]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
10783c0309e985fea8d839427b8d346cd4ef60e6
[wxWidgets.git] / wxPython / src / mac / _core.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5 import new
6 new_instancemethod = new.instancemethod
7 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
8 if (name == "thisown"): return self.this.own(value)
9 if (name == "this"):
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20 def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23 def _swig_getattr(self,class_type,name):
24 if (name == "thisown"): return self.this.own()
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
29 def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
34 import types
35 try:
36 _object = types.ObjectType
37 _newclass = 1
38 except AttributeError:
39 class _object : pass
40 _newclass = 0
41 del types
42
43
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
54 #// Give a reference to the dictionary of this module to the C++ extension
55 #// code.
56 _core_._wxPySetDictionary(vars())
57
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
59 #// be used here.
60 import sys as _sys
61 wx = _sys.modules[__name__]
62
63
64 #----------------------------------------------------------------------------
65
66 def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81 #----------------------------------------------------------------------------
82
83 NOT_FOUND = _core_.NOT_FOUND
84 VSCROLL = _core_.VSCROLL
85 HSCROLL = _core_.HSCROLL
86 CAPTION = _core_.CAPTION
87 DOUBLE_BORDER = _core_.DOUBLE_BORDER
88 SUNKEN_BORDER = _core_.SUNKEN_BORDER
89 RAISED_BORDER = _core_.RAISED_BORDER
90 BORDER = _core_.BORDER
91 SIMPLE_BORDER = _core_.SIMPLE_BORDER
92 STATIC_BORDER = _core_.STATIC_BORDER
93 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94 NO_BORDER = _core_.NO_BORDER
95 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98 WANTS_CHARS = _core_.WANTS_CHARS
99 POPUP_WINDOW = _core_.POPUP_WINDOW
100 CENTER_FRAME = _core_.CENTER_FRAME
101 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103 CLIP_CHILDREN = _core_.CLIP_CHILDREN
104 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107 RETAINED = _core_.RETAINED
108 BACKINGSTORE = _core_.BACKINGSTORE
109 COLOURED = _core_.COLOURED
110 FIXED_LENGTH = _core_.FIXED_LENGTH
111 LB_NEEDED_SB = _core_.LB_NEEDED_SB
112 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113 LB_SORT = _core_.LB_SORT
114 LB_SINGLE = _core_.LB_SINGLE
115 LB_MULTIPLE = _core_.LB_MULTIPLE
116 LB_EXTENDED = _core_.LB_EXTENDED
117 LB_OWNERDRAW = _core_.LB_OWNERDRAW
118 LB_HSCROLL = _core_.LB_HSCROLL
119 PROCESS_ENTER = _core_.PROCESS_ENTER
120 PASSWORD = _core_.PASSWORD
121 CB_SIMPLE = _core_.CB_SIMPLE
122 CB_DROPDOWN = _core_.CB_DROPDOWN
123 CB_SORT = _core_.CB_SORT
124 CB_READONLY = _core_.CB_READONLY
125 RA_HORIZONTAL = _core_.RA_HORIZONTAL
126 RA_VERTICAL = _core_.RA_VERTICAL
127 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
129 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
130 RB_GROUP = _core_.RB_GROUP
131 RB_SINGLE = _core_.RB_SINGLE
132 SB_HORIZONTAL = _core_.SB_HORIZONTAL
133 SB_VERTICAL = _core_.SB_VERTICAL
134 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
135 ST_SIZEGRIP = _core_.ST_SIZEGRIP
136 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
137 ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138 ST_DOTS_END = _core_.ST_DOTS_END
139 FLOOD_SURFACE = _core_.FLOOD_SURFACE
140 FLOOD_BORDER = _core_.FLOOD_BORDER
141 ODDEVEN_RULE = _core_.ODDEVEN_RULE
142 WINDING_RULE = _core_.WINDING_RULE
143 TOOL_TOP = _core_.TOOL_TOP
144 TOOL_BOTTOM = _core_.TOOL_BOTTOM
145 TOOL_LEFT = _core_.TOOL_LEFT
146 TOOL_RIGHT = _core_.TOOL_RIGHT
147 OK = _core_.OK
148 YES_NO = _core_.YES_NO
149 CANCEL = _core_.CANCEL
150 YES = _core_.YES
151 NO = _core_.NO
152 NO_DEFAULT = _core_.NO_DEFAULT
153 YES_DEFAULT = _core_.YES_DEFAULT
154 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155 ICON_HAND = _core_.ICON_HAND
156 ICON_QUESTION = _core_.ICON_QUESTION
157 ICON_INFORMATION = _core_.ICON_INFORMATION
158 ICON_STOP = _core_.ICON_STOP
159 ICON_ASTERISK = _core_.ICON_ASTERISK
160 ICON_MASK = _core_.ICON_MASK
161 ICON_WARNING = _core_.ICON_WARNING
162 ICON_ERROR = _core_.ICON_ERROR
163 FORWARD = _core_.FORWARD
164 BACKWARD = _core_.BACKWARD
165 RESET = _core_.RESET
166 HELP = _core_.HELP
167 MORE = _core_.MORE
168 SETUP = _core_.SETUP
169 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171 SIZE_AUTO = _core_.SIZE_AUTO
172 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
174 SIZE_FORCE = _core_.SIZE_FORCE
175 PORTRAIT = _core_.PORTRAIT
176 LANDSCAPE = _core_.LANDSCAPE
177 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181 ID_ANY = _core_.ID_ANY
182 ID_SEPARATOR = _core_.ID_SEPARATOR
183 ID_NONE = _core_.ID_NONE
184 ID_LOWEST = _core_.ID_LOWEST
185 ID_OPEN = _core_.ID_OPEN
186 ID_CLOSE = _core_.ID_CLOSE
187 ID_NEW = _core_.ID_NEW
188 ID_SAVE = _core_.ID_SAVE
189 ID_SAVEAS = _core_.ID_SAVEAS
190 ID_REVERT = _core_.ID_REVERT
191 ID_EXIT = _core_.ID_EXIT
192 ID_UNDO = _core_.ID_UNDO
193 ID_REDO = _core_.ID_REDO
194 ID_HELP = _core_.ID_HELP
195 ID_PRINT = _core_.ID_PRINT
196 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
197 ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
198 ID_PREVIEW = _core_.ID_PREVIEW
199 ID_ABOUT = _core_.ID_ABOUT
200 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
201 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
202 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
203 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
204 ID_HELP_INDEX = _core_.ID_HELP_INDEX
205 ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
206 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207 ID_PREFERENCES = _core_.ID_PREFERENCES
208 ID_CUT = _core_.ID_CUT
209 ID_COPY = _core_.ID_COPY
210 ID_PASTE = _core_.ID_PASTE
211 ID_CLEAR = _core_.ID_CLEAR
212 ID_FIND = _core_.ID_FIND
213 ID_DUPLICATE = _core_.ID_DUPLICATE
214 ID_SELECTALL = _core_.ID_SELECTALL
215 ID_DELETE = _core_.ID_DELETE
216 ID_REPLACE = _core_.ID_REPLACE
217 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
218 ID_PROPERTIES = _core_.ID_PROPERTIES
219 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
220 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
221 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
222 ID_VIEW_LIST = _core_.ID_VIEW_LIST
223 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
224 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
225 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
226 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
227 ID_FILE1 = _core_.ID_FILE1
228 ID_FILE2 = _core_.ID_FILE2
229 ID_FILE3 = _core_.ID_FILE3
230 ID_FILE4 = _core_.ID_FILE4
231 ID_FILE5 = _core_.ID_FILE5
232 ID_FILE6 = _core_.ID_FILE6
233 ID_FILE7 = _core_.ID_FILE7
234 ID_FILE8 = _core_.ID_FILE8
235 ID_FILE9 = _core_.ID_FILE9
236 ID_OK = _core_.ID_OK
237 ID_CANCEL = _core_.ID_CANCEL
238 ID_APPLY = _core_.ID_APPLY
239 ID_YES = _core_.ID_YES
240 ID_NO = _core_.ID_NO
241 ID_STATIC = _core_.ID_STATIC
242 ID_FORWARD = _core_.ID_FORWARD
243 ID_BACKWARD = _core_.ID_BACKWARD
244 ID_DEFAULT = _core_.ID_DEFAULT
245 ID_MORE = _core_.ID_MORE
246 ID_SETUP = _core_.ID_SETUP
247 ID_RESET = _core_.ID_RESET
248 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
249 ID_YESTOALL = _core_.ID_YESTOALL
250 ID_NOTOALL = _core_.ID_NOTOALL
251 ID_ABORT = _core_.ID_ABORT
252 ID_RETRY = _core_.ID_RETRY
253 ID_IGNORE = _core_.ID_IGNORE
254 ID_ADD = _core_.ID_ADD
255 ID_REMOVE = _core_.ID_REMOVE
256 ID_UP = _core_.ID_UP
257 ID_DOWN = _core_.ID_DOWN
258 ID_HOME = _core_.ID_HOME
259 ID_REFRESH = _core_.ID_REFRESH
260 ID_STOP = _core_.ID_STOP
261 ID_INDEX = _core_.ID_INDEX
262 ID_BOLD = _core_.ID_BOLD
263 ID_ITALIC = _core_.ID_ITALIC
264 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
265 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
266 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
267 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
268 ID_UNDERLINE = _core_.ID_UNDERLINE
269 ID_INDENT = _core_.ID_INDENT
270 ID_UNINDENT = _core_.ID_UNINDENT
271 ID_ZOOM_100 = _core_.ID_ZOOM_100
272 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
273 ID_ZOOM_IN = _core_.ID_ZOOM_IN
274 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
275 ID_UNDELETE = _core_.ID_UNDELETE
276 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
277 ID_HIGHEST = _core_.ID_HIGHEST
278 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
279 PD_APP_MODAL = _core_.PD_APP_MODAL
280 PD_CAN_ABORT = _core_.PD_CAN_ABORT
281 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
282 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
283 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
284 PD_SMOOTH = _core_.PD_SMOOTH
285 PD_CAN_SKIP = _core_.PD_CAN_SKIP
286 MENU_TEAROFF = _core_.MENU_TEAROFF
287 MB_DOCKABLE = _core_.MB_DOCKABLE
288 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
289 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
290 LI_HORIZONTAL = _core_.LI_HORIZONTAL
291 LI_VERTICAL = _core_.LI_VERTICAL
292 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
293 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
294 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
295 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
296 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
297 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
298 MM_TEXT = _core_.MM_TEXT
299 MM_LOMETRIC = _core_.MM_LOMETRIC
300 MM_HIMETRIC = _core_.MM_HIMETRIC
301 MM_LOENGLISH = _core_.MM_LOENGLISH
302 MM_HIENGLISH = _core_.MM_HIENGLISH
303 MM_TWIPS = _core_.MM_TWIPS
304 MM_ISOTROPIC = _core_.MM_ISOTROPIC
305 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
306 MM_POINTS = _core_.MM_POINTS
307 MM_METRIC = _core_.MM_METRIC
308 CENTRE = _core_.CENTRE
309 CENTER = _core_.CENTER
310 HORIZONTAL = _core_.HORIZONTAL
311 VERTICAL = _core_.VERTICAL
312 BOTH = _core_.BOTH
313 LEFT = _core_.LEFT
314 RIGHT = _core_.RIGHT
315 UP = _core_.UP
316 DOWN = _core_.DOWN
317 TOP = _core_.TOP
318 BOTTOM = _core_.BOTTOM
319 NORTH = _core_.NORTH
320 SOUTH = _core_.SOUTH
321 WEST = _core_.WEST
322 EAST = _core_.EAST
323 ALL = _core_.ALL
324 ALIGN_NOT = _core_.ALIGN_NOT
325 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
326 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
327 ALIGN_LEFT = _core_.ALIGN_LEFT
328 ALIGN_TOP = _core_.ALIGN_TOP
329 ALIGN_RIGHT = _core_.ALIGN_RIGHT
330 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
331 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
332 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
333 ALIGN_CENTER = _core_.ALIGN_CENTER
334 ALIGN_CENTRE = _core_.ALIGN_CENTRE
335 ALIGN_MASK = _core_.ALIGN_MASK
336 STRETCH_NOT = _core_.STRETCH_NOT
337 SHRINK = _core_.SHRINK
338 GROW = _core_.GROW
339 EXPAND = _core_.EXPAND
340 SHAPED = _core_.SHAPED
341 FIXED_MINSIZE = _core_.FIXED_MINSIZE
342 TILE = _core_.TILE
343 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
344 BORDER_DEFAULT = _core_.BORDER_DEFAULT
345 BORDER_NONE = _core_.BORDER_NONE
346 BORDER_STATIC = _core_.BORDER_STATIC
347 BORDER_SIMPLE = _core_.BORDER_SIMPLE
348 BORDER_RAISED = _core_.BORDER_RAISED
349 BORDER_SUNKEN = _core_.BORDER_SUNKEN
350 BORDER_DOUBLE = _core_.BORDER_DOUBLE
351 BORDER_MASK = _core_.BORDER_MASK
352 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
353 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
354 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
355 DEFAULT = _core_.DEFAULT
356 DECORATIVE = _core_.DECORATIVE
357 ROMAN = _core_.ROMAN
358 SCRIPT = _core_.SCRIPT
359 SWISS = _core_.SWISS
360 MODERN = _core_.MODERN
361 TELETYPE = _core_.TELETYPE
362 VARIABLE = _core_.VARIABLE
363 FIXED = _core_.FIXED
364 NORMAL = _core_.NORMAL
365 LIGHT = _core_.LIGHT
366 BOLD = _core_.BOLD
367 ITALIC = _core_.ITALIC
368 SLANT = _core_.SLANT
369 SOLID = _core_.SOLID
370 DOT = _core_.DOT
371 LONG_DASH = _core_.LONG_DASH
372 SHORT_DASH = _core_.SHORT_DASH
373 DOT_DASH = _core_.DOT_DASH
374 USER_DASH = _core_.USER_DASH
375 TRANSPARENT = _core_.TRANSPARENT
376 STIPPLE = _core_.STIPPLE
377 STIPPLE_MASK = _core_.STIPPLE_MASK
378 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
379 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
380 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
381 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
382 CROSS_HATCH = _core_.CROSS_HATCH
383 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
384 VERTICAL_HATCH = _core_.VERTICAL_HATCH
385 JOIN_BEVEL = _core_.JOIN_BEVEL
386 JOIN_MITER = _core_.JOIN_MITER
387 JOIN_ROUND = _core_.JOIN_ROUND
388 CAP_ROUND = _core_.CAP_ROUND
389 CAP_PROJECTING = _core_.CAP_PROJECTING
390 CAP_BUTT = _core_.CAP_BUTT
391 CLEAR = _core_.CLEAR
392 XOR = _core_.XOR
393 INVERT = _core_.INVERT
394 OR_REVERSE = _core_.OR_REVERSE
395 AND_REVERSE = _core_.AND_REVERSE
396 COPY = _core_.COPY
397 AND = _core_.AND
398 AND_INVERT = _core_.AND_INVERT
399 NO_OP = _core_.NO_OP
400 NOR = _core_.NOR
401 EQUIV = _core_.EQUIV
402 SRC_INVERT = _core_.SRC_INVERT
403 OR_INVERT = _core_.OR_INVERT
404 NAND = _core_.NAND
405 OR = _core_.OR
406 SET = _core_.SET
407 WXK_BACK = _core_.WXK_BACK
408 WXK_TAB = _core_.WXK_TAB
409 WXK_RETURN = _core_.WXK_RETURN
410 WXK_ESCAPE = _core_.WXK_ESCAPE
411 WXK_SPACE = _core_.WXK_SPACE
412 WXK_DELETE = _core_.WXK_DELETE
413 WXK_START = _core_.WXK_START
414 WXK_LBUTTON = _core_.WXK_LBUTTON
415 WXK_RBUTTON = _core_.WXK_RBUTTON
416 WXK_CANCEL = _core_.WXK_CANCEL
417 WXK_MBUTTON = _core_.WXK_MBUTTON
418 WXK_CLEAR = _core_.WXK_CLEAR
419 WXK_SHIFT = _core_.WXK_SHIFT
420 WXK_ALT = _core_.WXK_ALT
421 WXK_CONTROL = _core_.WXK_CONTROL
422 WXK_MENU = _core_.WXK_MENU
423 WXK_PAUSE = _core_.WXK_PAUSE
424 WXK_CAPITAL = _core_.WXK_CAPITAL
425 WXK_PRIOR = _core_.WXK_PRIOR
426 WXK_NEXT = _core_.WXK_NEXT
427 WXK_END = _core_.WXK_END
428 WXK_HOME = _core_.WXK_HOME
429 WXK_LEFT = _core_.WXK_LEFT
430 WXK_UP = _core_.WXK_UP
431 WXK_RIGHT = _core_.WXK_RIGHT
432 WXK_DOWN = _core_.WXK_DOWN
433 WXK_SELECT = _core_.WXK_SELECT
434 WXK_PRINT = _core_.WXK_PRINT
435 WXK_EXECUTE = _core_.WXK_EXECUTE
436 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
437 WXK_INSERT = _core_.WXK_INSERT
438 WXK_HELP = _core_.WXK_HELP
439 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
440 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
441 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
442 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
443 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
444 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
445 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
446 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
447 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
448 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
449 WXK_MULTIPLY = _core_.WXK_MULTIPLY
450 WXK_ADD = _core_.WXK_ADD
451 WXK_SEPARATOR = _core_.WXK_SEPARATOR
452 WXK_SUBTRACT = _core_.WXK_SUBTRACT
453 WXK_DECIMAL = _core_.WXK_DECIMAL
454 WXK_DIVIDE = _core_.WXK_DIVIDE
455 WXK_F1 = _core_.WXK_F1
456 WXK_F2 = _core_.WXK_F2
457 WXK_F3 = _core_.WXK_F3
458 WXK_F4 = _core_.WXK_F4
459 WXK_F5 = _core_.WXK_F5
460 WXK_F6 = _core_.WXK_F6
461 WXK_F7 = _core_.WXK_F7
462 WXK_F8 = _core_.WXK_F8
463 WXK_F9 = _core_.WXK_F9
464 WXK_F10 = _core_.WXK_F10
465 WXK_F11 = _core_.WXK_F11
466 WXK_F12 = _core_.WXK_F12
467 WXK_F13 = _core_.WXK_F13
468 WXK_F14 = _core_.WXK_F14
469 WXK_F15 = _core_.WXK_F15
470 WXK_F16 = _core_.WXK_F16
471 WXK_F17 = _core_.WXK_F17
472 WXK_F18 = _core_.WXK_F18
473 WXK_F19 = _core_.WXK_F19
474 WXK_F20 = _core_.WXK_F20
475 WXK_F21 = _core_.WXK_F21
476 WXK_F22 = _core_.WXK_F22
477 WXK_F23 = _core_.WXK_F23
478 WXK_F24 = _core_.WXK_F24
479 WXK_NUMLOCK = _core_.WXK_NUMLOCK
480 WXK_SCROLL = _core_.WXK_SCROLL
481 WXK_PAGEUP = _core_.WXK_PAGEUP
482 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
483 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
484 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
485 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
486 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
487 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
488 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
489 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
490 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
491 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
492 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
493 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
494 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
495 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
496 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
497 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
498 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
499 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
500 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
501 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
502 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
503 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
504 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
505 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
506 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
507 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
508 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
509 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
510 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
511 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
512 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
513 WXK_COMMAND = _core_.WXK_COMMAND
514 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
515 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
516 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
517 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
518 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
519 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
520 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
521 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
522 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
523 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
524 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
525 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
526 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
527 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
528 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
529 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
530 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
531 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
532 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
533 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
534 PAPER_NONE = _core_.PAPER_NONE
535 PAPER_LETTER = _core_.PAPER_LETTER
536 PAPER_LEGAL = _core_.PAPER_LEGAL
537 PAPER_A4 = _core_.PAPER_A4
538 PAPER_CSHEET = _core_.PAPER_CSHEET
539 PAPER_DSHEET = _core_.PAPER_DSHEET
540 PAPER_ESHEET = _core_.PAPER_ESHEET
541 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
542 PAPER_TABLOID = _core_.PAPER_TABLOID
543 PAPER_LEDGER = _core_.PAPER_LEDGER
544 PAPER_STATEMENT = _core_.PAPER_STATEMENT
545 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
546 PAPER_A3 = _core_.PAPER_A3
547 PAPER_A4SMALL = _core_.PAPER_A4SMALL
548 PAPER_A5 = _core_.PAPER_A5
549 PAPER_B4 = _core_.PAPER_B4
550 PAPER_B5 = _core_.PAPER_B5
551 PAPER_FOLIO = _core_.PAPER_FOLIO
552 PAPER_QUARTO = _core_.PAPER_QUARTO
553 PAPER_10X14 = _core_.PAPER_10X14
554 PAPER_11X17 = _core_.PAPER_11X17
555 PAPER_NOTE = _core_.PAPER_NOTE
556 PAPER_ENV_9 = _core_.PAPER_ENV_9
557 PAPER_ENV_10 = _core_.PAPER_ENV_10
558 PAPER_ENV_11 = _core_.PAPER_ENV_11
559 PAPER_ENV_12 = _core_.PAPER_ENV_12
560 PAPER_ENV_14 = _core_.PAPER_ENV_14
561 PAPER_ENV_DL = _core_.PAPER_ENV_DL
562 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
563 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
564 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
565 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
566 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
567 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
568 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
569 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
570 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
571 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
572 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
573 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
574 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
575 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
576 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
577 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
578 PAPER_9X11 = _core_.PAPER_9X11
579 PAPER_10X11 = _core_.PAPER_10X11
580 PAPER_15X11 = _core_.PAPER_15X11
581 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
582 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
583 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
584 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
585 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
586 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
587 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
588 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
589 PAPER_A_PLUS = _core_.PAPER_A_PLUS
590 PAPER_B_PLUS = _core_.PAPER_B_PLUS
591 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
592 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
593 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
594 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
595 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
596 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
597 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
598 PAPER_A2 = _core_.PAPER_A2
599 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
600 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
601 PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
602 PAPER_A6 = _core_.PAPER_A6
603 PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
604 PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
605 PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
606 PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
607 PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
608 PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
609 PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
610 PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
611 PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
612 PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
613 PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
614 PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
615 PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
616 PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
617 PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
618 PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
619 PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
620 PAPER_B6_JIS = _core_.PAPER_B6_JIS
621 PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
622 PAPER_12X11 = _core_.PAPER_12X11
623 PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
624 PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
625 PAPER_P16K = _core_.PAPER_P16K
626 PAPER_P32K = _core_.PAPER_P32K
627 PAPER_P32KBIG = _core_.PAPER_P32KBIG
628 PAPER_PENV_1 = _core_.PAPER_PENV_1
629 PAPER_PENV_2 = _core_.PAPER_PENV_2
630 PAPER_PENV_3 = _core_.PAPER_PENV_3
631 PAPER_PENV_4 = _core_.PAPER_PENV_4
632 PAPER_PENV_5 = _core_.PAPER_PENV_5
633 PAPER_PENV_6 = _core_.PAPER_PENV_6
634 PAPER_PENV_7 = _core_.PAPER_PENV_7
635 PAPER_PENV_8 = _core_.PAPER_PENV_8
636 PAPER_PENV_9 = _core_.PAPER_PENV_9
637 PAPER_PENV_10 = _core_.PAPER_PENV_10
638 PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
639 PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
640 PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
641 PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
642 PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
643 PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
644 PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
645 PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
646 PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
647 PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
648 PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
649 PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
650 PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
651 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
652 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
653 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
654 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
655 ITEM_NORMAL = _core_.ITEM_NORMAL
656 ITEM_CHECK = _core_.ITEM_CHECK
657 ITEM_RADIO = _core_.ITEM_RADIO
658 ITEM_MAX = _core_.ITEM_MAX
659 HT_NOWHERE = _core_.HT_NOWHERE
660 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
661 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
662 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
663 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
664 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
665 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
666 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
667 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
668 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
669 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
670 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
671 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
672 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
673 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
674 HT_MAX = _core_.HT_MAX
675 MOD_NONE = _core_.MOD_NONE
676 MOD_ALT = _core_.MOD_ALT
677 MOD_CONTROL = _core_.MOD_CONTROL
678 MOD_ALTGR = _core_.MOD_ALTGR
679 MOD_SHIFT = _core_.MOD_SHIFT
680 MOD_META = _core_.MOD_META
681 MOD_WIN = _core_.MOD_WIN
682 MOD_CMD = _core_.MOD_CMD
683 MOD_ALL = _core_.MOD_ALL
684 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
685 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
686 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
687 #---------------------------------------------------------------------------
688
689 class Object(object):
690 """
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
693 """
694 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
695 def __init__(self): raise AttributeError, "No constructor defined"
696 __repr__ = _swig_repr
697 def GetClassName(*args, **kwargs):
698 """
699 GetClassName(self) -> String
700
701 Returns the class name of the C++ class using wxRTTI.
702 """
703 return _core_.Object_GetClassName(*args, **kwargs)
704
705 def Destroy(*args, **kwargs):
706 """
707 Destroy(self)
708
709 Deletes the C++ object this Python object is a proxy for.
710 """
711 val = _core_.Object_Destroy(*args, **kwargs)
712 args[0].thisown = 0
713 return val
714
715 _core_.Object_swigregister(Object)
716 _wxPySetDictionary = _core_._wxPySetDictionary
717 cvar = _core_.cvar
718 EmptyString = cvar.EmptyString
719
720 #---------------------------------------------------------------------------
721
722 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
723 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
724 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
725 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
726 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
727 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
728 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
729 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
730 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
731 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
732 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
733 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
734 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
735 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
736 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
737 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
738 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
739 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
740 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
741 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
742 CURSOR_NONE = _core_.CURSOR_NONE
743 CURSOR_ARROW = _core_.CURSOR_ARROW
744 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
745 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
746 CURSOR_CHAR = _core_.CURSOR_CHAR
747 CURSOR_CROSS = _core_.CURSOR_CROSS
748 CURSOR_HAND = _core_.CURSOR_HAND
749 CURSOR_IBEAM = _core_.CURSOR_IBEAM
750 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
751 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
752 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
753 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
754 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
755 CURSOR_PENCIL = _core_.CURSOR_PENCIL
756 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
757 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
758 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
759 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
760 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
761 CURSOR_SIZENS = _core_.CURSOR_SIZENS
762 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
763 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
764 CURSOR_SIZING = _core_.CURSOR_SIZING
765 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
766 CURSOR_WAIT = _core_.CURSOR_WAIT
767 CURSOR_WATCH = _core_.CURSOR_WATCH
768 CURSOR_BLANK = _core_.CURSOR_BLANK
769 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
770 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
771 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
772 CURSOR_MAX = _core_.CURSOR_MAX
773 #---------------------------------------------------------------------------
774
775 class Size(object):
776 """
777 wx.Size is a useful data structure used to represent the size of
778 something. It simply contains integer width and height
779 properties. In most places in wxPython where a wx.Size is
780 expected a (width, height) tuple can be used instead.
781 """
782 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
783 __repr__ = _swig_repr
784 width = property(_core_.Size_width_get, _core_.Size_width_set)
785 height = property(_core_.Size_height_get, _core_.Size_height_set)
786 x = width; y = height
787 def __init__(self, *args, **kwargs):
788 """
789 __init__(self, int w=0, int h=0) -> Size
790
791 Creates a size object.
792 """
793 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
794 __swig_destroy__ = _core_.delete_Size
795 __del__ = lambda self : None;
796 def __eq__(*args, **kwargs):
797 """
798 __eq__(self, PyObject other) -> bool
799
800 Test for equality of wx.Size objects.
801 """
802 return _core_.Size___eq__(*args, **kwargs)
803
804 def __ne__(*args, **kwargs):
805 """
806 __ne__(self, PyObject other) -> bool
807
808 Test for inequality of wx.Size objects.
809 """
810 return _core_.Size___ne__(*args, **kwargs)
811
812 def __add__(*args, **kwargs):
813 """
814 __add__(self, Size sz) -> Size
815
816 Add sz's proprties to this and return the result.
817 """
818 return _core_.Size___add__(*args, **kwargs)
819
820 def __sub__(*args, **kwargs):
821 """
822 __sub__(self, Size sz) -> Size
823
824 Subtract sz's properties from this and return the result.
825 """
826 return _core_.Size___sub__(*args, **kwargs)
827
828 def IncTo(*args, **kwargs):
829 """
830 IncTo(self, Size sz)
831
832 Increments this object so that both of its dimensions are not less
833 than the corresponding dimensions of the size.
834 """
835 return _core_.Size_IncTo(*args, **kwargs)
836
837 def DecTo(*args, **kwargs):
838 """
839 DecTo(self, Size sz)
840
841 Decrements this object so that both of its dimensions are not greater
842 than the corresponding dimensions of the size.
843 """
844 return _core_.Size_DecTo(*args, **kwargs)
845
846 def Scale(*args, **kwargs):
847 """
848 Scale(self, float xscale, float yscale)
849
850 Scales the dimensions of this object by the given factors.
851 """
852 return _core_.Size_Scale(*args, **kwargs)
853
854 def Set(*args, **kwargs):
855 """
856 Set(self, int w, int h)
857
858 Set both width and height.
859 """
860 return _core_.Size_Set(*args, **kwargs)
861
862 def SetWidth(*args, **kwargs):
863 """SetWidth(self, int w)"""
864 return _core_.Size_SetWidth(*args, **kwargs)
865
866 def SetHeight(*args, **kwargs):
867 """SetHeight(self, int h)"""
868 return _core_.Size_SetHeight(*args, **kwargs)
869
870 def GetWidth(*args, **kwargs):
871 """GetWidth(self) -> int"""
872 return _core_.Size_GetWidth(*args, **kwargs)
873
874 def GetHeight(*args, **kwargs):
875 """GetHeight(self) -> int"""
876 return _core_.Size_GetHeight(*args, **kwargs)
877
878 def IsFullySpecified(*args, **kwargs):
879 """
880 IsFullySpecified(self) -> bool
881
882 Returns True if both components of the size are non-default values.
883 """
884 return _core_.Size_IsFullySpecified(*args, **kwargs)
885
886 def SetDefaults(*args, **kwargs):
887 """
888 SetDefaults(self, Size size)
889
890 Combine this size with the other one replacing the default components
891 of this object (i.e. equal to -1) with those of the other.
892 """
893 return _core_.Size_SetDefaults(*args, **kwargs)
894
895 def Get(*args, **kwargs):
896 """
897 Get() -> (width,height)
898
899 Returns the width and height properties as a tuple.
900 """
901 return _core_.Size_Get(*args, **kwargs)
902
903 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
904 def __str__(self): return str(self.Get())
905 def __repr__(self): return 'wx.Size'+str(self.Get())
906 def __len__(self): return len(self.Get())
907 def __getitem__(self, index): return self.Get()[index]
908 def __setitem__(self, index, val):
909 if index == 0: self.width = val
910 elif index == 1: self.height = val
911 else: raise IndexError
912 def __nonzero__(self): return self.Get() != (0,0)
913 __safe_for_unpickling__ = True
914 def __reduce__(self): return (wx.Size, self.Get())
915
916 _core_.Size_swigregister(Size)
917
918 #---------------------------------------------------------------------------
919
920 class RealPoint(object):
921 """
922 A data structure for representing a point or position with floating
923 point x and y properties. In wxPython most places that expect a
924 wx.RealPoint can also accept a (x,y) tuple.
925 """
926 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
927 __repr__ = _swig_repr
928 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
929 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
930 def __init__(self, *args, **kwargs):
931 """
932 __init__(self, double x=0.0, double y=0.0) -> RealPoint
933
934 Create a wx.RealPoint object
935 """
936 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
937 __swig_destroy__ = _core_.delete_RealPoint
938 __del__ = lambda self : None;
939 def __eq__(*args, **kwargs):
940 """
941 __eq__(self, PyObject other) -> bool
942
943 Test for equality of wx.RealPoint objects.
944 """
945 return _core_.RealPoint___eq__(*args, **kwargs)
946
947 def __ne__(*args, **kwargs):
948 """
949 __ne__(self, PyObject other) -> bool
950
951 Test for inequality of wx.RealPoint objects.
952 """
953 return _core_.RealPoint___ne__(*args, **kwargs)
954
955 def __add__(*args, **kwargs):
956 """
957 __add__(self, RealPoint pt) -> RealPoint
958
959 Add pt's proprties to this and return the result.
960 """
961 return _core_.RealPoint___add__(*args, **kwargs)
962
963 def __sub__(*args, **kwargs):
964 """
965 __sub__(self, RealPoint pt) -> RealPoint
966
967 Subtract pt's proprties from this and return the result
968 """
969 return _core_.RealPoint___sub__(*args, **kwargs)
970
971 def Set(*args, **kwargs):
972 """
973 Set(self, double x, double y)
974
975 Set both the x and y properties
976 """
977 return _core_.RealPoint_Set(*args, **kwargs)
978
979 def Get(*args, **kwargs):
980 """
981 Get() -> (x,y)
982
983 Return the x and y properties as a tuple.
984 """
985 return _core_.RealPoint_Get(*args, **kwargs)
986
987 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
988 def __str__(self): return str(self.Get())
989 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
990 def __len__(self): return len(self.Get())
991 def __getitem__(self, index): return self.Get()[index]
992 def __setitem__(self, index, val):
993 if index == 0: self.x = val
994 elif index == 1: self.y = val
995 else: raise IndexError
996 def __nonzero__(self): return self.Get() != (0.0, 0.0)
997 __safe_for_unpickling__ = True
998 def __reduce__(self): return (wx.RealPoint, self.Get())
999
1000 _core_.RealPoint_swigregister(RealPoint)
1001
1002 #---------------------------------------------------------------------------
1003
1004 class Point(object):
1005 """
1006 A data structure for representing a point or position with integer x
1007 and y properties. Most places in wxPython that expect a wx.Point can
1008 also accept a (x,y) tuple.
1009 """
1010 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1011 __repr__ = _swig_repr
1012 x = property(_core_.Point_x_get, _core_.Point_x_set)
1013 y = property(_core_.Point_y_get, _core_.Point_y_set)
1014 def __init__(self, *args, **kwargs):
1015 """
1016 __init__(self, int x=0, int y=0) -> Point
1017
1018 Create a wx.Point object
1019 """
1020 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1021 __swig_destroy__ = _core_.delete_Point
1022 __del__ = lambda self : None;
1023 def __eq__(*args, **kwargs):
1024 """
1025 __eq__(self, PyObject other) -> bool
1026
1027 Test for equality of wx.Point objects.
1028 """
1029 return _core_.Point___eq__(*args, **kwargs)
1030
1031 def __ne__(*args, **kwargs):
1032 """
1033 __ne__(self, PyObject other) -> bool
1034
1035 Test for inequality of wx.Point objects.
1036 """
1037 return _core_.Point___ne__(*args, **kwargs)
1038
1039 def __add__(*args, **kwargs):
1040 """
1041 __add__(self, Point pt) -> Point
1042
1043 Add pt's proprties to this and return the result.
1044 """
1045 return _core_.Point___add__(*args, **kwargs)
1046
1047 def __sub__(*args, **kwargs):
1048 """
1049 __sub__(self, Point pt) -> Point
1050
1051 Subtract pt's proprties from this and return the result
1052 """
1053 return _core_.Point___sub__(*args, **kwargs)
1054
1055 def __iadd__(*args, **kwargs):
1056 """
1057 __iadd__(self, Point pt) -> Point
1058
1059 Add pt to this object.
1060 """
1061 return _core_.Point___iadd__(*args, **kwargs)
1062
1063 def __isub__(*args, **kwargs):
1064 """
1065 __isub__(self, Point pt) -> Point
1066
1067 Subtract pt from this object.
1068 """
1069 return _core_.Point___isub__(*args, **kwargs)
1070
1071 def Set(*args, **kwargs):
1072 """
1073 Set(self, long x, long y)
1074
1075 Set both the x and y properties
1076 """
1077 return _core_.Point_Set(*args, **kwargs)
1078
1079 def Get(*args, **kwargs):
1080 """
1081 Get() -> (x,y)
1082
1083 Return the x and y properties as a tuple.
1084 """
1085 return _core_.Point_Get(*args, **kwargs)
1086
1087 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1088 def __str__(self): return str(self.Get())
1089 def __repr__(self): return 'wx.Point'+str(self.Get())
1090 def __len__(self): return len(self.Get())
1091 def __getitem__(self, index): return self.Get()[index]
1092 def __setitem__(self, index, val):
1093 if index == 0: self.x = val
1094 elif index == 1: self.y = val
1095 else: raise IndexError
1096 def __nonzero__(self): return self.Get() != (0,0)
1097 __safe_for_unpickling__ = True
1098 def __reduce__(self): return (wx.Point, self.Get())
1099
1100 _core_.Point_swigregister(Point)
1101
1102 #---------------------------------------------------------------------------
1103
1104 class Rect(object):
1105 """
1106 A class for representing and manipulating rectangles. It has x, y,
1107 width and height properties. In wxPython most palces that expect a
1108 wx.Rect can also accept a (x,y,width,height) tuple.
1109 """
1110 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1111 __repr__ = _swig_repr
1112 def __init__(self, *args, **kwargs):
1113 """
1114 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1115
1116 Create a new Rect object.
1117 """
1118 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1119 __swig_destroy__ = _core_.delete_Rect
1120 __del__ = lambda self : None;
1121 def GetX(*args, **kwargs):
1122 """GetX(self) -> int"""
1123 return _core_.Rect_GetX(*args, **kwargs)
1124
1125 def SetX(*args, **kwargs):
1126 """SetX(self, int x)"""
1127 return _core_.Rect_SetX(*args, **kwargs)
1128
1129 def GetY(*args, **kwargs):
1130 """GetY(self) -> int"""
1131 return _core_.Rect_GetY(*args, **kwargs)
1132
1133 def SetY(*args, **kwargs):
1134 """SetY(self, int y)"""
1135 return _core_.Rect_SetY(*args, **kwargs)
1136
1137 def GetWidth(*args, **kwargs):
1138 """GetWidth(self) -> int"""
1139 return _core_.Rect_GetWidth(*args, **kwargs)
1140
1141 def SetWidth(*args, **kwargs):
1142 """SetWidth(self, int w)"""
1143 return _core_.Rect_SetWidth(*args, **kwargs)
1144
1145 def GetHeight(*args, **kwargs):
1146 """GetHeight(self) -> int"""
1147 return _core_.Rect_GetHeight(*args, **kwargs)
1148
1149 def SetHeight(*args, **kwargs):
1150 """SetHeight(self, int h)"""
1151 return _core_.Rect_SetHeight(*args, **kwargs)
1152
1153 def GetPosition(*args, **kwargs):
1154 """GetPosition(self) -> Point"""
1155 return _core_.Rect_GetPosition(*args, **kwargs)
1156
1157 def SetPosition(*args, **kwargs):
1158 """SetPosition(self, Point p)"""
1159 return _core_.Rect_SetPosition(*args, **kwargs)
1160
1161 def GetSize(*args, **kwargs):
1162 """GetSize(self) -> Size"""
1163 return _core_.Rect_GetSize(*args, **kwargs)
1164
1165 def SetSize(*args, **kwargs):
1166 """SetSize(self, Size s)"""
1167 return _core_.Rect_SetSize(*args, **kwargs)
1168
1169 def IsEmpty(*args, **kwargs):
1170 """IsEmpty(self) -> bool"""
1171 return _core_.Rect_IsEmpty(*args, **kwargs)
1172
1173 def GetTopLeft(*args, **kwargs):
1174 """GetTopLeft(self) -> Point"""
1175 return _core_.Rect_GetTopLeft(*args, **kwargs)
1176
1177 def SetTopLeft(*args, **kwargs):
1178 """SetTopLeft(self, Point p)"""
1179 return _core_.Rect_SetTopLeft(*args, **kwargs)
1180
1181 def GetBottomRight(*args, **kwargs):
1182 """GetBottomRight(self) -> Point"""
1183 return _core_.Rect_GetBottomRight(*args, **kwargs)
1184
1185 def SetBottomRight(*args, **kwargs):
1186 """SetBottomRight(self, Point p)"""
1187 return _core_.Rect_SetBottomRight(*args, **kwargs)
1188
1189 def GetLeft(*args, **kwargs):
1190 """GetLeft(self) -> int"""
1191 return _core_.Rect_GetLeft(*args, **kwargs)
1192
1193 def GetTop(*args, **kwargs):
1194 """GetTop(self) -> int"""
1195 return _core_.Rect_GetTop(*args, **kwargs)
1196
1197 def GetBottom(*args, **kwargs):
1198 """GetBottom(self) -> int"""
1199 return _core_.Rect_GetBottom(*args, **kwargs)
1200
1201 def GetRight(*args, **kwargs):
1202 """GetRight(self) -> int"""
1203 return _core_.Rect_GetRight(*args, **kwargs)
1204
1205 def SetLeft(*args, **kwargs):
1206 """SetLeft(self, int left)"""
1207 return _core_.Rect_SetLeft(*args, **kwargs)
1208
1209 def SetRight(*args, **kwargs):
1210 """SetRight(self, int right)"""
1211 return _core_.Rect_SetRight(*args, **kwargs)
1212
1213 def SetTop(*args, **kwargs):
1214 """SetTop(self, int top)"""
1215 return _core_.Rect_SetTop(*args, **kwargs)
1216
1217 def SetBottom(*args, **kwargs):
1218 """SetBottom(self, int bottom)"""
1219 return _core_.Rect_SetBottom(*args, **kwargs)
1220
1221 position = property(GetPosition, SetPosition)
1222 size = property(GetSize, SetSize)
1223 left = property(GetLeft, SetLeft)
1224 right = property(GetRight, SetRight)
1225 top = property(GetTop, SetTop)
1226 bottom = property(GetBottom, SetBottom)
1227
1228 def Inflate(*args, **kwargs):
1229 """
1230 Inflate(self, int dx, int dy) -> Rect
1231
1232 Increases the size of the rectangle.
1233
1234 The left border is moved farther left and the right border is moved
1235 farther right by ``dx``. The upper border is moved farther up and the
1236 bottom border is moved farther down by ``dy``. (Note the the width and
1237 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1238 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1239 opposite happens: the rectangle size decreases in the respective
1240 direction.
1241
1242 The change is made to the rectangle inplace, if instead you need a
1243 copy that is inflated, preserving the original then make the copy
1244 first::
1245
1246 copy = wx.Rect(*original)
1247 copy.Inflate(10,15)
1248
1249
1250 """
1251 return _core_.Rect_Inflate(*args, **kwargs)
1252
1253 def Deflate(*args, **kwargs):
1254 """
1255 Deflate(self, int dx, int dy) -> Rect
1256
1257 Decrease the rectangle size. This method is the opposite of `Inflate`
1258 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1259 `Inflate` for a full description.
1260 """
1261 return _core_.Rect_Deflate(*args, **kwargs)
1262
1263 def OffsetXY(*args, **kwargs):
1264 """
1265 OffsetXY(self, int dx, int dy)
1266
1267 Moves the rectangle by the specified offset. If dx is positive, the
1268 rectangle is moved to the right, if dy is positive, it is moved to the
1269 bottom, otherwise it is moved to the left or top respectively.
1270 """
1271 return _core_.Rect_OffsetXY(*args, **kwargs)
1272
1273 def Offset(*args, **kwargs):
1274 """
1275 Offset(self, Point pt)
1276
1277 Same as `OffsetXY` but uses dx,dy from Point
1278 """
1279 return _core_.Rect_Offset(*args, **kwargs)
1280
1281 def Intersect(*args, **kwargs):
1282 """
1283 Intersect(self, Rect rect) -> Rect
1284
1285 Returns the intersectsion of this rectangle and rect.
1286 """
1287 return _core_.Rect_Intersect(*args, **kwargs)
1288
1289 def Union(*args, **kwargs):
1290 """
1291 Union(self, Rect rect) -> Rect
1292
1293 Returns the union of this rectangle and rect.
1294 """
1295 return _core_.Rect_Union(*args, **kwargs)
1296
1297 def __add__(*args, **kwargs):
1298 """
1299 __add__(self, Rect rect) -> Rect
1300
1301 Add the properties of rect to this rectangle and return the result.
1302 """
1303 return _core_.Rect___add__(*args, **kwargs)
1304
1305 def __iadd__(*args, **kwargs):
1306 """
1307 __iadd__(self, Rect rect) -> Rect
1308
1309 Add the properties of rect to this rectangle, updating this rectangle.
1310 """
1311 return _core_.Rect___iadd__(*args, **kwargs)
1312
1313 def __eq__(*args, **kwargs):
1314 """
1315 __eq__(self, PyObject other) -> bool
1316
1317 Test for equality of wx.Rect objects.
1318 """
1319 return _core_.Rect___eq__(*args, **kwargs)
1320
1321 def __ne__(*args, **kwargs):
1322 """
1323 __ne__(self, PyObject other) -> bool
1324
1325 Test for inequality of wx.Rect objects.
1326 """
1327 return _core_.Rect___ne__(*args, **kwargs)
1328
1329 def InsideXY(*args, **kwargs):
1330 """
1331 InsideXY(self, int x, int y) -> bool
1332
1333 Return True if the point is (not strcitly) inside the rect.
1334 """
1335 return _core_.Rect_InsideXY(*args, **kwargs)
1336
1337 def Inside(*args, **kwargs):
1338 """
1339 Inside(self, Point pt) -> bool
1340
1341 Return True if the point is (not strcitly) inside the rect.
1342 """
1343 return _core_.Rect_Inside(*args, **kwargs)
1344
1345 def InsideRect(*args, **kwargs):
1346 """
1347 InsideRect(self, Rect rect) -> bool
1348
1349 Returns ``True`` if the given rectangle is completely inside this
1350 rectangle or touches its boundary.
1351 """
1352 return _core_.Rect_InsideRect(*args, **kwargs)
1353
1354 def Intersects(*args, **kwargs):
1355 """
1356 Intersects(self, Rect rect) -> bool
1357
1358 Returns True if the rectangles have a non empty intersection.
1359 """
1360 return _core_.Rect_Intersects(*args, **kwargs)
1361
1362 def CenterIn(*args, **kwargs):
1363 """
1364 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1365
1366 Center this rectangle within the one passed to the method, which is
1367 usually, but not necessarily, the larger one.
1368 """
1369 return _core_.Rect_CenterIn(*args, **kwargs)
1370
1371 CentreIn = CenterIn
1372 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1373 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1374 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1375 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1376 def Set(*args, **kwargs):
1377 """
1378 Set(self, int x=0, int y=0, int width=0, int height=0)
1379
1380 Set all rectangle properties.
1381 """
1382 return _core_.Rect_Set(*args, **kwargs)
1383
1384 def Get(*args, **kwargs):
1385 """
1386 Get() -> (x,y,width,height)
1387
1388 Return the rectangle properties as a tuple.
1389 """
1390 return _core_.Rect_Get(*args, **kwargs)
1391
1392 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1393 def __str__(self): return str(self.Get())
1394 def __repr__(self): return 'wx.Rect'+str(self.Get())
1395 def __len__(self): return len(self.Get())
1396 def __getitem__(self, index): return self.Get()[index]
1397 def __setitem__(self, index, val):
1398 if index == 0: self.x = val
1399 elif index == 1: self.y = val
1400 elif index == 2: self.width = val
1401 elif index == 3: self.height = val
1402 else: raise IndexError
1403 def __nonzero__(self): return self.Get() != (0,0,0,0)
1404 __safe_for_unpickling__ = True
1405 def __reduce__(self): return (wx.Rect, self.Get())
1406
1407 _core_.Rect_swigregister(Rect)
1408
1409 def RectPP(*args, **kwargs):
1410 """
1411 RectPP(Point topLeft, Point bottomRight) -> Rect
1412
1413 Create a new Rect object from Points representing two corners.
1414 """
1415 val = _core_.new_RectPP(*args, **kwargs)
1416 return val
1417
1418 def RectPS(*args, **kwargs):
1419 """
1420 RectPS(Point pos, Size size) -> Rect
1421
1422 Create a new Rect from a position and size.
1423 """
1424 val = _core_.new_RectPS(*args, **kwargs)
1425 return val
1426
1427 def RectS(*args, **kwargs):
1428 """
1429 RectS(Size size) -> Rect
1430
1431 Create a new Rect from a size only.
1432 """
1433 val = _core_.new_RectS(*args, **kwargs)
1434 return val
1435
1436
1437 def IntersectRect(*args, **kwargs):
1438 """
1439 IntersectRect(Rect r1, Rect r2) -> Rect
1440
1441 Calculate and return the intersection of r1 and r2.
1442 """
1443 return _core_.IntersectRect(*args, **kwargs)
1444 #---------------------------------------------------------------------------
1445
1446 class Point2D(object):
1447 """
1448 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1449 with floating point values.
1450 """
1451 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1452 __repr__ = _swig_repr
1453 def __init__(self, *args, **kwargs):
1454 """
1455 __init__(self, double x=0.0, double y=0.0) -> Point2D
1456
1457 Create a w.Point2D object.
1458 """
1459 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
1460 def GetFloor(*args, **kwargs):
1461 """
1462 GetFloor() -> (x,y)
1463
1464 Convert to integer
1465 """
1466 return _core_.Point2D_GetFloor(*args, **kwargs)
1467
1468 def GetRounded(*args, **kwargs):
1469 """
1470 GetRounded() -> (x,y)
1471
1472 Convert to integer
1473 """
1474 return _core_.Point2D_GetRounded(*args, **kwargs)
1475
1476 def GetVectorLength(*args, **kwargs):
1477 """GetVectorLength(self) -> double"""
1478 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1479
1480 def GetVectorAngle(*args, **kwargs):
1481 """GetVectorAngle(self) -> double"""
1482 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1483
1484 def SetVectorLength(*args, **kwargs):
1485 """SetVectorLength(self, double length)"""
1486 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1487
1488 def SetVectorAngle(*args, **kwargs):
1489 """SetVectorAngle(self, double degrees)"""
1490 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1491
1492 def SetPolarCoordinates(self, angle, length):
1493 self.SetVectorLength(length)
1494 self.SetVectorAngle(angle)
1495 def Normalize(self):
1496 self.SetVectorLength(1.0)
1497
1498 def GetDistance(*args, **kwargs):
1499 """GetDistance(self, Point2D pt) -> double"""
1500 return _core_.Point2D_GetDistance(*args, **kwargs)
1501
1502 def GetDistanceSquare(*args, **kwargs):
1503 """GetDistanceSquare(self, Point2D pt) -> double"""
1504 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1505
1506 def GetDotProduct(*args, **kwargs):
1507 """GetDotProduct(self, Point2D vec) -> double"""
1508 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1509
1510 def GetCrossProduct(*args, **kwargs):
1511 """GetCrossProduct(self, Point2D vec) -> double"""
1512 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1513
1514 def __neg__(*args, **kwargs):
1515 """
1516 __neg__(self) -> Point2D
1517
1518 the reflection of this point
1519 """
1520 return _core_.Point2D___neg__(*args, **kwargs)
1521
1522 def __iadd__(*args, **kwargs):
1523 """__iadd__(self, Point2D pt) -> Point2D"""
1524 return _core_.Point2D___iadd__(*args, **kwargs)
1525
1526 def __isub__(*args, **kwargs):
1527 """__isub__(self, Point2D pt) -> Point2D"""
1528 return _core_.Point2D___isub__(*args, **kwargs)
1529
1530 def __imul__(*args, **kwargs):
1531 """__imul__(self, Point2D pt) -> Point2D"""
1532 return _core_.Point2D___imul__(*args, **kwargs)
1533
1534 def __idiv__(*args, **kwargs):
1535 """__idiv__(self, Point2D pt) -> Point2D"""
1536 return _core_.Point2D___idiv__(*args, **kwargs)
1537
1538 def __eq__(*args, **kwargs):
1539 """
1540 __eq__(self, PyObject other) -> bool
1541
1542 Test for equality of wx.Point2D objects.
1543 """
1544 return _core_.Point2D___eq__(*args, **kwargs)
1545
1546 def __ne__(*args, **kwargs):
1547 """
1548 __ne__(self, PyObject other) -> bool
1549
1550 Test for inequality of wx.Point2D objects.
1551 """
1552 return _core_.Point2D___ne__(*args, **kwargs)
1553
1554 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1555 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1556 def Set(*args, **kwargs):
1557 """Set(self, double x=0, double y=0)"""
1558 return _core_.Point2D_Set(*args, **kwargs)
1559
1560 def Get(*args, **kwargs):
1561 """
1562 Get() -> (x,y)
1563
1564 Return x and y properties as a tuple.
1565 """
1566 return _core_.Point2D_Get(*args, **kwargs)
1567
1568 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1569 def __str__(self): return str(self.Get())
1570 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1571 def __len__(self): return len(self.Get())
1572 def __getitem__(self, index): return self.Get()[index]
1573 def __setitem__(self, index, val):
1574 if index == 0: self.x = val
1575 elif index == 1: self.y = val
1576 else: raise IndexError
1577 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1578 __safe_for_unpickling__ = True
1579 def __reduce__(self): return (wx.Point2D, self.Get())
1580
1581 _core_.Point2D_swigregister(Point2D)
1582
1583 def Point2DCopy(*args, **kwargs):
1584 """
1585 Point2DCopy(Point2D pt) -> Point2D
1586
1587 Create a w.Point2D object.
1588 """
1589 val = _core_.new_Point2DCopy(*args, **kwargs)
1590 return val
1591
1592 def Point2DFromPoint(*args, **kwargs):
1593 """
1594 Point2DFromPoint(Point pt) -> Point2D
1595
1596 Create a w.Point2D object.
1597 """
1598 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1599 return val
1600
1601 #---------------------------------------------------------------------------
1602
1603 FromStart = _core_.FromStart
1604 FromCurrent = _core_.FromCurrent
1605 FromEnd = _core_.FromEnd
1606 class InputStream(object):
1607 """Proxy of C++ InputStream class"""
1608 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1609 __repr__ = _swig_repr
1610 def __init__(self, *args, **kwargs):
1611 """__init__(self, PyObject p) -> InputStream"""
1612 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1613 __swig_destroy__ = _core_.delete_InputStream
1614 __del__ = lambda self : None;
1615 def close(*args, **kwargs):
1616 """close(self)"""
1617 return _core_.InputStream_close(*args, **kwargs)
1618
1619 def flush(*args, **kwargs):
1620 """flush(self)"""
1621 return _core_.InputStream_flush(*args, **kwargs)
1622
1623 def eof(*args, **kwargs):
1624 """eof(self) -> bool"""
1625 return _core_.InputStream_eof(*args, **kwargs)
1626
1627 def read(*args, **kwargs):
1628 """read(self, int size=-1) -> PyObject"""
1629 return _core_.InputStream_read(*args, **kwargs)
1630
1631 def readline(*args, **kwargs):
1632 """readline(self, int size=-1) -> PyObject"""
1633 return _core_.InputStream_readline(*args, **kwargs)
1634
1635 def readlines(*args, **kwargs):
1636 """readlines(self, int sizehint=-1) -> PyObject"""
1637 return _core_.InputStream_readlines(*args, **kwargs)
1638
1639 def seek(*args, **kwargs):
1640 """seek(self, int offset, int whence=0)"""
1641 return _core_.InputStream_seek(*args, **kwargs)
1642
1643 def tell(*args, **kwargs):
1644 """tell(self) -> int"""
1645 return _core_.InputStream_tell(*args, **kwargs)
1646
1647 def Peek(*args, **kwargs):
1648 """Peek(self) -> char"""
1649 return _core_.InputStream_Peek(*args, **kwargs)
1650
1651 def GetC(*args, **kwargs):
1652 """GetC(self) -> char"""
1653 return _core_.InputStream_GetC(*args, **kwargs)
1654
1655 def LastRead(*args, **kwargs):
1656 """LastRead(self) -> size_t"""
1657 return _core_.InputStream_LastRead(*args, **kwargs)
1658
1659 def CanRead(*args, **kwargs):
1660 """CanRead(self) -> bool"""
1661 return _core_.InputStream_CanRead(*args, **kwargs)
1662
1663 def Eof(*args, **kwargs):
1664 """Eof(self) -> bool"""
1665 return _core_.InputStream_Eof(*args, **kwargs)
1666
1667 def Ungetch(*args, **kwargs):
1668 """Ungetch(self, char c) -> bool"""
1669 return _core_.InputStream_Ungetch(*args, **kwargs)
1670
1671 def SeekI(*args, **kwargs):
1672 """SeekI(self, long pos, int mode=FromStart) -> long"""
1673 return _core_.InputStream_SeekI(*args, **kwargs)
1674
1675 def TellI(*args, **kwargs):
1676 """TellI(self) -> long"""
1677 return _core_.InputStream_TellI(*args, **kwargs)
1678
1679 _core_.InputStream_swigregister(InputStream)
1680 DefaultPosition = cvar.DefaultPosition
1681 DefaultSize = cvar.DefaultSize
1682
1683 class OutputStream(object):
1684 """Proxy of C++ OutputStream class"""
1685 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1686 def __init__(self): raise AttributeError, "No constructor defined"
1687 __repr__ = _swig_repr
1688 def write(*args, **kwargs):
1689 """write(self, PyObject obj)"""
1690 return _core_.OutputStream_write(*args, **kwargs)
1691
1692 def LastWrite(*args, **kwargs):
1693 """LastWrite(self) -> size_t"""
1694 return _core_.OutputStream_LastWrite(*args, **kwargs)
1695
1696 _core_.OutputStream_swigregister(OutputStream)
1697
1698 #---------------------------------------------------------------------------
1699
1700 class FSFile(Object):
1701 """Proxy of C++ FSFile class"""
1702 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1703 __repr__ = _swig_repr
1704 def __init__(self, *args, **kwargs):
1705 """
1706 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1707 DateTime modif) -> FSFile
1708 """
1709 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1710 __swig_destroy__ = _core_.delete_FSFile
1711 __del__ = lambda self : None;
1712 def GetStream(*args, **kwargs):
1713 """GetStream(self) -> InputStream"""
1714 return _core_.FSFile_GetStream(*args, **kwargs)
1715
1716 def GetMimeType(*args, **kwargs):
1717 """GetMimeType(self) -> String"""
1718 return _core_.FSFile_GetMimeType(*args, **kwargs)
1719
1720 def GetLocation(*args, **kwargs):
1721 """GetLocation(self) -> String"""
1722 return _core_.FSFile_GetLocation(*args, **kwargs)
1723
1724 def GetAnchor(*args, **kwargs):
1725 """GetAnchor(self) -> String"""
1726 return _core_.FSFile_GetAnchor(*args, **kwargs)
1727
1728 def GetModificationTime(*args, **kwargs):
1729 """GetModificationTime(self) -> DateTime"""
1730 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1731
1732 _core_.FSFile_swigregister(FSFile)
1733
1734 class CPPFileSystemHandler(object):
1735 """Proxy of C++ CPPFileSystemHandler class"""
1736 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1737 def __init__(self): raise AttributeError, "No constructor defined"
1738 __repr__ = _swig_repr
1739 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1740 __del__ = lambda self : None;
1741 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
1742
1743 class FileSystemHandler(CPPFileSystemHandler):
1744 """Proxy of C++ FileSystemHandler class"""
1745 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1746 __repr__ = _swig_repr
1747 def __init__(self, *args, **kwargs):
1748 """__init__(self) -> FileSystemHandler"""
1749 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
1750 self._setCallbackInfo(self, FileSystemHandler)
1751
1752 def _setCallbackInfo(*args, **kwargs):
1753 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1754 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1755
1756 def CanOpen(*args, **kwargs):
1757 """CanOpen(self, String location) -> bool"""
1758 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1759
1760 def OpenFile(*args, **kwargs):
1761 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1762 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1763
1764 def FindFirst(*args, **kwargs):
1765 """FindFirst(self, String spec, int flags=0) -> String"""
1766 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1767
1768 def FindNext(*args, **kwargs):
1769 """FindNext(self) -> String"""
1770 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1771
1772 def GetProtocol(*args, **kwargs):
1773 """GetProtocol(self, String location) -> String"""
1774 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1775
1776 def GetLeftLocation(*args, **kwargs):
1777 """GetLeftLocation(self, String location) -> String"""
1778 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1779
1780 def GetAnchor(*args, **kwargs):
1781 """GetAnchor(self, String location) -> String"""
1782 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1783
1784 def GetRightLocation(*args, **kwargs):
1785 """GetRightLocation(self, String location) -> String"""
1786 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1787
1788 def GetMimeTypeFromExt(*args, **kwargs):
1789 """GetMimeTypeFromExt(self, String location) -> String"""
1790 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1791
1792 _core_.FileSystemHandler_swigregister(FileSystemHandler)
1793
1794 class FileSystem(Object):
1795 """Proxy of C++ FileSystem class"""
1796 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1797 __repr__ = _swig_repr
1798 def __init__(self, *args, **kwargs):
1799 """__init__(self) -> FileSystem"""
1800 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1801 __swig_destroy__ = _core_.delete_FileSystem
1802 __del__ = lambda self : None;
1803 def ChangePathTo(*args, **kwargs):
1804 """ChangePathTo(self, String location, bool is_dir=False)"""
1805 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1806
1807 def GetPath(*args, **kwargs):
1808 """GetPath(self) -> String"""
1809 return _core_.FileSystem_GetPath(*args, **kwargs)
1810
1811 def OpenFile(*args, **kwargs):
1812 """OpenFile(self, String location) -> FSFile"""
1813 return _core_.FileSystem_OpenFile(*args, **kwargs)
1814
1815 def FindFirst(*args, **kwargs):
1816 """FindFirst(self, String spec, int flags=0) -> String"""
1817 return _core_.FileSystem_FindFirst(*args, **kwargs)
1818
1819 def FindNext(*args, **kwargs):
1820 """FindNext(self) -> String"""
1821 return _core_.FileSystem_FindNext(*args, **kwargs)
1822
1823 def AddHandler(*args, **kwargs):
1824 """AddHandler(CPPFileSystemHandler handler)"""
1825 return _core_.FileSystem_AddHandler(*args, **kwargs)
1826
1827 AddHandler = staticmethod(AddHandler)
1828 def CleanUpHandlers(*args, **kwargs):
1829 """CleanUpHandlers()"""
1830 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1831
1832 CleanUpHandlers = staticmethod(CleanUpHandlers)
1833 def FileNameToURL(*args, **kwargs):
1834 """FileNameToURL(String filename) -> String"""
1835 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1836
1837 FileNameToURL = staticmethod(FileNameToURL)
1838 def URLToFileName(*args, **kwargs):
1839 """URLToFileName(String url) -> String"""
1840 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1841
1842 URLToFileName = staticmethod(URLToFileName)
1843 _core_.FileSystem_swigregister(FileSystem)
1844
1845 def FileSystem_AddHandler(*args, **kwargs):
1846 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1847 return _core_.FileSystem_AddHandler(*args, **kwargs)
1848
1849 def FileSystem_CleanUpHandlers(*args):
1850 """FileSystem_CleanUpHandlers()"""
1851 return _core_.FileSystem_CleanUpHandlers(*args)
1852
1853 def FileSystem_FileNameToURL(*args, **kwargs):
1854 """FileSystem_FileNameToURL(String filename) -> String"""
1855 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1856
1857 def FileSystem_URLToFileName(*args, **kwargs):
1858 """FileSystem_URLToFileName(String url) -> String"""
1859 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1860
1861 class InternetFSHandler(CPPFileSystemHandler):
1862 """Proxy of C++ InternetFSHandler class"""
1863 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1864 __repr__ = _swig_repr
1865 def __init__(self, *args, **kwargs):
1866 """__init__(self) -> InternetFSHandler"""
1867 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
1868 def CanOpen(*args, **kwargs):
1869 """CanOpen(self, String location) -> bool"""
1870 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1871
1872 def OpenFile(*args, **kwargs):
1873 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1874 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1875
1876 _core_.InternetFSHandler_swigregister(InternetFSHandler)
1877
1878 class ZipFSHandler(CPPFileSystemHandler):
1879 """Proxy of C++ ZipFSHandler class"""
1880 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1881 __repr__ = _swig_repr
1882 def __init__(self, *args, **kwargs):
1883 """__init__(self) -> ZipFSHandler"""
1884 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
1885 def CanOpen(*args, **kwargs):
1886 """CanOpen(self, String location) -> bool"""
1887 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1888
1889 def OpenFile(*args, **kwargs):
1890 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1891 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1892
1893 def FindFirst(*args, **kwargs):
1894 """FindFirst(self, String spec, int flags=0) -> String"""
1895 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1896
1897 def FindNext(*args, **kwargs):
1898 """FindNext(self) -> String"""
1899 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1900
1901 _core_.ZipFSHandler_swigregister(ZipFSHandler)
1902
1903
1904 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1905 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1906 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1907
1908 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1909 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1910 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1911
1912 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1913 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1914 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1915 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1916 """
1917 Add 'file' to the memory filesystem. The dataItem parameter can
1918 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1919 arbitrary data. If a bitmap or image is used then the imgType
1920 parameter should specify what kind of image file it should be
1921 written as, wx.BITMAP_TYPE_PNG, etc.
1922 """
1923 if isinstance(dataItem, wx.Image):
1924 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1925 elif isinstance(dataItem, wx.Bitmap):
1926 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1927 elif type(dataItem) == str:
1928 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1929 else:
1930 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1931
1932 class MemoryFSHandler(CPPFileSystemHandler):
1933 """Proxy of C++ MemoryFSHandler class"""
1934 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1935 __repr__ = _swig_repr
1936 def __init__(self, *args, **kwargs):
1937 """__init__(self) -> MemoryFSHandler"""
1938 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
1939 def RemoveFile(*args, **kwargs):
1940 """RemoveFile(String filename)"""
1941 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1942
1943 RemoveFile = staticmethod(RemoveFile)
1944 AddFile = staticmethod(MemoryFSHandler_AddFile)
1945 def CanOpen(*args, **kwargs):
1946 """CanOpen(self, String location) -> bool"""
1947 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1948
1949 def OpenFile(*args, **kwargs):
1950 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1951 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1952
1953 def FindFirst(*args, **kwargs):
1954 """FindFirst(self, String spec, int flags=0) -> String"""
1955 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1956
1957 def FindNext(*args, **kwargs):
1958 """FindNext(self) -> String"""
1959 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1960
1961 _core_.MemoryFSHandler_swigregister(MemoryFSHandler)
1962
1963 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1964 """MemoryFSHandler_RemoveFile(String filename)"""
1965 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1966
1967 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1968 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1969 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
1970 #---------------------------------------------------------------------------
1971
1972 class ImageHandler(Object):
1973 """
1974 This is the base class for implementing image file loading/saving, and
1975 image creation from data. It is used within `wx.Image` and is not
1976 normally seen by the application.
1977 """
1978 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1979 def __init__(self): raise AttributeError, "No constructor defined"
1980 __repr__ = _swig_repr
1981 def GetName(*args, **kwargs):
1982 """GetName(self) -> String"""
1983 return _core_.ImageHandler_GetName(*args, **kwargs)
1984
1985 def GetExtension(*args, **kwargs):
1986 """GetExtension(self) -> String"""
1987 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1988
1989 def GetType(*args, **kwargs):
1990 """GetType(self) -> long"""
1991 return _core_.ImageHandler_GetType(*args, **kwargs)
1992
1993 def GetMimeType(*args, **kwargs):
1994 """GetMimeType(self) -> String"""
1995 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
1996
1997 def CanRead(*args, **kwargs):
1998 """CanRead(self, String name) -> bool"""
1999 return _core_.ImageHandler_CanRead(*args, **kwargs)
2000
2001 def CanReadStream(*args, **kwargs):
2002 """CanReadStream(self, InputStream stream) -> bool"""
2003 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2004
2005 def SetName(*args, **kwargs):
2006 """SetName(self, String name)"""
2007 return _core_.ImageHandler_SetName(*args, **kwargs)
2008
2009 def SetExtension(*args, **kwargs):
2010 """SetExtension(self, String extension)"""
2011 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2012
2013 def SetType(*args, **kwargs):
2014 """SetType(self, long type)"""
2015 return _core_.ImageHandler_SetType(*args, **kwargs)
2016
2017 def SetMimeType(*args, **kwargs):
2018 """SetMimeType(self, String mimetype)"""
2019 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2020
2021 _core_.ImageHandler_swigregister(ImageHandler)
2022
2023 class PyImageHandler(ImageHandler):
2024 """
2025 This is the base class for implementing image file loading/saving, and
2026 image creation from data, all written in Python. To create a custom
2027 image handler derive a new class from wx.PyImageHandler and provide
2028 the following methods::
2029
2030 def DoCanRead(self, stream) --> bool
2031 '''Check if this handler can read the image on the stream'''
2032
2033 def LoadFile(self, image, stream, verbose, index) --> bool
2034 '''Load image data from the stream and load it into image.'''
2035
2036 def SaveFile(self, image, stream, verbose) --> bool
2037 '''Save the iamge data in image to the stream using
2038 this handler's image file format.'''
2039
2040 def GetImageCount(self, stream) --> int
2041 '''If this image format can hold more than one image,
2042 how many does the image on the stream have?'''
2043
2044 To activate your handler create an instance of it and pass it to
2045 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2046 `SetExtension` from your constructor.
2047
2048 """
2049 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2050 __repr__ = _swig_repr
2051 def __init__(self, *args, **kwargs):
2052 """
2053 __init__(self) -> PyImageHandler
2054
2055 This is the base class for implementing image file loading/saving, and
2056 image creation from data, all written in Python. To create a custom
2057 image handler derive a new class from wx.PyImageHandler and provide
2058 the following methods::
2059
2060 def DoCanRead(self, stream) --> bool
2061 '''Check if this handler can read the image on the stream'''
2062
2063 def LoadFile(self, image, stream, verbose, index) --> bool
2064 '''Load image data from the stream and load it into image.'''
2065
2066 def SaveFile(self, image, stream, verbose) --> bool
2067 '''Save the iamge data in image to the stream using
2068 this handler's image file format.'''
2069
2070 def GetImageCount(self, stream) --> int
2071 '''If this image format can hold more than one image,
2072 how many does the image on the stream have?'''
2073
2074 To activate your handler create an instance of it and pass it to
2075 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2076 `SetExtension` from your constructor.
2077
2078 """
2079 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
2080 self._SetSelf(self)
2081
2082 def _SetSelf(*args, **kwargs):
2083 """_SetSelf(self, PyObject self)"""
2084 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2085
2086 _core_.PyImageHandler_swigregister(PyImageHandler)
2087
2088 class ImageHistogram(object):
2089 """Proxy of C++ ImageHistogram class"""
2090 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2091 __repr__ = _swig_repr
2092 def __init__(self, *args, **kwargs):
2093 """__init__(self) -> ImageHistogram"""
2094 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
2095 def MakeKey(*args, **kwargs):
2096 """
2097 MakeKey(byte r, byte g, byte b) -> unsigned long
2098
2099 Get the key in the histogram for the given RGB values
2100 """
2101 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2102
2103 MakeKey = staticmethod(MakeKey)
2104 def FindFirstUnusedColour(*args, **kwargs):
2105 """
2106 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2107
2108 Find first colour that is not used in the image and has higher RGB
2109 values than startR, startG, startB. Returns a tuple consisting of a
2110 success flag and rgb values.
2111 """
2112 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2113
2114 def GetCount(*args, **kwargs):
2115 """
2116 GetCount(self, unsigned long key) -> unsigned long
2117
2118 Returns the pixel count for the given key. Use `MakeKey` to create a
2119 key value from a RGB tripple.
2120 """
2121 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2122
2123 def GetCountRGB(*args, **kwargs):
2124 """
2125 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2126
2127 Returns the pixel count for the given RGB values.
2128 """
2129 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2130
2131 def GetCountColour(*args, **kwargs):
2132 """
2133 GetCountColour(self, Colour colour) -> unsigned long
2134
2135 Returns the pixel count for the given `wx.Colour` value.
2136 """
2137 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2138
2139 _core_.ImageHistogram_swigregister(ImageHistogram)
2140
2141 def ImageHistogram_MakeKey(*args, **kwargs):
2142 """
2143 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2144
2145 Get the key in the histogram for the given RGB values
2146 """
2147 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2148
2149 class Image_RGBValue(object):
2150 """
2151 An object that contains values for red, green and blue which represent
2152 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2153 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2154 color space.
2155 """
2156 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2157 __repr__ = _swig_repr
2158 def __init__(self, *args, **kwargs):
2159 """
2160 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2161
2162 Constructor.
2163 """
2164 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2165 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2166 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2167 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2168 _core_.Image_RGBValue_swigregister(Image_RGBValue)
2169
2170 class Image_HSVValue(object):
2171 """
2172 An object that contains values for hue, saturation and value which
2173 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2174 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2175 color space.
2176 """
2177 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2178 __repr__ = _swig_repr
2179 def __init__(self, *args, **kwargs):
2180 """
2181 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2182
2183 Constructor.
2184 """
2185 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2186 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2187 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2188 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2189 _core_.Image_HSVValue_swigregister(Image_HSVValue)
2190
2191 class Image(Object):
2192 """
2193 A platform-independent image class. An image can be created from
2194 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2195 variety of formats. Functions are available to set and get image
2196 bits, so it can be used for basic image manipulation.
2197
2198 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2199 platform-specific `wx.Bitmap` object must be created from it using the
2200 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2201 device context, using `wx.DC.DrawBitmap`.
2202
2203 One colour value of the image may be used as a mask colour which will
2204 lead to the automatic creation of a `wx.Mask` object associated to the
2205 bitmap object.
2206
2207 wx.Image supports alpha channel data, that is in addition to a byte
2208 for the red, green and blue colour components for each pixel it also
2209 stores a byte representing the pixel opacity. An alpha value of 0
2210 corresponds to a transparent pixel (null opacity) while a value of 255
2211 means that the pixel is 100% opaque.
2212
2213 Unlike RGB data, not all images have an alpha channel and before using
2214 `GetAlpha` you should check if this image contains an alpha channel
2215 with `HasAlpha`. Note that currently only images loaded from PNG files
2216 with transparency information will have an alpha channel.
2217 """
2218 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2219 __repr__ = _swig_repr
2220 def __init__(self, *args, **kwargs):
2221 """
2222 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2223
2224 Loads an image from a file.
2225 """
2226 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2227 __swig_destroy__ = _core_.delete_Image
2228 __del__ = lambda self : None;
2229 def Create(*args, **kwargs):
2230 """
2231 Create(self, int width, int height, bool clear=True)
2232
2233 Creates a fresh image. If clear is ``True``, the new image will be
2234 initialized to black. Otherwise, the image data will be uninitialized.
2235 """
2236 return _core_.Image_Create(*args, **kwargs)
2237
2238 def Destroy(*args, **kwargs):
2239 """
2240 Destroy(self)
2241
2242 Destroys the image data.
2243 """
2244 val = _core_.Image_Destroy(*args, **kwargs)
2245 args[0].thisown = 0
2246 return val
2247
2248 def Scale(*args, **kwargs):
2249 """
2250 Scale(self, int width, int height) -> Image
2251
2252 Returns a scaled version of the image. This is also useful for scaling
2253 bitmaps in general as the only other way to scale bitmaps is to blit a
2254 `wx.MemoryDC` into another `wx.MemoryDC`.
2255 """
2256 return _core_.Image_Scale(*args, **kwargs)
2257
2258 def ShrinkBy(*args, **kwargs):
2259 """
2260 ShrinkBy(self, int xFactor, int yFactor) -> Image
2261
2262 Return a version of the image scaled smaller by the given factors.
2263 """
2264 return _core_.Image_ShrinkBy(*args, **kwargs)
2265
2266 def Rescale(*args, **kwargs):
2267 """
2268 Rescale(self, int width, int height) -> Image
2269
2270 Changes the size of the image in-place by scaling it: after a call to
2271 this function, the image will have the given width and height.
2272
2273 Returns the (modified) image itself.
2274 """
2275 return _core_.Image_Rescale(*args, **kwargs)
2276
2277 def Resize(*args, **kwargs):
2278 """
2279 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2280
2281 Changes the size of the image in-place without scaling it, by adding
2282 either a border with the given colour or cropping as necessary. The
2283 image is pasted into a new image with the given size and background
2284 colour at the position pos relative to the upper left of the new
2285 image. If red = green = blue = -1 then use either the current mask
2286 colour if set or find, use, and set a suitable mask colour for any
2287 newly exposed areas.
2288
2289 Returns the (modified) image itself.
2290 """
2291 return _core_.Image_Resize(*args, **kwargs)
2292
2293 def SetRGB(*args, **kwargs):
2294 """
2295 SetRGB(self, int x, int y, byte r, byte g, byte b)
2296
2297 Sets the pixel at the given coordinate. This routine performs
2298 bounds-checks for the coordinate so it can be considered a safe way to
2299 manipulate the data, but in some cases this might be too slow so that
2300 the data will have to be set directly. In that case you will have to
2301 get access to the image data using the `GetData` method.
2302 """
2303 return _core_.Image_SetRGB(*args, **kwargs)
2304
2305 def SetRGBRect(*args, **kwargs):
2306 """
2307 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2308
2309 Sets the colour of the pixels within the given rectangle. This routine
2310 performs bounds-checks for the rectangle so it can be considered a
2311 safe way to manipulate the data.
2312 """
2313 return _core_.Image_SetRGBRect(*args, **kwargs)
2314
2315 def GetRed(*args, **kwargs):
2316 """
2317 GetRed(self, int x, int y) -> byte
2318
2319 Returns the red intensity at the given coordinate.
2320 """
2321 return _core_.Image_GetRed(*args, **kwargs)
2322
2323 def GetGreen(*args, **kwargs):
2324 """
2325 GetGreen(self, int x, int y) -> byte
2326
2327 Returns the green intensity at the given coordinate.
2328 """
2329 return _core_.Image_GetGreen(*args, **kwargs)
2330
2331 def GetBlue(*args, **kwargs):
2332 """
2333 GetBlue(self, int x, int y) -> byte
2334
2335 Returns the blue intensity at the given coordinate.
2336 """
2337 return _core_.Image_GetBlue(*args, **kwargs)
2338
2339 def SetAlpha(*args, **kwargs):
2340 """
2341 SetAlpha(self, int x, int y, byte alpha)
2342
2343 Sets the alpha value for the given pixel. This function should only be
2344 called if the image has alpha channel data, use `HasAlpha` to check
2345 for this.
2346 """
2347 return _core_.Image_SetAlpha(*args, **kwargs)
2348
2349 def GetAlpha(*args, **kwargs):
2350 """
2351 GetAlpha(self, int x, int y) -> byte
2352
2353 Returns the alpha value for the given pixel. This function may only be
2354 called for the images with alpha channel, use `HasAlpha` to check for
2355 this.
2356
2357 The returned value is the *opacity* of the image, i.e. the value of 0
2358 corresponds to the fully transparent pixels while the value of 255 to
2359 the fully opaque pixels.
2360 """
2361 return _core_.Image_GetAlpha(*args, **kwargs)
2362
2363 def HasAlpha(*args, **kwargs):
2364 """
2365 HasAlpha(self) -> bool
2366
2367 Returns true if this image has alpha channel, false otherwise.
2368 """
2369 return _core_.Image_HasAlpha(*args, **kwargs)
2370
2371 def InitAlpha(*args, **kwargs):
2372 """
2373 InitAlpha(self)
2374
2375 Initializes the image alpha channel data. It is an error to call it if
2376 the image already has alpha data. If it doesn't, alpha data will be by
2377 default initialized to all pixels being fully opaque. But if the image
2378 has a a mask colour, all mask pixels will be completely transparent.
2379 """
2380 return _core_.Image_InitAlpha(*args, **kwargs)
2381
2382 def IsTransparent(*args, **kwargs):
2383 """
2384 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2385
2386 Returns ``True`` if this pixel is masked or has an alpha value less
2387 than the spcified threshold.
2388 """
2389 return _core_.Image_IsTransparent(*args, **kwargs)
2390
2391 def FindFirstUnusedColour(*args, **kwargs):
2392 """
2393 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2394
2395 Find first colour that is not used in the image and has higher RGB
2396 values than startR, startG, startB. Returns a tuple consisting of a
2397 success flag and rgb values.
2398 """
2399 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2400
2401 def ConvertAlphaToMask(*args, **kwargs):
2402 """
2403 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2404
2405 If the image has alpha channel, this method converts it to mask. All
2406 pixels with alpha value less than ``threshold`` are replaced with the
2407 mask colour and the alpha channel is removed. The mask colour is
2408 chosen automatically using `FindFirstUnusedColour`.
2409
2410 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2411 nothing.
2412 """
2413 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2414
2415 def ConvertColourToAlpha(*args, **kwargs):
2416 """
2417 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2418
2419 This method converts an image where the original alpha information is
2420 only available as a shades of a colour (actually shades of grey)
2421 typically when you draw anti-aliased text into a bitmap. The DC
2422 drawing routines draw grey values on the black background although
2423 they actually mean to draw white with differnt alpha values. This
2424 method reverses it, assuming a black (!) background and white text.
2425 The method will then fill up the whole image with the colour given.
2426 """
2427 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2428
2429 def SetMaskFromImage(*args, **kwargs):
2430 """
2431 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2432
2433 Sets the image's mask so that the pixels that have RGB value of
2434 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2435 by first finding an unused colour in the image, setting this colour as
2436 the mask colour and then using this colour to draw all pixels in the
2437 image who corresponding pixel in mask has given RGB value.
2438
2439 Returns ``False`` if ``mask`` does not have same dimensions as the
2440 image or if there is no unused colour left. Returns ``True`` if the
2441 mask was successfully applied.
2442
2443 Note that this method involves computing the histogram, which is
2444 computationally intensive operation.
2445 """
2446 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2447
2448 def CanRead(*args, **kwargs):
2449 """
2450 CanRead(String filename) -> bool
2451
2452 Returns True if the image handlers can read this file.
2453 """
2454 return _core_.Image_CanRead(*args, **kwargs)
2455
2456 CanRead = staticmethod(CanRead)
2457 def GetImageCount(*args, **kwargs):
2458 """
2459 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2460
2461 If the image file contains more than one image and the image handler
2462 is capable of retrieving these individually, this function will return
2463 the number of available images.
2464 """
2465 return _core_.Image_GetImageCount(*args, **kwargs)
2466
2467 GetImageCount = staticmethod(GetImageCount)
2468 def LoadFile(*args, **kwargs):
2469 """
2470 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2471
2472 Loads an image from a file. If no handler type is provided, the
2473 library will try to autodetect the format.
2474 """
2475 return _core_.Image_LoadFile(*args, **kwargs)
2476
2477 def LoadMimeFile(*args, **kwargs):
2478 """
2479 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2480
2481 Loads an image from a file, specifying the image type with a MIME type
2482 string.
2483 """
2484 return _core_.Image_LoadMimeFile(*args, **kwargs)
2485
2486 def SaveFile(*args, **kwargs):
2487 """
2488 SaveFile(self, String name, int type) -> bool
2489
2490 Saves an image in the named file.
2491 """
2492 return _core_.Image_SaveFile(*args, **kwargs)
2493
2494 def SaveMimeFile(*args, **kwargs):
2495 """
2496 SaveMimeFile(self, String name, String mimetype) -> bool
2497
2498 Saves an image in the named file.
2499 """
2500 return _core_.Image_SaveMimeFile(*args, **kwargs)
2501
2502 def CanReadStream(*args, **kwargs):
2503 """
2504 CanReadStream(InputStream stream) -> bool
2505
2506 Returns True if the image handlers can read an image file from the
2507 data currently on the input stream, or a readable Python file-like
2508 object.
2509 """
2510 return _core_.Image_CanReadStream(*args, **kwargs)
2511
2512 CanReadStream = staticmethod(CanReadStream)
2513 def LoadStream(*args, **kwargs):
2514 """
2515 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2516
2517 Loads an image from an input stream or a readable Python file-like
2518 object. If no handler type is provided, the library will try to
2519 autodetect the format.
2520 """
2521 return _core_.Image_LoadStream(*args, **kwargs)
2522
2523 def LoadMimeStream(*args, **kwargs):
2524 """
2525 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2526
2527 Loads an image from an input stream or a readable Python file-like
2528 object, using a MIME type string to specify the image file format.
2529 """
2530 return _core_.Image_LoadMimeStream(*args, **kwargs)
2531
2532 def Ok(*args, **kwargs):
2533 """
2534 Ok(self) -> bool
2535
2536 Returns true if image data is present.
2537 """
2538 return _core_.Image_Ok(*args, **kwargs)
2539
2540 def GetWidth(*args, **kwargs):
2541 """
2542 GetWidth(self) -> int
2543
2544 Gets the width of the image in pixels.
2545 """
2546 return _core_.Image_GetWidth(*args, **kwargs)
2547
2548 def GetHeight(*args, **kwargs):
2549 """
2550 GetHeight(self) -> int
2551
2552 Gets the height of the image in pixels.
2553 """
2554 return _core_.Image_GetHeight(*args, **kwargs)
2555
2556 def GetSize(*args, **kwargs):
2557 """
2558 GetSize(self) -> Size
2559
2560 Returns the size of the image in pixels.
2561 """
2562 return _core_.Image_GetSize(*args, **kwargs)
2563
2564 def GetSubImage(*args, **kwargs):
2565 """
2566 GetSubImage(self, Rect rect) -> Image
2567
2568 Returns a sub image of the current one as long as the rect belongs
2569 entirely to the image.
2570 """
2571 return _core_.Image_GetSubImage(*args, **kwargs)
2572
2573 def Size(*args, **kwargs):
2574 """
2575 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2576
2577 Returns a resized version of this image without scaling it by adding
2578 either a border with the given colour or cropping as necessary. The
2579 image is pasted into a new image with the given size and background
2580 colour at the position ``pos`` relative to the upper left of the new
2581 image. If red = green = blue = -1 then use either the current mask
2582 colour if set or find, use, and set a suitable mask colour for any
2583 newly exposed areas.
2584 """
2585 return _core_.Image_Size(*args, **kwargs)
2586
2587 def Copy(*args, **kwargs):
2588 """
2589 Copy(self) -> Image
2590
2591 Returns an identical copy of the image.
2592 """
2593 return _core_.Image_Copy(*args, **kwargs)
2594
2595 def Paste(*args, **kwargs):
2596 """
2597 Paste(self, Image image, int x, int y)
2598
2599 Pastes ``image`` into this instance and takes care of the mask colour
2600 and any out of bounds problems.
2601 """
2602 return _core_.Image_Paste(*args, **kwargs)
2603
2604 def GetData(*args, **kwargs):
2605 """
2606 GetData(self) -> PyObject
2607
2608 Returns a string containing a copy of the RGB bytes of the image.
2609 """
2610 return _core_.Image_GetData(*args, **kwargs)
2611
2612 def SetData(*args, **kwargs):
2613 """
2614 SetData(self, buffer data)
2615
2616 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2617 either a string or a buffer object holding the data and the length of
2618 the data must be width*height*3.
2619 """
2620 return _core_.Image_SetData(*args, **kwargs)
2621
2622 def GetDataBuffer(*args, **kwargs):
2623 """
2624 GetDataBuffer(self) -> PyObject
2625
2626 Returns a writable Python buffer object that is pointing at the RGB
2627 image data buffer inside the wx.Image. You need to ensure that you do
2628 not use this buffer object after the image has been destroyed.
2629 """
2630 return _core_.Image_GetDataBuffer(*args, **kwargs)
2631
2632 def SetDataBuffer(*args, **kwargs):
2633 """
2634 SetDataBuffer(self, buffer data)
2635
2636 Sets the internal image data pointer to point at a Python buffer
2637 object. This can save making an extra copy of the data but you must
2638 ensure that the buffer object lives longer than the wx.Image does.
2639 """
2640 return _core_.Image_SetDataBuffer(*args, **kwargs)
2641
2642 def GetAlphaData(*args, **kwargs):
2643 """
2644 GetAlphaData(self) -> PyObject
2645
2646 Returns a string containing a copy of the alpha bytes of the image.
2647 """
2648 return _core_.Image_GetAlphaData(*args, **kwargs)
2649
2650 def SetAlphaData(*args, **kwargs):
2651 """
2652 SetAlphaData(self, buffer alpha)
2653
2654 Resets the Image's alpha data from a buffer of bytes. Accepts either
2655 a string or a buffer object holding the data and the length of the
2656 data must be width*height.
2657 """
2658 return _core_.Image_SetAlphaData(*args, **kwargs)
2659
2660 def GetAlphaBuffer(*args, **kwargs):
2661 """
2662 GetAlphaBuffer(self) -> PyObject
2663
2664 Returns a writable Python buffer object that is pointing at the Alpha
2665 data buffer inside the wx.Image. You need to ensure that you do not
2666 use this buffer object after the image has been destroyed.
2667 """
2668 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2669
2670 def SetAlphaBuffer(*args, **kwargs):
2671 """
2672 SetAlphaBuffer(self, buffer alpha)
2673
2674 Sets the internal image alpha pointer to point at a Python buffer
2675 object. This can save making an extra copy of the data but you must
2676 ensure that the buffer object lives as long as the wx.Image does.
2677 """
2678 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2679
2680 def SetMaskColour(*args, **kwargs):
2681 """
2682 SetMaskColour(self, byte r, byte g, byte b)
2683
2684 Sets the mask colour for this image (and tells the image to use the
2685 mask).
2686 """
2687 return _core_.Image_SetMaskColour(*args, **kwargs)
2688
2689 def GetOrFindMaskColour(*args, **kwargs):
2690 """
2691 GetOrFindMaskColour() -> (r,g,b)
2692
2693 Get the current mask colour or find a suitable colour.
2694 """
2695 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2696
2697 def GetMaskRed(*args, **kwargs):
2698 """
2699 GetMaskRed(self) -> byte
2700
2701 Gets the red component of the mask colour.
2702 """
2703 return _core_.Image_GetMaskRed(*args, **kwargs)
2704
2705 def GetMaskGreen(*args, **kwargs):
2706 """
2707 GetMaskGreen(self) -> byte
2708
2709 Gets the green component of the mask colour.
2710 """
2711 return _core_.Image_GetMaskGreen(*args, **kwargs)
2712
2713 def GetMaskBlue(*args, **kwargs):
2714 """
2715 GetMaskBlue(self) -> byte
2716
2717 Gets the blue component of the mask colour.
2718 """
2719 return _core_.Image_GetMaskBlue(*args, **kwargs)
2720
2721 def SetMask(*args, **kwargs):
2722 """
2723 SetMask(self, bool mask=True)
2724
2725 Specifies whether there is a mask or not. The area of the mask is
2726 determined by the current mask colour.
2727 """
2728 return _core_.Image_SetMask(*args, **kwargs)
2729
2730 def HasMask(*args, **kwargs):
2731 """
2732 HasMask(self) -> bool
2733
2734 Returns ``True`` if there is a mask active, ``False`` otherwise.
2735 """
2736 return _core_.Image_HasMask(*args, **kwargs)
2737
2738 def Rotate(*args, **kwargs):
2739 """
2740 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2741 Point offset_after_rotation=None) -> Image
2742
2743 Rotates the image about the given point, by ``angle`` radians. Passing
2744 ``True`` to ``interpolating`` results in better image quality, but is
2745 slower. If the image has a mask, then the mask colour is used for the
2746 uncovered pixels in the rotated image background. Otherwise, black
2747 will be used as the fill colour.
2748
2749 Returns the rotated image, leaving this image intact.
2750 """
2751 return _core_.Image_Rotate(*args, **kwargs)
2752
2753 def Rotate90(*args, **kwargs):
2754 """
2755 Rotate90(self, bool clockwise=True) -> Image
2756
2757 Returns a copy of the image rotated 90 degrees in the direction
2758 indicated by ``clockwise``.
2759 """
2760 return _core_.Image_Rotate90(*args, **kwargs)
2761
2762 def Mirror(*args, **kwargs):
2763 """
2764 Mirror(self, bool horizontally=True) -> Image
2765
2766 Returns a mirrored copy of the image. The parameter ``horizontally``
2767 indicates the orientation.
2768 """
2769 return _core_.Image_Mirror(*args, **kwargs)
2770
2771 def Replace(*args, **kwargs):
2772 """
2773 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2774
2775 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2776 ``(r2,g2,b2)``.
2777 """
2778 return _core_.Image_Replace(*args, **kwargs)
2779
2780 def ConvertToGreyscale(*args, **kwargs):
2781 """
2782 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2783
2784 Convert to greyscale image. Uses the luminance component (Y) of the
2785 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2786 defaults to ITU-T BT.601
2787 """
2788 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2789
2790 def ConvertToMono(*args, **kwargs):
2791 """
2792 ConvertToMono(self, byte r, byte g, byte b) -> Image
2793
2794 Returns monochromatic version of the image. The returned image has
2795 white colour where the original has ``(r,g,b)`` colour and black
2796 colour everywhere else.
2797 """
2798 return _core_.Image_ConvertToMono(*args, **kwargs)
2799
2800 def SetOption(*args, **kwargs):
2801 """
2802 SetOption(self, String name, String value)
2803
2804 Sets an image handler defined option. For example, when saving as a
2805 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2806 number between 0 and 100 (0 is terrible, 100 is very good).
2807 """
2808 return _core_.Image_SetOption(*args, **kwargs)
2809
2810 def SetOptionInt(*args, **kwargs):
2811 """
2812 SetOptionInt(self, String name, int value)
2813
2814 Sets an image option as an integer.
2815 """
2816 return _core_.Image_SetOptionInt(*args, **kwargs)
2817
2818 def GetOption(*args, **kwargs):
2819 """
2820 GetOption(self, String name) -> String
2821
2822 Gets the value of an image handler option.
2823 """
2824 return _core_.Image_GetOption(*args, **kwargs)
2825
2826 def GetOptionInt(*args, **kwargs):
2827 """
2828 GetOptionInt(self, String name) -> int
2829
2830 Gets the value of an image handler option as an integer. If the given
2831 option is not present, the function returns 0.
2832 """
2833 return _core_.Image_GetOptionInt(*args, **kwargs)
2834
2835 def HasOption(*args, **kwargs):
2836 """
2837 HasOption(self, String name) -> bool
2838
2839 Returns true if the given option is present.
2840 """
2841 return _core_.Image_HasOption(*args, **kwargs)
2842
2843 def CountColours(*args, **kwargs):
2844 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2845 return _core_.Image_CountColours(*args, **kwargs)
2846
2847 def ComputeHistogram(*args, **kwargs):
2848 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2849 return _core_.Image_ComputeHistogram(*args, **kwargs)
2850
2851 def AddHandler(*args, **kwargs):
2852 """AddHandler(ImageHandler handler)"""
2853 return _core_.Image_AddHandler(*args, **kwargs)
2854
2855 AddHandler = staticmethod(AddHandler)
2856 def InsertHandler(*args, **kwargs):
2857 """InsertHandler(ImageHandler handler)"""
2858 return _core_.Image_InsertHandler(*args, **kwargs)
2859
2860 InsertHandler = staticmethod(InsertHandler)
2861 def RemoveHandler(*args, **kwargs):
2862 """RemoveHandler(String name) -> bool"""
2863 return _core_.Image_RemoveHandler(*args, **kwargs)
2864
2865 RemoveHandler = staticmethod(RemoveHandler)
2866 def GetHandlers(*args, **kwargs):
2867 """GetHandlers() -> PyObject"""
2868 return _core_.Image_GetHandlers(*args, **kwargs)
2869
2870 GetHandlers = staticmethod(GetHandlers)
2871 def GetImageExtWildcard(*args, **kwargs):
2872 """
2873 GetImageExtWildcard() -> String
2874
2875 Iterates all registered wxImageHandler objects, and returns a string
2876 containing file extension masks suitable for passing to file open/save
2877 dialog boxes.
2878 """
2879 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2880
2881 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2882 def ConvertToBitmap(*args, **kwargs):
2883 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2884 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2885
2886 def ConvertToMonoBitmap(*args, **kwargs):
2887 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2888 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2889
2890 def RotateHue(*args, **kwargs):
2891 """
2892 RotateHue(self, double angle)
2893
2894 Rotates the hue of each pixel of the image. Hue is a double in the
2895 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2896 """
2897 return _core_.Image_RotateHue(*args, **kwargs)
2898
2899 def RGBtoHSV(*args, **kwargs):
2900 """
2901 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2902
2903 Converts a color in RGB color space to HSV color space.
2904 """
2905 return _core_.Image_RGBtoHSV(*args, **kwargs)
2906
2907 RGBtoHSV = staticmethod(RGBtoHSV)
2908 def HSVtoRGB(*args, **kwargs):
2909 """
2910 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2911
2912 Converts a color in HSV color space to RGB color space.
2913 """
2914 return _core_.Image_HSVtoRGB(*args, **kwargs)
2915
2916 HSVtoRGB = staticmethod(HSVtoRGB)
2917 def __nonzero__(self): return self.Ok()
2918 _core_.Image_swigregister(Image)
2919
2920 def ImageFromMime(*args, **kwargs):
2921 """
2922 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2923
2924 Loads an image from a file, using a MIME type string (such as
2925 'image/jpeg') to specify image type.
2926 """
2927 val = _core_.new_ImageFromMime(*args, **kwargs)
2928 return val
2929
2930 def ImageFromStream(*args, **kwargs):
2931 """
2932 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2933
2934 Loads an image from an input stream, or any readable Python file-like
2935 object.
2936 """
2937 val = _core_.new_ImageFromStream(*args, **kwargs)
2938 return val
2939
2940 def ImageFromStreamMime(*args, **kwargs):
2941 """
2942 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2943
2944 Loads an image from an input stream, or any readable Python file-like
2945 object, specifying the image format with a MIME type string.
2946 """
2947 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2948 return val
2949
2950 def EmptyImage(*args, **kwargs):
2951 """
2952 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2953
2954 Construct an empty image of a given size, optionally setting all
2955 pixels to black.
2956 """
2957 val = _core_.new_EmptyImage(*args, **kwargs)
2958 return val
2959
2960 def ImageFromBitmap(*args, **kwargs):
2961 """
2962 ImageFromBitmap(Bitmap bitmap) -> Image
2963
2964 Construct an Image from a `wx.Bitmap`.
2965 """
2966 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2967 return val
2968
2969 def ImageFromData(*args, **kwargs):
2970 """
2971 ImageFromData(int width, int height, buffer data) -> Image
2972
2973 Construct an Image from a buffer of RGB bytes. Accepts either a
2974 string or a buffer object holding the data and the length of the data
2975 must be width*height*3.
2976 """
2977 val = _core_.new_ImageFromData(*args, **kwargs)
2978 return val
2979
2980 def ImageFromDataWithAlpha(*args, **kwargs):
2981 """
2982 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2983
2984 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2985 Accepts either a string or a buffer object holding the data and the
2986 length of the data must be width*height*3 bytes, and the length of the
2987 alpha data must be width*height bytes.
2988 """
2989 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2990 return val
2991
2992 def Image_CanRead(*args, **kwargs):
2993 """
2994 Image_CanRead(String filename) -> bool
2995
2996 Returns True if the image handlers can read this file.
2997 """
2998 return _core_.Image_CanRead(*args, **kwargs)
2999
3000 def Image_GetImageCount(*args, **kwargs):
3001 """
3002 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3003
3004 If the image file contains more than one image and the image handler
3005 is capable of retrieving these individually, this function will return
3006 the number of available images.
3007 """
3008 return _core_.Image_GetImageCount(*args, **kwargs)
3009
3010 def Image_CanReadStream(*args, **kwargs):
3011 """
3012 Image_CanReadStream(InputStream stream) -> bool
3013
3014 Returns True if the image handlers can read an image file from the
3015 data currently on the input stream, or a readable Python file-like
3016 object.
3017 """
3018 return _core_.Image_CanReadStream(*args, **kwargs)
3019
3020 def Image_AddHandler(*args, **kwargs):
3021 """Image_AddHandler(ImageHandler handler)"""
3022 return _core_.Image_AddHandler(*args, **kwargs)
3023
3024 def Image_InsertHandler(*args, **kwargs):
3025 """Image_InsertHandler(ImageHandler handler)"""
3026 return _core_.Image_InsertHandler(*args, **kwargs)
3027
3028 def Image_RemoveHandler(*args, **kwargs):
3029 """Image_RemoveHandler(String name) -> bool"""
3030 return _core_.Image_RemoveHandler(*args, **kwargs)
3031
3032 def Image_GetHandlers(*args):
3033 """Image_GetHandlers() -> PyObject"""
3034 return _core_.Image_GetHandlers(*args)
3035
3036 def Image_GetImageExtWildcard(*args):
3037 """
3038 Image_GetImageExtWildcard() -> String
3039
3040 Iterates all registered wxImageHandler objects, and returns a string
3041 containing file extension masks suitable for passing to file open/save
3042 dialog boxes.
3043 """
3044 return _core_.Image_GetImageExtWildcard(*args)
3045
3046 def Image_RGBtoHSV(*args, **kwargs):
3047 """
3048 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3049
3050 Converts a color in RGB color space to HSV color space.
3051 """
3052 return _core_.Image_RGBtoHSV(*args, **kwargs)
3053
3054 def Image_HSVtoRGB(*args, **kwargs):
3055 """
3056 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3057
3058 Converts a color in HSV color space to RGB color space.
3059 """
3060 return _core_.Image_HSVtoRGB(*args, **kwargs)
3061
3062
3063 def _ImageFromBuffer(*args, **kwargs):
3064 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3065 return _core_._ImageFromBuffer(*args, **kwargs)
3066 def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3067 """
3068 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3069 parameter must be a Python object that implements the buffer interface,
3070 such as a string, array, etc. The dataBuffer object is expected to
3071 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3072 object can optionally be supplied for the image's alpha channel data, and
3073 it is expected to be width*height bytes long.
3074
3075 The wx.Image will be created with its data and alpha pointers initialized
3076 to the memory address pointed to by the buffer objects, thus saving the
3077 time needed to copy the image data from the buffer object to the wx.Image.
3078 While this has advantages, it also has the shoot-yourself-in-the-foot
3079 risks associated with sharing a C pointer between two objects.
3080
3081 To help alleviate the risk a reference to the data and alpha buffer
3082 objects are kept with the wx.Image, so that they won't get deleted until
3083 after the wx.Image is deleted. However please be aware that it is not
3084 guaranteed that an object won't move its memory buffer to a new location
3085 when it needs to resize its contents. If that happens then the wx.Image
3086 will end up referring to an invalid memory location and could cause the
3087 application to crash. Therefore care should be taken to not manipulate
3088 the objects used for the data and alpha buffers in a way that would cause
3089 them to change size.
3090 """
3091 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3092 image._buffer = dataBuffer
3093 image._alpha = alphaBuffer
3094 return image
3095
3096 def InitAllImageHandlers():
3097 """
3098 The former functionality of InitAllImageHanders is now done internal to
3099 the _core_ extension module and so this function has become a simple NOP.
3100 """
3101 pass
3102
3103 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3104 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3105 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3106 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3107 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3108 BMP_24BPP = _core_.BMP_24BPP
3109 BMP_8BPP = _core_.BMP_8BPP
3110 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3111 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3112 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3113 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3114 BMP_4BPP = _core_.BMP_4BPP
3115 BMP_1BPP = _core_.BMP_1BPP
3116 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3117 class BMPHandler(ImageHandler):
3118 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3119 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3120 __repr__ = _swig_repr
3121 def __init__(self, *args, **kwargs):
3122 """
3123 __init__(self) -> BMPHandler
3124
3125 A `wx.ImageHandler` for \*.bmp bitmap files.
3126 """
3127 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3128 _core_.BMPHandler_swigregister(BMPHandler)
3129 NullImage = cvar.NullImage
3130 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3131 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3132 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3133 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3134 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3135 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3136 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3137 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3138 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3139 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3140 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3141 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3142 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3143 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3144 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3145
3146 class ICOHandler(BMPHandler):
3147 """A `wx.ImageHandler` for \*.ico icon files."""
3148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3149 __repr__ = _swig_repr
3150 def __init__(self, *args, **kwargs):
3151 """
3152 __init__(self) -> ICOHandler
3153
3154 A `wx.ImageHandler` for \*.ico icon files.
3155 """
3156 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3157 _core_.ICOHandler_swigregister(ICOHandler)
3158
3159 class CURHandler(ICOHandler):
3160 """A `wx.ImageHandler` for \*.cur cursor files."""
3161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3162 __repr__ = _swig_repr
3163 def __init__(self, *args, **kwargs):
3164 """
3165 __init__(self) -> CURHandler
3166
3167 A `wx.ImageHandler` for \*.cur cursor files.
3168 """
3169 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3170 _core_.CURHandler_swigregister(CURHandler)
3171
3172 class ANIHandler(CURHandler):
3173 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3174 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3175 __repr__ = _swig_repr
3176 def __init__(self, *args, **kwargs):
3177 """
3178 __init__(self) -> ANIHandler
3179
3180 A `wx.ImageHandler` for \*.ani animated cursor files.
3181 """
3182 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3183 _core_.ANIHandler_swigregister(ANIHandler)
3184
3185 class PNGHandler(ImageHandler):
3186 """A `wx.ImageHandler` for PNG image files."""
3187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3188 __repr__ = _swig_repr
3189 def __init__(self, *args, **kwargs):
3190 """
3191 __init__(self) -> PNGHandler
3192
3193 A `wx.ImageHandler` for PNG image files.
3194 """
3195 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3196 _core_.PNGHandler_swigregister(PNGHandler)
3197
3198 class GIFHandler(ImageHandler):
3199 """A `wx.ImageHandler` for GIF image files."""
3200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3201 __repr__ = _swig_repr
3202 def __init__(self, *args, **kwargs):
3203 """
3204 __init__(self) -> GIFHandler
3205
3206 A `wx.ImageHandler` for GIF image files.
3207 """
3208 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3209 _core_.GIFHandler_swigregister(GIFHandler)
3210
3211 class PCXHandler(ImageHandler):
3212 """A `wx.ImageHandler` for PCX imager files."""
3213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3214 __repr__ = _swig_repr
3215 def __init__(self, *args, **kwargs):
3216 """
3217 __init__(self) -> PCXHandler
3218
3219 A `wx.ImageHandler` for PCX imager files.
3220 """
3221 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3222 _core_.PCXHandler_swigregister(PCXHandler)
3223
3224 class JPEGHandler(ImageHandler):
3225 """A `wx.ImageHandler` for JPEG/JPG image files."""
3226 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3227 __repr__ = _swig_repr
3228 def __init__(self, *args, **kwargs):
3229 """
3230 __init__(self) -> JPEGHandler
3231
3232 A `wx.ImageHandler` for JPEG/JPG image files.
3233 """
3234 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3235 _core_.JPEGHandler_swigregister(JPEGHandler)
3236
3237 class PNMHandler(ImageHandler):
3238 """A `wx.ImageHandler` for PNM image files."""
3239 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3240 __repr__ = _swig_repr
3241 def __init__(self, *args, **kwargs):
3242 """
3243 __init__(self) -> PNMHandler
3244
3245 A `wx.ImageHandler` for PNM image files.
3246 """
3247 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3248 _core_.PNMHandler_swigregister(PNMHandler)
3249
3250 class XPMHandler(ImageHandler):
3251 """A `wx.ImageHandler` for XPM image."""
3252 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3253 __repr__ = _swig_repr
3254 def __init__(self, *args, **kwargs):
3255 """
3256 __init__(self) -> XPMHandler
3257
3258 A `wx.ImageHandler` for XPM image.
3259 """
3260 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3261 _core_.XPMHandler_swigregister(XPMHandler)
3262
3263 class TIFFHandler(ImageHandler):
3264 """A `wx.ImageHandler` for TIFF image files."""
3265 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3266 __repr__ = _swig_repr
3267 def __init__(self, *args, **kwargs):
3268 """
3269 __init__(self) -> TIFFHandler
3270
3271 A `wx.ImageHandler` for TIFF image files.
3272 """
3273 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3274 _core_.TIFFHandler_swigregister(TIFFHandler)
3275
3276 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3277 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3278 class Quantize(object):
3279 """Performs quantization, or colour reduction, on a wxImage."""
3280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3281 def __init__(self): raise AttributeError, "No constructor defined"
3282 __repr__ = _swig_repr
3283 def Quantize(*args, **kwargs):
3284 """
3285 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3286
3287 Reduce the colours in the source image and put the result into the
3288 destination image, setting the palette in the destination if
3289 needed. Both images may be the same, to overwrite the source image.
3290 """
3291 return _core_.Quantize_Quantize(*args, **kwargs)
3292
3293 Quantize = staticmethod(Quantize)
3294 _core_.Quantize_swigregister(Quantize)
3295
3296 def Quantize_Quantize(*args, **kwargs):
3297 """
3298 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3299
3300 Reduce the colours in the source image and put the result into the
3301 destination image, setting the palette in the destination if
3302 needed. Both images may be the same, to overwrite the source image.
3303 """
3304 return _core_.Quantize_Quantize(*args, **kwargs)
3305
3306 #---------------------------------------------------------------------------
3307
3308 class EvtHandler(Object):
3309 """Proxy of C++ EvtHandler class"""
3310 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3311 __repr__ = _swig_repr
3312 def __init__(self, *args, **kwargs):
3313 """__init__(self) -> EvtHandler"""
3314 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
3315 def GetNextHandler(*args, **kwargs):
3316 """GetNextHandler(self) -> EvtHandler"""
3317 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3318
3319 def GetPreviousHandler(*args, **kwargs):
3320 """GetPreviousHandler(self) -> EvtHandler"""
3321 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3322
3323 def SetNextHandler(*args, **kwargs):
3324 """SetNextHandler(self, EvtHandler handler)"""
3325 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3326
3327 def SetPreviousHandler(*args, **kwargs):
3328 """SetPreviousHandler(self, EvtHandler handler)"""
3329 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3330
3331 def GetEvtHandlerEnabled(*args, **kwargs):
3332 """GetEvtHandlerEnabled(self) -> bool"""
3333 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3334
3335 def SetEvtHandlerEnabled(*args, **kwargs):
3336 """SetEvtHandlerEnabled(self, bool enabled)"""
3337 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3338
3339 def ProcessEvent(*args, **kwargs):
3340 """ProcessEvent(self, Event event) -> bool"""
3341 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3342
3343 def AddPendingEvent(*args, **kwargs):
3344 """AddPendingEvent(self, Event event)"""
3345 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3346
3347 def ProcessPendingEvents(*args, **kwargs):
3348 """ProcessPendingEvents(self)"""
3349 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3350
3351 def Connect(*args, **kwargs):
3352 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3353 return _core_.EvtHandler_Connect(*args, **kwargs)
3354
3355 def Disconnect(*args, **kwargs):
3356 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3357 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3358
3359 def _setOORInfo(*args, **kwargs):
3360 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3361 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3362 args[0].thisown = 0
3363 return val
3364
3365 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3366 """
3367 Bind an event to an event handler.
3368
3369 :param event: One of the EVT_* objects that specifies the
3370 type of event to bind,
3371
3372 :param handler: A callable object to be invoked when the
3373 event is delivered to self. Pass None to
3374 disconnect an event handler.
3375
3376 :param source: Sometimes the event originates from a
3377 different window than self, but you still
3378 want to catch it in self. (For example, a
3379 button event delivered to a frame.) By
3380 passing the source of the event, the event
3381 handling system is able to differentiate
3382 between the same event type from different
3383 controls.
3384
3385 :param id: Used to spcify the event source by ID instead
3386 of instance.
3387
3388 :param id2: Used when it is desirable to bind a handler
3389 to a range of IDs, such as with EVT_MENU_RANGE.
3390 """
3391 if source is not None:
3392 id = source.GetId()
3393 event.Bind(self, id, id2, handler)
3394
3395 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3396 """
3397 Disconencts the event handler binding for event from self.
3398 Returns True if successful.
3399 """
3400 if source is not None:
3401 id = source.GetId()
3402 return event.Unbind(self, id, id2)
3403
3404 _core_.EvtHandler_swigregister(EvtHandler)
3405
3406 #---------------------------------------------------------------------------
3407
3408 class PyEventBinder(object):
3409 """
3410 Instances of this class are used to bind specific events to event
3411 handlers.
3412 """
3413 def __init__(self, evtType, expectedIDs=0):
3414 if expectedIDs not in [0, 1, 2]:
3415 raise ValueError, "Invalid number of expectedIDs"
3416 self.expectedIDs = expectedIDs
3417
3418 if type(evtType) == list or type(evtType) == tuple:
3419 self.evtType = evtType
3420 else:
3421 self.evtType = [evtType]
3422
3423
3424 def Bind(self, target, id1, id2, function):
3425 """Bind this set of event types to target."""
3426 for et in self.evtType:
3427 target.Connect(id1, id2, et, function)
3428
3429
3430 def Unbind(self, target, id1, id2):
3431 """Remove an event binding."""
3432 success = 0
3433 for et in self.evtType:
3434 success += target.Disconnect(id1, id2, et)
3435 return success != 0
3436
3437
3438 def __call__(self, *args):
3439 """
3440 For backwards compatibility with the old EVT_* functions.
3441 Should be called with either (window, func), (window, ID,
3442 func) or (window, ID1, ID2, func) parameters depending on the
3443 type of the event.
3444 """
3445 assert len(args) == 2 + self.expectedIDs
3446 id1 = wx.ID_ANY
3447 id2 = wx.ID_ANY
3448 target = args[0]
3449 if self.expectedIDs == 0:
3450 func = args[1]
3451 elif self.expectedIDs == 1:
3452 id1 = args[1]
3453 func = args[2]
3454 elif self.expectedIDs == 2:
3455 id1 = args[1]
3456 id2 = args[2]
3457 func = args[3]
3458 else:
3459 raise ValueError, "Unexpected number of IDs"
3460
3461 self.Bind(target, id1, id2, func)
3462
3463
3464 # These two are square pegs that don't fit the PyEventBinder hole...
3465 def EVT_COMMAND(win, id, cmd, func):
3466 win.Connect(id, -1, cmd, func)
3467 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3468 win.Connect(id1, id2, cmd, func)
3469
3470
3471 #---------------------------------------------------------------------------
3472
3473 #---------------------------------------------------------------------------
3474
3475 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3476 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3477
3478 def NewEventType(*args):
3479 """NewEventType() -> EventType"""
3480 return _core_.NewEventType(*args)
3481 wxEVT_NULL = _core_.wxEVT_NULL
3482 wxEVT_FIRST = _core_.wxEVT_FIRST
3483 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3484 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3485 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3486 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3487 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3488 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3489 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3490 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3491 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3492 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3493 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3494 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3495 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3496 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3497 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3498 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3499 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3500 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3501 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3502 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3503 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3504 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3505 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3506 wxEVT_MOTION = _core_.wxEVT_MOTION
3507 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3508 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3509 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3510 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3511 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3512 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3513 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3514 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3515 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3516 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3517 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3518 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3519 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3520 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3521 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3522 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3523 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3524 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3525 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3526 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3527 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3528 wxEVT_CHAR = _core_.wxEVT_CHAR
3529 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3530 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3531 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3532 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3533 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3534 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3535 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3536 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3537 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3538 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3539 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3540 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3541 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3542 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3543 wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3544 wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
3545 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3546 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3547 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3548 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3549 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3550 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3551 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3552 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3553 wxEVT_SIZE = _core_.wxEVT_SIZE
3554 wxEVT_MOVE = _core_.wxEVT_MOVE
3555 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3556 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3557 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3558 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3559 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3560 wxEVT_CREATE = _core_.wxEVT_CREATE
3561 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3562 wxEVT_SHOW = _core_.wxEVT_SHOW
3563 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3564 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3565 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3566 wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
3567 wxEVT_PAINT = _core_.wxEVT_PAINT
3568 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3569 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3570 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3571 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3572 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3573 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3574 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3575 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3576 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3577 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3578 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3579 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3580 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3581 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3582 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3583 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3584 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3585 wxEVT_IDLE = _core_.wxEVT_IDLE
3586 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3587 wxEVT_SIZING = _core_.wxEVT_SIZING
3588 wxEVT_MOVING = _core_.wxEVT_MOVING
3589 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3590 wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3591 wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3592 wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
3593 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3594 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3595 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3596 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3597 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3598 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3599 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3600 #
3601 # Create some event binders
3602 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3603 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3604 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3605 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3606 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3607 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3608 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3609 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3610 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3611 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3612 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3613 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3614 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3615 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3616 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3617 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3618 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3619 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3620 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3621 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3622 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3623 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3624 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3625 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3626 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3627 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3628 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3629 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3630 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3631 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3632 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3633 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3634 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3635 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3636 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3637 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3638 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3639 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3640 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3641 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3642 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3643 EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
3644
3645 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3646 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3647 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3648 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3649 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3650 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3651 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3652 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3653 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3654 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3655 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3656 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3657 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3658
3659 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3660 wxEVT_LEFT_UP,
3661 wxEVT_MIDDLE_DOWN,
3662 wxEVT_MIDDLE_UP,
3663 wxEVT_RIGHT_DOWN,
3664 wxEVT_RIGHT_UP,
3665 wxEVT_MOTION,
3666 wxEVT_LEFT_DCLICK,
3667 wxEVT_MIDDLE_DCLICK,
3668 wxEVT_RIGHT_DCLICK,
3669 wxEVT_ENTER_WINDOW,
3670 wxEVT_LEAVE_WINDOW,
3671 wxEVT_MOUSEWHEEL
3672 ])
3673
3674
3675 # Scrolling from wxWindow (sent to wxScrolledWindow)
3676 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3677 wxEVT_SCROLLWIN_BOTTOM,
3678 wxEVT_SCROLLWIN_LINEUP,
3679 wxEVT_SCROLLWIN_LINEDOWN,
3680 wxEVT_SCROLLWIN_PAGEUP,
3681 wxEVT_SCROLLWIN_PAGEDOWN,
3682 wxEVT_SCROLLWIN_THUMBTRACK,
3683 wxEVT_SCROLLWIN_THUMBRELEASE,
3684 ])
3685
3686 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3687 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3688 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3689 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3690 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3691 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3692 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3693 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3694
3695 # Scrolling from wx.Slider and wx.ScrollBar
3696 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3697 wxEVT_SCROLL_BOTTOM,
3698 wxEVT_SCROLL_LINEUP,
3699 wxEVT_SCROLL_LINEDOWN,
3700 wxEVT_SCROLL_PAGEUP,
3701 wxEVT_SCROLL_PAGEDOWN,
3702 wxEVT_SCROLL_THUMBTRACK,
3703 wxEVT_SCROLL_THUMBRELEASE,
3704 wxEVT_SCROLL_CHANGED,
3705 ])
3706
3707 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3708 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3709 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3710 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3711 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3712 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3713 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3714 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3715 EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3716 EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3717
3718 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3719 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3720 wxEVT_SCROLL_BOTTOM,
3721 wxEVT_SCROLL_LINEUP,
3722 wxEVT_SCROLL_LINEDOWN,
3723 wxEVT_SCROLL_PAGEUP,
3724 wxEVT_SCROLL_PAGEDOWN,
3725 wxEVT_SCROLL_THUMBTRACK,
3726 wxEVT_SCROLL_THUMBRELEASE,
3727 wxEVT_SCROLL_CHANGED,
3728 ], 1)
3729
3730 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3731 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3732 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3733 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3734 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3735 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3736 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3737 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3738 EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3739 EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
3740
3741 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3742 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3743 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3744 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3745 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3746 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3747 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3748 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3749 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3750 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3751
3752 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3753 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3754 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3755 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3756 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3757 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3758 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3759 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3760 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3761
3762
3763 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3764 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3765 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3766 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3767 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3768 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3769 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3770
3771 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3772
3773 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3774 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3775
3776 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3777
3778 EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3779 EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3780 EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
3781
3782
3783 #---------------------------------------------------------------------------
3784
3785 class Event(Object):
3786 """
3787 An event is a structure holding information about an event passed to a
3788 callback or member function. wx.Event is an abstract base class for
3789 other event classes
3790 """
3791 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3792 def __init__(self): raise AttributeError, "No constructor defined"
3793 __repr__ = _swig_repr
3794 __swig_destroy__ = _core_.delete_Event
3795 __del__ = lambda self : None;
3796 def SetEventType(*args, **kwargs):
3797 """
3798 SetEventType(self, EventType typ)
3799
3800 Sets the specific type of the event.
3801 """
3802 return _core_.Event_SetEventType(*args, **kwargs)
3803
3804 def GetEventType(*args, **kwargs):
3805 """
3806 GetEventType(self) -> EventType
3807
3808 Returns the identifier of the given event type, such as
3809 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3810 """
3811 return _core_.Event_GetEventType(*args, **kwargs)
3812
3813 def GetEventObject(*args, **kwargs):
3814 """
3815 GetEventObject(self) -> Object
3816
3817 Returns the object (usually a window) associated with the event, if
3818 any.
3819 """
3820 return _core_.Event_GetEventObject(*args, **kwargs)
3821
3822 def SetEventObject(*args, **kwargs):
3823 """
3824 SetEventObject(self, Object obj)
3825
3826 Sets the originating object, or in other words, obj is normally the
3827 object that is sending the event.
3828 """
3829 return _core_.Event_SetEventObject(*args, **kwargs)
3830
3831 def GetTimestamp(*args, **kwargs):
3832 """GetTimestamp(self) -> long"""
3833 return _core_.Event_GetTimestamp(*args, **kwargs)
3834
3835 def SetTimestamp(*args, **kwargs):
3836 """SetTimestamp(self, long ts=0)"""
3837 return _core_.Event_SetTimestamp(*args, **kwargs)
3838
3839 def GetId(*args, **kwargs):
3840 """
3841 GetId(self) -> int
3842
3843 Returns the identifier associated with this event, such as a button
3844 command id.
3845 """
3846 return _core_.Event_GetId(*args, **kwargs)
3847
3848 def SetId(*args, **kwargs):
3849 """
3850 SetId(self, int Id)
3851
3852 Set's the ID for the event. This is usually the ID of the window that
3853 is sending the event, but it can also be a command id from a menu
3854 item, etc.
3855 """
3856 return _core_.Event_SetId(*args, **kwargs)
3857
3858 def IsCommandEvent(*args, **kwargs):
3859 """
3860 IsCommandEvent(self) -> bool
3861
3862 Returns true if the event is or is derived from `wx.CommandEvent` else
3863 it returns false. Note: Exists only for optimization purposes.
3864 """
3865 return _core_.Event_IsCommandEvent(*args, **kwargs)
3866
3867 def Skip(*args, **kwargs):
3868 """
3869 Skip(self, bool skip=True)
3870
3871 Called by an event handler, it controls whether additional event
3872 handlers bound to this event will be called after the current event
3873 handler returns. Skip(false) (the default setting) will prevent
3874 additional event handlers from being called and control will be
3875 returned to the sender of the event immediately after the current
3876 handler has finished. Skip(True) will cause the event processing
3877 system to continue searching for a handler function for this event.
3878
3879 """
3880 return _core_.Event_Skip(*args, **kwargs)
3881
3882 def GetSkipped(*args, **kwargs):
3883 """
3884 GetSkipped(self) -> bool
3885
3886 Returns true if the event handler should be skipped, false otherwise.
3887 :see: `Skip`
3888 """
3889 return _core_.Event_GetSkipped(*args, **kwargs)
3890
3891 def ShouldPropagate(*args, **kwargs):
3892 """
3893 ShouldPropagate(self) -> bool
3894
3895 Test if this event should be propagated to the parent window or not,
3896 i.e. if the propagation level is currently greater than 0.
3897 """
3898 return _core_.Event_ShouldPropagate(*args, **kwargs)
3899
3900 def StopPropagation(*args, **kwargs):
3901 """
3902 StopPropagation(self) -> int
3903
3904 Stop the event from propagating to its parent window. Returns the old
3905 propagation level value which may be later passed to
3906 `ResumePropagation` to allow propagating the event again.
3907 """
3908 return _core_.Event_StopPropagation(*args, **kwargs)
3909
3910 def ResumePropagation(*args, **kwargs):
3911 """
3912 ResumePropagation(self, int propagationLevel)
3913
3914 Resume the event propagation by restoring the propagation level. (For
3915 example, you can use the value returned by an earlier call to
3916 `StopPropagation`.)
3917
3918 """
3919 return _core_.Event_ResumePropagation(*args, **kwargs)
3920
3921 def Clone(*args, **kwargs):
3922 """Clone(self) -> Event"""
3923 return _core_.Event_Clone(*args, **kwargs)
3924
3925 _core_.Event_swigregister(Event)
3926
3927 #---------------------------------------------------------------------------
3928
3929 class PropagationDisabler(object):
3930 """
3931 Helper class to temporarily change an event not to propagate. Simply
3932 create an instance of this class and then whe it is destroyed the
3933 propogation of the event will be restored.
3934 """
3935 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3936 __repr__ = _swig_repr
3937 def __init__(self, *args, **kwargs):
3938 """
3939 __init__(self, Event event) -> PropagationDisabler
3940
3941 Helper class to temporarily change an event not to propagate. Simply
3942 create an instance of this class and then whe it is destroyed the
3943 propogation of the event will be restored.
3944 """
3945 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3946 __swig_destroy__ = _core_.delete_PropagationDisabler
3947 __del__ = lambda self : None;
3948 _core_.PropagationDisabler_swigregister(PropagationDisabler)
3949
3950 class PropagateOnce(object):
3951 """
3952 A helper class that will temporarily lower propagation level of an
3953 event. Simply create an instance of this class and then whe it is
3954 destroyed the propogation of the event will be restored.
3955 """
3956 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3957 __repr__ = _swig_repr
3958 def __init__(self, *args, **kwargs):
3959 """
3960 __init__(self, Event event) -> PropagateOnce
3961
3962 A helper class that will temporarily lower propagation level of an
3963 event. Simply create an instance of this class and then whe it is
3964 destroyed the propogation of the event will be restored.
3965 """
3966 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3967 __swig_destroy__ = _core_.delete_PropagateOnce
3968 __del__ = lambda self : None;
3969 _core_.PropagateOnce_swigregister(PropagateOnce)
3970
3971 #---------------------------------------------------------------------------
3972
3973 class CommandEvent(Event):
3974 """
3975 This event class contains information about command events, which
3976 originate from a variety of simple controls, as well as menus and
3977 toolbars.
3978 """
3979 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3980 __repr__ = _swig_repr
3981 def __init__(self, *args, **kwargs):
3982 """
3983 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3984
3985 This event class contains information about command events, which
3986 originate from a variety of simple controls, as well as menus and
3987 toolbars.
3988 """
3989 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
3990 def GetSelection(*args, **kwargs):
3991 """
3992 GetSelection(self) -> int
3993
3994 Returns item index for a listbox or choice selection event (not valid
3995 for a deselection).
3996 """
3997 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3998
3999 def SetString(*args, **kwargs):
4000 """SetString(self, String s)"""
4001 return _core_.CommandEvent_SetString(*args, **kwargs)
4002
4003 def GetString(*args, **kwargs):
4004 """
4005 GetString(self) -> String
4006
4007 Returns item string for a listbox or choice selection event (not valid
4008 for a deselection).
4009 """
4010 return _core_.CommandEvent_GetString(*args, **kwargs)
4011
4012 def IsChecked(*args, **kwargs):
4013 """
4014 IsChecked(self) -> bool
4015
4016 This method can be used with checkbox and menu events: for the
4017 checkboxes, the method returns true for a selection event and false
4018 for a deselection one. For the menu events, this method indicates if
4019 the menu item just has become checked or unchecked (and thus only
4020 makes sense for checkable menu items).
4021 """
4022 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4023
4024 Checked = IsChecked
4025 def IsSelection(*args, **kwargs):
4026 """
4027 IsSelection(self) -> bool
4028
4029 For a listbox or similar event, returns true if it is a selection,
4030 false if it is a deselection.
4031 """
4032 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4033
4034 def SetExtraLong(*args, **kwargs):
4035 """SetExtraLong(self, long extraLong)"""
4036 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4037
4038 def GetExtraLong(*args, **kwargs):
4039 """
4040 GetExtraLong(self) -> long
4041
4042 Returns extra information dependant on the event objects type. If the
4043 event comes from a listbox selection, it is a boolean determining
4044 whether the event was a selection (true) or a deselection (false). A
4045 listbox deselection only occurs for multiple-selection boxes, and in
4046 this case the index and string values are indeterminate and the
4047 listbox must be examined by the application.
4048 """
4049 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4050
4051 def SetInt(*args, **kwargs):
4052 """SetInt(self, int i)"""
4053 return _core_.CommandEvent_SetInt(*args, **kwargs)
4054
4055 def GetInt(*args, **kwargs):
4056 """
4057 GetInt(self) -> int
4058
4059 Returns the integer identifier corresponding to a listbox, choice or
4060 radiobox selection (only if the event was a selection, not a
4061 deselection), or a boolean value representing the value of a checkbox.
4062 """
4063 return _core_.CommandEvent_GetInt(*args, **kwargs)
4064
4065 def GetClientData(*args, **kwargs):
4066 """
4067 GetClientData(self) -> PyObject
4068
4069 Returns the client data object for a listbox or choice selection event, (if any.)
4070 """
4071 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4072
4073 def SetClientData(*args, **kwargs):
4074 """
4075 SetClientData(self, PyObject clientData)
4076
4077 Associate the given client data with the item at position n.
4078 """
4079 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4080
4081 GetClientObject = GetClientData
4082 SetClientObject = SetClientData
4083
4084 def Clone(*args, **kwargs):
4085 """Clone(self) -> Event"""
4086 return _core_.CommandEvent_Clone(*args, **kwargs)
4087
4088 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4089 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4090 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4091 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4092 Selection = property(GetSelection,doc="See `GetSelection`")
4093 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
4094 _core_.CommandEvent_swigregister(CommandEvent)
4095
4096 #---------------------------------------------------------------------------
4097
4098 class NotifyEvent(CommandEvent):
4099 """
4100 An instance of this class (or one of its derived classes) is sent from
4101 a control when the control's state is being changed and the control
4102 allows that change to be prevented from happening. The event handler
4103 can call `Veto` or `Allow` to tell the control what to do.
4104 """
4105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4106 __repr__ = _swig_repr
4107 def __init__(self, *args, **kwargs):
4108 """
4109 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4110
4111 An instance of this class (or one of its derived classes) is sent from
4112 a control when the control's state is being changed and the control
4113 allows that change to be prevented from happening. The event handler
4114 can call `Veto` or `Allow` to tell the control what to do.
4115 """
4116 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
4117 def Veto(*args, **kwargs):
4118 """
4119 Veto(self)
4120
4121 Prevents the change announced by this event from happening.
4122
4123 It is in general a good idea to notify the user about the reasons for
4124 vetoing the change because otherwise the applications behaviour (which
4125 just refuses to do what the user wants) might be quite surprising.
4126 """
4127 return _core_.NotifyEvent_Veto(*args, **kwargs)
4128
4129 def Allow(*args, **kwargs):
4130 """
4131 Allow(self)
4132
4133 This is the opposite of `Veto`: it explicitly allows the event to be
4134 processed. For most events it is not necessary to call this method as
4135 the events are allowed anyhow but some are forbidden by default (this
4136 will be mentioned in the corresponding event description).
4137 """
4138 return _core_.NotifyEvent_Allow(*args, **kwargs)
4139
4140 def IsAllowed(*args, **kwargs):
4141 """
4142 IsAllowed(self) -> bool
4143
4144 Returns true if the change is allowed (`Veto` hasn't been called) or
4145 false otherwise (if it was).
4146 """
4147 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4148
4149 _core_.NotifyEvent_swigregister(NotifyEvent)
4150
4151 #---------------------------------------------------------------------------
4152
4153 class ScrollEvent(CommandEvent):
4154 """
4155 A scroll event holds information about events sent from stand-alone
4156 scrollbars and sliders. Note that scrolled windows do not send
4157 instnaces of this event class, but send the `wx.ScrollWinEvent`
4158 instead.
4159 """
4160 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4161 __repr__ = _swig_repr
4162 def __init__(self, *args, **kwargs):
4163 """
4164 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4165 int orient=0) -> ScrollEvent
4166 """
4167 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
4168 def GetOrientation(*args, **kwargs):
4169 """
4170 GetOrientation(self) -> int
4171
4172 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4173 the scrollbar.
4174 """
4175 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4176
4177 def GetPosition(*args, **kwargs):
4178 """
4179 GetPosition(self) -> int
4180
4181 Returns the position of the scrollbar.
4182 """
4183 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4184
4185 def SetOrientation(*args, **kwargs):
4186 """SetOrientation(self, int orient)"""
4187 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4188
4189 def SetPosition(*args, **kwargs):
4190 """SetPosition(self, int pos)"""
4191 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4192
4193 _core_.ScrollEvent_swigregister(ScrollEvent)
4194
4195 #---------------------------------------------------------------------------
4196
4197 class ScrollWinEvent(Event):
4198 """
4199 A wx.ScrollWinEvent holds information about scrolling and is sent from
4200 scrolling windows.
4201 """
4202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4203 __repr__ = _swig_repr
4204 def __init__(self, *args, **kwargs):
4205 """
4206 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4207
4208 A wx.ScrollWinEvent holds information about scrolling and is sent from
4209 scrolling windows.
4210 """
4211 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
4212 def GetOrientation(*args, **kwargs):
4213 """
4214 GetOrientation(self) -> int
4215
4216 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4217 the scrollbar.
4218 """
4219 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4220
4221 def GetPosition(*args, **kwargs):
4222 """
4223 GetPosition(self) -> int
4224
4225 Returns the position of the scrollbar for the thumb track and release
4226 events. Note that this field can't be used for the other events, you
4227 need to query the window itself for the current position in that case.
4228 """
4229 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4230
4231 def SetOrientation(*args, **kwargs):
4232 """SetOrientation(self, int orient)"""
4233 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4234
4235 def SetPosition(*args, **kwargs):
4236 """SetPosition(self, int pos)"""
4237 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4238
4239 _core_.ScrollWinEvent_swigregister(ScrollWinEvent)
4240
4241 #---------------------------------------------------------------------------
4242
4243 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4244 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4245 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4246 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4247 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4248 class MouseEvent(Event):
4249 """
4250 This event class contains information about the events generated by
4251 the mouse: they include mouse buttons press and release events and
4252 mouse move events.
4253
4254 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4255 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4256 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4257 a middle button so a portable application should avoid relying on the
4258 events from it.
4259
4260 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4261 the former returns true when the event corresponds to the left mouse
4262 button click while the latter returns true if the left mouse button is
4263 currently being pressed. For example, when the user is dragging the
4264 mouse you can use `LeftIsDown` to test whether the left mouse button
4265 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4266 `LeftIsDown` will also return true in wxWidgets whatever the
4267 underlying GUI behaviour is (which is platform-dependent). The same
4268 applies, of course, to other mouse buttons as well.
4269 """
4270 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4271 __repr__ = _swig_repr
4272 def __init__(self, *args, **kwargs):
4273 """
4274 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4275
4276 Constructs a wx.MouseEvent. Valid event types are:
4277
4278 * wxEVT_ENTER_WINDOW
4279 * wxEVT_LEAVE_WINDOW
4280 * wxEVT_LEFT_DOWN
4281 * wxEVT_LEFT_UP
4282 * wxEVT_LEFT_DCLICK
4283 * wxEVT_MIDDLE_DOWN
4284 * wxEVT_MIDDLE_UP
4285 * wxEVT_MIDDLE_DCLICK
4286 * wxEVT_RIGHT_DOWN
4287 * wxEVT_RIGHT_UP
4288 * wxEVT_RIGHT_DCLICK
4289 * wxEVT_MOTION
4290 * wxEVT_MOUSEWHEEL
4291 """
4292 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
4293 def IsButton(*args, **kwargs):
4294 """
4295 IsButton(self) -> bool
4296
4297 Returns true if the event was a mouse button event (not necessarily a
4298 button down event - that may be tested using `ButtonDown`).
4299 """
4300 return _core_.MouseEvent_IsButton(*args, **kwargs)
4301
4302 def ButtonDown(*args, **kwargs):
4303 """
4304 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4305
4306 If the argument is omitted, this returns true if the event was any
4307 mouse button down event. Otherwise the argument specifies which
4308 button-down event shold be checked for (see `Button` for the possible
4309 values).
4310 """
4311 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4312
4313 def ButtonDClick(*args, **kwargs):
4314 """
4315 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4316
4317 If the argument is omitted, this returns true if the event was any
4318 mouse double click event. Otherwise the argument specifies which
4319 double click event to check for (see `Button` for the possible
4320 values).
4321 """
4322 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4323
4324 def ButtonUp(*args, **kwargs):
4325 """
4326 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4327
4328 If the argument is omitted, this returns true if the event was any
4329 mouse button up event. Otherwise the argument specifies which button
4330 up event to check for (see `Button` for the possible values).
4331 """
4332 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4333
4334 def Button(*args, **kwargs):
4335 """
4336 Button(self, int button) -> bool
4337
4338 Returns true if the identified mouse button is changing state. Valid
4339 values of button are:
4340
4341 ==================== =====================================
4342 wx.MOUSE_BTN_LEFT check if left button was pressed
4343 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4344 wx.MOUSE_BTN_RIGHT check if right button was pressed
4345 wx.MOUSE_BTN_ANY check if any button was pressed
4346 ==================== =====================================
4347
4348 """
4349 return _core_.MouseEvent_Button(*args, **kwargs)
4350
4351 def ButtonIsDown(*args, **kwargs):
4352 """ButtonIsDown(self, int but) -> bool"""
4353 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4354
4355 def GetButton(*args, **kwargs):
4356 """
4357 GetButton(self) -> int
4358
4359 Returns the mouse button which generated this event or
4360 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4361 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4362 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4363 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4364 right buttons respectively.
4365 """
4366 return _core_.MouseEvent_GetButton(*args, **kwargs)
4367
4368 def ControlDown(*args, **kwargs):
4369 """
4370 ControlDown(self) -> bool
4371
4372 Returns true if the control key was down at the time of the event.
4373 """
4374 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4375
4376 def MetaDown(*args, **kwargs):
4377 """
4378 MetaDown(self) -> bool
4379
4380 Returns true if the Meta key was down at the time of the event.
4381 """
4382 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4383
4384 def AltDown(*args, **kwargs):
4385 """
4386 AltDown(self) -> bool
4387
4388 Returns true if the Alt key was down at the time of the event.
4389 """
4390 return _core_.MouseEvent_AltDown(*args, **kwargs)
4391
4392 def ShiftDown(*args, **kwargs):
4393 """
4394 ShiftDown(self) -> bool
4395
4396 Returns true if the Shift key was down at the time of the event.
4397 """
4398 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4399
4400 def CmdDown(*args, **kwargs):
4401 """
4402 CmdDown(self) -> bool
4403
4404 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4405 platforms but the special "Apple" (a.k.a as "Command") key on
4406 Macs. It often makes sense to use it instead of, say, `ControlDown`
4407 because Cmd key is used for the same thing under Mac as Ctrl
4408 elsewhere. The Ctrl key still exists, it's just not used for this
4409 purpose. So for non-Mac platforms this is the same as `ControlDown`
4410 and Macs this is the same as `MetaDown`.
4411 """
4412 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4413
4414 def LeftDown(*args, **kwargs):
4415 """
4416 LeftDown(self) -> bool
4417
4418 Returns true if the left mouse button state changed to down.
4419 """
4420 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4421
4422 def MiddleDown(*args, **kwargs):
4423 """
4424 MiddleDown(self) -> bool
4425
4426 Returns true if the middle mouse button state changed to down.
4427 """
4428 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4429
4430 def RightDown(*args, **kwargs):
4431 """
4432 RightDown(self) -> bool
4433
4434 Returns true if the right mouse button state changed to down.
4435 """
4436 return _core_.MouseEvent_RightDown(*args, **kwargs)
4437
4438 def LeftUp(*args, **kwargs):
4439 """
4440 LeftUp(self) -> bool
4441
4442 Returns true if the left mouse button state changed to up.
4443 """
4444 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4445
4446 def MiddleUp(*args, **kwargs):
4447 """
4448 MiddleUp(self) -> bool
4449
4450 Returns true if the middle mouse button state changed to up.
4451 """
4452 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4453
4454 def RightUp(*args, **kwargs):
4455 """
4456 RightUp(self) -> bool
4457
4458 Returns true if the right mouse button state changed to up.
4459 """
4460 return _core_.MouseEvent_RightUp(*args, **kwargs)
4461
4462 def LeftDClick(*args, **kwargs):
4463 """
4464 LeftDClick(self) -> bool
4465
4466 Returns true if the event was a left button double click.
4467 """
4468 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4469
4470 def MiddleDClick(*args, **kwargs):
4471 """
4472 MiddleDClick(self) -> bool
4473
4474 Returns true if the event was a middle button double click.
4475 """
4476 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4477
4478 def RightDClick(*args, **kwargs):
4479 """
4480 RightDClick(self) -> bool
4481
4482 Returns true if the event was a right button double click.
4483 """
4484 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4485
4486 def LeftIsDown(*args, **kwargs):
4487 """
4488 LeftIsDown(self) -> bool
4489
4490 Returns true if the left mouse button is currently down, independent
4491 of the current event type.
4492
4493 Please notice that it is not the same as LeftDown which returns true
4494 if the left mouse button was just pressed. Rather, it describes the
4495 state of the mouse button before the event happened.
4496
4497 This event is usually used in the mouse event handlers which process
4498 "move mouse" messages to determine whether the user is (still)
4499 dragging the mouse.
4500 """
4501 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4502
4503 def MiddleIsDown(*args, **kwargs):
4504 """
4505 MiddleIsDown(self) -> bool
4506
4507 Returns true if the middle mouse button is currently down, independent
4508 of the current event type.
4509 """
4510 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4511
4512 def RightIsDown(*args, **kwargs):
4513 """
4514 RightIsDown(self) -> bool
4515
4516 Returns true if the right mouse button is currently down, independent
4517 of the current event type.
4518 """
4519 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4520
4521 def Dragging(*args, **kwargs):
4522 """
4523 Dragging(self) -> bool
4524
4525 Returns true if this was a dragging event (motion while a button is
4526 depressed).
4527 """
4528 return _core_.MouseEvent_Dragging(*args, **kwargs)
4529
4530 def Moving(*args, **kwargs):
4531 """
4532 Moving(self) -> bool
4533
4534 Returns true if this was a motion event and no mouse buttons were
4535 pressed. If any mouse button is held pressed, then this method returns
4536 false and Dragging returns true.
4537 """
4538 return _core_.MouseEvent_Moving(*args, **kwargs)
4539
4540 def Entering(*args, **kwargs):
4541 """
4542 Entering(self) -> bool
4543
4544 Returns true if the mouse was entering the window.
4545 """
4546 return _core_.MouseEvent_Entering(*args, **kwargs)
4547
4548 def Leaving(*args, **kwargs):
4549 """
4550 Leaving(self) -> bool
4551
4552 Returns true if the mouse was leaving the window.
4553 """
4554 return _core_.MouseEvent_Leaving(*args, **kwargs)
4555
4556 def GetPosition(*args, **kwargs):
4557 """
4558 GetPosition(self) -> Point
4559
4560 Returns the pixel position of the mouse in window coordinates when the
4561 event happened.
4562 """
4563 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4564
4565 def GetPositionTuple(*args, **kwargs):
4566 """
4567 GetPositionTuple() -> (x,y)
4568
4569 Returns the pixel position of the mouse in window coordinates when the
4570 event happened.
4571 """
4572 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4573
4574 def GetLogicalPosition(*args, **kwargs):
4575 """
4576 GetLogicalPosition(self, DC dc) -> Point
4577
4578 Returns the logical mouse position in pixels (i.e. translated
4579 according to the translation set for the DC, which usually indicates
4580 that the window has been scrolled).
4581 """
4582 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4583
4584 def GetX(*args, **kwargs):
4585 """
4586 GetX(self) -> int
4587
4588 Returns X coordinate of the physical mouse event position.
4589 """
4590 return _core_.MouseEvent_GetX(*args, **kwargs)
4591
4592 def GetY(*args, **kwargs):
4593 """
4594 GetY(self) -> int
4595
4596 Returns Y coordinate of the physical mouse event position.
4597 """
4598 return _core_.MouseEvent_GetY(*args, **kwargs)
4599
4600 def GetWheelRotation(*args, **kwargs):
4601 """
4602 GetWheelRotation(self) -> int
4603
4604 Get wheel rotation, positive or negative indicates direction of
4605 rotation. Current devices all send an event when rotation is equal to
4606 +/-WheelDelta, but this allows for finer resolution devices to be
4607 created in the future. Because of this you shouldn't assume that one
4608 event is equal to 1 line or whatever, but you should be able to either
4609 do partial line scrolling or wait until +/-WheelDelta rotation values
4610 have been accumulated before scrolling.
4611 """
4612 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4613
4614 def GetWheelDelta(*args, **kwargs):
4615 """
4616 GetWheelDelta(self) -> int
4617
4618 Get wheel delta, normally 120. This is the threshold for action to be
4619 taken, and one such action (for example, scrolling one increment)
4620 should occur for each delta.
4621 """
4622 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4623
4624 def GetLinesPerAction(*args, **kwargs):
4625 """
4626 GetLinesPerAction(self) -> int
4627
4628 Returns the configured number of lines (or whatever) to be scrolled
4629 per wheel action. Defaults to three.
4630 """
4631 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4632
4633 def IsPageScroll(*args, **kwargs):
4634 """
4635 IsPageScroll(self) -> bool
4636
4637 Returns true if the system has been setup to do page scrolling with
4638 the mouse wheel instead of line scrolling.
4639 """
4640 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4641
4642 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4643 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4644 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4645 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4646 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4647 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4648 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4649 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4650 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4651 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4652 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4653 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4654 _core_.MouseEvent_swigregister(MouseEvent)
4655
4656 #---------------------------------------------------------------------------
4657
4658 class SetCursorEvent(Event):
4659 """
4660 A SetCursorEvent is generated when the mouse cursor is about to be set
4661 as a result of mouse motion. This event gives the application the
4662 chance to perform specific mouse cursor processing based on the
4663 current position of the mouse within the window. Use the `SetCursor`
4664 method to specify the cursor you want to be displayed.
4665 """
4666 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4667 __repr__ = _swig_repr
4668 def __init__(self, *args, **kwargs):
4669 """
4670 __init__(self, int x=0, int y=0) -> SetCursorEvent
4671
4672 Construct a new `wx.SetCursorEvent`.
4673 """
4674 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
4675 def GetX(*args, **kwargs):
4676 """
4677 GetX(self) -> int
4678
4679 Returns the X coordinate of the mouse in client coordinates.
4680 """
4681 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4682
4683 def GetY(*args, **kwargs):
4684 """
4685 GetY(self) -> int
4686
4687 Returns the Y coordinate of the mouse in client coordinates.
4688 """
4689 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4690
4691 def SetCursor(*args, **kwargs):
4692 """
4693 SetCursor(self, Cursor cursor)
4694
4695 Sets the cursor associated with this event.
4696 """
4697 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4698
4699 def GetCursor(*args, **kwargs):
4700 """
4701 GetCursor(self) -> Cursor
4702
4703 Returns a reference to the cursor specified by this event.
4704 """
4705 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4706
4707 def HasCursor(*args, **kwargs):
4708 """
4709 HasCursor(self) -> bool
4710
4711 Returns true if the cursor specified by this event is a valid cursor.
4712 """
4713 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4714
4715 _core_.SetCursorEvent_swigregister(SetCursorEvent)
4716
4717 #---------------------------------------------------------------------------
4718
4719 class KeyEvent(Event):
4720 """
4721 This event class contains information about keypress and character
4722 events. These events are only sent to the widget that currently has
4723 the keyboard focus.
4724
4725 Notice that there are three different kinds of keyboard events in
4726 wxWidgets: key down and up events and char events. The difference
4727 between the first two is clear - the first corresponds to a key press
4728 and the second to a key release - otherwise they are identical. Just
4729 note that if the key is maintained in a pressed state you will
4730 typically get a lot of (automatically generated) down events but only
4731 one up so it is wrong to assume that there is one up event
4732 corresponding to each down one.
4733
4734 Both key events provide untranslated key codes while the char event
4735 carries the translated one. The untranslated code for alphanumeric
4736 keys is always an upper case value. For the other keys it is one of
4737 WXK_XXX values from the keycodes table. The translated key is, in
4738 general, the character the user expects to appear as the result of the
4739 key combination when typing the text into a text entry zone, for
4740 example.
4741
4742 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4743 and the standard US keyboard): when the 'A' key is pressed, the key
4744 down event key code is equal to ASCII A == 65. But the char event key
4745 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4746 'A' keys simultaneously , the key code in key down event will still be
4747 just 'A' while the char event key code parameter will now be 'A' as
4748 well.
4749
4750 Although in this simple case it is clear that the correct key code
4751 could be found in the key down event handler by checking the value
4752 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4753 as for non alphanumeric keys or non-US keyboard layouts the
4754 translation is keyboard-layout dependent and can only be done properly
4755 by the system itself.
4756
4757 Another kind of translation is done when the control key is pressed:
4758 for example, for CTRL-A key press the key down event still carries the
4759 same key code 'A' as usual but the char event will have key code of 1,
4760 the ASCII value of this key combination.
4761
4762 You may discover how the other keys on your system behave
4763 interactively by running the KeyEvents sample in the wxPython demo and
4764 pressing some keys while the blue box at the top has the keyboard
4765 focus.
4766
4767 **Note**: If a key down event is caught and the event handler does not
4768 call event.Skip() then the coresponding char event will not
4769 happen. This is by design and enables the programs that handle both
4770 types of events to be a bit simpler.
4771
4772 **Note for Windows programmers**: The key and char events in wxWidgets
4773 are similar to but slightly different from Windows WM_KEYDOWN and
4774 WM_CHAR events. In particular, Alt-x combination will generate a char
4775 event in wxWidgets (unless it is used as an accelerator).
4776
4777 **Tip**: be sure to call event.Skip() for events that you don't
4778 process in key event function, otherwise menu shortcuts may cease to
4779 work under Windows.
4780
4781 """
4782 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4783 __repr__ = _swig_repr
4784 def __init__(self, *args, **kwargs):
4785 """
4786 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4787
4788 Construct a new `wx.KeyEvent`. Valid event types are:
4789 *
4790 """
4791 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
4792 def GetModifiers(*args, **kwargs):
4793 """
4794 GetModifiers(self) -> int
4795
4796 Returns a bitmask of the current modifier settings. Can be used to
4797 check if the key event has exactly the given modifiers without having
4798 to explicitly check that the other modifiers are not down. For
4799 example::
4800
4801 if event.GetModifers() == wx.MOD_CONTROL:
4802 DoSomething()
4803
4804 """
4805 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4806
4807 def ControlDown(*args, **kwargs):
4808 """
4809 ControlDown(self) -> bool
4810
4811 Returns ``True`` if the Control key was down at the time of the event.
4812 """
4813 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4814
4815 def MetaDown(*args, **kwargs):
4816 """
4817 MetaDown(self) -> bool
4818
4819 Returns ``True`` if the Meta key was down at the time of the event.
4820 """
4821 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4822
4823 def AltDown(*args, **kwargs):
4824 """
4825 AltDown(self) -> bool
4826
4827 Returns ``True`` if the Alt key was down at the time of the event.
4828 """
4829 return _core_.KeyEvent_AltDown(*args, **kwargs)
4830
4831 def ShiftDown(*args, **kwargs):
4832 """
4833 ShiftDown(self) -> bool
4834
4835 Returns ``True`` if the Shift key was down at the time of the event.
4836 """
4837 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4838
4839 def CmdDown(*args, **kwargs):
4840 """
4841 CmdDown(self) -> bool
4842
4843 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4844 platforms but the special "Apple" (a.k.a as "Command") key on
4845 Macs. It makes often sense to use it instead of, say, `ControlDown`
4846 because Cmd key is used for the same thing under Mac as Ctrl
4847 elsewhere. The Ctrl still exists, it's just not used for this
4848 purpose. So for non-Mac platforms this is the same as `ControlDown`
4849 and Macs this is the same as `MetaDown`.
4850 """
4851 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4852
4853 def HasModifiers(*args, **kwargs):
4854 """
4855 HasModifiers(self) -> bool
4856
4857 Returns true if either CTRL or ALT keys was down at the time of the
4858 key event. Note that this function does not take into account neither
4859 SHIFT nor META key states (the reason for ignoring the latter is that
4860 it is common for NUMLOCK key to be configured as META under X but the
4861 key presses even while NUMLOCK is on should be still processed
4862 normally).
4863 """
4864 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4865
4866 def GetKeyCode(*args, **kwargs):
4867 """
4868 GetKeyCode(self) -> int
4869
4870 Returns the virtual key code. ASCII events return normal ASCII values,
4871 while non-ASCII events return values such as WXK_LEFT for the left
4872 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4873 codes.
4874
4875 Note that in Unicode build, the returned value is meaningful only if
4876 the user entered a character that can be represented in current
4877 locale's default charset. You can obtain the corresponding Unicode
4878 character using `GetUnicodeKey`.
4879 """
4880 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4881
4882 KeyCode = GetKeyCode
4883 def GetUnicodeKey(*args, **kwargs):
4884 """
4885 GetUnicodeKey(self) -> int
4886
4887 Returns the Unicode character corresponding to this key event. This
4888 function is only meaningfule in a Unicode build of wxPython.
4889 """
4890 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4891
4892 GetUniChar = GetUnicodeKey
4893 def SetUnicodeKey(*args, **kwargs):
4894 """
4895 SetUnicodeKey(self, int uniChar)
4896
4897 Set the Unicode value of the key event, but only if this is a Unicode
4898 build of wxPython.
4899 """
4900 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4901
4902 def GetRawKeyCode(*args, **kwargs):
4903 """
4904 GetRawKeyCode(self) -> unsigned int
4905
4906 Returns the raw key code for this event. This is a platform-dependent
4907 scan code which should only be used in advanced
4908 applications. Currently the raw key codes are not supported by all
4909 ports.
4910 """
4911 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4912
4913 def GetRawKeyFlags(*args, **kwargs):
4914 """
4915 GetRawKeyFlags(self) -> unsigned int
4916
4917 Returns the low level key flags for this event. The flags are
4918 platform-dependent and should only be used in advanced applications.
4919 Currently the raw key flags are not supported by all ports.
4920 """
4921 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4922
4923 def GetPosition(*args, **kwargs):
4924 """
4925 GetPosition(self) -> Point
4926
4927 Find the position of the event, if applicable.
4928 """
4929 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4930
4931 def GetPositionTuple(*args, **kwargs):
4932 """
4933 GetPositionTuple() -> (x,y)
4934
4935 Find the position of the event, if applicable.
4936 """
4937 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4938
4939 def GetX(*args, **kwargs):
4940 """
4941 GetX(self) -> int
4942
4943 Returns the X position (in client coordinates) of the event, if
4944 applicable.
4945 """
4946 return _core_.KeyEvent_GetX(*args, **kwargs)
4947
4948 def GetY(*args, **kwargs):
4949 """
4950 GetY(self) -> int
4951
4952 Returns the Y position (in client coordinates) of the event, if
4953 applicable.
4954 """
4955 return _core_.KeyEvent_GetY(*args, **kwargs)
4956
4957 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4958 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4959 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4960 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4961 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4962 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4963 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4964 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4965 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4966 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4967 _core_.KeyEvent_swigregister(KeyEvent)
4968
4969 #---------------------------------------------------------------------------
4970
4971 class SizeEvent(Event):
4972 """
4973 A size event holds information about size change events. The EVT_SIZE
4974 handler function will be called when the window it is bound to has
4975 been resized.
4976
4977 Note that the size passed is of the whole window: call
4978 `wx.Window.GetClientSize` for the area which may be used by the
4979 application.
4980
4981 When a window is resized, usually only a small part of the window is
4982 damaged and and that area is all that is in the update region for the
4983 next paint event. However, if your drawing depends on the size of the
4984 window, you may need to clear the DC explicitly and repaint the whole
4985 window. In which case, you may need to call `wx.Window.Refresh` to
4986 invalidate the entire window.
4987
4988 """
4989 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4990 __repr__ = _swig_repr
4991 def __init__(self, *args, **kwargs):
4992 """
4993 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4994
4995 Construct a new ``wx.SizeEvent``.
4996 """
4997 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
4998 def GetSize(*args, **kwargs):
4999 """
5000 GetSize(self) -> Size
5001
5002 Returns the entire size of the window generating the size change
5003 event.
5004 """
5005 return _core_.SizeEvent_GetSize(*args, **kwargs)
5006
5007 def GetRect(*args, **kwargs):
5008 """GetRect(self) -> Rect"""
5009 return _core_.SizeEvent_GetRect(*args, **kwargs)
5010
5011 def SetRect(*args, **kwargs):
5012 """SetRect(self, Rect rect)"""
5013 return _core_.SizeEvent_SetRect(*args, **kwargs)
5014
5015 def SetSize(*args, **kwargs):
5016 """SetSize(self, Size size)"""
5017 return _core_.SizeEvent_SetSize(*args, **kwargs)
5018
5019 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5020 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5021 _core_.SizeEvent_swigregister(SizeEvent)
5022
5023 #---------------------------------------------------------------------------
5024
5025 class MoveEvent(Event):
5026 """
5027 This event object is sent for EVT_MOVE event bindings when a window is
5028 moved to a new position.
5029 """
5030 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5031 __repr__ = _swig_repr
5032 def __init__(self, *args, **kwargs):
5033 """
5034 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5035
5036 Constructor.
5037 """
5038 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
5039 def GetPosition(*args, **kwargs):
5040 """
5041 GetPosition(self) -> Point
5042
5043 Returns the position of the window generating the move change event.
5044 """
5045 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5046
5047 def GetRect(*args, **kwargs):
5048 """GetRect(self) -> Rect"""
5049 return _core_.MoveEvent_GetRect(*args, **kwargs)
5050
5051 def SetRect(*args, **kwargs):
5052 """SetRect(self, Rect rect)"""
5053 return _core_.MoveEvent_SetRect(*args, **kwargs)
5054
5055 def SetPosition(*args, **kwargs):
5056 """SetPosition(self, Point pos)"""
5057 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5058
5059 m_pos = property(GetPosition, SetPosition)
5060 m_rect = property(GetRect, SetRect)
5061
5062 _core_.MoveEvent_swigregister(MoveEvent)
5063
5064 #---------------------------------------------------------------------------
5065
5066 class PaintEvent(Event):
5067 """
5068 A paint event is sent when a window's contents needs to be repainted.
5069 Note that in an EVT_PAINT handler the application must *always* create
5070 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5071 Windows assumes that the window has not been painted yet and will send
5072 the event again, causing endless refreshes.
5073
5074 You can optimize painting by retrieving the rectangles that have been
5075 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5076 and only repainting these rectangles. The rectangles are in terms of
5077 the client area, and are unscrolled, so you will need to do some
5078 calculations using the current view position to obtain logical,
5079 scrolled units.
5080
5081 """
5082 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5083 __repr__ = _swig_repr
5084 def __init__(self, *args, **kwargs):
5085 """__init__(self, int Id=0) -> PaintEvent"""
5086 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5087 _core_.PaintEvent_swigregister(PaintEvent)
5088
5089 class NcPaintEvent(Event):
5090 """Proxy of C++ NcPaintEvent class"""
5091 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5092 __repr__ = _swig_repr
5093 def __init__(self, *args, **kwargs):
5094 """__init__(self, int winid=0) -> NcPaintEvent"""
5095 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5096 _core_.NcPaintEvent_swigregister(NcPaintEvent)
5097
5098 #---------------------------------------------------------------------------
5099
5100 class EraseEvent(Event):
5101 """
5102 An erase event is sent whenever the background of a window needs to be
5103 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5104 binder. On some platforms, such as GTK+, this event is simulated
5105 (simply generated just before the paint event) and may cause flicker.
5106
5107 To paint a custom background use the `GetDC` method and use the returned
5108 device context if it is not ``None``, otherwise create a temporary
5109 `wx.ClientDC` and draw on that.
5110
5111 """
5112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5113 __repr__ = _swig_repr
5114 def __init__(self, *args, **kwargs):
5115 """
5116 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5117
5118 Constructor
5119 """
5120 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
5121 def GetDC(*args, **kwargs):
5122 """
5123 GetDC(self) -> DC
5124
5125 Returns the device context the event handler should draw upon. If
5126 ``None`` is returned then create a temporary `wx.ClientDC` and use
5127 that instead.
5128 """
5129 return _core_.EraseEvent_GetDC(*args, **kwargs)
5130
5131 _core_.EraseEvent_swigregister(EraseEvent)
5132
5133 #---------------------------------------------------------------------------
5134
5135 class FocusEvent(Event):
5136 """
5137 A focus event is sent when a window's focus changes. The window losing
5138 focus receives an EVT_KILL_FOCUS event while the window gaining it
5139 gets an EVT_SET_FOCUS event.
5140
5141 Notice that the set focus event happens both when the user gives focus
5142 to the window (whether using the mouse or keyboard) and when it is
5143 done from the program itself using `wx.Window.SetFocus`.
5144
5145 """
5146 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5147 __repr__ = _swig_repr
5148 def __init__(self, *args, **kwargs):
5149 """
5150 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5151
5152 Constructor
5153 """
5154 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
5155 def GetWindow(*args, **kwargs):
5156 """
5157 GetWindow(self) -> Window
5158
5159 Returns the other window associated with this event, that is the
5160 window which had the focus before for the EVT_SET_FOCUS event and the
5161 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5162
5163 Warning: the window returned may be None!
5164 """
5165 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5166
5167 def SetWindow(*args, **kwargs):
5168 """SetWindow(self, Window win)"""
5169 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5170
5171 _core_.FocusEvent_swigregister(FocusEvent)
5172
5173 #---------------------------------------------------------------------------
5174
5175 class ChildFocusEvent(CommandEvent):
5176 """
5177 wx.ChildFocusEvent notifies the parent that a child has received the
5178 focus. Unlike `wx.FocusEvent` it is propagated up the window
5179 heirarchy.
5180 """
5181 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5182 __repr__ = _swig_repr
5183 def __init__(self, *args, **kwargs):
5184 """
5185 __init__(self, Window win=None) -> ChildFocusEvent
5186
5187 Constructor
5188 """
5189 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
5190 def GetWindow(*args, **kwargs):
5191 """
5192 GetWindow(self) -> Window
5193
5194 The window which has just received the focus.
5195 """
5196 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5197
5198 Window = property(GetWindow,doc="See `GetWindow`")
5199 _core_.ChildFocusEvent_swigregister(ChildFocusEvent)
5200
5201 #---------------------------------------------------------------------------
5202
5203 class ActivateEvent(Event):
5204 """
5205 An activate event is sent when a top-level window or the entire
5206 application is being activated or deactivated.
5207
5208 A top-level window (a dialog or frame) receives an activate event when
5209 is being activated or deactivated. This is indicated visually by the
5210 title bar changing colour, and a subwindow gaining the keyboard focus.
5211 An application is activated or deactivated when one of its frames
5212 becomes activated, or a frame becomes inactivate resulting in all
5213 application frames being inactive.
5214
5215 Please note that usually you should call event.Skip() in your handlers
5216 for these events so the default handlers will still be called, as not
5217 doing so can result in strange effects.
5218
5219 """
5220 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5221 __repr__ = _swig_repr
5222 def __init__(self, *args, **kwargs):
5223 """
5224 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5225
5226 Constructor
5227 """
5228 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
5229 def GetActive(*args, **kwargs):
5230 """
5231 GetActive(self) -> bool
5232
5233 Returns true if the application or window is being activated, false
5234 otherwise.
5235 """
5236 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5237
5238 Active = property(GetActive,doc="See `GetActive`")
5239 _core_.ActivateEvent_swigregister(ActivateEvent)
5240
5241 #---------------------------------------------------------------------------
5242
5243 class InitDialogEvent(Event):
5244 """
5245 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5246 any window when `wx.Window.InitDialog` is called. Handlers for this
5247 event can transfer data to the window, or anything else that should be
5248 done before the user begins editing the form. The default handler
5249 calls `wx.Window.TransferDataToWindow`.
5250 """
5251 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5252 __repr__ = _swig_repr
5253 def __init__(self, *args, **kwargs):
5254 """
5255 __init__(self, int Id=0) -> InitDialogEvent
5256
5257 Constructor
5258 """
5259 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5260 _core_.InitDialogEvent_swigregister(InitDialogEvent)
5261
5262 #---------------------------------------------------------------------------
5263
5264 class MenuEvent(Event):
5265 """
5266 This class is used for a variety of menu-related events. Note that
5267 these do not include menu command events, which are handled by sending
5268 `wx.CommandEvent` objects.
5269
5270 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5271 text in the first field of the status bar.
5272 """
5273 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5274 __repr__ = _swig_repr
5275 def __init__(self, *args, **kwargs):
5276 """
5277 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5278
5279 Constructor
5280 """
5281 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
5282 def GetMenuId(*args, **kwargs):
5283 """
5284 GetMenuId(self) -> int
5285
5286 Returns the menu identifier associated with the event. This method
5287 should be only used with the HIGHLIGHT events.
5288 """
5289 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5290
5291 def IsPopup(*args, **kwargs):
5292 """
5293 IsPopup(self) -> bool
5294
5295 Returns ``True`` if the menu which is being opened or closed is a
5296 popup menu, ``False`` if it is a normal one. This method should only
5297 be used with the OPEN and CLOSE events.
5298 """
5299 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5300
5301 def GetMenu(*args, **kwargs):
5302 """
5303 GetMenu(self) -> Menu
5304
5305 Returns the menu which is being opened or closed. This method should
5306 only be used with the OPEN and CLOSE events.
5307 """
5308 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5309
5310 _core_.MenuEvent_swigregister(MenuEvent)
5311
5312 #---------------------------------------------------------------------------
5313
5314 class CloseEvent(Event):
5315 """
5316 This event class contains information about window and session close
5317 events.
5318
5319 The handler function for EVT_CLOSE is called when the user has tried
5320 to close a a frame or dialog box using the window manager controls or
5321 the system menu. It can also be invoked by the application itself
5322 programmatically, for example by calling the `wx.Window.Close`
5323 function.
5324
5325 You should check whether the application is forcing the deletion of
5326 the window using `CanVeto`. If it returns ``False``, you must destroy
5327 the window using `wx.Window.Destroy`. If the return value is ``True``,
5328 it is up to you whether you respond by destroying the window or not.
5329 For example you may wish to display a message dialog prompting to save
5330 files or to cancel the close.
5331
5332 If you don't destroy the window, you should call `Veto` to let the
5333 calling code know that you did not destroy the window. This allows the
5334 `wx.Window.Close` function to return ``True`` or ``False`` depending
5335 on whether the close instruction was honored or not.
5336 """
5337 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5338 __repr__ = _swig_repr
5339 def __init__(self, *args, **kwargs):
5340 """
5341 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5342
5343 Constructor.
5344 """
5345 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
5346 def SetLoggingOff(*args, **kwargs):
5347 """
5348 SetLoggingOff(self, bool logOff)
5349
5350 Sets the 'logging off' flag.
5351 """
5352 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5353
5354 def GetLoggingOff(*args, **kwargs):
5355 """
5356 GetLoggingOff(self) -> bool
5357
5358 Returns ``True`` if the user is logging off or ``False`` if the
5359 system is shutting down. This method can only be called for end
5360 session and query end session events, it doesn't make sense for close
5361 window event.
5362 """
5363 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5364
5365 def Veto(*args, **kwargs):
5366 """
5367 Veto(self, bool veto=True)
5368
5369 Call this from your event handler to veto a system shutdown or to
5370 signal to the calling application that a window close did not happen.
5371
5372 You can only veto a shutdown or close if `CanVeto` returns true.
5373 """
5374 return _core_.CloseEvent_Veto(*args, **kwargs)
5375
5376 def GetVeto(*args, **kwargs):
5377 """GetVeto(self) -> bool"""
5378 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5379
5380 def SetCanVeto(*args, **kwargs):
5381 """
5382 SetCanVeto(self, bool canVeto)
5383
5384 Sets the 'can veto' flag.
5385 """
5386 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5387
5388 def CanVeto(*args, **kwargs):
5389 """
5390 CanVeto(self) -> bool
5391
5392 Returns true if you can veto a system shutdown or a window close
5393 event. Vetoing a window close event is not possible if the calling
5394 code wishes to force the application to exit, and so this function
5395 must be called to check this.
5396 """
5397 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5398
5399 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
5400 Veto = property(GetVeto,doc="See `GetVeto`")
5401 _core_.CloseEvent_swigregister(CloseEvent)
5402
5403 #---------------------------------------------------------------------------
5404
5405 class ShowEvent(Event):
5406 """An EVT_SHOW event is sent when a window is shown or hidden."""
5407 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5408 __repr__ = _swig_repr
5409 def __init__(self, *args, **kwargs):
5410 """
5411 __init__(self, int winid=0, bool show=False) -> ShowEvent
5412
5413 An EVT_SHOW event is sent when a window is shown or hidden.
5414 """
5415 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
5416 def SetShow(*args, **kwargs):
5417 """SetShow(self, bool show)"""
5418 return _core_.ShowEvent_SetShow(*args, **kwargs)
5419
5420 def GetShow(*args, **kwargs):
5421 """GetShow(self) -> bool"""
5422 return _core_.ShowEvent_GetShow(*args, **kwargs)
5423
5424 _core_.ShowEvent_swigregister(ShowEvent)
5425
5426 #---------------------------------------------------------------------------
5427
5428 class IconizeEvent(Event):
5429 """
5430 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5431 restored.
5432 """
5433 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5434 __repr__ = _swig_repr
5435 def __init__(self, *args, **kwargs):
5436 """
5437 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5438
5439 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5440 restored.
5441 """
5442 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
5443 def Iconized(*args, **kwargs):
5444 """
5445 Iconized(self) -> bool
5446
5447 Returns ``True`` if the frame has been iconized, ``False`` if it has
5448 been restored.
5449 """
5450 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5451
5452 _core_.IconizeEvent_swigregister(IconizeEvent)
5453
5454 #---------------------------------------------------------------------------
5455
5456 class MaximizeEvent(Event):
5457 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5459 __repr__ = _swig_repr
5460 def __init__(self, *args, **kwargs):
5461 """
5462 __init__(self, int id=0) -> MaximizeEvent
5463
5464 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5465 """
5466 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5467 _core_.MaximizeEvent_swigregister(MaximizeEvent)
5468
5469 #---------------------------------------------------------------------------
5470
5471 class DropFilesEvent(Event):
5472 """
5473 This class is used for drop files events, that is, when files have
5474 been dropped onto the window. This functionality is only available
5475 under Windows. The window must have previously been enabled for
5476 dropping by calling `wx.Window.DragAcceptFiles`.
5477
5478 Important note: this is a separate implementation to the more general
5479 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5480 implementation uses the older, Windows message-based approach of
5481 dropping files.
5482
5483 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5484 events.
5485
5486 """
5487 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5488 def __init__(self): raise AttributeError, "No constructor defined"
5489 __repr__ = _swig_repr
5490 def GetPosition(*args, **kwargs):
5491 """
5492 GetPosition(self) -> Point
5493
5494 Returns the position at which the files were dropped.
5495 """
5496 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5497
5498 def GetNumberOfFiles(*args, **kwargs):
5499 """
5500 GetNumberOfFiles(self) -> int
5501
5502 Returns the number of files dropped.
5503 """
5504 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5505
5506 def GetFiles(*args, **kwargs):
5507 """
5508 GetFiles(self) -> PyObject
5509
5510 Returns a list of the filenames that were dropped.
5511 """
5512 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5513
5514 Files = property(GetFiles,doc="See `GetFiles`")
5515 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5516 Position = property(GetPosition,doc="See `GetPosition`")
5517 _core_.DropFilesEvent_swigregister(DropFilesEvent)
5518
5519 #---------------------------------------------------------------------------
5520
5521 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5522 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5523 class UpdateUIEvent(CommandEvent):
5524 """
5525 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5526 wxWidgets to give an application the chance to update various user
5527 interface elements.
5528
5529 Without update UI events, an application has to work hard to
5530 check/uncheck, enable/disable, and set the text for elements such as
5531 menu items and toolbar buttons. The code for doing this has to be
5532 mixed up with the code that is invoked when an action is invoked for a
5533 menu item or button.
5534
5535 With update UI events, you define an event handler to look at the
5536 state of the application and change UI elements accordingly. wxWidgets
5537 will call your handler functions in idle time, so you don't have to
5538 worry where to call this code. In addition to being a clearer and more
5539 declarative method, it also means you don't have to worry whether
5540 you're updating a toolbar or menubar identifier. The same handler can
5541 update a menu item and toolbar button, if the ID values are the same.
5542
5543 Instead of directly manipulating the menu or button, you call
5544 functions in the event object, such as `Check`. wxWidgets will
5545 determine whether such a call has been made, and which UI element to
5546 update.
5547
5548 These events will work for popup menus as well as menubars. Just
5549 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5550 any UI events for the window that owns the menu.
5551
5552 If you find that the overhead of UI update processing is affecting
5553 your application, you can do one or both of the following:
5554
5555 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5556 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5557 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5558 receive update events. No other windows will receive update
5559 events.
5560
5561 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5562 value to set the delay between updates. You may need to call
5563 `wx.Window.UpdateWindowUI` at critical points, for example when
5564 a dialog is about to be shown, in case the user sees a slight
5565 delay before windows are updated.
5566
5567 Note that although events are sent in idle time, defining a EVT_IDLE
5568 handler for a window does not affect this because the events are sent
5569 from an internal idle handler.
5570
5571 wxWidgets tries to optimize update events on some platforms. On
5572 Windows and GTK+, events for menubar items are only sent when the menu
5573 is about to be shown, and not in idle time.
5574
5575 """
5576 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5577 __repr__ = _swig_repr
5578 def __init__(self, *args, **kwargs):
5579 """
5580 __init__(self, int commandId=0) -> UpdateUIEvent
5581
5582 Constructor
5583 """
5584 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
5585 def GetChecked(*args, **kwargs):
5586 """
5587 GetChecked(self) -> bool
5588
5589 Returns ``True`` if the UI element should be checked.
5590 """
5591 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5592
5593 def GetEnabled(*args, **kwargs):
5594 """
5595 GetEnabled(self) -> bool
5596
5597 Returns ``True`` if the UI element should be enabled.
5598 """
5599 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5600
5601 def GetShown(*args, **kwargs):
5602 """
5603 GetShown(self) -> bool
5604
5605 Returns ``True`` if the UI element should be shown.
5606 """
5607 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5608
5609 def GetText(*args, **kwargs):
5610 """
5611 GetText(self) -> String
5612
5613 Returns the text that should be set for the UI element.
5614 """
5615 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5616
5617 def GetSetText(*args, **kwargs):
5618 """
5619 GetSetText(self) -> bool
5620
5621 Returns ``True`` if the application has called `SetText`. For
5622 wxWidgets internal use only.
5623 """
5624 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5625
5626 def GetSetChecked(*args, **kwargs):
5627 """
5628 GetSetChecked(self) -> bool
5629
5630 Returns ``True`` if the application has called `Check`. For wxWidgets
5631 internal use only.
5632 """
5633 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5634
5635 def GetSetEnabled(*args, **kwargs):
5636 """
5637 GetSetEnabled(self) -> bool
5638
5639 Returns ``True`` if the application has called `Enable`. For wxWidgets
5640 internal use only.
5641 """
5642 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5643
5644 def GetSetShown(*args, **kwargs):
5645 """
5646 GetSetShown(self) -> bool
5647
5648 Returns ``True`` if the application has called `Show`. For wxWidgets
5649 internal use only.
5650 """
5651 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5652
5653 def Check(*args, **kwargs):
5654 """
5655 Check(self, bool check)
5656
5657 Check or uncheck the UI element.
5658 """
5659 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5660
5661 def Enable(*args, **kwargs):
5662 """
5663 Enable(self, bool enable)
5664
5665 Enable or disable the UI element.
5666 """
5667 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5668
5669 def Show(*args, **kwargs):
5670 """
5671 Show(self, bool show)
5672
5673 Show or hide the UI element.
5674 """
5675 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5676
5677 def SetText(*args, **kwargs):
5678 """
5679 SetText(self, String text)
5680
5681 Sets the text for this UI element.
5682 """
5683 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5684
5685 def SetUpdateInterval(*args, **kwargs):
5686 """
5687 SetUpdateInterval(long updateInterval)
5688
5689 Sets the interval between updates in milliseconds. Set to -1 to
5690 disable updates, or to 0 to update as frequently as possible. The
5691 default is 0.
5692
5693 Use this to reduce the overhead of UI update events if your
5694 application has a lot of windows. If you set the value to -1 or
5695 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5696 at appropriate points in your application, such as when a dialog is
5697 about to be shown.
5698 """
5699 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5700
5701 SetUpdateInterval = staticmethod(SetUpdateInterval)
5702 def GetUpdateInterval(*args, **kwargs):
5703 """
5704 GetUpdateInterval() -> long
5705
5706 Returns the current interval between updates in milliseconds. -1
5707 disables updates, 0 updates as frequently as possible.
5708 """
5709 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5710
5711 GetUpdateInterval = staticmethod(GetUpdateInterval)
5712 def CanUpdate(*args, **kwargs):
5713 """
5714 CanUpdate(Window win) -> bool
5715
5716 Returns ``True`` if it is appropriate to update (send UI update events
5717 to) this window.
5718
5719 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5720 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5721 events were last sent in idle time, and the update interval, to
5722 determine whether events should be sent to this window now. By default
5723 this will always return true because the update mode is initially
5724 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5725 events will be sent as often as possible. You can reduce the frequency
5726 that events are sent by changing the mode and/or setting an update
5727 interval.
5728
5729 """
5730 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5731
5732 CanUpdate = staticmethod(CanUpdate)
5733 def ResetUpdateTime(*args, **kwargs):
5734 """
5735 ResetUpdateTime()
5736
5737 Used internally to reset the last-updated time to the current time. It
5738 is assumed that update events are normally sent in idle time, so this
5739 is called at the end of idle processing.
5740 """
5741 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5742
5743 ResetUpdateTime = staticmethod(ResetUpdateTime)
5744 def SetMode(*args, **kwargs):
5745 """
5746 SetMode(int mode)
5747
5748 Specify how wxWidgets will send update events: to all windows, or only
5749 to those which specify that they will process the events.
5750
5751 The mode may be one of the following values:
5752
5753 ============================= ==========================================
5754 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5755 is the default setting.
5756 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5757 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5758 style set.
5759 ============================= ==========================================
5760
5761 """
5762 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5763
5764 SetMode = staticmethod(SetMode)
5765 def GetMode(*args, **kwargs):
5766 """
5767 GetMode() -> int
5768
5769 Returns a value specifying how wxWidgets will send update events: to
5770 all windows, or only to those which specify that they will process the
5771 events.
5772 """
5773 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5774
5775 GetMode = staticmethod(GetMode)
5776 _core_.UpdateUIEvent_swigregister(UpdateUIEvent)
5777
5778 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5779 """
5780 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5781
5782 Sets the interval between updates in milliseconds. Set to -1 to
5783 disable updates, or to 0 to update as frequently as possible. The
5784 default is 0.
5785
5786 Use this to reduce the overhead of UI update events if your
5787 application has a lot of windows. If you set the value to -1 or
5788 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5789 at appropriate points in your application, such as when a dialog is
5790 about to be shown.
5791 """
5792 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5793
5794 def UpdateUIEvent_GetUpdateInterval(*args):
5795 """
5796 UpdateUIEvent_GetUpdateInterval() -> long
5797
5798 Returns the current interval between updates in milliseconds. -1
5799 disables updates, 0 updates as frequently as possible.
5800 """
5801 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
5802
5803 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5804 """
5805 UpdateUIEvent_CanUpdate(Window win) -> bool
5806
5807 Returns ``True`` if it is appropriate to update (send UI update events
5808 to) this window.
5809
5810 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5811 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5812 events were last sent in idle time, and the update interval, to
5813 determine whether events should be sent to this window now. By default
5814 this will always return true because the update mode is initially
5815 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5816 events will be sent as often as possible. You can reduce the frequency
5817 that events are sent by changing the mode and/or setting an update
5818 interval.
5819
5820 """
5821 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5822
5823 def UpdateUIEvent_ResetUpdateTime(*args):
5824 """
5825 UpdateUIEvent_ResetUpdateTime()
5826
5827 Used internally to reset the last-updated time to the current time. It
5828 is assumed that update events are normally sent in idle time, so this
5829 is called at the end of idle processing.
5830 """
5831 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
5832
5833 def UpdateUIEvent_SetMode(*args, **kwargs):
5834 """
5835 UpdateUIEvent_SetMode(int mode)
5836
5837 Specify how wxWidgets will send update events: to all windows, or only
5838 to those which specify that they will process the events.
5839
5840 The mode may be one of the following values:
5841
5842 ============================= ==========================================
5843 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5844 is the default setting.
5845 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5846 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5847 style set.
5848 ============================= ==========================================
5849
5850 """
5851 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5852
5853 def UpdateUIEvent_GetMode(*args):
5854 """
5855 UpdateUIEvent_GetMode() -> int
5856
5857 Returns a value specifying how wxWidgets will send update events: to
5858 all windows, or only to those which specify that they will process the
5859 events.
5860 """
5861 return _core_.UpdateUIEvent_GetMode(*args)
5862
5863 #---------------------------------------------------------------------------
5864
5865 class SysColourChangedEvent(Event):
5866 """
5867 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5868 when the user changes the colour settings using the control
5869 panel. This is only applicable under Windows.
5870
5871 The default event handler for this event propagates the event to child
5872 windows, since Windows only sends the events to top-level windows. If
5873 intercepting this event for a top-level window, remember to call
5874 `Skip` so the the base class handler will still be executed, or to
5875 pass the event on to the window's children explicitly.
5876
5877 """
5878 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5879 __repr__ = _swig_repr
5880 def __init__(self, *args, **kwargs):
5881 """
5882 __init__(self) -> SysColourChangedEvent
5883
5884 Constructor
5885 """
5886 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5887 _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
5888
5889 #---------------------------------------------------------------------------
5890
5891 class MouseCaptureChangedEvent(Event):
5892 """
5893 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5894 a window that loses its mouse capture. This is called even if
5895 `wx.Window.ReleaseMouse` was called by the application code. Handling
5896 this event allows an application to cater for unexpected capture
5897 releases which might otherwise confuse mouse handling code.
5898
5899 This event is implemented under Windows only.
5900 """
5901 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5902 __repr__ = _swig_repr
5903 def __init__(self, *args, **kwargs):
5904 """
5905 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5906
5907 Constructor
5908 """
5909 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
5910 def GetCapturedWindow(*args, **kwargs):
5911 """
5912 GetCapturedWindow(self) -> Window
5913
5914 Returns the window that gained the capture, or ``None`` if it was a
5915 non-wxWidgets window.
5916 """
5917 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5918
5919 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
5920
5921 #---------------------------------------------------------------------------
5922
5923 class MouseCaptureLostEvent(Event):
5924 """
5925 A mouse capture lost event is sent to a window that obtained mouse
5926 capture, which was subsequently loss due to "external" event, for
5927 example when a dialog box is shown or if another application captures
5928 the mouse.
5929
5930 If this happens, this event is sent to all windows that are on the
5931 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5932 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5933 if the capture changes because of a call to CaptureMouse or
5934 ReleaseMouse.
5935
5936 This event is currently emitted under Windows only.
5937
5938 """
5939 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5940 __repr__ = _swig_repr
5941 def __init__(self, *args, **kwargs):
5942 """
5943 __init__(self, int winid=0) -> MouseCaptureLostEvent
5944
5945 A mouse capture lost event is sent to a window that obtained mouse
5946 capture, which was subsequently loss due to "external" event, for
5947 example when a dialog box is shown or if another application captures
5948 the mouse.
5949
5950 If this happens, this event is sent to all windows that are on the
5951 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5952 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5953 if the capture changes because of a call to CaptureMouse or
5954 ReleaseMouse.
5955
5956 This event is currently emitted under Windows only.
5957
5958 """
5959 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
5960 _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
5961
5962 #---------------------------------------------------------------------------
5963
5964 class DisplayChangedEvent(Event):
5965 """
5966 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5967 resolution has changed.
5968
5969 This event is implemented under Windows only.
5970 """
5971 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5972 __repr__ = _swig_repr
5973 def __init__(self, *args, **kwargs):
5974 """__init__(self) -> DisplayChangedEvent"""
5975 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5976 _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
5977
5978 #---------------------------------------------------------------------------
5979
5980 class PaletteChangedEvent(Event):
5981 """
5982 An EVT_PALETTE_CHANGED event is sent when the system palette has
5983 changed, thereby giving each window a chance to redo their own to
5984 match.
5985
5986 This event is implemented under Windows only.
5987 """
5988 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5989 __repr__ = _swig_repr
5990 def __init__(self, *args, **kwargs):
5991 """
5992 __init__(self, int id=0) -> PaletteChangedEvent
5993
5994 An EVT_PALETTE_CHANGED event is sent when the system palette has
5995 changed, thereby giving each window a chance to redo their own to
5996 match.
5997
5998 This event is implemented under Windows only.
5999 """
6000 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
6001 def SetChangedWindow(*args, **kwargs):
6002 """SetChangedWindow(self, Window win)"""
6003 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6004
6005 def GetChangedWindow(*args, **kwargs):
6006 """GetChangedWindow(self) -> Window"""
6007 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6008
6009 _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
6010
6011 #---------------------------------------------------------------------------
6012
6013 class QueryNewPaletteEvent(Event):
6014 """
6015 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6016 focus and should re-do its palette.
6017
6018 This event is implemented under Windows only.
6019 """
6020 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6021 __repr__ = _swig_repr
6022 def __init__(self, *args, **kwargs):
6023 """
6024 __init__(self, int winid=0) -> QueryNewPaletteEvent
6025
6026 Constructor.
6027 """
6028 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
6029 def SetPaletteRealized(*args, **kwargs):
6030 """
6031 SetPaletteRealized(self, bool realized)
6032
6033 App should set this if it changes the palette.
6034 """
6035 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6036
6037 def GetPaletteRealized(*args, **kwargs):
6038 """GetPaletteRealized(self) -> bool"""
6039 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6040
6041 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
6042
6043 #---------------------------------------------------------------------------
6044
6045 class NavigationKeyEvent(Event):
6046 """
6047 EVT_NAVIGATION_KEY events are used to control moving the focus between
6048 widgets, otherwise known as tab-traversal. You woudl normally not
6049 catch navigation events in applications as there are already
6050 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6051 it useful to send navigation events in certain situations to change
6052 the focus in certain ways, although it's probably easier to just call
6053 `wx.Window.Navigate`.
6054 """
6055 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6056 __repr__ = _swig_repr
6057 def __init__(self, *args, **kwargs):
6058 """__init__(self) -> NavigationKeyEvent"""
6059 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
6060 def GetDirection(*args, **kwargs):
6061 """
6062 GetDirection(self) -> bool
6063
6064 Returns ``True`` if the direction is forward, ``False`` otherwise.
6065 """
6066 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6067
6068 def SetDirection(*args, **kwargs):
6069 """
6070 SetDirection(self, bool forward)
6071
6072 Specify the direction that the navigation should take. Usually the
6073 difference between using Tab and Shift-Tab.
6074 """
6075 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6076
6077 def IsWindowChange(*args, **kwargs):
6078 """
6079 IsWindowChange(self) -> bool
6080
6081 Returns ``True`` if window change is allowed.
6082 """
6083 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6084
6085 def SetWindowChange(*args, **kwargs):
6086 """
6087 SetWindowChange(self, bool ischange)
6088
6089 Specify if the navigation should be able to change parent windows.
6090 For example, changing notebook pages, etc. This is usually implemented
6091 by using Control-Tab.
6092 """
6093 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6094
6095 def IsFromTab(*args, **kwargs):
6096 """
6097 IsFromTab(self) -> bool
6098
6099 Returns ``True`` if the navigation event is originated from the Tab
6100 key.
6101 """
6102 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6103
6104 def SetFromTab(*args, **kwargs):
6105 """
6106 SetFromTab(self, bool bIs)
6107
6108 Set to true under MSW if the event was generated using the tab key.
6109 This is required for proper navogation over radio buttons.
6110 """
6111 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6112
6113 def SetFlags(*args, **kwargs):
6114 """
6115 SetFlags(self, long flags)
6116
6117 Set the navigation flags to a combination of the following:
6118
6119 * wx.NavigationKeyEvent.IsBackward
6120 * wx.NavigationKeyEvent.IsForward
6121 * wx.NavigationKeyEvent.WinChange
6122 * wx.NavigationKeyEvent.FromTab
6123
6124 """
6125 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6126
6127 def GetCurrentFocus(*args, **kwargs):
6128 """
6129 GetCurrentFocus(self) -> Window
6130
6131 Returns the child window which currenty has the focus. May be
6132 ``None``.
6133 """
6134 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6135
6136 def SetCurrentFocus(*args, **kwargs):
6137 """
6138 SetCurrentFocus(self, Window win)
6139
6140 Set the window that has the focus.
6141 """
6142 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6143
6144 IsBackward = _core_.NavigationKeyEvent_IsBackward
6145 IsForward = _core_.NavigationKeyEvent_IsForward
6146 WinChange = _core_.NavigationKeyEvent_WinChange
6147 FromTab = _core_.NavigationKeyEvent_FromTab
6148 _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
6149
6150 #---------------------------------------------------------------------------
6151
6152 class WindowCreateEvent(CommandEvent):
6153 """
6154 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6155 underlying GUI object) exists.
6156 """
6157 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6158 __repr__ = _swig_repr
6159 def __init__(self, *args, **kwargs):
6160 """
6161 __init__(self, Window win=None) -> WindowCreateEvent
6162
6163 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6164 underlying GUI object) exists.
6165 """
6166 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
6167 def GetWindow(*args, **kwargs):
6168 """
6169 GetWindow(self) -> Window
6170
6171 Returns the window that this event refers to.
6172 """
6173 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6174
6175 _core_.WindowCreateEvent_swigregister(WindowCreateEvent)
6176
6177 class WindowDestroyEvent(CommandEvent):
6178 """
6179 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6180 when the GUI window is destroyed.
6181
6182 When a class derived from `wx.Window` is destroyed its destructor will
6183 have already run by the time this event is sent. Therefore this event
6184 will not usually be received at all by the window itself. Since it is
6185 received after the destructor has run, an object should not try to
6186 handle its own wx.WindowDestroyEvent, but it can be used to get
6187 notification of the destruction of another window.
6188 """
6189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6190 __repr__ = _swig_repr
6191 def __init__(self, *args, **kwargs):
6192 """
6193 __init__(self, Window win=None) -> WindowDestroyEvent
6194
6195 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6196 when the GUI window is destroyed.
6197
6198 When a class derived from `wx.Window` is destroyed its destructor will
6199 have already run by the time this event is sent. Therefore this event
6200 will not usually be received at all by the window itself. Since it is
6201 received after the destructor has run, an object should not try to
6202 handle its own wx.WindowDestroyEvent, but it can be used to get
6203 notification of the destruction of another window.
6204 """
6205 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
6206 def GetWindow(*args, **kwargs):
6207 """
6208 GetWindow(self) -> Window
6209
6210 Returns the window that this event refers to.
6211 """
6212 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6213
6214 _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
6215
6216 #---------------------------------------------------------------------------
6217
6218 class ContextMenuEvent(CommandEvent):
6219 """
6220 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6221 give the application a chance to show a context (popup) menu.
6222 """
6223 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6224 __repr__ = _swig_repr
6225 def __init__(self, *args, **kwargs):
6226 """
6227 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6228
6229 Constructor.
6230 """
6231 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
6232 def GetPosition(*args, **kwargs):
6233 """
6234 GetPosition(self) -> Point
6235
6236 Returns the position (in screen coordinants) at which the menu should
6237 be shown.
6238 """
6239 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6240
6241 def SetPosition(*args, **kwargs):
6242 """
6243 SetPosition(self, Point pos)
6244
6245 Sets the position at which the menu should be shown.
6246 """
6247 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6248
6249 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
6250 _core_.ContextMenuEvent_swigregister(ContextMenuEvent)
6251
6252 #---------------------------------------------------------------------------
6253
6254 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6255 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6256 class IdleEvent(Event):
6257 """
6258 This class is used for EVT_IDLE events, which are generated and sent
6259 when the application *becomes* idle. In other words, the when the
6260 event queue becomes empty then idle events are sent to all windows (by
6261 default) and as long as none of them call `RequestMore` then there are
6262 no more idle events until after the system event queue has some normal
6263 events and then becomes empty again.
6264
6265 By default, idle events are sent to all windows. If this is causing a
6266 significant overhead in your application, you can call
6267 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6268 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6269 which should receive idle events. Then idle events will only be sent
6270 to those windows and not to any others.
6271 """
6272 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6273 __repr__ = _swig_repr
6274 def __init__(self, *args, **kwargs):
6275 """
6276 __init__(self) -> IdleEvent
6277
6278 Constructor
6279 """
6280 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
6281 def RequestMore(*args, **kwargs):
6282 """
6283 RequestMore(self, bool needMore=True)
6284
6285 Tells wxWidgets that more processing is required. This function can be
6286 called by an EVT_IDLE handler for a window to indicate that the
6287 application should forward the EVT_IDLE event once more to the
6288 application windows. If no window calls this function during its
6289 EVT_IDLE handler, then the application will remain in a passive event
6290 loop until a new event is posted to the application by the windowing
6291 system.
6292 """
6293 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6294
6295 def MoreRequested(*args, **kwargs):
6296 """
6297 MoreRequested(self) -> bool
6298
6299 Returns ``True`` if the OnIdle function processing this event
6300 requested more processing time.
6301 """
6302 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6303
6304 def SetMode(*args, **kwargs):
6305 """
6306 SetMode(int mode)
6307
6308 Static method for specifying how wxWidgets will send idle events: to
6309 all windows, or only to those which specify that they will process the
6310 events.
6311
6312 The mode can be one of the following values:
6313
6314 ========================= ========================================
6315 wx.IDLE_PROCESS_ALL Send idle events to all windows
6316 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6317 the wx.WS_EX_PROCESS_IDLE extra style
6318 flag set.
6319 ========================= ========================================
6320
6321 """
6322 return _core_.IdleEvent_SetMode(*args, **kwargs)
6323
6324 SetMode = staticmethod(SetMode)
6325 def GetMode(*args, **kwargs):
6326 """
6327 GetMode() -> int
6328
6329 Static method returning a value specifying how wxWidgets will send
6330 idle events: to all windows, or only to those which specify that they
6331 will process the events.
6332 """
6333 return _core_.IdleEvent_GetMode(*args, **kwargs)
6334
6335 GetMode = staticmethod(GetMode)
6336 def CanSend(*args, **kwargs):
6337 """
6338 CanSend(Window win) -> bool
6339
6340 Returns ``True`` if it is appropriate to send idle events to this
6341 window.
6342
6343 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6344 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6345 events should be sent to this window now. By default this will always
6346 return ``True`` because the update mode is initially
6347 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6348 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6349 """
6350 return _core_.IdleEvent_CanSend(*args, **kwargs)
6351
6352 CanSend = staticmethod(CanSend)
6353 _core_.IdleEvent_swigregister(IdleEvent)
6354
6355 def IdleEvent_SetMode(*args, **kwargs):
6356 """
6357 IdleEvent_SetMode(int mode)
6358
6359 Static method for specifying how wxWidgets will send idle events: to
6360 all windows, or only to those which specify that they will process the
6361 events.
6362
6363 The mode can be one of the following values:
6364
6365 ========================= ========================================
6366 wx.IDLE_PROCESS_ALL Send idle events to all windows
6367 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6368 the wx.WS_EX_PROCESS_IDLE extra style
6369 flag set.
6370 ========================= ========================================
6371
6372 """
6373 return _core_.IdleEvent_SetMode(*args, **kwargs)
6374
6375 def IdleEvent_GetMode(*args):
6376 """
6377 IdleEvent_GetMode() -> int
6378
6379 Static method returning a value specifying how wxWidgets will send
6380 idle events: to all windows, or only to those which specify that they
6381 will process the events.
6382 """
6383 return _core_.IdleEvent_GetMode(*args)
6384
6385 def IdleEvent_CanSend(*args, **kwargs):
6386 """
6387 IdleEvent_CanSend(Window win) -> bool
6388
6389 Returns ``True`` if it is appropriate to send idle events to this
6390 window.
6391
6392 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6393 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6394 events should be sent to this window now. By default this will always
6395 return ``True`` because the update mode is initially
6396 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6397 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6398 """
6399 return _core_.IdleEvent_CanSend(*args, **kwargs)
6400
6401 #---------------------------------------------------------------------------
6402
6403 class ClipboardTextEvent(CommandEvent):
6404 """
6405 A Clipboard Text event is sent when a window intercepts a text
6406 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6407 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6408 popup menu command, etc. NOTE : under windows these events are *NOT*
6409 generated automatically for a Rich Edit text control.
6410 """
6411 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6412 __repr__ = _swig_repr
6413 def __init__(self, *args, **kwargs):
6414 """
6415 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6416
6417 A Clipboard Text event is sent when a window intercepts a text
6418 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6419 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6420 popup menu command, etc. NOTE : under windows these events are *NOT*
6421 generated automatically for a Rich Edit text control.
6422 """
6423 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6424 _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6425
6426 #---------------------------------------------------------------------------
6427
6428 class PyEvent(Event):
6429 """
6430 wx.PyEvent can be used as a base class for implementing custom event
6431 types in Python. You should derived from this class instead of
6432 `wx.Event` because this class is Python-aware and is able to transport
6433 its Python bits safely through the wxWidgets event system and have
6434 them still be there when the event handler is invoked.
6435
6436 :see: `wx.PyCommandEvent`
6437
6438 """
6439 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6440 __repr__ = _swig_repr
6441 def __init__(self, *args, **kwargs):
6442 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6443 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
6444 self._SetSelf(self)
6445
6446 __swig_destroy__ = _core_.delete_PyEvent
6447 __del__ = lambda self : None;
6448 def _SetSelf(*args, **kwargs):
6449 """_SetSelf(self, PyObject self)"""
6450 return _core_.PyEvent__SetSelf(*args, **kwargs)
6451
6452 def _GetSelf(*args, **kwargs):
6453 """_GetSelf(self) -> PyObject"""
6454 return _core_.PyEvent__GetSelf(*args, **kwargs)
6455
6456 _core_.PyEvent_swigregister(PyEvent)
6457
6458 class PyCommandEvent(CommandEvent):
6459 """
6460 wx.PyCommandEvent can be used as a base class for implementing custom
6461 event types in Python, where the event shoudl travel up to parent
6462 windows looking for a handler. You should derived from this class
6463 instead of `wx.CommandEvent` because this class is Python-aware and is
6464 able to transport its Python bits safely through the wxWidgets event
6465 system and have them still be there when the event handler is invoked.
6466
6467 :see: `wx.PyEvent`
6468
6469 """
6470 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6471 __repr__ = _swig_repr
6472 def __init__(self, *args, **kwargs):
6473 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6474 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
6475 self._SetSelf(self)
6476
6477 __swig_destroy__ = _core_.delete_PyCommandEvent
6478 __del__ = lambda self : None;
6479 def _SetSelf(*args, **kwargs):
6480 """_SetSelf(self, PyObject self)"""
6481 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
6482
6483 def _GetSelf(*args, **kwargs):
6484 """_GetSelf(self) -> PyObject"""
6485 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
6486
6487 _core_.PyCommandEvent_swigregister(PyCommandEvent)
6488
6489 class DateEvent(CommandEvent):
6490 """
6491 This event class holds information about a date change event and is
6492 used together with `wx.DatePickerCtrl`. It also serves as a base class
6493 for `wx.calendar.CalendarEvent`. Bind these event types with
6494 EVT_DATE_CHANGED.
6495 """
6496 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6497 __repr__ = _swig_repr
6498 def __init__(self, *args, **kwargs):
6499 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6500 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
6501 def GetDate(*args, **kwargs):
6502 """
6503 GetDate(self) -> DateTime
6504
6505 Returns the date.
6506 """
6507 return _core_.DateEvent_GetDate(*args, **kwargs)
6508
6509 def SetDate(*args, **kwargs):
6510 """
6511 SetDate(self, DateTime date)
6512
6513 Sets the date carried by the event, normally only used by the library
6514 internally.
6515 """
6516 return _core_.DateEvent_SetDate(*args, **kwargs)
6517
6518 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
6519 _core_.DateEvent_swigregister(DateEvent)
6520
6521 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6522 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6523
6524 #---------------------------------------------------------------------------
6525
6526 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6527 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6528 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6529 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6530 PRINT_WINDOWS = _core_.PRINT_WINDOWS
6531 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6532 class PyApp(EvtHandler):
6533 """
6534 The ``wx.PyApp`` class is an *implementation detail*, please use the
6535 `wx.App` class (or some other derived class) instead.
6536 """
6537 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6538 __repr__ = _swig_repr
6539 def __init__(self, *args, **kwargs):
6540 """
6541 __init__(self) -> PyApp
6542
6543 Create a new application object, starting the bootstrap process.
6544 """
6545 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
6546 self._setCallbackInfo(self, PyApp, False)
6547 self._setOORInfo(self, False)
6548
6549 __swig_destroy__ = _core_.delete_PyApp
6550 __del__ = lambda self : None;
6551 def _setCallbackInfo(*args, **kwargs):
6552 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6553 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6554
6555 def GetAppName(*args, **kwargs):
6556 """
6557 GetAppName(self) -> String
6558
6559 Get the application name.
6560 """
6561 return _core_.PyApp_GetAppName(*args, **kwargs)
6562
6563 def SetAppName(*args, **kwargs):
6564 """
6565 SetAppName(self, String name)
6566
6567 Set the application name. This value may be used automatically by
6568 `wx.Config` and such.
6569 """
6570 return _core_.PyApp_SetAppName(*args, **kwargs)
6571
6572 def GetClassName(*args, **kwargs):
6573 """
6574 GetClassName(self) -> String
6575
6576 Get the application's class name.
6577 """
6578 return _core_.PyApp_GetClassName(*args, **kwargs)
6579
6580 def SetClassName(*args, **kwargs):
6581 """
6582 SetClassName(self, String name)
6583
6584 Set the application's class name. This value may be used for
6585 X-resources if applicable for the platform
6586 """
6587 return _core_.PyApp_SetClassName(*args, **kwargs)
6588
6589 def GetVendorName(*args, **kwargs):
6590 """
6591 GetVendorName(self) -> String
6592
6593 Get the application's vendor name.
6594 """
6595 return _core_.PyApp_GetVendorName(*args, **kwargs)
6596
6597 def SetVendorName(*args, **kwargs):
6598 """
6599 SetVendorName(self, String name)
6600
6601 Set the application's vendor name. This value may be used
6602 automatically by `wx.Config` and such.
6603 """
6604 return _core_.PyApp_SetVendorName(*args, **kwargs)
6605
6606 def GetTraits(*args, **kwargs):
6607 """
6608 GetTraits(self) -> wxAppTraits
6609
6610 Return (and create if necessary) the app traits object to which we
6611 delegate for everything which either should be configurable by the
6612 user (then he can change the default behaviour simply by overriding
6613 CreateTraits() and returning his own traits object) or which is
6614 GUI/console dependent as then wx.AppTraits allows us to abstract the
6615 differences behind the common facade.
6616
6617 :todo: Add support for overriding CreateAppTraits in wxPython.
6618 """
6619 return _core_.PyApp_GetTraits(*args, **kwargs)
6620
6621 def ProcessPendingEvents(*args, **kwargs):
6622 """
6623 ProcessPendingEvents(self)
6624
6625 Process all events in the Pending Events list -- it is necessary to
6626 call this function to process posted events. This normally happens
6627 during each event loop iteration.
6628 """
6629 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6630
6631 def Yield(*args, **kwargs):
6632 """
6633 Yield(self, bool onlyIfNeeded=False) -> bool
6634
6635 Process all currently pending events right now, instead of waiting
6636 until return to the event loop. It is an error to call ``Yield``
6637 recursively unless the value of ``onlyIfNeeded`` is True.
6638
6639 :warning: This function is dangerous as it can lead to unexpected
6640 reentrancies (i.e. when called from an event handler it may
6641 result in calling the same event handler again), use with
6642 extreme care or, better, don't use at all!
6643
6644 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6645
6646 """
6647 return _core_.PyApp_Yield(*args, **kwargs)
6648
6649 def WakeUpIdle(*args, **kwargs):
6650 """
6651 WakeUpIdle(self)
6652
6653 Make sure that idle events are sent again.
6654 :see: `wx.WakeUpIdle`
6655 """
6656 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6657
6658 def IsMainLoopRunning(*args, **kwargs):
6659 """
6660 IsMainLoopRunning() -> bool
6661
6662 Returns True if we're running the main loop, i.e. if the events can
6663 currently be dispatched.
6664 """
6665 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6666
6667 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
6668 def MainLoop(*args, **kwargs):
6669 """
6670 MainLoop(self) -> int
6671
6672 Execute the main GUI loop, the function doesn't normally return until
6673 all top level windows have been closed and destroyed.
6674 """
6675 return _core_.PyApp_MainLoop(*args, **kwargs)
6676
6677 def Exit(*args, **kwargs):
6678 """
6679 Exit(self)
6680
6681 Exit the main loop thus terminating the application.
6682 :see: `wx.Exit`
6683 """
6684 return _core_.PyApp_Exit(*args, **kwargs)
6685
6686 def ExitMainLoop(*args, **kwargs):
6687 """
6688 ExitMainLoop(self)
6689
6690 Exit the main GUI loop during the next iteration of the main
6691 loop, (i.e. it does not stop the program immediately!)
6692 """
6693 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6694
6695 def Pending(*args, **kwargs):
6696 """
6697 Pending(self) -> bool
6698
6699 Returns True if there are unprocessed events in the event queue.
6700 """
6701 return _core_.PyApp_Pending(*args, **kwargs)
6702
6703 def Dispatch(*args, **kwargs):
6704 """
6705 Dispatch(self) -> bool
6706
6707 Process the first event in the event queue (blocks until an event
6708 appears if there are none currently)
6709 """
6710 return _core_.PyApp_Dispatch(*args, **kwargs)
6711
6712 def ProcessIdle(*args, **kwargs):
6713 """
6714 ProcessIdle(self) -> bool
6715
6716 Called from the MainLoop when the application becomes idle (there are
6717 no pending events) and sends a `wx.IdleEvent` to all interested
6718 parties. Returns True if more idle events are needed, False if not.
6719 """
6720 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6721
6722 def SendIdleEvents(*args, **kwargs):
6723 """
6724 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6725
6726 Send idle event to window and all subwindows. Returns True if more
6727 idle time is requested.
6728 """
6729 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6730
6731 def IsActive(*args, **kwargs):
6732 """
6733 IsActive(self) -> bool
6734
6735 Return True if our app has focus.
6736 """
6737 return _core_.PyApp_IsActive(*args, **kwargs)
6738
6739 def SetTopWindow(*args, **kwargs):
6740 """
6741 SetTopWindow(self, Window win)
6742
6743 Set the *main* top level window
6744 """
6745 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6746
6747 def GetTopWindow(*args, **kwargs):
6748 """
6749 GetTopWindow(self) -> Window
6750
6751 Return the *main* top level window (if it hadn't been set previously
6752 with SetTopWindow(), will return just some top level window and, if
6753 there not any, will return None)
6754 """
6755 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6756
6757 def SetExitOnFrameDelete(*args, **kwargs):
6758 """
6759 SetExitOnFrameDelete(self, bool flag)
6760
6761 Control the exit behaviour: by default, the program will exit the main
6762 loop (and so, usually, terminate) when the last top-level program
6763 window is deleted. Beware that if you disable this behaviour (with
6764 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6765 explicitly from somewhere.
6766 """
6767 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6768
6769 def GetExitOnFrameDelete(*args, **kwargs):
6770 """
6771 GetExitOnFrameDelete(self) -> bool
6772
6773 Get the current exit behaviour setting.
6774 """
6775 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6776
6777 def SetUseBestVisual(*args, **kwargs):
6778 """
6779 SetUseBestVisual(self, bool flag)
6780
6781 Set whether the app should try to use the best available visual on
6782 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6783 """
6784 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6785
6786 def GetUseBestVisual(*args, **kwargs):
6787 """
6788 GetUseBestVisual(self) -> bool
6789
6790 Get current UseBestVisual setting.
6791 """
6792 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6793
6794 def SetPrintMode(*args, **kwargs):
6795 """SetPrintMode(self, int mode)"""
6796 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6797
6798 def GetPrintMode(*args, **kwargs):
6799 """GetPrintMode(self) -> int"""
6800 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6801
6802 def SetAssertMode(*args, **kwargs):
6803 """
6804 SetAssertMode(self, int mode)
6805
6806 Set the OnAssert behaviour for debug and hybrid builds.
6807 """
6808 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6809
6810 def GetAssertMode(*args, **kwargs):
6811 """
6812 GetAssertMode(self) -> int
6813
6814 Get the current OnAssert behaviour setting.
6815 """
6816 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6817
6818 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6819 """GetMacSupportPCMenuShortcuts() -> bool"""
6820 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6821
6822 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6823 def GetMacAboutMenuItemId(*args, **kwargs):
6824 """GetMacAboutMenuItemId() -> long"""
6825 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6826
6827 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6828 def GetMacPreferencesMenuItemId(*args, **kwargs):
6829 """GetMacPreferencesMenuItemId() -> long"""
6830 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6831
6832 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6833 def GetMacExitMenuItemId(*args, **kwargs):
6834 """GetMacExitMenuItemId() -> long"""
6835 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6836
6837 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6838 def GetMacHelpMenuTitleName(*args, **kwargs):
6839 """GetMacHelpMenuTitleName() -> String"""
6840 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6841
6842 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6843 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6844 """SetMacSupportPCMenuShortcuts(bool val)"""
6845 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6846
6847 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6848 def SetMacAboutMenuItemId(*args, **kwargs):
6849 """SetMacAboutMenuItemId(long val)"""
6850 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6851
6852 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6853 def SetMacPreferencesMenuItemId(*args, **kwargs):
6854 """SetMacPreferencesMenuItemId(long val)"""
6855 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6856
6857 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6858 def SetMacExitMenuItemId(*args, **kwargs):
6859 """SetMacExitMenuItemId(long val)"""
6860 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6861
6862 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6863 def SetMacHelpMenuTitleName(*args, **kwargs):
6864 """SetMacHelpMenuTitleName(String val)"""
6865 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6866
6867 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6868 def _BootstrapApp(*args, **kwargs):
6869 """
6870 _BootstrapApp(self)
6871
6872 For internal use only
6873 """
6874 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6875
6876 def GetComCtl32Version(*args, **kwargs):
6877 """
6878 GetComCtl32Version() -> int
6879
6880 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6881 it wasn't found at all. Raises an exception on non-Windows platforms.
6882 """
6883 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6884
6885 GetComCtl32Version = staticmethod(GetComCtl32Version)
6886 def DisplayAvailable(*args, **kwargs):
6887 """
6888 DisplayAvailable() -> bool
6889
6890 Tests if it is possible to create a GUI in the current environment.
6891 This will mean different things on the different platforms.
6892
6893 * On X Windows systems this function will return ``False`` if it is
6894 not able to open a connection to the X display, which can happen
6895 if $DISPLAY is not set, or is not set correctly.
6896
6897 * On Mac OS X a ``False`` return value will mean that wx is not
6898 able to access the window manager, which can happen if logged in
6899 remotely or if running from the normal version of python instead
6900 of the framework version, (i.e., pythonw.)
6901
6902 * On MS Windows...
6903
6904 """
6905 return _core_.PyApp_DisplayAvailable(*args, **kwargs)
6906
6907 DisplayAvailable = staticmethod(DisplayAvailable)
6908 _core_.PyApp_swigregister(PyApp)
6909
6910 def PyApp_IsMainLoopRunning(*args):
6911 """
6912 PyApp_IsMainLoopRunning() -> bool
6913
6914 Returns True if we're running the main loop, i.e. if the events can
6915 currently be dispatched.
6916 """
6917 return _core_.PyApp_IsMainLoopRunning(*args)
6918
6919 def PyApp_GetMacSupportPCMenuShortcuts(*args):
6920 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6921 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
6922
6923 def PyApp_GetMacAboutMenuItemId(*args):
6924 """PyApp_GetMacAboutMenuItemId() -> long"""
6925 return _core_.PyApp_GetMacAboutMenuItemId(*args)
6926
6927 def PyApp_GetMacPreferencesMenuItemId(*args):
6928 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6929 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
6930
6931 def PyApp_GetMacExitMenuItemId(*args):
6932 """PyApp_GetMacExitMenuItemId() -> long"""
6933 return _core_.PyApp_GetMacExitMenuItemId(*args)
6934
6935 def PyApp_GetMacHelpMenuTitleName(*args):
6936 """PyApp_GetMacHelpMenuTitleName() -> String"""
6937 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
6938
6939 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
6940 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6941 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6942
6943 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
6944 """PyApp_SetMacAboutMenuItemId(long val)"""
6945 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6946
6947 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
6948 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6949 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6950
6951 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
6952 """PyApp_SetMacExitMenuItemId(long val)"""
6953 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6954
6955 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
6956 """PyApp_SetMacHelpMenuTitleName(String val)"""
6957 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6958
6959 def PyApp_GetComCtl32Version(*args):
6960 """
6961 PyApp_GetComCtl32Version() -> int
6962
6963 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6964 it wasn't found at all. Raises an exception on non-Windows platforms.
6965 """
6966 return _core_.PyApp_GetComCtl32Version(*args)
6967
6968 def PyApp_DisplayAvailable(*args):
6969 """
6970 PyApp_DisplayAvailable() -> bool
6971
6972 Tests if it is possible to create a GUI in the current environment.
6973 This will mean different things on the different platforms.
6974
6975 * On X Windows systems this function will return ``False`` if it is
6976 not able to open a connection to the X display, which can happen
6977 if $DISPLAY is not set, or is not set correctly.
6978
6979 * On Mac OS X a ``False`` return value will mean that wx is not
6980 able to access the window manager, which can happen if logged in
6981 remotely or if running from the normal version of python instead
6982 of the framework version, (i.e., pythonw.)
6983
6984 * On MS Windows...
6985
6986 """
6987 return _core_.PyApp_DisplayAvailable(*args)
6988
6989 #---------------------------------------------------------------------------
6990
6991
6992 def Exit(*args):
6993 """
6994 Exit()
6995
6996 Force an exit of the application. Convenience for wx.GetApp().Exit()
6997 """
6998 return _core_.Exit(*args)
6999
7000 def Yield(*args):
7001 """
7002 Yield() -> bool
7003
7004 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7005 """
7006 return _core_.Yield(*args)
7007
7008 def YieldIfNeeded(*args):
7009 """
7010 YieldIfNeeded() -> bool
7011
7012 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7013 """
7014 return _core_.YieldIfNeeded(*args)
7015
7016 def SafeYield(*args, **kwargs):
7017 """
7018 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7019
7020 This function is similar to `wx.Yield`, except that it disables the
7021 user input to all program windows before calling `wx.Yield` and
7022 re-enables it again afterwards. If ``win`` is not None, this window
7023 will remain enabled, allowing the implementation of some limited user
7024 interaction.
7025
7026 :Returns: the result of the call to `wx.Yield`.
7027 """
7028 return _core_.SafeYield(*args, **kwargs)
7029
7030 def WakeUpIdle(*args):
7031 """
7032 WakeUpIdle()
7033
7034 Cause the message queue to become empty again, so idle events will be
7035 sent.
7036 """
7037 return _core_.WakeUpIdle(*args)
7038
7039 def PostEvent(*args, **kwargs):
7040 """
7041 PostEvent(EvtHandler dest, Event event)
7042
7043 Send an event to a window or other wx.EvtHandler to be processed
7044 later.
7045 """
7046 return _core_.PostEvent(*args, **kwargs)
7047
7048 def App_CleanUp(*args):
7049 """
7050 App_CleanUp()
7051
7052 For internal use only, it is used to cleanup after wxWidgets when
7053 Python shuts down.
7054 """
7055 return _core_.App_CleanUp(*args)
7056
7057 def GetApp(*args):
7058 """
7059 GetApp() -> PyApp
7060
7061 Return a reference to the current wx.App object.
7062 """
7063 return _core_.GetApp(*args)
7064
7065 def SetDefaultPyEncoding(*args, **kwargs):
7066 """
7067 SetDefaultPyEncoding(string encoding)
7068
7069 Sets the encoding that wxPython will use when it needs to convert a
7070 Python string or unicode object to or from a wxString.
7071
7072 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7073 but please be aware that the default encoding within the same locale
7074 may be slightly different on different platforms. For example, please
7075 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7076 between the common latin/roman encodings.
7077 """
7078 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7079
7080 def GetDefaultPyEncoding(*args):
7081 """
7082 GetDefaultPyEncoding() -> string
7083
7084 Gets the current encoding that wxPython will use when it needs to
7085 convert a Python string or unicode object to or from a wxString.
7086 """
7087 return _core_.GetDefaultPyEncoding(*args)
7088 #----------------------------------------------------------------------
7089
7090 class PyOnDemandOutputWindow:
7091 """
7092 A class that can be used for redirecting Python's stdout and
7093 stderr streams. It will do nothing until something is wrriten to
7094 the stream at which point it will create a Frame with a text area
7095 and write the text there.
7096 """
7097 def __init__(self, title = "wxPython: stdout/stderr"):
7098 self.frame = None
7099 self.title = title
7100 self.pos = wx.DefaultPosition
7101 self.size = (450, 300)
7102 self.parent = None
7103
7104 def SetParent(self, parent):
7105 """Set the window to be used as the popup Frame's parent."""
7106 self.parent = parent
7107
7108
7109 def CreateOutputWindow(self, st):
7110 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7111 style=wx.DEFAULT_FRAME_STYLE)
7112 self.text = wx.TextCtrl(self.frame, -1, "",
7113 style=wx.TE_MULTILINE|wx.TE_READONLY)
7114 self.text.AppendText(st)
7115 self.frame.Show(True)
7116 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
7117
7118
7119 def OnCloseWindow(self, event):
7120 if self.frame is not None:
7121 self.frame.Destroy()
7122 self.frame = None
7123 self.text = None
7124
7125
7126 # These methods provide the file-like output behaviour.
7127 def write(self, text):
7128 """
7129 Create the output window if needed and write the string to it.
7130 If not called in the context of the gui thread then uses
7131 CallAfter to do the work there.
7132 """
7133 if self.frame is None:
7134 if not wx.Thread_IsMain():
7135 wx.CallAfter(self.CreateOutputWindow, text)
7136 else:
7137 self.CreateOutputWindow(text)
7138 else:
7139 if not wx.Thread_IsMain():
7140 wx.CallAfter(self.text.AppendText, text)
7141 else:
7142 self.text.AppendText(text)
7143
7144
7145 def close(self):
7146 if self.frame is not None:
7147 wx.CallAfter(self.frame.Close)
7148
7149
7150 def flush(self):
7151 pass
7152
7153
7154
7155 #----------------------------------------------------------------------
7156
7157 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7158
7159 class App(wx.PyApp):
7160 """
7161 The ``wx.App`` class represents the application and is used to:
7162
7163 * bootstrap the wxPython system and initialize the underlying
7164 gui toolkit
7165 * set and get application-wide properties
7166 * implement the windowing system main message or event loop,
7167 and to dispatch events to window instances
7168 * etc.
7169
7170 Every application must have a ``wx.App`` instance, and all
7171 creation of UI objects should be delayed until after the
7172 ``wx.App`` object has been created in order to ensure that the gui
7173 platform and wxWidgets have been fully initialized.
7174
7175 Normally you would derive from this class and implement an
7176 ``OnInit`` method that creates a frame and then calls
7177 ``self.SetTopWindow(frame)``.
7178
7179 :see: `wx.PySimpleApp` for a simpler app class that can be used
7180 directly.
7181 """
7182
7183 outputWindowClass = PyOnDemandOutputWindow
7184
7185 def __init__(self, redirect=_defRedirect, filename=None,
7186 useBestVisual=False, clearSigInt=True):
7187 """
7188 Construct a ``wx.App`` object.
7189
7190 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7191 redirected? Defaults to True on Windows and Mac, False
7192 otherwise. If `filename` is None then output will be
7193 redirected to a window that pops up as needed. (You can
7194 control what kind of window is created for the output by
7195 resetting the class variable ``outputWindowClass`` to a
7196 class of your choosing.)
7197
7198 :param filename: The name of a file to redirect output to, if
7199 redirect is True.
7200
7201 :param useBestVisual: Should the app try to use the best
7202 available visual provided by the system (only relevant on
7203 systems that have more than one visual.) This parameter
7204 must be used instead of calling `SetUseBestVisual` later
7205 on because it must be set before the underlying GUI
7206 toolkit is initialized.
7207
7208 :param clearSigInt: Should SIGINT be cleared? This allows the
7209 app to terminate upon a Ctrl-C in the console like other
7210 GUI apps will.
7211
7212 :note: You should override OnInit to do applicaition
7213 initialization to ensure that the system, toolkit and
7214 wxWidgets are fully initialized.
7215 """
7216
7217 wx.PyApp.__init__(self)
7218
7219 # make sure we can create a GUI
7220 if not self.DisplayAvailable():
7221
7222 if wx.Platform == "__WXMAC__":
7223 msg = """This program needs access to the screen.
7224 Please run with 'pythonw', not 'python', and only when you are logged
7225 in on the main display of your Mac."""
7226
7227 elif wx.Platform == "__WXGTK__":
7228 msg ="Unable to access the X Display, is $DISPLAY set properly?"
7229
7230 else:
7231 msg = "Unable to create GUI"
7232 # TODO: more description is needed for wxMSW...
7233
7234 raise SystemExit(msg)
7235
7236 # This has to be done before OnInit
7237 self.SetUseBestVisual(useBestVisual)
7238
7239 # Set the default handler for SIGINT. This fixes a problem
7240 # where if Ctrl-C is pressed in the console that started this
7241 # app then it will not appear to do anything, (not even send
7242 # KeyboardInterrupt???) but will later segfault on exit. By
7243 # setting the default handler then the app will exit, as
7244 # expected (depending on platform.)
7245 if clearSigInt:
7246 try:
7247 import signal
7248 signal.signal(signal.SIGINT, signal.SIG_DFL)
7249 except:
7250 pass
7251
7252 # Save and redirect the stdio to a window?
7253 self.stdioWin = None
7254 self.saveStdio = (_sys.stdout, _sys.stderr)
7255 if redirect:
7256 self.RedirectStdio(filename)
7257
7258 # Use Python's install prefix as the default
7259 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7260
7261 # This finishes the initialization of wxWindows and then calls
7262 # the OnInit that should be present in the derived class
7263 self._BootstrapApp()
7264
7265
7266 def OnPreInit(self):
7267 """
7268 Things that must be done after _BootstrapApp has done its
7269 thing, but would be nice if they were already done by the time
7270 that OnInit is called.
7271 """
7272 wx.StockGDI._initStockObjects()
7273
7274
7275 def __del__(self, destroy=wx.PyApp.__del__):
7276 self.RestoreStdio() # Just in case the MainLoop was overridden
7277 destroy(self)
7278
7279 def Destroy(self):
7280 wx.PyApp.Destroy(self)
7281 self.thisown = 0
7282
7283 def SetTopWindow(self, frame):
7284 """Set the \"main\" top level window"""
7285 if self.stdioWin:
7286 self.stdioWin.SetParent(frame)
7287 wx.PyApp.SetTopWindow(self, frame)
7288
7289
7290 def MainLoop(self):
7291 """Execute the main GUI event loop"""
7292 wx.PyApp.MainLoop(self)
7293 self.RestoreStdio()
7294
7295
7296 def RedirectStdio(self, filename=None):
7297 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7298 if filename:
7299 _sys.stdout = _sys.stderr = open(filename, 'a')
7300 else:
7301 self.stdioWin = self.outputWindowClass()
7302 _sys.stdout = _sys.stderr = self.stdioWin
7303
7304
7305 def RestoreStdio(self):
7306 try:
7307 _sys.stdout, _sys.stderr = self.saveStdio
7308 except:
7309 pass
7310
7311
7312 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7313 """
7314 Set the title, position and/or size of the output window if
7315 the stdio has been redirected. This should be called before
7316 any output would cause the output window to be created.
7317 """
7318 if self.stdioWin:
7319 if title is not None:
7320 self.stdioWin.title = title
7321 if pos is not None:
7322 self.stdioWin.pos = pos
7323 if size is not None:
7324 self.stdioWin.size = size
7325
7326
7327
7328
7329 # change from wx.PyApp_XX to wx.App_XX
7330 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7331 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7332 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7333 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7334 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7335 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7336 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7337 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7338 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7339 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7340 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7341
7342 #----------------------------------------------------------------------------
7343
7344 class PySimpleApp(wx.App):
7345 """
7346 A simple application class. You can just create one of these and
7347 then then make your top level windows later, and not have to worry
7348 about OnInit. For example::
7349
7350 app = wx.PySimpleApp()
7351 frame = wx.Frame(None, title='Hello World')
7352 frame.Show()
7353 app.MainLoop()
7354
7355 :see: `wx.App`
7356 """
7357
7358 def __init__(self, redirect=False, filename=None,
7359 useBestVisual=False, clearSigInt=True):
7360 """
7361 :see: `wx.App.__init__`
7362 """
7363 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
7364
7365 def OnInit(self):
7366 return True
7367
7368
7369
7370 # Is anybody using this one?
7371 class PyWidgetTester(wx.App):
7372 def __init__(self, size = (250, 100)):
7373 self.size = size
7374 wx.App.__init__(self, 0)
7375
7376 def OnInit(self):
7377 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7378 self.SetTopWindow(self.frame)
7379 return True
7380
7381 def SetWidget(self, widgetClass, *args, **kwargs):
7382 w = widgetClass(self.frame, *args, **kwargs)
7383 self.frame.Show(True)
7384
7385 #----------------------------------------------------------------------------
7386 # DO NOT hold any other references to this object. This is how we
7387 # know when to cleanup system resources that wxWidgets is holding. When
7388 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7389 # goes to zero and it calls the wx.App_CleanUp function.
7390
7391 class __wxPyCleanup:
7392 def __init__(self):
7393 self.cleanup = _core_.App_CleanUp
7394 def __del__(self):
7395 self.cleanup()
7396
7397 _sys.__wxPythonCleanup = __wxPyCleanup()
7398
7399 ## # another possible solution, but it gets called too early...
7400 ## import atexit
7401 ## atexit.register(_core_.wxApp_CleanUp)
7402
7403
7404 #----------------------------------------------------------------------------
7405
7406 #---------------------------------------------------------------------------
7407
7408 class EventLoop(object):
7409 """Proxy of C++ EventLoop class"""
7410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7411 __repr__ = _swig_repr
7412 def __init__(self, *args, **kwargs):
7413 """__init__(self) -> EventLoop"""
7414 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7415 __swig_destroy__ = _core_.delete_EventLoop
7416 __del__ = lambda self : None;
7417 def Run(*args, **kwargs):
7418 """Run(self) -> int"""
7419 return _core_.EventLoop_Run(*args, **kwargs)
7420
7421 def Exit(*args, **kwargs):
7422 """Exit(self, int rc=0)"""
7423 return _core_.EventLoop_Exit(*args, **kwargs)
7424
7425 def Pending(*args, **kwargs):
7426 """Pending(self) -> bool"""
7427 return _core_.EventLoop_Pending(*args, **kwargs)
7428
7429 def Dispatch(*args, **kwargs):
7430 """Dispatch(self) -> bool"""
7431 return _core_.EventLoop_Dispatch(*args, **kwargs)
7432
7433 def IsRunning(*args, **kwargs):
7434 """IsRunning(self) -> bool"""
7435 return _core_.EventLoop_IsRunning(*args, **kwargs)
7436
7437 def GetActive(*args, **kwargs):
7438 """GetActive() -> EventLoop"""
7439 return _core_.EventLoop_GetActive(*args, **kwargs)
7440
7441 GetActive = staticmethod(GetActive)
7442 def SetActive(*args, **kwargs):
7443 """SetActive(EventLoop loop)"""
7444 return _core_.EventLoop_SetActive(*args, **kwargs)
7445
7446 SetActive = staticmethod(SetActive)
7447 _core_.EventLoop_swigregister(EventLoop)
7448
7449 def EventLoop_GetActive(*args):
7450 """EventLoop_GetActive() -> EventLoop"""
7451 return _core_.EventLoop_GetActive(*args)
7452
7453 def EventLoop_SetActive(*args, **kwargs):
7454 """EventLoop_SetActive(EventLoop loop)"""
7455 return _core_.EventLoop_SetActive(*args, **kwargs)
7456
7457 class EventLoopActivator(object):
7458 """Proxy of C++ EventLoopActivator class"""
7459 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7460 __repr__ = _swig_repr
7461 def __init__(self, *args, **kwargs):
7462 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7463 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7464 __swig_destroy__ = _core_.delete_EventLoopActivator
7465 __del__ = lambda self : None;
7466 _core_.EventLoopActivator_swigregister(EventLoopActivator)
7467
7468 #---------------------------------------------------------------------------
7469
7470 ACCEL_ALT = _core_.ACCEL_ALT
7471 ACCEL_CTRL = _core_.ACCEL_CTRL
7472 ACCEL_SHIFT = _core_.ACCEL_SHIFT
7473 ACCEL_NORMAL = _core_.ACCEL_NORMAL
7474 ACCEL_CMD = _core_.ACCEL_CMD
7475 class AcceleratorEntry(object):
7476 """
7477 A class used to define items in an `wx.AcceleratorTable`. wxPython
7478 programs can choose to use wx.AcceleratorEntry objects, but using a
7479 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7480 as well. See `__init__` for of the tuple values.
7481
7482 :see: `wx.AcceleratorTable`
7483 """
7484 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7485 __repr__ = _swig_repr
7486 def __init__(self, *args, **kwargs):
7487 """
7488 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7489
7490 Construct a wx.AcceleratorEntry.
7491 """
7492 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7493 __swig_destroy__ = _core_.delete_AcceleratorEntry
7494 __del__ = lambda self : None;
7495 def Set(*args, **kwargs):
7496 """
7497 Set(self, int flags, int keyCode, int cmd)
7498
7499 (Re)set the attributes of a wx.AcceleratorEntry.
7500 :see `__init__`
7501 """
7502 return _core_.AcceleratorEntry_Set(*args, **kwargs)
7503
7504 def GetFlags(*args, **kwargs):
7505 """
7506 GetFlags(self) -> int
7507
7508 Get the AcceleratorEntry's flags.
7509 """
7510 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7511
7512 def GetKeyCode(*args, **kwargs):
7513 """
7514 GetKeyCode(self) -> int
7515
7516 Get the AcceleratorEntry's keycode.
7517 """
7518 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7519
7520 def GetCommand(*args, **kwargs):
7521 """
7522 GetCommand(self) -> int
7523
7524 Get the AcceleratorEntry's command ID.
7525 """
7526 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7527
7528 Command = property(GetCommand,doc="See `GetCommand`")
7529 Flags = property(GetFlags,doc="See `GetFlags`")
7530 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
7531 _core_.AcceleratorEntry_swigregister(AcceleratorEntry)
7532
7533 class AcceleratorTable(Object):
7534 """
7535 An accelerator table allows the application to specify a table of
7536 keyboard shortcuts for menus or other commands. On Windows, menu or
7537 button commands are supported; on GTK, only menu commands are
7538 supported.
7539 """
7540 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7541 __repr__ = _swig_repr
7542 def __init__(self, *args, **kwargs):
7543 """
7544 __init__(entries) -> AcceleratorTable
7545
7546 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7547 items or or of 3-tuples (flags, keyCode, cmdID)
7548
7549 :see: `wx.AcceleratorEntry`
7550 """
7551 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7552 __swig_destroy__ = _core_.delete_AcceleratorTable
7553 __del__ = lambda self : None;
7554 def Ok(*args, **kwargs):
7555 """Ok(self) -> bool"""
7556 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7557
7558 _core_.AcceleratorTable_swigregister(AcceleratorTable)
7559
7560
7561 def GetAccelFromString(*args, **kwargs):
7562 """GetAccelFromString(String label) -> AcceleratorEntry"""
7563 return _core_.GetAccelFromString(*args, **kwargs)
7564 #---------------------------------------------------------------------------
7565
7566 class VisualAttributes(object):
7567 """struct containing all the visual attributes of a control"""
7568 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7569 __repr__ = _swig_repr
7570 def __init__(self, *args, **kwargs):
7571 """
7572 __init__(self) -> VisualAttributes
7573
7574 struct containing all the visual attributes of a control
7575 """
7576 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7577 __swig_destroy__ = _core_.delete_VisualAttributes
7578 __del__ = lambda self : None;
7579 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7580 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7581 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7582 _core_.VisualAttributes_swigregister(VisualAttributes)
7583 NullAcceleratorTable = cvar.NullAcceleratorTable
7584 PanelNameStr = cvar.PanelNameStr
7585
7586 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7587 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7588 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7589 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7590 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7591 class Window(EvtHandler):
7592 """
7593 wx.Window is the base class for all windows and represents any visible
7594 object on the screen. All controls, top level windows and so on are
7595 wx.Windows. Sizers and device contexts are not however, as they don't
7596 appear on screen themselves.
7597
7598 """
7599 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7600 __repr__ = _swig_repr
7601 def __init__(self, *args, **kwargs):
7602 """
7603 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7604 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7605
7606 Construct and show a generic Window.
7607 """
7608 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
7609 self._setOORInfo(self)
7610
7611 def Create(*args, **kwargs):
7612 """
7613 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7614 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7615
7616 Create the GUI part of the Window for 2-phase creation mode.
7617 """
7618 return _core_.Window_Create(*args, **kwargs)
7619
7620 def Close(*args, **kwargs):
7621 """
7622 Close(self, bool force=False) -> bool
7623
7624 This function simply generates a EVT_CLOSE event whose handler usually
7625 tries to close the window. It doesn't close the window itself,
7626 however. If force is False (the default) then the window's close
7627 handler will be allowed to veto the destruction of the window.
7628 """
7629 return _core_.Window_Close(*args, **kwargs)
7630
7631 def Destroy(*args, **kwargs):
7632 """
7633 Destroy(self) -> bool
7634
7635 Destroys the window safely. Frames and dialogs are not destroyed
7636 immediately when this function is called -- they are added to a list
7637 of windows to be deleted on idle time, when all the window's events
7638 have been processed. This prevents problems with events being sent to
7639 non-existent windows.
7640
7641 Returns True if the window has either been successfully deleted, or it
7642 has been added to the list of windows pending real deletion.
7643 """
7644 val = _core_.Window_Destroy(*args, **kwargs)
7645 args[0].thisown = 0
7646 return val
7647
7648 def DestroyChildren(*args, **kwargs):
7649 """
7650 DestroyChildren(self) -> bool
7651
7652 Destroys all children of a window. Called automatically by the
7653 destructor.
7654 """
7655 return _core_.Window_DestroyChildren(*args, **kwargs)
7656
7657 def IsBeingDeleted(*args, **kwargs):
7658 """
7659 IsBeingDeleted(self) -> bool
7660
7661 Is the window in the process of being deleted?
7662 """
7663 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7664
7665 def SetLabel(*args, **kwargs):
7666 """
7667 SetLabel(self, String label)
7668
7669 Set the text which the window shows in its label if applicable.
7670 """
7671 return _core_.Window_SetLabel(*args, **kwargs)
7672
7673 def GetLabel(*args, **kwargs):
7674 """
7675 GetLabel(self) -> String
7676
7677 Generic way of getting a label from any window, for identification
7678 purposes. The interpretation of this function differs from class to
7679 class. For frames and dialogs, the value returned is the title. For
7680 buttons or static text controls, it is the button text. This function
7681 can be useful for meta-programs such as testing tools or special-needs
7682 access programs)which need to identify windows by name.
7683 """
7684 return _core_.Window_GetLabel(*args, **kwargs)
7685
7686 def SetName(*args, **kwargs):
7687 """
7688 SetName(self, String name)
7689
7690 Sets the window's name. The window name is used for ressource setting
7691 in X, it is not the same as the window title/label
7692 """
7693 return _core_.Window_SetName(*args, **kwargs)
7694
7695 def GetName(*args, **kwargs):
7696 """
7697 GetName(self) -> String
7698
7699 Returns the windows name. This name is not guaranteed to be unique;
7700 it is up to the programmer to supply an appropriate name in the window
7701 constructor or via wx.Window.SetName.
7702 """
7703 return _core_.Window_GetName(*args, **kwargs)
7704
7705 def SetWindowVariant(*args, **kwargs):
7706 """
7707 SetWindowVariant(self, int variant)
7708
7709 Sets the variant of the window/font size to use for this window, if
7710 the platform supports variants, for example, wxMac.
7711 """
7712 return _core_.Window_SetWindowVariant(*args, **kwargs)
7713
7714 def GetWindowVariant(*args, **kwargs):
7715 """GetWindowVariant(self) -> int"""
7716 return _core_.Window_GetWindowVariant(*args, **kwargs)
7717
7718 def SetId(*args, **kwargs):
7719 """
7720 SetId(self, int winid)
7721
7722 Sets the identifier of the window. Each window has an integer
7723 identifier. If the application has not provided one, an identifier
7724 will be generated. Normally, the identifier should be provided on
7725 creation and should not be modified subsequently.
7726 """
7727 return _core_.Window_SetId(*args, **kwargs)
7728
7729 def GetId(*args, **kwargs):
7730 """
7731 GetId(self) -> int
7732
7733 Returns the identifier of the window. Each window has an integer
7734 identifier. If the application has not provided one (or the default Id
7735 -1 is used) then an unique identifier with a negative value will be
7736 generated.
7737 """
7738 return _core_.Window_GetId(*args, **kwargs)
7739
7740 def NewControlId(*args, **kwargs):
7741 """
7742 NewControlId() -> int
7743
7744 Generate a control id for the controls which were not given one.
7745 """
7746 return _core_.Window_NewControlId(*args, **kwargs)
7747
7748 NewControlId = staticmethod(NewControlId)
7749 def NextControlId(*args, **kwargs):
7750 """
7751 NextControlId(int winid) -> int
7752
7753 Get the id of the control following the one with the given
7754 autogenerated) id
7755 """
7756 return _core_.Window_NextControlId(*args, **kwargs)
7757
7758 NextControlId = staticmethod(NextControlId)
7759 def PrevControlId(*args, **kwargs):
7760 """
7761 PrevControlId(int winid) -> int
7762
7763 Get the id of the control preceding the one with the given
7764 autogenerated) id
7765 """
7766 return _core_.Window_PrevControlId(*args, **kwargs)
7767
7768 PrevControlId = staticmethod(PrevControlId)
7769 def SetSize(*args, **kwargs):
7770 """
7771 SetSize(self, Size size)
7772
7773 Sets the size of the window in pixels.
7774 """
7775 return _core_.Window_SetSize(*args, **kwargs)
7776
7777 def SetDimensions(*args, **kwargs):
7778 """
7779 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7780
7781 Sets the position and size of the window in pixels. The sizeFlags
7782 parameter indicates the interpretation of the other params if they are
7783 equal to -1.
7784
7785 ======================== ======================================
7786 wx.SIZE_AUTO A -1 indicates that a class-specific
7787 default should be used.
7788 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7789 -1 values are supplied.
7790 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7791 interpreted as real dimensions, not
7792 default values.
7793 ======================== ======================================
7794
7795 """
7796 return _core_.Window_SetDimensions(*args, **kwargs)
7797
7798 def SetRect(*args, **kwargs):
7799 """
7800 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7801
7802 Sets the position and size of the window in pixels using a wx.Rect.
7803 """
7804 return _core_.Window_SetRect(*args, **kwargs)
7805
7806 def SetSizeWH(*args, **kwargs):
7807 """
7808 SetSizeWH(self, int width, int height)
7809
7810 Sets the size of the window in pixels.
7811 """
7812 return _core_.Window_SetSizeWH(*args, **kwargs)
7813
7814 def Move(*args, **kwargs):
7815 """
7816 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7817
7818 Moves the window to the given position.
7819 """
7820 return _core_.Window_Move(*args, **kwargs)
7821
7822 SetPosition = Move
7823 def MoveXY(*args, **kwargs):
7824 """
7825 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7826
7827 Moves the window to the given position.
7828 """
7829 return _core_.Window_MoveXY(*args, **kwargs)
7830
7831 def SetBestFittingSize(*args, **kwargs):
7832 """
7833 SetBestFittingSize(self, Size size=DefaultSize)
7834
7835 A 'Smart' SetSize that will fill in default size components with the
7836 window's *best size* values. Also set's the minsize for use with sizers.
7837 """
7838 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7839
7840 def Raise(*args, **kwargs):
7841 """
7842 Raise(self)
7843
7844 Raises the window to the top of the window hierarchy. In current
7845 version of wxWidgets this works both for manage and child windows.
7846 """
7847 return _core_.Window_Raise(*args, **kwargs)
7848
7849 def Lower(*args, **kwargs):
7850 """
7851 Lower(self)
7852
7853 Lowers the window to the bottom of the window hierarchy. In current
7854 version of wxWidgets this works both for manage and child windows.
7855 """
7856 return _core_.Window_Lower(*args, **kwargs)
7857
7858 def SetClientSize(*args, **kwargs):
7859 """
7860 SetClientSize(self, Size size)
7861
7862 This sets the size of the window client area in pixels. Using this
7863 function to size a window tends to be more device-independent than
7864 wx.Window.SetSize, since the application need not worry about what
7865 dimensions the border or title bar have when trying to fit the window
7866 around panel items, for example.
7867 """
7868 return _core_.Window_SetClientSize(*args, **kwargs)
7869
7870 def SetClientSizeWH(*args, **kwargs):
7871 """
7872 SetClientSizeWH(self, int width, int height)
7873
7874 This sets the size of the window client area in pixels. Using this
7875 function to size a window tends to be more device-independent than
7876 wx.Window.SetSize, since the application need not worry about what
7877 dimensions the border or title bar have when trying to fit the window
7878 around panel items, for example.
7879 """
7880 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7881
7882 def SetClientRect(*args, **kwargs):
7883 """
7884 SetClientRect(self, Rect rect)
7885
7886 This sets the size of the window client area in pixels. Using this
7887 function to size a window tends to be more device-independent than
7888 wx.Window.SetSize, since the application need not worry about what
7889 dimensions the border or title bar have when trying to fit the window
7890 around panel items, for example.
7891 """
7892 return _core_.Window_SetClientRect(*args, **kwargs)
7893
7894 def GetPosition(*args, **kwargs):
7895 """
7896 GetPosition(self) -> Point
7897
7898 Get the window's position. Notice that the position is in client
7899 coordinates for child windows and screen coordinates for the top level
7900 ones, use `GetScreenPosition` if you need screen coordinates for all
7901 kinds of windows.
7902 """
7903 return _core_.Window_GetPosition(*args, **kwargs)
7904
7905 def GetPositionTuple(*args, **kwargs):
7906 """
7907 GetPositionTuple() -> (x,y)
7908
7909 Get the window's position. Notice that the position is in client
7910 coordinates for child windows and screen coordinates for the top level
7911 ones, use `GetScreenPosition` if you need screen coordinates for all
7912 kinds of windows.
7913 """
7914 return _core_.Window_GetPositionTuple(*args, **kwargs)
7915
7916 def GetScreenPosition(*args, **kwargs):
7917 """
7918 GetScreenPosition(self) -> Point
7919
7920 Get the position of the window in screen coordinantes.
7921 """
7922 return _core_.Window_GetScreenPosition(*args, **kwargs)
7923
7924 def GetScreenPositionTuple(*args, **kwargs):
7925 """
7926 GetScreenPositionTuple() -> (x,y)
7927
7928 Get the position of the window in screen coordinantes.
7929 """
7930 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7931
7932 def GetScreenRect(*args, **kwargs):
7933 """
7934 GetScreenRect(self) -> Rect
7935
7936 Returns the size and position of the window in screen coordinantes as
7937 a `wx.Rect` object.
7938 """
7939 return _core_.Window_GetScreenRect(*args, **kwargs)
7940
7941 def GetSize(*args, **kwargs):
7942 """
7943 GetSize(self) -> Size
7944
7945 Get the window size.
7946 """
7947 return _core_.Window_GetSize(*args, **kwargs)
7948
7949 def GetSizeTuple(*args, **kwargs):
7950 """
7951 GetSizeTuple() -> (width, height)
7952
7953 Get the window size.
7954 """
7955 return _core_.Window_GetSizeTuple(*args, **kwargs)
7956
7957 def GetRect(*args, **kwargs):
7958 """
7959 GetRect(self) -> Rect
7960
7961 Returns the size and position of the window as a `wx.Rect` object.
7962 """
7963 return _core_.Window_GetRect(*args, **kwargs)
7964
7965 def GetClientSize(*args, **kwargs):
7966 """
7967 GetClientSize(self) -> Size
7968
7969 This gets the size of the window's 'client area' in pixels. The client
7970 area is the area which may be drawn on by the programmer, excluding
7971 title bar, border, scrollbars, etc.
7972 """
7973 return _core_.Window_GetClientSize(*args, **kwargs)
7974
7975 def GetClientSizeTuple(*args, **kwargs):
7976 """
7977 GetClientSizeTuple() -> (width, height)
7978
7979 This gets the size of the window's 'client area' in pixels. The client
7980 area is the area which may be drawn on by the programmer, excluding
7981 title bar, border, scrollbars, etc.
7982 """
7983 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7984
7985 def GetClientAreaOrigin(*args, **kwargs):
7986 """
7987 GetClientAreaOrigin(self) -> Point
7988
7989 Get the origin of the client area of the window relative to the
7990 window's top left corner (the client area may be shifted because of
7991 the borders, scrollbars, other decorations...)
7992 """
7993 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7994
7995 def GetClientRect(*args, **kwargs):
7996 """
7997 GetClientRect(self) -> Rect
7998
7999 Get the client area position and size as a `wx.Rect` object.
8000 """
8001 return _core_.Window_GetClientRect(*args, **kwargs)
8002
8003 def GetBestSize(*args, **kwargs):
8004 """
8005 GetBestSize(self) -> Size
8006
8007 This function returns the best acceptable minimal size for the
8008 window, if applicable. For example, for a static text control, it will
8009 be the minimal size such that the control label is not truncated. For
8010 windows containing subwindows (suzh aswx.Panel), the size returned by
8011 this function will be the same as the size the window would have had
8012 after calling Fit.
8013 """
8014 return _core_.Window_GetBestSize(*args, **kwargs)
8015
8016 def GetBestSizeTuple(*args, **kwargs):
8017 """
8018 GetBestSizeTuple() -> (width, height)
8019
8020 This function returns the best acceptable minimal size for the
8021 window, if applicable. For example, for a static text control, it will
8022 be the minimal size such that the control label is not truncated. For
8023 windows containing subwindows (suzh aswx.Panel), the size returned by
8024 this function will be the same as the size the window would have had
8025 after calling Fit.
8026 """
8027 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8028
8029 def InvalidateBestSize(*args, **kwargs):
8030 """
8031 InvalidateBestSize(self)
8032
8033 Reset the cached best size value so it will be recalculated the next
8034 time it is needed.
8035 """
8036 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8037
8038 def CacheBestSize(*args, **kwargs):
8039 """
8040 CacheBestSize(self, Size size)
8041
8042 Cache the best size so it doesn't need to be calculated again, (at least until
8043 some properties of the window change.)
8044 """
8045 return _core_.Window_CacheBestSize(*args, **kwargs)
8046
8047 def GetBestFittingSize(*args, **kwargs):
8048 """
8049 GetBestFittingSize(self) -> Size
8050
8051 This function will merge the window's best size into the window's
8052 minimum size, giving priority to the min size components, and returns
8053 the results.
8054
8055 """
8056 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8057
8058 def GetAdjustedBestSize(*args, **kwargs):
8059 """
8060 GetAdjustedBestSize(self) -> Size
8061
8062 This method is similar to GetBestSize, except in one
8063 thing. GetBestSize should return the minimum untruncated size of the
8064 window, while this method will return the largest of BestSize and any
8065 user specified minimum size. ie. it is the minimum size the window
8066 should currently be drawn at, not the minimal size it can possibly
8067 tolerate.
8068 """
8069 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8070
8071 def Center(*args, **kwargs):
8072 """
8073 Center(self, int direction=BOTH)
8074
8075 Centers the window. The parameter specifies the direction for
8076 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8077 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8078 on the entire screen and not on its parent window. If it is a
8079 top-level window and has no parent then it will always be centered
8080 relative to the screen.
8081 """
8082 return _core_.Window_Center(*args, **kwargs)
8083
8084 Centre = Center
8085 def CenterOnParent(*args, **kwargs):
8086 """
8087 CenterOnParent(self, int dir=BOTH)
8088
8089 Center with respect to the the parent window
8090 """
8091 return _core_.Window_CenterOnParent(*args, **kwargs)
8092
8093 CentreOnParent = CenterOnParent
8094 def Fit(*args, **kwargs):
8095 """
8096 Fit(self)
8097
8098 Sizes the window so that it fits around its subwindows. This function
8099 won't do anything if there are no subwindows and will only really work
8100 correctly if sizers are used for the subwindows layout. Also, if the
8101 window has exactly one subwindow it is better (faster and the result
8102 is more precise as Fit adds some margin to account for fuzziness of
8103 its calculations) to call window.SetClientSize(child.GetSize())
8104 instead of calling Fit.
8105 """
8106 return _core_.Window_Fit(*args, **kwargs)
8107
8108 def FitInside(*args, **kwargs):
8109 """
8110 FitInside(self)
8111
8112 Similar to Fit, but sizes the interior (virtual) size of a
8113 window. Mainly useful with scrolled windows to reset scrollbars after
8114 sizing changes that do not trigger a size event, and/or scrolled
8115 windows without an interior sizer. This function similarly won't do
8116 anything if there are no subwindows.
8117 """
8118 return _core_.Window_FitInside(*args, **kwargs)
8119
8120 def SetSizeHints(*args, **kwargs):
8121 """
8122 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8123 int incH=-1)
8124
8125 Allows specification of minimum and maximum window sizes, and window
8126 size increments. If a pair of values is not set (or set to -1), the
8127 default values will be used. If this function is called, the user
8128 will not be able to size the window outside the given bounds (if it is
8129 a top-level window.) Sizers will also inspect the minimum window size
8130 and will use that value if set when calculating layout.
8131
8132 The resizing increments are only significant under Motif or Xt.
8133 """
8134 return _core_.Window_SetSizeHints(*args, **kwargs)
8135
8136 def SetSizeHintsSz(*args, **kwargs):
8137 """
8138 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8139
8140 Allows specification of minimum and maximum window sizes, and window
8141 size increments. If a pair of values is not set (or set to -1), the
8142 default values will be used. If this function is called, the user
8143 will not be able to size the window outside the given bounds (if it is
8144 a top-level window.) Sizers will also inspect the minimum window size
8145 and will use that value if set when calculating layout.
8146
8147 The resizing increments are only significant under Motif or Xt.
8148 """
8149 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8150
8151 def SetVirtualSizeHints(*args, **kwargs):
8152 """
8153 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8154
8155 Allows specification of minimum and maximum virtual window sizes. If a
8156 pair of values is not set (or set to -1), the default values will be
8157 used. If this function is called, the user will not be able to size
8158 the virtual area of the window outside the given bounds.
8159 """
8160 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8161
8162 def SetVirtualSizeHintsSz(*args, **kwargs):
8163 """
8164 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8165
8166 Allows specification of minimum and maximum virtual window sizes. If a
8167 pair of values is not set (or set to -1), the default values will be
8168 used. If this function is called, the user will not be able to size
8169 the virtual area of the window outside the given bounds.
8170 """
8171 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
8172
8173 def GetMaxSize(*args, **kwargs):
8174 """GetMaxSize(self) -> Size"""
8175 return _core_.Window_GetMaxSize(*args, **kwargs)
8176
8177 def GetMinSize(*args, **kwargs):
8178 """GetMinSize(self) -> Size"""
8179 return _core_.Window_GetMinSize(*args, **kwargs)
8180
8181 def SetMinSize(*args, **kwargs):
8182 """
8183 SetMinSize(self, Size minSize)
8184
8185 A more convenient method than `SetSizeHints` for setting just the
8186 min size.
8187 """
8188 return _core_.Window_SetMinSize(*args, **kwargs)
8189
8190 def SetMaxSize(*args, **kwargs):
8191 """
8192 SetMaxSize(self, Size maxSize)
8193
8194 A more convenient method than `SetSizeHints` for setting just the
8195 max size.
8196 """
8197 return _core_.Window_SetMaxSize(*args, **kwargs)
8198
8199 def GetMinWidth(*args, **kwargs):
8200 """GetMinWidth(self) -> int"""
8201 return _core_.Window_GetMinWidth(*args, **kwargs)
8202
8203 def GetMinHeight(*args, **kwargs):
8204 """GetMinHeight(self) -> int"""
8205 return _core_.Window_GetMinHeight(*args, **kwargs)
8206
8207 def GetMaxWidth(*args, **kwargs):
8208 """GetMaxWidth(self) -> int"""
8209 return _core_.Window_GetMaxWidth(*args, **kwargs)
8210
8211 def GetMaxHeight(*args, **kwargs):
8212 """GetMaxHeight(self) -> int"""
8213 return _core_.Window_GetMaxHeight(*args, **kwargs)
8214
8215 def SetVirtualSize(*args, **kwargs):
8216 """
8217 SetVirtualSize(self, Size size)
8218
8219 Set the the virtual size of a window in pixels. For most windows this
8220 is just the client area of the window, but for some like scrolled
8221 windows it is more or less independent of the screen window size.
8222 """
8223 return _core_.Window_SetVirtualSize(*args, **kwargs)
8224
8225 def SetVirtualSizeWH(*args, **kwargs):
8226 """
8227 SetVirtualSizeWH(self, int w, int h)
8228
8229 Set the the virtual size of a window in pixels. For most windows this
8230 is just the client area of the window, but for some like scrolled
8231 windows it is more or less independent of the screen window size.
8232 """
8233 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8234
8235 def GetVirtualSize(*args, **kwargs):
8236 """
8237 GetVirtualSize(self) -> Size
8238
8239 Get the the virtual size of the window in pixels. For most windows
8240 this is just the client area of the window, but for some like scrolled
8241 windows it is more or less independent of the screen window size.
8242 """
8243 return _core_.Window_GetVirtualSize(*args, **kwargs)
8244
8245 def GetVirtualSizeTuple(*args, **kwargs):
8246 """
8247 GetVirtualSizeTuple() -> (width, height)
8248
8249 Get the the virtual size of the window in pixels. For most windows
8250 this is just the client area of the window, but for some like scrolled
8251 windows it is more or less independent of the screen window size.
8252 """
8253 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8254
8255 def GetBestVirtualSize(*args, **kwargs):
8256 """
8257 GetBestVirtualSize(self) -> Size
8258
8259 Return the largest of ClientSize and BestSize (as determined by a
8260 sizer, interior children, or other means)
8261 """
8262 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8263
8264 def Show(*args, **kwargs):
8265 """
8266 Show(self, bool show=True) -> bool
8267
8268 Shows or hides the window. You may need to call Raise for a top level
8269 window if you want to bring it to top, although this is not needed if
8270 Show is called immediately after the frame creation. Returns True if
8271 the window has been shown or hidden or False if nothing was done
8272 because it already was in the requested state.
8273 """
8274 return _core_.Window_Show(*args, **kwargs)
8275
8276 def Hide(*args, **kwargs):
8277 """
8278 Hide(self) -> bool
8279
8280 Equivalent to calling Show(False).
8281 """
8282 return _core_.Window_Hide(*args, **kwargs)
8283
8284 def Enable(*args, **kwargs):
8285 """
8286 Enable(self, bool enable=True) -> bool
8287
8288 Enable or disable the window for user input. Note that when a parent
8289 window is disabled, all of its children are disabled as well and they
8290 are reenabled again when the parent is. Returns true if the window
8291 has been enabled or disabled, false if nothing was done, i.e. if the
8292 window had already been in the specified state.
8293 """
8294 return _core_.Window_Enable(*args, **kwargs)
8295
8296 def Disable(*args, **kwargs):
8297 """
8298 Disable(self) -> bool
8299
8300 Disables the window, same as Enable(false).
8301 """
8302 return _core_.Window_Disable(*args, **kwargs)
8303
8304 def IsShown(*args, **kwargs):
8305 """
8306 IsShown(self) -> bool
8307
8308 Returns true if the window is shown, false if it has been hidden.
8309 """
8310 return _core_.Window_IsShown(*args, **kwargs)
8311
8312 def IsEnabled(*args, **kwargs):
8313 """
8314 IsEnabled(self) -> bool
8315
8316 Returns true if the window is enabled for input, false otherwise.
8317 """
8318 return _core_.Window_IsEnabled(*args, **kwargs)
8319
8320 def SetWindowStyleFlag(*args, **kwargs):
8321 """
8322 SetWindowStyleFlag(self, long style)
8323
8324 Sets the style of the window. Please note that some styles cannot be
8325 changed after the window creation and that Refresh() might need to be
8326 called after changing the others for the change to take place
8327 immediately.
8328 """
8329 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8330
8331 def GetWindowStyleFlag(*args, **kwargs):
8332 """
8333 GetWindowStyleFlag(self) -> long
8334
8335 Gets the window style that was passed to the constructor or Create
8336 method.
8337 """
8338 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8339
8340 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8341 def HasFlag(*args, **kwargs):
8342 """
8343 HasFlag(self, int flag) -> bool
8344
8345 Test if the given style is set for this window.
8346 """
8347 return _core_.Window_HasFlag(*args, **kwargs)
8348
8349 def IsRetained(*args, **kwargs):
8350 """
8351 IsRetained(self) -> bool
8352
8353 Returns true if the window is retained, false otherwise. Retained
8354 windows are only available on X platforms.
8355 """
8356 return _core_.Window_IsRetained(*args, **kwargs)
8357
8358 def SetExtraStyle(*args, **kwargs):
8359 """
8360 SetExtraStyle(self, long exStyle)
8361
8362 Sets the extra style bits for the window. Extra styles are the less
8363 often used style bits which can't be set with the constructor or with
8364 SetWindowStyleFlag()
8365 """
8366 return _core_.Window_SetExtraStyle(*args, **kwargs)
8367
8368 def GetExtraStyle(*args, **kwargs):
8369 """
8370 GetExtraStyle(self) -> long
8371
8372 Returns the extra style bits for the window.
8373 """
8374 return _core_.Window_GetExtraStyle(*args, **kwargs)
8375
8376 def MakeModal(*args, **kwargs):
8377 """
8378 MakeModal(self, bool modal=True)
8379
8380 Disables all other windows in the application so that the user can
8381 only interact with this window. Passing False will reverse this
8382 effect.
8383 """
8384 return _core_.Window_MakeModal(*args, **kwargs)
8385
8386 def SetThemeEnabled(*args, **kwargs):
8387 """
8388 SetThemeEnabled(self, bool enableTheme)
8389
8390 This function tells a window if it should use the system's "theme"
8391 code to draw the windows' background instead if its own background
8392 drawing code. This will only have an effect on platforms that support
8393 the notion of themes in user defined windows. One such platform is
8394 GTK+ where windows can have (very colourful) backgrounds defined by a
8395 user's selected theme.
8396
8397 Dialogs, notebook pages and the status bar have this flag set to true
8398 by default so that the default look and feel is simulated best.
8399 """
8400 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8401
8402 def GetThemeEnabled(*args, **kwargs):
8403 """
8404 GetThemeEnabled(self) -> bool
8405
8406 Return the themeEnabled flag.
8407 """
8408 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8409
8410 def SetFocus(*args, **kwargs):
8411 """
8412 SetFocus(self)
8413
8414 Set's the focus to this window, allowing it to receive keyboard input.
8415 """
8416 return _core_.Window_SetFocus(*args, **kwargs)
8417
8418 def SetFocusFromKbd(*args, **kwargs):
8419 """
8420 SetFocusFromKbd(self)
8421
8422 Set focus to this window as the result of a keyboard action. Normally
8423 only called internally.
8424 """
8425 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8426
8427 def FindFocus(*args, **kwargs):
8428 """
8429 FindFocus() -> Window
8430
8431 Returns the window or control that currently has the keyboard focus,
8432 or None.
8433 """
8434 return _core_.Window_FindFocus(*args, **kwargs)
8435
8436 FindFocus = staticmethod(FindFocus)
8437 def AcceptsFocus(*args, **kwargs):
8438 """
8439 AcceptsFocus(self) -> bool
8440
8441 Can this window have focus?
8442 """
8443 return _core_.Window_AcceptsFocus(*args, **kwargs)
8444
8445 def AcceptsFocusFromKeyboard(*args, **kwargs):
8446 """
8447 AcceptsFocusFromKeyboard(self) -> bool
8448
8449 Can this window be given focus by keyboard navigation? if not, the
8450 only way to give it focus (provided it accepts it at all) is to click
8451 it.
8452 """
8453 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8454
8455 def Navigate(*args, **kwargs):
8456 """
8457 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8458
8459 Does keyboard navigation from this window to another, by sending a
8460 `wx.NavigationKeyEvent`.
8461 """
8462 return _core_.Window_Navigate(*args, **kwargs)
8463
8464 def MoveAfterInTabOrder(*args, **kwargs):
8465 """
8466 MoveAfterInTabOrder(self, Window win)
8467
8468 Moves this window in the tab navigation order after the specified
8469 sibling window. This means that when the user presses the TAB key on
8470 that other window, the focus switches to this window.
8471
8472 The default tab order is the same as creation order. This function
8473 and `MoveBeforeInTabOrder` allow to change it after creating all the
8474 windows.
8475
8476 """
8477 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8478
8479 def MoveBeforeInTabOrder(*args, **kwargs):
8480 """
8481 MoveBeforeInTabOrder(self, Window win)
8482
8483 Same as `MoveAfterInTabOrder` except that it inserts this window just
8484 before win instead of putting it right after it.
8485 """
8486 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8487
8488 def GetChildren(*args, **kwargs):
8489 """
8490 GetChildren(self) -> PyObject
8491
8492 Returns a list of the window's children. NOTE: Currently this is a
8493 copy of the child window list maintained by the window, so the return
8494 value of this function is only valid as long as the window's children
8495 do not change.
8496 """
8497 return _core_.Window_GetChildren(*args, **kwargs)
8498
8499 def GetParent(*args, **kwargs):
8500 """
8501 GetParent(self) -> Window
8502
8503 Returns the parent window of this window, or None if there isn't one.
8504 """
8505 return _core_.Window_GetParent(*args, **kwargs)
8506
8507 def GetGrandParent(*args, **kwargs):
8508 """
8509 GetGrandParent(self) -> Window
8510
8511 Returns the parent of the parent of this window, or None if there
8512 isn't one.
8513 """
8514 return _core_.Window_GetGrandParent(*args, **kwargs)
8515
8516 def IsTopLevel(*args, **kwargs):
8517 """
8518 IsTopLevel(self) -> bool
8519
8520 Returns true if the given window is a top-level one. Currently all
8521 frames and dialogs are always considered to be top-level windows (even
8522 if they have a parent window).
8523 """
8524 return _core_.Window_IsTopLevel(*args, **kwargs)
8525
8526 def Reparent(*args, **kwargs):
8527 """
8528 Reparent(self, Window newParent) -> bool
8529
8530 Reparents the window, i.e the window will be removed from its current
8531 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8532 re-inserted into another. Available on Windows and GTK. Returns True
8533 if the parent was changed, False otherwise (error or newParent ==
8534 oldParent)
8535 """
8536 return _core_.Window_Reparent(*args, **kwargs)
8537
8538 def AddChild(*args, **kwargs):
8539 """
8540 AddChild(self, Window child)
8541
8542 Adds a child window. This is called automatically by window creation
8543 functions so should not be required by the application programmer.
8544 """
8545 return _core_.Window_AddChild(*args, **kwargs)
8546
8547 def RemoveChild(*args, **kwargs):
8548 """
8549 RemoveChild(self, Window child)
8550
8551 Removes a child window. This is called automatically by window
8552 deletion functions so should not be required by the application
8553 programmer.
8554 """
8555 return _core_.Window_RemoveChild(*args, **kwargs)
8556
8557 def SetDoubleBuffered(*args, **kwargs):
8558 """
8559 SetDoubleBuffered(self, bool on)
8560
8561 Currently wxGTK2 only.
8562 """
8563 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8564
8565 def FindWindowById(*args, **kwargs):
8566 """
8567 FindWindowById(self, long winid) -> Window
8568
8569 Find a chld of this window by window ID
8570 """
8571 return _core_.Window_FindWindowById(*args, **kwargs)
8572
8573 def FindWindowByName(*args, **kwargs):
8574 """
8575 FindWindowByName(self, String name) -> Window
8576
8577 Find a child of this window by name
8578 """
8579 return _core_.Window_FindWindowByName(*args, **kwargs)
8580
8581 def GetEventHandler(*args, **kwargs):
8582 """
8583 GetEventHandler(self) -> EvtHandler
8584
8585 Returns the event handler for this window. By default, the window is
8586 its own event handler.
8587 """
8588 return _core_.Window_GetEventHandler(*args, **kwargs)
8589
8590 def SetEventHandler(*args, **kwargs):
8591 """
8592 SetEventHandler(self, EvtHandler handler)
8593
8594 Sets the event handler for this window. An event handler is an object
8595 that is capable of processing the events sent to a window. By default,
8596 the window is its own event handler, but an application may wish to
8597 substitute another, for example to allow central implementation of
8598 event-handling for a variety of different window classes.
8599
8600 It is usually better to use `wx.Window.PushEventHandler` since this sets
8601 up a chain of event handlers, where an event not handled by one event
8602 handler is handed to the next one in the chain.
8603 """
8604 return _core_.Window_SetEventHandler(*args, **kwargs)
8605
8606 def PushEventHandler(*args, **kwargs):
8607 """
8608 PushEventHandler(self, EvtHandler handler)
8609
8610 Pushes this event handler onto the event handler stack for the window.
8611 An event handler is an object that is capable of processing the events
8612 sent to a window. By default, the window is its own event handler, but
8613 an application may wish to substitute another, for example to allow
8614 central implementation of event-handling for a variety of different
8615 window classes.
8616
8617 wx.Window.PushEventHandler allows an application to set up a chain of
8618 event handlers, where an event not handled by one event handler is
8619 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8620 remove the event handler.
8621 """
8622 return _core_.Window_PushEventHandler(*args, **kwargs)
8623
8624 def PopEventHandler(*args, **kwargs):
8625 """
8626 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8627
8628 Removes and returns the top-most event handler on the event handler
8629 stack. If deleteHandler is True then the wx.EvtHandler object will be
8630 destroyed after it is popped.
8631 """
8632 return _core_.Window_PopEventHandler(*args, **kwargs)
8633
8634 def RemoveEventHandler(*args, **kwargs):
8635 """
8636 RemoveEventHandler(self, EvtHandler handler) -> bool
8637
8638 Find the given handler in the event handler chain and remove (but not
8639 delete) it from the event handler chain, return True if it was found
8640 and False otherwise (this also results in an assert failure so this
8641 function should only be called when the handler is supposed to be
8642 there.)
8643 """
8644 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8645
8646 def SetValidator(*args, **kwargs):
8647 """
8648 SetValidator(self, Validator validator)
8649
8650 Deletes the current validator (if any) and sets the window validator,
8651 having called wx.Validator.Clone to create a new validator of this
8652 type.
8653 """
8654 return _core_.Window_SetValidator(*args, **kwargs)
8655
8656 def GetValidator(*args, **kwargs):
8657 """
8658 GetValidator(self) -> Validator
8659
8660 Returns a pointer to the current validator for the window, or None if
8661 there is none.
8662 """
8663 return _core_.Window_GetValidator(*args, **kwargs)
8664
8665 def Validate(*args, **kwargs):
8666 """
8667 Validate(self) -> bool
8668
8669 Validates the current values of the child controls using their
8670 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8671 style flag set, the method will also call Validate() of all child
8672 windows. Returns false if any of the validations failed.
8673 """
8674 return _core_.Window_Validate(*args, **kwargs)
8675
8676 def TransferDataToWindow(*args, **kwargs):
8677 """
8678 TransferDataToWindow(self) -> bool
8679
8680 Transfers values to child controls from data areas specified by their
8681 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8682 style flag set, the method will also call TransferDataToWindow() of
8683 all child windows.
8684 """
8685 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8686
8687 def TransferDataFromWindow(*args, **kwargs):
8688 """
8689 TransferDataFromWindow(self) -> bool
8690
8691 Transfers values from child controls to data areas specified by their
8692 validators. Returns false if a transfer failed. If the window has
8693 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8694 also call TransferDataFromWindow() of all child windows.
8695 """
8696 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8697
8698 def InitDialog(*args, **kwargs):
8699 """
8700 InitDialog(self)
8701
8702 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8703 to the dialog via validators.
8704 """
8705 return _core_.Window_InitDialog(*args, **kwargs)
8706
8707 def SetAcceleratorTable(*args, **kwargs):
8708 """
8709 SetAcceleratorTable(self, AcceleratorTable accel)
8710
8711 Sets the accelerator table for this window.
8712 """
8713 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8714
8715 def GetAcceleratorTable(*args, **kwargs):
8716 """
8717 GetAcceleratorTable(self) -> AcceleratorTable
8718
8719 Gets the accelerator table for this window.
8720 """
8721 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8722
8723 def RegisterHotKey(*args, **kwargs):
8724 """
8725 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8726
8727 Registers a system wide hotkey. Every time the user presses the hotkey
8728 registered here, this window will receive a hotkey event. It will
8729 receive the event even if the application is in the background and
8730 does not have the input focus because the user is working with some
8731 other application. To bind an event handler function to this hotkey
8732 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8733 hotkey was registered successfully.
8734 """
8735 return _core_.Window_RegisterHotKey(*args, **kwargs)
8736
8737 def UnregisterHotKey(*args, **kwargs):
8738 """
8739 UnregisterHotKey(self, int hotkeyId) -> bool
8740
8741 Unregisters a system wide hotkey.
8742 """
8743 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8744
8745 def ConvertDialogPointToPixels(*args, **kwargs):
8746 """
8747 ConvertDialogPointToPixels(self, Point pt) -> Point
8748
8749 Converts a point or size from dialog units to pixels. Dialog units
8750 are used for maintaining a dialog's proportions even if the font
8751 changes. For the x dimension, the dialog units are multiplied by the
8752 average character width and then divided by 4. For the y dimension,
8753 the dialog units are multiplied by the average character height and
8754 then divided by 8.
8755 """
8756 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8757
8758 def ConvertDialogSizeToPixels(*args, **kwargs):
8759 """
8760 ConvertDialogSizeToPixels(self, Size sz) -> Size
8761
8762 Converts a point or size from dialog units to pixels. Dialog units
8763 are used for maintaining a dialog's proportions even if the font
8764 changes. For the x dimension, the dialog units are multiplied by the
8765 average character width and then divided by 4. For the y dimension,
8766 the dialog units are multiplied by the average character height and
8767 then divided by 8.
8768 """
8769 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8770
8771 def DLG_PNT(*args, **kwargs):
8772 """
8773 DLG_PNT(self, Point pt) -> Point
8774
8775 Converts a point or size from dialog units to pixels. Dialog units
8776 are used for maintaining a dialog's proportions even if the font
8777 changes. For the x dimension, the dialog units are multiplied by the
8778 average character width and then divided by 4. For the y dimension,
8779 the dialog units are multiplied by the average character height and
8780 then divided by 8.
8781 """
8782 return _core_.Window_DLG_PNT(*args, **kwargs)
8783
8784 def DLG_SZE(*args, **kwargs):
8785 """
8786 DLG_SZE(self, Size sz) -> Size
8787
8788 Converts a point or size from dialog units to pixels. Dialog units
8789 are used for maintaining a dialog's proportions even if the font
8790 changes. For the x dimension, the dialog units are multiplied by the
8791 average character width and then divided by 4. For the y dimension,
8792 the dialog units are multiplied by the average character height and
8793 then divided by 8.
8794 """
8795 return _core_.Window_DLG_SZE(*args, **kwargs)
8796
8797 def ConvertPixelPointToDialog(*args, **kwargs):
8798 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8799 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8800
8801 def ConvertPixelSizeToDialog(*args, **kwargs):
8802 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8803 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8804
8805 def WarpPointer(*args, **kwargs):
8806 """
8807 WarpPointer(self, int x, int y)
8808
8809 Moves the pointer to the given position on the window.
8810
8811 NOTE: This function is not supported under Mac because Apple Human
8812 Interface Guidelines forbid moving the mouse cursor programmatically.
8813 """
8814 return _core_.Window_WarpPointer(*args, **kwargs)
8815
8816 def CaptureMouse(*args, **kwargs):
8817 """
8818 CaptureMouse(self)
8819
8820 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8821 release the capture.
8822
8823 Note that wxWindows maintains the stack of windows having captured the
8824 mouse and when the mouse is released the capture returns to the window
8825 which had had captured it previously and it is only really released if
8826 there were no previous window. In particular, this means that you must
8827 release the mouse as many times as you capture it, unless the window
8828 receives the `wx.MouseCaptureLostEvent` event.
8829
8830 Any application which captures the mouse in the beginning of some
8831 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8832 operation when it receives the event. The event handler must not
8833 recapture mouse.
8834 """
8835 return _core_.Window_CaptureMouse(*args, **kwargs)
8836
8837 def ReleaseMouse(*args, **kwargs):
8838 """
8839 ReleaseMouse(self)
8840
8841 Releases mouse input captured with wx.Window.CaptureMouse.
8842 """
8843 return _core_.Window_ReleaseMouse(*args, **kwargs)
8844
8845 def GetCapture(*args, **kwargs):
8846 """
8847 GetCapture() -> Window
8848
8849 Returns the window which currently captures the mouse or None
8850 """
8851 return _core_.Window_GetCapture(*args, **kwargs)
8852
8853 GetCapture = staticmethod(GetCapture)
8854 def HasCapture(*args, **kwargs):
8855 """
8856 HasCapture(self) -> bool
8857
8858 Returns true if this window has the current mouse capture.
8859 """
8860 return _core_.Window_HasCapture(*args, **kwargs)
8861
8862 def Refresh(*args, **kwargs):
8863 """
8864 Refresh(self, bool eraseBackground=True, Rect rect=None)
8865
8866 Mark the specified rectangle (or the whole window) as "dirty" so it
8867 will be repainted. Causes an EVT_PAINT event to be generated and sent
8868 to the window.
8869 """
8870 return _core_.Window_Refresh(*args, **kwargs)
8871
8872 def RefreshRect(*args, **kwargs):
8873 """
8874 RefreshRect(self, Rect rect, bool eraseBackground=True)
8875
8876 Redraws the contents of the given rectangle: the area inside it will
8877 be repainted. This is the same as Refresh but has a nicer syntax.
8878 """
8879 return _core_.Window_RefreshRect(*args, **kwargs)
8880
8881 def Update(*args, **kwargs):
8882 """
8883 Update(self)
8884
8885 Calling this method immediately repaints the invalidated area of the
8886 window instead of waiting for the EVT_PAINT event to happen, (normally
8887 this would usually only happen when the flow of control returns to the
8888 event loop.) Notice that this function doesn't refresh the window and
8889 does nothing if the window has been already repainted. Use Refresh
8890 first if you want to immediately redraw the window (or some portion of
8891 it) unconditionally.
8892 """
8893 return _core_.Window_Update(*args, **kwargs)
8894
8895 def ClearBackground(*args, **kwargs):
8896 """
8897 ClearBackground(self)
8898
8899 Clears the window by filling it with the current background
8900 colour. Does not cause an erase background event to be generated.
8901 """
8902 return _core_.Window_ClearBackground(*args, **kwargs)
8903
8904 def Freeze(*args, **kwargs):
8905 """
8906 Freeze(self)
8907
8908 Freezes the window or, in other words, prevents any updates from
8909 taking place on screen, the window is not redrawn at all. Thaw must be
8910 called to reenable window redrawing. Calls to Freeze/Thaw may be
8911 nested, with the actual Thaw being delayed until all the nesting has
8912 been undone.
8913
8914 This method is useful for visual appearance optimization (for example,
8915 it is a good idea to use it before inserting large amount of text into
8916 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8917 for all controls so it is mostly just a hint to wxWindows and not a
8918 mandatory directive.
8919 """
8920 return _core_.Window_Freeze(*args, **kwargs)
8921
8922 def Thaw(*args, **kwargs):
8923 """
8924 Thaw(self)
8925
8926 Reenables window updating after a previous call to Freeze. Calls to
8927 Freeze/Thaw may be nested, so Thaw must be called the same number of
8928 times that Freeze was before the window will be updated.
8929 """
8930 return _core_.Window_Thaw(*args, **kwargs)
8931
8932 def PrepareDC(*args, **kwargs):
8933 """
8934 PrepareDC(self, DC dc)
8935
8936 Call this function to prepare the device context for drawing a
8937 scrolled image. It sets the device origin according to the current
8938 scroll position.
8939 """
8940 return _core_.Window_PrepareDC(*args, **kwargs)
8941
8942 def GetUpdateRegion(*args, **kwargs):
8943 """
8944 GetUpdateRegion(self) -> Region
8945
8946 Returns the region specifying which parts of the window have been
8947 damaged. Should only be called within an EVT_PAINT handler.
8948 """
8949 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8950
8951 def GetUpdateClientRect(*args, **kwargs):
8952 """
8953 GetUpdateClientRect(self) -> Rect
8954
8955 Get the update rectangle region bounding box in client coords.
8956 """
8957 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8958
8959 def IsExposed(*args, **kwargs):
8960 """
8961 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8962
8963 Returns true if the given point or rectangle area has been exposed
8964 since the last repaint. Call this in an paint event handler to
8965 optimize redrawing by only redrawing those areas, which have been
8966 exposed.
8967 """
8968 return _core_.Window_IsExposed(*args, **kwargs)
8969
8970 def IsExposedPoint(*args, **kwargs):
8971 """
8972 IsExposedPoint(self, Point pt) -> bool
8973
8974 Returns true if the given point or rectangle area has been exposed
8975 since the last repaint. Call this in an paint event handler to
8976 optimize redrawing by only redrawing those areas, which have been
8977 exposed.
8978 """
8979 return _core_.Window_IsExposedPoint(*args, **kwargs)
8980
8981 def IsExposedRect(*args, **kwargs):
8982 """
8983 IsExposedRect(self, Rect rect) -> bool
8984
8985 Returns true if the given point or rectangle area has been exposed
8986 since the last repaint. Call this in an paint event handler to
8987 optimize redrawing by only redrawing those areas, which have been
8988 exposed.
8989 """
8990 return _core_.Window_IsExposedRect(*args, **kwargs)
8991
8992 def GetDefaultAttributes(*args, **kwargs):
8993 """
8994 GetDefaultAttributes(self) -> VisualAttributes
8995
8996 Get the default attributes for an instance of this class. This is
8997 useful if you want to use the same font or colour in your own control
8998 as in a standard control -- which is a much better idea than hard
8999 coding specific colours or fonts which might look completely out of
9000 place on the user's system, especially if it uses themes.
9001 """
9002 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9003
9004 def GetClassDefaultAttributes(*args, **kwargs):
9005 """
9006 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9007
9008 Get the default attributes for this class. This is useful if you want
9009 to use the same font or colour in your own control as in a standard
9010 control -- which is a much better idea than hard coding specific
9011 colours or fonts which might look completely out of place on the
9012 user's system, especially if it uses themes.
9013
9014 The variant parameter is only relevant under Mac currently and is
9015 ignore under other platforms. Under Mac, it will change the size of
9016 the returned font. See `wx.Window.SetWindowVariant` for more about
9017 this.
9018 """
9019 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9020
9021 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9022 def SetBackgroundColour(*args, **kwargs):
9023 """
9024 SetBackgroundColour(self, Colour colour) -> bool
9025
9026 Sets the background colour of the window. Returns True if the colour
9027 was changed. The background colour is usually painted by the default
9028 EVT_ERASE_BACKGROUND event handler function under Windows and
9029 automatically under GTK. Using `wx.NullColour` will reset the window
9030 to the default background colour.
9031
9032 Note that setting the background colour may not cause an immediate
9033 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9034 calling this function.
9035
9036 Using this function will disable attempts to use themes for this
9037 window, if the system supports them. Use with care since usually the
9038 themes represent the appearance chosen by the user to be used for all
9039 applications on the system.
9040 """
9041 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9042
9043 def SetOwnBackgroundColour(*args, **kwargs):
9044 """SetOwnBackgroundColour(self, Colour colour)"""
9045 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
9046
9047 def SetForegroundColour(*args, **kwargs):
9048 """
9049 SetForegroundColour(self, Colour colour) -> bool
9050
9051 Sets the foreground colour of the window. Returns True is the colour
9052 was changed. The interpretation of foreground colour is dependent on
9053 the window class; it may be the text colour or other colour, or it may
9054 not be used at all.
9055 """
9056 return _core_.Window_SetForegroundColour(*args, **kwargs)
9057
9058 def SetOwnForegroundColour(*args, **kwargs):
9059 """SetOwnForegroundColour(self, Colour colour)"""
9060 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
9061
9062 def GetBackgroundColour(*args, **kwargs):
9063 """
9064 GetBackgroundColour(self) -> Colour
9065
9066 Returns the background colour of the window.
9067 """
9068 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9069
9070 def GetForegroundColour(*args, **kwargs):
9071 """
9072 GetForegroundColour(self) -> Colour
9073
9074 Returns the foreground colour of the window. The interpretation of
9075 foreground colour is dependent on the window class; it may be the text
9076 colour or other colour, or it may not be used at all.
9077 """
9078 return _core_.Window_GetForegroundColour(*args, **kwargs)
9079
9080 def InheritsBackgroundColour(*args, **kwargs):
9081 """InheritsBackgroundColour(self) -> bool"""
9082 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9083
9084 def UseBgCol(*args, **kwargs):
9085 """UseBgCol(self) -> bool"""
9086 return _core_.Window_UseBgCol(*args, **kwargs)
9087
9088 def SetBackgroundStyle(*args, **kwargs):
9089 """
9090 SetBackgroundStyle(self, int style) -> bool
9091
9092 Returns the background style of the window. The background style
9093 indicates how the background of the window is drawn.
9094
9095 ====================== ========================================
9096 wx.BG_STYLE_SYSTEM The background colour or pattern should
9097 be determined by the system
9098 wx.BG_STYLE_COLOUR The background should be a solid colour
9099 wx.BG_STYLE_CUSTOM The background will be implemented by the
9100 application.
9101 ====================== ========================================
9102
9103 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9104 a custom background, such as a tiled bitmap. Currently the style has
9105 no effect on other platforms.
9106
9107 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9108 """
9109 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9110
9111 def GetBackgroundStyle(*args, **kwargs):
9112 """
9113 GetBackgroundStyle(self) -> int
9114
9115 Returns the background style of the window.
9116
9117 :see: `SetBackgroundStyle`
9118 """
9119 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9120
9121 def HasTransparentBackground(*args, **kwargs):
9122 """
9123 HasTransparentBackground(self) -> bool
9124
9125 Returns True if this window's background is transparent (as, for
9126 example, for `wx.StaticText`) and should show the parent window's
9127 background.
9128
9129 This method is mostly used internally by the library itself and you
9130 normally shouldn't have to call it. You may, however, have to override
9131 it in your custom control classes to ensure that background is painted
9132 correctly.
9133 """
9134 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9135
9136 def SetCursor(*args, **kwargs):
9137 """
9138 SetCursor(self, Cursor cursor) -> bool
9139
9140 Sets the window's cursor. Notice that the window cursor also sets it
9141 for the children of the window implicitly.
9142
9143 The cursor may be wx.NullCursor in which case the window cursor will
9144 be reset back to default.
9145 """
9146 return _core_.Window_SetCursor(*args, **kwargs)
9147
9148 def GetCursor(*args, **kwargs):
9149 """
9150 GetCursor(self) -> Cursor
9151
9152 Return the cursor associated with this window.
9153 """
9154 return _core_.Window_GetCursor(*args, **kwargs)
9155
9156 def SetFont(*args, **kwargs):
9157 """
9158 SetFont(self, Font font) -> bool
9159
9160 Sets the font for this window.
9161 """
9162 return _core_.Window_SetFont(*args, **kwargs)
9163
9164 def SetOwnFont(*args, **kwargs):
9165 """SetOwnFont(self, Font font)"""
9166 return _core_.Window_SetOwnFont(*args, **kwargs)
9167
9168 def GetFont(*args, **kwargs):
9169 """
9170 GetFont(self) -> Font
9171
9172 Returns the default font used for this window.
9173 """
9174 return _core_.Window_GetFont(*args, **kwargs)
9175
9176 def SetCaret(*args, **kwargs):
9177 """
9178 SetCaret(self, Caret caret)
9179
9180 Sets the caret associated with the window.
9181 """
9182 return _core_.Window_SetCaret(*args, **kwargs)
9183
9184 def GetCaret(*args, **kwargs):
9185 """
9186 GetCaret(self) -> Caret
9187
9188 Returns the caret associated with the window.
9189 """
9190 return _core_.Window_GetCaret(*args, **kwargs)
9191
9192 def GetCharHeight(*args, **kwargs):
9193 """
9194 GetCharHeight(self) -> int
9195
9196 Get the (average) character size for the current font.
9197 """
9198 return _core_.Window_GetCharHeight(*args, **kwargs)
9199
9200 def GetCharWidth(*args, **kwargs):
9201 """
9202 GetCharWidth(self) -> int
9203
9204 Get the (average) character size for the current font.
9205 """
9206 return _core_.Window_GetCharWidth(*args, **kwargs)
9207
9208 def GetTextExtent(*args, **kwargs):
9209 """
9210 GetTextExtent(String string) -> (width, height)
9211
9212 Get the width and height of the text using the current font.
9213 """
9214 return _core_.Window_GetTextExtent(*args, **kwargs)
9215
9216 def GetFullTextExtent(*args, **kwargs):
9217 """
9218 GetFullTextExtent(String string, Font font=None) ->
9219 (width, height, descent, externalLeading)
9220
9221 Get the width, height, decent and leading of the text using the
9222 current or specified font.
9223 """
9224 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9225
9226 def ClientToScreenXY(*args, **kwargs):
9227 """
9228 ClientToScreenXY(int x, int y) -> (x,y)
9229
9230 Converts to screen coordinates from coordinates relative to this window.
9231 """
9232 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9233
9234 def ScreenToClientXY(*args, **kwargs):
9235 """
9236 ScreenToClientXY(int x, int y) -> (x,y)
9237
9238 Converts from screen to client window coordinates.
9239 """
9240 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9241
9242 def ClientToScreen(*args, **kwargs):
9243 """
9244 ClientToScreen(self, Point pt) -> Point
9245
9246 Converts to screen coordinates from coordinates relative to this window.
9247 """
9248 return _core_.Window_ClientToScreen(*args, **kwargs)
9249
9250 def ScreenToClient(*args, **kwargs):
9251 """
9252 ScreenToClient(self, Point pt) -> Point
9253
9254 Converts from screen to client window coordinates.
9255 """
9256 return _core_.Window_ScreenToClient(*args, **kwargs)
9257
9258 def HitTestXY(*args, **kwargs):
9259 """
9260 HitTestXY(self, int x, int y) -> int
9261
9262 Test where the given (in client coords) point lies
9263 """
9264 return _core_.Window_HitTestXY(*args, **kwargs)
9265
9266 def HitTest(*args, **kwargs):
9267 """
9268 HitTest(self, Point pt) -> int
9269
9270 Test where the given (in client coords) point lies
9271 """
9272 return _core_.Window_HitTest(*args, **kwargs)
9273
9274 def GetBorder(*args):
9275 """
9276 GetBorder(self, long flags) -> int
9277 GetBorder(self) -> int
9278
9279 Get border for the flags of this window
9280 """
9281 return _core_.Window_GetBorder(*args)
9282
9283 def UpdateWindowUI(*args, **kwargs):
9284 """
9285 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9286
9287 This function sends EVT_UPDATE_UI events to the window. The particular
9288 implementation depends on the window; for example a wx.ToolBar will
9289 send an update UI event for each toolbar button, and a wx.Frame will
9290 send an update UI event for each menubar menu item. You can call this
9291 function from your application to ensure that your UI is up-to-date at
9292 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9293 concerned). This may be necessary if you have called
9294 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9295 limit the overhead that wxWindows incurs by sending update UI events
9296 in idle time.
9297 """
9298 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9299
9300 def PopupMenuXY(*args, **kwargs):
9301 """
9302 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9303
9304 Pops up the given menu at the specified coordinates, relative to this window,
9305 and returns control when the user has dismissed the menu. If a menu item is
9306 selected, the corresponding menu event is generated and will be processed as
9307 usual. If the default position is given then the current position of the
9308 mouse cursor will be used.
9309 """
9310 return _core_.Window_PopupMenuXY(*args, **kwargs)
9311
9312 def PopupMenu(*args, **kwargs):
9313 """
9314 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9315
9316 Pops up the given menu at the specified coordinates, relative to this window,
9317 and returns control when the user has dismissed the menu. If a menu item is
9318 selected, the corresponding menu event is generated and will be processed as
9319 usual. If the default position is given then the current position of the
9320 mouse cursor will be used.
9321 """
9322 return _core_.Window_PopupMenu(*args, **kwargs)
9323
9324 def HasMultiplePages(*args, **kwargs):
9325 """HasMultiplePages(self) -> bool"""
9326 return _core_.Window_HasMultiplePages(*args, **kwargs)
9327
9328 def GetHandle(*args, **kwargs):
9329 """
9330 GetHandle(self) -> long
9331
9332 Returns the platform-specific handle (as a long integer) of the
9333 physical window. Currently on wxMac it returns the handle of the
9334 toplevel parent of the window.
9335 """
9336 return _core_.Window_GetHandle(*args, **kwargs)
9337
9338 def AssociateHandle(*args, **kwargs):
9339 """
9340 AssociateHandle(self, long handle)
9341
9342 Associate the window with a new native handle
9343 """
9344 return _core_.Window_AssociateHandle(*args, **kwargs)
9345
9346 def DissociateHandle(*args, **kwargs):
9347 """
9348 DissociateHandle(self)
9349
9350 Dissociate the current native handle from the window
9351 """
9352 return _core_.Window_DissociateHandle(*args, **kwargs)
9353
9354 def HasScrollbar(*args, **kwargs):
9355 """
9356 HasScrollbar(self, int orient) -> bool
9357
9358 Does the window have the scrollbar for this orientation?
9359 """
9360 return _core_.Window_HasScrollbar(*args, **kwargs)
9361
9362 def SetScrollbar(*args, **kwargs):
9363 """
9364 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9365 bool refresh=True)
9366
9367 Sets the scrollbar properties of a built-in scrollbar.
9368 """
9369 return _core_.Window_SetScrollbar(*args, **kwargs)
9370
9371 def SetScrollPos(*args, **kwargs):
9372 """
9373 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9374
9375 Sets the position of one of the built-in scrollbars.
9376 """
9377 return _core_.Window_SetScrollPos(*args, **kwargs)
9378
9379 def GetScrollPos(*args, **kwargs):
9380 """
9381 GetScrollPos(self, int orientation) -> int
9382
9383 Returns the built-in scrollbar position.
9384 """
9385 return _core_.Window_GetScrollPos(*args, **kwargs)
9386
9387 def GetScrollThumb(*args, **kwargs):
9388 """
9389 GetScrollThumb(self, int orientation) -> int
9390
9391 Returns the built-in scrollbar thumb size.
9392 """
9393 return _core_.Window_GetScrollThumb(*args, **kwargs)
9394
9395 def GetScrollRange(*args, **kwargs):
9396 """
9397 GetScrollRange(self, int orientation) -> int
9398
9399 Returns the built-in scrollbar range.
9400 """
9401 return _core_.Window_GetScrollRange(*args, **kwargs)
9402
9403 def ScrollWindow(*args, **kwargs):
9404 """
9405 ScrollWindow(self, int dx, int dy, Rect rect=None)
9406
9407 Physically scrolls the pixels in the window and move child windows
9408 accordingly. Use this function to optimise your scrolling
9409 implementations, to minimise the area that must be redrawn. Note that
9410 it is rarely required to call this function from a user program.
9411 """
9412 return _core_.Window_ScrollWindow(*args, **kwargs)
9413
9414 def ScrollLines(*args, **kwargs):
9415 """
9416 ScrollLines(self, int lines) -> bool
9417
9418 If the platform and window class supports it, scrolls the window by
9419 the given number of lines down, if lines is positive, or up if lines
9420 is negative. Returns True if the window was scrolled, False if it was
9421 already on top/bottom and nothing was done.
9422 """
9423 return _core_.Window_ScrollLines(*args, **kwargs)
9424
9425 def ScrollPages(*args, **kwargs):
9426 """
9427 ScrollPages(self, int pages) -> bool
9428
9429 If the platform and window class supports it, scrolls the window by
9430 the given number of pages down, if pages is positive, or up if pages
9431 is negative. Returns True if the window was scrolled, False if it was
9432 already on top/bottom and nothing was done.
9433 """
9434 return _core_.Window_ScrollPages(*args, **kwargs)
9435
9436 def LineUp(*args, **kwargs):
9437 """
9438 LineUp(self) -> bool
9439
9440 This is just a wrapper for ScrollLines(-1).
9441 """
9442 return _core_.Window_LineUp(*args, **kwargs)
9443
9444 def LineDown(*args, **kwargs):
9445 """
9446 LineDown(self) -> bool
9447
9448 This is just a wrapper for ScrollLines(1).
9449 """
9450 return _core_.Window_LineDown(*args, **kwargs)
9451
9452 def PageUp(*args, **kwargs):
9453 """
9454 PageUp(self) -> bool
9455
9456 This is just a wrapper for ScrollPages(-1).
9457 """
9458 return _core_.Window_PageUp(*args, **kwargs)
9459
9460 def PageDown(*args, **kwargs):
9461 """
9462 PageDown(self) -> bool
9463
9464 This is just a wrapper for ScrollPages(1).
9465 """
9466 return _core_.Window_PageDown(*args, **kwargs)
9467
9468 def SetHelpText(*args, **kwargs):
9469 """
9470 SetHelpText(self, String text)
9471
9472 Sets the help text to be used as context-sensitive help for this
9473 window. Note that the text is actually stored by the current
9474 `wx.HelpProvider` implementation, and not in the window object itself.
9475 """
9476 return _core_.Window_SetHelpText(*args, **kwargs)
9477
9478 def SetHelpTextForId(*args, **kwargs):
9479 """
9480 SetHelpTextForId(self, String text)
9481
9482 Associate this help text with all windows with the same id as this
9483 one.
9484 """
9485 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9486
9487 def GetHelpTextAtPoint(*args, **kwargs):
9488 """
9489 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9490
9491 Get the help string associated with the given position in this window.
9492
9493 Notice that pt may be invalid if event origin is keyboard or unknown
9494 and this method should return the global window help text then
9495
9496 """
9497 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9498
9499 def GetHelpText(*args, **kwargs):
9500 """
9501 GetHelpText(self) -> String
9502
9503 Gets the help text to be used as context-sensitive help for this
9504 window. Note that the text is actually stored by the current
9505 `wx.HelpProvider` implementation, and not in the window object itself.
9506 """
9507 return _core_.Window_GetHelpText(*args, **kwargs)
9508
9509 def SetToolTipString(*args, **kwargs):
9510 """
9511 SetToolTipString(self, String tip)
9512
9513 Attach a tooltip to the window.
9514 """
9515 return _core_.Window_SetToolTipString(*args, **kwargs)
9516
9517 def SetToolTip(*args, **kwargs):
9518 """
9519 SetToolTip(self, ToolTip tip)
9520
9521 Attach a tooltip to the window.
9522 """
9523 return _core_.Window_SetToolTip(*args, **kwargs)
9524
9525 def GetToolTip(*args, **kwargs):
9526 """
9527 GetToolTip(self) -> ToolTip
9528
9529 get the associated tooltip or None if none
9530 """
9531 return _core_.Window_GetToolTip(*args, **kwargs)
9532
9533 def SetDropTarget(*args, **kwargs):
9534 """
9535 SetDropTarget(self, DropTarget dropTarget)
9536
9537 Associates a drop target with this window. If the window already has
9538 a drop target, it is deleted.
9539 """
9540 return _core_.Window_SetDropTarget(*args, **kwargs)
9541
9542 def GetDropTarget(*args, **kwargs):
9543 """
9544 GetDropTarget(self) -> DropTarget
9545
9546 Returns the associated drop target, which may be None.
9547 """
9548 return _core_.Window_GetDropTarget(*args, **kwargs)
9549
9550 def DragAcceptFiles(*args, **kwargs):
9551 """
9552 DragAcceptFiles(self, bool accept)
9553
9554 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9555 Only functional on Windows.
9556 """
9557 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9558
9559 def SetConstraints(*args, **kwargs):
9560 """
9561 SetConstraints(self, LayoutConstraints constraints)
9562
9563 Sets the window to have the given layout constraints. If an existing
9564 layout constraints object is already owned by the window, it will be
9565 deleted. Pass None to disassociate and delete the window's current
9566 constraints.
9567
9568 You must call SetAutoLayout to tell a window to use the constraints
9569 automatically in its default EVT_SIZE handler; otherwise, you must
9570 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9571 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9572 effect.
9573 """
9574 return _core_.Window_SetConstraints(*args, **kwargs)
9575
9576 def GetConstraints(*args, **kwargs):
9577 """
9578 GetConstraints(self) -> LayoutConstraints
9579
9580 Returns a pointer to the window's layout constraints, or None if there
9581 are none.
9582 """
9583 return _core_.Window_GetConstraints(*args, **kwargs)
9584
9585 def SetAutoLayout(*args, **kwargs):
9586 """
9587 SetAutoLayout(self, bool autoLayout)
9588
9589 Determines whether the Layout function will be called automatically
9590 when the window is resized. lease note that this only happens for the
9591 windows usually used to contain children, namely `wx.Panel` and
9592 `wx.TopLevelWindow` (and the classes deriving from them).
9593
9594 This method is called implicitly by `SetSizer` but if you use
9595 `SetConstraints` you should call it manually or otherwise the window
9596 layout won't be correctly updated when its size changes.
9597 """
9598 return _core_.Window_SetAutoLayout(*args, **kwargs)
9599
9600 def GetAutoLayout(*args, **kwargs):
9601 """
9602 GetAutoLayout(self) -> bool
9603
9604 Returns the current autoLayout setting
9605 """
9606 return _core_.Window_GetAutoLayout(*args, **kwargs)
9607
9608 def Layout(*args, **kwargs):
9609 """
9610 Layout(self) -> bool
9611
9612 Invokes the constraint-based layout algorithm or the sizer-based
9613 algorithm for this window. See SetAutoLayout: when auto layout is on,
9614 this function gets called automatically by the default EVT_SIZE
9615 handler when the window is resized.
9616 """
9617 return _core_.Window_Layout(*args, **kwargs)
9618
9619 def SetSizer(*args, **kwargs):
9620 """
9621 SetSizer(self, Sizer sizer, bool deleteOld=True)
9622
9623 Sets the window to have the given layout sizer. The window will then
9624 own the object, and will take care of its deletion. If an existing
9625 layout sizer object is already owned by the window, it will be deleted
9626 if the deleteOld parameter is true. Note that this function will also
9627 call SetAutoLayout implicitly with a True parameter if the sizer is
9628 non-None, and False otherwise.
9629 """
9630 return _core_.Window_SetSizer(*args, **kwargs)
9631
9632 def SetSizerAndFit(*args, **kwargs):
9633 """
9634 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9635
9636 The same as SetSizer, except it also sets the size hints for the
9637 window based on the sizer's minimum size.
9638 """
9639 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9640
9641 def GetSizer(*args, **kwargs):
9642 """
9643 GetSizer(self) -> Sizer
9644
9645 Return the sizer associated with the window by a previous call to
9646 SetSizer or None if there isn't one.
9647 """
9648 return _core_.Window_GetSizer(*args, **kwargs)
9649
9650 def SetContainingSizer(*args, **kwargs):
9651 """
9652 SetContainingSizer(self, Sizer sizer)
9653
9654 This normally does not need to be called by application code. It is
9655 called internally when a window is added to a sizer, and is used so
9656 the window can remove itself from the sizer when it is destroyed.
9657 """
9658 return _core_.Window_SetContainingSizer(*args, **kwargs)
9659
9660 def GetContainingSizer(*args, **kwargs):
9661 """
9662 GetContainingSizer(self) -> Sizer
9663
9664 Return the sizer that this window is a member of, if any, otherwise None.
9665 """
9666 return _core_.Window_GetContainingSizer(*args, **kwargs)
9667
9668 def InheritAttributes(*args, **kwargs):
9669 """
9670 InheritAttributes(self)
9671
9672 This function is (or should be, in case of custom controls) called
9673 during window creation to intelligently set up the window visual
9674 attributes, that is the font and the foreground and background
9675 colours.
9676
9677 By 'intelligently' the following is meant: by default, all windows use
9678 their own default attributes. However if some of the parent's
9679 attributes are explicitly changed (that is, using SetFont and not
9680 SetOwnFont) and if the corresponding attribute hadn't been
9681 explicitly set for this window itself, then this window takes the same
9682 value as used by the parent. In addition, if the window overrides
9683 ShouldInheritColours to return false, the colours will not be changed
9684 no matter what and only the font might.
9685
9686 This rather complicated logic is necessary in order to accommodate the
9687 different usage scenarios. The most common one is when all default
9688 attributes are used and in this case, nothing should be inherited as
9689 in modern GUIs different controls use different fonts (and colours)
9690 than their siblings so they can't inherit the same value from the
9691 parent. However it was also deemed desirable to allow to simply change
9692 the attributes of all children at once by just changing the font or
9693 colour of their common parent, hence in this case we do inherit the
9694 parents attributes.
9695
9696 """
9697 return _core_.Window_InheritAttributes(*args, **kwargs)
9698
9699 def ShouldInheritColours(*args, **kwargs):
9700 """
9701 ShouldInheritColours(self) -> bool
9702
9703 Return true from here to allow the colours of this window to be
9704 changed by InheritAttributes, returning false forbids inheriting them
9705 from the parent window.
9706
9707 The base class version returns false, but this method is overridden in
9708 wxControl where it returns true.
9709 """
9710 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9711
9712 def CanSetTransparent(*args, **kwargs):
9713 """
9714 CanSetTransparent(self) -> bool
9715
9716 Returns ``True`` if the platform supports setting the transparency for
9717 this window. Note that this method will err on the side of caution,
9718 so it is possible that this will return ``False`` when it is in fact
9719 possible to set the transparency.
9720
9721 NOTE: On X-windows systems the X server must have the composite
9722 extension loaded, and there must be a composite manager program (such
9723 as xcompmgr) running.
9724 """
9725 return _core_.Window_CanSetTransparent(*args, **kwargs)
9726
9727 def SetTransparent(*args, **kwargs):
9728 """
9729 SetTransparent(self, byte alpha) -> bool
9730
9731 Attempt to set the transparency of this window to the ``alpha`` value,
9732 returns True on success. The ``alpha`` value is an integer in the
9733 range of 0 to 255, where 0 is fully transparent and 255 is fully
9734 opaque.
9735 """
9736 return _core_.Window_SetTransparent(*args, **kwargs)
9737
9738 def PostCreate(self, pre):
9739 """
9740 Phase 3 of the 2-phase create <wink!>
9741 Call this method after precreating the window with the 2-phase create method.
9742 """
9743 self.this = pre.this
9744 self.thisown = pre.thisown
9745 pre.thisown = 0
9746 if hasattr(self, '_setOORInfo'):
9747 self._setOORInfo(self)
9748 if hasattr(self, '_setCallbackInfo'):
9749 self._setCallbackInfo(self, self.__class__)
9750
9751 def SendSizeEvent(self):
9752 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9753
9754 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
9755 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
9756 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
9757 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
9758 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
9759 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
9760 BestSize = property(GetBestSize,doc="See `GetBestSize`")
9761 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
9762 Border = property(GetBorder,doc="See `GetBorder`")
9763 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
9764 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
9765 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
9766 Children = property(GetChildren,doc="See `GetChildren`")
9767 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
9768 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
9769 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
9770 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
9771 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
9772 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
9773 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
9774 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
9775 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
9776 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
9777 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
9778 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
9779 FullTextExtent = property(GetFullTextExtent,doc="See `GetFullTextExtent`")
9780 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
9781 Handle = property(GetHandle,doc="See `GetHandle`")
9782 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
9783 HelpTextAtPoint = property(GetHelpTextAtPoint,doc="See `GetHelpTextAtPoint`")
9784 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
9785 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
9786 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
9787 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
9788 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
9789 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
9790 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
9791 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
9792 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
9793 Parent = property(GetParent,doc="See `GetParent`")
9794 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
9795 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
9796 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
9797 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
9798 ScrollPos = property(GetScrollPos,SetScrollPos,doc="See `GetScrollPos` and `SetScrollPos`")
9799 ScrollRange = property(GetScrollRange,doc="See `GetScrollRange`")
9800 ScrollThumb = property(GetScrollThumb,doc="See `GetScrollThumb`")
9801 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
9802 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
9803 TextExtent = property(GetTextExtent,doc="See `GetTextExtent`")
9804 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
9805 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
9806 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
9807 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
9808 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
9809 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
9810 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
9811 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
9812 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
9813 _core_.Window_swigregister(Window)
9814
9815 def PreWindow(*args, **kwargs):
9816 """
9817 PreWindow() -> Window
9818
9819 Precreate a Window for 2-phase creation.
9820 """
9821 val = _core_.new_PreWindow(*args, **kwargs)
9822 return val
9823
9824 def Window_NewControlId(*args):
9825 """
9826 Window_NewControlId() -> int
9827
9828 Generate a control id for the controls which were not given one.
9829 """
9830 return _core_.Window_NewControlId(*args)
9831
9832 def Window_NextControlId(*args, **kwargs):
9833 """
9834 Window_NextControlId(int winid) -> int
9835
9836 Get the id of the control following the one with the given
9837 autogenerated) id
9838 """
9839 return _core_.Window_NextControlId(*args, **kwargs)
9840
9841 def Window_PrevControlId(*args, **kwargs):
9842 """
9843 Window_PrevControlId(int winid) -> int
9844
9845 Get the id of the control preceding the one with the given
9846 autogenerated) id
9847 """
9848 return _core_.Window_PrevControlId(*args, **kwargs)
9849
9850 def Window_FindFocus(*args):
9851 """
9852 Window_FindFocus() -> Window
9853
9854 Returns the window or control that currently has the keyboard focus,
9855 or None.
9856 """
9857 return _core_.Window_FindFocus(*args)
9858
9859 def Window_GetCapture(*args):
9860 """
9861 Window_GetCapture() -> Window
9862
9863 Returns the window which currently captures the mouse or None
9864 """
9865 return _core_.Window_GetCapture(*args)
9866
9867 def Window_GetClassDefaultAttributes(*args, **kwargs):
9868 """
9869 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9870
9871 Get the default attributes for this class. This is useful if you want
9872 to use the same font or colour in your own control as in a standard
9873 control -- which is a much better idea than hard coding specific
9874 colours or fonts which might look completely out of place on the
9875 user's system, especially if it uses themes.
9876
9877 The variant parameter is only relevant under Mac currently and is
9878 ignore under other platforms. Under Mac, it will change the size of
9879 the returned font. See `wx.Window.SetWindowVariant` for more about
9880 this.
9881 """
9882 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9883
9884 def DLG_PNT(win, point_or_x, y=None):
9885 """
9886 Convenience function for converting a Point or (x,y) in
9887 dialog units to pixel units.
9888 """
9889 if y is None:
9890 return win.ConvertDialogPointToPixels(point_or_x)
9891 else:
9892 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9893
9894 def DLG_SZE(win, size_width, height=None):
9895 """
9896 Convenience function for converting a Size or (w,h) in
9897 dialog units to pixel units.
9898 """
9899 if height is None:
9900 return win.ConvertDialogSizeToPixels(size_width)
9901 else:
9902 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9903
9904
9905 def FindWindowById(*args, **kwargs):
9906 """
9907 FindWindowById(long id, Window parent=None) -> Window
9908
9909 Find the first window in the application with the given id. If parent
9910 is None, the search will start from all top-level frames and dialog
9911 boxes; if non-None, the search will be limited to the given window
9912 hierarchy. The search is recursive in both cases.
9913 """
9914 return _core_.FindWindowById(*args, **kwargs)
9915
9916 def FindWindowByName(*args, **kwargs):
9917 """
9918 FindWindowByName(String name, Window parent=None) -> Window
9919
9920 Find a window by its name (as given in a window constructor or Create
9921 function call). If parent is None, the search will start from all
9922 top-level frames and dialog boxes; if non-None, the search will be
9923 limited to the given window hierarchy. The search is recursive in both
9924 cases.
9925
9926 If no window with such name is found, wx.FindWindowByLabel is called.
9927 """
9928 return _core_.FindWindowByName(*args, **kwargs)
9929
9930 def FindWindowByLabel(*args, **kwargs):
9931 """
9932 FindWindowByLabel(String label, Window parent=None) -> Window
9933
9934 Find a window by its label. Depending on the type of window, the label
9935 may be a window title or panel item label. If parent is None, the
9936 search will start from all top-level frames and dialog boxes; if
9937 non-None, the search will be limited to the given window
9938 hierarchy. The search is recursive in both cases.
9939 """
9940 return _core_.FindWindowByLabel(*args, **kwargs)
9941
9942 def Window_FromHWND(*args, **kwargs):
9943 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9944 return _core_.Window_FromHWND(*args, **kwargs)
9945
9946 def GetTopLevelWindows(*args):
9947 """
9948 GetTopLevelWindows() -> PyObject
9949
9950 Returns a list of the the application's top-level windows, (frames,
9951 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9952 by wxWidgets, and so it is only valid as long as no top-level windows
9953 are closed or new top-level windows are created.
9954
9955 """
9956 return _core_.GetTopLevelWindows(*args)
9957 #---------------------------------------------------------------------------
9958
9959 class Validator(EvtHandler):
9960 """Proxy of C++ Validator class"""
9961 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9962 __repr__ = _swig_repr
9963 def __init__(self, *args, **kwargs):
9964 """__init__(self) -> Validator"""
9965 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
9966 self._setOORInfo(self)
9967
9968 def Clone(*args, **kwargs):
9969 """Clone(self) -> Validator"""
9970 return _core_.Validator_Clone(*args, **kwargs)
9971
9972 def Validate(*args, **kwargs):
9973 """Validate(self, Window parent) -> bool"""
9974 return _core_.Validator_Validate(*args, **kwargs)
9975
9976 def TransferToWindow(*args, **kwargs):
9977 """TransferToWindow(self) -> bool"""
9978 return _core_.Validator_TransferToWindow(*args, **kwargs)
9979
9980 def TransferFromWindow(*args, **kwargs):
9981 """TransferFromWindow(self) -> bool"""
9982 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9983
9984 def GetWindow(*args, **kwargs):
9985 """GetWindow(self) -> Window"""
9986 return _core_.Validator_GetWindow(*args, **kwargs)
9987
9988 def SetWindow(*args, **kwargs):
9989 """SetWindow(self, Window window)"""
9990 return _core_.Validator_SetWindow(*args, **kwargs)
9991
9992 def IsSilent(*args, **kwargs):
9993 """IsSilent() -> bool"""
9994 return _core_.Validator_IsSilent(*args, **kwargs)
9995
9996 IsSilent = staticmethod(IsSilent)
9997 def SetBellOnError(*args, **kwargs):
9998 """SetBellOnError(int doIt=True)"""
9999 return _core_.Validator_SetBellOnError(*args, **kwargs)
10000
10001 SetBellOnError = staticmethod(SetBellOnError)
10002 _core_.Validator_swigregister(Validator)
10003
10004 def Validator_IsSilent(*args):
10005 """Validator_IsSilent() -> bool"""
10006 return _core_.Validator_IsSilent(*args)
10007
10008 def Validator_SetBellOnError(*args, **kwargs):
10009 """Validator_SetBellOnError(int doIt=True)"""
10010 return _core_.Validator_SetBellOnError(*args, **kwargs)
10011
10012 class PyValidator(Validator):
10013 """Proxy of C++ PyValidator class"""
10014 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10015 __repr__ = _swig_repr
10016 def __init__(self, *args, **kwargs):
10017 """__init__(self) -> PyValidator"""
10018 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
10019
10020 self._setCallbackInfo(self, PyValidator, 1)
10021 self._setOORInfo(self)
10022
10023 def _setCallbackInfo(*args, **kwargs):
10024 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10025 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10026
10027 _core_.PyValidator_swigregister(PyValidator)
10028
10029 #---------------------------------------------------------------------------
10030
10031 class Menu(EvtHandler):
10032 """Proxy of C++ Menu class"""
10033 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10034 __repr__ = _swig_repr
10035 def __init__(self, *args, **kwargs):
10036 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10037 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
10038 self._setOORInfo(self)
10039
10040 def Append(*args, **kwargs):
10041 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10042 return _core_.Menu_Append(*args, **kwargs)
10043
10044 def AppendSeparator(*args, **kwargs):
10045 """AppendSeparator(self) -> MenuItem"""
10046 return _core_.Menu_AppendSeparator(*args, **kwargs)
10047
10048 def AppendCheckItem(*args, **kwargs):
10049 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10050 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10051
10052 def AppendRadioItem(*args, **kwargs):
10053 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10054 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10055
10056 def AppendMenu(*args, **kwargs):
10057 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10058 return _core_.Menu_AppendMenu(*args, **kwargs)
10059
10060 def AppendSubMenu(*args, **kwargs):
10061 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10062 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10063
10064 def AppendItem(*args, **kwargs):
10065 """AppendItem(self, MenuItem item) -> MenuItem"""
10066 return _core_.Menu_AppendItem(*args, **kwargs)
10067
10068 def InsertItem(*args, **kwargs):
10069 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10070 return _core_.Menu_InsertItem(*args, **kwargs)
10071
10072 def PrependItem(*args, **kwargs):
10073 """PrependItem(self, MenuItem item) -> MenuItem"""
10074 return _core_.Menu_PrependItem(*args, **kwargs)
10075
10076 def Break(*args, **kwargs):
10077 """Break(self)"""
10078 return _core_.Menu_Break(*args, **kwargs)
10079
10080 def Insert(*args, **kwargs):
10081 """
10082 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10083 int kind=ITEM_NORMAL) -> MenuItem
10084 """
10085 return _core_.Menu_Insert(*args, **kwargs)
10086
10087 def InsertSeparator(*args, **kwargs):
10088 """InsertSeparator(self, size_t pos) -> MenuItem"""
10089 return _core_.Menu_InsertSeparator(*args, **kwargs)
10090
10091 def InsertCheckItem(*args, **kwargs):
10092 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10093 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10094
10095 def InsertRadioItem(*args, **kwargs):
10096 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10097 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10098
10099 def InsertMenu(*args, **kwargs):
10100 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10101 return _core_.Menu_InsertMenu(*args, **kwargs)
10102
10103 def Prepend(*args, **kwargs):
10104 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10105 return _core_.Menu_Prepend(*args, **kwargs)
10106
10107 def PrependSeparator(*args, **kwargs):
10108 """PrependSeparator(self) -> MenuItem"""
10109 return _core_.Menu_PrependSeparator(*args, **kwargs)
10110
10111 def PrependCheckItem(*args, **kwargs):
10112 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10113 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10114
10115 def PrependRadioItem(*args, **kwargs):
10116 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10117 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10118
10119 def PrependMenu(*args, **kwargs):
10120 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10121 return _core_.Menu_PrependMenu(*args, **kwargs)
10122
10123 def Remove(*args, **kwargs):
10124 """Remove(self, int id) -> MenuItem"""
10125 return _core_.Menu_Remove(*args, **kwargs)
10126
10127 def RemoveItem(*args, **kwargs):
10128 """RemoveItem(self, MenuItem item) -> MenuItem"""
10129 return _core_.Menu_RemoveItem(*args, **kwargs)
10130
10131 def Delete(*args, **kwargs):
10132 """Delete(self, int id) -> bool"""
10133 return _core_.Menu_Delete(*args, **kwargs)
10134
10135 def DeleteItem(*args, **kwargs):
10136 """DeleteItem(self, MenuItem item) -> bool"""
10137 return _core_.Menu_DeleteItem(*args, **kwargs)
10138
10139 def Destroy(*args, **kwargs):
10140 """
10141 Destroy(self)
10142
10143 Deletes the C++ object this Python object is a proxy for.
10144 """
10145 val = _core_.Menu_Destroy(*args, **kwargs)
10146 args[0].thisown = 0
10147 return val
10148
10149 def DestroyId(*args, **kwargs):
10150 """
10151 DestroyId(self, int id) -> bool
10152
10153 Deletes the C++ object this Python object is a proxy for.
10154 """
10155 val = _core_.Menu_DestroyId(*args, **kwargs)
10156 args[0].thisown = 0
10157 return val
10158
10159 def DestroyItem(*args, **kwargs):
10160 """
10161 DestroyItem(self, MenuItem item) -> bool
10162
10163 Deletes the C++ object this Python object is a proxy for.
10164 """
10165 val = _core_.Menu_DestroyItem(*args, **kwargs)
10166 args[0].thisown = 0
10167 return val
10168
10169 def GetMenuItemCount(*args, **kwargs):
10170 """GetMenuItemCount(self) -> size_t"""
10171 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10172
10173 def GetMenuItems(*args, **kwargs):
10174 """GetMenuItems(self) -> PyObject"""
10175 return _core_.Menu_GetMenuItems(*args, **kwargs)
10176
10177 def FindItem(*args, **kwargs):
10178 """FindItem(self, String item) -> int"""
10179 return _core_.Menu_FindItem(*args, **kwargs)
10180
10181 def FindItemById(*args, **kwargs):
10182 """FindItemById(self, int id) -> MenuItem"""
10183 return _core_.Menu_FindItemById(*args, **kwargs)
10184
10185 def FindItemByPosition(*args, **kwargs):
10186 """FindItemByPosition(self, size_t position) -> MenuItem"""
10187 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10188
10189 def Enable(*args, **kwargs):
10190 """Enable(self, int id, bool enable)"""
10191 return _core_.Menu_Enable(*args, **kwargs)
10192
10193 def IsEnabled(*args, **kwargs):
10194 """IsEnabled(self, int id) -> bool"""
10195 return _core_.Menu_IsEnabled(*args, **kwargs)
10196
10197 def Check(*args, **kwargs):
10198 """Check(self, int id, bool check)"""
10199 return _core_.Menu_Check(*args, **kwargs)
10200
10201 def IsChecked(*args, **kwargs):
10202 """IsChecked(self, int id) -> bool"""
10203 return _core_.Menu_IsChecked(*args, **kwargs)
10204
10205 def SetLabel(*args, **kwargs):
10206 """SetLabel(self, int id, String label)"""
10207 return _core_.Menu_SetLabel(*args, **kwargs)
10208
10209 def GetLabel(*args, **kwargs):
10210 """GetLabel(self, int id) -> String"""
10211 return _core_.Menu_GetLabel(*args, **kwargs)
10212
10213 def SetHelpString(*args, **kwargs):
10214 """SetHelpString(self, int id, String helpString)"""
10215 return _core_.Menu_SetHelpString(*args, **kwargs)
10216
10217 def GetHelpString(*args, **kwargs):
10218 """GetHelpString(self, int id) -> String"""
10219 return _core_.Menu_GetHelpString(*args, **kwargs)
10220
10221 def SetTitle(*args, **kwargs):
10222 """SetTitle(self, String title)"""
10223 return _core_.Menu_SetTitle(*args, **kwargs)
10224
10225 def GetTitle(*args, **kwargs):
10226 """GetTitle(self) -> String"""
10227 return _core_.Menu_GetTitle(*args, **kwargs)
10228
10229 def SetEventHandler(*args, **kwargs):
10230 """SetEventHandler(self, EvtHandler handler)"""
10231 return _core_.Menu_SetEventHandler(*args, **kwargs)
10232
10233 def GetEventHandler(*args, **kwargs):
10234 """GetEventHandler(self) -> EvtHandler"""
10235 return _core_.Menu_GetEventHandler(*args, **kwargs)
10236
10237 def SetInvokingWindow(*args, **kwargs):
10238 """SetInvokingWindow(self, Window win)"""
10239 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10240
10241 def GetInvokingWindow(*args, **kwargs):
10242 """GetInvokingWindow(self) -> Window"""
10243 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10244
10245 def GetStyle(*args, **kwargs):
10246 """GetStyle(self) -> long"""
10247 return _core_.Menu_GetStyle(*args, **kwargs)
10248
10249 def UpdateUI(*args, **kwargs):
10250 """UpdateUI(self, EvtHandler source=None)"""
10251 return _core_.Menu_UpdateUI(*args, **kwargs)
10252
10253 def GetMenuBar(*args, **kwargs):
10254 """GetMenuBar(self) -> MenuBar"""
10255 return _core_.Menu_GetMenuBar(*args, **kwargs)
10256
10257 def Attach(*args, **kwargs):
10258 """Attach(self, wxMenuBarBase menubar)"""
10259 return _core_.Menu_Attach(*args, **kwargs)
10260
10261 def Detach(*args, **kwargs):
10262 """Detach(self)"""
10263 return _core_.Menu_Detach(*args, **kwargs)
10264
10265 def IsAttached(*args, **kwargs):
10266 """IsAttached(self) -> bool"""
10267 return _core_.Menu_IsAttached(*args, **kwargs)
10268
10269 def SetParent(*args, **kwargs):
10270 """SetParent(self, Menu parent)"""
10271 return _core_.Menu_SetParent(*args, **kwargs)
10272
10273 def GetParent(*args, **kwargs):
10274 """GetParent(self) -> Menu"""
10275 return _core_.Menu_GetParent(*args, **kwargs)
10276
10277 _core_.Menu_swigregister(Menu)
10278 DefaultValidator = cvar.DefaultValidator
10279
10280 #---------------------------------------------------------------------------
10281
10282 class MenuBar(Window):
10283 """Proxy of C++ MenuBar class"""
10284 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10285 __repr__ = _swig_repr
10286 def __init__(self, *args, **kwargs):
10287 """__init__(self, long style=0) -> MenuBar"""
10288 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
10289 self._setOORInfo(self)
10290
10291 def Append(*args, **kwargs):
10292 """Append(self, Menu menu, String title) -> bool"""
10293 return _core_.MenuBar_Append(*args, **kwargs)
10294
10295 def Insert(*args, **kwargs):
10296 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10297 return _core_.MenuBar_Insert(*args, **kwargs)
10298
10299 def GetMenuCount(*args, **kwargs):
10300 """GetMenuCount(self) -> size_t"""
10301 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10302
10303 def GetMenu(*args, **kwargs):
10304 """GetMenu(self, size_t pos) -> Menu"""
10305 return _core_.MenuBar_GetMenu(*args, **kwargs)
10306
10307 def Replace(*args, **kwargs):
10308 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10309 return _core_.MenuBar_Replace(*args, **kwargs)
10310
10311 def Remove(*args, **kwargs):
10312 """Remove(self, size_t pos) -> Menu"""
10313 return _core_.MenuBar_Remove(*args, **kwargs)
10314
10315 def EnableTop(*args, **kwargs):
10316 """EnableTop(self, size_t pos, bool enable)"""
10317 return _core_.MenuBar_EnableTop(*args, **kwargs)
10318
10319 def IsEnabledTop(*args, **kwargs):
10320 """IsEnabledTop(self, size_t pos) -> bool"""
10321 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10322
10323 def SetLabelTop(*args, **kwargs):
10324 """SetLabelTop(self, size_t pos, String label)"""
10325 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10326
10327 def GetLabelTop(*args, **kwargs):
10328 """GetLabelTop(self, size_t pos) -> String"""
10329 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10330
10331 def FindMenuItem(*args, **kwargs):
10332 """FindMenuItem(self, String menu, String item) -> int"""
10333 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10334
10335 def FindItemById(*args, **kwargs):
10336 """FindItemById(self, int id) -> MenuItem"""
10337 return _core_.MenuBar_FindItemById(*args, **kwargs)
10338
10339 def FindMenu(*args, **kwargs):
10340 """FindMenu(self, String title) -> int"""
10341 return _core_.MenuBar_FindMenu(*args, **kwargs)
10342
10343 def Enable(*args, **kwargs):
10344 """Enable(self, int id, bool enable)"""
10345 return _core_.MenuBar_Enable(*args, **kwargs)
10346
10347 def Check(*args, **kwargs):
10348 """Check(self, int id, bool check)"""
10349 return _core_.MenuBar_Check(*args, **kwargs)
10350
10351 def IsChecked(*args, **kwargs):
10352 """IsChecked(self, int id) -> bool"""
10353 return _core_.MenuBar_IsChecked(*args, **kwargs)
10354
10355 def IsEnabled(*args, **kwargs):
10356 """IsEnabled(self, int id) -> bool"""
10357 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10358
10359 def SetLabel(*args, **kwargs):
10360 """SetLabel(self, int id, String label)"""
10361 return _core_.MenuBar_SetLabel(*args, **kwargs)
10362
10363 def GetLabel(*args, **kwargs):
10364 """GetLabel(self, int id) -> String"""
10365 return _core_.MenuBar_GetLabel(*args, **kwargs)
10366
10367 def SetHelpString(*args, **kwargs):
10368 """SetHelpString(self, int id, String helpString)"""
10369 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10370
10371 def GetHelpString(*args, **kwargs):
10372 """GetHelpString(self, int id) -> String"""
10373 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10374
10375 def GetFrame(*args, **kwargs):
10376 """GetFrame(self) -> wxFrame"""
10377 return _core_.MenuBar_GetFrame(*args, **kwargs)
10378
10379 def IsAttached(*args, **kwargs):
10380 """IsAttached(self) -> bool"""
10381 return _core_.MenuBar_IsAttached(*args, **kwargs)
10382
10383 def Attach(*args, **kwargs):
10384 """Attach(self, wxFrame frame)"""
10385 return _core_.MenuBar_Attach(*args, **kwargs)
10386
10387 def Detach(*args, **kwargs):
10388 """Detach(self)"""
10389 return _core_.MenuBar_Detach(*args, **kwargs)
10390
10391 def UpdateMenus(*args, **kwargs):
10392 """UpdateMenus(self)"""
10393 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10394
10395 def SetAutoWindowMenu(*args, **kwargs):
10396 """SetAutoWindowMenu(bool enable)"""
10397 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10398
10399 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10400 def GetAutoWindowMenu(*args, **kwargs):
10401 """GetAutoWindowMenu() -> bool"""
10402 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10403
10404 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
10405 _core_.MenuBar_swigregister(MenuBar)
10406
10407 def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10408 """MenuBar_SetAutoWindowMenu(bool enable)"""
10409 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10410
10411 def MenuBar_GetAutoWindowMenu(*args):
10412 """MenuBar_GetAutoWindowMenu() -> bool"""
10413 return _core_.MenuBar_GetAutoWindowMenu(*args)
10414
10415 #---------------------------------------------------------------------------
10416
10417 class MenuItem(Object):
10418 """Proxy of C++ MenuItem class"""
10419 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10420 __repr__ = _swig_repr
10421 def __init__(self, *args, **kwargs):
10422 """
10423 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10424 String help=EmptyString, int kind=ITEM_NORMAL,
10425 Menu subMenu=None) -> MenuItem
10426 """
10427 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10428 __swig_destroy__ = _core_.delete_MenuItem
10429 __del__ = lambda self : None;
10430 def GetMenu(*args, **kwargs):
10431 """GetMenu(self) -> Menu"""
10432 return _core_.MenuItem_GetMenu(*args, **kwargs)
10433
10434 def SetMenu(*args, **kwargs):
10435 """SetMenu(self, Menu menu)"""
10436 return _core_.MenuItem_SetMenu(*args, **kwargs)
10437
10438 def SetId(*args, **kwargs):
10439 """SetId(self, int id)"""
10440 return _core_.MenuItem_SetId(*args, **kwargs)
10441
10442 def GetId(*args, **kwargs):
10443 """GetId(self) -> int"""
10444 return _core_.MenuItem_GetId(*args, **kwargs)
10445
10446 def IsSeparator(*args, **kwargs):
10447 """IsSeparator(self) -> bool"""
10448 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10449
10450 def SetText(*args, **kwargs):
10451 """SetText(self, String str)"""
10452 return _core_.MenuItem_SetText(*args, **kwargs)
10453
10454 def GetLabel(*args, **kwargs):
10455 """GetLabel(self) -> String"""
10456 return _core_.MenuItem_GetLabel(*args, **kwargs)
10457
10458 def GetText(*args, **kwargs):
10459 """GetText(self) -> String"""
10460 return _core_.MenuItem_GetText(*args, **kwargs)
10461
10462 def GetLabelFromText(*args, **kwargs):
10463 """GetLabelFromText(String text) -> String"""
10464 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10465
10466 GetLabelFromText = staticmethod(GetLabelFromText)
10467 def GetKind(*args, **kwargs):
10468 """GetKind(self) -> int"""
10469 return _core_.MenuItem_GetKind(*args, **kwargs)
10470
10471 def SetKind(*args, **kwargs):
10472 """SetKind(self, int kind)"""
10473 return _core_.MenuItem_SetKind(*args, **kwargs)
10474
10475 def SetCheckable(*args, **kwargs):
10476 """SetCheckable(self, bool checkable)"""
10477 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10478
10479 def IsCheckable(*args, **kwargs):
10480 """IsCheckable(self) -> bool"""
10481 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10482
10483 def IsSubMenu(*args, **kwargs):
10484 """IsSubMenu(self) -> bool"""
10485 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10486
10487 def SetSubMenu(*args, **kwargs):
10488 """SetSubMenu(self, Menu menu)"""
10489 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10490
10491 def GetSubMenu(*args, **kwargs):
10492 """GetSubMenu(self) -> Menu"""
10493 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10494
10495 def Enable(*args, **kwargs):
10496 """Enable(self, bool enable=True)"""
10497 return _core_.MenuItem_Enable(*args, **kwargs)
10498
10499 def IsEnabled(*args, **kwargs):
10500 """IsEnabled(self) -> bool"""
10501 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10502
10503 def Check(*args, **kwargs):
10504 """Check(self, bool check=True)"""
10505 return _core_.MenuItem_Check(*args, **kwargs)
10506
10507 def IsChecked(*args, **kwargs):
10508 """IsChecked(self) -> bool"""
10509 return _core_.MenuItem_IsChecked(*args, **kwargs)
10510
10511 def Toggle(*args, **kwargs):
10512 """Toggle(self)"""
10513 return _core_.MenuItem_Toggle(*args, **kwargs)
10514
10515 def SetHelp(*args, **kwargs):
10516 """SetHelp(self, String str)"""
10517 return _core_.MenuItem_SetHelp(*args, **kwargs)
10518
10519 def GetHelp(*args, **kwargs):
10520 """GetHelp(self) -> String"""
10521 return _core_.MenuItem_GetHelp(*args, **kwargs)
10522
10523 def GetAccel(*args, **kwargs):
10524 """GetAccel(self) -> AcceleratorEntry"""
10525 return _core_.MenuItem_GetAccel(*args, **kwargs)
10526
10527 def SetAccel(*args, **kwargs):
10528 """SetAccel(self, AcceleratorEntry accel)"""
10529 return _core_.MenuItem_SetAccel(*args, **kwargs)
10530
10531 def SetBitmap(*args, **kwargs):
10532 """SetBitmap(self, Bitmap bitmap)"""
10533 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10534
10535 def GetBitmap(*args, **kwargs):
10536 """GetBitmap(self) -> Bitmap"""
10537 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10538
10539 def SetFont(*args, **kwargs):
10540 """SetFont(self, Font font)"""
10541 return _core_.MenuItem_SetFont(*args, **kwargs)
10542
10543 def GetFont(*args, **kwargs):
10544 """GetFont(self) -> Font"""
10545 return _core_.MenuItem_GetFont(*args, **kwargs)
10546
10547 def SetTextColour(*args, **kwargs):
10548 """SetTextColour(self, Colour colText)"""
10549 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10550
10551 def GetTextColour(*args, **kwargs):
10552 """GetTextColour(self) -> Colour"""
10553 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10554
10555 def SetBackgroundColour(*args, **kwargs):
10556 """SetBackgroundColour(self, Colour colBack)"""
10557 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10558
10559 def GetBackgroundColour(*args, **kwargs):
10560 """GetBackgroundColour(self) -> Colour"""
10561 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10562
10563 def SetBitmaps(*args, **kwargs):
10564 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10565 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10566
10567 def SetDisabledBitmap(*args, **kwargs):
10568 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10569 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10570
10571 def GetDisabledBitmap(*args, **kwargs):
10572 """GetDisabledBitmap(self) -> Bitmap"""
10573 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10574
10575 def SetMarginWidth(*args, **kwargs):
10576 """SetMarginWidth(self, int nWidth)"""
10577 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10578
10579 def GetMarginWidth(*args, **kwargs):
10580 """GetMarginWidth(self) -> int"""
10581 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10582
10583 def GetDefaultMarginWidth(*args, **kwargs):
10584 """GetDefaultMarginWidth() -> int"""
10585 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10586
10587 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10588 def IsOwnerDrawn(*args, **kwargs):
10589 """IsOwnerDrawn(self) -> bool"""
10590 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10591
10592 def SetOwnerDrawn(*args, **kwargs):
10593 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10594 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10595
10596 def ResetOwnerDrawn(*args, **kwargs):
10597 """ResetOwnerDrawn(self)"""
10598 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10599
10600 _core_.MenuItem_swigregister(MenuItem)
10601
10602 def MenuItem_GetLabelFromText(*args, **kwargs):
10603 """MenuItem_GetLabelFromText(String text) -> String"""
10604 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10605
10606 def MenuItem_GetDefaultMarginWidth(*args):
10607 """MenuItem_GetDefaultMarginWidth() -> int"""
10608 return _core_.MenuItem_GetDefaultMarginWidth(*args)
10609
10610 #---------------------------------------------------------------------------
10611
10612 class Control(Window):
10613 """
10614 This is the base class for a control or 'widget'.
10615
10616 A control is generally a small window which processes user input
10617 and/or displays one or more item of data.
10618 """
10619 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10620 __repr__ = _swig_repr
10621 def __init__(self, *args, **kwargs):
10622 """
10623 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10624 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10625 String name=ControlNameStr) -> Control
10626
10627 Create a Control. Normally you should only call this from a subclass'
10628 __init__ as a plain old wx.Control is not very useful.
10629 """
10630 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
10631 self._setOORInfo(self)
10632
10633 def Create(*args, **kwargs):
10634 """
10635 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10636 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10637 String name=ControlNameStr) -> bool
10638
10639 Do the 2nd phase and create the GUI control.
10640 """
10641 return _core_.Control_Create(*args, **kwargs)
10642
10643 def GetAlignment(*args, **kwargs):
10644 """
10645 GetAlignment(self) -> int
10646
10647 Get the control alignment (left/right/centre, top/bottom/centre)
10648 """
10649 return _core_.Control_GetAlignment(*args, **kwargs)
10650
10651 def GetLabelText(*args, **kwargs):
10652 """
10653 GetLabelText(self) -> String
10654
10655 Get just the text of the label, without mnemonic characters ('&')
10656 """
10657 return _core_.Control_GetLabelText(*args, **kwargs)
10658
10659 def Command(*args, **kwargs):
10660 """
10661 Command(self, CommandEvent event)
10662
10663 Simulates the effect of the user issuing a command to the item.
10664
10665 :see: `wx.CommandEvent`
10666
10667 """
10668 return _core_.Control_Command(*args, **kwargs)
10669
10670 def GetLabel(*args, **kwargs):
10671 """
10672 GetLabel(self) -> String
10673
10674 Return a control's text.
10675 """
10676 return _core_.Control_GetLabel(*args, **kwargs)
10677
10678 def GetClassDefaultAttributes(*args, **kwargs):
10679 """
10680 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10681
10682 Get the default attributes for this class. This is useful if you want
10683 to use the same font or colour in your own control as in a standard
10684 control -- which is a much better idea than hard coding specific
10685 colours or fonts which might look completely out of place on the
10686 user's system, especially if it uses themes.
10687
10688 The variant parameter is only relevant under Mac currently and is
10689 ignore under other platforms. Under Mac, it will change the size of
10690 the returned font. See `wx.Window.SetWindowVariant` for more about
10691 this.
10692 """
10693 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10694
10695 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10696 Alignment = property(GetAlignment,doc="See `GetAlignment`")
10697 Label = property(GetLabel,doc="See `GetLabel`")
10698 LabelText = property(GetLabelText,doc="See `GetLabelText`")
10699 _core_.Control_swigregister(Control)
10700 ControlNameStr = cvar.ControlNameStr
10701
10702 def PreControl(*args, **kwargs):
10703 """
10704 PreControl() -> Control
10705
10706 Precreate a Control control for 2-phase creation
10707 """
10708 val = _core_.new_PreControl(*args, **kwargs)
10709 return val
10710
10711 def Control_GetClassDefaultAttributes(*args, **kwargs):
10712 """
10713 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10714
10715 Get the default attributes for this class. This is useful if you want
10716 to use the same font or colour in your own control as in a standard
10717 control -- which is a much better idea than hard coding specific
10718 colours or fonts which might look completely out of place on the
10719 user's system, especially if it uses themes.
10720
10721 The variant parameter is only relevant under Mac currently and is
10722 ignore under other platforms. Under Mac, it will change the size of
10723 the returned font. See `wx.Window.SetWindowVariant` for more about
10724 this.
10725 """
10726 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10727
10728 #---------------------------------------------------------------------------
10729
10730 class ItemContainer(object):
10731 """
10732 The wx.ItemContainer class defines an interface which is implemented
10733 by all controls which have string subitems, each of which may be
10734 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10735 as `wx.ComboBox` which implements an extended interface deriving from
10736 this one.
10737
10738 It defines the methods for accessing the control's items and although
10739 each of the derived classes implements them differently, they still
10740 all conform to the same interface.
10741
10742 The items in a wx.ItemContainer have (non empty) string labels and,
10743 optionally, client data associated with them.
10744
10745 """
10746 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10747 def __init__(self): raise AttributeError, "No constructor defined"
10748 __repr__ = _swig_repr
10749 def Append(*args, **kwargs):
10750 """
10751 Append(self, String item, PyObject clientData=None) -> int
10752
10753 Adds the item to the control, associating the given data with the item
10754 if not None. The return value is the index of the newly added item
10755 which may be different from the last one if the control is sorted (e.g.
10756 has wx.LB_SORT or wx.CB_SORT style).
10757 """
10758 return _core_.ItemContainer_Append(*args, **kwargs)
10759
10760 def AppendItems(*args, **kwargs):
10761 """
10762 AppendItems(self, List strings)
10763
10764 Apend several items at once to the control. Notice that calling this
10765 method may be much faster than appending the items one by one if you
10766 need to add a lot of items.
10767 """
10768 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10769
10770 def Insert(*args, **kwargs):
10771 """
10772 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10773
10774 Insert an item into the control before the item at the ``pos`` index,
10775 optionally associating some data object with the item.
10776 """
10777 return _core_.ItemContainer_Insert(*args, **kwargs)
10778
10779 def Clear(*args, **kwargs):
10780 """
10781 Clear(self)
10782
10783 Removes all items from the control.
10784 """
10785 return _core_.ItemContainer_Clear(*args, **kwargs)
10786
10787 def Delete(*args, **kwargs):
10788 """
10789 Delete(self, unsigned int n)
10790
10791 Deletes the item at the zero-based index 'n' from the control. Note
10792 that it is an error (signalled by a `wx.PyAssertionError` exception if
10793 enabled) to remove an item with the index negative or greater or equal
10794 than the number of items in the control.
10795 """
10796 return _core_.ItemContainer_Delete(*args, **kwargs)
10797
10798 def GetClientData(*args, **kwargs):
10799 """
10800 GetClientData(self, unsigned int n) -> PyObject
10801
10802 Returns the client data associated with the given item, (if any.)
10803 """
10804 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10805
10806 def SetClientData(*args, **kwargs):
10807 """
10808 SetClientData(self, unsigned int n, PyObject clientData)
10809
10810 Associate the given client data with the item at position n.
10811 """
10812 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10813
10814 def GetCount(*args, **kwargs):
10815 """
10816 GetCount(self) -> unsigned int
10817
10818 Returns the number of items in the control.
10819 """
10820 return _core_.ItemContainer_GetCount(*args, **kwargs)
10821
10822 def IsEmpty(*args, **kwargs):
10823 """
10824 IsEmpty(self) -> bool
10825
10826 Returns True if the control is empty or False if it has some items.
10827 """
10828 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10829
10830 def GetString(*args, **kwargs):
10831 """
10832 GetString(self, unsigned int n) -> String
10833
10834 Returns the label of the item with the given index.
10835 """
10836 return _core_.ItemContainer_GetString(*args, **kwargs)
10837
10838 def GetStrings(*args, **kwargs):
10839 """GetStrings(self) -> wxArrayString"""
10840 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10841
10842 def SetString(*args, **kwargs):
10843 """
10844 SetString(self, unsigned int n, String s)
10845
10846 Sets the label for the given item.
10847 """
10848 return _core_.ItemContainer_SetString(*args, **kwargs)
10849
10850 def FindString(*args, **kwargs):
10851 """
10852 FindString(self, String s) -> int
10853
10854 Finds an item whose label matches the given string. Returns the
10855 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10856 found.
10857 """
10858 return _core_.ItemContainer_FindString(*args, **kwargs)
10859
10860 def SetSelection(*args, **kwargs):
10861 """
10862 SetSelection(self, int n)
10863
10864 Sets the item at index 'n' to be the selected item.
10865 """
10866 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10867
10868 def GetSelection(*args, **kwargs):
10869 """
10870 GetSelection(self) -> int
10871
10872 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10873 is selected.
10874 """
10875 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10876
10877 def SetStringSelection(*args, **kwargs):
10878 """SetStringSelection(self, String s) -> bool"""
10879 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10880
10881 def GetStringSelection(*args, **kwargs):
10882 """
10883 GetStringSelection(self) -> String
10884
10885 Returns the label of the selected item or an empty string if no item
10886 is selected.
10887 """
10888 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10889
10890 def Select(*args, **kwargs):
10891 """
10892 Select(self, int n)
10893
10894 This is the same as `SetSelection` and exists only because it is
10895 slightly more natural for controls which support multiple selection.
10896 """
10897 return _core_.ItemContainer_Select(*args, **kwargs)
10898
10899 _core_.ItemContainer_swigregister(ItemContainer)
10900
10901 #---------------------------------------------------------------------------
10902
10903 class ControlWithItems(Control,ItemContainer):
10904 """
10905 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10906 wx.Control class, and is used for the base class of various controls
10907 that have items.
10908 """
10909 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10910 def __init__(self): raise AttributeError, "No constructor defined"
10911 __repr__ = _swig_repr
10912 _core_.ControlWithItems_swigregister(ControlWithItems)
10913
10914 #---------------------------------------------------------------------------
10915
10916 class SizerItem(Object):
10917 """
10918 The wx.SizerItem class is used to track the position, size and other
10919 attributes of each item managed by a `wx.Sizer`. It is not usually
10920 necessary to use this class because the sizer elements can also be
10921 identified by their positions or window or sizer references but
10922 sometimes it may be more convenient to use wx.SizerItem directly.
10923 Also, custom classes derived from `wx.PySizer` will probably need to
10924 use the collection of wx.SizerItems held by wx.Sizer when calculating
10925 layout.
10926
10927 :see: `wx.Sizer`, `wx.GBSizerItem`
10928 """
10929 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10930 __repr__ = _swig_repr
10931 def __init__(self, *args, **kwargs):
10932 """
10933 __init__(self) -> SizerItem
10934
10935 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10936 size will need to be set before this item can be used in a Sizer.
10937
10938 You will probably never need to create a wx.SizerItem directly as they
10939 are created automatically when the sizer's Add, Insert or Prepend
10940 methods are called.
10941
10942 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10943 """
10944 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10945 __swig_destroy__ = _core_.delete_SizerItem
10946 __del__ = lambda self : None;
10947 def DeleteWindows(*args, **kwargs):
10948 """
10949 DeleteWindows(self)
10950
10951 Destroy the window or the windows in a subsizer, depending on the type
10952 of item.
10953 """
10954 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10955
10956 def DetachSizer(*args, **kwargs):
10957 """
10958 DetachSizer(self)
10959
10960 Enable deleting the SizerItem without destroying the contained sizer.
10961 """
10962 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10963
10964 def GetSize(*args, **kwargs):
10965 """
10966 GetSize(self) -> Size
10967
10968 Get the current size of the item, as set in the last Layout.
10969 """
10970 return _core_.SizerItem_GetSize(*args, **kwargs)
10971
10972 def CalcMin(*args, **kwargs):
10973 """
10974 CalcMin(self) -> Size
10975
10976 Calculates the minimum desired size for the item, including any space
10977 needed by borders.
10978 """
10979 return _core_.SizerItem_CalcMin(*args, **kwargs)
10980
10981 def SetDimension(*args, **kwargs):
10982 """
10983 SetDimension(self, Point pos, Size size)
10984
10985 Set the position and size of the space allocated for this item by the
10986 sizer, and adjust the position and size of the item (window or
10987 subsizer) to be within that space taking alignment and borders into
10988 account.
10989 """
10990 return _core_.SizerItem_SetDimension(*args, **kwargs)
10991
10992 def GetMinSize(*args, **kwargs):
10993 """
10994 GetMinSize(self) -> Size
10995
10996 Get the minimum size needed for the item.
10997 """
10998 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10999
11000 def GetMinSizeWithBorder(*args, **kwargs):
11001 """
11002 GetMinSizeWithBorder(self) -> Size
11003
11004 Get the minimum size needed for the item with space for the borders
11005 added, if needed.
11006 """
11007 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11008
11009 def SetInitSize(*args, **kwargs):
11010 """SetInitSize(self, int x, int y)"""
11011 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11012
11013 def SetRatioWH(*args, **kwargs):
11014 """
11015 SetRatioWH(self, int width, int height)
11016
11017 Set the ratio item attribute.
11018 """
11019 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11020
11021 def SetRatioSize(*args, **kwargs):
11022 """
11023 SetRatioSize(self, Size size)
11024
11025 Set the ratio item attribute.
11026 """
11027 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11028
11029 def SetRatio(*args, **kwargs):
11030 """
11031 SetRatio(self, float ratio)
11032
11033 Set the ratio item attribute.
11034 """
11035 return _core_.SizerItem_SetRatio(*args, **kwargs)
11036
11037 def GetRatio(*args, **kwargs):
11038 """
11039 GetRatio(self) -> float
11040
11041 Set the ratio item attribute.
11042 """
11043 return _core_.SizerItem_GetRatio(*args, **kwargs)
11044
11045 def GetRect(*args, **kwargs):
11046 """
11047 GetRect(self) -> Rect
11048
11049 Returns the rectangle that the sizer item should occupy
11050 """
11051 return _core_.SizerItem_GetRect(*args, **kwargs)
11052
11053 def IsWindow(*args, **kwargs):
11054 """
11055 IsWindow(self) -> bool
11056
11057 Is this sizer item a window?
11058 """
11059 return _core_.SizerItem_IsWindow(*args, **kwargs)
11060
11061 def IsSizer(*args, **kwargs):
11062 """
11063 IsSizer(self) -> bool
11064
11065 Is this sizer item a subsizer?
11066 """
11067 return _core_.SizerItem_IsSizer(*args, **kwargs)
11068
11069 def IsSpacer(*args, **kwargs):
11070 """
11071 IsSpacer(self) -> bool
11072
11073 Is this sizer item a spacer?
11074 """
11075 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11076
11077 def SetProportion(*args, **kwargs):
11078 """
11079 SetProportion(self, int proportion)
11080
11081 Set the proportion value for this item.
11082 """
11083 return _core_.SizerItem_SetProportion(*args, **kwargs)
11084
11085 def GetProportion(*args, **kwargs):
11086 """
11087 GetProportion(self) -> int
11088
11089 Get the proportion value for this item.
11090 """
11091 return _core_.SizerItem_GetProportion(*args, **kwargs)
11092
11093 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11094 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
11095 def SetFlag(*args, **kwargs):
11096 """
11097 SetFlag(self, int flag)
11098
11099 Set the flag value for this item.
11100 """
11101 return _core_.SizerItem_SetFlag(*args, **kwargs)
11102
11103 def GetFlag(*args, **kwargs):
11104 """
11105 GetFlag(self) -> int
11106
11107 Get the flag value for this item.
11108 """
11109 return _core_.SizerItem_GetFlag(*args, **kwargs)
11110
11111 def SetBorder(*args, **kwargs):
11112 """
11113 SetBorder(self, int border)
11114
11115 Set the border value for this item.
11116 """
11117 return _core_.SizerItem_SetBorder(*args, **kwargs)
11118
11119 def GetBorder(*args, **kwargs):
11120 """
11121 GetBorder(self) -> int
11122
11123 Get the border value for this item.
11124 """
11125 return _core_.SizerItem_GetBorder(*args, **kwargs)
11126
11127 def GetWindow(*args, **kwargs):
11128 """
11129 GetWindow(self) -> Window
11130
11131 Get the window (if any) that is managed by this sizer item.
11132 """
11133 return _core_.SizerItem_GetWindow(*args, **kwargs)
11134
11135 def SetWindow(*args, **kwargs):
11136 """
11137 SetWindow(self, Window window)
11138
11139 Set the window to be managed by this sizer item.
11140 """
11141 return _core_.SizerItem_SetWindow(*args, **kwargs)
11142
11143 def GetSizer(*args, **kwargs):
11144 """
11145 GetSizer(self) -> Sizer
11146
11147 Get the subsizer (if any) that is managed by this sizer item.
11148 """
11149 return _core_.SizerItem_GetSizer(*args, **kwargs)
11150
11151 def SetSizer(*args, **kwargs):
11152 """
11153 SetSizer(self, Sizer sizer)
11154
11155 Set the subsizer to be managed by this sizer item.
11156 """
11157 return _core_.SizerItem_SetSizer(*args, **kwargs)
11158
11159 def GetSpacer(*args, **kwargs):
11160 """
11161 GetSpacer(self) -> Size
11162
11163 Get the size of the spacer managed by this sizer item.
11164 """
11165 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11166
11167 def SetSpacer(*args, **kwargs):
11168 """
11169 SetSpacer(self, Size size)
11170
11171 Set the size of the spacer to be managed by this sizer item.
11172 """
11173 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11174
11175 def Show(*args, **kwargs):
11176 """
11177 Show(self, bool show)
11178
11179 Set the show item attribute, which sizers use to determine if the item
11180 is to be made part of the layout or not. If the item is tracking a
11181 window then it is shown or hidden as needed.
11182 """
11183 return _core_.SizerItem_Show(*args, **kwargs)
11184
11185 def IsShown(*args, **kwargs):
11186 """
11187 IsShown(self) -> bool
11188
11189 Is the item to be shown in the layout?
11190 """
11191 return _core_.SizerItem_IsShown(*args, **kwargs)
11192
11193 def GetPosition(*args, **kwargs):
11194 """
11195 GetPosition(self) -> Point
11196
11197 Returns the current position of the item, as set in the last Layout.
11198 """
11199 return _core_.SizerItem_GetPosition(*args, **kwargs)
11200
11201 def GetUserData(*args, **kwargs):
11202 """
11203 GetUserData(self) -> PyObject
11204
11205 Returns the userData associated with this sizer item, or None if there
11206 isn't any.
11207 """
11208 return _core_.SizerItem_GetUserData(*args, **kwargs)
11209
11210 def SetUserData(*args, **kwargs):
11211 """
11212 SetUserData(self, PyObject userData)
11213
11214 Associate a Python object with this sizer item.
11215 """
11216 return _core_.SizerItem_SetUserData(*args, **kwargs)
11217
11218 _core_.SizerItem_swigregister(SizerItem)
11219
11220 def SizerItemWindow(*args, **kwargs):
11221 """
11222 SizerItemWindow(Window window, int proportion, int flag, int border,
11223 PyObject userData=None) -> SizerItem
11224
11225 Constructs a `wx.SizerItem` for tracking a window.
11226 """
11227 val = _core_.new_SizerItemWindow(*args, **kwargs)
11228 return val
11229
11230 def SizerItemSpacer(*args, **kwargs):
11231 """
11232 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11233 PyObject userData=None) -> SizerItem
11234
11235 Constructs a `wx.SizerItem` for tracking a spacer.
11236 """
11237 val = _core_.new_SizerItemSpacer(*args, **kwargs)
11238 return val
11239
11240 def SizerItemSizer(*args, **kwargs):
11241 """
11242 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11243 PyObject userData=None) -> SizerItem
11244
11245 Constructs a `wx.SizerItem` for tracking a subsizer
11246 """
11247 val = _core_.new_SizerItemSizer(*args, **kwargs)
11248 return val
11249
11250 class Sizer(Object):
11251 """
11252 wx.Sizer is the abstract base class used for laying out subwindows in
11253 a window. You cannot use wx.Sizer directly; instead, you will have to
11254 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11255 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11256 `wx.GridBagSizer`.
11257
11258 The concept implemented by sizers in wxWidgets is closely related to
11259 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11260 toolkit or the Qt toolkit. It is based upon the idea of the individual
11261 subwindows reporting their minimal required size and their ability to
11262 get stretched if the size of the parent window has changed. This will
11263 most often mean that the programmer does not set the original size of
11264 a dialog in the beginning, rather the dialog will assigned a sizer and
11265 this sizer will be queried about the recommended size. The sizer in
11266 turn will query its children, which can be normal windows or contorls,
11267 empty space or other sizers, so that a hierarchy of sizers can be
11268 constructed. Note that wxSizer does not derive from wxWindow and thus
11269 do not interfere with tab ordering and requires very little resources
11270 compared to a real window on screen.
11271
11272 What makes sizers so well fitted for use in wxWidgets is the fact that
11273 every control reports its own minimal size and the algorithm can
11274 handle differences in font sizes or different window (dialog item)
11275 sizes on different platforms without problems. If for example the
11276 standard font as well as the overall design of Mac widgets requires
11277 more space than on Windows, then the initial size of a dialog using a
11278 sizer will automatically be bigger on Mac than on Windows.
11279 """
11280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11281 def __init__(self): raise AttributeError, "No constructor defined"
11282 __repr__ = _swig_repr
11283 __swig_destroy__ = _core_.delete_Sizer
11284 __del__ = lambda self : None;
11285 def _setOORInfo(*args, **kwargs):
11286 """_setOORInfo(self, PyObject _self)"""
11287 return _core_.Sizer__setOORInfo(*args, **kwargs)
11288
11289 def Add(*args, **kwargs):
11290 """
11291 Add(self, item, int proportion=0, int flag=0, int border=0,
11292 PyObject userData=None) -> wx.SizerItem
11293
11294 Appends a child item to the sizer.
11295 """
11296 return _core_.Sizer_Add(*args, **kwargs)
11297
11298 def Insert(*args, **kwargs):
11299 """
11300 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11301 PyObject userData=None) -> wx.SizerItem
11302
11303 Inserts a new item into the list of items managed by this sizer before
11304 the item at index *before*. See `Add` for a description of the parameters.
11305 """
11306 return _core_.Sizer_Insert(*args, **kwargs)
11307
11308 def Prepend(*args, **kwargs):
11309 """
11310 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11311 PyObject userData=None) -> wx.SizerItem
11312
11313 Adds a new item to the begining of the list of sizer items managed by
11314 this sizer. See `Add` for a description of the parameters.
11315 """
11316 return _core_.Sizer_Prepend(*args, **kwargs)
11317
11318 def Remove(*args, **kwargs):
11319 """
11320 Remove(self, item) -> bool
11321
11322 Removes an item from the sizer and destroys it. This method does not
11323 cause any layout or resizing to take place, call `Layout` to update
11324 the layout on screen after removing a child from the sizer. The
11325 *item* parameter can be either a window, a sizer, or the zero-based
11326 index of an item to remove. Returns True if the child item was found
11327 and removed.
11328 """
11329 return _core_.Sizer_Remove(*args, **kwargs)
11330
11331 def Detach(*args, **kwargs):
11332 """
11333 Detach(self, item) -> bool
11334
11335 Detaches an item from the sizer without destroying it. This method
11336 does not cause any layout or resizing to take place, call `Layout` to
11337 do so. The *item* parameter can be either a window, a sizer, or the
11338 zero-based index of the item to be detached. Returns True if the child item
11339 was found and detached.
11340 """
11341 return _core_.Sizer_Detach(*args, **kwargs)
11342
11343 def GetItem(*args, **kwargs):
11344 """
11345 GetItem(self, item) -> wx.SizerItem
11346
11347 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11348 parameter can be either a window, a sizer, or the zero-based index of
11349 the item to be found.
11350 """
11351 return _core_.Sizer_GetItem(*args, **kwargs)
11352
11353 def _SetItemMinSize(*args, **kwargs):
11354 """_SetItemMinSize(self, PyObject item, Size size)"""
11355 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11356
11357 def SetItemMinSize(self, item, *args):
11358 """
11359 SetItemMinSize(self, item, Size size)
11360
11361 Sets the minimum size that will be allocated for an item in the sizer.
11362 The *item* parameter can be either a window, a sizer, or the
11363 zero-based index of the item. If a window or sizer is given then it
11364 will be searched for recursivly in subsizers if neccessary.
11365 """
11366 if len(args) == 2:
11367 # for backward compatibility accept separate width,height args too
11368 return self._SetItemMinSize(item, args)
11369 else:
11370 return self._SetItemMinSize(item, args[0])
11371
11372 def AddItem(*args, **kwargs):
11373 """
11374 AddItem(self, SizerItem item)
11375
11376 Adds a `wx.SizerItem` to the sizer.
11377 """
11378 return _core_.Sizer_AddItem(*args, **kwargs)
11379
11380 def InsertItem(*args, **kwargs):
11381 """
11382 InsertItem(self, int index, SizerItem item)
11383
11384 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11385 """
11386 return _core_.Sizer_InsertItem(*args, **kwargs)
11387
11388 def PrependItem(*args, **kwargs):
11389 """
11390 PrependItem(self, SizerItem item)
11391
11392 Prepends a `wx.SizerItem` to the sizer.
11393 """
11394 return _core_.Sizer_PrependItem(*args, **kwargs)
11395
11396 def AddMany(self, items):
11397 """
11398 AddMany is a convenience method for adding several items
11399 to a sizer at one time. Simply pass it a list of tuples,
11400 where each tuple consists of the parameters that you
11401 would normally pass to the `Add` method.
11402 """
11403 for item in items:
11404 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11405 item = (item, )
11406 self.Add(*item)
11407
11408 # for backwards compatibility only, please do not use in new code
11409 def AddWindow(self, *args, **kw):
11410 """Compatibility alias for `Add`."""
11411 return self.Add(*args, **kw)
11412 def AddSizer(self, *args, **kw):
11413 """Compatibility alias for `Add`."""
11414 return self.Add(*args, **kw)
11415 def AddSpacer(self, *args, **kw):
11416 """Compatibility alias for `Add`."""
11417 return self.Add(*args, **kw)
11418
11419 def PrependWindow(self, *args, **kw):
11420 """Compatibility alias for `Prepend`."""
11421 return self.Prepend(*args, **kw)
11422 def PrependSizer(self, *args, **kw):
11423 """Compatibility alias for `Prepend`."""
11424 return self.Prepend(*args, **kw)
11425 def PrependSpacer(self, *args, **kw):
11426 """Compatibility alias for `Prepend`."""
11427 return self.Prepend(*args, **kw)
11428
11429 def InsertWindow(self, *args, **kw):
11430 """Compatibility alias for `Insert`."""
11431 return self.Insert(*args, **kw)
11432 def InsertSizer(self, *args, **kw):
11433 """Compatibility alias for `Insert`."""
11434 return self.Insert(*args, **kw)
11435 def InsertSpacer(self, *args, **kw):
11436 """Compatibility alias for `Insert`."""
11437 return self.Insert(*args, **kw)
11438
11439 def RemoveWindow(self, *args, **kw):
11440 """Compatibility alias for `Remove`."""
11441 return self.Remove(*args, **kw)
11442 def RemoveSizer(self, *args, **kw):
11443 """Compatibility alias for `Remove`."""
11444 return self.Remove(*args, **kw)
11445 def RemovePos(self, *args, **kw):
11446 """Compatibility alias for `Remove`."""
11447 return self.Remove(*args, **kw)
11448
11449
11450 def SetDimension(*args, **kwargs):
11451 """
11452 SetDimension(self, int x, int y, int width, int height)
11453
11454 Call this to force the sizer to take the given dimension and thus
11455 force the items owned by the sizer to resize themselves according to
11456 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11457 methods.
11458 """
11459 return _core_.Sizer_SetDimension(*args, **kwargs)
11460
11461 def SetMinSize(*args, **kwargs):
11462 """
11463 SetMinSize(self, Size size)
11464
11465 Call this to give the sizer a minimal size. Normally, the sizer will
11466 calculate its minimal size based purely on how much space its children
11467 need. After calling this method `GetMinSize` will return either the
11468 minimal size as requested by its children or the minimal size set
11469 here, depending on which is bigger.
11470 """
11471 return _core_.Sizer_SetMinSize(*args, **kwargs)
11472
11473 def GetSize(*args, **kwargs):
11474 """
11475 GetSize(self) -> Size
11476
11477 Returns the current size of the space managed by the sizer.
11478 """
11479 return _core_.Sizer_GetSize(*args, **kwargs)
11480
11481 def GetPosition(*args, **kwargs):
11482 """
11483 GetPosition(self) -> Point
11484
11485 Returns the current position of the sizer's managed space.
11486 """
11487 return _core_.Sizer_GetPosition(*args, **kwargs)
11488
11489 def GetMinSize(*args, **kwargs):
11490 """
11491 GetMinSize(self) -> Size
11492
11493 Returns the minimal size of the sizer. This is either the combined
11494 minimal size of all the children and their borders or the minimal size
11495 set by SetMinSize, depending on which is bigger.
11496 """
11497 return _core_.Sizer_GetMinSize(*args, **kwargs)
11498
11499 def GetSizeTuple(self):
11500 return self.GetSize().Get()
11501 def GetPositionTuple(self):
11502 return self.GetPosition().Get()
11503 def GetMinSizeTuple(self):
11504 return self.GetMinSize().Get()
11505
11506 def RecalcSizes(*args, **kwargs):
11507 """
11508 RecalcSizes(self)
11509
11510 Using the sizes calculated by `CalcMin` reposition and resize all the
11511 items managed by this sizer. You should not need to call this directly as
11512 it is called by `Layout`.
11513 """
11514 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11515
11516 def CalcMin(*args, **kwargs):
11517 """
11518 CalcMin(self) -> Size
11519
11520 This method is where the sizer will do the actual calculation of its
11521 children's minimal sizes. You should not need to call this directly as
11522 it is called by `Layout`.
11523 """
11524 return _core_.Sizer_CalcMin(*args, **kwargs)
11525
11526 def Layout(*args, **kwargs):
11527 """
11528 Layout(self)
11529
11530 This method will force the recalculation and layout of the items
11531 controlled by the sizer using the current space allocated to the
11532 sizer. Normally this is called automatically from the owning window's
11533 EVT_SIZE handler, but it is also useful to call it from user code when
11534 one of the items in a sizer change size, or items are added or
11535 removed.
11536 """
11537 return _core_.Sizer_Layout(*args, **kwargs)
11538
11539 def Fit(*args, **kwargs):
11540 """
11541 Fit(self, Window window) -> Size
11542
11543 Tell the sizer to resize the *window* to match the sizer's minimal
11544 size. This is commonly done in the constructor of the window itself in
11545 order to set its initial size to match the needs of the children as
11546 determined by the sizer. Returns the new size.
11547
11548 For a top level window this is the total window size, not the client size.
11549 """
11550 return _core_.Sizer_Fit(*args, **kwargs)
11551
11552 def FitInside(*args, **kwargs):
11553 """
11554 FitInside(self, Window window)
11555
11556 Tell the sizer to resize the *virtual size* of the *window* to match the
11557 sizer's minimal size. This will not alter the on screen size of the
11558 window, but may cause the addition/removal/alteration of scrollbars
11559 required to view the virtual area in windows which manage it.
11560
11561 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11562
11563 """
11564 return _core_.Sizer_FitInside(*args, **kwargs)
11565
11566 def SetSizeHints(*args, **kwargs):
11567 """
11568 SetSizeHints(self, Window window)
11569
11570 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11571 match the sizer's minimal size. This is commonly done in the
11572 constructor of the window itself if the window is resizable (as are
11573 many dialogs under Unix and frames on probably all platforms) in order
11574 to prevent the window from being sized smaller than the minimal size
11575 required by the sizer.
11576 """
11577 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11578
11579 def SetVirtualSizeHints(*args, **kwargs):
11580 """
11581 SetVirtualSizeHints(self, Window window)
11582
11583 Tell the sizer to set the minimal size of the window virtual area to
11584 match the sizer's minimal size. For windows with managed scrollbars
11585 this will set them appropriately.
11586
11587 :see: `wx.ScrolledWindow.SetScrollbars`
11588
11589 """
11590 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11591
11592 def Clear(*args, **kwargs):
11593 """
11594 Clear(self, bool deleteWindows=False)
11595
11596 Clear all items from the sizer, optionally destroying the window items
11597 as well.
11598 """
11599 return _core_.Sizer_Clear(*args, **kwargs)
11600
11601 def DeleteWindows(*args, **kwargs):
11602 """
11603 DeleteWindows(self)
11604
11605 Destroy all windows managed by the sizer.
11606 """
11607 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11608
11609 def GetChildren(*args, **kwargs):
11610 """
11611 GetChildren(self) -> list
11612
11613 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11614 """
11615 return _core_.Sizer_GetChildren(*args, **kwargs)
11616
11617 def Show(*args, **kwargs):
11618 """
11619 Show(self, item, bool show=True, bool recursive=false) -> bool
11620
11621 Shows or hides an item managed by the sizer. To make a sizer item
11622 disappear or reappear, use Show followed by `Layout`. The *item*
11623 parameter can be either a window, a sizer, or the zero-based index of
11624 the item. Use the recursive parameter to show or hide an item in a
11625 subsizer. Returns True if the item was found.
11626 """
11627 return _core_.Sizer_Show(*args, **kwargs)
11628
11629 def IsShown(*args, **kwargs):
11630 """
11631 IsShown(self, item)
11632
11633 Determines if the item is currently shown. To make a sizer
11634 item disappear or reappear, use Show followed by `Layout`. The *item*
11635 parameter can be either a window, a sizer, or the zero-based index of
11636 the item.
11637 """
11638 return _core_.Sizer_IsShown(*args, **kwargs)
11639
11640 def Hide(self, item, recursive=False):
11641 """
11642 A convenience method for `Show` (item, False, recursive).
11643 """
11644 return self.Show(item, False, recursive)
11645
11646 def ShowItems(*args, **kwargs):
11647 """
11648 ShowItems(self, bool show)
11649
11650 Recursively call `wx.SizerItem.Show` on all sizer items.
11651 """
11652 return _core_.Sizer_ShowItems(*args, **kwargs)
11653
11654 _core_.Sizer_swigregister(Sizer)
11655
11656 class PySizer(Sizer):
11657 """
11658 wx.PySizer is a special version of `wx.Sizer` that has been
11659 instrumented to allow the C++ virtual methods to be overloaded in
11660 Python derived classes. You would derive from this class if you are
11661 wanting to implement a custom sizer in Python code. Simply implement
11662 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11663 For example::
11664
11665 class MySizer(wx.PySizer):
11666 def __init__(self):
11667 wx.PySizer.__init__(self)
11668
11669 def CalcMin(self):
11670 for item in self.GetChildren():
11671 # calculate the total minimum width and height needed
11672 # by all items in the sizer according to this sizer's
11673 # layout algorithm.
11674 ...
11675 return wx.Size(width, height)
11676
11677 def RecalcSizes(self):
11678 # find the space allotted to this sizer
11679 pos = self.GetPosition()
11680 size = self.GetSize()
11681 for item in self.GetChildren():
11682 # Recalculate (if necessary) the position and size of
11683 # each item and then call item.SetDimension to do the
11684 # actual positioning and sizing of the items within the
11685 # space alloted to this sizer.
11686 ...
11687 item.SetDimension(itemPos, itemSize)
11688
11689
11690 When `Layout` is called it first calls `CalcMin` followed by
11691 `RecalcSizes` so you can optimize a bit by saving the results of
11692 `CalcMin` and reusing them in `RecalcSizes`.
11693
11694 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11695
11696
11697 """
11698 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11699 __repr__ = _swig_repr
11700 def __init__(self, *args, **kwargs):
11701 """
11702 __init__(self) -> PySizer
11703
11704 Creates a wx.PySizer. Must be called from the __init__ in the derived
11705 class.
11706 """
11707 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
11708 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11709
11710 def _setCallbackInfo(*args, **kwargs):
11711 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11712 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11713
11714 _core_.PySizer_swigregister(PySizer)
11715
11716 #---------------------------------------------------------------------------
11717
11718 class BoxSizer(Sizer):
11719 """
11720 The basic idea behind a box sizer is that windows will most often be
11721 laid out in rather simple basic geometry, typically in a row or a
11722 column or nested hierarchies of either. A wx.BoxSizer will lay out
11723 its items in a simple row or column, depending on the orientation
11724 parameter passed to the constructor.
11725 """
11726 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11727 __repr__ = _swig_repr
11728 def __init__(self, *args, **kwargs):
11729 """
11730 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11731
11732 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11733 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11734 sizer.
11735 """
11736 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
11737 self._setOORInfo(self)
11738
11739 def GetOrientation(*args, **kwargs):
11740 """
11741 GetOrientation(self) -> int
11742
11743 Returns the current orientation of the sizer.
11744 """
11745 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11746
11747 def SetOrientation(*args, **kwargs):
11748 """
11749 SetOrientation(self, int orient)
11750
11751 Resets the orientation of the sizer.
11752 """
11753 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
11754
11755 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
11756 _core_.BoxSizer_swigregister(BoxSizer)
11757
11758 #---------------------------------------------------------------------------
11759
11760 class StaticBoxSizer(BoxSizer):
11761 """
11762 wx.StaticBoxSizer derives from and functions identically to the
11763 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11764 manages. Note that this static box must be created separately and
11765 passed to the sizer constructor.
11766 """
11767 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11768 __repr__ = _swig_repr
11769 def __init__(self, *args, **kwargs):
11770 """
11771 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11772
11773 Constructor. It takes an associated static box and the orientation
11774 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11775 ``wx.HORIZONTAL``.
11776 """
11777 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
11778 self._setOORInfo(self)
11779
11780 def GetStaticBox(*args, **kwargs):
11781 """
11782 GetStaticBox(self) -> StaticBox
11783
11784 Returns the static box associated with this sizer.
11785 """
11786 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
11787
11788 _core_.StaticBoxSizer_swigregister(StaticBoxSizer)
11789
11790 #---------------------------------------------------------------------------
11791
11792 class GridSizer(Sizer):
11793 """
11794 A grid sizer is a sizer which lays out its children in a
11795 two-dimensional table with all cells having the same size. In other
11796 words, the width of each cell within the grid is the width of the
11797 widest item added to the sizer and the height of each grid cell is the
11798 height of the tallest item. An optional vertical and/or horizontal
11799 gap between items can also be specified (in pixels.)
11800
11801 Items are placed in the cells of the grid in the order they are added,
11802 in row-major order. In other words, the first row is filled first,
11803 then the second, and so on until all items have been added. (If
11804 neccessary, additional rows will be added as items are added.) If you
11805 need to have greater control over the cells that items are placed in
11806 then use the `wx.GridBagSizer`.
11807
11808 """
11809 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11810 __repr__ = _swig_repr
11811 def __init__(self, *args, **kwargs):
11812 """
11813 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11814
11815 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11816 of columns and rows in the sizer - if either of the parameters is
11817 zero, it will be calculated to from the total number of children in
11818 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11819 define extra space between all children.
11820 """
11821 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
11822 self._setOORInfo(self)
11823
11824 def SetCols(*args, **kwargs):
11825 """
11826 SetCols(self, int cols)
11827
11828 Sets the number of columns in the sizer.
11829 """
11830 return _core_.GridSizer_SetCols(*args, **kwargs)
11831
11832 def SetRows(*args, **kwargs):
11833 """
11834 SetRows(self, int rows)
11835
11836 Sets the number of rows in the sizer.
11837 """
11838 return _core_.GridSizer_SetRows(*args, **kwargs)
11839
11840 def SetVGap(*args, **kwargs):
11841 """
11842 SetVGap(self, int gap)
11843
11844 Sets the vertical gap (in pixels) between the cells in the sizer.
11845 """
11846 return _core_.GridSizer_SetVGap(*args, **kwargs)
11847
11848 def SetHGap(*args, **kwargs):
11849 """
11850 SetHGap(self, int gap)
11851
11852 Sets the horizontal gap (in pixels) between cells in the sizer
11853 """
11854 return _core_.GridSizer_SetHGap(*args, **kwargs)
11855
11856 def GetCols(*args, **kwargs):
11857 """
11858 GetCols(self) -> int
11859
11860 Returns the number of columns in the sizer.
11861 """
11862 return _core_.GridSizer_GetCols(*args, **kwargs)
11863
11864 def GetRows(*args, **kwargs):
11865 """
11866 GetRows(self) -> int
11867
11868 Returns the number of rows in the sizer.
11869 """
11870 return _core_.GridSizer_GetRows(*args, **kwargs)
11871
11872 def GetVGap(*args, **kwargs):
11873 """
11874 GetVGap(self) -> int
11875
11876 Returns the vertical gap (in pixels) between the cells in the sizer.
11877 """
11878 return _core_.GridSizer_GetVGap(*args, **kwargs)
11879
11880 def GetHGap(*args, **kwargs):
11881 """
11882 GetHGap(self) -> int
11883
11884 Returns the horizontal gap (in pixels) between cells in the sizer.
11885 """
11886 return _core_.GridSizer_GetHGap(*args, **kwargs)
11887
11888 def CalcRowsCols(self):
11889 """
11890 CalcRowsCols() -> (rows, cols)
11891
11892 Calculates how many rows and columns will be in the sizer based
11893 on the current number of items and also the rows, cols specified
11894 in the constructor.
11895 """
11896 nitems = len(self.GetChildren())
11897 rows = self.GetRows()
11898 cols = self.GetCols()
11899 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11900 if cols != 0:
11901 rows = (nitems + cols - 1) / cols
11902 elif rows != 0:
11903 cols = (nitems + rows - 1) / rows
11904 return (rows, cols)
11905
11906 _core_.GridSizer_swigregister(GridSizer)
11907
11908 #---------------------------------------------------------------------------
11909
11910 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11911 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11912 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11913 class FlexGridSizer(GridSizer):
11914 """
11915 A flex grid sizer is a sizer which lays out its children in a
11916 two-dimensional table with all table cells in one row having the same
11917 height and all cells in one column having the same width, but all
11918 rows or all columns are not necessarily the same height or width as in
11919 the `wx.GridSizer`.
11920
11921 wx.FlexGridSizer can also size items equally in one direction but
11922 unequally ("flexibly") in the other. If the sizer is only flexible
11923 in one direction (this can be changed using `SetFlexibleDirection`), it
11924 needs to be decided how the sizer should grow in the other ("non
11925 flexible") direction in order to fill the available space. The
11926 `SetNonFlexibleGrowMode` method serves this purpose.
11927
11928
11929 """
11930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11931 __repr__ = _swig_repr
11932 def __init__(self, *args, **kwargs):
11933 """
11934 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11935
11936 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11937 number of columns and rows in the sizer - if either of the parameters
11938 is zero, it will be calculated to from the total number of children in
11939 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11940 define extra space between all children.
11941 """
11942 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
11943 self._setOORInfo(self)
11944
11945 def AddGrowableRow(*args, **kwargs):
11946 """
11947 AddGrowableRow(self, size_t idx, int proportion=0)
11948
11949 Specifies that row *idx* (starting from zero) should be grown if there
11950 is extra space available to the sizer.
11951
11952 The *proportion* parameter has the same meaning as the stretch factor
11953 for the box sizers except that if all proportions are 0, then all
11954 columns are resized equally (instead of not being resized at all).
11955 """
11956 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11957
11958 def RemoveGrowableRow(*args, **kwargs):
11959 """
11960 RemoveGrowableRow(self, size_t idx)
11961
11962 Specifies that row *idx* is no longer growable.
11963 """
11964 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11965
11966 def AddGrowableCol(*args, **kwargs):
11967 """
11968 AddGrowableCol(self, size_t idx, int proportion=0)
11969
11970 Specifies that column *idx* (starting from zero) should be grown if
11971 there is extra space available to the sizer.
11972
11973 The *proportion* parameter has the same meaning as the stretch factor
11974 for the box sizers except that if all proportions are 0, then all
11975 columns are resized equally (instead of not being resized at all).
11976 """
11977 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11978
11979 def RemoveGrowableCol(*args, **kwargs):
11980 """
11981 RemoveGrowableCol(self, size_t idx)
11982
11983 Specifies that column *idx* is no longer growable.
11984 """
11985 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11986
11987 def SetFlexibleDirection(*args, **kwargs):
11988 """
11989 SetFlexibleDirection(self, int direction)
11990
11991 Specifies whether the sizer should flexibly resize its columns, rows,
11992 or both. Argument *direction* can be one of the following values. Any
11993 other value is ignored.
11994
11995 ============== =======================================
11996 wx.VERTICAL Rows are flexibly sized.
11997 wx.HORIZONTAL Columns are flexibly sized.
11998 wx.BOTH Both rows and columns are flexibly sized
11999 (this is the default value).
12000 ============== =======================================
12001
12002 Note that this method does not trigger relayout.
12003
12004 """
12005 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12006
12007 def GetFlexibleDirection(*args, **kwargs):
12008 """
12009 GetFlexibleDirection(self) -> int
12010
12011 Returns a value that specifies whether the sizer
12012 flexibly resizes its columns, rows, or both (default).
12013
12014 :see: `SetFlexibleDirection`
12015 """
12016 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12017
12018 def SetNonFlexibleGrowMode(*args, **kwargs):
12019 """
12020 SetNonFlexibleGrowMode(self, int mode)
12021
12022 Specifies how the sizer should grow in the non-flexible direction if
12023 there is one (so `SetFlexibleDirection` must have been called
12024 previously). Argument *mode* can be one of the following values:
12025
12026 ========================== =================================================
12027 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12028 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12029 `AddGrowableCol` and `AddGrowableRow`. In this
12030 case equal sizing applies to minimum sizes of
12031 columns or rows (this is the default value).
12032 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12033 the non flexible direction, whether they are
12034 growable or not in the flexbile direction.
12035 ========================== =================================================
12036
12037 Note that this method does not trigger relayout.
12038
12039
12040 """
12041 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12042
12043 def GetNonFlexibleGrowMode(*args, **kwargs):
12044 """
12045 GetNonFlexibleGrowMode(self) -> int
12046
12047 Returns the value that specifies how the sizer grows in the
12048 non-flexible direction if there is one.
12049
12050 :see: `SetNonFlexibleGrowMode`
12051 """
12052 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12053
12054 def GetRowHeights(*args, **kwargs):
12055 """
12056 GetRowHeights(self) -> list
12057
12058 Returns a list of integers representing the heights of each of the
12059 rows in the sizer.
12060 """
12061 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12062
12063 def GetColWidths(*args, **kwargs):
12064 """
12065 GetColWidths(self) -> list
12066
12067 Returns a list of integers representing the widths of each of the
12068 columns in the sizer.
12069 """
12070 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12071
12072 _core_.FlexGridSizer_swigregister(FlexGridSizer)
12073
12074 class StdDialogButtonSizer(BoxSizer):
12075 """
12076 A special sizer that knows how to order and position standard buttons
12077 in order to conform to the current platform's standards. You simply
12078 need to add each `wx.Button` to the sizer, and be sure to create the
12079 buttons using the standard ID's. Then call `Realize` and the sizer
12080 will take care of the rest.
12081
12082 """
12083 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12084 __repr__ = _swig_repr
12085 def __init__(self, *args, **kwargs):
12086 """__init__(self) -> StdDialogButtonSizer"""
12087 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
12088 def AddButton(*args, **kwargs):
12089 """
12090 AddButton(self, wxButton button)
12091
12092 Use this to add the buttons to this sizer. Do not use the `Add`
12093 method in the base class.
12094 """
12095 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12096
12097 def Realize(*args, **kwargs):
12098 """
12099 Realize(self)
12100
12101 This funciton needs to be called after all the buttons have been added
12102 to the sizer. It will reorder them and position them in a platform
12103 specifc manner.
12104 """
12105 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
12106
12107 def SetAffirmativeButton(*args, **kwargs):
12108 """SetAffirmativeButton(self, wxButton button)"""
12109 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12110
12111 def SetNegativeButton(*args, **kwargs):
12112 """SetNegativeButton(self, wxButton button)"""
12113 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12114
12115 def SetCancelButton(*args, **kwargs):
12116 """SetCancelButton(self, wxButton button)"""
12117 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
12118
12119 def GetAffirmativeButton(*args, **kwargs):
12120 """GetAffirmativeButton(self) -> wxButton"""
12121 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12122
12123 def GetApplyButton(*args, **kwargs):
12124 """GetApplyButton(self) -> wxButton"""
12125 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12126
12127 def GetNegativeButton(*args, **kwargs):
12128 """GetNegativeButton(self) -> wxButton"""
12129 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12130
12131 def GetCancelButton(*args, **kwargs):
12132 """GetCancelButton(self) -> wxButton"""
12133 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12134
12135 def GetHelpButton(*args, **kwargs):
12136 """GetHelpButton(self) -> wxButton"""
12137 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12138
12139 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
12140
12141 #---------------------------------------------------------------------------
12142
12143 class GBPosition(object):
12144 """
12145 This class represents the position of an item in a virtual grid of
12146 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12147 typemaps that will automatically convert from a 2-element sequence of
12148 integers to a wx.GBPosition, so you can use the more pythonic
12149 representation of the position nearly transparently in Python code.
12150 """
12151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12152 __repr__ = _swig_repr
12153 def __init__(self, *args, **kwargs):
12154 """
12155 __init__(self, int row=0, int col=0) -> GBPosition
12156
12157 This class represents the position of an item in a virtual grid of
12158 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12159 typemaps that will automatically convert from a 2-element sequence of
12160 integers to a wx.GBPosition, so you can use the more pythonic
12161 representation of the position nearly transparently in Python code.
12162 """
12163 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12164 __swig_destroy__ = _core_.delete_GBPosition
12165 __del__ = lambda self : None;
12166 def GetRow(*args, **kwargs):
12167 """GetRow(self) -> int"""
12168 return _core_.GBPosition_GetRow(*args, **kwargs)
12169
12170 def GetCol(*args, **kwargs):
12171 """GetCol(self) -> int"""
12172 return _core_.GBPosition_GetCol(*args, **kwargs)
12173
12174 def SetRow(*args, **kwargs):
12175 """SetRow(self, int row)"""
12176 return _core_.GBPosition_SetRow(*args, **kwargs)
12177
12178 def SetCol(*args, **kwargs):
12179 """SetCol(self, int col)"""
12180 return _core_.GBPosition_SetCol(*args, **kwargs)
12181
12182 def __eq__(*args, **kwargs):
12183 """
12184 __eq__(self, PyObject other) -> bool
12185
12186 Compare GBPosition for equality.
12187 """
12188 return _core_.GBPosition___eq__(*args, **kwargs)
12189
12190 def __ne__(*args, **kwargs):
12191 """
12192 __ne__(self, PyObject other) -> bool
12193
12194 Compare GBPosition for inequality.
12195 """
12196 return _core_.GBPosition___ne__(*args, **kwargs)
12197
12198 def Set(*args, **kwargs):
12199 """Set(self, int row=0, int col=0)"""
12200 return _core_.GBPosition_Set(*args, **kwargs)
12201
12202 def Get(*args, **kwargs):
12203 """Get(self) -> PyObject"""
12204 return _core_.GBPosition_Get(*args, **kwargs)
12205
12206 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12207 def __str__(self): return str(self.Get())
12208 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12209 def __len__(self): return len(self.Get())
12210 def __getitem__(self, index): return self.Get()[index]
12211 def __setitem__(self, index, val):
12212 if index == 0: self.SetRow(val)
12213 elif index == 1: self.SetCol(val)
12214 else: raise IndexError
12215 def __nonzero__(self): return self.Get() != (0,0)
12216 __safe_for_unpickling__ = True
12217 def __reduce__(self): return (wx.GBPosition, self.Get())
12218
12219 row = property(GetRow, SetRow)
12220 col = property(GetCol, SetCol)
12221
12222 _core_.GBPosition_swigregister(GBPosition)
12223
12224 class GBSpan(object):
12225 """
12226 This class is used to hold the row and column spanning attributes of
12227 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12228 automatically convert from a 2-element sequence of integers to a
12229 wx.GBSpan, so you can use the more pythonic representation of the span
12230 nearly transparently in Python code.
12231
12232 """
12233 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12234 __repr__ = _swig_repr
12235 def __init__(self, *args, **kwargs):
12236 """
12237 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12238
12239 Construct a new wxGBSpan, optionally setting the rowspan and
12240 colspan. The default is (1,1). (Meaning that the item occupies one
12241 cell in each direction.
12242 """
12243 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12244 __swig_destroy__ = _core_.delete_GBSpan
12245 __del__ = lambda self : None;
12246 def GetRowspan(*args, **kwargs):
12247 """GetRowspan(self) -> int"""
12248 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12249
12250 def GetColspan(*args, **kwargs):
12251 """GetColspan(self) -> int"""
12252 return _core_.GBSpan_GetColspan(*args, **kwargs)
12253
12254 def SetRowspan(*args, **kwargs):
12255 """SetRowspan(self, int rowspan)"""
12256 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12257
12258 def SetColspan(*args, **kwargs):
12259 """SetColspan(self, int colspan)"""
12260 return _core_.GBSpan_SetColspan(*args, **kwargs)
12261
12262 def __eq__(*args, **kwargs):
12263 """
12264 __eq__(self, PyObject other) -> bool
12265
12266 Compare wxGBSpan for equality.
12267 """
12268 return _core_.GBSpan___eq__(*args, **kwargs)
12269
12270 def __ne__(*args, **kwargs):
12271 """
12272 __ne__(self, PyObject other) -> bool
12273
12274 Compare GBSpan for inequality.
12275 """
12276 return _core_.GBSpan___ne__(*args, **kwargs)
12277
12278 def Set(*args, **kwargs):
12279 """Set(self, int rowspan=1, int colspan=1)"""
12280 return _core_.GBSpan_Set(*args, **kwargs)
12281
12282 def Get(*args, **kwargs):
12283 """Get(self) -> PyObject"""
12284 return _core_.GBSpan_Get(*args, **kwargs)
12285
12286 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
12287 def __str__(self): return str(self.Get())
12288 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12289 def __len__(self): return len(self.Get())
12290 def __getitem__(self, index): return self.Get()[index]
12291 def __setitem__(self, index, val):
12292 if index == 0: self.SetRowspan(val)
12293 elif index == 1: self.SetColspan(val)
12294 else: raise IndexError
12295 def __nonzero__(self): return self.Get() != (0,0)
12296 __safe_for_unpickling__ = True
12297 def __reduce__(self): return (wx.GBSpan, self.Get())
12298
12299 rowspan = property(GetRowspan, SetRowspan)
12300 colspan = property(GetColspan, SetColspan)
12301
12302 _core_.GBSpan_swigregister(GBSpan)
12303
12304 class GBSizerItem(SizerItem):
12305 """
12306 The wx.GBSizerItem class is used to track the additional data about
12307 items in a `wx.GridBagSizer` such as the item's position in the grid
12308 and how many rows or columns it spans.
12309
12310 """
12311 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12312 __repr__ = _swig_repr
12313 def __init__(self, *args, **kwargs):
12314 """
12315 __init__(self) -> GBSizerItem
12316
12317 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12318 size will need to be set, as well as a position and span before this
12319 item can be used in a Sizer.
12320
12321 You will probably never need to create a wx.GBSizerItem directly as they
12322 are created automatically when the sizer's Add method is called.
12323 """
12324 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12325 __swig_destroy__ = _core_.delete_GBSizerItem
12326 __del__ = lambda self : None;
12327 def GetPos(*args, **kwargs):
12328 """
12329 GetPos(self) -> GBPosition
12330
12331 Get the grid position of the item
12332 """
12333 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12334
12335 def GetPosTuple(self): return self.GetPos().Get()
12336 def GetSpan(*args, **kwargs):
12337 """
12338 GetSpan(self) -> GBSpan
12339
12340 Get the row and column spanning of the item
12341 """
12342 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12343
12344 def GetSpanTuple(self): return self.GetSpan().Get()
12345 def SetPos(*args, **kwargs):
12346 """
12347 SetPos(self, GBPosition pos) -> bool
12348
12349 If the item is already a member of a sizer then first ensure that
12350 there is no other item that would intersect with this one at the new
12351 position, then set the new position. Returns True if the change is
12352 successful and after the next Layout() the item will be moved.
12353 """
12354 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12355
12356 def SetSpan(*args, **kwargs):
12357 """
12358 SetSpan(self, GBSpan span) -> bool
12359
12360 If the item is already a member of a sizer then first ensure that
12361 there is no other item that would intersect with this one with its new
12362 spanning size, then set the new spanning. Returns True if the change
12363 is successful and after the next Layout() the item will be resized.
12364
12365 """
12366 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12367
12368 def Intersects(*args, **kwargs):
12369 """
12370 Intersects(self, GBSizerItem other) -> bool
12371
12372 Returns True if this item and the other item instersect.
12373 """
12374 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12375
12376 def IntersectsPos(*args, **kwargs):
12377 """
12378 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12379
12380 Returns True if the given pos/span would intersect with this item.
12381 """
12382 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
12383
12384 def GetEndPos(*args, **kwargs):
12385 """
12386 GetEndPos(self) -> GBPosition
12387
12388 Get the row and column of the endpoint of this item.
12389 """
12390 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12391
12392 def GetGBSizer(*args, **kwargs):
12393 """
12394 GetGBSizer(self) -> GridBagSizer
12395
12396 Get the sizer this item is a member of.
12397 """
12398 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12399
12400 def SetGBSizer(*args, **kwargs):
12401 """
12402 SetGBSizer(self, GridBagSizer sizer)
12403
12404 Set the sizer this item is a member of.
12405 """
12406 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12407
12408 _core_.GBSizerItem_swigregister(GBSizerItem)
12409 DefaultSpan = cvar.DefaultSpan
12410
12411 def GBSizerItemWindow(*args, **kwargs):
12412 """
12413 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12414 int border, PyObject userData=None) -> GBSizerItem
12415
12416 Construct a `wx.GBSizerItem` for a window.
12417 """
12418 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12419 return val
12420
12421 def GBSizerItemSizer(*args, **kwargs):
12422 """
12423 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12424 int border, PyObject userData=None) -> GBSizerItem
12425
12426 Construct a `wx.GBSizerItem` for a sizer
12427 """
12428 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12429 return val
12430
12431 def GBSizerItemSpacer(*args, **kwargs):
12432 """
12433 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12434 int flag, int border, PyObject userData=None) -> GBSizerItem
12435
12436 Construct a `wx.GBSizerItem` for a spacer.
12437 """
12438 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12439 return val
12440
12441 class GridBagSizer(FlexGridSizer):
12442 """
12443 A `wx.Sizer` that can lay out items in a virtual grid like a
12444 `wx.FlexGridSizer` but in this case explicit positioning of the items
12445 is allowed using `wx.GBPosition`, and items can optionally span more
12446 than one row and/or column using `wx.GBSpan`. The total size of the
12447 virtual grid is determined by the largest row and column that items are
12448 positioned at, adjusted for spanning.
12449
12450 """
12451 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12452 __repr__ = _swig_repr
12453 def __init__(self, *args, **kwargs):
12454 """
12455 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12456
12457 Constructor, with optional parameters to specify the gap between the
12458 rows and columns.
12459 """
12460 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
12461 self._setOORInfo(self)
12462
12463 def Add(*args, **kwargs):
12464 """
12465 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12466 int border=0, userData=None) -> wx.GBSizerItem
12467
12468 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12469 more than one row or column as specified with *span*. The remaining
12470 args behave similarly to `wx.Sizer.Add`.
12471
12472 Returns True if the item was successfully placed at the given cell
12473 position, False if something was already there.
12474
12475 """
12476 return _core_.GridBagSizer_Add(*args, **kwargs)
12477
12478 def AddItem(*args, **kwargs):
12479 """
12480 Add(self, GBSizerItem item) -> wx.GBSizerItem
12481
12482 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12483 the item was successfully placed at its given cell position, False if
12484 something was already there.
12485 """
12486 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12487
12488 def GetCellSize(*args, **kwargs):
12489 """
12490 GetCellSize(self, int row, int col) -> Size
12491
12492 Get the size of the specified cell, including hgap and
12493 vgap. Only valid after a Layout.
12494 """
12495 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12496
12497 def GetEmptyCellSize(*args, **kwargs):
12498 """
12499 GetEmptyCellSize(self) -> Size
12500
12501 Get the size used for cells in the grid with no item.
12502 """
12503 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12504
12505 def SetEmptyCellSize(*args, **kwargs):
12506 """
12507 SetEmptyCellSize(self, Size sz)
12508
12509 Set the size used for cells in the grid with no item.
12510 """
12511 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12512
12513 def GetItemPosition(*args):
12514 """
12515 GetItemPosition(self, item) -> GBPosition
12516
12517 Get the grid position of the specified *item* where *item* is either a
12518 window or subsizer that is a member of this sizer, or a zero-based
12519 index of an item.
12520 """
12521 return _core_.GridBagSizer_GetItemPosition(*args)
12522
12523 def SetItemPosition(*args):
12524 """
12525 SetItemPosition(self, item, GBPosition pos) -> bool
12526
12527 Set the grid position of the specified *item* where *item* is either a
12528 window or subsizer that is a member of this sizer, or a zero-based
12529 index of an item. Returns True on success. If the move is not
12530 allowed (because an item is already there) then False is returned.
12531
12532 """
12533 return _core_.GridBagSizer_SetItemPosition(*args)
12534
12535 def GetItemSpan(*args):
12536 """
12537 GetItemSpan(self, item) -> GBSpan
12538
12539 Get the row/col spanning of the specified *item* where *item* is
12540 either a window or subsizer that is a member of this sizer, or a
12541 zero-based index of an item.
12542 """
12543 return _core_.GridBagSizer_GetItemSpan(*args)
12544
12545 def SetItemSpan(*args):
12546 """
12547 SetItemSpan(self, item, GBSpan span) -> bool
12548
12549 Set the row/col spanning of the specified *item* where *item* is
12550 either a window or subsizer that is a member of this sizer, or a
12551 zero-based index of an item. Returns True on success. If the move is
12552 not allowed (because an item is already there) then False is returned.
12553 """
12554 return _core_.GridBagSizer_SetItemSpan(*args)
12555
12556 def FindItem(*args):
12557 """
12558 FindItem(self, item) -> GBSizerItem
12559
12560 Find the sizer item for the given window or subsizer, returns None if
12561 not found. (non-recursive)
12562 """
12563 return _core_.GridBagSizer_FindItem(*args)
12564
12565 def FindItemAtPosition(*args, **kwargs):
12566 """
12567 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12568
12569 Return the sizer item for the given grid cell, or None if there is no
12570 item at that position. (non-recursive)
12571 """
12572 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12573
12574 def FindItemAtPoint(*args, **kwargs):
12575 """
12576 FindItemAtPoint(self, Point pt) -> GBSizerItem
12577
12578 Return the sizer item located at the point given in *pt*, or None if
12579 there is no item at that point. The (x,y) coordinates in pt correspond
12580 to the client coordinates of the window using the sizer for
12581 layout. (non-recursive)
12582 """
12583 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12584
12585 def CheckForIntersection(*args, **kwargs):
12586 """
12587 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12588
12589 Look at all items and see if any intersect (or would overlap) the
12590 given *item*. Returns True if so, False if there would be no overlap.
12591 If an *excludeItem* is given then it will not be checked for
12592 intersection, for example it may be the item we are checking the
12593 position of.
12594
12595 """
12596 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
12597
12598 def CheckForIntersectionPos(*args, **kwargs):
12599 """
12600 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12601
12602 Look at all items and see if any intersect (or would overlap) the
12603 given position and span. Returns True if so, False if there would be
12604 no overlap. If an *excludeItem* is given then it will not be checked
12605 for intersection, for example it may be the item we are checking the
12606 position of.
12607 """
12608 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
12609
12610 _core_.GridBagSizer_swigregister(GridBagSizer)
12611
12612 #---------------------------------------------------------------------------
12613
12614 Left = _core_.Left
12615 Top = _core_.Top
12616 Right = _core_.Right
12617 Bottom = _core_.Bottom
12618 Width = _core_.Width
12619 Height = _core_.Height
12620 Centre = _core_.Centre
12621 Center = _core_.Center
12622 CentreX = _core_.CentreX
12623 CentreY = _core_.CentreY
12624 Unconstrained = _core_.Unconstrained
12625 AsIs = _core_.AsIs
12626 PercentOf = _core_.PercentOf
12627 Above = _core_.Above
12628 Below = _core_.Below
12629 LeftOf = _core_.LeftOf
12630 RightOf = _core_.RightOf
12631 SameAs = _core_.SameAs
12632 Absolute = _core_.Absolute
12633 class IndividualLayoutConstraint(Object):
12634 """
12635 Objects of this class are stored in the `wx.LayoutConstraints` class as
12636 one of eight possible constraints that a window can be involved in.
12637 You will never need to create an instance of
12638 wx.IndividualLayoutConstraint, rather you should create a
12639 `wx.LayoutConstraints` instance and use the individual contstraints
12640 that it contains.
12641 """
12642 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12643 def __init__(self): raise AttributeError, "No constructor defined"
12644 __repr__ = _swig_repr
12645 def Set(*args, **kwargs):
12646 """
12647 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12648
12649 Sets the properties of the constraint. Normally called by one of the
12650 convenience functions such as Above, RightOf, SameAs.
12651 """
12652 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12653
12654 def LeftOf(*args, **kwargs):
12655 """
12656 LeftOf(self, Window sibling, int marg=0)
12657
12658 Constrains this edge to be to the left of the given window, with an
12659 optional margin. Implicitly, this is relative to the left edge of the
12660 other window.
12661 """
12662 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12663
12664 def RightOf(*args, **kwargs):
12665 """
12666 RightOf(self, Window sibling, int marg=0)
12667
12668 Constrains this edge to be to the right of the given window, with an
12669 optional margin. Implicitly, this is relative to the right edge of the
12670 other window.
12671 """
12672 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12673
12674 def Above(*args, **kwargs):
12675 """
12676 Above(self, Window sibling, int marg=0)
12677
12678 Constrains this edge to be above the given window, with an optional
12679 margin. Implicitly, this is relative to the top edge of the other
12680 window.
12681 """
12682 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12683
12684 def Below(*args, **kwargs):
12685 """
12686 Below(self, Window sibling, int marg=0)
12687
12688 Constrains this edge to be below the given window, with an optional
12689 margin. Implicitly, this is relative to the bottom edge of the other
12690 window.
12691 """
12692 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12693
12694 def SameAs(*args, **kwargs):
12695 """
12696 SameAs(self, Window otherW, int edge, int marg=0)
12697
12698 Constrains this edge or dimension to be to the same as the edge of the
12699 given window, with an optional margin.
12700 """
12701 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12702
12703 def PercentOf(*args, **kwargs):
12704 """
12705 PercentOf(self, Window otherW, int wh, int per)
12706
12707 Constrains this edge or dimension to be to a percentage of the given
12708 window, with an optional margin.
12709 """
12710 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12711
12712 def Absolute(*args, **kwargs):
12713 """
12714 Absolute(self, int val)
12715
12716 Constrains this edge or dimension to be the given absolute value.
12717 """
12718 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12719
12720 def Unconstrained(*args, **kwargs):
12721 """
12722 Unconstrained(self)
12723
12724 Sets this edge or dimension to be unconstrained, that is, dependent on
12725 other edges and dimensions from which this value can be deduced.
12726 """
12727 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12728
12729 def AsIs(*args, **kwargs):
12730 """
12731 AsIs(self)
12732
12733 Sets this edge or constraint to be whatever the window's value is at
12734 the moment. If either of the width and height constraints are *as is*,
12735 the window will not be resized, but moved instead. This is important
12736 when considering panel items which are intended to have a default
12737 size, such as a button, which may take its size from the size of the
12738 button label.
12739 """
12740 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12741
12742 def GetOtherWindow(*args, **kwargs):
12743 """GetOtherWindow(self) -> Window"""
12744 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12745
12746 def GetMyEdge(*args, **kwargs):
12747 """GetMyEdge(self) -> int"""
12748 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12749
12750 def SetEdge(*args, **kwargs):
12751 """SetEdge(self, int which)"""
12752 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12753
12754 def SetValue(*args, **kwargs):
12755 """SetValue(self, int v)"""
12756 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12757
12758 def GetMargin(*args, **kwargs):
12759 """GetMargin(self) -> int"""
12760 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12761
12762 def SetMargin(*args, **kwargs):
12763 """SetMargin(self, int m)"""
12764 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12765
12766 def GetValue(*args, **kwargs):
12767 """GetValue(self) -> int"""
12768 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12769
12770 def GetPercent(*args, **kwargs):
12771 """GetPercent(self) -> int"""
12772 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12773
12774 def GetOtherEdge(*args, **kwargs):
12775 """GetOtherEdge(self) -> int"""
12776 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12777
12778 def GetDone(*args, **kwargs):
12779 """GetDone(self) -> bool"""
12780 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12781
12782 def SetDone(*args, **kwargs):
12783 """SetDone(self, bool d)"""
12784 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12785
12786 def GetRelationship(*args, **kwargs):
12787 """GetRelationship(self) -> int"""
12788 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12789
12790 def SetRelationship(*args, **kwargs):
12791 """SetRelationship(self, int r)"""
12792 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12793
12794 def ResetIfWin(*args, **kwargs):
12795 """
12796 ResetIfWin(self, Window otherW) -> bool
12797
12798 Reset constraint if it mentions otherWin
12799 """
12800 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12801
12802 def SatisfyConstraint(*args, **kwargs):
12803 """
12804 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12805
12806 Try to satisfy constraint
12807 """
12808 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12809
12810 def GetEdge(*args, **kwargs):
12811 """
12812 GetEdge(self, int which, Window thisWin, Window other) -> int
12813
12814 Get the value of this edge or dimension, or if this
12815 is not determinable, -1.
12816 """
12817 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12818
12819 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
12820
12821 class LayoutConstraints(Object):
12822 """
12823 **Note:** constraints are now deprecated and you should use sizers
12824 instead.
12825
12826 Objects of this class can be associated with a window to define its
12827 layout constraints, with respect to siblings or its parent.
12828
12829 The class consists of the following eight constraints of class
12830 wx.IndividualLayoutConstraint, some or all of which should be accessed
12831 directly to set the appropriate constraints.
12832
12833 * left: represents the left hand edge of the window
12834 * right: represents the right hand edge of the window
12835 * top: represents the top edge of the window
12836 * bottom: represents the bottom edge of the window
12837 * width: represents the width of the window
12838 * height: represents the height of the window
12839 * centreX: represents the horizontal centre point of the window
12840 * centreY: represents the vertical centre point of the window
12841
12842 Most constraints are initially set to have the relationship
12843 wxUnconstrained, which means that their values should be calculated by
12844 looking at known constraints. The exceptions are width and height,
12845 which are set to wxAsIs to ensure that if the user does not specify a
12846 constraint, the existing width and height will be used, to be
12847 compatible with panel items which often have take a default size. If
12848 the constraint is ``wx.AsIs``, the dimension will not be changed.
12849
12850 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12851
12852 """
12853 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12854 __repr__ = _swig_repr
12855 left = property(_core_.LayoutConstraints_left_get)
12856 top = property(_core_.LayoutConstraints_top_get)
12857 right = property(_core_.LayoutConstraints_right_get)
12858 bottom = property(_core_.LayoutConstraints_bottom_get)
12859 width = property(_core_.LayoutConstraints_width_get)
12860 height = property(_core_.LayoutConstraints_height_get)
12861 centreX = property(_core_.LayoutConstraints_centreX_get)
12862 centreY = property(_core_.LayoutConstraints_centreY_get)
12863 def __init__(self, *args, **kwargs):
12864 """__init__(self) -> LayoutConstraints"""
12865 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12866 __swig_destroy__ = _core_.delete_LayoutConstraints
12867 __del__ = lambda self : None;
12868 def SatisfyConstraints(*args, **kwargs):
12869 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12870 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12871
12872 def AreSatisfied(*args, **kwargs):
12873 """AreSatisfied(self) -> bool"""
12874 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12875
12876 _core_.LayoutConstraints_swigregister(LayoutConstraints)
12877
12878 #----------------------------------------------------------------------------
12879
12880 # Use Python's bool constants if available, make some if not
12881 try:
12882 True
12883 except NameError:
12884 __builtins__.True = 1==1
12885 __builtins__.False = 1==0
12886 def bool(value): return not not value
12887 __builtins__.bool = bool
12888
12889
12890
12891 # workarounds for bad wxRTTI names
12892 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12893 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12894 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12895
12896
12897 #----------------------------------------------------------------------------
12898 # Load version numbers from __version__... Ensure that major and minor
12899 # versions are the same for both wxPython and wxWidgets.
12900
12901 from __version__ import *
12902 __version__ = VERSION_STRING
12903
12904 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12905 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12906 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12907 import warnings
12908 warnings.warn("wxPython/wxWidgets release number mismatch")
12909
12910 #----------------------------------------------------------------------------
12911
12912 # Set wxPython's default string<-->unicode conversion encoding from
12913 # the locale, but only if Python's default hasn't been changed. (We
12914 # assume that if the user has customized it already then that is the
12915 # encoding we need to use as well.)
12916 #
12917 # The encoding selected here is used when string or unicode objects
12918 # need to be converted in order to pass them to wxWidgets. Please be
12919 # aware that the default encoding within the same locale may be
12920 # slightly different on different platforms. For example, please see
12921 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12922 # between the common latin/roman encodings.
12923
12924 default = _sys.getdefaultencoding()
12925 if default == 'ascii':
12926 import locale
12927 import codecs
12928 try:
12929 default = locale.getdefaultlocale()[1]
12930 codecs.lookup(default)
12931 except (ValueError, LookupError, TypeError):
12932 default = _sys.getdefaultencoding()
12933 del locale
12934 del codecs
12935 if default:
12936 wx.SetDefaultPyEncoding(default)
12937 del default
12938
12939 #----------------------------------------------------------------------------
12940
12941 class PyDeadObjectError(AttributeError):
12942 pass
12943
12944 class _wxPyDeadObject(object):
12945 """
12946 Instances of wx objects that are OOR capable will have their __class__
12947 changed to this class when the C++ object is deleted. This should help
12948 prevent crashes due to referencing a bogus C++ pointer.
12949 """
12950 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12951 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12952
12953 def __repr__(self):
12954 if not hasattr(self, "_name"):
12955 self._name = "[unknown]"
12956 return self.reprStr % self._name
12957
12958 def __getattr__(self, *args):
12959 if not hasattr(self, "_name"):
12960 self._name = "[unknown]"
12961 raise PyDeadObjectError(self.attrStr % self._name)
12962
12963 def __nonzero__(self):
12964 return 0
12965
12966
12967
12968 class PyUnbornObjectError(AttributeError):
12969 pass
12970
12971 class _wxPyUnbornObject(object):
12972 """
12973 Some stock objects are created when the wx._core module is
12974 imported, but their C++ instance is not created until the wx.App
12975 object is created and initialized. These object instances will
12976 temporarily have their __class__ changed to this class so an
12977 exception will be raised if they are used before the C++ instance
12978 is ready.
12979 """
12980
12981 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12982 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12983
12984 def __repr__(self):
12985 #if not hasattr(self, "_name"):
12986 # self._name = "[unknown]"
12987 return self.reprStr #% self._name
12988
12989 def __getattr__(self, *args):
12990 #if not hasattr(self, "_name"):
12991 # self._name = "[unknown]"
12992 raise PyUnbornObjectError(self.attrStr) # % self._name )
12993
12994 def __nonzero__(self):
12995 return 0
12996
12997
12998 #----------------------------------------------------------------------------
12999
13000 def CallAfter(callable, *args, **kw):
13001 """
13002 Call the specified function after the current and pending event
13003 handlers have been completed. This is also good for making GUI
13004 method calls from non-GUI threads. Any extra positional or
13005 keyword args are passed on to the callable when it is called.
13006
13007 :see: `wx.FutureCall`
13008 """
13009 app = wx.GetApp()
13010 assert app is not None, 'No wx.App created yet'
13011
13012 if not hasattr(app, "_CallAfterId"):
13013 app._CallAfterId = wx.NewEventType()
13014 app.Connect(-1, -1, app._CallAfterId,
13015 lambda event: event.callable(*event.args, **event.kw) )
13016 evt = wx.PyEvent()
13017 evt.SetEventType(app._CallAfterId)
13018 evt.callable = callable
13019 evt.args = args
13020 evt.kw = kw
13021 wx.PostEvent(app, evt)
13022
13023 #----------------------------------------------------------------------------
13024
13025
13026 class FutureCall:
13027 """
13028 A convenience class for `wx.Timer`, that calls the given callable
13029 object once after the given amount of milliseconds, passing any
13030 positional or keyword args. The return value of the callable is
13031 availbale after it has been run with the `GetResult` method.
13032
13033 If you don't need to get the return value or restart the timer
13034 then there is no need to hold a reference to this object. It will
13035 hold a reference to itself while the timer is running (the timer
13036 has a reference to self.Notify) but the cycle will be broken when
13037 the timer completes, automatically cleaning up the wx.FutureCall
13038 object.
13039
13040 :see: `wx.CallAfter`
13041 """
13042 def __init__(self, millis, callable, *args, **kwargs):
13043 self.millis = millis
13044 self.callable = callable
13045 self.SetArgs(*args, **kwargs)
13046 self.runCount = 0
13047 self.running = False
13048 self.hasRun = False
13049 self.result = None
13050 self.timer = None
13051 self.Start()
13052
13053 def __del__(self):
13054 self.Stop()
13055
13056
13057 def Start(self, millis=None, *args, **kwargs):
13058 """
13059 (Re)start the timer
13060 """
13061 self.hasRun = False
13062 if millis is not None:
13063 self.millis = millis
13064 if args or kwargs:
13065 self.SetArgs(*args, **kwargs)
13066 self.Stop()
13067 self.timer = wx.PyTimer(self.Notify)
13068 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13069 self.running = True
13070 Restart = Start
13071
13072
13073 def Stop(self):
13074 """
13075 Stop and destroy the timer.
13076 """
13077 if self.timer is not None:
13078 self.timer.Stop()
13079 self.timer = None
13080
13081
13082 def GetInterval(self):
13083 if self.timer is not None:
13084 return self.timer.GetInterval()
13085 else:
13086 return 0
13087
13088
13089 def IsRunning(self):
13090 return self.timer is not None and self.timer.IsRunning()
13091
13092
13093 def SetArgs(self, *args, **kwargs):
13094 """
13095 (Re)set the args passed to the callable object. This is
13096 useful in conjunction with Restart if you want to schedule a
13097 new call to the same callable object but with different
13098 parameters.
13099 """
13100 self.args = args
13101 self.kwargs = kwargs
13102
13103
13104 def HasRun(self):
13105 return self.hasRun
13106
13107 def GetResult(self):
13108 return self.result
13109
13110 def Notify(self):
13111 """
13112 The timer has expired so call the callable.
13113 """
13114 if self.callable and getattr(self.callable, 'im_self', True):
13115 self.runCount += 1
13116 self.running = False
13117 self.result = self.callable(*self.args, **self.kwargs)
13118 self.hasRun = True
13119 if not self.running:
13120 # if it wasn't restarted, then cleanup
13121 wx.CallAfter(self.Stop)
13122
13123
13124
13125 #----------------------------------------------------------------------------
13126 # Control which items in this module should be documented by epydoc.
13127 # We allow only classes and functions, which will help reduce the size
13128 # of the docs by filtering out the zillions of constants, EVT objects,
13129 # and etc that don't make much sense by themselves, but are instead
13130 # documented (or will be) as part of the classes/functions/methods
13131 # where they should be used.
13132
13133 class __DocFilter:
13134 """
13135 A filter for epydoc that only allows non-Ptr classes and
13136 functions, in order to reduce the clutter in the API docs.
13137 """
13138 def __init__(self, globals):
13139 self._globals = globals
13140
13141 def __call__(self, name):
13142 import types
13143 obj = self._globals.get(name, None)
13144
13145 # only document classes and function
13146 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13147 return False
13148
13149 # skip other things that are private or will be documented as part of somethign else
13150 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
13151 return False
13152
13153 # skip functions that are duplicates of static functions in a class
13154 if name.find('_') != -1:
13155 cls = self._globals.get(name.split('_')[0], None)
13156 methname = name.split('_')[1]
13157 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13158 return False
13159
13160 return True
13161
13162 #----------------------------------------------------------------------------
13163 #----------------------------------------------------------------------------
13164
13165 # Import other modules in this package that should show up in the
13166 # "core" wx namespace
13167 from _gdi import *
13168 from _windows import *
13169 from _controls import *
13170 from _misc import *
13171
13172 #----------------------------------------------------------------------------
13173 #----------------------------------------------------------------------------
13174
13175
13176