]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
dd3e8c99fdbb2f877997a97f99bef591702f4125
[wxWidgets.git] / wxPython / src / mac / _core.py
1 # This file was created automatically by SWIG.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _core_
5
6 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
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) or (name == "thisown"):
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 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28 import types
29 try:
30 _object = types.ObjectType
31 _newclass = 1
32 except AttributeError:
33 class _object : pass
34 _newclass = 0
35 del types
36
37
38 def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
47 #// Give a reference to the dictionary of this module to the C++ extension
48 #// code.
49 _core_._wxPySetDictionary(vars())
50
51 #// A little trick to make 'wx' be a reference to this module so wx.Names can
52 #// be used here.
53 import sys as _sys
54 wx = _sys.modules[__name__]
55
56
57 #----------------------------------------------------------------------------
58
59 def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74 #----------------------------------------------------------------------------
75
76 NOT_FOUND = _core_.NOT_FOUND
77 VSCROLL = _core_.VSCROLL
78 HSCROLL = _core_.HSCROLL
79 CAPTION = _core_.CAPTION
80 DOUBLE_BORDER = _core_.DOUBLE_BORDER
81 SUNKEN_BORDER = _core_.SUNKEN_BORDER
82 RAISED_BORDER = _core_.RAISED_BORDER
83 BORDER = _core_.BORDER
84 SIMPLE_BORDER = _core_.SIMPLE_BORDER
85 STATIC_BORDER = _core_.STATIC_BORDER
86 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87 NO_BORDER = _core_.NO_BORDER
88 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
89 DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
90 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
91 WANTS_CHARS = _core_.WANTS_CHARS
92 POPUP_WINDOW = _core_.POPUP_WINDOW
93 CENTER_FRAME = _core_.CENTER_FRAME
94 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
95 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
96 CLIP_CHILDREN = _core_.CLIP_CHILDREN
97 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
98 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
99 RETAINED = _core_.RETAINED
100 BACKINGSTORE = _core_.BACKINGSTORE
101 COLOURED = _core_.COLOURED
102 FIXED_LENGTH = _core_.FIXED_LENGTH
103 LB_NEEDED_SB = _core_.LB_NEEDED_SB
104 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
105 LB_SORT = _core_.LB_SORT
106 LB_SINGLE = _core_.LB_SINGLE
107 LB_MULTIPLE = _core_.LB_MULTIPLE
108 LB_EXTENDED = _core_.LB_EXTENDED
109 LB_OWNERDRAW = _core_.LB_OWNERDRAW
110 LB_HSCROLL = _core_.LB_HSCROLL
111 PROCESS_ENTER = _core_.PROCESS_ENTER
112 PASSWORD = _core_.PASSWORD
113 CB_SIMPLE = _core_.CB_SIMPLE
114 CB_DROPDOWN = _core_.CB_DROPDOWN
115 CB_SORT = _core_.CB_SORT
116 CB_READONLY = _core_.CB_READONLY
117 RA_HORIZONTAL = _core_.RA_HORIZONTAL
118 RA_VERTICAL = _core_.RA_VERTICAL
119 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
120 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
121 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
122 RB_GROUP = _core_.RB_GROUP
123 RB_SINGLE = _core_.RB_SINGLE
124 SB_HORIZONTAL = _core_.SB_HORIZONTAL
125 SB_VERTICAL = _core_.SB_VERTICAL
126 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
127 ST_SIZEGRIP = _core_.ST_SIZEGRIP
128 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
129 FLOOD_SURFACE = _core_.FLOOD_SURFACE
130 FLOOD_BORDER = _core_.FLOOD_BORDER
131 ODDEVEN_RULE = _core_.ODDEVEN_RULE
132 WINDING_RULE = _core_.WINDING_RULE
133 TOOL_TOP = _core_.TOOL_TOP
134 TOOL_BOTTOM = _core_.TOOL_BOTTOM
135 TOOL_LEFT = _core_.TOOL_LEFT
136 TOOL_RIGHT = _core_.TOOL_RIGHT
137 OK = _core_.OK
138 YES_NO = _core_.YES_NO
139 CANCEL = _core_.CANCEL
140 YES = _core_.YES
141 NO = _core_.NO
142 NO_DEFAULT = _core_.NO_DEFAULT
143 YES_DEFAULT = _core_.YES_DEFAULT
144 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
145 ICON_HAND = _core_.ICON_HAND
146 ICON_QUESTION = _core_.ICON_QUESTION
147 ICON_INFORMATION = _core_.ICON_INFORMATION
148 ICON_STOP = _core_.ICON_STOP
149 ICON_ASTERISK = _core_.ICON_ASTERISK
150 ICON_MASK = _core_.ICON_MASK
151 ICON_WARNING = _core_.ICON_WARNING
152 ICON_ERROR = _core_.ICON_ERROR
153 FORWARD = _core_.FORWARD
154 BACKWARD = _core_.BACKWARD
155 RESET = _core_.RESET
156 HELP = _core_.HELP
157 MORE = _core_.MORE
158 SETUP = _core_.SETUP
159 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
160 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
161 SIZE_AUTO = _core_.SIZE_AUTO
162 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
163 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
164 PORTRAIT = _core_.PORTRAIT
165 LANDSCAPE = _core_.LANDSCAPE
166 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
167 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
168 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
169 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
170 ID_ANY = _core_.ID_ANY
171 ID_SEPARATOR = _core_.ID_SEPARATOR
172 ID_LOWEST = _core_.ID_LOWEST
173 ID_OPEN = _core_.ID_OPEN
174 ID_CLOSE = _core_.ID_CLOSE
175 ID_NEW = _core_.ID_NEW
176 ID_SAVE = _core_.ID_SAVE
177 ID_SAVEAS = _core_.ID_SAVEAS
178 ID_REVERT = _core_.ID_REVERT
179 ID_EXIT = _core_.ID_EXIT
180 ID_UNDO = _core_.ID_UNDO
181 ID_REDO = _core_.ID_REDO
182 ID_HELP = _core_.ID_HELP
183 ID_PRINT = _core_.ID_PRINT
184 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
185 ID_PREVIEW = _core_.ID_PREVIEW
186 ID_ABOUT = _core_.ID_ABOUT
187 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
188 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
189 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
190 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
191 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
192 ID_PREFERENCES = _core_.ID_PREFERENCES
193 ID_CUT = _core_.ID_CUT
194 ID_COPY = _core_.ID_COPY
195 ID_PASTE = _core_.ID_PASTE
196 ID_CLEAR = _core_.ID_CLEAR
197 ID_FIND = _core_.ID_FIND
198 ID_DUPLICATE = _core_.ID_DUPLICATE
199 ID_SELECTALL = _core_.ID_SELECTALL
200 ID_DELETE = _core_.ID_DELETE
201 ID_REPLACE = _core_.ID_REPLACE
202 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
203 ID_PROPERTIES = _core_.ID_PROPERTIES
204 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
205 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
206 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
207 ID_VIEW_LIST = _core_.ID_VIEW_LIST
208 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
209 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
210 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
211 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
212 ID_FILE1 = _core_.ID_FILE1
213 ID_FILE2 = _core_.ID_FILE2
214 ID_FILE3 = _core_.ID_FILE3
215 ID_FILE4 = _core_.ID_FILE4
216 ID_FILE5 = _core_.ID_FILE5
217 ID_FILE6 = _core_.ID_FILE6
218 ID_FILE7 = _core_.ID_FILE7
219 ID_FILE8 = _core_.ID_FILE8
220 ID_FILE9 = _core_.ID_FILE9
221 ID_OK = _core_.ID_OK
222 ID_CANCEL = _core_.ID_CANCEL
223 ID_APPLY = _core_.ID_APPLY
224 ID_YES = _core_.ID_YES
225 ID_NO = _core_.ID_NO
226 ID_STATIC = _core_.ID_STATIC
227 ID_FORWARD = _core_.ID_FORWARD
228 ID_BACKWARD = _core_.ID_BACKWARD
229 ID_DEFAULT = _core_.ID_DEFAULT
230 ID_MORE = _core_.ID_MORE
231 ID_SETUP = _core_.ID_SETUP
232 ID_RESET = _core_.ID_RESET
233 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
234 ID_YESTOALL = _core_.ID_YESTOALL
235 ID_NOTOALL = _core_.ID_NOTOALL
236 ID_ABORT = _core_.ID_ABORT
237 ID_RETRY = _core_.ID_RETRY
238 ID_IGNORE = _core_.ID_IGNORE
239 ID_ADD = _core_.ID_ADD
240 ID_REMOVE = _core_.ID_REMOVE
241 ID_UP = _core_.ID_UP
242 ID_DOWN = _core_.ID_DOWN
243 ID_HOME = _core_.ID_HOME
244 ID_REFRESH = _core_.ID_REFRESH
245 ID_STOP = _core_.ID_STOP
246 ID_INDEX = _core_.ID_INDEX
247 ID_BOLD = _core_.ID_BOLD
248 ID_ITALIC = _core_.ID_ITALIC
249 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
250 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
251 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
252 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
253 ID_UNDERLINE = _core_.ID_UNDERLINE
254 ID_INDENT = _core_.ID_INDENT
255 ID_UNINDENT = _core_.ID_UNINDENT
256 ID_ZOOM_100 = _core_.ID_ZOOM_100
257 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
258 ID_ZOOM_IN = _core_.ID_ZOOM_IN
259 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
260 ID_UNDELETE = _core_.ID_UNDELETE
261 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
262 ID_HIGHEST = _core_.ID_HIGHEST
263 OPEN = _core_.OPEN
264 SAVE = _core_.SAVE
265 HIDE_READONLY = _core_.HIDE_READONLY
266 OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
267 FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
268 MULTIPLE = _core_.MULTIPLE
269 CHANGE_DIR = _core_.CHANGE_DIR
270 ACCEL_ALT = _core_.ACCEL_ALT
271 ACCEL_CTRL = _core_.ACCEL_CTRL
272 ACCEL_SHIFT = _core_.ACCEL_SHIFT
273 ACCEL_NORMAL = _core_.ACCEL_NORMAL
274 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
275 PD_APP_MODAL = _core_.PD_APP_MODAL
276 PD_CAN_ABORT = _core_.PD_CAN_ABORT
277 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
278 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
279 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
280 PD_SMOOTH = _core_.PD_SMOOTH
281 PD_CAN_SKIP = _core_.PD_CAN_SKIP
282 DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
283 DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
284 MENU_TEAROFF = _core_.MENU_TEAROFF
285 MB_DOCKABLE = _core_.MB_DOCKABLE
286 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
287 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
288 LI_HORIZONTAL = _core_.LI_HORIZONTAL
289 LI_VERTICAL = _core_.LI_VERTICAL
290 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
291 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
292 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
293 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
294 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
295 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
296 MM_TEXT = _core_.MM_TEXT
297 MM_LOMETRIC = _core_.MM_LOMETRIC
298 MM_HIMETRIC = _core_.MM_HIMETRIC
299 MM_LOENGLISH = _core_.MM_LOENGLISH
300 MM_HIENGLISH = _core_.MM_HIENGLISH
301 MM_TWIPS = _core_.MM_TWIPS
302 MM_ISOTROPIC = _core_.MM_ISOTROPIC
303 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
304 MM_POINTS = _core_.MM_POINTS
305 MM_METRIC = _core_.MM_METRIC
306 CENTRE = _core_.CENTRE
307 CENTER = _core_.CENTER
308 HORIZONTAL = _core_.HORIZONTAL
309 VERTICAL = _core_.VERTICAL
310 BOTH = _core_.BOTH
311 LEFT = _core_.LEFT
312 RIGHT = _core_.RIGHT
313 UP = _core_.UP
314 DOWN = _core_.DOWN
315 TOP = _core_.TOP
316 BOTTOM = _core_.BOTTOM
317 NORTH = _core_.NORTH
318 SOUTH = _core_.SOUTH
319 WEST = _core_.WEST
320 EAST = _core_.EAST
321 ALL = _core_.ALL
322 ALIGN_NOT = _core_.ALIGN_NOT
323 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
324 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
325 ALIGN_LEFT = _core_.ALIGN_LEFT
326 ALIGN_TOP = _core_.ALIGN_TOP
327 ALIGN_RIGHT = _core_.ALIGN_RIGHT
328 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
329 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
330 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
331 ALIGN_CENTER = _core_.ALIGN_CENTER
332 ALIGN_CENTRE = _core_.ALIGN_CENTRE
333 ALIGN_MASK = _core_.ALIGN_MASK
334 STRETCH_NOT = _core_.STRETCH_NOT
335 SHRINK = _core_.SHRINK
336 GROW = _core_.GROW
337 EXPAND = _core_.EXPAND
338 SHAPED = _core_.SHAPED
339 FIXED_MINSIZE = _core_.FIXED_MINSIZE
340 TILE = _core_.TILE
341 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
342 BORDER_DEFAULT = _core_.BORDER_DEFAULT
343 BORDER_NONE = _core_.BORDER_NONE
344 BORDER_STATIC = _core_.BORDER_STATIC
345 BORDER_SIMPLE = _core_.BORDER_SIMPLE
346 BORDER_RAISED = _core_.BORDER_RAISED
347 BORDER_SUNKEN = _core_.BORDER_SUNKEN
348 BORDER_DOUBLE = _core_.BORDER_DOUBLE
349 BORDER_MASK = _core_.BORDER_MASK
350 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
351 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
352 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
353 DEFAULT = _core_.DEFAULT
354 DECORATIVE = _core_.DECORATIVE
355 ROMAN = _core_.ROMAN
356 SCRIPT = _core_.SCRIPT
357 SWISS = _core_.SWISS
358 MODERN = _core_.MODERN
359 TELETYPE = _core_.TELETYPE
360 VARIABLE = _core_.VARIABLE
361 FIXED = _core_.FIXED
362 NORMAL = _core_.NORMAL
363 LIGHT = _core_.LIGHT
364 BOLD = _core_.BOLD
365 ITALIC = _core_.ITALIC
366 SLANT = _core_.SLANT
367 SOLID = _core_.SOLID
368 DOT = _core_.DOT
369 LONG_DASH = _core_.LONG_DASH
370 SHORT_DASH = _core_.SHORT_DASH
371 DOT_DASH = _core_.DOT_DASH
372 USER_DASH = _core_.USER_DASH
373 TRANSPARENT = _core_.TRANSPARENT
374 STIPPLE = _core_.STIPPLE
375 STIPPLE_MASK = _core_.STIPPLE_MASK
376 STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
377 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
378 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
379 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
380 CROSS_HATCH = _core_.CROSS_HATCH
381 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
382 VERTICAL_HATCH = _core_.VERTICAL_HATCH
383 JOIN_BEVEL = _core_.JOIN_BEVEL
384 JOIN_MITER = _core_.JOIN_MITER
385 JOIN_ROUND = _core_.JOIN_ROUND
386 CAP_ROUND = _core_.CAP_ROUND
387 CAP_PROJECTING = _core_.CAP_PROJECTING
388 CAP_BUTT = _core_.CAP_BUTT
389 CLEAR = _core_.CLEAR
390 XOR = _core_.XOR
391 INVERT = _core_.INVERT
392 OR_REVERSE = _core_.OR_REVERSE
393 AND_REVERSE = _core_.AND_REVERSE
394 COPY = _core_.COPY
395 AND = _core_.AND
396 AND_INVERT = _core_.AND_INVERT
397 NO_OP = _core_.NO_OP
398 NOR = _core_.NOR
399 EQUIV = _core_.EQUIV
400 SRC_INVERT = _core_.SRC_INVERT
401 OR_INVERT = _core_.OR_INVERT
402 NAND = _core_.NAND
403 OR = _core_.OR
404 SET = _core_.SET
405 WXK_BACK = _core_.WXK_BACK
406 WXK_TAB = _core_.WXK_TAB
407 WXK_RETURN = _core_.WXK_RETURN
408 WXK_ESCAPE = _core_.WXK_ESCAPE
409 WXK_SPACE = _core_.WXK_SPACE
410 WXK_DELETE = _core_.WXK_DELETE
411 WXK_START = _core_.WXK_START
412 WXK_LBUTTON = _core_.WXK_LBUTTON
413 WXK_RBUTTON = _core_.WXK_RBUTTON
414 WXK_CANCEL = _core_.WXK_CANCEL
415 WXK_MBUTTON = _core_.WXK_MBUTTON
416 WXK_CLEAR = _core_.WXK_CLEAR
417 WXK_SHIFT = _core_.WXK_SHIFT
418 WXK_ALT = _core_.WXK_ALT
419 WXK_CONTROL = _core_.WXK_CONTROL
420 WXK_MENU = _core_.WXK_MENU
421 WXK_PAUSE = _core_.WXK_PAUSE
422 WXK_CAPITAL = _core_.WXK_CAPITAL
423 WXK_PRIOR = _core_.WXK_PRIOR
424 WXK_NEXT = _core_.WXK_NEXT
425 WXK_END = _core_.WXK_END
426 WXK_HOME = _core_.WXK_HOME
427 WXK_LEFT = _core_.WXK_LEFT
428 WXK_UP = _core_.WXK_UP
429 WXK_RIGHT = _core_.WXK_RIGHT
430 WXK_DOWN = _core_.WXK_DOWN
431 WXK_SELECT = _core_.WXK_SELECT
432 WXK_PRINT = _core_.WXK_PRINT
433 WXK_EXECUTE = _core_.WXK_EXECUTE
434 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
435 WXK_INSERT = _core_.WXK_INSERT
436 WXK_HELP = _core_.WXK_HELP
437 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
438 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
439 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
440 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
441 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
442 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
443 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
444 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
445 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
446 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
447 WXK_MULTIPLY = _core_.WXK_MULTIPLY
448 WXK_ADD = _core_.WXK_ADD
449 WXK_SEPARATOR = _core_.WXK_SEPARATOR
450 WXK_SUBTRACT = _core_.WXK_SUBTRACT
451 WXK_DECIMAL = _core_.WXK_DECIMAL
452 WXK_DIVIDE = _core_.WXK_DIVIDE
453 WXK_F1 = _core_.WXK_F1
454 WXK_F2 = _core_.WXK_F2
455 WXK_F3 = _core_.WXK_F3
456 WXK_F4 = _core_.WXK_F4
457 WXK_F5 = _core_.WXK_F5
458 WXK_F6 = _core_.WXK_F6
459 WXK_F7 = _core_.WXK_F7
460 WXK_F8 = _core_.WXK_F8
461 WXK_F9 = _core_.WXK_F9
462 WXK_F10 = _core_.WXK_F10
463 WXK_F11 = _core_.WXK_F11
464 WXK_F12 = _core_.WXK_F12
465 WXK_F13 = _core_.WXK_F13
466 WXK_F14 = _core_.WXK_F14
467 WXK_F15 = _core_.WXK_F15
468 WXK_F16 = _core_.WXK_F16
469 WXK_F17 = _core_.WXK_F17
470 WXK_F18 = _core_.WXK_F18
471 WXK_F19 = _core_.WXK_F19
472 WXK_F20 = _core_.WXK_F20
473 WXK_F21 = _core_.WXK_F21
474 WXK_F22 = _core_.WXK_F22
475 WXK_F23 = _core_.WXK_F23
476 WXK_F24 = _core_.WXK_F24
477 WXK_NUMLOCK = _core_.WXK_NUMLOCK
478 WXK_SCROLL = _core_.WXK_SCROLL
479 WXK_PAGEUP = _core_.WXK_PAGEUP
480 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
481 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
482 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
483 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
484 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
485 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
486 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
487 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
488 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
489 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
490 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
491 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
492 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
493 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
494 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
495 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
496 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
497 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
498 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
499 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
500 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
501 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
502 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
503 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
504 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
505 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
506 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
507 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
508 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
509 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
510 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
511 WXK_COMMAND = _core_.WXK_COMMAND
512 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
513 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
514 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
515 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
516 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
517 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
518 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
519 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
520 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
521 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
522 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
523 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
524 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
525 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
526 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
527 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
528 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
529 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
530 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
531 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
532 PAPER_NONE = _core_.PAPER_NONE
533 PAPER_LETTER = _core_.PAPER_LETTER
534 PAPER_LEGAL = _core_.PAPER_LEGAL
535 PAPER_A4 = _core_.PAPER_A4
536 PAPER_CSHEET = _core_.PAPER_CSHEET
537 PAPER_DSHEET = _core_.PAPER_DSHEET
538 PAPER_ESHEET = _core_.PAPER_ESHEET
539 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
540 PAPER_TABLOID = _core_.PAPER_TABLOID
541 PAPER_LEDGER = _core_.PAPER_LEDGER
542 PAPER_STATEMENT = _core_.PAPER_STATEMENT
543 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
544 PAPER_A3 = _core_.PAPER_A3
545 PAPER_A4SMALL = _core_.PAPER_A4SMALL
546 PAPER_A5 = _core_.PAPER_A5
547 PAPER_B4 = _core_.PAPER_B4
548 PAPER_B5 = _core_.PAPER_B5
549 PAPER_FOLIO = _core_.PAPER_FOLIO
550 PAPER_QUARTO = _core_.PAPER_QUARTO
551 PAPER_10X14 = _core_.PAPER_10X14
552 PAPER_11X17 = _core_.PAPER_11X17
553 PAPER_NOTE = _core_.PAPER_NOTE
554 PAPER_ENV_9 = _core_.PAPER_ENV_9
555 PAPER_ENV_10 = _core_.PAPER_ENV_10
556 PAPER_ENV_11 = _core_.PAPER_ENV_11
557 PAPER_ENV_12 = _core_.PAPER_ENV_12
558 PAPER_ENV_14 = _core_.PAPER_ENV_14
559 PAPER_ENV_DL = _core_.PAPER_ENV_DL
560 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
561 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
562 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
563 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
564 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
565 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
566 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
567 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
568 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
569 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
570 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
571 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
572 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
573 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
574 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
575 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
576 PAPER_9X11 = _core_.PAPER_9X11
577 PAPER_10X11 = _core_.PAPER_10X11
578 PAPER_15X11 = _core_.PAPER_15X11
579 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
580 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
581 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
582 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
583 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
584 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
585 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
586 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
587 PAPER_A_PLUS = _core_.PAPER_A_PLUS
588 PAPER_B_PLUS = _core_.PAPER_B_PLUS
589 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
590 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
591 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
592 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
593 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
594 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
595 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
596 PAPER_A2 = _core_.PAPER_A2
597 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
598 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
599 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
600 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
601 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
602 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
603 ITEM_NORMAL = _core_.ITEM_NORMAL
604 ITEM_CHECK = _core_.ITEM_CHECK
605 ITEM_RADIO = _core_.ITEM_RADIO
606 ITEM_MAX = _core_.ITEM_MAX
607 HT_NOWHERE = _core_.HT_NOWHERE
608 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
609 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
610 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
611 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
612 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
613 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
614 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
615 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
616 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
617 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
618 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
619 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
620 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
621 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
622 HT_MAX = _core_.HT_MAX
623 MOD_NONE = _core_.MOD_NONE
624 MOD_ALT = _core_.MOD_ALT
625 MOD_CONTROL = _core_.MOD_CONTROL
626 MOD_SHIFT = _core_.MOD_SHIFT
627 MOD_WIN = _core_.MOD_WIN
628 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
629 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
630 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
631 #---------------------------------------------------------------------------
632
633 class Object(object):
634 """
635 The base class for most wx objects, although in wxPython not
636 much functionality is needed nor exposed.
637 """
638 def __init__(self): raise RuntimeError, "No constructor defined"
639 def __repr__(self):
640 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
641 def GetClassName(*args, **kwargs):
642 """
643 GetClassName(self) -> String
644
645 Returns the class name of the C++ class using wxRTTI.
646 """
647 return _core_.Object_GetClassName(*args, **kwargs)
648
649 def Destroy(*args, **kwargs):
650 """
651 Destroy(self)
652
653 Deletes the C++ object this Python object is a proxy for.
654 """
655 return _core_.Object_Destroy(*args, **kwargs)
656
657
658 class ObjectPtr(Object):
659 def __init__(self, this):
660 self.this = this
661 if not hasattr(self,"thisown"): self.thisown = 0
662 self.__class__ = Object
663 _core_.Object_swigregister(ObjectPtr)
664 _wxPySetDictionary = _core_._wxPySetDictionary
665
666 _wxPyFixStockObjects = _core_._wxPyFixStockObjects
667
668 cvar = _core_.cvar
669 EmptyString = cvar.EmptyString
670
671 #---------------------------------------------------------------------------
672
673 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
674 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
675 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
676 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
677 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
678 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
679 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
680 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
681 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
682 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
683 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
684 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
685 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
686 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
687 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
688 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
689 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
690 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
691 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
692 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
693 CURSOR_NONE = _core_.CURSOR_NONE
694 CURSOR_ARROW = _core_.CURSOR_ARROW
695 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
696 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
697 CURSOR_CHAR = _core_.CURSOR_CHAR
698 CURSOR_CROSS = _core_.CURSOR_CROSS
699 CURSOR_HAND = _core_.CURSOR_HAND
700 CURSOR_IBEAM = _core_.CURSOR_IBEAM
701 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
702 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
703 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
704 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
705 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
706 CURSOR_PENCIL = _core_.CURSOR_PENCIL
707 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
708 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
709 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
710 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
711 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
712 CURSOR_SIZENS = _core_.CURSOR_SIZENS
713 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
714 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
715 CURSOR_SIZING = _core_.CURSOR_SIZING
716 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
717 CURSOR_WAIT = _core_.CURSOR_WAIT
718 CURSOR_WATCH = _core_.CURSOR_WATCH
719 CURSOR_BLANK = _core_.CURSOR_BLANK
720 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
721 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
722 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
723 CURSOR_MAX = _core_.CURSOR_MAX
724 #---------------------------------------------------------------------------
725
726 class Size(object):
727 """
728 wx.Size is a useful data structure used to represent the size of
729 something. It simply contians integer width and height
730 proprtites. In most places in wxPython where a wx.Size is
731 expected a (width, height) tuple can be used instead.
732 """
733 def __repr__(self):
734 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
735 width = property(_core_.Size_width_get, _core_.Size_width_set)
736 height = property(_core_.Size_height_get, _core_.Size_height_set)
737 x = width; y = height
738 def __init__(self, *args, **kwargs):
739 """
740 __init__(self, int w=0, int h=0) -> Size
741
742 Creates a size object.
743 """
744 newobj = _core_.new_Size(*args, **kwargs)
745 self.this = newobj.this
746 self.thisown = 1
747 del newobj.thisown
748 def __del__(self, destroy=_core_.delete_Size):
749 """__del__(self)"""
750 try:
751 if self.thisown: destroy(self)
752 except: pass
753
754 def __eq__(*args, **kwargs):
755 """
756 __eq__(self, Size sz) -> bool
757
758 Test for equality of wx.Size objects.
759 """
760 return _core_.Size___eq__(*args, **kwargs)
761
762 def __ne__(*args, **kwargs):
763 """
764 __ne__(self, Size sz) -> bool
765
766 Test for inequality.
767 """
768 return _core_.Size___ne__(*args, **kwargs)
769
770 def __add__(*args, **kwargs):
771 """
772 __add__(self, Size sz) -> Size
773
774 Add sz's proprties to this and return the result.
775 """
776 return _core_.Size___add__(*args, **kwargs)
777
778 def __sub__(*args, **kwargs):
779 """
780 __sub__(self, Size sz) -> Size
781
782 Subtract sz's properties from this and return the result.
783 """
784 return _core_.Size___sub__(*args, **kwargs)
785
786 def IncTo(*args, **kwargs):
787 """
788 IncTo(self, Size sz)
789
790 Increments this object so that both of its dimensions are not less
791 than the corresponding dimensions of the size.
792 """
793 return _core_.Size_IncTo(*args, **kwargs)
794
795 def DecTo(*args, **kwargs):
796 """
797 DecTo(self, Size sz)
798
799 Decrements this object so that both of its dimensions are not greater
800 than the corresponding dimensions of the size.
801 """
802 return _core_.Size_DecTo(*args, **kwargs)
803
804 def Set(*args, **kwargs):
805 """
806 Set(self, int w, int h)
807
808 Set both width and height.
809 """
810 return _core_.Size_Set(*args, **kwargs)
811
812 def SetWidth(*args, **kwargs):
813 """SetWidth(self, int w)"""
814 return _core_.Size_SetWidth(*args, **kwargs)
815
816 def SetHeight(*args, **kwargs):
817 """SetHeight(self, int h)"""
818 return _core_.Size_SetHeight(*args, **kwargs)
819
820 def GetWidth(*args, **kwargs):
821 """GetWidth(self) -> int"""
822 return _core_.Size_GetWidth(*args, **kwargs)
823
824 def GetHeight(*args, **kwargs):
825 """GetHeight(self) -> int"""
826 return _core_.Size_GetHeight(*args, **kwargs)
827
828 def IsFullySpecified(*args, **kwargs):
829 """
830 IsFullySpecified(self) -> bool
831
832 Returns True if both components of the size are non-default values.
833 """
834 return _core_.Size_IsFullySpecified(*args, **kwargs)
835
836 def SetDefaults(*args, **kwargs):
837 """
838 SetDefaults(self, Size size)
839
840 Combine this size with the other one replacing the default components
841 of this object (i.e. equal to -1) with those of the other.
842 """
843 return _core_.Size_SetDefaults(*args, **kwargs)
844
845 def Get(*args, **kwargs):
846 """
847 Get() -> (width,height)
848
849 Returns the width and height properties as a tuple.
850 """
851 return _core_.Size_Get(*args, **kwargs)
852
853 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
854 def __str__(self): return str(self.Get())
855 def __repr__(self): return 'wx.Size'+str(self.Get())
856 def __len__(self): return len(self.Get())
857 def __getitem__(self, index): return self.Get()[index]
858 def __setitem__(self, index, val):
859 if index == 0: self.width = val
860 elif index == 1: self.height = val
861 else: raise IndexError
862 def __nonzero__(self): return self.Get() != (0,0)
863 __safe_for_unpickling__ = True
864 def __reduce__(self): return (wx.Size, self.Get())
865
866
867 class SizePtr(Size):
868 def __init__(self, this):
869 self.this = this
870 if not hasattr(self,"thisown"): self.thisown = 0
871 self.__class__ = Size
872 _core_.Size_swigregister(SizePtr)
873
874 #---------------------------------------------------------------------------
875
876 class RealPoint(object):
877 """
878 A data structure for representing a point or position with floating
879 point x and y properties. In wxPython most places that expect a
880 wx.RealPoint can also accept a (x,y) tuple.
881 """
882 def __repr__(self):
883 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
884 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
885 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
886 def __init__(self, *args, **kwargs):
887 """
888 __init__(self, double x=0.0, double y=0.0) -> RealPoint
889
890 Create a wx.RealPoint object
891 """
892 newobj = _core_.new_RealPoint(*args, **kwargs)
893 self.this = newobj.this
894 self.thisown = 1
895 del newobj.thisown
896 def __del__(self, destroy=_core_.delete_RealPoint):
897 """__del__(self)"""
898 try:
899 if self.thisown: destroy(self)
900 except: pass
901
902 def __eq__(*args, **kwargs):
903 """
904 __eq__(self, RealPoint pt) -> bool
905
906 Test for equality of wx.RealPoint objects.
907 """
908 return _core_.RealPoint___eq__(*args, **kwargs)
909
910 def __ne__(*args, **kwargs):
911 """
912 __ne__(self, RealPoint pt) -> bool
913
914 Test for inequality of wx.RealPoint objects.
915 """
916 return _core_.RealPoint___ne__(*args, **kwargs)
917
918 def __add__(*args, **kwargs):
919 """
920 __add__(self, RealPoint pt) -> RealPoint
921
922 Add pt's proprties to this and return the result.
923 """
924 return _core_.RealPoint___add__(*args, **kwargs)
925
926 def __sub__(*args, **kwargs):
927 """
928 __sub__(self, RealPoint pt) -> RealPoint
929
930 Subtract pt's proprties from this and return the result
931 """
932 return _core_.RealPoint___sub__(*args, **kwargs)
933
934 def Set(*args, **kwargs):
935 """
936 Set(self, double x, double y)
937
938 Set both the x and y properties
939 """
940 return _core_.RealPoint_Set(*args, **kwargs)
941
942 def Get(*args, **kwargs):
943 """
944 Get() -> (x,y)
945
946 Return the x and y properties as a tuple.
947 """
948 return _core_.RealPoint_Get(*args, **kwargs)
949
950 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
951 def __str__(self): return str(self.Get())
952 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
953 def __len__(self): return len(self.Get())
954 def __getitem__(self, index): return self.Get()[index]
955 def __setitem__(self, index, val):
956 if index == 0: self.x = val
957 elif index == 1: self.y = val
958 else: raise IndexError
959 def __nonzero__(self): return self.Get() != (0.0, 0.0)
960 __safe_for_unpickling__ = True
961 def __reduce__(self): return (wx.RealPoint, self.Get())
962
963
964 class RealPointPtr(RealPoint):
965 def __init__(self, this):
966 self.this = this
967 if not hasattr(self,"thisown"): self.thisown = 0
968 self.__class__ = RealPoint
969 _core_.RealPoint_swigregister(RealPointPtr)
970
971 #---------------------------------------------------------------------------
972
973 class Point(object):
974 """
975 A data structure for representing a point or position with integer x
976 and y properties. Most places in wxPython that expect a wx.Point can
977 also accept a (x,y) tuple.
978 """
979 def __repr__(self):
980 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
981 x = property(_core_.Point_x_get, _core_.Point_x_set)
982 y = property(_core_.Point_y_get, _core_.Point_y_set)
983 def __init__(self, *args, **kwargs):
984 """
985 __init__(self, int x=0, int y=0) -> Point
986
987 Create a wx.Point object
988 """
989 newobj = _core_.new_Point(*args, **kwargs)
990 self.this = newobj.this
991 self.thisown = 1
992 del newobj.thisown
993 def __del__(self, destroy=_core_.delete_Point):
994 """__del__(self)"""
995 try:
996 if self.thisown: destroy(self)
997 except: pass
998
999 def __eq__(*args, **kwargs):
1000 """
1001 __eq__(self, Point pt) -> bool
1002
1003 Test for equality of wx.Point objects.
1004 """
1005 return _core_.Point___eq__(*args, **kwargs)
1006
1007 def __ne__(*args, **kwargs):
1008 """
1009 __ne__(self, Point pt) -> bool
1010
1011 Test for inequality of wx.Point objects.
1012 """
1013 return _core_.Point___ne__(*args, **kwargs)
1014
1015 def __add__(*args, **kwargs):
1016 """
1017 __add__(self, Point pt) -> Point
1018
1019 Add pt's proprties to this and return the result.
1020 """
1021 return _core_.Point___add__(*args, **kwargs)
1022
1023 def __sub__(*args, **kwargs):
1024 """
1025 __sub__(self, Point pt) -> Point
1026
1027 Subtract pt's proprties from this and return the result
1028 """
1029 return _core_.Point___sub__(*args, **kwargs)
1030
1031 def __iadd__(*args, **kwargs):
1032 """
1033 __iadd__(self, Point pt) -> Point
1034
1035 Add pt to this object.
1036 """
1037 return _core_.Point___iadd__(*args, **kwargs)
1038
1039 def __isub__(*args, **kwargs):
1040 """
1041 __isub__(self, Point pt) -> Point
1042
1043 Subtract pt from this object.
1044 """
1045 return _core_.Point___isub__(*args, **kwargs)
1046
1047 def Set(*args, **kwargs):
1048 """
1049 Set(self, long x, long y)
1050
1051 Set both the x and y properties
1052 """
1053 return _core_.Point_Set(*args, **kwargs)
1054
1055 def Get(*args, **kwargs):
1056 """
1057 Get() -> (x,y)
1058
1059 Return the x and y properties as a tuple.
1060 """
1061 return _core_.Point_Get(*args, **kwargs)
1062
1063 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1064 def __str__(self): return str(self.Get())
1065 def __repr__(self): return 'wx.Point'+str(self.Get())
1066 def __len__(self): return len(self.Get())
1067 def __getitem__(self, index): return self.Get()[index]
1068 def __setitem__(self, index, val):
1069 if index == 0: self.x = val
1070 elif index == 1: self.y = val
1071 else: raise IndexError
1072 def __nonzero__(self): return self.Get() != (0,0)
1073 __safe_for_unpickling__ = True
1074 def __reduce__(self): return (wx.Point, self.Get())
1075
1076
1077 class PointPtr(Point):
1078 def __init__(self, this):
1079 self.this = this
1080 if not hasattr(self,"thisown"): self.thisown = 0
1081 self.__class__ = Point
1082 _core_.Point_swigregister(PointPtr)
1083
1084 #---------------------------------------------------------------------------
1085
1086 class Rect(object):
1087 """
1088 A class for representing and manipulating rectangles. It has x, y,
1089 width and height properties. In wxPython most palces that expect a
1090 wx.Rect can also accept a (x,y,width,height) tuple.
1091 """
1092 def __repr__(self):
1093 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1094 def __init__(self, *args, **kwargs):
1095 """
1096 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1097
1098 Create a new Rect object.
1099 """
1100 newobj = _core_.new_Rect(*args, **kwargs)
1101 self.this = newobj.this
1102 self.thisown = 1
1103 del newobj.thisown
1104 def __del__(self, destroy=_core_.delete_Rect):
1105 """__del__(self)"""
1106 try:
1107 if self.thisown: destroy(self)
1108 except: pass
1109
1110 def GetX(*args, **kwargs):
1111 """GetX(self) -> int"""
1112 return _core_.Rect_GetX(*args, **kwargs)
1113
1114 def SetX(*args, **kwargs):
1115 """SetX(self, int x)"""
1116 return _core_.Rect_SetX(*args, **kwargs)
1117
1118 def GetY(*args, **kwargs):
1119 """GetY(self) -> int"""
1120 return _core_.Rect_GetY(*args, **kwargs)
1121
1122 def SetY(*args, **kwargs):
1123 """SetY(self, int y)"""
1124 return _core_.Rect_SetY(*args, **kwargs)
1125
1126 def GetWidth(*args, **kwargs):
1127 """GetWidth(self) -> int"""
1128 return _core_.Rect_GetWidth(*args, **kwargs)
1129
1130 def SetWidth(*args, **kwargs):
1131 """SetWidth(self, int w)"""
1132 return _core_.Rect_SetWidth(*args, **kwargs)
1133
1134 def GetHeight(*args, **kwargs):
1135 """GetHeight(self) -> int"""
1136 return _core_.Rect_GetHeight(*args, **kwargs)
1137
1138 def SetHeight(*args, **kwargs):
1139 """SetHeight(self, int h)"""
1140 return _core_.Rect_SetHeight(*args, **kwargs)
1141
1142 def GetPosition(*args, **kwargs):
1143 """GetPosition(self) -> Point"""
1144 return _core_.Rect_GetPosition(*args, **kwargs)
1145
1146 def SetPosition(*args, **kwargs):
1147 """SetPosition(self, Point p)"""
1148 return _core_.Rect_SetPosition(*args, **kwargs)
1149
1150 def GetSize(*args, **kwargs):
1151 """GetSize(self) -> Size"""
1152 return _core_.Rect_GetSize(*args, **kwargs)
1153
1154 def SetSize(*args, **kwargs):
1155 """SetSize(self, Size s)"""
1156 return _core_.Rect_SetSize(*args, **kwargs)
1157
1158 def IsEmpty(*args, **kwargs):
1159 """IsEmpty(self) -> bool"""
1160 return _core_.Rect_IsEmpty(*args, **kwargs)
1161
1162 def GetTopLeft(*args, **kwargs):
1163 """GetTopLeft(self) -> Point"""
1164 return _core_.Rect_GetTopLeft(*args, **kwargs)
1165
1166 def SetTopLeft(*args, **kwargs):
1167 """SetTopLeft(self, Point p)"""
1168 return _core_.Rect_SetTopLeft(*args, **kwargs)
1169
1170 def GetBottomRight(*args, **kwargs):
1171 """GetBottomRight(self) -> Point"""
1172 return _core_.Rect_GetBottomRight(*args, **kwargs)
1173
1174 def SetBottomRight(*args, **kwargs):
1175 """SetBottomRight(self, Point p)"""
1176 return _core_.Rect_SetBottomRight(*args, **kwargs)
1177
1178 def GetLeft(*args, **kwargs):
1179 """GetLeft(self) -> int"""
1180 return _core_.Rect_GetLeft(*args, **kwargs)
1181
1182 def GetTop(*args, **kwargs):
1183 """GetTop(self) -> int"""
1184 return _core_.Rect_GetTop(*args, **kwargs)
1185
1186 def GetBottom(*args, **kwargs):
1187 """GetBottom(self) -> int"""
1188 return _core_.Rect_GetBottom(*args, **kwargs)
1189
1190 def GetRight(*args, **kwargs):
1191 """GetRight(self) -> int"""
1192 return _core_.Rect_GetRight(*args, **kwargs)
1193
1194 def SetLeft(*args, **kwargs):
1195 """SetLeft(self, int left)"""
1196 return _core_.Rect_SetLeft(*args, **kwargs)
1197
1198 def SetRight(*args, **kwargs):
1199 """SetRight(self, int right)"""
1200 return _core_.Rect_SetRight(*args, **kwargs)
1201
1202 def SetTop(*args, **kwargs):
1203 """SetTop(self, int top)"""
1204 return _core_.Rect_SetTop(*args, **kwargs)
1205
1206 def SetBottom(*args, **kwargs):
1207 """SetBottom(self, int bottom)"""
1208 return _core_.Rect_SetBottom(*args, **kwargs)
1209
1210 position = property(GetPosition, SetPosition)
1211 size = property(GetSize, SetSize)
1212 left = property(GetLeft, SetLeft)
1213 right = property(GetRight, SetRight)
1214 top = property(GetTop, SetTop)
1215 bottom = property(GetBottom, SetBottom)
1216
1217 def Inflate(*args, **kwargs):
1218 """
1219 Inflate(self, int dx, int dy) -> Rect
1220
1221 Increases the size of the rectangle.
1222
1223 The left border is moved farther left and the right border is moved
1224 farther right by ``dx``. The upper border is moved farther up and the
1225 bottom border is moved farther down by ``dy``. (Note the the width and
1226 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1227 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1228 opposite happens: the rectangle size decreases in the respective
1229 direction.
1230
1231 The change is made to the rectangle inplace, if instead you need a
1232 copy that is inflated, preserving the original then make the copy
1233 first::
1234
1235 copy = wx.Rect(*original)
1236 copy.Inflate(10,15)
1237
1238
1239 """
1240 return _core_.Rect_Inflate(*args, **kwargs)
1241
1242 def Deflate(*args, **kwargs):
1243 """
1244 Deflate(self, int dx, int dy) -> Rect
1245
1246 Decrease the rectangle size. This method is the opposite of `Inflate`
1247 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1248 `Inflate` for a full description.
1249 """
1250 return _core_.Rect_Deflate(*args, **kwargs)
1251
1252 def OffsetXY(*args, **kwargs):
1253 """
1254 OffsetXY(self, int dx, int dy)
1255
1256 Moves the rectangle by the specified offset. If dx is positive, the
1257 rectangle is moved to the right, if dy is positive, it is moved to the
1258 bottom, otherwise it is moved to the left or top respectively.
1259 """
1260 return _core_.Rect_OffsetXY(*args, **kwargs)
1261
1262 def Offset(*args, **kwargs):
1263 """
1264 Offset(self, Point pt)
1265
1266 Same as OffsetXY but uses dx,dy from Point
1267 """
1268 return _core_.Rect_Offset(*args, **kwargs)
1269
1270 def Intersect(*args, **kwargs):
1271 """
1272 Intersect(self, Rect rect) -> Rect
1273
1274 Returns the intersectsion of this rectangle and rect.
1275 """
1276 return _core_.Rect_Intersect(*args, **kwargs)
1277
1278 def Union(*args, **kwargs):
1279 """
1280 Union(self, Rect rect) -> Rect
1281
1282 Returns the union of this rectangle and rect.
1283 """
1284 return _core_.Rect_Union(*args, **kwargs)
1285
1286 def __add__(*args, **kwargs):
1287 """
1288 __add__(self, Rect rect) -> Rect
1289
1290 Add the properties of rect to this rectangle and return the result.
1291 """
1292 return _core_.Rect___add__(*args, **kwargs)
1293
1294 def __iadd__(*args, **kwargs):
1295 """
1296 __iadd__(self, Rect rect) -> Rect
1297
1298 Add the properties of rect to this rectangle, updating this rectangle.
1299 """
1300 return _core_.Rect___iadd__(*args, **kwargs)
1301
1302 def __eq__(*args, **kwargs):
1303 """
1304 __eq__(self, Rect rect) -> bool
1305
1306 Test for equality.
1307 """
1308 return _core_.Rect___eq__(*args, **kwargs)
1309
1310 def __ne__(*args, **kwargs):
1311 """
1312 __ne__(self, Rect rect) -> bool
1313
1314 Test for inequality.
1315 """
1316 return _core_.Rect___ne__(*args, **kwargs)
1317
1318 def InsideXY(*args, **kwargs):
1319 """
1320 InsideXY(self, int x, int y) -> bool
1321
1322 Return True if the point is (not strcitly) inside the rect.
1323 """
1324 return _core_.Rect_InsideXY(*args, **kwargs)
1325
1326 def Inside(*args, **kwargs):
1327 """
1328 Inside(self, Point pt) -> bool
1329
1330 Return True if the point is (not strcitly) inside the rect.
1331 """
1332 return _core_.Rect_Inside(*args, **kwargs)
1333
1334 def Intersects(*args, **kwargs):
1335 """
1336 Intersects(self, Rect rect) -> bool
1337
1338 Returns True if the rectangles have a non empty intersection.
1339 """
1340 return _core_.Rect_Intersects(*args, **kwargs)
1341
1342 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1343 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1344 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1345 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1346 def Set(*args, **kwargs):
1347 """
1348 Set(self, int x=0, int y=0, int width=0, int height=0)
1349
1350 Set all rectangle properties.
1351 """
1352 return _core_.Rect_Set(*args, **kwargs)
1353
1354 def Get(*args, **kwargs):
1355 """
1356 Get() -> (x,y,width,height)
1357
1358 Return the rectangle properties as a tuple.
1359 """
1360 return _core_.Rect_Get(*args, **kwargs)
1361
1362 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1363 def __str__(self): return str(self.Get())
1364 def __repr__(self): return 'wx.Rect'+str(self.Get())
1365 def __len__(self): return len(self.Get())
1366 def __getitem__(self, index): return self.Get()[index]
1367 def __setitem__(self, index, val):
1368 if index == 0: self.x = val
1369 elif index == 1: self.y = val
1370 elif index == 2: self.width = val
1371 elif index == 3: self.height = val
1372 else: raise IndexError
1373 def __nonzero__(self): return self.Get() != (0,0,0,0)
1374 __safe_for_unpickling__ = True
1375 def __reduce__(self): return (wx.Rect, self.Get())
1376
1377
1378 class RectPtr(Rect):
1379 def __init__(self, this):
1380 self.this = this
1381 if not hasattr(self,"thisown"): self.thisown = 0
1382 self.__class__ = Rect
1383 _core_.Rect_swigregister(RectPtr)
1384
1385 def RectPP(*args, **kwargs):
1386 """
1387 RectPP(Point topLeft, Point bottomRight) -> Rect
1388
1389 Create a new Rect object from Points representing two corners.
1390 """
1391 val = _core_.new_RectPP(*args, **kwargs)
1392 val.thisown = 1
1393 return val
1394
1395 def RectPS(*args, **kwargs):
1396 """
1397 RectPS(Point pos, Size size) -> Rect
1398
1399 Create a new Rect from a position and size.
1400 """
1401 val = _core_.new_RectPS(*args, **kwargs)
1402 val.thisown = 1
1403 return val
1404
1405 def RectS(*args, **kwargs):
1406 """
1407 RectS(Size size) -> Rect
1408
1409 Create a new Rect from a size only.
1410 """
1411 val = _core_.new_RectS(*args, **kwargs)
1412 val.thisown = 1
1413 return val
1414
1415
1416 def IntersectRect(*args, **kwargs):
1417 """
1418 IntersectRect(Rect r1, Rect r2) -> Rect
1419
1420 Calculate and return the intersection of r1 and r2.
1421 """
1422 return _core_.IntersectRect(*args, **kwargs)
1423 #---------------------------------------------------------------------------
1424
1425 class Point2D(object):
1426 """
1427 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1428 with floating point values.
1429 """
1430 def __repr__(self):
1431 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1432 def __init__(self, *args, **kwargs):
1433 """
1434 __init__(self, double x=0.0, double y=0.0) -> Point2D
1435
1436 Create a w.Point2D object.
1437 """
1438 newobj = _core_.new_Point2D(*args, **kwargs)
1439 self.this = newobj.this
1440 self.thisown = 1
1441 del newobj.thisown
1442 def GetFloor(*args, **kwargs):
1443 """
1444 GetFloor() -> (x,y)
1445
1446 Convert to integer
1447 """
1448 return _core_.Point2D_GetFloor(*args, **kwargs)
1449
1450 def GetRounded(*args, **kwargs):
1451 """
1452 GetRounded() -> (x,y)
1453
1454 Convert to integer
1455 """
1456 return _core_.Point2D_GetRounded(*args, **kwargs)
1457
1458 def GetVectorLength(*args, **kwargs):
1459 """GetVectorLength(self) -> double"""
1460 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1461
1462 def GetVectorAngle(*args, **kwargs):
1463 """GetVectorAngle(self) -> double"""
1464 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1465
1466 def SetVectorLength(*args, **kwargs):
1467 """SetVectorLength(self, double length)"""
1468 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1469
1470 def SetVectorAngle(*args, **kwargs):
1471 """SetVectorAngle(self, double degrees)"""
1472 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1473
1474 def SetPolarCoordinates(self, angle, length):
1475 self.SetVectorLength(length)
1476 self.SetVectorAngle(angle)
1477 def Normalize(self):
1478 self.SetVectorLength(1.0)
1479
1480 def GetDistance(*args, **kwargs):
1481 """GetDistance(self, Point2D pt) -> double"""
1482 return _core_.Point2D_GetDistance(*args, **kwargs)
1483
1484 def GetDistanceSquare(*args, **kwargs):
1485 """GetDistanceSquare(self, Point2D pt) -> double"""
1486 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1487
1488 def GetDotProduct(*args, **kwargs):
1489 """GetDotProduct(self, Point2D vec) -> double"""
1490 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1491
1492 def GetCrossProduct(*args, **kwargs):
1493 """GetCrossProduct(self, Point2D vec) -> double"""
1494 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1495
1496 def __neg__(*args, **kwargs):
1497 """
1498 __neg__(self) -> Point2D
1499
1500 the reflection of this point
1501 """
1502 return _core_.Point2D___neg__(*args, **kwargs)
1503
1504 def __iadd__(*args, **kwargs):
1505 """__iadd__(self, Point2D pt) -> Point2D"""
1506 return _core_.Point2D___iadd__(*args, **kwargs)
1507
1508 def __isub__(*args, **kwargs):
1509 """__isub__(self, Point2D pt) -> Point2D"""
1510 return _core_.Point2D___isub__(*args, **kwargs)
1511
1512 def __imul__(*args, **kwargs):
1513 """__imul__(self, Point2D pt) -> Point2D"""
1514 return _core_.Point2D___imul__(*args, **kwargs)
1515
1516 def __idiv__(*args, **kwargs):
1517 """__idiv__(self, Point2D pt) -> Point2D"""
1518 return _core_.Point2D___idiv__(*args, **kwargs)
1519
1520 def __eq__(*args, **kwargs):
1521 """
1522 __eq__(self, Point2D pt) -> bool
1523
1524 Test for equality
1525 """
1526 return _core_.Point2D___eq__(*args, **kwargs)
1527
1528 def __ne__(*args, **kwargs):
1529 """
1530 __ne__(self, Point2D pt) -> bool
1531
1532 Test for inequality
1533 """
1534 return _core_.Point2D___ne__(*args, **kwargs)
1535
1536 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1537 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1538 def Set(*args, **kwargs):
1539 """Set(self, double x=0, double y=0)"""
1540 return _core_.Point2D_Set(*args, **kwargs)
1541
1542 def Get(*args, **kwargs):
1543 """
1544 Get() -> (x,y)
1545
1546 Return x and y properties as a tuple.
1547 """
1548 return _core_.Point2D_Get(*args, **kwargs)
1549
1550 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1551 def __str__(self): return str(self.Get())
1552 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1553 def __len__(self): return len(self.Get())
1554 def __getitem__(self, index): return self.Get()[index]
1555 def __setitem__(self, index, val):
1556 if index == 0: self.x = val
1557 elif index == 1: self.y = val
1558 else: raise IndexError
1559 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1560 __safe_for_unpickling__ = True
1561 def __reduce__(self): return (wx.Point2D, self.Get())
1562
1563
1564 class Point2DPtr(Point2D):
1565 def __init__(self, this):
1566 self.this = this
1567 if not hasattr(self,"thisown"): self.thisown = 0
1568 self.__class__ = Point2D
1569 _core_.Point2D_swigregister(Point2DPtr)
1570
1571 def Point2DCopy(*args, **kwargs):
1572 """
1573 Point2DCopy(Point2D pt) -> Point2D
1574
1575 Create a w.Point2D object.
1576 """
1577 val = _core_.new_Point2DCopy(*args, **kwargs)
1578 val.thisown = 1
1579 return val
1580
1581 def Point2DFromPoint(*args, **kwargs):
1582 """
1583 Point2DFromPoint(Point pt) -> Point2D
1584
1585 Create a w.Point2D object.
1586 """
1587 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1588 val.thisown = 1
1589 return val
1590
1591 #---------------------------------------------------------------------------
1592
1593 FromStart = _core_.FromStart
1594 FromCurrent = _core_.FromCurrent
1595 FromEnd = _core_.FromEnd
1596 class InputStream(object):
1597 """Proxy of C++ InputStream class"""
1598 def __repr__(self):
1599 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1600 def __init__(self, *args, **kwargs):
1601 """__init__(self, PyObject p) -> InputStream"""
1602 newobj = _core_.new_InputStream(*args, **kwargs)
1603 self.this = newobj.this
1604 self.thisown = 1
1605 del newobj.thisown
1606 def __del__(self, destroy=_core_.delete_InputStream):
1607 """__del__(self)"""
1608 try:
1609 if self.thisown: destroy(self)
1610 except: pass
1611
1612 def close(*args, **kwargs):
1613 """close(self)"""
1614 return _core_.InputStream_close(*args, **kwargs)
1615
1616 def flush(*args, **kwargs):
1617 """flush(self)"""
1618 return _core_.InputStream_flush(*args, **kwargs)
1619
1620 def eof(*args, **kwargs):
1621 """eof(self) -> bool"""
1622 return _core_.InputStream_eof(*args, **kwargs)
1623
1624 def read(*args, **kwargs):
1625 """read(self, int size=-1) -> PyObject"""
1626 return _core_.InputStream_read(*args, **kwargs)
1627
1628 def readline(*args, **kwargs):
1629 """readline(self, int size=-1) -> PyObject"""
1630 return _core_.InputStream_readline(*args, **kwargs)
1631
1632 def readlines(*args, **kwargs):
1633 """readlines(self, int sizehint=-1) -> PyObject"""
1634 return _core_.InputStream_readlines(*args, **kwargs)
1635
1636 def seek(*args, **kwargs):
1637 """seek(self, int offset, int whence=0)"""
1638 return _core_.InputStream_seek(*args, **kwargs)
1639
1640 def tell(*args, **kwargs):
1641 """tell(self) -> int"""
1642 return _core_.InputStream_tell(*args, **kwargs)
1643
1644 def Peek(*args, **kwargs):
1645 """Peek(self) -> char"""
1646 return _core_.InputStream_Peek(*args, **kwargs)
1647
1648 def GetC(*args, **kwargs):
1649 """GetC(self) -> char"""
1650 return _core_.InputStream_GetC(*args, **kwargs)
1651
1652 def LastRead(*args, **kwargs):
1653 """LastRead(self) -> size_t"""
1654 return _core_.InputStream_LastRead(*args, **kwargs)
1655
1656 def CanRead(*args, **kwargs):
1657 """CanRead(self) -> bool"""
1658 return _core_.InputStream_CanRead(*args, **kwargs)
1659
1660 def Eof(*args, **kwargs):
1661 """Eof(self) -> bool"""
1662 return _core_.InputStream_Eof(*args, **kwargs)
1663
1664 def Ungetch(*args, **kwargs):
1665 """Ungetch(self, char c) -> bool"""
1666 return _core_.InputStream_Ungetch(*args, **kwargs)
1667
1668 def SeekI(*args, **kwargs):
1669 """SeekI(self, long pos, int mode=FromStart) -> long"""
1670 return _core_.InputStream_SeekI(*args, **kwargs)
1671
1672 def TellI(*args, **kwargs):
1673 """TellI(self) -> long"""
1674 return _core_.InputStream_TellI(*args, **kwargs)
1675
1676
1677 class InputStreamPtr(InputStream):
1678 def __init__(self, this):
1679 self.this = this
1680 if not hasattr(self,"thisown"): self.thisown = 0
1681 self.__class__ = InputStream
1682 _core_.InputStream_swigregister(InputStreamPtr)
1683 DefaultPosition = cvar.DefaultPosition
1684 DefaultSize = cvar.DefaultSize
1685
1686 class OutputStream(object):
1687 """Proxy of C++ OutputStream class"""
1688 def __init__(self): raise RuntimeError, "No constructor defined"
1689 def __repr__(self):
1690 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1691 def write(*args, **kwargs):
1692 """write(self, PyObject obj)"""
1693 return _core_.OutputStream_write(*args, **kwargs)
1694
1695
1696 class OutputStreamPtr(OutputStream):
1697 def __init__(self, this):
1698 self.this = this
1699 if not hasattr(self,"thisown"): self.thisown = 0
1700 self.__class__ = OutputStream
1701 _core_.OutputStream_swigregister(OutputStreamPtr)
1702
1703 #---------------------------------------------------------------------------
1704
1705 class FSFile(Object):
1706 """Proxy of C++ FSFile class"""
1707 def __repr__(self):
1708 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1709 def __init__(self, *args, **kwargs):
1710 """
1711 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1712 DateTime modif) -> FSFile
1713 """
1714 newobj = _core_.new_FSFile(*args, **kwargs)
1715 self.this = newobj.this
1716 self.thisown = 1
1717 del newobj.thisown
1718 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
1719
1720 def __del__(self, destroy=_core_.delete_FSFile):
1721 """__del__(self)"""
1722 try:
1723 if self.thisown: destroy(self)
1724 except: pass
1725
1726 def GetStream(*args, **kwargs):
1727 """GetStream(self) -> InputStream"""
1728 return _core_.FSFile_GetStream(*args, **kwargs)
1729
1730 def GetMimeType(*args, **kwargs):
1731 """GetMimeType(self) -> String"""
1732 return _core_.FSFile_GetMimeType(*args, **kwargs)
1733
1734 def GetLocation(*args, **kwargs):
1735 """GetLocation(self) -> String"""
1736 return _core_.FSFile_GetLocation(*args, **kwargs)
1737
1738 def GetAnchor(*args, **kwargs):
1739 """GetAnchor(self) -> String"""
1740 return _core_.FSFile_GetAnchor(*args, **kwargs)
1741
1742 def GetModificationTime(*args, **kwargs):
1743 """GetModificationTime(self) -> DateTime"""
1744 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1745
1746
1747 class FSFilePtr(FSFile):
1748 def __init__(self, this):
1749 self.this = this
1750 if not hasattr(self,"thisown"): self.thisown = 0
1751 self.__class__ = FSFile
1752 _core_.FSFile_swigregister(FSFilePtr)
1753
1754 class CPPFileSystemHandler(object):
1755 """Proxy of C++ CPPFileSystemHandler class"""
1756 def __init__(self): raise RuntimeError, "No constructor defined"
1757 def __repr__(self):
1758 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1759
1760 class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1761 def __init__(self, this):
1762 self.this = this
1763 if not hasattr(self,"thisown"): self.thisown = 0
1764 self.__class__ = CPPFileSystemHandler
1765 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1766
1767 class FileSystemHandler(CPPFileSystemHandler):
1768 """Proxy of C++ FileSystemHandler class"""
1769 def __repr__(self):
1770 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1771 def __init__(self, *args, **kwargs):
1772 """__init__(self) -> FileSystemHandler"""
1773 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1774 self.this = newobj.this
1775 self.thisown = 1
1776 del newobj.thisown
1777 self._setCallbackInfo(self, FileSystemHandler)
1778
1779 def _setCallbackInfo(*args, **kwargs):
1780 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1781 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1782
1783 def CanOpen(*args, **kwargs):
1784 """CanOpen(self, String location) -> bool"""
1785 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1786
1787 def OpenFile(*args, **kwargs):
1788 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1789 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1790
1791 def FindFirst(*args, **kwargs):
1792 """FindFirst(self, String spec, int flags=0) -> String"""
1793 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1794
1795 def FindNext(*args, **kwargs):
1796 """FindNext(self) -> String"""
1797 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1798
1799 def GetProtocol(*args, **kwargs):
1800 """GetProtocol(self, String location) -> String"""
1801 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1802
1803 def GetLeftLocation(*args, **kwargs):
1804 """GetLeftLocation(self, String location) -> String"""
1805 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1806
1807 def GetAnchor(*args, **kwargs):
1808 """GetAnchor(self, String location) -> String"""
1809 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1810
1811 def GetRightLocation(*args, **kwargs):
1812 """GetRightLocation(self, String location) -> String"""
1813 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1814
1815 def GetMimeTypeFromExt(*args, **kwargs):
1816 """GetMimeTypeFromExt(self, String location) -> String"""
1817 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1818
1819
1820 class FileSystemHandlerPtr(FileSystemHandler):
1821 def __init__(self, this):
1822 self.this = this
1823 if not hasattr(self,"thisown"): self.thisown = 0
1824 self.__class__ = FileSystemHandler
1825 _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1826
1827 class FileSystem(Object):
1828 """Proxy of C++ FileSystem class"""
1829 def __repr__(self):
1830 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1831 def __init__(self, *args, **kwargs):
1832 """__init__(self) -> FileSystem"""
1833 newobj = _core_.new_FileSystem(*args, **kwargs)
1834 self.this = newobj.this
1835 self.thisown = 1
1836 del newobj.thisown
1837 def __del__(self, destroy=_core_.delete_FileSystem):
1838 """__del__(self)"""
1839 try:
1840 if self.thisown: destroy(self)
1841 except: pass
1842
1843 def ChangePathTo(*args, **kwargs):
1844 """ChangePathTo(self, String location, bool is_dir=False)"""
1845 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1846
1847 def GetPath(*args, **kwargs):
1848 """GetPath(self) -> String"""
1849 return _core_.FileSystem_GetPath(*args, **kwargs)
1850
1851 def OpenFile(*args, **kwargs):
1852 """OpenFile(self, String location) -> FSFile"""
1853 return _core_.FileSystem_OpenFile(*args, **kwargs)
1854
1855 def FindFirst(*args, **kwargs):
1856 """FindFirst(self, String spec, int flags=0) -> String"""
1857 return _core_.FileSystem_FindFirst(*args, **kwargs)
1858
1859 def FindNext(*args, **kwargs):
1860 """FindNext(self) -> String"""
1861 return _core_.FileSystem_FindNext(*args, **kwargs)
1862
1863 def AddHandler(*args, **kwargs):
1864 """AddHandler(CPPFileSystemHandler handler)"""
1865 return _core_.FileSystem_AddHandler(*args, **kwargs)
1866
1867 AddHandler = staticmethod(AddHandler)
1868 def CleanUpHandlers(*args, **kwargs):
1869 """CleanUpHandlers()"""
1870 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1871
1872 CleanUpHandlers = staticmethod(CleanUpHandlers)
1873 def FileNameToURL(*args, **kwargs):
1874 """FileNameToURL(String filename) -> String"""
1875 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1876
1877 FileNameToURL = staticmethod(FileNameToURL)
1878 def URLToFileName(*args, **kwargs):
1879 """URLToFileName(String url) -> String"""
1880 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1881
1882 URLToFileName = staticmethod(URLToFileName)
1883
1884 class FileSystemPtr(FileSystem):
1885 def __init__(self, this):
1886 self.this = this
1887 if not hasattr(self,"thisown"): self.thisown = 0
1888 self.__class__ = FileSystem
1889 _core_.FileSystem_swigregister(FileSystemPtr)
1890
1891 def FileSystem_AddHandler(*args, **kwargs):
1892 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1893 return _core_.FileSystem_AddHandler(*args, **kwargs)
1894
1895 def FileSystem_CleanUpHandlers(*args, **kwargs):
1896 """FileSystem_CleanUpHandlers()"""
1897 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1898
1899 def FileSystem_FileNameToURL(*args, **kwargs):
1900 """FileSystem_FileNameToURL(String filename) -> String"""
1901 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1902
1903 def FileSystem_URLToFileName(*args, **kwargs):
1904 """FileSystem_URLToFileName(String url) -> String"""
1905 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1906
1907 class InternetFSHandler(CPPFileSystemHandler):
1908 """Proxy of C++ InternetFSHandler class"""
1909 def __repr__(self):
1910 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1911 def __init__(self, *args, **kwargs):
1912 """__init__(self) -> InternetFSHandler"""
1913 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1914 self.this = newobj.this
1915 self.thisown = 1
1916 del newobj.thisown
1917 def CanOpen(*args, **kwargs):
1918 """CanOpen(self, String location) -> bool"""
1919 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1920
1921 def OpenFile(*args, **kwargs):
1922 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1923 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1924
1925
1926 class InternetFSHandlerPtr(InternetFSHandler):
1927 def __init__(self, this):
1928 self.this = this
1929 if not hasattr(self,"thisown"): self.thisown = 0
1930 self.__class__ = InternetFSHandler
1931 _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1932
1933 class ZipFSHandler(CPPFileSystemHandler):
1934 """Proxy of C++ ZipFSHandler class"""
1935 def __repr__(self):
1936 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1937 def __init__(self, *args, **kwargs):
1938 """__init__(self) -> ZipFSHandler"""
1939 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1940 self.this = newobj.this
1941 self.thisown = 1
1942 del newobj.thisown
1943 def CanOpen(*args, **kwargs):
1944 """CanOpen(self, String location) -> bool"""
1945 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1946
1947 def OpenFile(*args, **kwargs):
1948 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1949 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1950
1951 def FindFirst(*args, **kwargs):
1952 """FindFirst(self, String spec, int flags=0) -> String"""
1953 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1954
1955 def FindNext(*args, **kwargs):
1956 """FindNext(self) -> String"""
1957 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1958
1959
1960 class ZipFSHandlerPtr(ZipFSHandler):
1961 def __init__(self, this):
1962 self.this = this
1963 if not hasattr(self,"thisown"): self.thisown = 0
1964 self.__class__ = ZipFSHandler
1965 _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
1966
1967
1968 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1969 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1970 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1971
1972 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1973 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1974 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1975
1976 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1977 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1978 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1979 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1980 """
1981 Add 'file' to the memory filesystem. The dataItem parameter can
1982 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1983 arbitrary data. If a bitmap or image is used then the imgType
1984 parameter should specify what kind of image file it should be
1985 written as, wx.BITMAP_TYPE_PNG, etc.
1986 """
1987 if isinstance(dataItem, wx.Image):
1988 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1989 elif isinstance(dataItem, wx.Bitmap):
1990 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1991 elif type(dataItem) == str:
1992 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1993 else:
1994 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1995
1996 class MemoryFSHandler(CPPFileSystemHandler):
1997 """Proxy of C++ MemoryFSHandler class"""
1998 def __repr__(self):
1999 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2000 def __init__(self, *args, **kwargs):
2001 """__init__(self) -> MemoryFSHandler"""
2002 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
2003 self.this = newobj.this
2004 self.thisown = 1
2005 del newobj.thisown
2006 def RemoveFile(*args, **kwargs):
2007 """RemoveFile(String filename)"""
2008 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2009
2010 RemoveFile = staticmethod(RemoveFile)
2011 AddFile = staticmethod(MemoryFSHandler_AddFile)
2012 def CanOpen(*args, **kwargs):
2013 """CanOpen(self, String location) -> bool"""
2014 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2015
2016 def OpenFile(*args, **kwargs):
2017 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2018 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2019
2020 def FindFirst(*args, **kwargs):
2021 """FindFirst(self, String spec, int flags=0) -> String"""
2022 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2023
2024 def FindNext(*args, **kwargs):
2025 """FindNext(self) -> String"""
2026 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2027
2028
2029 class MemoryFSHandlerPtr(MemoryFSHandler):
2030 def __init__(self, this):
2031 self.this = this
2032 if not hasattr(self,"thisown"): self.thisown = 0
2033 self.__class__ = MemoryFSHandler
2034 _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
2035
2036 def MemoryFSHandler_RemoveFile(*args, **kwargs):
2037 """MemoryFSHandler_RemoveFile(String filename)"""
2038 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2039
2040 IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2041 IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2042 IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
2043 #---------------------------------------------------------------------------
2044
2045 class ImageHandler(Object):
2046 """
2047 This is the base class for implementing image file loading/saving, and
2048 image creation from data. It is used within `wx.Image` and is not
2049 normally seen by the application.
2050 """
2051 def __init__(self): raise RuntimeError, "No constructor defined"
2052 def __repr__(self):
2053 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2054 def GetName(*args, **kwargs):
2055 """GetName(self) -> String"""
2056 return _core_.ImageHandler_GetName(*args, **kwargs)
2057
2058 def GetExtension(*args, **kwargs):
2059 """GetExtension(self) -> String"""
2060 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2061
2062 def GetType(*args, **kwargs):
2063 """GetType(self) -> long"""
2064 return _core_.ImageHandler_GetType(*args, **kwargs)
2065
2066 def GetMimeType(*args, **kwargs):
2067 """GetMimeType(self) -> String"""
2068 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2069
2070 def CanRead(*args, **kwargs):
2071 """CanRead(self, String name) -> bool"""
2072 return _core_.ImageHandler_CanRead(*args, **kwargs)
2073
2074 def SetName(*args, **kwargs):
2075 """SetName(self, String name)"""
2076 return _core_.ImageHandler_SetName(*args, **kwargs)
2077
2078 def SetExtension(*args, **kwargs):
2079 """SetExtension(self, String extension)"""
2080 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2081
2082 def SetType(*args, **kwargs):
2083 """SetType(self, long type)"""
2084 return _core_.ImageHandler_SetType(*args, **kwargs)
2085
2086 def SetMimeType(*args, **kwargs):
2087 """SetMimeType(self, String mimetype)"""
2088 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2089
2090
2091 class ImageHandlerPtr(ImageHandler):
2092 def __init__(self, this):
2093 self.this = this
2094 if not hasattr(self,"thisown"): self.thisown = 0
2095 self.__class__ = ImageHandler
2096 _core_.ImageHandler_swigregister(ImageHandlerPtr)
2097
2098 class ImageHistogram(object):
2099 """Proxy of C++ ImageHistogram class"""
2100 def __repr__(self):
2101 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2102 def __init__(self, *args, **kwargs):
2103 """__init__(self) -> ImageHistogram"""
2104 newobj = _core_.new_ImageHistogram(*args, **kwargs)
2105 self.this = newobj.this
2106 self.thisown = 1
2107 del newobj.thisown
2108 def MakeKey(*args, **kwargs):
2109 """
2110 MakeKey(byte r, byte g, byte b) -> unsigned long
2111
2112 Get the key in the histogram for the given RGB values
2113 """
2114 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2115
2116 MakeKey = staticmethod(MakeKey)
2117 def FindFirstUnusedColour(*args, **kwargs):
2118 """
2119 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2120
2121 Find first colour that is not used in the image and has higher RGB
2122 values than startR, startG, startB. Returns a tuple consisting of a
2123 success flag and rgb values.
2124 """
2125 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2126
2127 def GetCount(*args, **kwargs):
2128 """
2129 GetCount(self, unsigned long key) -> unsigned long
2130
2131 Returns the pixel count for the given key. Use `MakeKey` to create a
2132 key value from a RGB tripple.
2133 """
2134 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2135
2136 def GetCountRGB(*args, **kwargs):
2137 """
2138 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2139
2140 Returns the pixel count for the given RGB values.
2141 """
2142 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2143
2144 def GetCountColour(*args, **kwargs):
2145 """
2146 GetCountColour(self, Colour colour) -> unsigned long
2147
2148 Returns the pixel count for the given `wx.Colour` value.
2149 """
2150 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2151
2152
2153 class ImageHistogramPtr(ImageHistogram):
2154 def __init__(self, this):
2155 self.this = this
2156 if not hasattr(self,"thisown"): self.thisown = 0
2157 self.__class__ = ImageHistogram
2158 _core_.ImageHistogram_swigregister(ImageHistogramPtr)
2159
2160 def ImageHistogram_MakeKey(*args, **kwargs):
2161 """
2162 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2163
2164 Get the key in the histogram for the given RGB values
2165 """
2166 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2167
2168 class Image(Object):
2169 """
2170 A platform-independent image class. An image can be created from
2171 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2172 variety of formats. Functions are available to set and get image
2173 bits, so it can be used for basic image manipulation.
2174
2175 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2176 platform-specific `wx.Bitmap` object must be created from it using the
2177 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2178 device context, using `wx.DC.DrawBitmap`.
2179
2180 One colour value of the image may be used as a mask colour which will
2181 lead to the automatic creation of a `wx.Mask` object associated to the
2182 bitmap object.
2183
2184 wx.Image supports alpha channel data, that is in addition to a byte
2185 for the red, green and blue colour components for each pixel it also
2186 stores a byte representing the pixel opacity. An alpha value of 0
2187 corresponds to a transparent pixel (null opacity) while a value of 255
2188 means that the pixel is 100% opaque.
2189
2190 Unlike RGB data, not all images have an alpha channel and before using
2191 `GetAlpha` you should check if this image contains an alpha channel
2192 with `HasAlpha`. Note that currently only images loaded from PNG files
2193 with transparency information will have an alpha channel.
2194 """
2195 def __repr__(self):
2196 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2197 def __init__(self, *args, **kwargs):
2198 """
2199 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2200
2201 Loads an image from a file.
2202 """
2203 newobj = _core_.new_Image(*args, **kwargs)
2204 self.this = newobj.this
2205 self.thisown = 1
2206 del newobj.thisown
2207 def __del__(self, destroy=_core_.delete_Image):
2208 """__del__(self)"""
2209 try:
2210 if self.thisown: destroy(self)
2211 except: pass
2212
2213 def Create(*args, **kwargs):
2214 """
2215 Create(self, int width, int height, bool clear=True)
2216
2217 Creates a fresh image. If clear is ``True``, the new image will be
2218 initialized to black. Otherwise, the image data will be uninitialized.
2219 """
2220 return _core_.Image_Create(*args, **kwargs)
2221
2222 def Destroy(*args, **kwargs):
2223 """
2224 Destroy(self)
2225
2226 Destroys the image data.
2227 """
2228 return _core_.Image_Destroy(*args, **kwargs)
2229
2230 def Scale(*args, **kwargs):
2231 """
2232 Scale(self, int width, int height) -> Image
2233
2234 Returns a scaled version of the image. This is also useful for scaling
2235 bitmaps in general as the only other way to scale bitmaps is to blit a
2236 `wx.MemoryDC` into another `wx.MemoryDC`.
2237 """
2238 return _core_.Image_Scale(*args, **kwargs)
2239
2240 def ShrinkBy(*args, **kwargs):
2241 """
2242 ShrinkBy(self, int xFactor, int yFactor) -> Image
2243
2244 Return a version of the image scaled smaller by the given factors.
2245 """
2246 return _core_.Image_ShrinkBy(*args, **kwargs)
2247
2248 def Rescale(*args, **kwargs):
2249 """
2250 Rescale(self, int width, int height) -> Image
2251
2252 Changes the size of the image in-place by scaling it: after a call to
2253 this function, the image will have the given width and height.
2254
2255 Returns the (modified) image itself.
2256 """
2257 return _core_.Image_Rescale(*args, **kwargs)
2258
2259 def Resize(*args, **kwargs):
2260 """
2261 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2262
2263 Changes the size of the image in-place without scaling it, by adding
2264 either a border with the given colour or cropping as necessary. The
2265 image is pasted into a new image with the given size and background
2266 colour at the position pos relative to the upper left of the new
2267 image. If red = green = blue = -1 then use either the current mask
2268 colour if set or find, use, and set a suitable mask colour for any
2269 newly exposed areas.
2270
2271 Returns the (modified) image itself.
2272 """
2273 return _core_.Image_Resize(*args, **kwargs)
2274
2275 def SetRGB(*args, **kwargs):
2276 """
2277 SetRGB(self, int x, int y, byte r, byte g, byte b)
2278
2279 Sets the pixel at the given coordinate. This routine performs
2280 bounds-checks for the coordinate so it can be considered a safe way to
2281 manipulate the data, but in some cases this might be too slow so that
2282 the data will have to be set directly. In that case you will have to
2283 get access to the image data using the `GetData` method.
2284 """
2285 return _core_.Image_SetRGB(*args, **kwargs)
2286
2287 def SetRGBRect(*args, **kwargs):
2288 """
2289 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2290
2291 Sets the colour of the pixels within the given rectangle. This routine
2292 performs bounds-checks for the rectangle so it can be considered a
2293 safe way to manipulate the data.
2294 """
2295 return _core_.Image_SetRGBRect(*args, **kwargs)
2296
2297 def GetRed(*args, **kwargs):
2298 """
2299 GetRed(self, int x, int y) -> byte
2300
2301 Returns the red intensity at the given coordinate.
2302 """
2303 return _core_.Image_GetRed(*args, **kwargs)
2304
2305 def GetGreen(*args, **kwargs):
2306 """
2307 GetGreen(self, int x, int y) -> byte
2308
2309 Returns the green intensity at the given coordinate.
2310 """
2311 return _core_.Image_GetGreen(*args, **kwargs)
2312
2313 def GetBlue(*args, **kwargs):
2314 """
2315 GetBlue(self, int x, int y) -> byte
2316
2317 Returns the blue intensity at the given coordinate.
2318 """
2319 return _core_.Image_GetBlue(*args, **kwargs)
2320
2321 def SetAlpha(*args, **kwargs):
2322 """
2323 SetAlpha(self, int x, int y, byte alpha)
2324
2325 Sets the alpha value for the given pixel. This function should only be
2326 called if the image has alpha channel data, use `HasAlpha` to check
2327 for this.
2328 """
2329 return _core_.Image_SetAlpha(*args, **kwargs)
2330
2331 def GetAlpha(*args, **kwargs):
2332 """
2333 GetAlpha(self, int x, int y) -> byte
2334
2335 Returns the alpha value for the given pixel. This function may only be
2336 called for the images with alpha channel, use `HasAlpha` to check for
2337 this.
2338
2339 The returned value is the *opacity* of the image, i.e. the value of 0
2340 corresponds to the fully transparent pixels while the value of 255 to
2341 the fully opaque pixels.
2342 """
2343 return _core_.Image_GetAlpha(*args, **kwargs)
2344
2345 def HasAlpha(*args, **kwargs):
2346 """
2347 HasAlpha(self) -> bool
2348
2349 Returns true if this image has alpha channel, false otherwise.
2350 """
2351 return _core_.Image_HasAlpha(*args, **kwargs)
2352
2353 def InitAlpha(*args, **kwargs):
2354 """
2355 InitAlpha(self)
2356
2357 Initializes the image alpha channel data. It is an error to call it if
2358 the image already has alpha data. If it doesn't, alpha data will be by
2359 default initialized to all pixels being fully opaque. But if the image
2360 has a a mask colour, all mask pixels will be completely transparent.
2361 """
2362 return _core_.Image_InitAlpha(*args, **kwargs)
2363
2364 def IsTransparent(*args, **kwargs):
2365 """
2366 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2367
2368 Returns ``True`` if this pixel is masked or has an alpha value less
2369 than the spcified threshold.
2370 """
2371 return _core_.Image_IsTransparent(*args, **kwargs)
2372
2373 def FindFirstUnusedColour(*args, **kwargs):
2374 """
2375 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2376
2377 Find first colour that is not used in the image and has higher RGB
2378 values than startR, startG, startB. Returns a tuple consisting of a
2379 success flag and rgb values.
2380 """
2381 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2382
2383 def ConvertAlphaToMask(*args, **kwargs):
2384 """
2385 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2386
2387 If the image has alpha channel, this method converts it to mask. All
2388 pixels with alpha value less than ``threshold`` are replaced with the
2389 mask colour and the alpha channel is removed. The mask colour is
2390 chosen automatically using `FindFirstUnusedColour`.
2391
2392 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2393 nothing.
2394 """
2395 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2396
2397 def ConvertColourToAlpha(*args, **kwargs):
2398 """
2399 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2400
2401 This method converts an image where the original alpha information is
2402 only available as a shades of a colour (actually shades of grey)
2403 typically when you draw anti-aliased text into a bitmap. The DC
2404 drawing routines draw grey values on the black background although
2405 they actually mean to draw white with differnt alpha values. This
2406 method reverses it, assuming a black (!) background and white text.
2407 The method will then fill up the whole image with the colour given.
2408 """
2409 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2410
2411 def SetMaskFromImage(*args, **kwargs):
2412 """
2413 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2414
2415 Sets the image's mask so that the pixels that have RGB value of
2416 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2417 by first finding an unused colour in the image, setting this colour as
2418 the mask colour and then using this colour to draw all pixels in the
2419 image who corresponding pixel in mask has given RGB value.
2420
2421 Returns ``False`` if ``mask`` does not have same dimensions as the
2422 image or if there is no unused colour left. Returns ``True`` if the
2423 mask was successfully applied.
2424
2425 Note that this method involves computing the histogram, which is
2426 computationally intensive operation.
2427 """
2428 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2429
2430 def CanRead(*args, **kwargs):
2431 """
2432 CanRead(String filename) -> bool
2433
2434 Returns True if the image handlers can read this file.
2435 """
2436 return _core_.Image_CanRead(*args, **kwargs)
2437
2438 CanRead = staticmethod(CanRead)
2439 def GetImageCount(*args, **kwargs):
2440 """
2441 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2442
2443 If the image file contains more than one image and the image handler
2444 is capable of retrieving these individually, this function will return
2445 the number of available images.
2446 """
2447 return _core_.Image_GetImageCount(*args, **kwargs)
2448
2449 GetImageCount = staticmethod(GetImageCount)
2450 def LoadFile(*args, **kwargs):
2451 """
2452 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2453
2454 Loads an image from a file. If no handler type is provided, the
2455 library will try to autodetect the format.
2456 """
2457 return _core_.Image_LoadFile(*args, **kwargs)
2458
2459 def LoadMimeFile(*args, **kwargs):
2460 """
2461 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2462
2463 Loads an image from a file, specifying the image type with a MIME type
2464 string.
2465 """
2466 return _core_.Image_LoadMimeFile(*args, **kwargs)
2467
2468 def SaveFile(*args, **kwargs):
2469 """
2470 SaveFile(self, String name, int type) -> bool
2471
2472 Saves an image in the named file.
2473 """
2474 return _core_.Image_SaveFile(*args, **kwargs)
2475
2476 def SaveMimeFile(*args, **kwargs):
2477 """
2478 SaveMimeFile(self, String name, String mimetype) -> bool
2479
2480 Saves an image in the named file.
2481 """
2482 return _core_.Image_SaveMimeFile(*args, **kwargs)
2483
2484 def CanReadStream(*args, **kwargs):
2485 """
2486 CanReadStream(InputStream stream) -> bool
2487
2488 Returns True if the image handlers can read an image file from the
2489 data currently on the input stream, or a readable Python file-like
2490 object.
2491 """
2492 return _core_.Image_CanReadStream(*args, **kwargs)
2493
2494 CanReadStream = staticmethod(CanReadStream)
2495 def LoadStream(*args, **kwargs):
2496 """
2497 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2498
2499 Loads an image from an input stream or a readable Python file-like
2500 object. If no handler type is provided, the library will try to
2501 autodetect the format.
2502 """
2503 return _core_.Image_LoadStream(*args, **kwargs)
2504
2505 def LoadMimeStream(*args, **kwargs):
2506 """
2507 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2508
2509 Loads an image from an input stream or a readable Python file-like
2510 object, using a MIME type string to specify the image file format.
2511 """
2512 return _core_.Image_LoadMimeStream(*args, **kwargs)
2513
2514 def Ok(*args, **kwargs):
2515 """
2516 Ok(self) -> bool
2517
2518 Returns true if image data is present.
2519 """
2520 return _core_.Image_Ok(*args, **kwargs)
2521
2522 def GetWidth(*args, **kwargs):
2523 """
2524 GetWidth(self) -> int
2525
2526 Gets the width of the image in pixels.
2527 """
2528 return _core_.Image_GetWidth(*args, **kwargs)
2529
2530 def GetHeight(*args, **kwargs):
2531 """
2532 GetHeight(self) -> int
2533
2534 Gets the height of the image in pixels.
2535 """
2536 return _core_.Image_GetHeight(*args, **kwargs)
2537
2538 def GetSize(*args, **kwargs):
2539 """
2540 GetSize(self) -> Size
2541
2542 Returns the size of the image in pixels.
2543 """
2544 return _core_.Image_GetSize(*args, **kwargs)
2545
2546 def GetSubImage(*args, **kwargs):
2547 """
2548 GetSubImage(self, Rect rect) -> Image
2549
2550 Returns a sub image of the current one as long as the rect belongs
2551 entirely to the image.
2552 """
2553 return _core_.Image_GetSubImage(*args, **kwargs)
2554
2555 def Size(*args, **kwargs):
2556 """
2557 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2558
2559 Returns a resized version of this image without scaling it by adding
2560 either a border with the given colour or cropping as necessary. The
2561 image is pasted into a new image with the given size and background
2562 colour at the position ``pos`` relative to the upper left of the new
2563 image. If red = green = blue = -1 then use either the current mask
2564 colour if set or find, use, and set a suitable mask colour for any
2565 newly exposed areas.
2566 """
2567 return _core_.Image_Size(*args, **kwargs)
2568
2569 def Copy(*args, **kwargs):
2570 """
2571 Copy(self) -> Image
2572
2573 Returns an identical copy of the image.
2574 """
2575 return _core_.Image_Copy(*args, **kwargs)
2576
2577 def Paste(*args, **kwargs):
2578 """
2579 Paste(self, Image image, int x, int y)
2580
2581 Pastes ``image`` into this instance and takes care of the mask colour
2582 and any out of bounds problems.
2583 """
2584 return _core_.Image_Paste(*args, **kwargs)
2585
2586 def GetData(*args, **kwargs):
2587 """
2588 GetData(self) -> PyObject
2589
2590 Returns a string containing a copy of the RGB bytes of the image.
2591 """
2592 return _core_.Image_GetData(*args, **kwargs)
2593
2594 def SetData(*args, **kwargs):
2595 """
2596 SetData(self, buffer data)
2597
2598 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2599 either a string or a buffer object holding the data and the length of
2600 the data must be width*height*3.
2601 """
2602 return _core_.Image_SetData(*args, **kwargs)
2603
2604 def GetDataBuffer(*args, **kwargs):
2605 """
2606 GetDataBuffer(self) -> PyObject
2607
2608 Returns a writable Python buffer object that is pointing at the RGB
2609 image data buffer inside the wx.Image. You need to ensure that you do
2610 not use this buffer object after the image has been destroyed.
2611 """
2612 return _core_.Image_GetDataBuffer(*args, **kwargs)
2613
2614 def SetDataBuffer(*args, **kwargs):
2615 """
2616 SetDataBuffer(self, buffer data)
2617
2618 Sets the internal image data pointer to point at a Python buffer
2619 object. This can save making an extra copy of the data but you must
2620 ensure that the buffer object lives longer than the wx.Image does.
2621 """
2622 return _core_.Image_SetDataBuffer(*args, **kwargs)
2623
2624 def GetAlphaData(*args, **kwargs):
2625 """
2626 GetAlphaData(self) -> PyObject
2627
2628 Returns a string containing a copy of the alpha bytes of the image.
2629 """
2630 return _core_.Image_GetAlphaData(*args, **kwargs)
2631
2632 def SetAlphaData(*args, **kwargs):
2633 """
2634 SetAlphaData(self, buffer alpha)
2635
2636 Resets the Image's alpha data from a buffer of bytes. Accepts either
2637 a string or a buffer object holding the data and the length of the
2638 data must be width*height.
2639 """
2640 return _core_.Image_SetAlphaData(*args, **kwargs)
2641
2642 def GetAlphaBuffer(*args, **kwargs):
2643 """GetAlphaBuffer(self) -> PyObject"""
2644 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2645
2646 def SetAlphaBuffer(*args, **kwargs):
2647 """SetAlphaBuffer(self, buffer alpha)"""
2648 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2649
2650 def SetMaskColour(*args, **kwargs):
2651 """
2652 SetMaskColour(self, byte r, byte g, byte b)
2653
2654 Sets the mask colour for this image (and tells the image to use the
2655 mask).
2656 """
2657 return _core_.Image_SetMaskColour(*args, **kwargs)
2658
2659 def GetOrFindMaskColour(*args, **kwargs):
2660 """
2661 GetOrFindMaskColour() -> (r,g,b)
2662
2663 Get the current mask colour or find a suitable colour.
2664 """
2665 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2666
2667 def GetMaskRed(*args, **kwargs):
2668 """
2669 GetMaskRed(self) -> byte
2670
2671 Gets the red component of the mask colour.
2672 """
2673 return _core_.Image_GetMaskRed(*args, **kwargs)
2674
2675 def GetMaskGreen(*args, **kwargs):
2676 """
2677 GetMaskGreen(self) -> byte
2678
2679 Gets the green component of the mask colour.
2680 """
2681 return _core_.Image_GetMaskGreen(*args, **kwargs)
2682
2683 def GetMaskBlue(*args, **kwargs):
2684 """
2685 GetMaskBlue(self) -> byte
2686
2687 Gets the blue component of the mask colour.
2688 """
2689 return _core_.Image_GetMaskBlue(*args, **kwargs)
2690
2691 def SetMask(*args, **kwargs):
2692 """
2693 SetMask(self, bool mask=True)
2694
2695 Specifies whether there is a mask or not. The area of the mask is
2696 determined by the current mask colour.
2697 """
2698 return _core_.Image_SetMask(*args, **kwargs)
2699
2700 def HasMask(*args, **kwargs):
2701 """
2702 HasMask(self) -> bool
2703
2704 Returns ``True`` if there is a mask active, ``False`` otherwise.
2705 """
2706 return _core_.Image_HasMask(*args, **kwargs)
2707
2708 def Rotate(*args, **kwargs):
2709 """
2710 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2711 Point offset_after_rotation=None) -> Image
2712
2713 Rotates the image about the given point, by ``angle`` radians. Passing
2714 ``True`` to ``interpolating`` results in better image quality, but is
2715 slower. If the image has a mask, then the mask colour is used for the
2716 uncovered pixels in the rotated image background. Otherwise, black
2717 will be used as the fill colour.
2718
2719 Returns the rotated image, leaving this image intact.
2720 """
2721 return _core_.Image_Rotate(*args, **kwargs)
2722
2723 def Rotate90(*args, **kwargs):
2724 """
2725 Rotate90(self, bool clockwise=True) -> Image
2726
2727 Returns a copy of the image rotated 90 degrees in the direction
2728 indicated by ``clockwise``.
2729 """
2730 return _core_.Image_Rotate90(*args, **kwargs)
2731
2732 def Mirror(*args, **kwargs):
2733 """
2734 Mirror(self, bool horizontally=True) -> Image
2735
2736 Returns a mirrored copy of the image. The parameter ``horizontally``
2737 indicates the orientation.
2738 """
2739 return _core_.Image_Mirror(*args, **kwargs)
2740
2741 def Replace(*args, **kwargs):
2742 """
2743 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2744
2745 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2746 ``(r2,g2,b2)``.
2747 """
2748 return _core_.Image_Replace(*args, **kwargs)
2749
2750 def ConvertToMono(*args, **kwargs):
2751 """
2752 ConvertToMono(self, byte r, byte g, byte b) -> Image
2753
2754 Returns monochromatic version of the image. The returned image has
2755 white colour where the original has ``(r,g,b)`` colour and black
2756 colour everywhere else.
2757 """
2758 return _core_.Image_ConvertToMono(*args, **kwargs)
2759
2760 def SetOption(*args, **kwargs):
2761 """
2762 SetOption(self, String name, String value)
2763
2764 Sets an image handler defined option. For example, when saving as a
2765 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2766 number between 0 and 100 (0 is terrible, 100 is very good).
2767 """
2768 return _core_.Image_SetOption(*args, **kwargs)
2769
2770 def SetOptionInt(*args, **kwargs):
2771 """
2772 SetOptionInt(self, String name, int value)
2773
2774 Sets an image option as an integer.
2775 """
2776 return _core_.Image_SetOptionInt(*args, **kwargs)
2777
2778 def GetOption(*args, **kwargs):
2779 """
2780 GetOption(self, String name) -> String
2781
2782 Gets the value of an image handler option.
2783 """
2784 return _core_.Image_GetOption(*args, **kwargs)
2785
2786 def GetOptionInt(*args, **kwargs):
2787 """
2788 GetOptionInt(self, String name) -> int
2789
2790 Gets the value of an image handler option as an integer. If the given
2791 option is not present, the function returns 0.
2792 """
2793 return _core_.Image_GetOptionInt(*args, **kwargs)
2794
2795 def HasOption(*args, **kwargs):
2796 """
2797 HasOption(self, String name) -> bool
2798
2799 Returns true if the given option is present.
2800 """
2801 return _core_.Image_HasOption(*args, **kwargs)
2802
2803 def CountColours(*args, **kwargs):
2804 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2805 return _core_.Image_CountColours(*args, **kwargs)
2806
2807 def ComputeHistogram(*args, **kwargs):
2808 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2809 return _core_.Image_ComputeHistogram(*args, **kwargs)
2810
2811 def AddHandler(*args, **kwargs):
2812 """AddHandler(ImageHandler handler)"""
2813 return _core_.Image_AddHandler(*args, **kwargs)
2814
2815 AddHandler = staticmethod(AddHandler)
2816 def InsertHandler(*args, **kwargs):
2817 """InsertHandler(ImageHandler handler)"""
2818 return _core_.Image_InsertHandler(*args, **kwargs)
2819
2820 InsertHandler = staticmethod(InsertHandler)
2821 def RemoveHandler(*args, **kwargs):
2822 """RemoveHandler(String name) -> bool"""
2823 return _core_.Image_RemoveHandler(*args, **kwargs)
2824
2825 RemoveHandler = staticmethod(RemoveHandler)
2826 def GetImageExtWildcard(*args, **kwargs):
2827 """
2828 GetImageExtWildcard() -> String
2829
2830 Iterates all registered wxImageHandler objects, and returns a string
2831 containing file extension masks suitable for passing to file open/save
2832 dialog boxes.
2833 """
2834 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2835
2836 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2837 def ConvertToBitmap(*args, **kwargs):
2838 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2839 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2840
2841 def ConvertToMonoBitmap(*args, **kwargs):
2842 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2843 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2844
2845 def __nonzero__(self): return self.Ok()
2846
2847 class ImagePtr(Image):
2848 def __init__(self, this):
2849 self.this = this
2850 if not hasattr(self,"thisown"): self.thisown = 0
2851 self.__class__ = Image
2852 _core_.Image_swigregister(ImagePtr)
2853
2854 def ImageFromMime(*args, **kwargs):
2855 """
2856 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2857
2858 Loads an image from a file, using a MIME type string (such as
2859 'image/jpeg') to specify image type.
2860 """
2861 val = _core_.new_ImageFromMime(*args, **kwargs)
2862 val.thisown = 1
2863 return val
2864
2865 def ImageFromStream(*args, **kwargs):
2866 """
2867 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2868
2869 Loads an image from an input stream, or any readable Python file-like
2870 object.
2871 """
2872 val = _core_.new_ImageFromStream(*args, **kwargs)
2873 val.thisown = 1
2874 return val
2875
2876 def ImageFromStreamMime(*args, **kwargs):
2877 """
2878 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2879
2880 Loads an image from an input stream, or any readable Python file-like
2881 object, specifying the image format with a MIME type string.
2882 """
2883 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2884 val.thisown = 1
2885 return val
2886
2887 def EmptyImage(*args, **kwargs):
2888 """
2889 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2890
2891 Construct an empty image of a given size, optionally setting all
2892 pixels to black.
2893 """
2894 val = _core_.new_EmptyImage(*args, **kwargs)
2895 val.thisown = 1
2896 return val
2897
2898 def ImageFromBitmap(*args, **kwargs):
2899 """
2900 ImageFromBitmap(Bitmap bitmap) -> Image
2901
2902 Construct an Image from a `wx.Bitmap`.
2903 """
2904 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2905 val.thisown = 1
2906 return val
2907
2908 def ImageFromData(*args, **kwargs):
2909 """
2910 ImageFromData(int width, int height, buffer data) -> Image
2911
2912 Construct an Image from a buffer of RGB bytes. Accepts either a
2913 string or a buffer object holding the data and the length of the data
2914 must be width*height*3.
2915 """
2916 val = _core_.new_ImageFromData(*args, **kwargs)
2917 val.thisown = 1
2918 return val
2919
2920 def ImageFromDataWithAlpha(*args, **kwargs):
2921 """
2922 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2923
2924 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2925 Accepts either a string or a buffer object holding the data and the
2926 length of the data must be width*height*3 bytes, and the length of the
2927 alpha data must be width*height bytes.
2928 """
2929 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2930 val.thisown = 1
2931 return val
2932
2933 def Image_CanRead(*args, **kwargs):
2934 """
2935 Image_CanRead(String filename) -> bool
2936
2937 Returns True if the image handlers can read this file.
2938 """
2939 return _core_.Image_CanRead(*args, **kwargs)
2940
2941 def Image_GetImageCount(*args, **kwargs):
2942 """
2943 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2944
2945 If the image file contains more than one image and the image handler
2946 is capable of retrieving these individually, this function will return
2947 the number of available images.
2948 """
2949 return _core_.Image_GetImageCount(*args, **kwargs)
2950
2951 def Image_CanReadStream(*args, **kwargs):
2952 """
2953 Image_CanReadStream(InputStream stream) -> bool
2954
2955 Returns True if the image handlers can read an image file from the
2956 data currently on the input stream, or a readable Python file-like
2957 object.
2958 """
2959 return _core_.Image_CanReadStream(*args, **kwargs)
2960
2961 def Image_AddHandler(*args, **kwargs):
2962 """Image_AddHandler(ImageHandler handler)"""
2963 return _core_.Image_AddHandler(*args, **kwargs)
2964
2965 def Image_InsertHandler(*args, **kwargs):
2966 """Image_InsertHandler(ImageHandler handler)"""
2967 return _core_.Image_InsertHandler(*args, **kwargs)
2968
2969 def Image_RemoveHandler(*args, **kwargs):
2970 """Image_RemoveHandler(String name) -> bool"""
2971 return _core_.Image_RemoveHandler(*args, **kwargs)
2972
2973 def Image_GetImageExtWildcard(*args, **kwargs):
2974 """
2975 Image_GetImageExtWildcard() -> String
2976
2977 Iterates all registered wxImageHandler objects, and returns a string
2978 containing file extension masks suitable for passing to file open/save
2979 dialog boxes.
2980 """
2981 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2982
2983 def InitAllImageHandlers():
2984 """
2985 The former functionality of InitAllImageHanders is now done internal to
2986 the _core_ extension module and so this function has become a simple NOP.
2987 """
2988 pass
2989
2990 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2991 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2992 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
2993 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
2994 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
2995 BMP_24BPP = _core_.BMP_24BPP
2996 BMP_8BPP = _core_.BMP_8BPP
2997 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2998 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2999 BMP_8BPP_RED = _core_.BMP_8BPP_RED
3000 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3001 BMP_4BPP = _core_.BMP_4BPP
3002 BMP_1BPP = _core_.BMP_1BPP
3003 BMP_1BPP_BW = _core_.BMP_1BPP_BW
3004 class BMPHandler(ImageHandler):
3005 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3006 def __repr__(self):
3007 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3008 def __init__(self, *args, **kwargs):
3009 """
3010 __init__(self) -> BMPHandler
3011
3012 A `wx.ImageHandler` for \*.bmp bitmap files.
3013 """
3014 newobj = _core_.new_BMPHandler(*args, **kwargs)
3015 self.this = newobj.this
3016 self.thisown = 1
3017 del newobj.thisown
3018
3019 class BMPHandlerPtr(BMPHandler):
3020 def __init__(self, this):
3021 self.this = this
3022 if not hasattr(self,"thisown"): self.thisown = 0
3023 self.__class__ = BMPHandler
3024 _core_.BMPHandler_swigregister(BMPHandlerPtr)
3025 NullImage = cvar.NullImage
3026 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
3027 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3028 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3029 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3030 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
3031 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3032 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
3033 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
3034 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
3035 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3036 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3037 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3038 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
3039 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3040 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
3041
3042 class ICOHandler(BMPHandler):
3043 """A `wx.ImageHandler` for \*.ico icon files."""
3044 def __repr__(self):
3045 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3046 def __init__(self, *args, **kwargs):
3047 """
3048 __init__(self) -> ICOHandler
3049
3050 A `wx.ImageHandler` for \*.ico icon files.
3051 """
3052 newobj = _core_.new_ICOHandler(*args, **kwargs)
3053 self.this = newobj.this
3054 self.thisown = 1
3055 del newobj.thisown
3056
3057 class ICOHandlerPtr(ICOHandler):
3058 def __init__(self, this):
3059 self.this = this
3060 if not hasattr(self,"thisown"): self.thisown = 0
3061 self.__class__ = ICOHandler
3062 _core_.ICOHandler_swigregister(ICOHandlerPtr)
3063
3064 class CURHandler(ICOHandler):
3065 """A `wx.ImageHandler` for \*.cur cursor files."""
3066 def __repr__(self):
3067 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3068 def __init__(self, *args, **kwargs):
3069 """
3070 __init__(self) -> CURHandler
3071
3072 A `wx.ImageHandler` for \*.cur cursor files.
3073 """
3074 newobj = _core_.new_CURHandler(*args, **kwargs)
3075 self.this = newobj.this
3076 self.thisown = 1
3077 del newobj.thisown
3078
3079 class CURHandlerPtr(CURHandler):
3080 def __init__(self, this):
3081 self.this = this
3082 if not hasattr(self,"thisown"): self.thisown = 0
3083 self.__class__ = CURHandler
3084 _core_.CURHandler_swigregister(CURHandlerPtr)
3085
3086 class ANIHandler(CURHandler):
3087 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3088 def __repr__(self):
3089 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3090 def __init__(self, *args, **kwargs):
3091 """
3092 __init__(self) -> ANIHandler
3093
3094 A `wx.ImageHandler` for \*.ani animated cursor files.
3095 """
3096 newobj = _core_.new_ANIHandler(*args, **kwargs)
3097 self.this = newobj.this
3098 self.thisown = 1
3099 del newobj.thisown
3100
3101 class ANIHandlerPtr(ANIHandler):
3102 def __init__(self, this):
3103 self.this = this
3104 if not hasattr(self,"thisown"): self.thisown = 0
3105 self.__class__ = ANIHandler
3106 _core_.ANIHandler_swigregister(ANIHandlerPtr)
3107
3108 class PNGHandler(ImageHandler):
3109 """A `wx.ImageHandler` for PNG image files."""
3110 def __repr__(self):
3111 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3112 def __init__(self, *args, **kwargs):
3113 """
3114 __init__(self) -> PNGHandler
3115
3116 A `wx.ImageHandler` for PNG image files.
3117 """
3118 newobj = _core_.new_PNGHandler(*args, **kwargs)
3119 self.this = newobj.this
3120 self.thisown = 1
3121 del newobj.thisown
3122
3123 class PNGHandlerPtr(PNGHandler):
3124 def __init__(self, this):
3125 self.this = this
3126 if not hasattr(self,"thisown"): self.thisown = 0
3127 self.__class__ = PNGHandler
3128 _core_.PNGHandler_swigregister(PNGHandlerPtr)
3129
3130 class GIFHandler(ImageHandler):
3131 """A `wx.ImageHandler` for GIF image files."""
3132 def __repr__(self):
3133 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3134 def __init__(self, *args, **kwargs):
3135 """
3136 __init__(self) -> GIFHandler
3137
3138 A `wx.ImageHandler` for GIF image files.
3139 """
3140 newobj = _core_.new_GIFHandler(*args, **kwargs)
3141 self.this = newobj.this
3142 self.thisown = 1
3143 del newobj.thisown
3144
3145 class GIFHandlerPtr(GIFHandler):
3146 def __init__(self, this):
3147 self.this = this
3148 if not hasattr(self,"thisown"): self.thisown = 0
3149 self.__class__ = GIFHandler
3150 _core_.GIFHandler_swigregister(GIFHandlerPtr)
3151
3152 class PCXHandler(ImageHandler):
3153 """A `wx.ImageHandler` for PCX imager files."""
3154 def __repr__(self):
3155 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3156 def __init__(self, *args, **kwargs):
3157 """
3158 __init__(self) -> PCXHandler
3159
3160 A `wx.ImageHandler` for PCX imager files.
3161 """
3162 newobj = _core_.new_PCXHandler(*args, **kwargs)
3163 self.this = newobj.this
3164 self.thisown = 1
3165 del newobj.thisown
3166
3167 class PCXHandlerPtr(PCXHandler):
3168 def __init__(self, this):
3169 self.this = this
3170 if not hasattr(self,"thisown"): self.thisown = 0
3171 self.__class__ = PCXHandler
3172 _core_.PCXHandler_swigregister(PCXHandlerPtr)
3173
3174 class JPEGHandler(ImageHandler):
3175 """A `wx.ImageHandler` for JPEG/JPG image files."""
3176 def __repr__(self):
3177 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3178 def __init__(self, *args, **kwargs):
3179 """
3180 __init__(self) -> JPEGHandler
3181
3182 A `wx.ImageHandler` for JPEG/JPG image files.
3183 """
3184 newobj = _core_.new_JPEGHandler(*args, **kwargs)
3185 self.this = newobj.this
3186 self.thisown = 1
3187 del newobj.thisown
3188
3189 class JPEGHandlerPtr(JPEGHandler):
3190 def __init__(self, this):
3191 self.this = this
3192 if not hasattr(self,"thisown"): self.thisown = 0
3193 self.__class__ = JPEGHandler
3194 _core_.JPEGHandler_swigregister(JPEGHandlerPtr)
3195
3196 class PNMHandler(ImageHandler):
3197 """A `wx.ImageHandler` for PNM image files."""
3198 def __repr__(self):
3199 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3200 def __init__(self, *args, **kwargs):
3201 """
3202 __init__(self) -> PNMHandler
3203
3204 A `wx.ImageHandler` for PNM image files.
3205 """
3206 newobj = _core_.new_PNMHandler(*args, **kwargs)
3207 self.this = newobj.this
3208 self.thisown = 1
3209 del newobj.thisown
3210
3211 class PNMHandlerPtr(PNMHandler):
3212 def __init__(self, this):
3213 self.this = this
3214 if not hasattr(self,"thisown"): self.thisown = 0
3215 self.__class__ = PNMHandler
3216 _core_.PNMHandler_swigregister(PNMHandlerPtr)
3217
3218 class XPMHandler(ImageHandler):
3219 """A `wx.ImageHandler` for XPM image."""
3220 def __repr__(self):
3221 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3222 def __init__(self, *args, **kwargs):
3223 """
3224 __init__(self) -> XPMHandler
3225
3226 A `wx.ImageHandler` for XPM image.
3227 """
3228 newobj = _core_.new_XPMHandler(*args, **kwargs)
3229 self.this = newobj.this
3230 self.thisown = 1
3231 del newobj.thisown
3232
3233 class XPMHandlerPtr(XPMHandler):
3234 def __init__(self, this):
3235 self.this = this
3236 if not hasattr(self,"thisown"): self.thisown = 0
3237 self.__class__ = XPMHandler
3238 _core_.XPMHandler_swigregister(XPMHandlerPtr)
3239
3240 class TIFFHandler(ImageHandler):
3241 """A `wx.ImageHandler` for TIFF image files."""
3242 def __repr__(self):
3243 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3244 def __init__(self, *args, **kwargs):
3245 """
3246 __init__(self) -> TIFFHandler
3247
3248 A `wx.ImageHandler` for TIFF image files.
3249 """
3250 newobj = _core_.new_TIFFHandler(*args, **kwargs)
3251 self.this = newobj.this
3252 self.thisown = 1
3253 del newobj.thisown
3254
3255 class TIFFHandlerPtr(TIFFHandler):
3256 def __init__(self, this):
3257 self.this = this
3258 if not hasattr(self,"thisown"): self.thisown = 0
3259 self.__class__ = TIFFHandler
3260 _core_.TIFFHandler_swigregister(TIFFHandlerPtr)
3261
3262 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3263 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3264 class Quantize(object):
3265 """Performs quantization, or colour reduction, on a wxImage."""
3266 def __init__(self): raise RuntimeError, "No constructor defined"
3267 def __repr__(self):
3268 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3269 def Quantize(*args, **kwargs):
3270 """
3271 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3272
3273 Reduce the colours in the source image and put the result into the
3274 destination image, setting the palette in the destination if
3275 needed. Both images may be the same, to overwrite the source image.
3276 """
3277 return _core_.Quantize_Quantize(*args, **kwargs)
3278
3279 Quantize = staticmethod(Quantize)
3280
3281 class QuantizePtr(Quantize):
3282 def __init__(self, this):
3283 self.this = this
3284 if not hasattr(self,"thisown"): self.thisown = 0
3285 self.__class__ = Quantize
3286 _core_.Quantize_swigregister(QuantizePtr)
3287
3288 def Quantize_Quantize(*args, **kwargs):
3289 """
3290 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3291
3292 Reduce the colours in the source image and put the result into the
3293 destination image, setting the palette in the destination if
3294 needed. Both images may be the same, to overwrite the source image.
3295 """
3296 return _core_.Quantize_Quantize(*args, **kwargs)
3297
3298 #---------------------------------------------------------------------------
3299
3300 class EvtHandler(Object):
3301 """Proxy of C++ EvtHandler class"""
3302 def __repr__(self):
3303 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3304 def __init__(self, *args, **kwargs):
3305 """__init__(self) -> EvtHandler"""
3306 newobj = _core_.new_EvtHandler(*args, **kwargs)
3307 self.this = newobj.this
3308 self.thisown = 1
3309 del newobj.thisown
3310 def GetNextHandler(*args, **kwargs):
3311 """GetNextHandler(self) -> EvtHandler"""
3312 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3313
3314 def GetPreviousHandler(*args, **kwargs):
3315 """GetPreviousHandler(self) -> EvtHandler"""
3316 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3317
3318 def SetNextHandler(*args, **kwargs):
3319 """SetNextHandler(self, EvtHandler handler)"""
3320 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3321
3322 def SetPreviousHandler(*args, **kwargs):
3323 """SetPreviousHandler(self, EvtHandler handler)"""
3324 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3325
3326 def GetEvtHandlerEnabled(*args, **kwargs):
3327 """GetEvtHandlerEnabled(self) -> bool"""
3328 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3329
3330 def SetEvtHandlerEnabled(*args, **kwargs):
3331 """SetEvtHandlerEnabled(self, bool enabled)"""
3332 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3333
3334 def ProcessEvent(*args, **kwargs):
3335 """ProcessEvent(self, Event event) -> bool"""
3336 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3337
3338 def AddPendingEvent(*args, **kwargs):
3339 """AddPendingEvent(self, Event event)"""
3340 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3341
3342 def ProcessPendingEvents(*args, **kwargs):
3343 """ProcessPendingEvents(self)"""
3344 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3345
3346 def Connect(*args, **kwargs):
3347 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3348 return _core_.EvtHandler_Connect(*args, **kwargs)
3349
3350 def Disconnect(*args, **kwargs):
3351 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
3352 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3353
3354 def _setOORInfo(*args, **kwargs):
3355 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3356 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
3357
3358 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3359 """
3360 Bind an event to an event handler.
3361
3362 :param event: One of the EVT_* objects that specifies the
3363 type of event to bind,
3364
3365 :param handler: A callable object to be invoked when the
3366 event is delivered to self. Pass None to
3367 disconnect an event handler.
3368
3369 :param source: Sometimes the event originates from a
3370 different window than self, but you still
3371 want to catch it in self. (For example, a
3372 button event delivered to a frame.) By
3373 passing the source of the event, the event
3374 handling system is able to differentiate
3375 between the same event type from different
3376 controls.
3377
3378 :param id: Used to spcify the event source by ID instead
3379 of instance.
3380
3381 :param id2: Used when it is desirable to bind a handler
3382 to a range of IDs, such as with EVT_MENU_RANGE.
3383 """
3384 if source is not None:
3385 id = source.GetId()
3386 event.Bind(self, id, id2, handler)
3387
3388 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3389 """
3390 Disconencts the event handler binding for event from self.
3391 Returns True if successful.
3392 """
3393 if source is not None:
3394 id = source.GetId()
3395 return event.Unbind(self, id, id2)
3396
3397
3398 class EvtHandlerPtr(EvtHandler):
3399 def __init__(self, this):
3400 self.this = this
3401 if not hasattr(self,"thisown"): self.thisown = 0
3402 self.__class__ = EvtHandler
3403 _core_.EvtHandler_swigregister(EvtHandlerPtr)
3404
3405 #---------------------------------------------------------------------------
3406
3407 class PyEventBinder(object):
3408 """
3409 Instances of this class are used to bind specific events to event
3410 handlers.
3411 """
3412 def __init__(self, evtType, expectedIDs=0):
3413 if expectedIDs not in [0, 1, 2]:
3414 raise ValueError, "Invalid number of expectedIDs"
3415 self.expectedIDs = expectedIDs
3416
3417 if type(evtType) == list or type(evtType) == tuple:
3418 self.evtType = evtType
3419 else:
3420 self.evtType = [evtType]
3421
3422
3423 def Bind(self, target, id1, id2, function):
3424 """Bind this set of event types to target."""
3425 for et in self.evtType:
3426 target.Connect(id1, id2, et, function)
3427
3428
3429 def Unbind(self, target, id1, id2):
3430 """Remove an event binding."""
3431 success = 0
3432 for et in self.evtType:
3433 success += target.Disconnect(id1, id2, et)
3434 return success != 0
3435
3436
3437 def __call__(self, *args):
3438 """
3439 For backwards compatibility with the old EVT_* functions.
3440 Should be called with either (window, func), (window, ID,
3441 func) or (window, ID1, ID2, func) parameters depending on the
3442 type of the event.
3443 """
3444 assert len(args) == 2 + self.expectedIDs
3445 id1 = wx.ID_ANY
3446 id2 = wx.ID_ANY
3447 target = args[0]
3448 if self.expectedIDs == 0:
3449 func = args[1]
3450 elif self.expectedIDs == 1:
3451 id1 = args[1]
3452 func = args[2]
3453 elif self.expectedIDs == 2:
3454 id1 = args[1]
3455 id2 = args[2]
3456 func = args[3]
3457 else:
3458 raise ValueError, "Unexpected number of IDs"
3459
3460 self.Bind(target, id1, id2, func)
3461
3462
3463 # These two are square pegs that don't fit the PyEventBinder hole...
3464 def EVT_COMMAND(win, id, cmd, func):
3465 win.Connect(id, -1, cmd, func)
3466 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3467 win.Connect(id1, id2, cmd, func)
3468
3469
3470 #---------------------------------------------------------------------------
3471
3472 #---------------------------------------------------------------------------
3473
3474 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3475 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3476
3477 def NewEventType(*args, **kwargs):
3478 """NewEventType() -> wxEventType"""
3479 return _core_.NewEventType(*args, **kwargs)
3480 wxEVT_NULL = _core_.wxEVT_NULL
3481 wxEVT_FIRST = _core_.wxEVT_FIRST
3482 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3483 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3484 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3485 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3486 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3487 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3488 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3489 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3490 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3491 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3492 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3493 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3494 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3495 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3496 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3497 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3498 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3499 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3500 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3501 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3502 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3503 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3504 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3505 wxEVT_MOTION = _core_.wxEVT_MOTION
3506 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3507 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3508 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3509 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3510 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3511 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3512 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3513 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3514 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3515 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3516 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3517 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3518 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3519 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3520 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3521 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3522 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3523 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3524 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3525 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3526 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3527 wxEVT_CHAR = _core_.wxEVT_CHAR
3528 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3529 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3530 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3531 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3532 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3533 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3534 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3535 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3536 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3537 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3538 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3539 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3540 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3541 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3542 wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
3543 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3544 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3545 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3546 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3547 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3548 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3549 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3550 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3551 wxEVT_SIZE = _core_.wxEVT_SIZE
3552 wxEVT_MOVE = _core_.wxEVT_MOVE
3553 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3554 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3555 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3556 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3557 wxEVT_POWER = _core_.wxEVT_POWER
3558 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3559 wxEVT_CREATE = _core_.wxEVT_CREATE
3560 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3561 wxEVT_SHOW = _core_.wxEVT_SHOW
3562 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3563 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3564 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3565 wxEVT_PAINT = _core_.wxEVT_PAINT
3566 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3567 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3568 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3569 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3570 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3571 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3572 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3573 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3574 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3575 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3576 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3577 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3578 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3579 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3580 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3581 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3582 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3583 wxEVT_IDLE = _core_.wxEVT_IDLE
3584 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3585 wxEVT_SIZING = _core_.wxEVT_SIZING
3586 wxEVT_MOVING = _core_.wxEVT_MOVING
3587 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3588 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3589 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3590 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3591 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3592 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3593 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3594 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3595 #
3596 # Create some event binders
3597 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3598 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3599 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3600 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3601 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3602 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3603 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3604 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3605 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3606 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3607 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3608 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3609 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3610 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3611 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3612 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3613 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3614 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3615 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3616 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3617 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3618 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3619 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3620 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3621 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3622 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3623 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3624 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3625 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3626 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3627 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3628 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3629 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3630 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3631 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3632 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3633 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3634 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3635 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3636 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3637 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3638
3639 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3640 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3641 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3642 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3643 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3644 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3645 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3646 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3647 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3648 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3649 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3650 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3651 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3652
3653 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3654 wxEVT_LEFT_UP,
3655 wxEVT_MIDDLE_DOWN,
3656 wxEVT_MIDDLE_UP,
3657 wxEVT_RIGHT_DOWN,
3658 wxEVT_RIGHT_UP,
3659 wxEVT_MOTION,
3660 wxEVT_LEFT_DCLICK,
3661 wxEVT_MIDDLE_DCLICK,
3662 wxEVT_RIGHT_DCLICK,
3663 wxEVT_ENTER_WINDOW,
3664 wxEVT_LEAVE_WINDOW,
3665 wxEVT_MOUSEWHEEL
3666 ])
3667
3668
3669 # Scrolling from wxWindow (sent to wxScrolledWindow)
3670 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3671 wxEVT_SCROLLWIN_BOTTOM,
3672 wxEVT_SCROLLWIN_LINEUP,
3673 wxEVT_SCROLLWIN_LINEDOWN,
3674 wxEVT_SCROLLWIN_PAGEUP,
3675 wxEVT_SCROLLWIN_PAGEDOWN,
3676 wxEVT_SCROLLWIN_THUMBTRACK,
3677 wxEVT_SCROLLWIN_THUMBRELEASE,
3678 ])
3679
3680 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3681 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3682 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3683 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3684 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3685 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3686 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3687 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3688
3689 # Scrolling from wx.Slider and wx.ScrollBar
3690 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3691 wxEVT_SCROLL_BOTTOM,
3692 wxEVT_SCROLL_LINEUP,
3693 wxEVT_SCROLL_LINEDOWN,
3694 wxEVT_SCROLL_PAGEUP,
3695 wxEVT_SCROLL_PAGEDOWN,
3696 wxEVT_SCROLL_THUMBTRACK,
3697 wxEVT_SCROLL_THUMBRELEASE,
3698 wxEVT_SCROLL_ENDSCROLL,
3699 ])
3700
3701 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3702 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3703 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3704 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3705 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3706 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3707 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3708 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3709 EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3710
3711 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3712 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3713 wxEVT_SCROLL_BOTTOM,
3714 wxEVT_SCROLL_LINEUP,
3715 wxEVT_SCROLL_LINEDOWN,
3716 wxEVT_SCROLL_PAGEUP,
3717 wxEVT_SCROLL_PAGEDOWN,
3718 wxEVT_SCROLL_THUMBTRACK,
3719 wxEVT_SCROLL_THUMBRELEASE,
3720 wxEVT_SCROLL_ENDSCROLL,
3721 ], 1)
3722
3723 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3724 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3725 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3726 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3727 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3728 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3729 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3730 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3731 EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3732
3733 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3734 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3735 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3736 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3737 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3738 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3739 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3740 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3741 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3742 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3743
3744 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3745 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3746 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3747 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3748 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3749 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3750 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3751 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3752 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3753
3754
3755 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3756 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3757 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3758 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3759 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3760 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3761 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3762
3763 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3764
3765 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3766 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3767
3768 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3769
3770
3771
3772 #---------------------------------------------------------------------------
3773
3774 class Event(Object):
3775 """
3776 An event is a structure holding information about an event passed to a
3777 callback or member function. wx.Event is an abstract base class for
3778 other event classes
3779 """
3780 def __init__(self): raise RuntimeError, "No constructor defined"
3781 def __repr__(self):
3782 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3783 def __del__(self, destroy=_core_.delete_Event):
3784 """__del__(self)"""
3785 try:
3786 if self.thisown: destroy(self)
3787 except: pass
3788
3789 def SetEventType(*args, **kwargs):
3790 """
3791 SetEventType(self, wxEventType typ)
3792
3793 Sets the specific type of the event.
3794 """
3795 return _core_.Event_SetEventType(*args, **kwargs)
3796
3797 def GetEventType(*args, **kwargs):
3798 """
3799 GetEventType(self) -> wxEventType
3800
3801 Returns the identifier of the given event type, such as
3802 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3803 """
3804 return _core_.Event_GetEventType(*args, **kwargs)
3805
3806 def GetEventObject(*args, **kwargs):
3807 """
3808 GetEventObject(self) -> Object
3809
3810 Returns the object (usually a window) associated with the event, if
3811 any.
3812 """
3813 return _core_.Event_GetEventObject(*args, **kwargs)
3814
3815 def SetEventObject(*args, **kwargs):
3816 """
3817 SetEventObject(self, Object obj)
3818
3819 Sets the originating object, or in other words, obj is normally the
3820 object that is sending the event.
3821 """
3822 return _core_.Event_SetEventObject(*args, **kwargs)
3823
3824 def GetTimestamp(*args, **kwargs):
3825 """GetTimestamp(self) -> long"""
3826 return _core_.Event_GetTimestamp(*args, **kwargs)
3827
3828 def SetTimestamp(*args, **kwargs):
3829 """SetTimestamp(self, long ts=0)"""
3830 return _core_.Event_SetTimestamp(*args, **kwargs)
3831
3832 def GetId(*args, **kwargs):
3833 """
3834 GetId(self) -> int
3835
3836 Returns the identifier associated with this event, such as a button
3837 command id.
3838 """
3839 return _core_.Event_GetId(*args, **kwargs)
3840
3841 def SetId(*args, **kwargs):
3842 """
3843 SetId(self, int Id)
3844
3845 Set's the ID for the event. This is usually the ID of the window that
3846 is sending the event, but it can also be a command id from a menu
3847 item, etc.
3848 """
3849 return _core_.Event_SetId(*args, **kwargs)
3850
3851 def IsCommandEvent(*args, **kwargs):
3852 """
3853 IsCommandEvent(self) -> bool
3854
3855 Returns true if the event is or is derived from `wx.CommandEvent` else
3856 it returns false. Note: Exists only for optimization purposes.
3857 """
3858 return _core_.Event_IsCommandEvent(*args, **kwargs)
3859
3860 def Skip(*args, **kwargs):
3861 """
3862 Skip(self, bool skip=True)
3863
3864 Called by an event handler, it controls whether additional event
3865 handlers bound to this event will be called after the current event
3866 handler returns. Skip(false) (the default setting) will prevent
3867 additional event handlers from being called and control will be
3868 returned to the sender of the event immediately after the current
3869 handler has finished. Skip(True) will cause the event processing
3870 system to continue searching for a handler function for this event.
3871
3872 """
3873 return _core_.Event_Skip(*args, **kwargs)
3874
3875 def GetSkipped(*args, **kwargs):
3876 """
3877 GetSkipped(self) -> bool
3878
3879 Returns true if the event handler should be skipped, false otherwise.
3880 :see: `Skip`
3881 """
3882 return _core_.Event_GetSkipped(*args, **kwargs)
3883
3884 def ShouldPropagate(*args, **kwargs):
3885 """
3886 ShouldPropagate(self) -> bool
3887
3888 Test if this event should be propagated to the parent window or not,
3889 i.e. if the propagation level is currently greater than 0.
3890 """
3891 return _core_.Event_ShouldPropagate(*args, **kwargs)
3892
3893 def StopPropagation(*args, **kwargs):
3894 """
3895 StopPropagation(self) -> int
3896
3897 Stop the event from propagating to its parent window. Returns the old
3898 propagation level value which may be later passed to
3899 `ResumePropagation` to allow propagating the event again.
3900 """
3901 return _core_.Event_StopPropagation(*args, **kwargs)
3902
3903 def ResumePropagation(*args, **kwargs):
3904 """
3905 ResumePropagation(self, int propagationLevel)
3906
3907 Resume the event propagation by restoring the propagation level. (For
3908 example, you can use the value returned by an earlier call to
3909 `StopPropagation`.)
3910
3911 """
3912 return _core_.Event_ResumePropagation(*args, **kwargs)
3913
3914 def Clone(*args, **kwargs):
3915 """Clone(self) -> Event"""
3916 return _core_.Event_Clone(*args, **kwargs)
3917
3918
3919 class EventPtr(Event):
3920 def __init__(self, this):
3921 self.this = this
3922 if not hasattr(self,"thisown"): self.thisown = 0
3923 self.__class__ = Event
3924 _core_.Event_swigregister(EventPtr)
3925
3926 #---------------------------------------------------------------------------
3927
3928 class PropagationDisabler(object):
3929 """
3930 Helper class to temporarily change an event not to propagate. Simply
3931 create an instance of this class and then whe it is destroyed the
3932 propogation of the event will be restored.
3933 """
3934 def __repr__(self):
3935 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3936 def __init__(self, *args, **kwargs):
3937 """
3938 __init__(self, Event event) -> PropagationDisabler
3939
3940 Helper class to temporarily change an event not to propagate. Simply
3941 create an instance of this class and then whe it is destroyed the
3942 propogation of the event will be restored.
3943 """
3944 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
3945 self.this = newobj.this
3946 self.thisown = 1
3947 del newobj.thisown
3948 def __del__(self, destroy=_core_.delete_PropagationDisabler):
3949 """__del__(self)"""
3950 try:
3951 if self.thisown: destroy(self)
3952 except: pass
3953
3954
3955 class PropagationDisablerPtr(PropagationDisabler):
3956 def __init__(self, this):
3957 self.this = this
3958 if not hasattr(self,"thisown"): self.thisown = 0
3959 self.__class__ = PropagationDisabler
3960 _core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
3961
3962 class PropagateOnce(object):
3963 """
3964 A helper class that will temporarily lower propagation level of an
3965 event. Simply create an instance of this class and then whe it is
3966 destroyed the propogation of the event will be restored.
3967 """
3968 def __repr__(self):
3969 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3970 def __init__(self, *args, **kwargs):
3971 """
3972 __init__(self, Event event) -> PropagateOnce
3973
3974 A helper class that will temporarily lower propagation level of an
3975 event. Simply create an instance of this class and then whe it is
3976 destroyed the propogation of the event will be restored.
3977 """
3978 newobj = _core_.new_PropagateOnce(*args, **kwargs)
3979 self.this = newobj.this
3980 self.thisown = 1
3981 del newobj.thisown
3982 def __del__(self, destroy=_core_.delete_PropagateOnce):
3983 """__del__(self)"""
3984 try:
3985 if self.thisown: destroy(self)
3986 except: pass
3987
3988
3989 class PropagateOncePtr(PropagateOnce):
3990 def __init__(self, this):
3991 self.this = this
3992 if not hasattr(self,"thisown"): self.thisown = 0
3993 self.__class__ = PropagateOnce
3994 _core_.PropagateOnce_swigregister(PropagateOncePtr)
3995
3996 #---------------------------------------------------------------------------
3997
3998 class CommandEvent(Event):
3999 """
4000 This event class contains information about command events, which
4001 originate from a variety of simple controls, as well as menus and
4002 toolbars.
4003 """
4004 def __repr__(self):
4005 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4006 def __init__(self, *args, **kwargs):
4007 """
4008 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4009
4010 This event class contains information about command events, which
4011 originate from a variety of simple controls, as well as menus and
4012 toolbars.
4013 """
4014 newobj = _core_.new_CommandEvent(*args, **kwargs)
4015 self.this = newobj.this
4016 self.thisown = 1
4017 del newobj.thisown
4018 def GetSelection(*args, **kwargs):
4019 """
4020 GetSelection(self) -> int
4021
4022 Returns item index for a listbox or choice selection event (not valid
4023 for a deselection).
4024 """
4025 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4026
4027 def SetString(*args, **kwargs):
4028 """SetString(self, String s)"""
4029 return _core_.CommandEvent_SetString(*args, **kwargs)
4030
4031 def GetString(*args, **kwargs):
4032 """
4033 GetString(self) -> String
4034
4035 Returns item string for a listbox or choice selection event (not valid
4036 for a deselection).
4037 """
4038 return _core_.CommandEvent_GetString(*args, **kwargs)
4039
4040 def IsChecked(*args, **kwargs):
4041 """
4042 IsChecked(self) -> bool
4043
4044 This method can be used with checkbox and menu events: for the
4045 checkboxes, the method returns true for a selection event and false
4046 for a deselection one. For the menu events, this method indicates if
4047 the menu item just has become checked or unchecked (and thus only
4048 makes sense for checkable menu items).
4049 """
4050 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4051
4052 Checked = IsChecked
4053 def IsSelection(*args, **kwargs):
4054 """
4055 IsSelection(self) -> bool
4056
4057 For a listbox or similar event, returns true if it is a selection,
4058 false if it is a deselection.
4059 """
4060 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4061
4062 def SetExtraLong(*args, **kwargs):
4063 """SetExtraLong(self, long extraLong)"""
4064 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4065
4066 def GetExtraLong(*args, **kwargs):
4067 """
4068 GetExtraLong(self) -> long
4069
4070 Returns extra information dependant on the event objects type. If the event
4071 comes from a listbox selection, it is a boolean determining whether the event
4072 was a selection (true) or a deselection (false). A listbox deselection only
4073 occurs for multiple-selection boxes, and in this case the index and string
4074 values are indeterminate and the listbox must be examined by the application.
4075 """
4076 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4077
4078 def SetInt(*args, **kwargs):
4079 """SetInt(self, int i)"""
4080 return _core_.CommandEvent_SetInt(*args, **kwargs)
4081
4082 def GetInt(*args, **kwargs):
4083 """
4084 GetInt(self) -> long
4085
4086 Returns the integer identifier corresponding to a listbox, choice or radiobox
4087 selection (only if the event was a selection, not a deselection), or a boolean
4088 value representing the value of a checkbox.
4089 """
4090 return _core_.CommandEvent_GetInt(*args, **kwargs)
4091
4092 def Clone(*args, **kwargs):
4093 """Clone(self) -> Event"""
4094 return _core_.CommandEvent_Clone(*args, **kwargs)
4095
4096
4097 class CommandEventPtr(CommandEvent):
4098 def __init__(self, this):
4099 self.this = this
4100 if not hasattr(self,"thisown"): self.thisown = 0
4101 self.__class__ = CommandEvent
4102 _core_.CommandEvent_swigregister(CommandEventPtr)
4103
4104 #---------------------------------------------------------------------------
4105
4106 class NotifyEvent(CommandEvent):
4107 """
4108 An instance of this class (or one of its derived classes) is sent from
4109 a control when the control's state is being changed and the control
4110 allows that change to be prevented from happening. The event handler
4111 can call `Veto` or `Allow` to tell the control what to do.
4112 """
4113 def __repr__(self):
4114 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4115 def __init__(self, *args, **kwargs):
4116 """
4117 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4118
4119 An instance of this class (or one of its derived classes) is sent from
4120 a control when the control's state is being changed and the control
4121 allows that change to be prevented from happening. The event handler
4122 can call `Veto` or `Allow` to tell the control what to do.
4123 """
4124 newobj = _core_.new_NotifyEvent(*args, **kwargs)
4125 self.this = newobj.this
4126 self.thisown = 1
4127 del newobj.thisown
4128 def Veto(*args, **kwargs):
4129 """
4130 Veto(self)
4131
4132 Prevents the change announced by this event from happening.
4133
4134 It is in general a good idea to notify the user about the reasons for
4135 vetoing the change because otherwise the applications behaviour (which
4136 just refuses to do what the user wants) might be quite surprising.
4137 """
4138 return _core_.NotifyEvent_Veto(*args, **kwargs)
4139
4140 def Allow(*args, **kwargs):
4141 """
4142 Allow(self)
4143
4144 This is the opposite of `Veto`: it explicitly allows the event to be
4145 processed. For most events it is not necessary to call this method as
4146 the events are allowed anyhow but some are forbidden by default (this
4147 will be mentioned in the corresponding event description).
4148 """
4149 return _core_.NotifyEvent_Allow(*args, **kwargs)
4150
4151 def IsAllowed(*args, **kwargs):
4152 """
4153 IsAllowed(self) -> bool
4154
4155 Returns true if the change is allowed (`Veto` hasn't been called) or
4156 false otherwise (if it was).
4157 """
4158 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4159
4160
4161 class NotifyEventPtr(NotifyEvent):
4162 def __init__(self, this):
4163 self.this = this
4164 if not hasattr(self,"thisown"): self.thisown = 0
4165 self.__class__ = NotifyEvent
4166 _core_.NotifyEvent_swigregister(NotifyEventPtr)
4167
4168 #---------------------------------------------------------------------------
4169
4170 class ScrollEvent(CommandEvent):
4171 """
4172 A scroll event holds information about events sent from stand-alone
4173 scrollbars and sliders. Note that scrolled windows do not send
4174 instnaces of this event class, but send the `wx.ScrollWinEvent`
4175 instead.
4176 """
4177 def __repr__(self):
4178 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4179 def __init__(self, *args, **kwargs):
4180 """
4181 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4182 int orient=0) -> ScrollEvent
4183 """
4184 newobj = _core_.new_ScrollEvent(*args, **kwargs)
4185 self.this = newobj.this
4186 self.thisown = 1
4187 del newobj.thisown
4188 def GetOrientation(*args, **kwargs):
4189 """
4190 GetOrientation(self) -> int
4191
4192 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4193 the scrollbar.
4194 """
4195 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4196
4197 def GetPosition(*args, **kwargs):
4198 """
4199 GetPosition(self) -> int
4200
4201 Returns the position of the scrollbar.
4202 """
4203 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4204
4205 def SetOrientation(*args, **kwargs):
4206 """SetOrientation(self, int orient)"""
4207 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4208
4209 def SetPosition(*args, **kwargs):
4210 """SetPosition(self, int pos)"""
4211 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4212
4213
4214 class ScrollEventPtr(ScrollEvent):
4215 def __init__(self, this):
4216 self.this = this
4217 if not hasattr(self,"thisown"): self.thisown = 0
4218 self.__class__ = ScrollEvent
4219 _core_.ScrollEvent_swigregister(ScrollEventPtr)
4220
4221 #---------------------------------------------------------------------------
4222
4223 class ScrollWinEvent(Event):
4224 """
4225 A wx.ScrollWinEvent holds information about scrolling and is sent from
4226 scrolling windows.
4227 """
4228 def __repr__(self):
4229 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4230 def __init__(self, *args, **kwargs):
4231 """
4232 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4233
4234 A wx.ScrollWinEvent holds information about scrolling and is sent from
4235 scrolling windows.
4236 """
4237 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
4238 self.this = newobj.this
4239 self.thisown = 1
4240 del newobj.thisown
4241 def GetOrientation(*args, **kwargs):
4242 """
4243 GetOrientation(self) -> int
4244
4245 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4246 the scrollbar.
4247 """
4248 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4249
4250 def GetPosition(*args, **kwargs):
4251 """
4252 GetPosition(self) -> int
4253
4254 Returns the position of the scrollbar for the thumb track and release
4255 events. Note that this field can't be used for the other events, you
4256 need to query the window itself for the current position in that case.
4257 """
4258 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4259
4260 def SetOrientation(*args, **kwargs):
4261 """SetOrientation(self, int orient)"""
4262 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4263
4264 def SetPosition(*args, **kwargs):
4265 """SetPosition(self, int pos)"""
4266 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4267
4268
4269 class ScrollWinEventPtr(ScrollWinEvent):
4270 def __init__(self, this):
4271 self.this = this
4272 if not hasattr(self,"thisown"): self.thisown = 0
4273 self.__class__ = ScrollWinEvent
4274 _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
4275
4276 #---------------------------------------------------------------------------
4277
4278 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4279 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4280 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4281 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4282 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4283 class MouseEvent(Event):
4284 """
4285 This event class contains information about the events generated by
4286 the mouse: they include mouse buttons press and release events and
4287 mouse move events.
4288
4289 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4290 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4291 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4292 a middle button so a portable application should avoid relying on the
4293 events from it.
4294
4295 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4296 the former returns true when the event corresponds to the left mouse
4297 button click while the latter returns true if the left mouse button is
4298 currently being pressed. For example, when the user is dragging the
4299 mouse you can use `LeftIsDown` to test whether the left mouse button
4300 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4301 `LeftIsDown` will also return true in wxWidgets whatever the
4302 underlying GUI behaviour is (which is platform-dependent). The same
4303 applies, of course, to other mouse buttons as well.
4304 """
4305 def __repr__(self):
4306 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4307 def __init__(self, *args, **kwargs):
4308 """
4309 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4310
4311 Constructs a wx.MouseEvent. Valid event types are:
4312
4313 * wxEVT_ENTER_WINDOW
4314 * wxEVT_LEAVE_WINDOW
4315 * wxEVT_LEFT_DOWN
4316 * wxEVT_LEFT_UP
4317 * wxEVT_LEFT_DCLICK
4318 * wxEVT_MIDDLE_DOWN
4319 * wxEVT_MIDDLE_UP
4320 * wxEVT_MIDDLE_DCLICK
4321 * wxEVT_RIGHT_DOWN
4322 * wxEVT_RIGHT_UP
4323 * wxEVT_RIGHT_DCLICK
4324 * wxEVT_MOTION
4325 * wxEVT_MOUSEWHEEL
4326 """
4327 newobj = _core_.new_MouseEvent(*args, **kwargs)
4328 self.this = newobj.this
4329 self.thisown = 1
4330 del newobj.thisown
4331 def IsButton(*args, **kwargs):
4332 """
4333 IsButton(self) -> bool
4334
4335 Returns true if the event was a mouse button event (not necessarily a
4336 button down event - that may be tested using `ButtonDown`).
4337 """
4338 return _core_.MouseEvent_IsButton(*args, **kwargs)
4339
4340 def ButtonDown(*args, **kwargs):
4341 """
4342 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4343
4344 If the argument is omitted, this returns true if the event was any mouse
4345 button down event. Otherwise the argument specifies which button-down
4346 event shold be checked for (see `Button` for the possible values).
4347 """
4348 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4349
4350 def ButtonDClick(*args, **kwargs):
4351 """
4352 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4353
4354 If the argument is omitted, this returns true if the event was any
4355 mouse double click event. Otherwise the argument specifies which
4356 double click event to check for (see `Button` for the possible
4357 values).
4358 """
4359 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4360
4361 def ButtonUp(*args, **kwargs):
4362 """
4363 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4364
4365 If the argument is omitted, this returns true if the event was any
4366 mouse button up event. Otherwise the argument specifies which
4367 button up event to check for (see `Button` for the possible values).
4368 """
4369 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4370
4371 def Button(*args, **kwargs):
4372 """
4373 Button(self, int button) -> bool
4374
4375 Returns true if the identified mouse button is changing state. Valid
4376 values of button are:
4377
4378 ==================== =====================================
4379 wx.MOUSE_BTN_LEFT check if left button was pressed
4380 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4381 wx.MOUSE_BTN_RIGHT check if right button was pressed
4382 wx.MOUSE_BTN_ANY check if any button was pressed
4383 ==================== =====================================
4384
4385 """
4386 return _core_.MouseEvent_Button(*args, **kwargs)
4387
4388 def ButtonIsDown(*args, **kwargs):
4389 """ButtonIsDown(self, int but) -> bool"""
4390 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4391
4392 def GetButton(*args, **kwargs):
4393 """
4394 GetButton(self) -> int
4395
4396 Returns the mouse button which generated this event or
4397 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4398 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4399 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4400 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4401 right buttons respectively.
4402 """
4403 return _core_.MouseEvent_GetButton(*args, **kwargs)
4404
4405 def ControlDown(*args, **kwargs):
4406 """
4407 ControlDown(self) -> bool
4408
4409 Returns true if the control key was down at the time of the event.
4410 """
4411 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4412
4413 def MetaDown(*args, **kwargs):
4414 """
4415 MetaDown(self) -> bool
4416
4417 Returns true if the Meta key was down at the time of the event.
4418 """
4419 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4420
4421 def AltDown(*args, **kwargs):
4422 """
4423 AltDown(self) -> bool
4424
4425 Returns true if the Alt key was down at the time of the event.
4426 """
4427 return _core_.MouseEvent_AltDown(*args, **kwargs)
4428
4429 def ShiftDown(*args, **kwargs):
4430 """
4431 ShiftDown(self) -> bool
4432
4433 Returns true if the Shift key was down at the time of the event.
4434 """
4435 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4436
4437 def CmdDown(*args, **kwargs):
4438 """
4439 CmdDown(self) -> bool
4440
4441 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4442 platforms but the special "Apple" (a.k.a as "Command") key on
4443 Macs: it often makes sense to use it instead of, say, `ControlDown`
4444 because Cmd key is used for the same thing under Mac as Ctrl
4445 elsewhere. The Ctrl key still exists, it's just not used for this
4446 purpose. So for non-Mac platforms this is the same as `ControlDown`
4447 and Macs this is the same as `MetaDown`.
4448 """
4449 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4450
4451 def LeftDown(*args, **kwargs):
4452 """
4453 LeftDown(self) -> bool
4454
4455 Returns true if the left mouse button state changed to down.
4456 """
4457 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4458
4459 def MiddleDown(*args, **kwargs):
4460 """
4461 MiddleDown(self) -> bool
4462
4463 Returns true if the middle mouse button state changed to down.
4464 """
4465 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4466
4467 def RightDown(*args, **kwargs):
4468 """
4469 RightDown(self) -> bool
4470
4471 Returns true if the right mouse button state changed to down.
4472 """
4473 return _core_.MouseEvent_RightDown(*args, **kwargs)
4474
4475 def LeftUp(*args, **kwargs):
4476 """
4477 LeftUp(self) -> bool
4478
4479 Returns true if the left mouse button state changed to up.
4480 """
4481 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4482
4483 def MiddleUp(*args, **kwargs):
4484 """
4485 MiddleUp(self) -> bool
4486
4487 Returns true if the middle mouse button state changed to up.
4488 """
4489 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4490
4491 def RightUp(*args, **kwargs):
4492 """
4493 RightUp(self) -> bool
4494
4495 Returns true if the right mouse button state changed to up.
4496 """
4497 return _core_.MouseEvent_RightUp(*args, **kwargs)
4498
4499 def LeftDClick(*args, **kwargs):
4500 """
4501 LeftDClick(self) -> bool
4502
4503 Returns true if the event was a left button double click.
4504 """
4505 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4506
4507 def MiddleDClick(*args, **kwargs):
4508 """
4509 MiddleDClick(self) -> bool
4510
4511 Returns true if the event was a middle button double click.
4512 """
4513 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4514
4515 def RightDClick(*args, **kwargs):
4516 """
4517 RightDClick(self) -> bool
4518
4519 Returns true if the event was a right button double click.
4520 """
4521 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4522
4523 def LeftIsDown(*args, **kwargs):
4524 """
4525 LeftIsDown(self) -> bool
4526
4527 Returns true if the left mouse button is currently down, independent
4528 of the current event type.
4529
4530 Please notice that it is not the same as LeftDown which returns true
4531 if the left mouse button was just pressed. Rather, it describes the
4532 state of the mouse button before the event happened.
4533
4534 This event is usually used in the mouse event handlers which process
4535 "move mouse" messages to determine whether the user is (still)
4536 dragging the mouse.
4537 """
4538 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4539
4540 def MiddleIsDown(*args, **kwargs):
4541 """
4542 MiddleIsDown(self) -> bool
4543
4544 Returns true if the middle mouse button is currently down, independent
4545 of the current event type.
4546 """
4547 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4548
4549 def RightIsDown(*args, **kwargs):
4550 """
4551 RightIsDown(self) -> bool
4552
4553 Returns true if the right mouse button is currently down, independent
4554 of the current event type.
4555 """
4556 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4557
4558 def Dragging(*args, **kwargs):
4559 """
4560 Dragging(self) -> bool
4561
4562 Returns true if this was a dragging event (motion while a button is
4563 depressed).
4564 """
4565 return _core_.MouseEvent_Dragging(*args, **kwargs)
4566
4567 def Moving(*args, **kwargs):
4568 """
4569 Moving(self) -> bool
4570
4571 Returns true if this was a motion event and no mouse buttons were
4572 pressed. If any mouse button is held pressed, then this method returns
4573 false and Dragging returns true.
4574 """
4575 return _core_.MouseEvent_Moving(*args, **kwargs)
4576
4577 def Entering(*args, **kwargs):
4578 """
4579 Entering(self) -> bool
4580
4581 Returns true if the mouse was entering the window.
4582 """
4583 return _core_.MouseEvent_Entering(*args, **kwargs)
4584
4585 def Leaving(*args, **kwargs):
4586 """
4587 Leaving(self) -> bool
4588
4589 Returns true if the mouse was leaving the window.
4590 """
4591 return _core_.MouseEvent_Leaving(*args, **kwargs)
4592
4593 def GetPosition(*args, **kwargs):
4594 """
4595 GetPosition(self) -> Point
4596
4597 Returns the pixel position of the mouse in window coordinates when the
4598 event happened.
4599 """
4600 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4601
4602 def GetPositionTuple(*args, **kwargs):
4603 """
4604 GetPositionTuple() -> (x,y)
4605
4606 Returns the pixel position of the mouse in window coordinates when the
4607 event happened.
4608 """
4609 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4610
4611 def GetLogicalPosition(*args, **kwargs):
4612 """
4613 GetLogicalPosition(self, DC dc) -> Point
4614
4615 Returns the logical mouse position in pixels (i.e. translated
4616 according to the translation set for the DC, which usually indicates
4617 that the window has been scrolled).
4618 """
4619 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4620
4621 def GetX(*args, **kwargs):
4622 """
4623 GetX(self) -> int
4624
4625 Returns X coordinate of the physical mouse event position.
4626 """
4627 return _core_.MouseEvent_GetX(*args, **kwargs)
4628
4629 def GetY(*args, **kwargs):
4630 """
4631 GetY(self) -> int
4632
4633 Returns Y coordinate of the physical mouse event position.
4634 """
4635 return _core_.MouseEvent_GetY(*args, **kwargs)
4636
4637 def GetWheelRotation(*args, **kwargs):
4638 """
4639 GetWheelRotation(self) -> int
4640
4641 Get wheel rotation, positive or negative indicates direction of
4642 rotation. Current devices all send an event when rotation is equal to
4643 +/-WheelDelta, but this allows for finer resolution devices to be
4644 created in the future. Because of this you shouldn't assume that one
4645 event is equal to 1 line or whatever, but you should be able to either
4646 do partial line scrolling or wait until +/-WheelDelta rotation values
4647 have been accumulated before scrolling.
4648 """
4649 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4650
4651 def GetWheelDelta(*args, **kwargs):
4652 """
4653 GetWheelDelta(self) -> int
4654
4655 Get wheel delta, normally 120. This is the threshold for action to be
4656 taken, and one such action (for example, scrolling one increment)
4657 should occur for each delta.
4658 """
4659 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4660
4661 def GetLinesPerAction(*args, **kwargs):
4662 """
4663 GetLinesPerAction(self) -> int
4664
4665 Returns the configured number of lines (or whatever) to be scrolled
4666 per wheel action. Defaults to three.
4667 """
4668 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4669
4670 def IsPageScroll(*args, **kwargs):
4671 """
4672 IsPageScroll(self) -> bool
4673
4674 Returns true if the system has been setup to do page scrolling with
4675 the mouse wheel instead of line scrolling.
4676 """
4677 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4678
4679 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4680 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4681 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4682 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4683 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4684 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4685 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4686 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4687 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4688 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4689 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4690 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4691
4692 class MouseEventPtr(MouseEvent):
4693 def __init__(self, this):
4694 self.this = this
4695 if not hasattr(self,"thisown"): self.thisown = 0
4696 self.__class__ = MouseEvent
4697 _core_.MouseEvent_swigregister(MouseEventPtr)
4698
4699 #---------------------------------------------------------------------------
4700
4701 class SetCursorEvent(Event):
4702 """Proxy of C++ SetCursorEvent class"""
4703 def __repr__(self):
4704 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4705 def __init__(self, *args, **kwargs):
4706 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
4707 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
4708 self.this = newobj.this
4709 self.thisown = 1
4710 del newobj.thisown
4711 def GetX(*args, **kwargs):
4712 """GetX(self) -> int"""
4713 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4714
4715 def GetY(*args, **kwargs):
4716 """GetY(self) -> int"""
4717 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4718
4719 def SetCursor(*args, **kwargs):
4720 """SetCursor(self, Cursor cursor)"""
4721 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4722
4723 def GetCursor(*args, **kwargs):
4724 """GetCursor(self) -> Cursor"""
4725 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4726
4727 def HasCursor(*args, **kwargs):
4728 """HasCursor(self) -> bool"""
4729 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4730
4731
4732 class SetCursorEventPtr(SetCursorEvent):
4733 def __init__(self, this):
4734 self.this = this
4735 if not hasattr(self,"thisown"): self.thisown = 0
4736 self.__class__ = SetCursorEvent
4737 _core_.SetCursorEvent_swigregister(SetCursorEventPtr)
4738
4739 #---------------------------------------------------------------------------
4740
4741 class KeyEvent(Event):
4742 """Proxy of C++ KeyEvent class"""
4743 def __repr__(self):
4744 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4745 def __init__(self, *args, **kwargs):
4746 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
4747 newobj = _core_.new_KeyEvent(*args, **kwargs)
4748 self.this = newobj.this
4749 self.thisown = 1
4750 del newobj.thisown
4751 def ControlDown(*args, **kwargs):
4752 """ControlDown(self) -> bool"""
4753 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4754
4755 def MetaDown(*args, **kwargs):
4756 """MetaDown(self) -> bool"""
4757 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4758
4759 def AltDown(*args, **kwargs):
4760 """AltDown(self) -> bool"""
4761 return _core_.KeyEvent_AltDown(*args, **kwargs)
4762
4763 def ShiftDown(*args, **kwargs):
4764 """ShiftDown(self) -> bool"""
4765 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4766
4767 def CmdDown(*args, **kwargs):
4768 """
4769 CmdDown(self) -> bool
4770
4771 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4772 platforms but the special "Apple" (a.k.a as "Command") key on
4773 Macs: it makes often sense to use it instead of, say, `ControlDown`
4774 because Cmd key is used for the same thing under Mac as Ctrl
4775 elsewhere. The Ctrl still exists, it's just not used for this
4776 purpose. So for non-Mac platforms this is the same as `ControlDown`
4777 and Macs this is the same as `MetaDown`.
4778 """
4779 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4780
4781 def HasModifiers(*args, **kwargs):
4782 """HasModifiers(self) -> bool"""
4783 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4784
4785 def GetKeyCode(*args, **kwargs):
4786 """GetKeyCode(self) -> int"""
4787 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4788
4789 KeyCode = GetKeyCode
4790 def GetUnicodeKey(*args, **kwargs):
4791 """GetUnicodeKey(self) -> int"""
4792 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
4793
4794 GetUniChar = GetUnicodeKey
4795 def GetRawKeyCode(*args, **kwargs):
4796 """GetRawKeyCode(self) -> unsigned int"""
4797 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4798
4799 def GetRawKeyFlags(*args, **kwargs):
4800 """GetRawKeyFlags(self) -> unsigned int"""
4801 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4802
4803 def GetPosition(*args, **kwargs):
4804 """
4805 GetPosition(self) -> Point
4806
4807 Find the position of the event.
4808 """
4809 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4810
4811 def GetPositionTuple(*args, **kwargs):
4812 """
4813 GetPositionTuple() -> (x,y)
4814
4815 Find the position of the event.
4816 """
4817 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4818
4819 def GetX(*args, **kwargs):
4820 """GetX(self) -> int"""
4821 return _core_.KeyEvent_GetX(*args, **kwargs)
4822
4823 def GetY(*args, **kwargs):
4824 """GetY(self) -> int"""
4825 return _core_.KeyEvent_GetY(*args, **kwargs)
4826
4827 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4828 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4829 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4830 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4831 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4832 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4833 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4834 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4835 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4836 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4837
4838 class KeyEventPtr(KeyEvent):
4839 def __init__(self, this):
4840 self.this = this
4841 if not hasattr(self,"thisown"): self.thisown = 0
4842 self.__class__ = KeyEvent
4843 _core_.KeyEvent_swigregister(KeyEventPtr)
4844
4845 #---------------------------------------------------------------------------
4846
4847 class SizeEvent(Event):
4848 """Proxy of C++ SizeEvent class"""
4849 def __repr__(self):
4850 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4851 def __init__(self, *args, **kwargs):
4852 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
4853 newobj = _core_.new_SizeEvent(*args, **kwargs)
4854 self.this = newobj.this
4855 self.thisown = 1
4856 del newobj.thisown
4857 def GetSize(*args, **kwargs):
4858 """GetSize(self) -> Size"""
4859 return _core_.SizeEvent_GetSize(*args, **kwargs)
4860
4861 def GetRect(*args, **kwargs):
4862 """GetRect(self) -> Rect"""
4863 return _core_.SizeEvent_GetRect(*args, **kwargs)
4864
4865 def SetRect(*args, **kwargs):
4866 """SetRect(self, Rect rect)"""
4867 return _core_.SizeEvent_SetRect(*args, **kwargs)
4868
4869 def SetSize(*args, **kwargs):
4870 """SetSize(self, Size size)"""
4871 return _core_.SizeEvent_SetSize(*args, **kwargs)
4872
4873 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4874 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
4875
4876 class SizeEventPtr(SizeEvent):
4877 def __init__(self, this):
4878 self.this = this
4879 if not hasattr(self,"thisown"): self.thisown = 0
4880 self.__class__ = SizeEvent
4881 _core_.SizeEvent_swigregister(SizeEventPtr)
4882
4883 #---------------------------------------------------------------------------
4884
4885 class MoveEvent(Event):
4886 """Proxy of C++ MoveEvent class"""
4887 def __repr__(self):
4888 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4889 def __init__(self, *args, **kwargs):
4890 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
4891 newobj = _core_.new_MoveEvent(*args, **kwargs)
4892 self.this = newobj.this
4893 self.thisown = 1
4894 del newobj.thisown
4895 def GetPosition(*args, **kwargs):
4896 """GetPosition(self) -> Point"""
4897 return _core_.MoveEvent_GetPosition(*args, **kwargs)
4898
4899 def GetRect(*args, **kwargs):
4900 """GetRect(self) -> Rect"""
4901 return _core_.MoveEvent_GetRect(*args, **kwargs)
4902
4903 def SetRect(*args, **kwargs):
4904 """SetRect(self, Rect rect)"""
4905 return _core_.MoveEvent_SetRect(*args, **kwargs)
4906
4907 def SetPosition(*args, **kwargs):
4908 """SetPosition(self, Point pos)"""
4909 return _core_.MoveEvent_SetPosition(*args, **kwargs)
4910
4911 m_pos = property(GetPosition, SetPosition)
4912 m_rect = property(GetRect, SetRect)
4913
4914
4915 class MoveEventPtr(MoveEvent):
4916 def __init__(self, this):
4917 self.this = this
4918 if not hasattr(self,"thisown"): self.thisown = 0
4919 self.__class__ = MoveEvent
4920 _core_.MoveEvent_swigregister(MoveEventPtr)
4921
4922 #---------------------------------------------------------------------------
4923
4924 class PaintEvent(Event):
4925 """Proxy of C++ PaintEvent class"""
4926 def __repr__(self):
4927 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4928 def __init__(self, *args, **kwargs):
4929 """__init__(self, int Id=0) -> PaintEvent"""
4930 newobj = _core_.new_PaintEvent(*args, **kwargs)
4931 self.this = newobj.this
4932 self.thisown = 1
4933 del newobj.thisown
4934
4935 class PaintEventPtr(PaintEvent):
4936 def __init__(self, this):
4937 self.this = this
4938 if not hasattr(self,"thisown"): self.thisown = 0
4939 self.__class__ = PaintEvent
4940 _core_.PaintEvent_swigregister(PaintEventPtr)
4941
4942 class NcPaintEvent(Event):
4943 """Proxy of C++ NcPaintEvent class"""
4944 def __repr__(self):
4945 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4946 def __init__(self, *args, **kwargs):
4947 """__init__(self, int winid=0) -> NcPaintEvent"""
4948 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
4949 self.this = newobj.this
4950 self.thisown = 1
4951 del newobj.thisown
4952
4953 class NcPaintEventPtr(NcPaintEvent):
4954 def __init__(self, this):
4955 self.this = this
4956 if not hasattr(self,"thisown"): self.thisown = 0
4957 self.__class__ = NcPaintEvent
4958 _core_.NcPaintEvent_swigregister(NcPaintEventPtr)
4959
4960 #---------------------------------------------------------------------------
4961
4962 class EraseEvent(Event):
4963 """Proxy of C++ EraseEvent class"""
4964 def __repr__(self):
4965 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4966 def __init__(self, *args, **kwargs):
4967 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
4968 newobj = _core_.new_EraseEvent(*args, **kwargs)
4969 self.this = newobj.this
4970 self.thisown = 1
4971 del newobj.thisown
4972 def GetDC(*args, **kwargs):
4973 """GetDC(self) -> DC"""
4974 return _core_.EraseEvent_GetDC(*args, **kwargs)
4975
4976
4977 class EraseEventPtr(EraseEvent):
4978 def __init__(self, this):
4979 self.this = this
4980 if not hasattr(self,"thisown"): self.thisown = 0
4981 self.__class__ = EraseEvent
4982 _core_.EraseEvent_swigregister(EraseEventPtr)
4983
4984 #---------------------------------------------------------------------------
4985
4986 class FocusEvent(Event):
4987 """Proxy of C++ FocusEvent class"""
4988 def __repr__(self):
4989 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4990 def __init__(self, *args, **kwargs):
4991 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
4992 newobj = _core_.new_FocusEvent(*args, **kwargs)
4993 self.this = newobj.this
4994 self.thisown = 1
4995 del newobj.thisown
4996 def GetWindow(*args, **kwargs):
4997 """GetWindow(self) -> Window"""
4998 return _core_.FocusEvent_GetWindow(*args, **kwargs)
4999
5000 def SetWindow(*args, **kwargs):
5001 """SetWindow(self, Window win)"""
5002 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5003
5004
5005 class FocusEventPtr(FocusEvent):
5006 def __init__(self, this):
5007 self.this = this
5008 if not hasattr(self,"thisown"): self.thisown = 0
5009 self.__class__ = FocusEvent
5010 _core_.FocusEvent_swigregister(FocusEventPtr)
5011
5012 #---------------------------------------------------------------------------
5013
5014 class ChildFocusEvent(CommandEvent):
5015 """Proxy of C++ ChildFocusEvent class"""
5016 def __repr__(self):
5017 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5018 def __init__(self, *args, **kwargs):
5019 """__init__(self, Window win=None) -> ChildFocusEvent"""
5020 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
5021 self.this = newobj.this
5022 self.thisown = 1
5023 del newobj.thisown
5024 def GetWindow(*args, **kwargs):
5025 """GetWindow(self) -> Window"""
5026 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5027
5028
5029 class ChildFocusEventPtr(ChildFocusEvent):
5030 def __init__(self, this):
5031 self.this = this
5032 if not hasattr(self,"thisown"): self.thisown = 0
5033 self.__class__ = ChildFocusEvent
5034 _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
5035
5036 #---------------------------------------------------------------------------
5037
5038 class ActivateEvent(Event):
5039 """Proxy of C++ ActivateEvent class"""
5040 def __repr__(self):
5041 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5042 def __init__(self, *args, **kwargs):
5043 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
5044 newobj = _core_.new_ActivateEvent(*args, **kwargs)
5045 self.this = newobj.this
5046 self.thisown = 1
5047 del newobj.thisown
5048 def GetActive(*args, **kwargs):
5049 """GetActive(self) -> bool"""
5050 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5051
5052
5053 class ActivateEventPtr(ActivateEvent):
5054 def __init__(self, this):
5055 self.this = this
5056 if not hasattr(self,"thisown"): self.thisown = 0
5057 self.__class__ = ActivateEvent
5058 _core_.ActivateEvent_swigregister(ActivateEventPtr)
5059
5060 #---------------------------------------------------------------------------
5061
5062 class InitDialogEvent(Event):
5063 """Proxy of C++ InitDialogEvent class"""
5064 def __repr__(self):
5065 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5066 def __init__(self, *args, **kwargs):
5067 """__init__(self, int Id=0) -> InitDialogEvent"""
5068 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
5069 self.this = newobj.this
5070 self.thisown = 1
5071 del newobj.thisown
5072
5073 class InitDialogEventPtr(InitDialogEvent):
5074 def __init__(self, this):
5075 self.this = this
5076 if not hasattr(self,"thisown"): self.thisown = 0
5077 self.__class__ = InitDialogEvent
5078 _core_.InitDialogEvent_swigregister(InitDialogEventPtr)
5079
5080 #---------------------------------------------------------------------------
5081
5082 class MenuEvent(Event):
5083 """Proxy of C++ MenuEvent class"""
5084 def __repr__(self):
5085 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5086 def __init__(self, *args, **kwargs):
5087 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
5088 newobj = _core_.new_MenuEvent(*args, **kwargs)
5089 self.this = newobj.this
5090 self.thisown = 1
5091 del newobj.thisown
5092 def GetMenuId(*args, **kwargs):
5093 """GetMenuId(self) -> int"""
5094 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5095
5096 def IsPopup(*args, **kwargs):
5097 """IsPopup(self) -> bool"""
5098 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5099
5100 def GetMenu(*args, **kwargs):
5101 """GetMenu(self) -> Menu"""
5102 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5103
5104
5105 class MenuEventPtr(MenuEvent):
5106 def __init__(self, this):
5107 self.this = this
5108 if not hasattr(self,"thisown"): self.thisown = 0
5109 self.__class__ = MenuEvent
5110 _core_.MenuEvent_swigregister(MenuEventPtr)
5111
5112 #---------------------------------------------------------------------------
5113
5114 class CloseEvent(Event):
5115 """Proxy of C++ CloseEvent class"""
5116 def __repr__(self):
5117 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5118 def __init__(self, *args, **kwargs):
5119 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
5120 newobj = _core_.new_CloseEvent(*args, **kwargs)
5121 self.this = newobj.this
5122 self.thisown = 1
5123 del newobj.thisown
5124 def SetLoggingOff(*args, **kwargs):
5125 """SetLoggingOff(self, bool logOff)"""
5126 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5127
5128 def GetLoggingOff(*args, **kwargs):
5129 """GetLoggingOff(self) -> bool"""
5130 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5131
5132 def Veto(*args, **kwargs):
5133 """Veto(self, bool veto=True)"""
5134 return _core_.CloseEvent_Veto(*args, **kwargs)
5135
5136 def SetCanVeto(*args, **kwargs):
5137 """SetCanVeto(self, bool canVeto)"""
5138 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5139
5140 def CanVeto(*args, **kwargs):
5141 """CanVeto(self) -> bool"""
5142 return _core_.CloseEvent_CanVeto(*args, **kwargs)
5143
5144 def GetVeto(*args, **kwargs):
5145 """GetVeto(self) -> bool"""
5146 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5147
5148
5149 class CloseEventPtr(CloseEvent):
5150 def __init__(self, this):
5151 self.this = this
5152 if not hasattr(self,"thisown"): self.thisown = 0
5153 self.__class__ = CloseEvent
5154 _core_.CloseEvent_swigregister(CloseEventPtr)
5155
5156 #---------------------------------------------------------------------------
5157
5158 class ShowEvent(Event):
5159 """Proxy of C++ ShowEvent class"""
5160 def __repr__(self):
5161 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5162 def __init__(self, *args, **kwargs):
5163 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
5164 newobj = _core_.new_ShowEvent(*args, **kwargs)
5165 self.this = newobj.this
5166 self.thisown = 1
5167 del newobj.thisown
5168 def SetShow(*args, **kwargs):
5169 """SetShow(self, bool show)"""
5170 return _core_.ShowEvent_SetShow(*args, **kwargs)
5171
5172 def GetShow(*args, **kwargs):
5173 """GetShow(self) -> bool"""
5174 return _core_.ShowEvent_GetShow(*args, **kwargs)
5175
5176
5177 class ShowEventPtr(ShowEvent):
5178 def __init__(self, this):
5179 self.this = this
5180 if not hasattr(self,"thisown"): self.thisown = 0
5181 self.__class__ = ShowEvent
5182 _core_.ShowEvent_swigregister(ShowEventPtr)
5183
5184 #---------------------------------------------------------------------------
5185
5186 class IconizeEvent(Event):
5187 """Proxy of C++ IconizeEvent class"""
5188 def __repr__(self):
5189 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5190 def __init__(self, *args, **kwargs):
5191 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
5192 newobj = _core_.new_IconizeEvent(*args, **kwargs)
5193 self.this = newobj.this
5194 self.thisown = 1
5195 del newobj.thisown
5196 def Iconized(*args, **kwargs):
5197 """Iconized(self) -> bool"""
5198 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5199
5200
5201 class IconizeEventPtr(IconizeEvent):
5202 def __init__(self, this):
5203 self.this = this
5204 if not hasattr(self,"thisown"): self.thisown = 0
5205 self.__class__ = IconizeEvent
5206 _core_.IconizeEvent_swigregister(IconizeEventPtr)
5207
5208 #---------------------------------------------------------------------------
5209
5210 class MaximizeEvent(Event):
5211 """Proxy of C++ MaximizeEvent class"""
5212 def __repr__(self):
5213 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5214 def __init__(self, *args, **kwargs):
5215 """__init__(self, int id=0) -> MaximizeEvent"""
5216 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
5217 self.this = newobj.this
5218 self.thisown = 1
5219 del newobj.thisown
5220
5221 class MaximizeEventPtr(MaximizeEvent):
5222 def __init__(self, this):
5223 self.this = this
5224 if not hasattr(self,"thisown"): self.thisown = 0
5225 self.__class__ = MaximizeEvent
5226 _core_.MaximizeEvent_swigregister(MaximizeEventPtr)
5227
5228 #---------------------------------------------------------------------------
5229
5230 class DropFilesEvent(Event):
5231 """Proxy of C++ DropFilesEvent class"""
5232 def __init__(self): raise RuntimeError, "No constructor defined"
5233 def __repr__(self):
5234 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5235 def GetPosition(*args, **kwargs):
5236 """GetPosition(self) -> Point"""
5237 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5238
5239 def GetNumberOfFiles(*args, **kwargs):
5240 """GetNumberOfFiles(self) -> int"""
5241 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5242
5243 def GetFiles(*args, **kwargs):
5244 """GetFiles(self) -> PyObject"""
5245 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5246
5247
5248 class DropFilesEventPtr(DropFilesEvent):
5249 def __init__(self, this):
5250 self.this = this
5251 if not hasattr(self,"thisown"): self.thisown = 0
5252 self.__class__ = DropFilesEvent
5253 _core_.DropFilesEvent_swigregister(DropFilesEventPtr)
5254
5255 #---------------------------------------------------------------------------
5256
5257 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5258 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5259 class UpdateUIEvent(CommandEvent):
5260 """Proxy of C++ UpdateUIEvent class"""
5261 def __repr__(self):
5262 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5263 def __init__(self, *args, **kwargs):
5264 """__init__(self, int commandId=0) -> UpdateUIEvent"""
5265 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
5266 self.this = newobj.this
5267 self.thisown = 1
5268 del newobj.thisown
5269 def GetChecked(*args, **kwargs):
5270 """GetChecked(self) -> bool"""
5271 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5272
5273 def GetEnabled(*args, **kwargs):
5274 """GetEnabled(self) -> bool"""
5275 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5276
5277 def GetText(*args, **kwargs):
5278 """GetText(self) -> String"""
5279 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5280
5281 def GetSetText(*args, **kwargs):
5282 """GetSetText(self) -> bool"""
5283 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5284
5285 def GetSetChecked(*args, **kwargs):
5286 """GetSetChecked(self) -> bool"""
5287 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5288
5289 def GetSetEnabled(*args, **kwargs):
5290 """GetSetEnabled(self) -> bool"""
5291 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5292
5293 def Check(*args, **kwargs):
5294 """Check(self, bool check)"""
5295 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5296
5297 def Enable(*args, **kwargs):
5298 """Enable(self, bool enable)"""
5299 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5300
5301 def SetText(*args, **kwargs):
5302 """SetText(self, String text)"""
5303 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5304
5305 def SetUpdateInterval(*args, **kwargs):
5306 """SetUpdateInterval(long updateInterval)"""
5307 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5308
5309 SetUpdateInterval = staticmethod(SetUpdateInterval)
5310 def GetUpdateInterval(*args, **kwargs):
5311 """GetUpdateInterval() -> long"""
5312 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5313
5314 GetUpdateInterval = staticmethod(GetUpdateInterval)
5315 def CanUpdate(*args, **kwargs):
5316 """CanUpdate(Window win) -> bool"""
5317 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5318
5319 CanUpdate = staticmethod(CanUpdate)
5320 def ResetUpdateTime(*args, **kwargs):
5321 """ResetUpdateTime()"""
5322 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5323
5324 ResetUpdateTime = staticmethod(ResetUpdateTime)
5325 def SetMode(*args, **kwargs):
5326 """SetMode(int mode)"""
5327 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5328
5329 SetMode = staticmethod(SetMode)
5330 def GetMode(*args, **kwargs):
5331 """GetMode() -> int"""
5332 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5333
5334 GetMode = staticmethod(GetMode)
5335
5336 class UpdateUIEventPtr(UpdateUIEvent):
5337 def __init__(self, this):
5338 self.this = this
5339 if not hasattr(self,"thisown"): self.thisown = 0
5340 self.__class__ = UpdateUIEvent
5341 _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
5342
5343 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5344 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
5345 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5346
5347 def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
5348 """UpdateUIEvent_GetUpdateInterval() -> long"""
5349 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5350
5351 def UpdateUIEvent_CanUpdate(*args, **kwargs):
5352 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
5353 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5354
5355 def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
5356 """UpdateUIEvent_ResetUpdateTime()"""
5357 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5358
5359 def UpdateUIEvent_SetMode(*args, **kwargs):
5360 """UpdateUIEvent_SetMode(int mode)"""
5361 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5362
5363 def UpdateUIEvent_GetMode(*args, **kwargs):
5364 """UpdateUIEvent_GetMode() -> int"""
5365 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5366
5367 #---------------------------------------------------------------------------
5368
5369 class SysColourChangedEvent(Event):
5370 """Proxy of C++ SysColourChangedEvent class"""
5371 def __repr__(self):
5372 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5373 def __init__(self, *args, **kwargs):
5374 """__init__(self) -> SysColourChangedEvent"""
5375 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
5376 self.this = newobj.this
5377 self.thisown = 1
5378 del newobj.thisown
5379
5380 class SysColourChangedEventPtr(SysColourChangedEvent):
5381 def __init__(self, this):
5382 self.this = this
5383 if not hasattr(self,"thisown"): self.thisown = 0
5384 self.__class__ = SysColourChangedEvent
5385 _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
5386
5387 #---------------------------------------------------------------------------
5388
5389 class MouseCaptureChangedEvent(Event):
5390 """Proxy of C++ MouseCaptureChangedEvent class"""
5391 def __repr__(self):
5392 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5393 def __init__(self, *args, **kwargs):
5394 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
5395 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
5396 self.this = newobj.this
5397 self.thisown = 1
5398 del newobj.thisown
5399 def GetCapturedWindow(*args, **kwargs):
5400 """GetCapturedWindow(self) -> Window"""
5401 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5402
5403
5404 class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
5405 def __init__(self, this):
5406 self.this = this
5407 if not hasattr(self,"thisown"): self.thisown = 0
5408 self.__class__ = MouseCaptureChangedEvent
5409 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
5410
5411 #---------------------------------------------------------------------------
5412
5413 class DisplayChangedEvent(Event):
5414 """Proxy of C++ DisplayChangedEvent class"""
5415 def __repr__(self):
5416 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5417 def __init__(self, *args, **kwargs):
5418 """__init__(self) -> DisplayChangedEvent"""
5419 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
5420 self.this = newobj.this
5421 self.thisown = 1
5422 del newobj.thisown
5423
5424 class DisplayChangedEventPtr(DisplayChangedEvent):
5425 def __init__(self, this):
5426 self.this = this
5427 if not hasattr(self,"thisown"): self.thisown = 0
5428 self.__class__ = DisplayChangedEvent
5429 _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
5430
5431 #---------------------------------------------------------------------------
5432
5433 class PaletteChangedEvent(Event):
5434 """Proxy of C++ PaletteChangedEvent class"""
5435 def __repr__(self):
5436 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5437 def __init__(self, *args, **kwargs):
5438 """__init__(self, int id=0) -> PaletteChangedEvent"""
5439 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
5440 self.this = newobj.this
5441 self.thisown = 1
5442 del newobj.thisown
5443 def SetChangedWindow(*args, **kwargs):
5444 """SetChangedWindow(self, Window win)"""
5445 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
5446
5447 def GetChangedWindow(*args, **kwargs):
5448 """GetChangedWindow(self) -> Window"""
5449 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
5450
5451
5452 class PaletteChangedEventPtr(PaletteChangedEvent):
5453 def __init__(self, this):
5454 self.this = this
5455 if not hasattr(self,"thisown"): self.thisown = 0
5456 self.__class__ = PaletteChangedEvent
5457 _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
5458
5459 #---------------------------------------------------------------------------
5460
5461 class QueryNewPaletteEvent(Event):
5462 """Proxy of C++ QueryNewPaletteEvent class"""
5463 def __repr__(self):
5464 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5465 def __init__(self, *args, **kwargs):
5466 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
5467 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
5468 self.this = newobj.this
5469 self.thisown = 1
5470 del newobj.thisown
5471 def SetPaletteRealized(*args, **kwargs):
5472 """SetPaletteRealized(self, bool realized)"""
5473 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
5474
5475 def GetPaletteRealized(*args, **kwargs):
5476 """GetPaletteRealized(self) -> bool"""
5477 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
5478
5479
5480 class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
5481 def __init__(self, this):
5482 self.this = this
5483 if not hasattr(self,"thisown"): self.thisown = 0
5484 self.__class__ = QueryNewPaletteEvent
5485 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
5486
5487 #---------------------------------------------------------------------------
5488
5489 class NavigationKeyEvent(Event):
5490 """Proxy of C++ NavigationKeyEvent class"""
5491 def __repr__(self):
5492 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5493 def __init__(self, *args, **kwargs):
5494 """__init__(self) -> NavigationKeyEvent"""
5495 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
5496 self.this = newobj.this
5497 self.thisown = 1
5498 del newobj.thisown
5499 def GetDirection(*args, **kwargs):
5500 """GetDirection(self) -> bool"""
5501 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
5502
5503 def SetDirection(*args, **kwargs):
5504 """SetDirection(self, bool forward)"""
5505 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
5506
5507 def IsWindowChange(*args, **kwargs):
5508 """IsWindowChange(self) -> bool"""
5509 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
5510
5511 def SetWindowChange(*args, **kwargs):
5512 """SetWindowChange(self, bool ischange)"""
5513 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
5514
5515 def IsFromTab(*args, **kwargs):
5516 """IsFromTab(self) -> bool"""
5517 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
5518
5519 def SetFromTab(*args, **kwargs):
5520 """SetFromTab(self, bool bIs)"""
5521 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
5522
5523 def SetFlags(*args, **kwargs):
5524 """SetFlags(self, long flags)"""
5525 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
5526
5527 def GetCurrentFocus(*args, **kwargs):
5528 """GetCurrentFocus(self) -> Window"""
5529 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
5530
5531 def SetCurrentFocus(*args, **kwargs):
5532 """SetCurrentFocus(self, Window win)"""
5533 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
5534
5535 IsBackward = _core_.NavigationKeyEvent_IsBackward
5536 IsForward = _core_.NavigationKeyEvent_IsForward
5537 WinChange = _core_.NavigationKeyEvent_WinChange
5538 FromTab = _core_.NavigationKeyEvent_FromTab
5539
5540 class NavigationKeyEventPtr(NavigationKeyEvent):
5541 def __init__(self, this):
5542 self.this = this
5543 if not hasattr(self,"thisown"): self.thisown = 0
5544 self.__class__ = NavigationKeyEvent
5545 _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
5546
5547 #---------------------------------------------------------------------------
5548
5549 class WindowCreateEvent(CommandEvent):
5550 """Proxy of C++ WindowCreateEvent class"""
5551 def __repr__(self):
5552 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5553 def __init__(self, *args, **kwargs):
5554 """__init__(self, Window win=None) -> WindowCreateEvent"""
5555 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
5556 self.this = newobj.this
5557 self.thisown = 1
5558 del newobj.thisown
5559 def GetWindow(*args, **kwargs):
5560 """GetWindow(self) -> Window"""
5561 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
5562
5563
5564 class WindowCreateEventPtr(WindowCreateEvent):
5565 def __init__(self, this):
5566 self.this = this
5567 if not hasattr(self,"thisown"): self.thisown = 0
5568 self.__class__ = WindowCreateEvent
5569 _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
5570
5571 class WindowDestroyEvent(CommandEvent):
5572 """Proxy of C++ WindowDestroyEvent class"""
5573 def __repr__(self):
5574 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5575 def __init__(self, *args, **kwargs):
5576 """__init__(self, Window win=None) -> WindowDestroyEvent"""
5577 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
5578 self.this = newobj.this
5579 self.thisown = 1
5580 del newobj.thisown
5581 def GetWindow(*args, **kwargs):
5582 """GetWindow(self) -> Window"""
5583 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
5584
5585
5586 class WindowDestroyEventPtr(WindowDestroyEvent):
5587 def __init__(self, this):
5588 self.this = this
5589 if not hasattr(self,"thisown"): self.thisown = 0
5590 self.__class__ = WindowDestroyEvent
5591 _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
5592
5593 #---------------------------------------------------------------------------
5594
5595 class ContextMenuEvent(CommandEvent):
5596 """Proxy of C++ ContextMenuEvent class"""
5597 def __repr__(self):
5598 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5599 def __init__(self, *args, **kwargs):
5600 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
5601 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
5602 self.this = newobj.this
5603 self.thisown = 1
5604 del newobj.thisown
5605 def GetPosition(*args, **kwargs):
5606 """GetPosition(self) -> Point"""
5607 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
5608
5609 def SetPosition(*args, **kwargs):
5610 """SetPosition(self, Point pos)"""
5611 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
5612
5613
5614 class ContextMenuEventPtr(ContextMenuEvent):
5615 def __init__(self, this):
5616 self.this = this
5617 if not hasattr(self,"thisown"): self.thisown = 0
5618 self.__class__ = ContextMenuEvent
5619 _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
5620
5621 #---------------------------------------------------------------------------
5622
5623 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
5624 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
5625 class IdleEvent(Event):
5626 """Proxy of C++ IdleEvent class"""
5627 def __repr__(self):
5628 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5629 def __init__(self, *args, **kwargs):
5630 """__init__(self) -> IdleEvent"""
5631 newobj = _core_.new_IdleEvent(*args, **kwargs)
5632 self.this = newobj.this
5633 self.thisown = 1
5634 del newobj.thisown
5635 def RequestMore(*args, **kwargs):
5636 """RequestMore(self, bool needMore=True)"""
5637 return _core_.IdleEvent_RequestMore(*args, **kwargs)
5638
5639 def MoreRequested(*args, **kwargs):
5640 """MoreRequested(self) -> bool"""
5641 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
5642
5643 def SetMode(*args, **kwargs):
5644 """SetMode(int mode)"""
5645 return _core_.IdleEvent_SetMode(*args, **kwargs)
5646
5647 SetMode = staticmethod(SetMode)
5648 def GetMode(*args, **kwargs):
5649 """GetMode() -> int"""
5650 return _core_.IdleEvent_GetMode(*args, **kwargs)
5651
5652 GetMode = staticmethod(GetMode)
5653 def CanSend(*args, **kwargs):
5654 """CanSend(Window win) -> bool"""
5655 return _core_.IdleEvent_CanSend(*args, **kwargs)
5656
5657 CanSend = staticmethod(CanSend)
5658
5659 class IdleEventPtr(IdleEvent):
5660 def __init__(self, this):
5661 self.this = this
5662 if not hasattr(self,"thisown"): self.thisown = 0
5663 self.__class__ = IdleEvent
5664 _core_.IdleEvent_swigregister(IdleEventPtr)
5665
5666 def IdleEvent_SetMode(*args, **kwargs):
5667 """IdleEvent_SetMode(int mode)"""
5668 return _core_.IdleEvent_SetMode(*args, **kwargs)
5669
5670 def IdleEvent_GetMode(*args, **kwargs):
5671 """IdleEvent_GetMode() -> int"""
5672 return _core_.IdleEvent_GetMode(*args, **kwargs)
5673
5674 def IdleEvent_CanSend(*args, **kwargs):
5675 """IdleEvent_CanSend(Window win) -> bool"""
5676 return _core_.IdleEvent_CanSend(*args, **kwargs)
5677
5678 #---------------------------------------------------------------------------
5679
5680 class PyEvent(Event):
5681 """Proxy of C++ PyEvent class"""
5682 def __repr__(self):
5683 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5684 def __init__(self, *args, **kwargs):
5685 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
5686 newobj = _core_.new_PyEvent(*args, **kwargs)
5687 self.this = newobj.this
5688 self.thisown = 1
5689 del newobj.thisown
5690 self.SetSelf(self)
5691
5692 def __del__(self, destroy=_core_.delete_PyEvent):
5693 """__del__(self)"""
5694 try:
5695 if self.thisown: destroy(self)
5696 except: pass
5697
5698 def SetSelf(*args, **kwargs):
5699 """SetSelf(self, PyObject self)"""
5700 return _core_.PyEvent_SetSelf(*args, **kwargs)
5701
5702 def GetSelf(*args, **kwargs):
5703 """GetSelf(self) -> PyObject"""
5704 return _core_.PyEvent_GetSelf(*args, **kwargs)
5705
5706
5707 class PyEventPtr(PyEvent):
5708 def __init__(self, this):
5709 self.this = this
5710 if not hasattr(self,"thisown"): self.thisown = 0
5711 self.__class__ = PyEvent
5712 _core_.PyEvent_swigregister(PyEventPtr)
5713
5714 class PyCommandEvent(CommandEvent):
5715 """Proxy of C++ PyCommandEvent class"""
5716 def __repr__(self):
5717 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5718 def __init__(self, *args, **kwargs):
5719 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
5720 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
5721 self.this = newobj.this
5722 self.thisown = 1
5723 del newobj.thisown
5724 self.SetSelf(self)
5725
5726 def __del__(self, destroy=_core_.delete_PyCommandEvent):
5727 """__del__(self)"""
5728 try:
5729 if self.thisown: destroy(self)
5730 except: pass
5731
5732 def SetSelf(*args, **kwargs):
5733 """SetSelf(self, PyObject self)"""
5734 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
5735
5736 def GetSelf(*args, **kwargs):
5737 """GetSelf(self) -> PyObject"""
5738 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
5739
5740
5741 class PyCommandEventPtr(PyCommandEvent):
5742 def __init__(self, this):
5743 self.this = this
5744 if not hasattr(self,"thisown"): self.thisown = 0
5745 self.__class__ = PyCommandEvent
5746 _core_.PyCommandEvent_swigregister(PyCommandEventPtr)
5747
5748 class DateEvent(CommandEvent):
5749 """Proxy of C++ DateEvent class"""
5750 def __repr__(self):
5751 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5752 def __init__(self, *args, **kwargs):
5753 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
5754 newobj = _core_.new_DateEvent(*args, **kwargs)
5755 self.this = newobj.this
5756 self.thisown = 1
5757 del newobj.thisown
5758 def GetDate(*args, **kwargs):
5759 """GetDate(self) -> DateTime"""
5760 return _core_.DateEvent_GetDate(*args, **kwargs)
5761
5762 def SetDate(*args, **kwargs):
5763 """SetDate(self, DateTime date)"""
5764 return _core_.DateEvent_SetDate(*args, **kwargs)
5765
5766
5767 class DateEventPtr(DateEvent):
5768 def __init__(self, this):
5769 self.this = this
5770 if not hasattr(self,"thisown"): self.thisown = 0
5771 self.__class__ = DateEvent
5772 _core_.DateEvent_swigregister(DateEventPtr)
5773
5774 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
5775 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
5776
5777 #---------------------------------------------------------------------------
5778
5779 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
5780 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
5781 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
5782 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
5783 PRINT_WINDOWS = _core_.PRINT_WINDOWS
5784 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
5785 class PyApp(EvtHandler):
5786 """
5787 The ``wx.PyApp`` class is an *implementation detail*, please use the
5788 `wx.App` class (or some other derived class) instead.
5789 """
5790 def __repr__(self):
5791 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5792 def __init__(self, *args, **kwargs):
5793 """
5794 __init__(self) -> PyApp
5795
5796 Create a new application object, starting the bootstrap process.
5797 """
5798 newobj = _core_.new_PyApp(*args, **kwargs)
5799 self.this = newobj.this
5800 self.thisown = 1
5801 del newobj.thisown
5802 self._setCallbackInfo(self, PyApp, False)
5803 self._setOORInfo(self, False)
5804
5805 def __del__(self, destroy=_core_.delete_PyApp):
5806 """__del__(self)"""
5807 try:
5808 if self.thisown: destroy(self)
5809 except: pass
5810
5811 def _setCallbackInfo(*args, **kwargs):
5812 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5813 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
5814
5815 def GetAppName(*args, **kwargs):
5816 """
5817 GetAppName(self) -> String
5818
5819 Get the application name.
5820 """
5821 return _core_.PyApp_GetAppName(*args, **kwargs)
5822
5823 def SetAppName(*args, **kwargs):
5824 """
5825 SetAppName(self, String name)
5826
5827 Set the application name. This value may be used automatically by
5828 `wx.Config` and such.
5829 """
5830 return _core_.PyApp_SetAppName(*args, **kwargs)
5831
5832 def GetClassName(*args, **kwargs):
5833 """
5834 GetClassName(self) -> String
5835
5836 Get the application's class name.
5837 """
5838 return _core_.PyApp_GetClassName(*args, **kwargs)
5839
5840 def SetClassName(*args, **kwargs):
5841 """
5842 SetClassName(self, String name)
5843
5844 Set the application's class name. This value may be used for
5845 X-resources if applicable for the platform
5846 """
5847 return _core_.PyApp_SetClassName(*args, **kwargs)
5848
5849 def GetVendorName(*args, **kwargs):
5850 """
5851 GetVendorName(self) -> String
5852
5853 Get the application's vendor name.
5854 """
5855 return _core_.PyApp_GetVendorName(*args, **kwargs)
5856
5857 def SetVendorName(*args, **kwargs):
5858 """
5859 SetVendorName(self, String name)
5860
5861 Set the application's vendor name. This value may be used
5862 automatically by `wx.Config` and such.
5863 """
5864 return _core_.PyApp_SetVendorName(*args, **kwargs)
5865
5866 def GetTraits(*args, **kwargs):
5867 """
5868 GetTraits(self) -> wxAppTraits
5869
5870 Return (and create if necessary) the app traits object to which we
5871 delegate for everything which either should be configurable by the
5872 user (then he can change the default behaviour simply by overriding
5873 CreateTraits() and returning his own traits object) or which is
5874 GUI/console dependent as then wx.AppTraits allows us to abstract the
5875 differences behind the common facade.
5876
5877 :todo: Add support for overriding CreateAppTraits in wxPython.
5878 """
5879 return _core_.PyApp_GetTraits(*args, **kwargs)
5880
5881 def ProcessPendingEvents(*args, **kwargs):
5882 """
5883 ProcessPendingEvents(self)
5884
5885 Process all events in the Pending Events list -- it is necessary to
5886 call this function to process posted events. This normally happens
5887 during each event loop iteration.
5888 """
5889 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
5890
5891 def Yield(*args, **kwargs):
5892 """
5893 Yield(self, bool onlyIfNeeded=False) -> bool
5894
5895 Process all currently pending events right now, instead of waiting
5896 until return to the event loop. It is an error to call ``Yield``
5897 recursively unless the value of ``onlyIfNeeded`` is True.
5898
5899 :warning: This function is dangerous as it can lead to unexpected
5900 reentrancies (i.e. when called from an event handler it may
5901 result in calling the same event handler again), use with
5902 extreme care or, better, don't use at all!
5903
5904 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
5905
5906 """
5907 return _core_.PyApp_Yield(*args, **kwargs)
5908
5909 def WakeUpIdle(*args, **kwargs):
5910 """
5911 WakeUpIdle(self)
5912
5913 Make sure that idle events are sent again.
5914 :see: `wx.WakeUpIdle`
5915 """
5916 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
5917
5918 def IsMainLoopRunning(*args, **kwargs):
5919 """
5920 IsMainLoopRunning() -> bool
5921
5922 Returns True if we're running the main loop, i.e. if the events can
5923 currently be dispatched.
5924 """
5925 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5926
5927 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
5928 def MainLoop(*args, **kwargs):
5929 """
5930 MainLoop(self) -> int
5931
5932 Execute the main GUI loop, the function doesn't normally return until
5933 all top level windows have been closed and destroyed.
5934 """
5935 return _core_.PyApp_MainLoop(*args, **kwargs)
5936
5937 def Exit(*args, **kwargs):
5938 """
5939 Exit(self)
5940
5941 Exit the main loop thus terminating the application.
5942 :see: `wx.Exit`
5943 """
5944 return _core_.PyApp_Exit(*args, **kwargs)
5945
5946 def ExitMainLoop(*args, **kwargs):
5947 """
5948 ExitMainLoop(self)
5949
5950 Exit the main GUI loop during the next iteration of the main
5951 loop, (i.e. it does not stop the program immediately!)
5952 """
5953 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
5954
5955 def Pending(*args, **kwargs):
5956 """
5957 Pending(self) -> bool
5958
5959 Returns True if there are unprocessed events in the event queue.
5960 """
5961 return _core_.PyApp_Pending(*args, **kwargs)
5962
5963 def Dispatch(*args, **kwargs):
5964 """
5965 Dispatch(self) -> bool
5966
5967 Process the first event in the event queue (blocks until an event
5968 appears if there are none currently)
5969 """
5970 return _core_.PyApp_Dispatch(*args, **kwargs)
5971
5972 def ProcessIdle(*args, **kwargs):
5973 """
5974 ProcessIdle(self) -> bool
5975
5976 Called from the MainLoop when the application becomes idle (there are
5977 no pending events) and sends a `wx.IdleEvent` to all interested
5978 parties. Returns True if more idle events are needed, False if not.
5979 """
5980 return _core_.PyApp_ProcessIdle(*args, **kwargs)
5981
5982 def SendIdleEvents(*args, **kwargs):
5983 """
5984 SendIdleEvents(self, Window win, IdleEvent event) -> bool
5985
5986 Send idle event to window and all subwindows. Returns True if more
5987 idle time is requested.
5988 """
5989 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
5990
5991 def IsActive(*args, **kwargs):
5992 """
5993 IsActive(self) -> bool
5994
5995 Return True if our app has focus.
5996 """
5997 return _core_.PyApp_IsActive(*args, **kwargs)
5998
5999 def SetTopWindow(*args, **kwargs):
6000 """
6001 SetTopWindow(self, Window win)
6002
6003 Set the *main* top level window
6004 """
6005 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6006
6007 def GetTopWindow(*args, **kwargs):
6008 """
6009 GetTopWindow(self) -> Window
6010
6011 Return the *main* top level window (if it hadn't been set previously
6012 with SetTopWindow(), will return just some top level window and, if
6013 there not any, will return None)
6014 """
6015 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6016
6017 def SetExitOnFrameDelete(*args, **kwargs):
6018 """
6019 SetExitOnFrameDelete(self, bool flag)
6020
6021 Control the exit behaviour: by default, the program will exit the main
6022 loop (and so, usually, terminate) when the last top-level program
6023 window is deleted. Beware that if you disable this behaviour (with
6024 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6025 explicitly from somewhere.
6026 """
6027 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6028
6029 def GetExitOnFrameDelete(*args, **kwargs):
6030 """
6031 GetExitOnFrameDelete(self) -> bool
6032
6033 Get the current exit behaviour setting.
6034 """
6035 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6036
6037 def SetUseBestVisual(*args, **kwargs):
6038 """
6039 SetUseBestVisual(self, bool flag)
6040
6041 Set whether the app should try to use the best available visual on
6042 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6043 """
6044 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6045
6046 def GetUseBestVisual(*args, **kwargs):
6047 """
6048 GetUseBestVisual(self) -> bool
6049
6050 Get current UseBestVisual setting.
6051 """
6052 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6053
6054 def SetPrintMode(*args, **kwargs):
6055 """SetPrintMode(self, int mode)"""
6056 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6057
6058 def GetPrintMode(*args, **kwargs):
6059 """GetPrintMode(self) -> int"""
6060 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6061
6062 def SetAssertMode(*args, **kwargs):
6063 """
6064 SetAssertMode(self, int mode)
6065
6066 Set the OnAssert behaviour for debug and hybrid builds.
6067 """
6068 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6069
6070 def GetAssertMode(*args, **kwargs):
6071 """
6072 GetAssertMode(self) -> int
6073
6074 Get the current OnAssert behaviour setting.
6075 """
6076 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6077
6078 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
6079 """GetMacSupportPCMenuShortcuts() -> bool"""
6080 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6081
6082 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6083 def GetMacAboutMenuItemId(*args, **kwargs):
6084 """GetMacAboutMenuItemId() -> long"""
6085 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6086
6087 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6088 def GetMacPreferencesMenuItemId(*args, **kwargs):
6089 """GetMacPreferencesMenuItemId() -> long"""
6090 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6091
6092 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6093 def GetMacExitMenuItemId(*args, **kwargs):
6094 """GetMacExitMenuItemId() -> long"""
6095 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6096
6097 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6098 def GetMacHelpMenuTitleName(*args, **kwargs):
6099 """GetMacHelpMenuTitleName() -> String"""
6100 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6101
6102 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6103 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
6104 """SetMacSupportPCMenuShortcuts(bool val)"""
6105 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6106
6107 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6108 def SetMacAboutMenuItemId(*args, **kwargs):
6109 """SetMacAboutMenuItemId(long val)"""
6110 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6111
6112 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6113 def SetMacPreferencesMenuItemId(*args, **kwargs):
6114 """SetMacPreferencesMenuItemId(long val)"""
6115 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6116
6117 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6118 def SetMacExitMenuItemId(*args, **kwargs):
6119 """SetMacExitMenuItemId(long val)"""
6120 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6121
6122 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6123 def SetMacHelpMenuTitleName(*args, **kwargs):
6124 """SetMacHelpMenuTitleName(String val)"""
6125 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6126
6127 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6128 def _BootstrapApp(*args, **kwargs):
6129 """
6130 _BootstrapApp(self)
6131
6132 For internal use only
6133 """
6134 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6135
6136 def GetComCtl32Version(*args, **kwargs):
6137 """
6138 GetComCtl32Version() -> int
6139
6140 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6141 it wasn't found at all. Raises an exception on non-Windows platforms.
6142 """
6143 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6144
6145 GetComCtl32Version = staticmethod(GetComCtl32Version)
6146
6147 class PyAppPtr(PyApp):
6148 def __init__(self, this):
6149 self.this = this
6150 if not hasattr(self,"thisown"): self.thisown = 0
6151 self.__class__ = PyApp
6152 _core_.PyApp_swigregister(PyAppPtr)
6153
6154 def PyApp_IsMainLoopRunning(*args, **kwargs):
6155 """
6156 PyApp_IsMainLoopRunning() -> bool
6157
6158 Returns True if we're running the main loop, i.e. if the events can
6159 currently be dispatched.
6160 """
6161 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6162
6163 def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
6164 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6165 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6166
6167 def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
6168 """PyApp_GetMacAboutMenuItemId() -> long"""
6169 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6170
6171 def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
6172 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6173 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6174
6175 def PyApp_GetMacExitMenuItemId(*args, **kwargs):
6176 """PyApp_GetMacExitMenuItemId() -> long"""
6177 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6178
6179 def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
6180 """PyApp_GetMacHelpMenuTitleName() -> String"""
6181 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6182
6183 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
6184 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6185 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6186
6187 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
6188 """PyApp_SetMacAboutMenuItemId(long val)"""
6189 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6190
6191 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
6192 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6193 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6194
6195 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
6196 """PyApp_SetMacExitMenuItemId(long val)"""
6197 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6198
6199 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
6200 """PyApp_SetMacHelpMenuTitleName(String val)"""
6201 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6202
6203 def PyApp_GetComCtl32Version(*args, **kwargs):
6204 """
6205 PyApp_GetComCtl32Version() -> int
6206
6207 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6208 it wasn't found at all. Raises an exception on non-Windows platforms.
6209 """
6210 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6211
6212 #---------------------------------------------------------------------------
6213
6214
6215 def Exit(*args, **kwargs):
6216 """
6217 Exit()
6218
6219 Force an exit of the application. Convenience for wx.GetApp().Exit()
6220 """
6221 return _core_.Exit(*args, **kwargs)
6222
6223 def Yield(*args, **kwargs):
6224 """
6225 Yield() -> bool
6226
6227 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6228 """
6229 return _core_.Yield(*args, **kwargs)
6230
6231 def YieldIfNeeded(*args, **kwargs):
6232 """
6233 YieldIfNeeded() -> bool
6234
6235 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6236 """
6237 return _core_.YieldIfNeeded(*args, **kwargs)
6238
6239 def SafeYield(*args, **kwargs):
6240 """
6241 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6242
6243 This function is similar to `wx.Yield`, except that it disables the
6244 user input to all program windows before calling `wx.Yield` and
6245 re-enables it again afterwards. If ``win`` is not None, this window
6246 will remain enabled, allowing the implementation of some limited user
6247 interaction.
6248
6249 :Returns: the result of the call to `wx.Yield`.
6250 """
6251 return _core_.SafeYield(*args, **kwargs)
6252
6253 def WakeUpIdle(*args, **kwargs):
6254 """
6255 WakeUpIdle()
6256
6257 Cause the message queue to become empty again, so idle events will be
6258 sent.
6259 """
6260 return _core_.WakeUpIdle(*args, **kwargs)
6261
6262 def PostEvent(*args, **kwargs):
6263 """
6264 PostEvent(EvtHandler dest, Event event)
6265
6266 Send an event to a window or other wx.EvtHandler to be processed
6267 later.
6268 """
6269 return _core_.PostEvent(*args, **kwargs)
6270
6271 def App_CleanUp(*args, **kwargs):
6272 """
6273 App_CleanUp()
6274
6275 For internal use only, it is used to cleanup after wxWidgets when
6276 Python shuts down.
6277 """
6278 return _core_.App_CleanUp(*args, **kwargs)
6279
6280 def GetApp(*args, **kwargs):
6281 """
6282 GetApp() -> PyApp
6283
6284 Return a reference to the current wx.App object.
6285 """
6286 return _core_.GetApp(*args, **kwargs)
6287
6288 def SetDefaultPyEncoding(*args, **kwargs):
6289 """
6290 SetDefaultPyEncoding(string encoding)
6291
6292 Sets the encoding that wxPython will use when it needs to convert a
6293 Python string or unicode object to or from a wxString.
6294
6295 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6296 but please be aware that the default encoding within the same locale
6297 may be slightly different on different platforms. For example, please
6298 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6299 between the common latin/roman encodings.
6300 """
6301 return _core_.SetDefaultPyEncoding(*args, **kwargs)
6302
6303 def GetDefaultPyEncoding(*args, **kwargs):
6304 """
6305 GetDefaultPyEncoding() -> string
6306
6307 Gets the current encoding that wxPython will use when it needs to
6308 convert a Python string or unicode object to or from a wxString.
6309 """
6310 return _core_.GetDefaultPyEncoding(*args, **kwargs)
6311 #----------------------------------------------------------------------
6312
6313 class PyOnDemandOutputWindow:
6314 """
6315 A class that can be used for redirecting Python's stdout and
6316 stderr streams. It will do nothing until something is wrriten to
6317 the stream at which point it will create a Frame with a text area
6318 and write the text there.
6319 """
6320 def __init__(self, title = "wxPython: stdout/stderr"):
6321 self.frame = None
6322 self.title = title
6323 self.pos = wx.DefaultPosition
6324 self.size = (450, 300)
6325 self.parent = None
6326
6327 def SetParent(self, parent):
6328 """Set the window to be used as the popup Frame's parent."""
6329 self.parent = parent
6330
6331
6332 def CreateOutputWindow(self, st):
6333 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6334 style=wx.DEFAULT_FRAME_STYLE)
6335 self.text = wx.TextCtrl(self.frame, -1, "",
6336 style=wx.TE_MULTILINE|wx.TE_READONLY)
6337 self.text.AppendText(st)
6338 self.frame.Show(True)
6339 EVT_CLOSE(self.frame, self.OnCloseWindow)
6340
6341
6342 def OnCloseWindow(self, event):
6343 if self.frame is not None:
6344 self.frame.Destroy()
6345 self.frame = None
6346 self.text = None
6347
6348
6349 # These methods provide the file-like output behaviour.
6350 def write(self, text):
6351 """
6352 Create the output window if needed and write the string to it.
6353 If not called in the context of the gui thread then uses
6354 CallAfter to do the work there.
6355 """
6356 if self.frame is None:
6357 if not wx.Thread_IsMain():
6358 wx.CallAfter(self.CreateOutputWindow, text)
6359 else:
6360 self.CreateOutputWindow(text)
6361 else:
6362 if not wx.Thread_IsMain():
6363 wx.CallAfter(self.text.AppendText, text)
6364 else:
6365 self.text.AppendText(text)
6366
6367
6368 def close(self):
6369 if self.frame is not None:
6370 wx.CallAfter(self.frame.Close)
6371
6372
6373 def flush(self):
6374 pass
6375
6376
6377
6378 #----------------------------------------------------------------------
6379
6380 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6381
6382 class App(wx.PyApp):
6383 """
6384 The ``wx.App`` class represents the application and is used to:
6385
6386 * bootstrap the wxPython system and initialize the underlying
6387 gui toolkit
6388 * set and get application-wide properties
6389 * implement the windowing system main message or event loop,
6390 and to dispatch events to window instances
6391 * etc.
6392
6393 Every application must have a ``wx.App`` instance, and all
6394 creation of UI objects should be delayed until after the
6395 ``wx.App`` object has been created in order to ensure that the gui
6396 platform and wxWidgets have been fully initialized.
6397
6398 Normally you would derive from this class and implement an
6399 ``OnInit`` method that creates a frame and then calls
6400 ``self.SetTopWindow(frame)``.
6401
6402 :see: `wx.PySimpleApp` for a simpler app class that can be used
6403 directly.
6404 """
6405
6406 outputWindowClass = PyOnDemandOutputWindow
6407
6408 def __init__(self, redirect=_defRedirect, filename=None,
6409 useBestVisual=False, clearSigInt=True):
6410 """
6411 Construct a ``wx.App`` object.
6412
6413 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
6414 redirected? Defaults to True on Windows and Mac, False
6415 otherwise. If `filename` is None then output will be
6416 redirected to a window that pops up as needed. (You can
6417 control what kind of window is created for the output by
6418 resetting the class variable ``outputWindowClass`` to a
6419 class of your choosing.)
6420
6421 :param filename: The name of a file to redirect output to, if
6422 redirect is True.
6423
6424 :param useBestVisual: Should the app try to use the best
6425 available visual provided by the system (only relevant on
6426 systems that have more than one visual.) This parameter
6427 must be used instead of calling `SetUseBestVisual` later
6428 on because it must be set before the underlying GUI
6429 toolkit is initialized.
6430
6431 :param clearSigInt: Should SIGINT be cleared? This allows the
6432 app to terminate upon a Ctrl-C in the console like other
6433 GUI apps will.
6434
6435 :note: You should override OnInit to do applicaition
6436 initialization to ensure that the system, toolkit and
6437 wxWidgets are fully initialized.
6438 """
6439 wx.PyApp.__init__(self)
6440
6441 if wx.Platform == "__WXMAC__":
6442 try:
6443 import MacOS
6444 if not MacOS.WMAvailable():
6445 print """\
6446 This program needs access to the screen. Please run with 'pythonw',
6447 not 'python', and only when you are logged in on the main display of
6448 your Mac."""
6449 _sys.exit(1)
6450 except SystemExit:
6451 raise
6452 except:
6453 pass
6454
6455 # This has to be done before OnInit
6456 self.SetUseBestVisual(useBestVisual)
6457
6458 # Set the default handler for SIGINT. This fixes a problem
6459 # where if Ctrl-C is pressed in the console that started this
6460 # app then it will not appear to do anything, (not even send
6461 # KeyboardInterrupt???) but will later segfault on exit. By
6462 # setting the default handler then the app will exit, as
6463 # expected (depending on platform.)
6464 if clearSigInt:
6465 try:
6466 import signal
6467 signal.signal(signal.SIGINT, signal.SIG_DFL)
6468 except:
6469 pass
6470
6471 # Save and redirect the stdio to a window?
6472 self.stdioWin = None
6473 self.saveStdio = (_sys.stdout, _sys.stderr)
6474 if redirect:
6475 self.RedirectStdio(filename)
6476
6477 # Use Python's install prefix as the default
6478 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
6479
6480 # This finishes the initialization of wxWindows and then calls
6481 # the OnInit that should be present in the derived class
6482 self._BootstrapApp()
6483
6484
6485 def __del__(self, destroy=wx.PyApp.__del__):
6486 self.RestoreStdio() # Just in case the MainLoop was overridden
6487 destroy(self)
6488
6489 def Destroy(self):
6490 wx.PyApp.Destroy(self)
6491 self.thisown = 0
6492
6493 def SetTopWindow(self, frame):
6494 """Set the \"main\" top level window"""
6495 if self.stdioWin:
6496 self.stdioWin.SetParent(frame)
6497 wx.PyApp.SetTopWindow(self, frame)
6498
6499
6500 def MainLoop(self):
6501 """Execute the main GUI event loop"""
6502 wx.PyApp.MainLoop(self)
6503 self.RestoreStdio()
6504
6505
6506 def RedirectStdio(self, filename=None):
6507 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
6508 if filename:
6509 _sys.stdout = _sys.stderr = open(filename, 'a')
6510 else:
6511 self.stdioWin = self.outputWindowClass()
6512 _sys.stdout = _sys.stderr = self.stdioWin
6513
6514
6515 def RestoreStdio(self):
6516 try:
6517 _sys.stdout, _sys.stderr = self.saveStdio
6518 except:
6519 pass
6520
6521
6522 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
6523 """
6524 Set the title, position and/or size of the output window if
6525 the stdio has been redirected. This should be called before
6526 any output would cause the output window to be created.
6527 """
6528 if self.stdioWin:
6529 if title is not None:
6530 self.stdioWin.title = title
6531 if pos is not None:
6532 self.stdioWin.pos = pos
6533 if size is not None:
6534 self.stdioWin.size = size
6535
6536
6537
6538
6539 # change from wx.PyApp_XX to wx.App_XX
6540 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
6541 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
6542 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
6543 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
6544 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
6545 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
6546 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
6547 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
6548 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
6549 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
6550 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
6551
6552 #----------------------------------------------------------------------------
6553
6554 class PySimpleApp(wx.App):
6555 """
6556 A simple application class. You can just create one of these and
6557 then then make your top level windows later, and not have to worry
6558 about OnInit. For example::
6559
6560 app = wx.PySimpleApp()
6561 frame = wx.Frame(None, title='Hello World')
6562 frame.Show()
6563 app.MainLoop()
6564
6565 :see: `wx.App`
6566 """
6567
6568 def __init__(self, redirect=False, filename=None,
6569 useBestVisual=False, clearSigInt=True):
6570 """
6571 :see: `wx.App.__init__`
6572 """
6573 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6574
6575 def OnInit(self):
6576 return True
6577
6578
6579
6580 # Is anybody using this one?
6581 class PyWidgetTester(wx.App):
6582 def __init__(self, size = (250, 100)):
6583 self.size = size
6584 wx.App.__init__(self, 0)
6585
6586 def OnInit(self):
6587 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
6588 self.SetTopWindow(self.frame)
6589 return True
6590
6591 def SetWidget(self, widgetClass, *args, **kwargs):
6592 w = widgetClass(self.frame, *args, **kwargs)
6593 self.frame.Show(True)
6594
6595 #----------------------------------------------------------------------------
6596 # DO NOT hold any other references to this object. This is how we
6597 # know when to cleanup system resources that wxWidgets is holding. When
6598 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
6599 # goes to zero and it calls the wx.App_CleanUp function.
6600
6601 class __wxPyCleanup:
6602 def __init__(self):
6603 self.cleanup = _core_.App_CleanUp
6604 def __del__(self):
6605 self.cleanup()
6606
6607 _sys.__wxPythonCleanup = __wxPyCleanup()
6608
6609 ## # another possible solution, but it gets called too early...
6610 ## import atexit
6611 ## atexit.register(_core_.wxApp_CleanUp)
6612
6613
6614 #----------------------------------------------------------------------------
6615
6616 #---------------------------------------------------------------------------
6617
6618 class EventLoop(object):
6619 """Proxy of C++ EventLoop class"""
6620 def __repr__(self):
6621 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6622 def __init__(self, *args, **kwargs):
6623 """__init__(self) -> EventLoop"""
6624 newobj = _core_.new_EventLoop(*args, **kwargs)
6625 self.this = newobj.this
6626 self.thisown = 1
6627 del newobj.thisown
6628 def __del__(self, destroy=_core_.delete_EventLoop):
6629 """__del__(self)"""
6630 try:
6631 if self.thisown: destroy(self)
6632 except: pass
6633
6634 def Run(*args, **kwargs):
6635 """Run(self) -> int"""
6636 return _core_.EventLoop_Run(*args, **kwargs)
6637
6638 def Exit(*args, **kwargs):
6639 """Exit(self, int rc=0)"""
6640 return _core_.EventLoop_Exit(*args, **kwargs)
6641
6642 def Pending(*args, **kwargs):
6643 """Pending(self) -> bool"""
6644 return _core_.EventLoop_Pending(*args, **kwargs)
6645
6646 def Dispatch(*args, **kwargs):
6647 """Dispatch(self) -> bool"""
6648 return _core_.EventLoop_Dispatch(*args, **kwargs)
6649
6650 def IsRunning(*args, **kwargs):
6651 """IsRunning(self) -> bool"""
6652 return _core_.EventLoop_IsRunning(*args, **kwargs)
6653
6654 def GetActive(*args, **kwargs):
6655 """GetActive() -> EventLoop"""
6656 return _core_.EventLoop_GetActive(*args, **kwargs)
6657
6658 GetActive = staticmethod(GetActive)
6659 def SetActive(*args, **kwargs):
6660 """SetActive(EventLoop loop)"""
6661 return _core_.EventLoop_SetActive(*args, **kwargs)
6662
6663 SetActive = staticmethod(SetActive)
6664
6665 class EventLoopPtr(EventLoop):
6666 def __init__(self, this):
6667 self.this = this
6668 if not hasattr(self,"thisown"): self.thisown = 0
6669 self.__class__ = EventLoop
6670 _core_.EventLoop_swigregister(EventLoopPtr)
6671
6672 def EventLoop_GetActive(*args, **kwargs):
6673 """EventLoop_GetActive() -> EventLoop"""
6674 return _core_.EventLoop_GetActive(*args, **kwargs)
6675
6676 def EventLoop_SetActive(*args, **kwargs):
6677 """EventLoop_SetActive(EventLoop loop)"""
6678 return _core_.EventLoop_SetActive(*args, **kwargs)
6679
6680 #---------------------------------------------------------------------------
6681
6682 class AcceleratorEntry(object):
6683 """
6684 A class used to define items in an `wx.AcceleratorTable`. wxPython
6685 programs can choose to use wx.AcceleratorEntry objects, but using a
6686 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
6687 as well. See `__init__` for of the tuple values.
6688
6689 :see: `wx.AcceleratorTable`
6690 """
6691 def __repr__(self):
6692 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6693 def __init__(self, *args, **kwargs):
6694 """
6695 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
6696
6697 Construct a wx.AcceleratorEntry.
6698 """
6699 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
6700 self.this = newobj.this
6701 self.thisown = 1
6702 del newobj.thisown
6703 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
6704 """__del__(self)"""
6705 try:
6706 if self.thisown: destroy(self)
6707 except: pass
6708
6709 def Set(*args, **kwargs):
6710 """
6711 Set(self, int flags, int keyCode, int cmd)
6712
6713 (Re)set the attributes of a wx.AcceleratorEntry.
6714 :see `__init__`
6715 """
6716 return _core_.AcceleratorEntry_Set(*args, **kwargs)
6717
6718 def GetFlags(*args, **kwargs):
6719 """
6720 GetFlags(self) -> int
6721
6722 Get the AcceleratorEntry's flags.
6723 """
6724 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
6725
6726 def GetKeyCode(*args, **kwargs):
6727 """
6728 GetKeyCode(self) -> int
6729
6730 Get the AcceleratorEntry's keycode.
6731 """
6732 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
6733
6734 def GetCommand(*args, **kwargs):
6735 """
6736 GetCommand(self) -> int
6737
6738 Get the AcceleratorEntry's command ID.
6739 """
6740 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
6741
6742
6743 class AcceleratorEntryPtr(AcceleratorEntry):
6744 def __init__(self, this):
6745 self.this = this
6746 if not hasattr(self,"thisown"): self.thisown = 0
6747 self.__class__ = AcceleratorEntry
6748 _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
6749
6750 class AcceleratorTable(Object):
6751 """
6752 An accelerator table allows the application to specify a table of
6753 keyboard shortcuts for menus or other commands. On Windows, menu or
6754 button commands are supported; on GTK, only menu commands are
6755 supported.
6756 """
6757 def __repr__(self):
6758 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6759 def __init__(self, *args, **kwargs):
6760 """
6761 __init__(entries) -> AcceleratorTable
6762
6763 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
6764 items or or of 3-tuples (flags, keyCode, cmdID)
6765
6766 :see: `wx.AcceleratorEntry`
6767 """
6768 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
6769 self.this = newobj.this
6770 self.thisown = 1
6771 del newobj.thisown
6772 def __del__(self, destroy=_core_.delete_AcceleratorTable):
6773 """__del__(self)"""
6774 try:
6775 if self.thisown: destroy(self)
6776 except: pass
6777
6778 def Ok(*args, **kwargs):
6779 """Ok(self) -> bool"""
6780 return _core_.AcceleratorTable_Ok(*args, **kwargs)
6781
6782
6783 class AcceleratorTablePtr(AcceleratorTable):
6784 def __init__(self, this):
6785 self.this = this
6786 if not hasattr(self,"thisown"): self.thisown = 0
6787 self.__class__ = AcceleratorTable
6788 _core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
6789
6790
6791 def GetAccelFromString(*args, **kwargs):
6792 """GetAccelFromString(String label) -> AcceleratorEntry"""
6793 return _core_.GetAccelFromString(*args, **kwargs)
6794 #---------------------------------------------------------------------------
6795
6796 class VisualAttributes(object):
6797 """struct containing all the visual attributes of a control"""
6798 def __repr__(self):
6799 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6800 def __init__(self, *args, **kwargs):
6801 """
6802 __init__(self) -> VisualAttributes
6803
6804 struct containing all the visual attributes of a control
6805 """
6806 newobj = _core_.new_VisualAttributes(*args, **kwargs)
6807 self.this = newobj.this
6808 self.thisown = 1
6809 del newobj.thisown
6810 def __del__(self, destroy=_core_.delete_VisualAttributes):
6811 """__del__(self)"""
6812 try:
6813 if self.thisown: destroy(self)
6814 except: pass
6815
6816 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
6817 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
6818 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
6819
6820 class VisualAttributesPtr(VisualAttributes):
6821 def __init__(self, this):
6822 self.this = this
6823 if not hasattr(self,"thisown"): self.thisown = 0
6824 self.__class__ = VisualAttributes
6825 _core_.VisualAttributes_swigregister(VisualAttributesPtr)
6826 NullAcceleratorTable = cvar.NullAcceleratorTable
6827 PanelNameStr = cvar.PanelNameStr
6828
6829 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
6830 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
6831 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
6832 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
6833 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
6834 class Window(EvtHandler):
6835 """
6836 wx.Window is the base class for all windows and represents any visible
6837 object on the screen. All controls, top level windows and so on are
6838 wx.Windows. Sizers and device contexts are not however, as they don't
6839 appear on screen themselves.
6840
6841 """
6842 def __repr__(self):
6843 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6844 def __init__(self, *args, **kwargs):
6845 """
6846 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
6847 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
6848
6849 Construct and show a generic Window.
6850 """
6851 newobj = _core_.new_Window(*args, **kwargs)
6852 self.this = newobj.this
6853 self.thisown = 1
6854 del newobj.thisown
6855 self._setOORInfo(self)
6856
6857 def Create(*args, **kwargs):
6858 """
6859 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
6860 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
6861
6862 Create the GUI part of the Window for 2-phase creation mode.
6863 """
6864 return _core_.Window_Create(*args, **kwargs)
6865
6866 def Close(*args, **kwargs):
6867 """
6868 Close(self, bool force=False) -> bool
6869
6870 This function simply generates a EVT_CLOSE event whose handler usually
6871 tries to close the window. It doesn't close the window itself,
6872 however. If force is False (the default) then the window's close
6873 handler will be allowed to veto the destruction of the window.
6874 """
6875 return _core_.Window_Close(*args, **kwargs)
6876
6877 def Destroy(*args, **kwargs):
6878 """
6879 Destroy(self) -> bool
6880
6881 Destroys the window safely. Frames and dialogs are not destroyed
6882 immediately when this function is called -- they are added to a list
6883 of windows to be deleted on idle time, when all the window's events
6884 have been processed. This prevents problems with events being sent to
6885 non-existent windows.
6886
6887 Returns True if the window has either been successfully deleted, or it
6888 has been added to the list of windows pending real deletion.
6889 """
6890 return _core_.Window_Destroy(*args, **kwargs)
6891
6892 def DestroyChildren(*args, **kwargs):
6893 """
6894 DestroyChildren(self) -> bool
6895
6896 Destroys all children of a window. Called automatically by the
6897 destructor.
6898 """
6899 return _core_.Window_DestroyChildren(*args, **kwargs)
6900
6901 def IsBeingDeleted(*args, **kwargs):
6902 """
6903 IsBeingDeleted(self) -> bool
6904
6905 Is the window in the process of being deleted?
6906 """
6907 return _core_.Window_IsBeingDeleted(*args, **kwargs)
6908
6909 def SetTitle(*args, **kwargs):
6910 """
6911 SetTitle(self, String title)
6912
6913 Sets the window's title. Applicable only to frames and dialogs.
6914 """
6915 return _core_.Window_SetTitle(*args, **kwargs)
6916
6917 def GetTitle(*args, **kwargs):
6918 """
6919 GetTitle(self) -> String
6920
6921 Gets the window's title. Applicable only to frames and dialogs.
6922 """
6923 return _core_.Window_GetTitle(*args, **kwargs)
6924
6925 def SetLabel(*args, **kwargs):
6926 """
6927 SetLabel(self, String label)
6928
6929 Set the text which the window shows in its label if applicable.
6930 """
6931 return _core_.Window_SetLabel(*args, **kwargs)
6932
6933 def GetLabel(*args, **kwargs):
6934 """
6935 GetLabel(self) -> String
6936
6937 Generic way of getting a label from any window, for identification
6938 purposes. The interpretation of this function differs from class to
6939 class. For frames and dialogs, the value returned is the title. For
6940 buttons or static text controls, it is the button text. This function
6941 can be useful for meta-programs such as testing tools or special-needs
6942 access programs)which need to identify windows by name.
6943 """
6944 return _core_.Window_GetLabel(*args, **kwargs)
6945
6946 def SetName(*args, **kwargs):
6947 """
6948 SetName(self, String name)
6949
6950 Sets the window's name. The window name is used for ressource setting
6951 in X, it is not the same as the window title/label
6952 """
6953 return _core_.Window_SetName(*args, **kwargs)
6954
6955 def GetName(*args, **kwargs):
6956 """
6957 GetName(self) -> String
6958
6959 Returns the windows name. This name is not guaranteed to be unique;
6960 it is up to the programmer to supply an appropriate name in the window
6961 constructor or via wx.Window.SetName.
6962 """
6963 return _core_.Window_GetName(*args, **kwargs)
6964
6965 def SetWindowVariant(*args, **kwargs):
6966 """
6967 SetWindowVariant(self, int variant)
6968
6969 Sets the variant of the window/font size to use for this window, if
6970 the platform supports variants, for example, wxMac.
6971 """
6972 return _core_.Window_SetWindowVariant(*args, **kwargs)
6973
6974 def GetWindowVariant(*args, **kwargs):
6975 """GetWindowVariant(self) -> int"""
6976 return _core_.Window_GetWindowVariant(*args, **kwargs)
6977
6978 def SetId(*args, **kwargs):
6979 """
6980 SetId(self, int winid)
6981
6982 Sets the identifier of the window. Each window has an integer
6983 identifier. If the application has not provided one, an identifier
6984 will be generated. Normally, the identifier should be provided on
6985 creation and should not be modified subsequently.
6986 """
6987 return _core_.Window_SetId(*args, **kwargs)
6988
6989 def GetId(*args, **kwargs):
6990 """
6991 GetId(self) -> int
6992
6993 Returns the identifier of the window. Each window has an integer
6994 identifier. If the application has not provided one (or the default Id
6995 -1 is used) then an unique identifier with a negative value will be
6996 generated.
6997 """
6998 return _core_.Window_GetId(*args, **kwargs)
6999
7000 def NewControlId(*args, **kwargs):
7001 """
7002 NewControlId() -> int
7003
7004 Generate a control id for the controls which were not given one.
7005 """
7006 return _core_.Window_NewControlId(*args, **kwargs)
7007
7008 NewControlId = staticmethod(NewControlId)
7009 def NextControlId(*args, **kwargs):
7010 """
7011 NextControlId(int winid) -> int
7012
7013 Get the id of the control following the one with the given
7014 autogenerated) id
7015 """
7016 return _core_.Window_NextControlId(*args, **kwargs)
7017
7018 NextControlId = staticmethod(NextControlId)
7019 def PrevControlId(*args, **kwargs):
7020 """
7021 PrevControlId(int winid) -> int
7022
7023 Get the id of the control preceding the one with the given
7024 autogenerated) id
7025 """
7026 return _core_.Window_PrevControlId(*args, **kwargs)
7027
7028 PrevControlId = staticmethod(PrevControlId)
7029 def SetSize(*args, **kwargs):
7030 """
7031 SetSize(self, Size size)
7032
7033 Sets the size of the window in pixels.
7034 """
7035 return _core_.Window_SetSize(*args, **kwargs)
7036
7037 def SetDimensions(*args, **kwargs):
7038 """
7039 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7040
7041 Sets the position and size of the window in pixels. The sizeFlags
7042 parameter indicates the interpretation of the other params if they are
7043 equal to -1.
7044
7045 ======================== ======================================
7046 wx.SIZE_AUTO A -1 indicates that a class-specific
7047 default should be used.
7048 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7049 -1 values are supplied.
7050 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7051 interpreted as real dimensions, not
7052 default values.
7053 ======================== ======================================
7054
7055 """
7056 return _core_.Window_SetDimensions(*args, **kwargs)
7057
7058 def SetRect(*args, **kwargs):
7059 """
7060 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7061
7062 Sets the position and size of the window in pixels using a wx.Rect.
7063 """
7064 return _core_.Window_SetRect(*args, **kwargs)
7065
7066 def SetSizeWH(*args, **kwargs):
7067 """
7068 SetSizeWH(self, int width, int height)
7069
7070 Sets the size of the window in pixels.
7071 """
7072 return _core_.Window_SetSizeWH(*args, **kwargs)
7073
7074 def Move(*args, **kwargs):
7075 """
7076 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7077
7078 Moves the window to the given position.
7079 """
7080 return _core_.Window_Move(*args, **kwargs)
7081
7082 SetPosition = Move
7083 def MoveXY(*args, **kwargs):
7084 """
7085 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7086
7087 Moves the window to the given position.
7088 """
7089 return _core_.Window_MoveXY(*args, **kwargs)
7090
7091 def SetBestFittingSize(*args, **kwargs):
7092 """
7093 SetBestFittingSize(self, Size size=DefaultSize)
7094
7095 A 'Smart' SetSize that will fill in default size components with the
7096 window's *best size* values. Also set's the minsize for use with sizers.
7097 """
7098 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7099
7100 def Raise(*args, **kwargs):
7101 """
7102 Raise(self)
7103
7104 Raises the window to the top of the window hierarchy if it is a
7105 managed window (dialog or frame).
7106 """
7107 return _core_.Window_Raise(*args, **kwargs)
7108
7109 def Lower(*args, **kwargs):
7110 """
7111 Lower(self)
7112
7113 Lowers the window to the bottom of the window hierarchy if it is a
7114 managed window (dialog or frame).
7115 """
7116 return _core_.Window_Lower(*args, **kwargs)
7117
7118 def SetClientSize(*args, **kwargs):
7119 """
7120 SetClientSize(self, Size size)
7121
7122 This sets the size of the window client area in pixels. Using this
7123 function to size a window tends to be more device-independent than
7124 wx.Window.SetSize, since the application need not worry about what
7125 dimensions the border or title bar have when trying to fit the window
7126 around panel items, for example.
7127 """
7128 return _core_.Window_SetClientSize(*args, **kwargs)
7129
7130 def SetClientSizeWH(*args, **kwargs):
7131 """
7132 SetClientSizeWH(self, int width, int height)
7133
7134 This sets the size of the window client area in pixels. Using this
7135 function to size a window tends to be more device-independent than
7136 wx.Window.SetSize, since the application need not worry about what
7137 dimensions the border or title bar have when trying to fit the window
7138 around panel items, for example.
7139 """
7140 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7141
7142 def SetClientRect(*args, **kwargs):
7143 """
7144 SetClientRect(self, Rect rect)
7145
7146 This sets the size of the window client area in pixels. Using this
7147 function to size a window tends to be more device-independent than
7148 wx.Window.SetSize, since the application need not worry about what
7149 dimensions the border or title bar have when trying to fit the window
7150 around panel items, for example.
7151 """
7152 return _core_.Window_SetClientRect(*args, **kwargs)
7153
7154 def GetPosition(*args, **kwargs):
7155 """
7156 GetPosition(self) -> Point
7157
7158 Get the window's position.
7159 """
7160 return _core_.Window_GetPosition(*args, **kwargs)
7161
7162 def GetPositionTuple(*args, **kwargs):
7163 """
7164 GetPositionTuple() -> (x,y)
7165
7166 Get the window's position.
7167 """
7168 return _core_.Window_GetPositionTuple(*args, **kwargs)
7169
7170 def GetSize(*args, **kwargs):
7171 """
7172 GetSize(self) -> Size
7173
7174 Get the window size.
7175 """
7176 return _core_.Window_GetSize(*args, **kwargs)
7177
7178 def GetSizeTuple(*args, **kwargs):
7179 """
7180 GetSizeTuple() -> (width, height)
7181
7182 Get the window size.
7183 """
7184 return _core_.Window_GetSizeTuple(*args, **kwargs)
7185
7186 def GetRect(*args, **kwargs):
7187 """
7188 GetRect(self) -> Rect
7189
7190 Returns the size and position of the window as a wx.Rect object.
7191 """
7192 return _core_.Window_GetRect(*args, **kwargs)
7193
7194 def GetClientSize(*args, **kwargs):
7195 """
7196 GetClientSize(self) -> Size
7197
7198 This gets the size of the window's 'client area' in pixels. The client
7199 area is the area which may be drawn on by the programmer, excluding
7200 title bar, border, scrollbars, etc.
7201 """
7202 return _core_.Window_GetClientSize(*args, **kwargs)
7203
7204 def GetClientSizeTuple(*args, **kwargs):
7205 """
7206 GetClientSizeTuple() -> (width, height)
7207
7208 This gets the size of the window's 'client area' in pixels. The client
7209 area is the area which may be drawn on by the programmer, excluding
7210 title bar, border, scrollbars, etc.
7211 """
7212 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7213
7214 def GetClientAreaOrigin(*args, **kwargs):
7215 """
7216 GetClientAreaOrigin(self) -> Point
7217
7218 Get the origin of the client area of the window relative to the
7219 window's top left corner (the client area may be shifted because of
7220 the borders, scrollbars, other decorations...)
7221 """
7222 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7223
7224 def GetClientRect(*args, **kwargs):
7225 """
7226 GetClientRect(self) -> Rect
7227
7228 Get the client area position and size as a `wx.Rect` object.
7229 """
7230 return _core_.Window_GetClientRect(*args, **kwargs)
7231
7232 def GetBestSize(*args, **kwargs):
7233 """
7234 GetBestSize(self) -> Size
7235
7236 This function returns the best acceptable minimal size for the
7237 window, if applicable. For example, for a static text control, it will
7238 be the minimal size such that the control label is not truncated. For
7239 windows containing subwindows (suzh aswx.Panel), the size returned by
7240 this function will be the same as the size the window would have had
7241 after calling Fit.
7242 """
7243 return _core_.Window_GetBestSize(*args, **kwargs)
7244
7245 def GetBestSizeTuple(*args, **kwargs):
7246 """
7247 GetBestSizeTuple() -> (width, height)
7248
7249 This function returns the best acceptable minimal size for the
7250 window, if applicable. For example, for a static text control, it will
7251 be the minimal size such that the control label is not truncated. For
7252 windows containing subwindows (suzh aswx.Panel), the size returned by
7253 this function will be the same as the size the window would have had
7254 after calling Fit.
7255 """
7256 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
7257
7258 def InvalidateBestSize(*args, **kwargs):
7259 """
7260 InvalidateBestSize(self)
7261
7262 Reset the cached best size value so it will be recalculated the next
7263 time it is needed.
7264 """
7265 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7266
7267 def GetBestFittingSize(*args, **kwargs):
7268 """
7269 GetBestFittingSize(self) -> Size
7270
7271 This function will merge the window's best size into the window's
7272 minimum size, giving priority to the min size components, and returns
7273 the results.
7274
7275 """
7276 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7277
7278 def GetAdjustedBestSize(*args, **kwargs):
7279 """
7280 GetAdjustedBestSize(self) -> Size
7281
7282 This method is similar to GetBestSize, except in one
7283 thing. GetBestSize should return the minimum untruncated size of the
7284 window, while this method will return the largest of BestSize and any
7285 user specified minimum size. ie. it is the minimum size the window
7286 should currently be drawn at, not the minimal size it can possibly
7287 tolerate.
7288 """
7289 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
7290
7291 def Center(*args, **kwargs):
7292 """
7293 Center(self, int direction=BOTH)
7294
7295 Centers the window. The parameter specifies the direction for
7296 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7297 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7298 on the entire screen and not on its parent window. If it is a
7299 top-level window and has no parent then it will always be centered
7300 relative to the screen.
7301 """
7302 return _core_.Window_Center(*args, **kwargs)
7303
7304 Centre = Center
7305 def CenterOnScreen(*args, **kwargs):
7306 """
7307 CenterOnScreen(self, int dir=BOTH)
7308
7309 Center on screen (only works for top level windows)
7310 """
7311 return _core_.Window_CenterOnScreen(*args, **kwargs)
7312
7313 CentreOnScreen = CenterOnScreen
7314 def CenterOnParent(*args, **kwargs):
7315 """
7316 CenterOnParent(self, int dir=BOTH)
7317
7318 Center with respect to the the parent window
7319 """
7320 return _core_.Window_CenterOnParent(*args, **kwargs)
7321
7322 CentreOnParent = CenterOnParent
7323 def Fit(*args, **kwargs):
7324 """
7325 Fit(self)
7326
7327 Sizes the window so that it fits around its subwindows. This function
7328 won't do anything if there are no subwindows and will only really work
7329 correctly if sizers are used for the subwindows layout. Also, if the
7330 window has exactly one subwindow it is better (faster and the result
7331 is more precise as Fit adds some margin to account for fuzziness of
7332 its calculations) to call window.SetClientSize(child.GetSize())
7333 instead of calling Fit.
7334 """
7335 return _core_.Window_Fit(*args, **kwargs)
7336
7337 def FitInside(*args, **kwargs):
7338 """
7339 FitInside(self)
7340
7341 Similar to Fit, but sizes the interior (virtual) size of a
7342 window. Mainly useful with scrolled windows to reset scrollbars after
7343 sizing changes that do not trigger a size event, and/or scrolled
7344 windows without an interior sizer. This function similarly won't do
7345 anything if there are no subwindows.
7346 """
7347 return _core_.Window_FitInside(*args, **kwargs)
7348
7349 def SetSizeHints(*args, **kwargs):
7350 """
7351 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7352 int incH=-1)
7353
7354 Allows specification of minimum and maximum window sizes, and window
7355 size increments. If a pair of values is not set (or set to -1), the
7356 default values will be used. If this function is called, the user
7357 will not be able to size the window outside the given bounds (if it is
7358 a top-level window.) Sizers will also inspect the minimum window size
7359 and will use that value if set when calculating layout.
7360
7361 The resizing increments are only significant under Motif or Xt.
7362 """
7363 return _core_.Window_SetSizeHints(*args, **kwargs)
7364
7365 def SetSizeHintsSz(*args, **kwargs):
7366 """
7367 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7368
7369 Allows specification of minimum and maximum window sizes, and window
7370 size increments. If a pair of values is not set (or set to -1), the
7371 default values will be used. If this function is called, the user
7372 will not be able to size the window outside the given bounds (if it is
7373 a top-level window.) Sizers will also inspect the minimum window size
7374 and will use that value if set when calculating layout.
7375
7376 The resizing increments are only significant under Motif or Xt.
7377 """
7378 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
7379
7380 def SetVirtualSizeHints(*args, **kwargs):
7381 """
7382 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
7383
7384 Allows specification of minimum and maximum virtual window sizes. If a
7385 pair of values is not set (or set to -1), the default values will be
7386 used. If this function is called, the user will not be able to size
7387 the virtual area of the window outside the given bounds.
7388 """
7389 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
7390
7391 def SetVirtualSizeHintsSz(*args, **kwargs):
7392 """
7393 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7394
7395 Allows specification of minimum and maximum virtual window sizes. If a
7396 pair of values is not set (or set to -1), the default values will be
7397 used. If this function is called, the user will not be able to size
7398 the virtual area of the window outside the given bounds.
7399 """
7400 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
7401
7402 def GetMaxSize(*args, **kwargs):
7403 """GetMaxSize(self) -> Size"""
7404 return _core_.Window_GetMaxSize(*args, **kwargs)
7405
7406 def GetMinSize(*args, **kwargs):
7407 """GetMinSize(self) -> Size"""
7408 return _core_.Window_GetMinSize(*args, **kwargs)
7409
7410 def SetMinSize(*args, **kwargs):
7411 """
7412 SetMinSize(self, Size minSize)
7413
7414 A more convenient method than `SetSizeHints` for setting just the
7415 min size.
7416 """
7417 return _core_.Window_SetMinSize(*args, **kwargs)
7418
7419 def SetMaxSize(*args, **kwargs):
7420 """
7421 SetMaxSize(self, Size maxSize)
7422
7423 A more convenient method than `SetSizeHints` for setting just the
7424 max size.
7425 """
7426 return _core_.Window_SetMaxSize(*args, **kwargs)
7427
7428 def GetMinWidth(*args, **kwargs):
7429 """GetMinWidth(self) -> int"""
7430 return _core_.Window_GetMinWidth(*args, **kwargs)
7431
7432 def GetMinHeight(*args, **kwargs):
7433 """GetMinHeight(self) -> int"""
7434 return _core_.Window_GetMinHeight(*args, **kwargs)
7435
7436 def GetMaxWidth(*args, **kwargs):
7437 """GetMaxWidth(self) -> int"""
7438 return _core_.Window_GetMaxWidth(*args, **kwargs)
7439
7440 def GetMaxHeight(*args, **kwargs):
7441 """GetMaxHeight(self) -> int"""
7442 return _core_.Window_GetMaxHeight(*args, **kwargs)
7443
7444 def SetVirtualSize(*args, **kwargs):
7445 """
7446 SetVirtualSize(self, Size size)
7447
7448 Set the the virtual size of a window in pixels. For most windows this
7449 is just the client area of the window, but for some like scrolled
7450 windows it is more or less independent of the screen window size.
7451 """
7452 return _core_.Window_SetVirtualSize(*args, **kwargs)
7453
7454 def SetVirtualSizeWH(*args, **kwargs):
7455 """
7456 SetVirtualSizeWH(self, int w, int h)
7457
7458 Set the the virtual size of a window in pixels. For most windows this
7459 is just the client area of the window, but for some like scrolled
7460 windows it is more or less independent of the screen window size.
7461 """
7462 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
7463
7464 def GetVirtualSize(*args, **kwargs):
7465 """
7466 GetVirtualSize(self) -> Size
7467
7468 Get the the virtual size of the window in pixels. For most windows
7469 this is just the client area of the window, but for some like scrolled
7470 windows it is more or less independent of the screen window size.
7471 """
7472 return _core_.Window_GetVirtualSize(*args, **kwargs)
7473
7474 def GetVirtualSizeTuple(*args, **kwargs):
7475 """
7476 GetVirtualSizeTuple() -> (width, height)
7477
7478 Get the the virtual size of the window in pixels. For most windows
7479 this is just the client area of the window, but for some like scrolled
7480 windows it is more or less independent of the screen window size.
7481 """
7482 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
7483
7484 def GetBestVirtualSize(*args, **kwargs):
7485 """
7486 GetBestVirtualSize(self) -> Size
7487
7488 Return the largest of ClientSize and BestSize (as determined by a
7489 sizer, interior children, or other means)
7490 """
7491 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
7492
7493 def Show(*args, **kwargs):
7494 """
7495 Show(self, bool show=True) -> bool
7496
7497 Shows or hides the window. You may need to call Raise for a top level
7498 window if you want to bring it to top, although this is not needed if
7499 Show is called immediately after the frame creation. Returns True if
7500 the window has been shown or hidden or False if nothing was done
7501 because it already was in the requested state.
7502 """
7503 return _core_.Window_Show(*args, **kwargs)
7504
7505 def Hide(*args, **kwargs):
7506 """
7507 Hide(self) -> bool
7508
7509 Equivalent to calling Show(False).
7510 """
7511 return _core_.Window_Hide(*args, **kwargs)
7512
7513 def Enable(*args, **kwargs):
7514 """
7515 Enable(self, bool enable=True) -> bool
7516
7517 Enable or disable the window for user input. Note that when a parent
7518 window is disabled, all of its children are disabled as well and they
7519 are reenabled again when the parent is. Returns true if the window
7520 has been enabled or disabled, false if nothing was done, i.e. if the
7521 window had already been in the specified state.
7522 """
7523 return _core_.Window_Enable(*args, **kwargs)
7524
7525 def Disable(*args, **kwargs):
7526 """
7527 Disable(self) -> bool
7528
7529 Disables the window, same as Enable(false).
7530 """
7531 return _core_.Window_Disable(*args, **kwargs)
7532
7533 def IsShown(*args, **kwargs):
7534 """
7535 IsShown(self) -> bool
7536
7537 Returns true if the window is shown, false if it has been hidden.
7538 """
7539 return _core_.Window_IsShown(*args, **kwargs)
7540
7541 def IsEnabled(*args, **kwargs):
7542 """
7543 IsEnabled(self) -> bool
7544
7545 Returns true if the window is enabled for input, false otherwise.
7546 """
7547 return _core_.Window_IsEnabled(*args, **kwargs)
7548
7549 def SetWindowStyleFlag(*args, **kwargs):
7550 """
7551 SetWindowStyleFlag(self, long style)
7552
7553 Sets the style of the window. Please note that some styles cannot be
7554 changed after the window creation and that Refresh() might need to be
7555 called after changing the others for the change to take place
7556 immediately.
7557 """
7558 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
7559
7560 def GetWindowStyleFlag(*args, **kwargs):
7561 """
7562 GetWindowStyleFlag(self) -> long
7563
7564 Gets the window style that was passed to the constructor or Create
7565 method.
7566 """
7567 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
7568
7569 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
7570 def HasFlag(*args, **kwargs):
7571 """
7572 HasFlag(self, int flag) -> bool
7573
7574 Test if the given style is set for this window.
7575 """
7576 return _core_.Window_HasFlag(*args, **kwargs)
7577
7578 def IsRetained(*args, **kwargs):
7579 """
7580 IsRetained(self) -> bool
7581
7582 Returns true if the window is retained, false otherwise. Retained
7583 windows are only available on X platforms.
7584 """
7585 return _core_.Window_IsRetained(*args, **kwargs)
7586
7587 def SetExtraStyle(*args, **kwargs):
7588 """
7589 SetExtraStyle(self, long exStyle)
7590
7591 Sets the extra style bits for the window. Extra styles are the less
7592 often used style bits which can't be set with the constructor or with
7593 SetWindowStyleFlag()
7594 """
7595 return _core_.Window_SetExtraStyle(*args, **kwargs)
7596
7597 def GetExtraStyle(*args, **kwargs):
7598 """
7599 GetExtraStyle(self) -> long
7600
7601 Returns the extra style bits for the window.
7602 """
7603 return _core_.Window_GetExtraStyle(*args, **kwargs)
7604
7605 def MakeModal(*args, **kwargs):
7606 """
7607 MakeModal(self, bool modal=True)
7608
7609 Disables all other windows in the application so that the user can
7610 only interact with this window. Passing False will reverse this
7611 effect.
7612 """
7613 return _core_.Window_MakeModal(*args, **kwargs)
7614
7615 def SetThemeEnabled(*args, **kwargs):
7616 """
7617 SetThemeEnabled(self, bool enableTheme)
7618
7619 This function tells a window if it should use the system's "theme"
7620 code to draw the windows' background instead if its own background
7621 drawing code. This will only have an effect on platforms that support
7622 the notion of themes in user defined windows. One such platform is
7623 GTK+ where windows can have (very colourful) backgrounds defined by a
7624 user's selected theme.
7625
7626 Dialogs, notebook pages and the status bar have this flag set to true
7627 by default so that the default look and feel is simulated best.
7628 """
7629 return _core_.Window_SetThemeEnabled(*args, **kwargs)
7630
7631 def GetThemeEnabled(*args, **kwargs):
7632 """
7633 GetThemeEnabled(self) -> bool
7634
7635 Return the themeEnabled flag.
7636 """
7637 return _core_.Window_GetThemeEnabled(*args, **kwargs)
7638
7639 def SetFocus(*args, **kwargs):
7640 """
7641 SetFocus(self)
7642
7643 Set's the focus to this window, allowing it to receive keyboard input.
7644 """
7645 return _core_.Window_SetFocus(*args, **kwargs)
7646
7647 def SetFocusFromKbd(*args, **kwargs):
7648 """
7649 SetFocusFromKbd(self)
7650
7651 Set focus to this window as the result of a keyboard action. Normally
7652 only called internally.
7653 """
7654 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
7655
7656 def FindFocus(*args, **kwargs):
7657 """
7658 FindFocus() -> Window
7659
7660 Returns the window or control that currently has the keyboard focus,
7661 or None.
7662 """
7663 return _core_.Window_FindFocus(*args, **kwargs)
7664
7665 FindFocus = staticmethod(FindFocus)
7666 def AcceptsFocus(*args, **kwargs):
7667 """
7668 AcceptsFocus(self) -> bool
7669
7670 Can this window have focus?
7671 """
7672 return _core_.Window_AcceptsFocus(*args, **kwargs)
7673
7674 def AcceptsFocusFromKeyboard(*args, **kwargs):
7675 """
7676 AcceptsFocusFromKeyboard(self) -> bool
7677
7678 Can this window be given focus by keyboard navigation? if not, the
7679 only way to give it focus (provided it accepts it at all) is to click
7680 it.
7681 """
7682 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
7683
7684 def GetDefaultItem(*args, **kwargs):
7685 """
7686 GetDefaultItem(self) -> Window
7687
7688 Get the default child of this parent, i.e. the one which is activated
7689 by pressing <Enter> such as the OK button on a wx.Dialog.
7690 """
7691 return _core_.Window_GetDefaultItem(*args, **kwargs)
7692
7693 def SetDefaultItem(*args, **kwargs):
7694 """
7695 SetDefaultItem(self, Window child) -> Window
7696
7697 Set this child as default, return the old default.
7698 """
7699 return _core_.Window_SetDefaultItem(*args, **kwargs)
7700
7701 def SetTmpDefaultItem(*args, **kwargs):
7702 """
7703 SetTmpDefaultItem(self, Window win)
7704
7705 Set this child as temporary default
7706 """
7707 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
7708
7709 def Navigate(*args, **kwargs):
7710 """
7711 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
7712
7713 Does keyboard navigation from this window to another, by sending a
7714 `wx.NavigationKeyEvent`.
7715 """
7716 return _core_.Window_Navigate(*args, **kwargs)
7717
7718 def MoveAfterInTabOrder(*args, **kwargs):
7719 """
7720 MoveAfterInTabOrder(self, Window win)
7721
7722 Moves this window in the tab navigation order after the specified
7723 sibling window. This means that when the user presses the TAB key on
7724 that other window, the focus switches to this window.
7725
7726 The default tab order is the same as creation order. This function
7727 and `MoveBeforeInTabOrder` allow to change it after creating all the
7728 windows.
7729
7730 """
7731 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
7732
7733 def MoveBeforeInTabOrder(*args, **kwargs):
7734 """
7735 MoveBeforeInTabOrder(self, Window win)
7736
7737 Same as `MoveAfterInTabOrder` except that it inserts this window just
7738 before win instead of putting it right after it.
7739 """
7740 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
7741
7742 def GetChildren(*args, **kwargs):
7743 """
7744 GetChildren(self) -> PyObject
7745
7746 Returns a list of the window's children. NOTE: Currently this is a
7747 copy of the child window list maintained by the window, so the return
7748 value of this function is only valid as long as the window's children
7749 do not change.
7750 """
7751 return _core_.Window_GetChildren(*args, **kwargs)
7752
7753 def GetParent(*args, **kwargs):
7754 """
7755 GetParent(self) -> Window
7756
7757 Returns the parent window of this window, or None if there isn't one.
7758 """
7759 return _core_.Window_GetParent(*args, **kwargs)
7760
7761 def GetGrandParent(*args, **kwargs):
7762 """
7763 GetGrandParent(self) -> Window
7764
7765 Returns the parent of the parent of this window, or None if there
7766 isn't one.
7767 """
7768 return _core_.Window_GetGrandParent(*args, **kwargs)
7769
7770 def IsTopLevel(*args, **kwargs):
7771 """
7772 IsTopLevel(self) -> bool
7773
7774 Returns true if the given window is a top-level one. Currently all
7775 frames and dialogs are always considered to be top-level windows (even
7776 if they have a parent window).
7777 """
7778 return _core_.Window_IsTopLevel(*args, **kwargs)
7779
7780 def Reparent(*args, **kwargs):
7781 """
7782 Reparent(self, Window newParent) -> bool
7783
7784 Reparents the window, i.e the window will be removed from its current
7785 parent window (e.g. a non-standard toolbar in a wxFrame) and then
7786 re-inserted into another. Available on Windows and GTK. Returns True
7787 if the parent was changed, False otherwise (error or newParent ==
7788 oldParent)
7789 """
7790 return _core_.Window_Reparent(*args, **kwargs)
7791
7792 def AddChild(*args, **kwargs):
7793 """
7794 AddChild(self, Window child)
7795
7796 Adds a child window. This is called automatically by window creation
7797 functions so should not be required by the application programmer.
7798 """
7799 return _core_.Window_AddChild(*args, **kwargs)
7800
7801 def RemoveChild(*args, **kwargs):
7802 """
7803 RemoveChild(self, Window child)
7804
7805 Removes a child window. This is called automatically by window
7806 deletion functions so should not be required by the application
7807 programmer.
7808 """
7809 return _core_.Window_RemoveChild(*args, **kwargs)
7810
7811 def FindWindowById(*args, **kwargs):
7812 """
7813 FindWindowById(self, long winid) -> Window
7814
7815 Find a chld of this window by window ID
7816 """
7817 return _core_.Window_FindWindowById(*args, **kwargs)
7818
7819 def FindWindowByName(*args, **kwargs):
7820 """
7821 FindWindowByName(self, String name) -> Window
7822
7823 Find a child of this window by name
7824 """
7825 return _core_.Window_FindWindowByName(*args, **kwargs)
7826
7827 def GetEventHandler(*args, **kwargs):
7828 """
7829 GetEventHandler(self) -> EvtHandler
7830
7831 Returns the event handler for this window. By default, the window is
7832 its own event handler.
7833 """
7834 return _core_.Window_GetEventHandler(*args, **kwargs)
7835
7836 def SetEventHandler(*args, **kwargs):
7837 """
7838 SetEventHandler(self, EvtHandler handler)
7839
7840 Sets the event handler for this window. An event handler is an object
7841 that is capable of processing the events sent to a window. By default,
7842 the window is its own event handler, but an application may wish to
7843 substitute another, for example to allow central implementation of
7844 event-handling for a variety of different window classes.
7845
7846 It is usually better to use `wx.Window.PushEventHandler` since this sets
7847 up a chain of event handlers, where an event not handled by one event
7848 handler is handed to the next one in the chain.
7849 """
7850 return _core_.Window_SetEventHandler(*args, **kwargs)
7851
7852 def PushEventHandler(*args, **kwargs):
7853 """
7854 PushEventHandler(self, EvtHandler handler)
7855
7856 Pushes this event handler onto the event handler stack for the window.
7857 An event handler is an object that is capable of processing the events
7858 sent to a window. By default, the window is its own event handler, but
7859 an application may wish to substitute another, for example to allow
7860 central implementation of event-handling for a variety of different
7861 window classes.
7862
7863 wx.Window.PushEventHandler allows an application to set up a chain of
7864 event handlers, where an event not handled by one event handler is
7865 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
7866 remove the event handler.
7867 """
7868 return _core_.Window_PushEventHandler(*args, **kwargs)
7869
7870 def PopEventHandler(*args, **kwargs):
7871 """
7872 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
7873
7874 Removes and returns the top-most event handler on the event handler
7875 stack. If deleteHandler is True then the wx.EvtHandler object will be
7876 destroyed after it is popped.
7877 """
7878 return _core_.Window_PopEventHandler(*args, **kwargs)
7879
7880 def RemoveEventHandler(*args, **kwargs):
7881 """
7882 RemoveEventHandler(self, EvtHandler handler) -> bool
7883
7884 Find the given handler in the event handler chain and remove (but not
7885 delete) it from the event handler chain, return True if it was found
7886 and False otherwise (this also results in an assert failure so this
7887 function should only be called when the handler is supposed to be
7888 there.)
7889 """
7890 return _core_.Window_RemoveEventHandler(*args, **kwargs)
7891
7892 def SetValidator(*args, **kwargs):
7893 """
7894 SetValidator(self, Validator validator)
7895
7896 Deletes the current validator (if any) and sets the window validator,
7897 having called wx.Validator.Clone to create a new validator of this
7898 type.
7899 """
7900 return _core_.Window_SetValidator(*args, **kwargs)
7901
7902 def GetValidator(*args, **kwargs):
7903 """
7904 GetValidator(self) -> Validator
7905
7906 Returns a pointer to the current validator for the window, or None if
7907 there is none.
7908 """
7909 return _core_.Window_GetValidator(*args, **kwargs)
7910
7911 def Validate(*args, **kwargs):
7912 """
7913 Validate(self) -> bool
7914
7915 Validates the current values of the child controls using their
7916 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7917 style flag set, the method will also call Validate() of all child
7918 windows. Returns false if any of the validations failed.
7919 """
7920 return _core_.Window_Validate(*args, **kwargs)
7921
7922 def TransferDataToWindow(*args, **kwargs):
7923 """
7924 TransferDataToWindow(self) -> bool
7925
7926 Transfers values to child controls from data areas specified by their
7927 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7928 style flag set, the method will also call TransferDataToWindow() of
7929 all child windows.
7930 """
7931 return _core_.Window_TransferDataToWindow(*args, **kwargs)
7932
7933 def TransferDataFromWindow(*args, **kwargs):
7934 """
7935 TransferDataFromWindow(self) -> bool
7936
7937 Transfers values from child controls to data areas specified by their
7938 validators. Returns false if a transfer failed. If the window has
7939 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
7940 also call TransferDataFromWindow() of all child windows.
7941 """
7942 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
7943
7944 def InitDialog(*args, **kwargs):
7945 """
7946 InitDialog(self)
7947
7948 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
7949 to the dialog via validators.
7950 """
7951 return _core_.Window_InitDialog(*args, **kwargs)
7952
7953 def SetAcceleratorTable(*args, **kwargs):
7954 """
7955 SetAcceleratorTable(self, AcceleratorTable accel)
7956
7957 Sets the accelerator table for this window.
7958 """
7959 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
7960
7961 def GetAcceleratorTable(*args, **kwargs):
7962 """
7963 GetAcceleratorTable(self) -> AcceleratorTable
7964
7965 Gets the accelerator table for this window.
7966 """
7967 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
7968
7969 def RegisterHotKey(*args, **kwargs):
7970 """
7971 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
7972
7973 Registers a system wide hotkey. Every time the user presses the hotkey
7974 registered here, this window will receive a hotkey event. It will
7975 receive the event even if the application is in the background and
7976 does not have the input focus because the user is working with some
7977 other application. To bind an event handler function to this hotkey
7978 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
7979 hotkey was registered successfully.
7980 """
7981 return _core_.Window_RegisterHotKey(*args, **kwargs)
7982
7983 def UnregisterHotKey(*args, **kwargs):
7984 """
7985 UnregisterHotKey(self, int hotkeyId) -> bool
7986
7987 Unregisters a system wide hotkey.
7988 """
7989 return _core_.Window_UnregisterHotKey(*args, **kwargs)
7990
7991 def ConvertDialogPointToPixels(*args, **kwargs):
7992 """
7993 ConvertDialogPointToPixels(self, Point pt) -> Point
7994
7995 Converts a point or size from dialog units to pixels. Dialog units
7996 are used for maintaining a dialog's proportions even if the font
7997 changes. For the x dimension, the dialog units are multiplied by the
7998 average character width and then divided by 4. For the y dimension,
7999 the dialog units are multiplied by the average character height and
8000 then divided by 8.
8001 """
8002 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8003
8004 def ConvertDialogSizeToPixels(*args, **kwargs):
8005 """
8006 ConvertDialogSizeToPixels(self, Size sz) -> Size
8007
8008 Converts a point or size from dialog units to pixels. Dialog units
8009 are used for maintaining a dialog's proportions even if the font
8010 changes. For the x dimension, the dialog units are multiplied by the
8011 average character width and then divided by 4. For the y dimension,
8012 the dialog units are multiplied by the average character height and
8013 then divided by 8.
8014 """
8015 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8016
8017 def DLG_PNT(*args, **kwargs):
8018 """
8019 DLG_PNT(self, Point pt) -> Point
8020
8021 Converts a point or size from dialog units to pixels. Dialog units
8022 are used for maintaining a dialog's proportions even if the font
8023 changes. For the x dimension, the dialog units are multiplied by the
8024 average character width and then divided by 4. For the y dimension,
8025 the dialog units are multiplied by the average character height and
8026 then divided by 8.
8027 """
8028 return _core_.Window_DLG_PNT(*args, **kwargs)
8029
8030 def DLG_SZE(*args, **kwargs):
8031 """
8032 DLG_SZE(self, Size sz) -> Size
8033
8034 Converts a point or size from dialog units to pixels. Dialog units
8035 are used for maintaining a dialog's proportions even if the font
8036 changes. For the x dimension, the dialog units are multiplied by the
8037 average character width and then divided by 4. For the y dimension,
8038 the dialog units are multiplied by the average character height and
8039 then divided by 8.
8040 """
8041 return _core_.Window_DLG_SZE(*args, **kwargs)
8042
8043 def ConvertPixelPointToDialog(*args, **kwargs):
8044 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8045 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8046
8047 def ConvertPixelSizeToDialog(*args, **kwargs):
8048 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8049 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8050
8051 def WarpPointer(*args, **kwargs):
8052 """
8053 WarpPointer(self, int x, int y)
8054
8055 Moves the pointer to the given position on the window.
8056
8057 NOTE: This function is not supported under Mac because Apple Human
8058 Interface Guidelines forbid moving the mouse cursor programmatically.
8059 """
8060 return _core_.Window_WarpPointer(*args, **kwargs)
8061
8062 def CaptureMouse(*args, **kwargs):
8063 """
8064 CaptureMouse(self)
8065
8066 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8067 release the capture.
8068
8069 Note that wxWindows maintains the stack of windows having captured the
8070 mouse and when the mouse is released the capture returns to the window
8071 which had had captured it previously and it is only really released if
8072 there were no previous window. In particular, this means that you must
8073 release the mouse as many times as you capture it.
8074 """
8075 return _core_.Window_CaptureMouse(*args, **kwargs)
8076
8077 def ReleaseMouse(*args, **kwargs):
8078 """
8079 ReleaseMouse(self)
8080
8081 Releases mouse input captured with wx.Window.CaptureMouse.
8082 """
8083 return _core_.Window_ReleaseMouse(*args, **kwargs)
8084
8085 def GetCapture(*args, **kwargs):
8086 """
8087 GetCapture() -> Window
8088
8089 Returns the window which currently captures the mouse or None
8090 """
8091 return _core_.Window_GetCapture(*args, **kwargs)
8092
8093 GetCapture = staticmethod(GetCapture)
8094 def HasCapture(*args, **kwargs):
8095 """
8096 HasCapture(self) -> bool
8097
8098 Returns true if this window has the current mouse capture.
8099 """
8100 return _core_.Window_HasCapture(*args, **kwargs)
8101
8102 def Refresh(*args, **kwargs):
8103 """
8104 Refresh(self, bool eraseBackground=True, Rect rect=None)
8105
8106 Mark the specified rectangle (or the whole window) as "dirty" so it
8107 will be repainted. Causes an EVT_PAINT event to be generated and sent
8108 to the window.
8109 """
8110 return _core_.Window_Refresh(*args, **kwargs)
8111
8112 def RefreshRect(*args, **kwargs):
8113 """
8114 RefreshRect(self, Rect rect, bool eraseBackground=True)
8115
8116 Redraws the contents of the given rectangle: the area inside it will
8117 be repainted. This is the same as Refresh but has a nicer syntax.
8118 """
8119 return _core_.Window_RefreshRect(*args, **kwargs)
8120
8121 def Update(*args, **kwargs):
8122 """
8123 Update(self)
8124
8125 Calling this method immediately repaints the invalidated area of the
8126 window instead of waiting for the EVT_PAINT event to happen, (normally
8127 this would usually only happen when the flow of control returns to the
8128 event loop.) Notice that this function doesn't refresh the window and
8129 does nothing if the window has been already repainted. Use Refresh
8130 first if you want to immediately redraw the window (or some portion of
8131 it) unconditionally.
8132 """
8133 return _core_.Window_Update(*args, **kwargs)
8134
8135 def ClearBackground(*args, **kwargs):
8136 """
8137 ClearBackground(self)
8138
8139 Clears the window by filling it with the current background
8140 colour. Does not cause an erase background event to be generated.
8141 """
8142 return _core_.Window_ClearBackground(*args, **kwargs)
8143
8144 def Freeze(*args, **kwargs):
8145 """
8146 Freeze(self)
8147
8148 Freezes the window or, in other words, prevents any updates from
8149 taking place on screen, the window is not redrawn at all. Thaw must be
8150 called to reenable window redrawing. Calls to Freeze/Thaw may be
8151 nested, with the actual Thaw being delayed until all the nesting has
8152 been undone.
8153
8154 This method is useful for visual appearance optimization (for example,
8155 it is a good idea to use it before inserting large amount of text into
8156 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8157 for all controls so it is mostly just a hint to wxWindows and not a
8158 mandatory directive.
8159 """
8160 return _core_.Window_Freeze(*args, **kwargs)
8161
8162 def Thaw(*args, **kwargs):
8163 """
8164 Thaw(self)
8165
8166 Reenables window updating after a previous call to Freeze. Calls to
8167 Freeze/Thaw may be nested, so Thaw must be called the same number of
8168 times that Freeze was before the window will be updated.
8169 """
8170 return _core_.Window_Thaw(*args, **kwargs)
8171
8172 def PrepareDC(*args, **kwargs):
8173 """
8174 PrepareDC(self, DC dc)
8175
8176 Call this function to prepare the device context for drawing a
8177 scrolled image. It sets the device origin according to the current
8178 scroll position.
8179 """
8180 return _core_.Window_PrepareDC(*args, **kwargs)
8181
8182 def GetUpdateRegion(*args, **kwargs):
8183 """
8184 GetUpdateRegion(self) -> Region
8185
8186 Returns the region specifying which parts of the window have been
8187 damaged. Should only be called within an EVT_PAINT handler.
8188 """
8189 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8190
8191 def GetUpdateClientRect(*args, **kwargs):
8192 """
8193 GetUpdateClientRect(self) -> Rect
8194
8195 Get the update rectangle region bounding box in client coords.
8196 """
8197 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8198
8199 def IsExposed(*args, **kwargs):
8200 """
8201 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8202
8203 Returns true if the given point or rectangle area has been exposed
8204 since the last repaint. Call this in an paint event handler to
8205 optimize redrawing by only redrawing those areas, which have been
8206 exposed.
8207 """
8208 return _core_.Window_IsExposed(*args, **kwargs)
8209
8210 def IsExposedPoint(*args, **kwargs):
8211 """
8212 IsExposedPoint(self, Point pt) -> bool
8213
8214 Returns true if the given point or rectangle area has been exposed
8215 since the last repaint. Call this in an paint event handler to
8216 optimize redrawing by only redrawing those areas, which have been
8217 exposed.
8218 """
8219 return _core_.Window_IsExposedPoint(*args, **kwargs)
8220
8221 def IsExposedRect(*args, **kwargs):
8222 """
8223 IsExposedRect(self, Rect rect) -> bool
8224
8225 Returns true if the given point or rectangle area has been exposed
8226 since the last repaint. Call this in an paint event handler to
8227 optimize redrawing by only redrawing those areas, which have been
8228 exposed.
8229 """
8230 return _core_.Window_IsExposedRect(*args, **kwargs)
8231
8232 def GetDefaultAttributes(*args, **kwargs):
8233 """
8234 GetDefaultAttributes(self) -> VisualAttributes
8235
8236 Get the default attributes for an instance of this class. This is
8237 useful if you want to use the same font or colour in your own control
8238 as in a standard control -- which is a much better idea than hard
8239 coding specific colours or fonts which might look completely out of
8240 place on the user's system, especially if it uses themes.
8241 """
8242 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8243
8244 def GetClassDefaultAttributes(*args, **kwargs):
8245 """
8246 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8247
8248 Get the default attributes for this class. This is useful if you want
8249 to use the same font or colour in your own control as in a standard
8250 control -- which is a much better idea than hard coding specific
8251 colours or fonts which might look completely out of place on the
8252 user's system, especially if it uses themes.
8253
8254 The variant parameter is only relevant under Mac currently and is
8255 ignore under other platforms. Under Mac, it will change the size of
8256 the returned font. See `wx.Window.SetWindowVariant` for more about
8257 this.
8258 """
8259 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8260
8261 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8262 def SetBackgroundColour(*args, **kwargs):
8263 """
8264 SetBackgroundColour(self, Colour colour) -> bool
8265
8266 Sets the background colour of the window. Returns True if the colour
8267 was changed. The background colour is usually painted by the default
8268 EVT_ERASE_BACKGROUND event handler function under Windows and
8269 automatically under GTK. Using `wx.NullColour` will reset the window
8270 to the default background colour.
8271
8272 Note that setting the background colour may not cause an immediate
8273 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8274 calling this function.
8275
8276 Using this function will disable attempts to use themes for this
8277 window, if the system supports them. Use with care since usually the
8278 themes represent the appearance chosen by the user to be used for all
8279 applications on the system.
8280 """
8281 return _core_.Window_SetBackgroundColour(*args, **kwargs)
8282
8283 def SetOwnBackgroundColour(*args, **kwargs):
8284 """SetOwnBackgroundColour(self, Colour colour)"""
8285 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
8286
8287 def SetForegroundColour(*args, **kwargs):
8288 """
8289 SetForegroundColour(self, Colour colour) -> bool
8290
8291 Sets the foreground colour of the window. Returns True is the colour
8292 was changed. The interpretation of foreground colour is dependent on
8293 the window class; it may be the text colour or other colour, or it may
8294 not be used at all.
8295 """
8296 return _core_.Window_SetForegroundColour(*args, **kwargs)
8297
8298 def SetOwnForegroundColour(*args, **kwargs):
8299 """SetOwnForegroundColour(self, Colour colour)"""
8300 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
8301
8302 def GetBackgroundColour(*args, **kwargs):
8303 """
8304 GetBackgroundColour(self) -> Colour
8305
8306 Returns the background colour of the window.
8307 """
8308 return _core_.Window_GetBackgroundColour(*args, **kwargs)
8309
8310 def GetForegroundColour(*args, **kwargs):
8311 """
8312 GetForegroundColour(self) -> Colour
8313
8314 Returns the foreground colour of the window. The interpretation of
8315 foreground colour is dependent on the window class; it may be the text
8316 colour or other colour, or it may not be used at all.
8317 """
8318 return _core_.Window_GetForegroundColour(*args, **kwargs)
8319
8320 def InheritsBackgroundColour(*args, **kwargs):
8321 """InheritsBackgroundColour(self) -> bool"""
8322 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8323
8324 def UseBgCol(*args, **kwargs):
8325 """UseBgCol(self) -> bool"""
8326 return _core_.Window_UseBgCol(*args, **kwargs)
8327
8328 def SetBackgroundStyle(*args, **kwargs):
8329 """
8330 SetBackgroundStyle(self, int style) -> bool
8331
8332 Returns the background style of the window. The background style
8333 indicates how the background of the window is drawn.
8334
8335 ====================== ========================================
8336 wx.BG_STYLE_SYSTEM The background colour or pattern should
8337 be determined by the system
8338 wx.BG_STYLE_COLOUR The background should be a solid colour
8339 wx.BG_STYLE_CUSTOM The background will be implemented by the
8340 application.
8341 ====================== ========================================
8342
8343 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8344 a custom background, such as a tiled bitmap. Currently the style has
8345 no effect on other platforms.
8346
8347 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8348 """
8349 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8350
8351 def GetBackgroundStyle(*args, **kwargs):
8352 """
8353 GetBackgroundStyle(self) -> int
8354
8355 Returns the background style of the window.
8356
8357 :see: `SetBackgroundStyle`
8358 """
8359 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8360
8361 def HasTransparentBackground(*args, **kwargs):
8362 """
8363 HasTransparentBackground(self) -> bool
8364
8365 Returns True if this window's background is transparent (as, for
8366 example, for `wx.StaticText`) and should show the parent window's
8367 background.
8368
8369 This method is mostly used internally by the library itself and you
8370 normally shouldn't have to call it. You may, however, have to override
8371 it in your custom control classes to ensure that background is painted
8372 correctly.
8373 """
8374 return _core_.Window_HasTransparentBackground(*args, **kwargs)
8375
8376 def SetCursor(*args, **kwargs):
8377 """
8378 SetCursor(self, Cursor cursor) -> bool
8379
8380 Sets the window's cursor. Notice that the window cursor also sets it
8381 for the children of the window implicitly.
8382
8383 The cursor may be wx.NullCursor in which case the window cursor will
8384 be reset back to default.
8385 """
8386 return _core_.Window_SetCursor(*args, **kwargs)
8387
8388 def GetCursor(*args, **kwargs):
8389 """
8390 GetCursor(self) -> Cursor
8391
8392 Return the cursor associated with this window.
8393 """
8394 return _core_.Window_GetCursor(*args, **kwargs)
8395
8396 def SetFont(*args, **kwargs):
8397 """
8398 SetFont(self, Font font) -> bool
8399
8400 Sets the font for this window.
8401 """
8402 return _core_.Window_SetFont(*args, **kwargs)
8403
8404 def SetOwnFont(*args, **kwargs):
8405 """SetOwnFont(self, Font font)"""
8406 return _core_.Window_SetOwnFont(*args, **kwargs)
8407
8408 def GetFont(*args, **kwargs):
8409 """
8410 GetFont(self) -> Font
8411
8412 Returns the default font used for this window.
8413 """
8414 return _core_.Window_GetFont(*args, **kwargs)
8415
8416 def SetCaret(*args, **kwargs):
8417 """
8418 SetCaret(self, Caret caret)
8419
8420 Sets the caret associated with the window.
8421 """
8422 return _core_.Window_SetCaret(*args, **kwargs)
8423
8424 def GetCaret(*args, **kwargs):
8425 """
8426 GetCaret(self) -> Caret
8427
8428 Returns the caret associated with the window.
8429 """
8430 return _core_.Window_GetCaret(*args, **kwargs)
8431
8432 def GetCharHeight(*args, **kwargs):
8433 """
8434 GetCharHeight(self) -> int
8435
8436 Get the (average) character size for the current font.
8437 """
8438 return _core_.Window_GetCharHeight(*args, **kwargs)
8439
8440 def GetCharWidth(*args, **kwargs):
8441 """
8442 GetCharWidth(self) -> int
8443
8444 Get the (average) character size for the current font.
8445 """
8446 return _core_.Window_GetCharWidth(*args, **kwargs)
8447
8448 def GetTextExtent(*args, **kwargs):
8449 """
8450 GetTextExtent(String string) -> (width, height)
8451
8452 Get the width and height of the text using the current font.
8453 """
8454 return _core_.Window_GetTextExtent(*args, **kwargs)
8455
8456 def GetFullTextExtent(*args, **kwargs):
8457 """
8458 GetFullTextExtent(String string, Font font=None) ->
8459 (width, height, descent, externalLeading)
8460
8461 Get the width, height, decent and leading of the text using the
8462 current or specified font.
8463 """
8464 return _core_.Window_GetFullTextExtent(*args, **kwargs)
8465
8466 def ClientToScreenXY(*args, **kwargs):
8467 """
8468 ClientToScreenXY(int x, int y) -> (x,y)
8469
8470 Converts to screen coordinates from coordinates relative to this window.
8471 """
8472 return _core_.Window_ClientToScreenXY(*args, **kwargs)
8473
8474 def ScreenToClientXY(*args, **kwargs):
8475 """
8476 ScreenToClientXY(int x, int y) -> (x,y)
8477
8478 Converts from screen to client window coordinates.
8479 """
8480 return _core_.Window_ScreenToClientXY(*args, **kwargs)
8481
8482 def ClientToScreen(*args, **kwargs):
8483 """
8484 ClientToScreen(self, Point pt) -> Point
8485
8486 Converts to screen coordinates from coordinates relative to this window.
8487 """
8488 return _core_.Window_ClientToScreen(*args, **kwargs)
8489
8490 def ScreenToClient(*args, **kwargs):
8491 """
8492 ScreenToClient(self, Point pt) -> Point
8493
8494 Converts from screen to client window coordinates.
8495 """
8496 return _core_.Window_ScreenToClient(*args, **kwargs)
8497
8498 def HitTestXY(*args, **kwargs):
8499 """
8500 HitTestXY(self, int x, int y) -> int
8501
8502 Test where the given (in client coords) point lies
8503 """
8504 return _core_.Window_HitTestXY(*args, **kwargs)
8505
8506 def HitTest(*args, **kwargs):
8507 """
8508 HitTest(self, Point pt) -> int
8509
8510 Test where the given (in client coords) point lies
8511 """
8512 return _core_.Window_HitTest(*args, **kwargs)
8513
8514 def GetBorder(*args):
8515 """
8516 GetBorder(self, long flags) -> int
8517 GetBorder(self) -> int
8518
8519 Get border for the flags of this window
8520 """
8521 return _core_.Window_GetBorder(*args)
8522
8523 def UpdateWindowUI(*args, **kwargs):
8524 """
8525 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
8526
8527 This function sends EVT_UPDATE_UI events to the window. The particular
8528 implementation depends on the window; for example a wx.ToolBar will
8529 send an update UI event for each toolbar button, and a wx.Frame will
8530 send an update UI event for each menubar menu item. You can call this
8531 function from your application to ensure that your UI is up-to-date at
8532 a particular point in time (as far as your EVT_UPDATE_UI handlers are
8533 concerned). This may be necessary if you have called
8534 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
8535 limit the overhead that wxWindows incurs by sending update UI events
8536 in idle time.
8537 """
8538 return _core_.Window_UpdateWindowUI(*args, **kwargs)
8539
8540 def PopupMenuXY(*args, **kwargs):
8541 """
8542 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
8543
8544 Pops up the given menu at the specified coordinates, relative to this window,
8545 and returns control when the user has dismissed the menu. If a menu item is
8546 selected, the corresponding menu event is generated and will be processed as
8547 usual. If the default position is given then the current position of the
8548 mouse cursor will be used.
8549 """
8550 return _core_.Window_PopupMenuXY(*args, **kwargs)
8551
8552 def PopupMenu(*args, **kwargs):
8553 """
8554 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
8555
8556 Pops up the given menu at the specified coordinates, relative to this window,
8557 and returns control when the user has dismissed the menu. If a menu item is
8558 selected, the corresponding menu event is generated and will be processed as
8559 usual. If the default position is given then the current position of the
8560 mouse cursor will be used.
8561 """
8562 return _core_.Window_PopupMenu(*args, **kwargs)
8563
8564 def GetHandle(*args, **kwargs):
8565 """
8566 GetHandle(self) -> long
8567
8568 Returns the platform-specific handle (as a long integer) of the
8569 physical window. Currently on wxMac it returns the handle of the
8570 toplevel parent of the window.
8571 """
8572 return _core_.Window_GetHandle(*args, **kwargs)
8573
8574 def AssociateHandle(*args, **kwargs):
8575 """
8576 AssociateHandle(self, long handle)
8577
8578 Associate the window with a new native handle
8579 """
8580 return _core_.Window_AssociateHandle(*args, **kwargs)
8581
8582 def DissociateHandle(*args, **kwargs):
8583 """
8584 DissociateHandle(self)
8585
8586 Dissociate the current native handle from the window
8587 """
8588 return _core_.Window_DissociateHandle(*args, **kwargs)
8589
8590 def HasScrollbar(*args, **kwargs):
8591 """
8592 HasScrollbar(self, int orient) -> bool
8593
8594 Does the window have the scrollbar for this orientation?
8595 """
8596 return _core_.Window_HasScrollbar(*args, **kwargs)
8597
8598 def SetScrollbar(*args, **kwargs):
8599 """
8600 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
8601 bool refresh=True)
8602
8603 Sets the scrollbar properties of a built-in scrollbar.
8604 """
8605 return _core_.Window_SetScrollbar(*args, **kwargs)
8606
8607 def SetScrollPos(*args, **kwargs):
8608 """
8609 SetScrollPos(self, int orientation, int pos, bool refresh=True)
8610
8611 Sets the position of one of the built-in scrollbars.
8612 """
8613 return _core_.Window_SetScrollPos(*args, **kwargs)
8614
8615 def GetScrollPos(*args, **kwargs):
8616 """
8617 GetScrollPos(self, int orientation) -> int
8618
8619 Returns the built-in scrollbar position.
8620 """
8621 return _core_.Window_GetScrollPos(*args, **kwargs)
8622
8623 def GetScrollThumb(*args, **kwargs):
8624 """
8625 GetScrollThumb(self, int orientation) -> int
8626
8627 Returns the built-in scrollbar thumb size.
8628 """
8629 return _core_.Window_GetScrollThumb(*args, **kwargs)
8630
8631 def GetScrollRange(*args, **kwargs):
8632 """
8633 GetScrollRange(self, int orientation) -> int
8634
8635 Returns the built-in scrollbar range.
8636 """
8637 return _core_.Window_GetScrollRange(*args, **kwargs)
8638
8639 def ScrollWindow(*args, **kwargs):
8640 """
8641 ScrollWindow(self, int dx, int dy, Rect rect=None)
8642
8643 Physically scrolls the pixels in the window and move child windows
8644 accordingly. Use this function to optimise your scrolling
8645 implementations, to minimise the area that must be redrawn. Note that
8646 it is rarely required to call this function from a user program.
8647 """
8648 return _core_.Window_ScrollWindow(*args, **kwargs)
8649
8650 def ScrollLines(*args, **kwargs):
8651 """
8652 ScrollLines(self, int lines) -> bool
8653
8654 If the platform and window class supports it, scrolls the window by
8655 the given number of lines down, if lines is positive, or up if lines
8656 is negative. Returns True if the window was scrolled, False if it was
8657 already on top/bottom and nothing was done.
8658 """
8659 return _core_.Window_ScrollLines(*args, **kwargs)
8660
8661 def ScrollPages(*args, **kwargs):
8662 """
8663 ScrollPages(self, int pages) -> bool
8664
8665 If the platform and window class supports it, scrolls the window by
8666 the given number of pages down, if pages is positive, or up if pages
8667 is negative. Returns True if the window was scrolled, False if it was
8668 already on top/bottom and nothing was done.
8669 """
8670 return _core_.Window_ScrollPages(*args, **kwargs)
8671
8672 def LineUp(*args, **kwargs):
8673 """
8674 LineUp(self) -> bool
8675
8676 This is just a wrapper for ScrollLines(-1).
8677 """
8678 return _core_.Window_LineUp(*args, **kwargs)
8679
8680 def LineDown(*args, **kwargs):
8681 """
8682 LineDown(self) -> bool
8683
8684 This is just a wrapper for ScrollLines(1).
8685 """
8686 return _core_.Window_LineDown(*args, **kwargs)
8687
8688 def PageUp(*args, **kwargs):
8689 """
8690 PageUp(self) -> bool
8691
8692 This is just a wrapper for ScrollPages(-1).
8693 """
8694 return _core_.Window_PageUp(*args, **kwargs)
8695
8696 def PageDown(*args, **kwargs):
8697 """
8698 PageDown(self) -> bool
8699
8700 This is just a wrapper for ScrollPages(1).
8701 """
8702 return _core_.Window_PageDown(*args, **kwargs)
8703
8704 def SetHelpText(*args, **kwargs):
8705 """
8706 SetHelpText(self, String text)
8707
8708 Sets the help text to be used as context-sensitive help for this
8709 window. Note that the text is actually stored by the current
8710 wxHelpProvider implementation, and not in the window object itself.
8711 """
8712 return _core_.Window_SetHelpText(*args, **kwargs)
8713
8714 def SetHelpTextForId(*args, **kwargs):
8715 """
8716 SetHelpTextForId(self, String text)
8717
8718 Associate this help text with all windows with the same id as this
8719 one.
8720 """
8721 return _core_.Window_SetHelpTextForId(*args, **kwargs)
8722
8723 def GetHelpText(*args, **kwargs):
8724 """
8725 GetHelpText(self) -> String
8726
8727 Gets the help text to be used as context-sensitive help for this
8728 window. Note that the text is actually stored by the current
8729 wxHelpProvider implementation, and not in the window object itself.
8730 """
8731 return _core_.Window_GetHelpText(*args, **kwargs)
8732
8733 def SetToolTipString(*args, **kwargs):
8734 """
8735 SetToolTipString(self, String tip)
8736
8737 Attach a tooltip to the window.
8738 """
8739 return _core_.Window_SetToolTipString(*args, **kwargs)
8740
8741 def SetToolTip(*args, **kwargs):
8742 """
8743 SetToolTip(self, ToolTip tip)
8744
8745 Attach a tooltip to the window.
8746 """
8747 return _core_.Window_SetToolTip(*args, **kwargs)
8748
8749 def GetToolTip(*args, **kwargs):
8750 """
8751 GetToolTip(self) -> ToolTip
8752
8753 get the associated tooltip or None if none
8754 """
8755 return _core_.Window_GetToolTip(*args, **kwargs)
8756
8757 def SetDropTarget(*args, **kwargs):
8758 """
8759 SetDropTarget(self, DropTarget dropTarget)
8760
8761 Associates a drop target with this window. If the window already has
8762 a drop target, it is deleted.
8763 """
8764 return _core_.Window_SetDropTarget(*args, **kwargs)
8765
8766 def GetDropTarget(*args, **kwargs):
8767 """
8768 GetDropTarget(self) -> DropTarget
8769
8770 Returns the associated drop target, which may be None.
8771 """
8772 return _core_.Window_GetDropTarget(*args, **kwargs)
8773
8774 def SetConstraints(*args, **kwargs):
8775 """
8776 SetConstraints(self, LayoutConstraints constraints)
8777
8778 Sets the window to have the given layout constraints. If an existing
8779 layout constraints object is already owned by the window, it will be
8780 deleted. Pass None to disassociate and delete the window's current
8781 constraints.
8782
8783 You must call SetAutoLayout to tell a window to use the constraints
8784 automatically in its default EVT_SIZE handler; otherwise, you must
8785 handle EVT_SIZE yourself and call Layout() explicitly. When setting
8786 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
8787 effect.
8788 """
8789 return _core_.Window_SetConstraints(*args, **kwargs)
8790
8791 def GetConstraints(*args, **kwargs):
8792 """
8793 GetConstraints(self) -> LayoutConstraints
8794
8795 Returns a pointer to the window's layout constraints, or None if there
8796 are none.
8797 """
8798 return _core_.Window_GetConstraints(*args, **kwargs)
8799
8800 def SetAutoLayout(*args, **kwargs):
8801 """
8802 SetAutoLayout(self, bool autoLayout)
8803
8804 Determines whether the Layout function will be called automatically
8805 when the window is resized. It is called implicitly by SetSizer but
8806 if you use SetConstraints you should call it manually or otherwise the
8807 window layout won't be correctly updated when its size changes.
8808 """
8809 return _core_.Window_SetAutoLayout(*args, **kwargs)
8810
8811 def GetAutoLayout(*args, **kwargs):
8812 """
8813 GetAutoLayout(self) -> bool
8814
8815 Returns the current autoLayout setting
8816 """
8817 return _core_.Window_GetAutoLayout(*args, **kwargs)
8818
8819 def Layout(*args, **kwargs):
8820 """
8821 Layout(self) -> bool
8822
8823 Invokes the constraint-based layout algorithm or the sizer-based
8824 algorithm for this window. See SetAutoLayout: when auto layout is on,
8825 this function gets called automatically by the default EVT_SIZE
8826 handler when the window is resized.
8827 """
8828 return _core_.Window_Layout(*args, **kwargs)
8829
8830 def SetSizer(*args, **kwargs):
8831 """
8832 SetSizer(self, Sizer sizer, bool deleteOld=True)
8833
8834 Sets the window to have the given layout sizer. The window will then
8835 own the object, and will take care of its deletion. If an existing
8836 layout sizer object is already owned by the window, it will be deleted
8837 if the deleteOld parameter is true. Note that this function will also
8838 call SetAutoLayout implicitly with a True parameter if the sizer is
8839 non-None, and False otherwise.
8840 """
8841 return _core_.Window_SetSizer(*args, **kwargs)
8842
8843 def SetSizerAndFit(*args, **kwargs):
8844 """
8845 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
8846
8847 The same as SetSizer, except it also sets the size hints for the
8848 window based on the sizer's minimum size.
8849 """
8850 return _core_.Window_SetSizerAndFit(*args, **kwargs)
8851
8852 def GetSizer(*args, **kwargs):
8853 """
8854 GetSizer(self) -> Sizer
8855
8856 Return the sizer associated with the window by a previous call to
8857 SetSizer or None if there isn't one.
8858 """
8859 return _core_.Window_GetSizer(*args, **kwargs)
8860
8861 def SetContainingSizer(*args, **kwargs):
8862 """
8863 SetContainingSizer(self, Sizer sizer)
8864
8865 This normally does not need to be called by application code. It is
8866 called internally when a window is added to a sizer, and is used so
8867 the window can remove itself from the sizer when it is destroyed.
8868 """
8869 return _core_.Window_SetContainingSizer(*args, **kwargs)
8870
8871 def GetContainingSizer(*args, **kwargs):
8872 """
8873 GetContainingSizer(self) -> Sizer
8874
8875 Return the sizer that this window is a member of, if any, otherwise None.
8876 """
8877 return _core_.Window_GetContainingSizer(*args, **kwargs)
8878
8879 def InheritAttributes(*args, **kwargs):
8880 """
8881 InheritAttributes(self)
8882
8883 This function is (or should be, in case of custom controls) called
8884 during window creation to intelligently set up the window visual
8885 attributes, that is the font and the foreground and background
8886 colours.
8887
8888 By 'intelligently' the following is meant: by default, all windows use
8889 their own default attributes. However if some of the parent's
8890 attributes are explicitly changed (that is, using SetFont and not
8891 SetOwnFont) and if the corresponding attribute hadn't been
8892 explicitly set for this window itself, then this window takes the same
8893 value as used by the parent. In addition, if the window overrides
8894 ShouldInheritColours to return false, the colours will not be changed
8895 no matter what and only the font might.
8896
8897 This rather complicated logic is necessary in order to accommodate the
8898 different usage scenarios. The most common one is when all default
8899 attributes are used and in this case, nothing should be inherited as
8900 in modern GUIs different controls use different fonts (and colours)
8901 than their siblings so they can't inherit the same value from the
8902 parent. However it was also deemed desirable to allow to simply change
8903 the attributes of all children at once by just changing the font or
8904 colour of their common parent, hence in this case we do inherit the
8905 parents attributes.
8906
8907 """
8908 return _core_.Window_InheritAttributes(*args, **kwargs)
8909
8910 def ShouldInheritColours(*args, **kwargs):
8911 """
8912 ShouldInheritColours(self) -> bool
8913
8914 Return true from here to allow the colours of this window to be
8915 changed by InheritAttributes, returning false forbids inheriting them
8916 from the parent window.
8917
8918 The base class version returns false, but this method is overridden in
8919 wxControl where it returns true.
8920 """
8921 return _core_.Window_ShouldInheritColours(*args, **kwargs)
8922
8923 def PostCreate(self, pre):
8924 """
8925 Phase 3 of the 2-phase create <wink!>
8926 Call this method after precreating the window with the 2-phase create method.
8927 """
8928 self.this = pre.this
8929 self.thisown = pre.thisown
8930 pre.thisown = 0
8931 if hasattr(self, '_setOORInfo'):
8932 self._setOORInfo(self)
8933 if hasattr(self, '_setCallbackInfo'):
8934 self._setCallbackInfo(self, self.__class__)
8935
8936
8937 class WindowPtr(Window):
8938 def __init__(self, this):
8939 self.this = this
8940 if not hasattr(self,"thisown"): self.thisown = 0
8941 self.__class__ = Window
8942 _core_.Window_swigregister(WindowPtr)
8943
8944 def PreWindow(*args, **kwargs):
8945 """
8946 PreWindow() -> Window
8947
8948 Precreate a Window for 2-phase creation.
8949 """
8950 val = _core_.new_PreWindow(*args, **kwargs)
8951 val.thisown = 1
8952 return val
8953
8954 def Window_NewControlId(*args, **kwargs):
8955 """
8956 Window_NewControlId() -> int
8957
8958 Generate a control id for the controls which were not given one.
8959 """
8960 return _core_.Window_NewControlId(*args, **kwargs)
8961
8962 def Window_NextControlId(*args, **kwargs):
8963 """
8964 Window_NextControlId(int winid) -> int
8965
8966 Get the id of the control following the one with the given
8967 autogenerated) id
8968 """
8969 return _core_.Window_NextControlId(*args, **kwargs)
8970
8971 def Window_PrevControlId(*args, **kwargs):
8972 """
8973 Window_PrevControlId(int winid) -> int
8974
8975 Get the id of the control preceding the one with the given
8976 autogenerated) id
8977 """
8978 return _core_.Window_PrevControlId(*args, **kwargs)
8979
8980 def Window_FindFocus(*args, **kwargs):
8981 """
8982 Window_FindFocus() -> Window
8983
8984 Returns the window or control that currently has the keyboard focus,
8985 or None.
8986 """
8987 return _core_.Window_FindFocus(*args, **kwargs)
8988
8989 def Window_GetCapture(*args, **kwargs):
8990 """
8991 Window_GetCapture() -> Window
8992
8993 Returns the window which currently captures the mouse or None
8994 """
8995 return _core_.Window_GetCapture(*args, **kwargs)
8996
8997 def Window_GetClassDefaultAttributes(*args, **kwargs):
8998 """
8999 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9000
9001 Get the default attributes for this class. This is useful if you want
9002 to use the same font or colour in your own control as in a standard
9003 control -- which is a much better idea than hard coding specific
9004 colours or fonts which might look completely out of place on the
9005 user's system, especially if it uses themes.
9006
9007 The variant parameter is only relevant under Mac currently and is
9008 ignore under other platforms. Under Mac, it will change the size of
9009 the returned font. See `wx.Window.SetWindowVariant` for more about
9010 this.
9011 """
9012 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9013
9014 def DLG_PNT(win, point_or_x, y=None):
9015 """
9016 Convenience function for converting a Point or (x,y) in
9017 dialog units to pixel units.
9018 """
9019 if y is None:
9020 return win.ConvertDialogPointToPixels(point_or_x)
9021 else:
9022 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9023
9024 def DLG_SZE(win, size_width, height=None):
9025 """
9026 Convenience function for converting a Size or (w,h) in
9027 dialog units to pixel units.
9028 """
9029 if height is None:
9030 return win.ConvertDialogSizeToPixels(size_width)
9031 else:
9032 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9033
9034
9035 def FindWindowById(*args, **kwargs):
9036 """
9037 FindWindowById(long id, Window parent=None) -> Window
9038
9039 Find the first window in the application with the given id. If parent
9040 is None, the search will start from all top-level frames and dialog
9041 boxes; if non-None, the search will be limited to the given window
9042 hierarchy. The search is recursive in both cases.
9043 """
9044 return _core_.FindWindowById(*args, **kwargs)
9045
9046 def FindWindowByName(*args, **kwargs):
9047 """
9048 FindWindowByName(String name, Window parent=None) -> Window
9049
9050 Find a window by its name (as given in a window constructor or Create
9051 function call). If parent is None, the search will start from all
9052 top-level frames and dialog boxes; if non-None, the search will be
9053 limited to the given window hierarchy. The search is recursive in both
9054 cases.
9055
9056 If no window with such name is found, wx.FindWindowByLabel is called.
9057 """
9058 return _core_.FindWindowByName(*args, **kwargs)
9059
9060 def FindWindowByLabel(*args, **kwargs):
9061 """
9062 FindWindowByLabel(String label, Window parent=None) -> Window
9063
9064 Find a window by its label. Depending on the type of window, the label
9065 may be a window title or panel item label. If parent is None, the
9066 search will start from all top-level frames and dialog boxes; if
9067 non-None, the search will be limited to the given window
9068 hierarchy. The search is recursive in both cases.
9069 """
9070 return _core_.FindWindowByLabel(*args, **kwargs)
9071
9072 def Window_FromHWND(*args, **kwargs):
9073 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9074 return _core_.Window_FromHWND(*args, **kwargs)
9075
9076 def GetTopLevelWindows(*args, **kwargs):
9077 """
9078 GetTopLevelWindows() -> PyObject
9079
9080 Returns a list of the the application's top-level windows, (frames,
9081 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9082 by wxWidgets, and so it is only valid as long as no top-level windows
9083 are closed or new top-level windows are created.
9084
9085 """
9086 return _core_.GetTopLevelWindows(*args, **kwargs)
9087 #---------------------------------------------------------------------------
9088
9089 class Validator(EvtHandler):
9090 """Proxy of C++ Validator class"""
9091 def __repr__(self):
9092 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9093 def __init__(self, *args, **kwargs):
9094 """__init__(self) -> Validator"""
9095 newobj = _core_.new_Validator(*args, **kwargs)
9096 self.this = newobj.this
9097 self.thisown = 1
9098 del newobj.thisown
9099 self._setOORInfo(self)
9100
9101 def Clone(*args, **kwargs):
9102 """Clone(self) -> Validator"""
9103 return _core_.Validator_Clone(*args, **kwargs)
9104
9105 def Validate(*args, **kwargs):
9106 """Validate(self, Window parent) -> bool"""
9107 return _core_.Validator_Validate(*args, **kwargs)
9108
9109 def TransferToWindow(*args, **kwargs):
9110 """TransferToWindow(self) -> bool"""
9111 return _core_.Validator_TransferToWindow(*args, **kwargs)
9112
9113 def TransferFromWindow(*args, **kwargs):
9114 """TransferFromWindow(self) -> bool"""
9115 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9116
9117 def GetWindow(*args, **kwargs):
9118 """GetWindow(self) -> Window"""
9119 return _core_.Validator_GetWindow(*args, **kwargs)
9120
9121 def SetWindow(*args, **kwargs):
9122 """SetWindow(self, Window window)"""
9123 return _core_.Validator_SetWindow(*args, **kwargs)
9124
9125 def IsSilent(*args, **kwargs):
9126 """IsSilent() -> bool"""
9127 return _core_.Validator_IsSilent(*args, **kwargs)
9128
9129 IsSilent = staticmethod(IsSilent)
9130 def SetBellOnError(*args, **kwargs):
9131 """SetBellOnError(int doIt=True)"""
9132 return _core_.Validator_SetBellOnError(*args, **kwargs)
9133
9134 SetBellOnError = staticmethod(SetBellOnError)
9135
9136 class ValidatorPtr(Validator):
9137 def __init__(self, this):
9138 self.this = this
9139 if not hasattr(self,"thisown"): self.thisown = 0
9140 self.__class__ = Validator
9141 _core_.Validator_swigregister(ValidatorPtr)
9142
9143 def Validator_IsSilent(*args, **kwargs):
9144 """Validator_IsSilent() -> bool"""
9145 return _core_.Validator_IsSilent(*args, **kwargs)
9146
9147 def Validator_SetBellOnError(*args, **kwargs):
9148 """Validator_SetBellOnError(int doIt=True)"""
9149 return _core_.Validator_SetBellOnError(*args, **kwargs)
9150
9151 class PyValidator(Validator):
9152 """Proxy of C++ PyValidator class"""
9153 def __repr__(self):
9154 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9155 def __init__(self, *args, **kwargs):
9156 """__init__(self) -> PyValidator"""
9157 newobj = _core_.new_PyValidator(*args, **kwargs)
9158 self.this = newobj.this
9159 self.thisown = 1
9160 del newobj.thisown
9161
9162 self._setCallbackInfo(self, PyValidator, 1)
9163 self._setOORInfo(self)
9164
9165 def _setCallbackInfo(*args, **kwargs):
9166 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9167 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9168
9169
9170 class PyValidatorPtr(PyValidator):
9171 def __init__(self, this):
9172 self.this = this
9173 if not hasattr(self,"thisown"): self.thisown = 0
9174 self.__class__ = PyValidator
9175 _core_.PyValidator_swigregister(PyValidatorPtr)
9176
9177 #---------------------------------------------------------------------------
9178
9179 class Menu(EvtHandler):
9180 """Proxy of C++ Menu class"""
9181 def __repr__(self):
9182 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9183 def __init__(self, *args, **kwargs):
9184 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9185 newobj = _core_.new_Menu(*args, **kwargs)
9186 self.this = newobj.this
9187 self.thisown = 1
9188 del newobj.thisown
9189 self._setOORInfo(self)
9190
9191 def Append(*args, **kwargs):
9192 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9193 return _core_.Menu_Append(*args, **kwargs)
9194
9195 def AppendSeparator(*args, **kwargs):
9196 """AppendSeparator(self) -> MenuItem"""
9197 return _core_.Menu_AppendSeparator(*args, **kwargs)
9198
9199 def AppendCheckItem(*args, **kwargs):
9200 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9201 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9202
9203 def AppendRadioItem(*args, **kwargs):
9204 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9205 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9206
9207 def AppendMenu(*args, **kwargs):
9208 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9209 return _core_.Menu_AppendMenu(*args, **kwargs)
9210
9211 def AppendItem(*args, **kwargs):
9212 """AppendItem(self, MenuItem item) -> MenuItem"""
9213 return _core_.Menu_AppendItem(*args, **kwargs)
9214
9215 def Break(*args, **kwargs):
9216 """Break(self)"""
9217 return _core_.Menu_Break(*args, **kwargs)
9218
9219 def InsertItem(*args, **kwargs):
9220 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9221 return _core_.Menu_InsertItem(*args, **kwargs)
9222
9223 def Insert(*args, **kwargs):
9224 """
9225 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9226 int kind=ITEM_NORMAL) -> MenuItem
9227 """
9228 return _core_.Menu_Insert(*args, **kwargs)
9229
9230 def InsertSeparator(*args, **kwargs):
9231 """InsertSeparator(self, size_t pos) -> MenuItem"""
9232 return _core_.Menu_InsertSeparator(*args, **kwargs)
9233
9234 def InsertCheckItem(*args, **kwargs):
9235 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9236 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9237
9238 def InsertRadioItem(*args, **kwargs):
9239 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9240 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9241
9242 def InsertMenu(*args, **kwargs):
9243 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9244 return _core_.Menu_InsertMenu(*args, **kwargs)
9245
9246 def PrependItem(*args, **kwargs):
9247 """PrependItem(self, MenuItem item) -> MenuItem"""
9248 return _core_.Menu_PrependItem(*args, **kwargs)
9249
9250 def Prepend(*args, **kwargs):
9251 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9252 return _core_.Menu_Prepend(*args, **kwargs)
9253
9254 def PrependSeparator(*args, **kwargs):
9255 """PrependSeparator(self) -> MenuItem"""
9256 return _core_.Menu_PrependSeparator(*args, **kwargs)
9257
9258 def PrependCheckItem(*args, **kwargs):
9259 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9260 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9261
9262 def PrependRadioItem(*args, **kwargs):
9263 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9264 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9265
9266 def PrependMenu(*args, **kwargs):
9267 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9268 return _core_.Menu_PrependMenu(*args, **kwargs)
9269
9270 def Remove(*args, **kwargs):
9271 """Remove(self, int id) -> MenuItem"""
9272 return _core_.Menu_Remove(*args, **kwargs)
9273
9274 def RemoveItem(*args, **kwargs):
9275 """RemoveItem(self, MenuItem item) -> MenuItem"""
9276 return _core_.Menu_RemoveItem(*args, **kwargs)
9277
9278 def Delete(*args, **kwargs):
9279 """Delete(self, int id) -> bool"""
9280 return _core_.Menu_Delete(*args, **kwargs)
9281
9282 def DeleteItem(*args, **kwargs):
9283 """DeleteItem(self, MenuItem item) -> bool"""
9284 return _core_.Menu_DeleteItem(*args, **kwargs)
9285
9286 def Destroy(*args, **kwargs):
9287 """
9288 Destroy(self)
9289
9290 Deletes the C++ object this Python object is a proxy for.
9291 """
9292 return _core_.Menu_Destroy(*args, **kwargs)
9293
9294 def DestroyId(*args, **kwargs):
9295 """
9296 DestroyId(self, int id) -> bool
9297
9298 Deletes the C++ object this Python object is a proxy for.
9299 """
9300 return _core_.Menu_DestroyId(*args, **kwargs)
9301
9302 def DestroyItem(*args, **kwargs):
9303 """
9304 DestroyItem(self, MenuItem item) -> bool
9305
9306 Deletes the C++ object this Python object is a proxy for.
9307 """
9308 return _core_.Menu_DestroyItem(*args, **kwargs)
9309
9310 def GetMenuItemCount(*args, **kwargs):
9311 """GetMenuItemCount(self) -> size_t"""
9312 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9313
9314 def GetMenuItems(*args, **kwargs):
9315 """GetMenuItems(self) -> PyObject"""
9316 return _core_.Menu_GetMenuItems(*args, **kwargs)
9317
9318 def FindItem(*args, **kwargs):
9319 """FindItem(self, String item) -> int"""
9320 return _core_.Menu_FindItem(*args, **kwargs)
9321
9322 def FindItemById(*args, **kwargs):
9323 """FindItemById(self, int id) -> MenuItem"""
9324 return _core_.Menu_FindItemById(*args, **kwargs)
9325
9326 def FindItemByPosition(*args, **kwargs):
9327 """FindItemByPosition(self, size_t position) -> MenuItem"""
9328 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9329
9330 def Enable(*args, **kwargs):
9331 """Enable(self, int id, bool enable)"""
9332 return _core_.Menu_Enable(*args, **kwargs)
9333
9334 def IsEnabled(*args, **kwargs):
9335 """IsEnabled(self, int id) -> bool"""
9336 return _core_.Menu_IsEnabled(*args, **kwargs)
9337
9338 def Check(*args, **kwargs):
9339 """Check(self, int id, bool check)"""
9340 return _core_.Menu_Check(*args, **kwargs)
9341
9342 def IsChecked(*args, **kwargs):
9343 """IsChecked(self, int id) -> bool"""
9344 return _core_.Menu_IsChecked(*args, **kwargs)
9345
9346 def SetLabel(*args, **kwargs):
9347 """SetLabel(self, int id, String label)"""
9348 return _core_.Menu_SetLabel(*args, **kwargs)
9349
9350 def GetLabel(*args, **kwargs):
9351 """GetLabel(self, int id) -> String"""
9352 return _core_.Menu_GetLabel(*args, **kwargs)
9353
9354 def SetHelpString(*args, **kwargs):
9355 """SetHelpString(self, int id, String helpString)"""
9356 return _core_.Menu_SetHelpString(*args, **kwargs)
9357
9358 def GetHelpString(*args, **kwargs):
9359 """GetHelpString(self, int id) -> String"""
9360 return _core_.Menu_GetHelpString(*args, **kwargs)
9361
9362 def SetTitle(*args, **kwargs):
9363 """SetTitle(self, String title)"""
9364 return _core_.Menu_SetTitle(*args, **kwargs)
9365
9366 def GetTitle(*args, **kwargs):
9367 """GetTitle(self) -> String"""
9368 return _core_.Menu_GetTitle(*args, **kwargs)
9369
9370 def SetEventHandler(*args, **kwargs):
9371 """SetEventHandler(self, EvtHandler handler)"""
9372 return _core_.Menu_SetEventHandler(*args, **kwargs)
9373
9374 def GetEventHandler(*args, **kwargs):
9375 """GetEventHandler(self) -> EvtHandler"""
9376 return _core_.Menu_GetEventHandler(*args, **kwargs)
9377
9378 def SetInvokingWindow(*args, **kwargs):
9379 """SetInvokingWindow(self, Window win)"""
9380 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
9381
9382 def GetInvokingWindow(*args, **kwargs):
9383 """GetInvokingWindow(self) -> Window"""
9384 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
9385
9386 def GetStyle(*args, **kwargs):
9387 """GetStyle(self) -> long"""
9388 return _core_.Menu_GetStyle(*args, **kwargs)
9389
9390 def UpdateUI(*args, **kwargs):
9391 """UpdateUI(self, EvtHandler source=None)"""
9392 return _core_.Menu_UpdateUI(*args, **kwargs)
9393
9394 def GetMenuBar(*args, **kwargs):
9395 """GetMenuBar(self) -> MenuBar"""
9396 return _core_.Menu_GetMenuBar(*args, **kwargs)
9397
9398 def Attach(*args, **kwargs):
9399 """Attach(self, wxMenuBarBase menubar)"""
9400 return _core_.Menu_Attach(*args, **kwargs)
9401
9402 def Detach(*args, **kwargs):
9403 """Detach(self)"""
9404 return _core_.Menu_Detach(*args, **kwargs)
9405
9406 def IsAttached(*args, **kwargs):
9407 """IsAttached(self) -> bool"""
9408 return _core_.Menu_IsAttached(*args, **kwargs)
9409
9410 def SetParent(*args, **kwargs):
9411 """SetParent(self, Menu parent)"""
9412 return _core_.Menu_SetParent(*args, **kwargs)
9413
9414 def GetParent(*args, **kwargs):
9415 """GetParent(self) -> Menu"""
9416 return _core_.Menu_GetParent(*args, **kwargs)
9417
9418
9419 class MenuPtr(Menu):
9420 def __init__(self, this):
9421 self.this = this
9422 if not hasattr(self,"thisown"): self.thisown = 0
9423 self.__class__ = Menu
9424 _core_.Menu_swigregister(MenuPtr)
9425 DefaultValidator = cvar.DefaultValidator
9426
9427 #---------------------------------------------------------------------------
9428
9429 class MenuBar(Window):
9430 """Proxy of C++ MenuBar class"""
9431 def __repr__(self):
9432 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9433 def __init__(self, *args, **kwargs):
9434 """__init__(self, long style=0) -> MenuBar"""
9435 newobj = _core_.new_MenuBar(*args, **kwargs)
9436 self.this = newobj.this
9437 self.thisown = 1
9438 del newobj.thisown
9439 self._setOORInfo(self)
9440
9441 def Append(*args, **kwargs):
9442 """Append(self, Menu menu, String title) -> bool"""
9443 return _core_.MenuBar_Append(*args, **kwargs)
9444
9445 def Insert(*args, **kwargs):
9446 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
9447 return _core_.MenuBar_Insert(*args, **kwargs)
9448
9449 def GetMenuCount(*args, **kwargs):
9450 """GetMenuCount(self) -> size_t"""
9451 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
9452
9453 def GetMenu(*args, **kwargs):
9454 """GetMenu(self, size_t pos) -> Menu"""
9455 return _core_.MenuBar_GetMenu(*args, **kwargs)
9456
9457 def Replace(*args, **kwargs):
9458 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
9459 return _core_.MenuBar_Replace(*args, **kwargs)
9460
9461 def Remove(*args, **kwargs):
9462 """Remove(self, size_t pos) -> Menu"""
9463 return _core_.MenuBar_Remove(*args, **kwargs)
9464
9465 def EnableTop(*args, **kwargs):
9466 """EnableTop(self, size_t pos, bool enable)"""
9467 return _core_.MenuBar_EnableTop(*args, **kwargs)
9468
9469 def IsEnabledTop(*args, **kwargs):
9470 """IsEnabledTop(self, size_t pos) -> bool"""
9471 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
9472
9473 def SetLabelTop(*args, **kwargs):
9474 """SetLabelTop(self, size_t pos, String label)"""
9475 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
9476
9477 def GetLabelTop(*args, **kwargs):
9478 """GetLabelTop(self, size_t pos) -> String"""
9479 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
9480
9481 def FindMenuItem(*args, **kwargs):
9482 """FindMenuItem(self, String menu, String item) -> int"""
9483 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
9484
9485 def FindItemById(*args, **kwargs):
9486 """FindItemById(self, int id) -> MenuItem"""
9487 return _core_.MenuBar_FindItemById(*args, **kwargs)
9488
9489 def FindMenu(*args, **kwargs):
9490 """FindMenu(self, String title) -> int"""
9491 return _core_.MenuBar_FindMenu(*args, **kwargs)
9492
9493 def Enable(*args, **kwargs):
9494 """Enable(self, int id, bool enable)"""
9495 return _core_.MenuBar_Enable(*args, **kwargs)
9496
9497 def Check(*args, **kwargs):
9498 """Check(self, int id, bool check)"""
9499 return _core_.MenuBar_Check(*args, **kwargs)
9500
9501 def IsChecked(*args, **kwargs):
9502 """IsChecked(self, int id) -> bool"""
9503 return _core_.MenuBar_IsChecked(*args, **kwargs)
9504
9505 def IsEnabled(*args, **kwargs):
9506 """IsEnabled(self, int id) -> bool"""
9507 return _core_.MenuBar_IsEnabled(*args, **kwargs)
9508
9509 def SetLabel(*args, **kwargs):
9510 """SetLabel(self, int id, String label)"""
9511 return _core_.MenuBar_SetLabel(*args, **kwargs)
9512
9513 def GetLabel(*args, **kwargs):
9514 """GetLabel(self, int id) -> String"""
9515 return _core_.MenuBar_GetLabel(*args, **kwargs)
9516
9517 def SetHelpString(*args, **kwargs):
9518 """SetHelpString(self, int id, String helpString)"""
9519 return _core_.MenuBar_SetHelpString(*args, **kwargs)
9520
9521 def GetHelpString(*args, **kwargs):
9522 """GetHelpString(self, int id) -> String"""
9523 return _core_.MenuBar_GetHelpString(*args, **kwargs)
9524
9525 def GetFrame(*args, **kwargs):
9526 """GetFrame(self) -> wxFrame"""
9527 return _core_.MenuBar_GetFrame(*args, **kwargs)
9528
9529 def IsAttached(*args, **kwargs):
9530 """IsAttached(self) -> bool"""
9531 return _core_.MenuBar_IsAttached(*args, **kwargs)
9532
9533 def Attach(*args, **kwargs):
9534 """Attach(self, wxFrame frame)"""
9535 return _core_.MenuBar_Attach(*args, **kwargs)
9536
9537 def Detach(*args, **kwargs):
9538 """Detach(self)"""
9539 return _core_.MenuBar_Detach(*args, **kwargs)
9540
9541
9542 class MenuBarPtr(MenuBar):
9543 def __init__(self, this):
9544 self.this = this
9545 if not hasattr(self,"thisown"): self.thisown = 0
9546 self.__class__ = MenuBar
9547 _core_.MenuBar_swigregister(MenuBarPtr)
9548
9549 #---------------------------------------------------------------------------
9550
9551 class MenuItem(Object):
9552 """Proxy of C++ MenuItem class"""
9553 def __repr__(self):
9554 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9555 def __init__(self, *args, **kwargs):
9556 """
9557 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
9558 String help=EmptyString, int kind=ITEM_NORMAL,
9559 Menu subMenu=None) -> MenuItem
9560 """
9561 newobj = _core_.new_MenuItem(*args, **kwargs)
9562 self.this = newobj.this
9563 self.thisown = 1
9564 del newobj.thisown
9565 def GetMenu(*args, **kwargs):
9566 """GetMenu(self) -> Menu"""
9567 return _core_.MenuItem_GetMenu(*args, **kwargs)
9568
9569 def SetMenu(*args, **kwargs):
9570 """SetMenu(self, Menu menu)"""
9571 return _core_.MenuItem_SetMenu(*args, **kwargs)
9572
9573 def SetId(*args, **kwargs):
9574 """SetId(self, int id)"""
9575 return _core_.MenuItem_SetId(*args, **kwargs)
9576
9577 def GetId(*args, **kwargs):
9578 """GetId(self) -> int"""
9579 return _core_.MenuItem_GetId(*args, **kwargs)
9580
9581 def IsSeparator(*args, **kwargs):
9582 """IsSeparator(self) -> bool"""
9583 return _core_.MenuItem_IsSeparator(*args, **kwargs)
9584
9585 def SetText(*args, **kwargs):
9586 """SetText(self, String str)"""
9587 return _core_.MenuItem_SetText(*args, **kwargs)
9588
9589 def GetLabel(*args, **kwargs):
9590 """GetLabel(self) -> String"""
9591 return _core_.MenuItem_GetLabel(*args, **kwargs)
9592
9593 def GetText(*args, **kwargs):
9594 """GetText(self) -> String"""
9595 return _core_.MenuItem_GetText(*args, **kwargs)
9596
9597 def GetLabelFromText(*args, **kwargs):
9598 """GetLabelFromText(String text) -> String"""
9599 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
9600
9601 GetLabelFromText = staticmethod(GetLabelFromText)
9602 def GetKind(*args, **kwargs):
9603 """GetKind(self) -> int"""
9604 return _core_.MenuItem_GetKind(*args, **kwargs)
9605
9606 def SetKind(*args, **kwargs):
9607 """SetKind(self, int kind)"""
9608 return _core_.MenuItem_SetKind(*args, **kwargs)
9609
9610 def SetCheckable(*args, **kwargs):
9611 """SetCheckable(self, bool checkable)"""
9612 return _core_.MenuItem_SetCheckable(*args, **kwargs)
9613
9614 def IsCheckable(*args, **kwargs):
9615 """IsCheckable(self) -> bool"""
9616 return _core_.MenuItem_IsCheckable(*args, **kwargs)
9617
9618 def IsSubMenu(*args, **kwargs):
9619 """IsSubMenu(self) -> bool"""
9620 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
9621
9622 def SetSubMenu(*args, **kwargs):
9623 """SetSubMenu(self, Menu menu)"""
9624 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
9625
9626 def GetSubMenu(*args, **kwargs):
9627 """GetSubMenu(self) -> Menu"""
9628 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
9629
9630 def Enable(*args, **kwargs):
9631 """Enable(self, bool enable=True)"""
9632 return _core_.MenuItem_Enable(*args, **kwargs)
9633
9634 def IsEnabled(*args, **kwargs):
9635 """IsEnabled(self) -> bool"""
9636 return _core_.MenuItem_IsEnabled(*args, **kwargs)
9637
9638 def Check(*args, **kwargs):
9639 """Check(self, bool check=True)"""
9640 return _core_.MenuItem_Check(*args, **kwargs)
9641
9642 def IsChecked(*args, **kwargs):
9643 """IsChecked(self) -> bool"""
9644 return _core_.MenuItem_IsChecked(*args, **kwargs)
9645
9646 def Toggle(*args, **kwargs):
9647 """Toggle(self)"""
9648 return _core_.MenuItem_Toggle(*args, **kwargs)
9649
9650 def SetHelp(*args, **kwargs):
9651 """SetHelp(self, String str)"""
9652 return _core_.MenuItem_SetHelp(*args, **kwargs)
9653
9654 def GetHelp(*args, **kwargs):
9655 """GetHelp(self) -> String"""
9656 return _core_.MenuItem_GetHelp(*args, **kwargs)
9657
9658 def GetAccel(*args, **kwargs):
9659 """GetAccel(self) -> AcceleratorEntry"""
9660 return _core_.MenuItem_GetAccel(*args, **kwargs)
9661
9662 def SetAccel(*args, **kwargs):
9663 """SetAccel(self, AcceleratorEntry accel)"""
9664 return _core_.MenuItem_SetAccel(*args, **kwargs)
9665
9666 def SetFont(*args, **kwargs):
9667 """SetFont(self, Font font)"""
9668 return _core_.MenuItem_SetFont(*args, **kwargs)
9669
9670 def GetFont(*args, **kwargs):
9671 """GetFont(self) -> Font"""
9672 return _core_.MenuItem_GetFont(*args, **kwargs)
9673
9674 def SetTextColour(*args, **kwargs):
9675 """SetTextColour(self, Colour colText)"""
9676 return _core_.MenuItem_SetTextColour(*args, **kwargs)
9677
9678 def GetTextColour(*args, **kwargs):
9679 """GetTextColour(self) -> Colour"""
9680 return _core_.MenuItem_GetTextColour(*args, **kwargs)
9681
9682 def SetBackgroundColour(*args, **kwargs):
9683 """SetBackgroundColour(self, Colour colBack)"""
9684 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
9685
9686 def GetBackgroundColour(*args, **kwargs):
9687 """GetBackgroundColour(self) -> Colour"""
9688 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
9689
9690 def SetBitmaps(*args, **kwargs):
9691 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
9692 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
9693
9694 def SetDisabledBitmap(*args, **kwargs):
9695 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
9696 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
9697
9698 def GetDisabledBitmap(*args, **kwargs):
9699 """GetDisabledBitmap(self) -> Bitmap"""
9700 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
9701
9702 def SetMarginWidth(*args, **kwargs):
9703 """SetMarginWidth(self, int nWidth)"""
9704 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
9705
9706 def GetMarginWidth(*args, **kwargs):
9707 """GetMarginWidth(self) -> int"""
9708 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
9709
9710 def GetDefaultMarginWidth(*args, **kwargs):
9711 """GetDefaultMarginWidth() -> int"""
9712 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
9713
9714 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
9715 def IsOwnerDrawn(*args, **kwargs):
9716 """IsOwnerDrawn(self) -> bool"""
9717 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
9718
9719 def SetOwnerDrawn(*args, **kwargs):
9720 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
9721 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
9722
9723 def ResetOwnerDrawn(*args, **kwargs):
9724 """ResetOwnerDrawn(self)"""
9725 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
9726
9727 def SetBitmap(*args, **kwargs):
9728 """SetBitmap(self, Bitmap bitmap)"""
9729 return _core_.MenuItem_SetBitmap(*args, **kwargs)
9730
9731 def GetBitmap(*args, **kwargs):
9732 """GetBitmap(self) -> Bitmap"""
9733 return _core_.MenuItem_GetBitmap(*args, **kwargs)
9734
9735
9736 class MenuItemPtr(MenuItem):
9737 def __init__(self, this):
9738 self.this = this
9739 if not hasattr(self,"thisown"): self.thisown = 0
9740 self.__class__ = MenuItem
9741 _core_.MenuItem_swigregister(MenuItemPtr)
9742
9743 def MenuItem_GetLabelFromText(*args, **kwargs):
9744 """MenuItem_GetLabelFromText(String text) -> String"""
9745 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
9746
9747 def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
9748 """MenuItem_GetDefaultMarginWidth() -> int"""
9749 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
9750
9751 #---------------------------------------------------------------------------
9752
9753 class Control(Window):
9754 """
9755 This is the base class for a control or 'widget'.
9756
9757 A control is generally a small window which processes user input
9758 and/or displays one or more item of data.
9759 """
9760 def __repr__(self):
9761 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9762 def __init__(self, *args, **kwargs):
9763 """
9764 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
9765 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
9766 String name=ControlNameStr) -> Control
9767
9768 Create a Control. Normally you should only call this from a subclass'
9769 __init__ as a plain old wx.Control is not very useful.
9770 """
9771 newobj = _core_.new_Control(*args, **kwargs)
9772 self.this = newobj.this
9773 self.thisown = 1
9774 del newobj.thisown
9775 self._setOORInfo(self)
9776
9777 def Create(*args, **kwargs):
9778 """
9779 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
9780 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
9781 String name=ControlNameStr) -> bool
9782
9783 Do the 2nd phase and create the GUI control.
9784 """
9785 return _core_.Control_Create(*args, **kwargs)
9786
9787 def Command(*args, **kwargs):
9788 """
9789 Command(self, CommandEvent event)
9790
9791 Simulates the effect of the user issuing a command to the item.
9792
9793 :see: `wx.CommandEvent`
9794
9795 """
9796 return _core_.Control_Command(*args, **kwargs)
9797
9798 def GetLabel(*args, **kwargs):
9799 """
9800 GetLabel(self) -> String
9801
9802 Return a control's text.
9803 """
9804 return _core_.Control_GetLabel(*args, **kwargs)
9805
9806 def SetLabel(*args, **kwargs):
9807 """
9808 SetLabel(self, String label)
9809
9810 Sets the item's text.
9811 """
9812 return _core_.Control_SetLabel(*args, **kwargs)
9813
9814 def GetClassDefaultAttributes(*args, **kwargs):
9815 """
9816 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9817
9818 Get the default attributes for this class. This is useful if you want
9819 to use the same font or colour in your own control as in a standard
9820 control -- which is a much better idea than hard coding specific
9821 colours or fonts which might look completely out of place on the
9822 user's system, especially if it uses themes.
9823
9824 The variant parameter is only relevant under Mac currently and is
9825 ignore under other platforms. Under Mac, it will change the size of
9826 the returned font. See `wx.Window.SetWindowVariant` for more about
9827 this.
9828 """
9829 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
9830
9831 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9832
9833 class ControlPtr(Control):
9834 def __init__(self, this):
9835 self.this = this
9836 if not hasattr(self,"thisown"): self.thisown = 0
9837 self.__class__ = Control
9838 _core_.Control_swigregister(ControlPtr)
9839 ControlNameStr = cvar.ControlNameStr
9840
9841 def PreControl(*args, **kwargs):
9842 """
9843 PreControl() -> Control
9844
9845 Precreate a Control control for 2-phase creation
9846 """
9847 val = _core_.new_PreControl(*args, **kwargs)
9848 val.thisown = 1
9849 return val
9850
9851 def Control_GetClassDefaultAttributes(*args, **kwargs):
9852 """
9853 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9854
9855 Get the default attributes for this class. This is useful if you want
9856 to use the same font or colour in your own control as in a standard
9857 control -- which is a much better idea than hard coding specific
9858 colours or fonts which might look completely out of place on the
9859 user's system, especially if it uses themes.
9860
9861 The variant parameter is only relevant under Mac currently and is
9862 ignore under other platforms. Under Mac, it will change the size of
9863 the returned font. See `wx.Window.SetWindowVariant` for more about
9864 this.
9865 """
9866 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
9867
9868 #---------------------------------------------------------------------------
9869
9870 class ItemContainer(object):
9871 """
9872 The wx.ItemContainer class defines an interface which is implemented
9873 by all controls which have string subitems, each of which may be
9874 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
9875 as `wx.ComboBox` which implements an extended interface deriving from
9876 this one.
9877
9878 It defines the methods for accessing the control's items and although
9879 each of the derived classes implements them differently, they still
9880 all conform to the same interface.
9881
9882 The items in a wx.ItemContainer have (non empty) string labels and,
9883 optionally, client data associated with them.
9884
9885 """
9886 def __init__(self): raise RuntimeError, "No constructor defined"
9887 def __repr__(self):
9888 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9889 def Append(*args, **kwargs):
9890 """
9891 Append(self, String item, PyObject clientData=None) -> int
9892
9893 Adds the item to the control, associating the given data with the item
9894 if not None. The return value is the index of the newly added item
9895 which may be different from the last one if the control is sorted (e.g.
9896 has wx.LB_SORT or wx.CB_SORT style).
9897 """
9898 return _core_.ItemContainer_Append(*args, **kwargs)
9899
9900 def AppendItems(*args, **kwargs):
9901 """
9902 AppendItems(self, List strings)
9903
9904 Apend several items at once to the control. Notice that calling this
9905 method may be much faster than appending the items one by one if you
9906 need to add a lot of items.
9907 """
9908 return _core_.ItemContainer_AppendItems(*args, **kwargs)
9909
9910 def Insert(*args, **kwargs):
9911 """
9912 Insert(self, String item, int pos, PyObject clientData=None) -> int
9913
9914 Insert an item into the control before the item at the ``pos`` index,
9915 optionally associating some data object with the item.
9916 """
9917 return _core_.ItemContainer_Insert(*args, **kwargs)
9918
9919 def Clear(*args, **kwargs):
9920 """
9921 Clear(self)
9922
9923 Removes all items from the control.
9924 """
9925 return _core_.ItemContainer_Clear(*args, **kwargs)
9926
9927 def Delete(*args, **kwargs):
9928 """
9929 Delete(self, int n)
9930
9931 Deletes the item at the zero-based index 'n' from the control. Note
9932 that it is an error (signalled by a `wx.PyAssertionError` exception if
9933 enabled) to remove an item with the index negative or greater or equal
9934 than the number of items in the control.
9935 """
9936 return _core_.ItemContainer_Delete(*args, **kwargs)
9937
9938 def GetClientData(*args, **kwargs):
9939 """
9940 GetClientData(self, int n) -> PyObject
9941
9942 Returns the client data associated with the given item, (if any.)
9943 """
9944 return _core_.ItemContainer_GetClientData(*args, **kwargs)
9945
9946 def SetClientData(*args, **kwargs):
9947 """
9948 SetClientData(self, int n, PyObject clientData)
9949
9950 Associate the given client data with the item at position n.
9951 """
9952 return _core_.ItemContainer_SetClientData(*args, **kwargs)
9953
9954 def GetCount(*args, **kwargs):
9955 """
9956 GetCount(self) -> int
9957
9958 Returns the number of items in the control.
9959 """
9960 return _core_.ItemContainer_GetCount(*args, **kwargs)
9961
9962 def IsEmpty(*args, **kwargs):
9963 """
9964 IsEmpty(self) -> bool
9965
9966 Returns True if the control is empty or False if it has some items.
9967 """
9968 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
9969
9970 def GetString(*args, **kwargs):
9971 """
9972 GetString(self, int n) -> String
9973
9974 Returns the label of the item with the given index.
9975 """
9976 return _core_.ItemContainer_GetString(*args, **kwargs)
9977
9978 def GetStrings(*args, **kwargs):
9979 """GetStrings(self) -> wxArrayString"""
9980 return _core_.ItemContainer_GetStrings(*args, **kwargs)
9981
9982 def SetString(*args, **kwargs):
9983 """
9984 SetString(self, int n, String s)
9985
9986 Sets the label for the given item.
9987 """
9988 return _core_.ItemContainer_SetString(*args, **kwargs)
9989
9990 def FindString(*args, **kwargs):
9991 """
9992 FindString(self, String s) -> int
9993
9994 Finds an item whose label matches the given string. Returns the
9995 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
9996 found.
9997 """
9998 return _core_.ItemContainer_FindString(*args, **kwargs)
9999
10000 def SetSelection(*args, **kwargs):
10001 """
10002 SetSelection(self, int n)
10003
10004 Sets the item at index 'n' to be the selected item.
10005 """
10006 return _core_.ItemContainer_SetSelection(*args, **kwargs)
10007
10008 def GetSelection(*args, **kwargs):
10009 """
10010 GetSelection(self) -> int
10011
10012 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10013 is selected.
10014 """
10015 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10016
10017 def SetStringSelection(*args, **kwargs):
10018 """SetStringSelection(self, String s) -> bool"""
10019 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10020
10021 def GetStringSelection(*args, **kwargs):
10022 """
10023 GetStringSelection(self) -> String
10024
10025 Returns the label of the selected item or an empty string if no item
10026 is selected.
10027 """
10028 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10029
10030 def Select(*args, **kwargs):
10031 """
10032 Select(self, int n)
10033
10034 This is the same as `SetSelection` and exists only because it is
10035 slightly more natural for controls which support multiple selection.
10036 """
10037 return _core_.ItemContainer_Select(*args, **kwargs)
10038
10039
10040 class ItemContainerPtr(ItemContainer):
10041 def __init__(self, this):
10042 self.this = this
10043 if not hasattr(self,"thisown"): self.thisown = 0
10044 self.__class__ = ItemContainer
10045 _core_.ItemContainer_swigregister(ItemContainerPtr)
10046
10047 #---------------------------------------------------------------------------
10048
10049 class ControlWithItems(Control,ItemContainer):
10050 """
10051 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10052 wx.Control class, and is used for the base class of various controls
10053 that have items.
10054 """
10055 def __init__(self): raise RuntimeError, "No constructor defined"
10056 def __repr__(self):
10057 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10058
10059 class ControlWithItemsPtr(ControlWithItems):
10060 def __init__(self, this):
10061 self.this = this
10062 if not hasattr(self,"thisown"): self.thisown = 0
10063 self.__class__ = ControlWithItems
10064 _core_.ControlWithItems_swigregister(ControlWithItemsPtr)
10065
10066 #---------------------------------------------------------------------------
10067
10068 class SizerItem(Object):
10069 """
10070 The wx.SizerItem class is used to track the position, size and other
10071 attributes of each item managed by a `wx.Sizer`. In normal usage user
10072 code should never need to deal directly with a wx.SizerItem, but
10073 custom classes derived from `wx.PySizer` will probably need to use the
10074 collection of wx.SizerItems held by wx.Sizer when calculating layout.
10075
10076 :see: `wx.Sizer`, `wx.GBSizerItem`
10077 """
10078 def __repr__(self):
10079 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10080 def __init__(self, *args, **kwargs):
10081 """
10082 __init__(self) -> SizerItem
10083
10084 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10085 size will need to be set before this item can be used in a Sizer.
10086
10087 You will probably never need to create a wx.SizerItem directly as they
10088 are created automatically when the sizer's Add, Insert or Prepend
10089 methods are called.
10090
10091 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10092 """
10093 newobj = _core_.new_SizerItem(*args, **kwargs)
10094 self.this = newobj.this
10095 self.thisown = 1
10096 del newobj.thisown
10097 def DeleteWindows(*args, **kwargs):
10098 """
10099 DeleteWindows(self)
10100
10101 Destroy the window or the windows in a subsizer, depending on the type
10102 of item.
10103 """
10104 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10105
10106 def DetachSizer(*args, **kwargs):
10107 """
10108 DetachSizer(self)
10109
10110 Enable deleting the SizerItem without destroying the contained sizer.
10111 """
10112 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10113
10114 def GetSize(*args, **kwargs):
10115 """
10116 GetSize(self) -> Size
10117
10118 Get the current size of the item, as set in the last Layout.
10119 """
10120 return _core_.SizerItem_GetSize(*args, **kwargs)
10121
10122 def CalcMin(*args, **kwargs):
10123 """
10124 CalcMin(self) -> Size
10125
10126 Calculates the minimum desired size for the item, including any space
10127 needed by borders.
10128 """
10129 return _core_.SizerItem_CalcMin(*args, **kwargs)
10130
10131 def SetDimension(*args, **kwargs):
10132 """
10133 SetDimension(self, Point pos, Size size)
10134
10135 Set the position and size of the space allocated for this item by the
10136 sizer, and adjust the position and size of the item (window or
10137 subsizer) to be within that space taking alignment and borders into
10138 account.
10139 """
10140 return _core_.SizerItem_SetDimension(*args, **kwargs)
10141
10142 def GetMinSize(*args, **kwargs):
10143 """
10144 GetMinSize(self) -> Size
10145
10146 Get the minimum size needed for the item.
10147 """
10148 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10149
10150 def GetMinSizeWithBorder(*args, **kwargs):
10151 """
10152 GetMinSizeWithBorder(self) -> Size
10153
10154 Get the minimum size needed for the item with space for the borders
10155 added, if needed.
10156 """
10157 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10158
10159 def SetInitSize(*args, **kwargs):
10160 """SetInitSize(self, int x, int y)"""
10161 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10162
10163 def SetRatioWH(*args, **kwargs):
10164 """
10165 SetRatioWH(self, int width, int height)
10166
10167 Set the ratio item attribute.
10168 """
10169 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10170
10171 def SetRatioSize(*args, **kwargs):
10172 """
10173 SetRatioSize(self, Size size)
10174
10175 Set the ratio item attribute.
10176 """
10177 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10178
10179 def SetRatio(*args, **kwargs):
10180 """
10181 SetRatio(self, float ratio)
10182
10183 Set the ratio item attribute.
10184 """
10185 return _core_.SizerItem_SetRatio(*args, **kwargs)
10186
10187 def GetRatio(*args, **kwargs):
10188 """
10189 GetRatio(self) -> float
10190
10191 Set the ratio item attribute.
10192 """
10193 return _core_.SizerItem_GetRatio(*args, **kwargs)
10194
10195 def GetRect(*args, **kwargs):
10196 """
10197 GetRect(self) -> Rect
10198
10199 Returns the rectangle that the sizer item should occupy
10200 """
10201 return _core_.SizerItem_GetRect(*args, **kwargs)
10202
10203 def IsWindow(*args, **kwargs):
10204 """
10205 IsWindow(self) -> bool
10206
10207 Is this sizer item a window?
10208 """
10209 return _core_.SizerItem_IsWindow(*args, **kwargs)
10210
10211 def IsSizer(*args, **kwargs):
10212 """
10213 IsSizer(self) -> bool
10214
10215 Is this sizer item a subsizer?
10216 """
10217 return _core_.SizerItem_IsSizer(*args, **kwargs)
10218
10219 def IsSpacer(*args, **kwargs):
10220 """
10221 IsSpacer(self) -> bool
10222
10223 Is this sizer item a spacer?
10224 """
10225 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10226
10227 def SetProportion(*args, **kwargs):
10228 """
10229 SetProportion(self, int proportion)
10230
10231 Set the proportion value for this item.
10232 """
10233 return _core_.SizerItem_SetProportion(*args, **kwargs)
10234
10235 def GetProportion(*args, **kwargs):
10236 """
10237 GetProportion(self) -> int
10238
10239 Get the proportion value for this item.
10240 """
10241 return _core_.SizerItem_GetProportion(*args, **kwargs)
10242
10243 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10244 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
10245 def SetFlag(*args, **kwargs):
10246 """
10247 SetFlag(self, int flag)
10248
10249 Set the flag value for this item.
10250 """
10251 return _core_.SizerItem_SetFlag(*args, **kwargs)
10252
10253 def GetFlag(*args, **kwargs):
10254 """
10255 GetFlag(self) -> int
10256
10257 Get the flag value for this item.
10258 """
10259 return _core_.SizerItem_GetFlag(*args, **kwargs)
10260
10261 def SetBorder(*args, **kwargs):
10262 """
10263 SetBorder(self, int border)
10264
10265 Set the border value for this item.
10266 """
10267 return _core_.SizerItem_SetBorder(*args, **kwargs)
10268
10269 def GetBorder(*args, **kwargs):
10270 """
10271 GetBorder(self) -> int
10272
10273 Get the border value for this item.
10274 """
10275 return _core_.SizerItem_GetBorder(*args, **kwargs)
10276
10277 def GetWindow(*args, **kwargs):
10278 """
10279 GetWindow(self) -> Window
10280
10281 Get the window (if any) that is managed by this sizer item.
10282 """
10283 return _core_.SizerItem_GetWindow(*args, **kwargs)
10284
10285 def SetWindow(*args, **kwargs):
10286 """
10287 SetWindow(self, Window window)
10288
10289 Set the window to be managed by this sizer item.
10290 """
10291 return _core_.SizerItem_SetWindow(*args, **kwargs)
10292
10293 def GetSizer(*args, **kwargs):
10294 """
10295 GetSizer(self) -> Sizer
10296
10297 Get the subsizer (if any) that is managed by this sizer item.
10298 """
10299 return _core_.SizerItem_GetSizer(*args, **kwargs)
10300
10301 def SetSizer(*args, **kwargs):
10302 """
10303 SetSizer(self, Sizer sizer)
10304
10305 Set the subsizer to be managed by this sizer item.
10306 """
10307 return _core_.SizerItem_SetSizer(*args, **kwargs)
10308
10309 def GetSpacer(*args, **kwargs):
10310 """
10311 GetSpacer(self) -> Size
10312
10313 Get the size of the spacer managed by this sizer item.
10314 """
10315 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10316
10317 def SetSpacer(*args, **kwargs):
10318 """
10319 SetSpacer(self, Size size)
10320
10321 Set the size of the spacer to be managed by this sizer item.
10322 """
10323 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10324
10325 def Show(*args, **kwargs):
10326 """
10327 Show(self, bool show)
10328
10329 Set the show item attribute, which sizers use to determine if the item
10330 is to be made part of the layout or not. If the item is tracking a
10331 window then it is shown or hidden as needed.
10332 """
10333 return _core_.SizerItem_Show(*args, **kwargs)
10334
10335 def IsShown(*args, **kwargs):
10336 """
10337 IsShown(self) -> bool
10338
10339 Is the item to be shown in the layout?
10340 """
10341 return _core_.SizerItem_IsShown(*args, **kwargs)
10342
10343 def GetPosition(*args, **kwargs):
10344 """
10345 GetPosition(self) -> Point
10346
10347 Returns the current position of the item, as set in the last Layout.
10348 """
10349 return _core_.SizerItem_GetPosition(*args, **kwargs)
10350
10351 def GetUserData(*args, **kwargs):
10352 """
10353 GetUserData(self) -> PyObject
10354
10355 Returns the userData associated with this sizer item, or None if there
10356 isn't any.
10357 """
10358 return _core_.SizerItem_GetUserData(*args, **kwargs)
10359
10360
10361 class SizerItemPtr(SizerItem):
10362 def __init__(self, this):
10363 self.this = this
10364 if not hasattr(self,"thisown"): self.thisown = 0
10365 self.__class__ = SizerItem
10366 _core_.SizerItem_swigregister(SizerItemPtr)
10367
10368 def SizerItemWindow(*args, **kwargs):
10369 """
10370 SizerItemWindow(Window window, int proportion, int flag, int border,
10371 PyObject userData=None) -> SizerItem
10372
10373 Constructs a `wx.SizerItem` for tracking a window.
10374 """
10375 val = _core_.new_SizerItemWindow(*args, **kwargs)
10376 val.thisown = 1
10377 return val
10378
10379 def SizerItemSpacer(*args, **kwargs):
10380 """
10381 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10382 PyObject userData=None) -> SizerItem
10383
10384 Constructs a `wx.SizerItem` for tracking a spacer.
10385 """
10386 val = _core_.new_SizerItemSpacer(*args, **kwargs)
10387 val.thisown = 1
10388 return val
10389
10390 def SizerItemSizer(*args, **kwargs):
10391 """
10392 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10393 PyObject userData=None) -> SizerItem
10394
10395 Constructs a `wx.SizerItem` for tracking a subsizer
10396 """
10397 val = _core_.new_SizerItemSizer(*args, **kwargs)
10398 val.thisown = 1
10399 return val
10400
10401 class Sizer(Object):
10402 """
10403 wx.Sizer is the abstract base class used for laying out subwindows in
10404 a window. You cannot use wx.Sizer directly; instead, you will have to
10405 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10406 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10407 and `wx.GridBagSizer`.
10408
10409 The concept implemented by sizers in wxWidgets is closely related to
10410 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10411 toolkit or the Qt toolkit. It is based upon the idea of the individual
10412 subwindows reporting their minimal required size and their ability to
10413 get stretched if the size of the parent window has changed. This will
10414 most often mean that the programmer does not set the original size of
10415 a dialog in the beginning, rather the dialog will assigned a sizer and
10416 this sizer will be queried about the recommended size. The sizer in
10417 turn will query its children, which can be normal windows or contorls,
10418 empty space or other sizers, so that a hierarchy of sizers can be
10419 constructed. Note that wxSizer does not derive from wxWindow and thus
10420 do not interfere with tab ordering and requires very little resources
10421 compared to a real window on screen.
10422
10423 What makes sizers so well fitted for use in wxWidgets is the fact that
10424 every control reports its own minimal size and the algorithm can
10425 handle differences in font sizes or different window (dialog item)
10426 sizes on different platforms without problems. If for example the
10427 standard font as well as the overall design of Mac widgets requires
10428 more space than on Windows, then the initial size of a dialog using a
10429 sizer will automatically be bigger on Mac than on Windows.
10430 """
10431 def __init__(self): raise RuntimeError, "No constructor defined"
10432 def __repr__(self):
10433 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10434 def _setOORInfo(*args, **kwargs):
10435 """_setOORInfo(self, PyObject _self)"""
10436 return _core_.Sizer__setOORInfo(*args, **kwargs)
10437
10438 def Add(*args, **kwargs):
10439 """
10440 Add(self, item, int proportion=0, int flag=0, int border=0,
10441 PyObject userData=None) -> wx.SizerItem
10442
10443 Appends a child item to the sizer.
10444 """
10445 return _core_.Sizer_Add(*args, **kwargs)
10446
10447 def Insert(*args, **kwargs):
10448 """
10449 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
10450 PyObject userData=None) -> wx.SizerItem
10451
10452 Inserts a new item into the list of items managed by this sizer before
10453 the item at index *before*. See `Add` for a description of the parameters.
10454 """
10455 return _core_.Sizer_Insert(*args, **kwargs)
10456
10457 def Prepend(*args, **kwargs):
10458 """
10459 Prepend(self, item, int proportion=0, int flag=0, int border=0,
10460 PyObject userData=None) -> wx.SizerItem
10461
10462 Adds a new item to the begining of the list of sizer items managed by
10463 this sizer. See `Add` for a description of the parameters.
10464 """
10465 return _core_.Sizer_Prepend(*args, **kwargs)
10466
10467 def Remove(*args, **kwargs):
10468 """
10469 Remove(self, item) -> bool
10470
10471 Removes an item from the sizer and destroys it. This method does not
10472 cause any layout or resizing to take place, call `Layout` to update
10473 the layout on screen after removing a child from the sizer. The
10474 *item* parameter can be either a window, a sizer, or the zero-based
10475 index of an item to remove. Returns True if the child item was found
10476 and removed.
10477 """
10478 return _core_.Sizer_Remove(*args, **kwargs)
10479
10480 def Detach(*args, **kwargs):
10481 """
10482 Detach(self, item) -> bool
10483
10484 Detaches an item from the sizer without destroying it. This method
10485 does not cause any layout or resizing to take place, call `Layout` to
10486 do so. The *item* parameter can be either a window, a sizer, or the
10487 zero-based index of the item to be detached. Returns True if the child item
10488 was found and detached.
10489 """
10490 return _core_.Sizer_Detach(*args, **kwargs)
10491
10492 def GetItem(*args, **kwargs):
10493 """
10494 GetItem(self, item) -> wx.SizerItem
10495
10496 Returns the `wx.SizerItem` which holds the *item* given. The *item*
10497 parameter can be either a window, a sizer, or the zero-based index of
10498 the item to be detached.
10499 """
10500 return _core_.Sizer_GetItem(*args, **kwargs)
10501
10502 def _SetItemMinSize(*args, **kwargs):
10503 """_SetItemMinSize(self, PyObject item, Size size)"""
10504 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
10505
10506 def SetItemMinSize(self, item, *args):
10507 """
10508 SetItemMinSize(self, item, Size size)
10509
10510 Sets the minimum size that will be allocated for an item in the sizer.
10511 The *item* parameter can be either a window, a sizer, or the
10512 zero-based index of the item. If a window or sizer is given then it
10513 will be searched for recursivly in subsizers if neccessary.
10514 """
10515 if len(args) == 2:
10516 # for backward compatibility accept separate width,height args too
10517 return self._SetItemMinSize(item, args)
10518 else:
10519 return self._SetItemMinSize(item, args[0])
10520
10521 def AddItem(*args, **kwargs):
10522 """
10523 AddItem(self, SizerItem item)
10524
10525 Adds a `wx.SizerItem` to the sizer.
10526 """
10527 return _core_.Sizer_AddItem(*args, **kwargs)
10528
10529 def InsertItem(*args, **kwargs):
10530 """
10531 InsertItem(self, int index, SizerItem item)
10532
10533 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
10534 """
10535 return _core_.Sizer_InsertItem(*args, **kwargs)
10536
10537 def PrependItem(*args, **kwargs):
10538 """
10539 PrependItem(self, SizerItem item)
10540
10541 Prepends a `wx.SizerItem` to the sizer.
10542 """
10543 return _core_.Sizer_PrependItem(*args, **kwargs)
10544
10545 def AddMany(self, items):
10546 """
10547 AddMany is a convenience method for adding several items
10548 to a sizer at one time. Simply pass it a list of tuples,
10549 where each tuple consists of the parameters that you
10550 would normally pass to the `Add` method.
10551 """
10552 for item in items:
10553 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
10554 item = (item, )
10555 self.Add(*item)
10556
10557 # for backwards compatibility only, please do not use in new code
10558 def AddWindow(self, *args, **kw):
10559 """Compatibility alias for `Add`."""
10560 return self.Add(*args, **kw)
10561 def AddSizer(self, *args, **kw):
10562 """Compatibility alias for `Add`."""
10563 return self.Add(*args, **kw)
10564 def AddSpacer(self, *args, **kw):
10565 """Compatibility alias for `Add`."""
10566 return self.Add(*args, **kw)
10567
10568 def PrependWindow(self, *args, **kw):
10569 """Compatibility alias for `Prepend`."""
10570 return self.Prepend(*args, **kw)
10571 def PrependSizer(self, *args, **kw):
10572 """Compatibility alias for `Prepend`."""
10573 return self.Prepend(*args, **kw)
10574 def PrependSpacer(self, *args, **kw):
10575 """Compatibility alias for `Prepend`."""
10576 return self.Prepend(*args, **kw)
10577
10578 def InsertWindow(self, *args, **kw):
10579 """Compatibility alias for `Insert`."""
10580 return self.Insert(*args, **kw)
10581 def InsertSizer(self, *args, **kw):
10582 """Compatibility alias for `Insert`."""
10583 return self.Insert(*args, **kw)
10584 def InsertSpacer(self, *args, **kw):
10585 """Compatibility alias for `Insert`."""
10586 return self.Insert(*args, **kw)
10587
10588 def RemoveWindow(self, *args, **kw):
10589 """Compatibility alias for `Remove`."""
10590 return self.Remove(*args, **kw)
10591 def RemoveSizer(self, *args, **kw):
10592 """Compatibility alias for `Remove`."""
10593 return self.Remove(*args, **kw)
10594 def RemovePos(self, *args, **kw):
10595 """Compatibility alias for `Remove`."""
10596 return self.Remove(*args, **kw)
10597
10598
10599 def SetDimension(*args, **kwargs):
10600 """
10601 SetDimension(self, int x, int y, int width, int height)
10602
10603 Call this to force the sizer to take the given dimension and thus
10604 force the items owned by the sizer to resize themselves according to
10605 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
10606 methods.
10607 """
10608 return _core_.Sizer_SetDimension(*args, **kwargs)
10609
10610 def SetMinSize(*args, **kwargs):
10611 """
10612 SetMinSize(self, Size size)
10613
10614 Call this to give the sizer a minimal size. Normally, the sizer will
10615 calculate its minimal size based purely on how much space its children
10616 need. After calling this method `GetMinSize` will return either the
10617 minimal size as requested by its children or the minimal size set
10618 here, depending on which is bigger.
10619 """
10620 return _core_.Sizer_SetMinSize(*args, **kwargs)
10621
10622 def GetSize(*args, **kwargs):
10623 """
10624 GetSize(self) -> Size
10625
10626 Returns the current size of the space managed by the sizer.
10627 """
10628 return _core_.Sizer_GetSize(*args, **kwargs)
10629
10630 def GetPosition(*args, **kwargs):
10631 """
10632 GetPosition(self) -> Point
10633
10634 Returns the current position of the sizer's managed space.
10635 """
10636 return _core_.Sizer_GetPosition(*args, **kwargs)
10637
10638 def GetMinSize(*args, **kwargs):
10639 """
10640 GetMinSize(self) -> Size
10641
10642 Returns the minimal size of the sizer. This is either the combined
10643 minimal size of all the children and their borders or the minimal size
10644 set by SetMinSize, depending on which is bigger.
10645 """
10646 return _core_.Sizer_GetMinSize(*args, **kwargs)
10647
10648 def GetSizeTuple(self):
10649 return self.GetSize().Get()
10650 def GetPositionTuple(self):
10651 return self.GetPosition().Get()
10652 def GetMinSizeTuple(self):
10653 return self.GetMinSize().Get()
10654
10655 def RecalcSizes(*args, **kwargs):
10656 """
10657 RecalcSizes(self)
10658
10659 Using the sizes calculated by `CalcMin` reposition and resize all the
10660 items managed by this sizer. You should not need to call this directly as
10661 it is called by `Layout`.
10662 """
10663 return _core_.Sizer_RecalcSizes(*args, **kwargs)
10664
10665 def CalcMin(*args, **kwargs):
10666 """
10667 CalcMin(self) -> Size
10668
10669 This method is where the sizer will do the actual calculation of its
10670 children's minimal sizes. You should not need to call this directly as
10671 it is called by `Layout`.
10672 """
10673 return _core_.Sizer_CalcMin(*args, **kwargs)
10674
10675 def Layout(*args, **kwargs):
10676 """
10677 Layout(self)
10678
10679 This method will force the recalculation and layout of the items
10680 controlled by the sizer using the current space allocated to the
10681 sizer. Normally this is called automatically from the owning window's
10682 EVT_SIZE handler, but it is also useful to call it from user code when
10683 one of the items in a sizer change size, or items are added or
10684 removed.
10685 """
10686 return _core_.Sizer_Layout(*args, **kwargs)
10687
10688 def Fit(*args, **kwargs):
10689 """
10690 Fit(self, Window window) -> Size
10691
10692 Tell the sizer to resize the *window* to match the sizer's minimal
10693 size. This is commonly done in the constructor of the window itself in
10694 order to set its initial size to match the needs of the children as
10695 determined by the sizer. Returns the new size.
10696
10697 For a top level window this is the total window size, not the client size.
10698 """
10699 return _core_.Sizer_Fit(*args, **kwargs)
10700
10701 def FitInside(*args, **kwargs):
10702 """
10703 FitInside(self, Window window)
10704
10705 Tell the sizer to resize the *virtual size* of the *window* to match the
10706 sizer's minimal size. This will not alter the on screen size of the
10707 window, but may cause the addition/removal/alteration of scrollbars
10708 required to view the virtual area in windows which manage it.
10709
10710 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
10711
10712 """
10713 return _core_.Sizer_FitInside(*args, **kwargs)
10714
10715 def SetSizeHints(*args, **kwargs):
10716 """
10717 SetSizeHints(self, Window window)
10718
10719 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
10720 match the sizer's minimal size. This is commonly done in the
10721 constructor of the window itself if the window is resizable (as are
10722 many dialogs under Unix and frames on probably all platforms) in order
10723 to prevent the window from being sized smaller than the minimal size
10724 required by the sizer.
10725 """
10726 return _core_.Sizer_SetSizeHints(*args, **kwargs)
10727
10728 def SetVirtualSizeHints(*args, **kwargs):
10729 """
10730 SetVirtualSizeHints(self, Window window)
10731
10732 Tell the sizer to set the minimal size of the window virtual area to
10733 match the sizer's minimal size. For windows with managed scrollbars
10734 this will set them appropriately.
10735
10736 :see: `wx.ScrolledWindow.SetScrollbars`
10737
10738 """
10739 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
10740
10741 def Clear(*args, **kwargs):
10742 """
10743 Clear(self, bool deleteWindows=False)
10744
10745 Clear all items from the sizer, optionally destroying the window items
10746 as well.
10747 """
10748 return _core_.Sizer_Clear(*args, **kwargs)
10749
10750 def DeleteWindows(*args, **kwargs):
10751 """
10752 DeleteWindows(self)
10753
10754 Destroy all windows managed by the sizer.
10755 """
10756 return _core_.Sizer_DeleteWindows(*args, **kwargs)
10757
10758 def GetChildren(*args, **kwargs):
10759 """
10760 GetChildren(self) -> list
10761
10762 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
10763 """
10764 return _core_.Sizer_GetChildren(*args, **kwargs)
10765
10766 def Show(*args, **kwargs):
10767 """
10768 Show(self, item, bool show=True, bool recursive=false) -> bool
10769
10770 Shows or hides an item managed by the sizer. To make a sizer item
10771 disappear or reappear, use Show followed by `Layout`. The *item*
10772 parameter can be either a window, a sizer, or the zero-based index of
10773 the item. Use the recursive parameter to show or hide an item in a
10774 subsizer. Returns True if the item was found.
10775 """
10776 return _core_.Sizer_Show(*args, **kwargs)
10777
10778 def IsShown(*args, **kwargs):
10779 """
10780 IsShown(self, item)
10781
10782 Determines if the item is currently shown. sizer. To make a sizer
10783 item disappear or reappear, use Show followed by `Layout`. The *item*
10784 parameter can be either a window, a sizer, or the zero-based index of
10785 the item.
10786 """
10787 return _core_.Sizer_IsShown(*args, **kwargs)
10788
10789 def Hide(self, item, recursive=False):
10790 """
10791 A convenience method for `Show` (item, False, recursive).
10792 """
10793 return self.Show(item, False, recursive)
10794
10795 def ShowItems(*args, **kwargs):
10796 """
10797 ShowItems(self, bool show)
10798
10799 Recursively call `wx.SizerItem.Show` on all sizer items.
10800 """
10801 return _core_.Sizer_ShowItems(*args, **kwargs)
10802
10803
10804 class SizerPtr(Sizer):
10805 def __init__(self, this):
10806 self.this = this
10807 if not hasattr(self,"thisown"): self.thisown = 0
10808 self.__class__ = Sizer
10809 _core_.Sizer_swigregister(SizerPtr)
10810
10811 class PySizer(Sizer):
10812 """
10813 wx.PySizer is a special version of `wx.Sizer` that has been
10814 instrumented to allow the C++ virtual methods to be overloaded in
10815 Python derived classes. You would derive from this class if you are
10816 wanting to implement a custom sizer in Python code. Simply implement
10817 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
10818 For example::
10819
10820 class MySizer(wx.PySizer):
10821 def __init__(self):
10822 wx.PySizer.__init__(self)
10823
10824 def CalcMin(self):
10825 for item in self.GetChildren():
10826 # calculate the total minimum width and height needed
10827 # by all items in the sizer according to this sizer's
10828 # layout algorithm.
10829 ...
10830 return wx.Size(width, height)
10831
10832 def RecalcSizes(self):
10833 # find the space allotted to this sizer
10834 pos = self.GetPosition()
10835 size = self.GetSize()
10836 for item in self.GetChildren():
10837 # Recalculate (if necessary) the position and size of
10838 # each item and then call item.SetDimension to do the
10839 # actual positioning and sizing of the items within the
10840 # space alloted to this sizer.
10841 ...
10842 item.SetDimension(itemPos, itemSize)
10843
10844
10845 When `Layout` is called it first calls `CalcMin` followed by
10846 `RecalcSizes` so you can optimize a bit by saving the results of
10847 `CalcMin` and reusing them in `RecalcSizes`.
10848
10849 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
10850
10851
10852 """
10853 def __repr__(self):
10854 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10855 def __init__(self, *args, **kwargs):
10856 """
10857 __init__(self) -> PySizer
10858
10859 Creates a wx.PySizer. Must be called from the __init__ in the derived
10860 class.
10861 """
10862 newobj = _core_.new_PySizer(*args, **kwargs)
10863 self.this = newobj.this
10864 self.thisown = 1
10865 del newobj.thisown
10866 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
10867
10868 def _setCallbackInfo(*args, **kwargs):
10869 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
10870 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
10871
10872
10873 class PySizerPtr(PySizer):
10874 def __init__(self, this):
10875 self.this = this
10876 if not hasattr(self,"thisown"): self.thisown = 0
10877 self.__class__ = PySizer
10878 _core_.PySizer_swigregister(PySizerPtr)
10879
10880 #---------------------------------------------------------------------------
10881
10882 class BoxSizer(Sizer):
10883 """
10884 The basic idea behind a box sizer is that windows will most often be
10885 laid out in rather simple basic geometry, typically in a row or a
10886 column or nested hierarchies of either. A wx.BoxSizer will lay out
10887 its items in a simple row or column, depending on the orientation
10888 parameter passed to the constructor.
10889 """
10890 def __repr__(self):
10891 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10892 def __init__(self, *args, **kwargs):
10893 """
10894 __init__(self, int orient=HORIZONTAL) -> BoxSizer
10895
10896 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
10897 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
10898 sizer.
10899 """
10900 newobj = _core_.new_BoxSizer(*args, **kwargs)
10901 self.this = newobj.this
10902 self.thisown = 1
10903 del newobj.thisown
10904 self._setOORInfo(self)
10905
10906 def GetOrientation(*args, **kwargs):
10907 """
10908 GetOrientation(self) -> int
10909
10910 Returns the current orientation of the sizer.
10911 """
10912 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
10913
10914 def SetOrientation(*args, **kwargs):
10915 """
10916 SetOrientation(self, int orient)
10917
10918 Resets the orientation of the sizer.
10919 """
10920 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
10921
10922
10923 class BoxSizerPtr(BoxSizer):
10924 def __init__(self, this):
10925 self.this = this
10926 if not hasattr(self,"thisown"): self.thisown = 0
10927 self.__class__ = BoxSizer
10928 _core_.BoxSizer_swigregister(BoxSizerPtr)
10929
10930 #---------------------------------------------------------------------------
10931
10932 class StaticBoxSizer(BoxSizer):
10933 """
10934 wx.StaticBoxSizer derives from and functions identically to the
10935 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
10936 manages. Note that this static box must be created separately and
10937 passed to the sizer constructor.
10938 """
10939 def __repr__(self):
10940 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10941 def __init__(self, *args, **kwargs):
10942 """
10943 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
10944
10945 Constructor. It takes an associated static box and the orientation
10946 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
10947 ``wx.HORIZONTAL``.
10948 """
10949 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
10950 self.this = newobj.this
10951 self.thisown = 1
10952 del newobj.thisown
10953 self._setOORInfo(self)
10954
10955 def GetStaticBox(*args, **kwargs):
10956 """
10957 GetStaticBox(self) -> StaticBox
10958
10959 Returns the static box associated with this sizer.
10960 """
10961 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
10962
10963
10964 class StaticBoxSizerPtr(StaticBoxSizer):
10965 def __init__(self, this):
10966 self.this = this
10967 if not hasattr(self,"thisown"): self.thisown = 0
10968 self.__class__ = StaticBoxSizer
10969 _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
10970
10971 #---------------------------------------------------------------------------
10972
10973 class GridSizer(Sizer):
10974 """
10975 A grid sizer is a sizer which lays out its children in a
10976 two-dimensional table with all cells having the same size. In other
10977 words, the width of each cell within the grid is the width of the
10978 widest item added to the sizer and the height of each grid cell is the
10979 height of the tallest item. An optional vertical and/or horizontal
10980 gap between items can also be specified (in pixels.)
10981
10982 Items are placed in the cells of the grid in the order they are added,
10983 in row-major order. In other words, the first row is filled first,
10984 then the second, and so on until all items have been added. (If
10985 neccessary, additional rows will be added as items are added.) If you
10986 need to have greater control over the cells that items are placed in
10987 then use the `wx.GridBagSizer`.
10988
10989 """
10990 def __repr__(self):
10991 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10992 def __init__(self, *args, **kwargs):
10993 """
10994 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
10995
10996 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
10997 of columns and rows in the sizer - if either of the parameters is
10998 zero, it will be calculated to from the total number of children in
10999 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11000 define extra space between all children.
11001 """
11002 newobj = _core_.new_GridSizer(*args, **kwargs)
11003 self.this = newobj.this
11004 self.thisown = 1
11005 del newobj.thisown
11006 self._setOORInfo(self)
11007
11008 def SetCols(*args, **kwargs):
11009 """
11010 SetCols(self, int cols)
11011
11012 Sets the number of columns in the sizer.
11013 """
11014 return _core_.GridSizer_SetCols(*args, **kwargs)
11015
11016 def SetRows(*args, **kwargs):
11017 """
11018 SetRows(self, int rows)
11019
11020 Sets the number of rows in the sizer.
11021 """
11022 return _core_.GridSizer_SetRows(*args, **kwargs)
11023
11024 def SetVGap(*args, **kwargs):
11025 """
11026 SetVGap(self, int gap)
11027
11028 Sets the vertical gap (in pixels) between the cells in the sizer.
11029 """
11030 return _core_.GridSizer_SetVGap(*args, **kwargs)
11031
11032 def SetHGap(*args, **kwargs):
11033 """
11034 SetHGap(self, int gap)
11035
11036 Sets the horizontal gap (in pixels) between cells in the sizer
11037 """
11038 return _core_.GridSizer_SetHGap(*args, **kwargs)
11039
11040 def GetCols(*args, **kwargs):
11041 """
11042 GetCols(self) -> int
11043
11044 Returns the number of columns in the sizer.
11045 """
11046 return _core_.GridSizer_GetCols(*args, **kwargs)
11047
11048 def GetRows(*args, **kwargs):
11049 """
11050 GetRows(self) -> int
11051
11052 Returns the number of rows in the sizer.
11053 """
11054 return _core_.GridSizer_GetRows(*args, **kwargs)
11055
11056 def GetVGap(*args, **kwargs):
11057 """
11058 GetVGap(self) -> int
11059
11060 Returns the vertical gap (in pixels) between the cells in the sizer.
11061 """
11062 return _core_.GridSizer_GetVGap(*args, **kwargs)
11063
11064 def GetHGap(*args, **kwargs):
11065 """
11066 GetHGap(self) -> int
11067
11068 Returns the horizontal gap (in pixels) between cells in the sizer.
11069 """
11070 return _core_.GridSizer_GetHGap(*args, **kwargs)
11071
11072
11073 class GridSizerPtr(GridSizer):
11074 def __init__(self, this):
11075 self.this = this
11076 if not hasattr(self,"thisown"): self.thisown = 0
11077 self.__class__ = GridSizer
11078 _core_.GridSizer_swigregister(GridSizerPtr)
11079
11080 #---------------------------------------------------------------------------
11081
11082 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11083 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11084 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11085 class FlexGridSizer(GridSizer):
11086 """
11087 A flex grid sizer is a sizer which lays out its children in a
11088 two-dimensional table with all table cells in one row having the same
11089 height and all cells in one column having the same width, but all
11090 rows or all columns are not necessarily the same height or width as in
11091 the `wx.GridSizer`.
11092
11093 wx.FlexGridSizer can also size items equally in one direction but
11094 unequally ("flexibly") in the other. If the sizer is only flexible
11095 in one direction (this can be changed using `SetFlexibleDirection`), it
11096 needs to be decided how the sizer should grow in the other ("non
11097 flexible") direction in order to fill the available space. The
11098 `SetNonFlexibleGrowMode` method serves this purpose.
11099
11100
11101 """
11102 def __repr__(self):
11103 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11104 def __init__(self, *args, **kwargs):
11105 """
11106 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11107
11108 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11109 number of columns and rows in the sizer - if either of the parameters
11110 is zero, it will be calculated to from the total number of children in
11111 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11112 define extra space between all children.
11113 """
11114 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
11115 self.this = newobj.this
11116 self.thisown = 1
11117 del newobj.thisown
11118 self._setOORInfo(self)
11119
11120 def AddGrowableRow(*args, **kwargs):
11121 """
11122 AddGrowableRow(self, size_t idx, int proportion=0)
11123
11124 Specifies that row *idx* (starting from zero) should be grown if there
11125 is extra space available to the sizer.
11126
11127 The *proportion* parameter has the same meaning as the stretch factor
11128 for the box sizers except that if all proportions are 0, then all
11129 columns are resized equally (instead of not being resized at all).
11130 """
11131 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11132
11133 def RemoveGrowableRow(*args, **kwargs):
11134 """
11135 RemoveGrowableRow(self, size_t idx)
11136
11137 Specifies that row *idx* is no longer growable.
11138 """
11139 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11140
11141 def AddGrowableCol(*args, **kwargs):
11142 """
11143 AddGrowableCol(self, size_t idx, int proportion=0)
11144
11145 Specifies that column *idx* (starting from zero) should be grown if
11146 there is extra space available to the sizer.
11147
11148 The *proportion* parameter has the same meaning as the stretch factor
11149 for the box sizers except that if all proportions are 0, then all
11150 columns are resized equally (instead of not being resized at all).
11151 """
11152 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11153
11154 def RemoveGrowableCol(*args, **kwargs):
11155 """
11156 RemoveGrowableCol(self, size_t idx)
11157
11158 Specifies that column *idx* is no longer growable.
11159 """
11160 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11161
11162 def SetFlexibleDirection(*args, **kwargs):
11163 """
11164 SetFlexibleDirection(self, int direction)
11165
11166 Specifies whether the sizer should flexibly resize its columns, rows,
11167 or both. Argument *direction* can be one of the following values. Any
11168 other value is ignored.
11169
11170 ============== =======================================
11171 wx.VERTICAL Rows are flexibly sized.
11172 wx.HORIZONTAL Columns are flexibly sized.
11173 wx.BOTH Both rows and columns are flexibly sized
11174 (this is the default value).
11175 ============== =======================================
11176
11177 Note that this method does not trigger relayout.
11178
11179 """
11180 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11181
11182 def GetFlexibleDirection(*args, **kwargs):
11183 """
11184 GetFlexibleDirection(self) -> int
11185
11186 Returns a value that specifies whether the sizer
11187 flexibly resizes its columns, rows, or both (default).
11188
11189 :see: `SetFlexibleDirection`
11190 """
11191 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11192
11193 def SetNonFlexibleGrowMode(*args, **kwargs):
11194 """
11195 SetNonFlexibleGrowMode(self, int mode)
11196
11197 Specifies how the sizer should grow in the non-flexible direction if
11198 there is one (so `SetFlexibleDirection` must have been called
11199 previously). Argument *mode* can be one of the following values:
11200
11201 ========================== =================================================
11202 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11203 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11204 `AddGrowableCol` and `AddGrowableRow`. In this
11205 case equal sizing applies to minimum sizes of
11206 columns or rows (this is the default value).
11207 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11208 the non flexible direction, whether they are
11209 growable or not in the flexbile direction.
11210 ========================== =================================================
11211
11212 Note that this method does not trigger relayout.
11213
11214
11215 """
11216 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11217
11218 def GetNonFlexibleGrowMode(*args, **kwargs):
11219 """
11220 GetNonFlexibleGrowMode(self) -> int
11221
11222 Returns the value that specifies how the sizer grows in the
11223 non-flexible direction if there is one.
11224
11225 :see: `SetNonFlexibleGrowMode`
11226 """
11227 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11228
11229 def GetRowHeights(*args, **kwargs):
11230 """
11231 GetRowHeights(self) -> list
11232
11233 Returns a list of integers representing the heights of each of the
11234 rows in the sizer.
11235 """
11236 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11237
11238 def GetColWidths(*args, **kwargs):
11239 """
11240 GetColWidths(self) -> list
11241
11242 Returns a list of integers representing the widths of each of the
11243 columns in the sizer.
11244 """
11245 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11246
11247
11248 class FlexGridSizerPtr(FlexGridSizer):
11249 def __init__(self, this):
11250 self.this = this
11251 if not hasattr(self,"thisown"): self.thisown = 0
11252 self.__class__ = FlexGridSizer
11253 _core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
11254
11255 class StdDialogButtonSizer(BoxSizer):
11256 """
11257 A special sizer that knows how to order and position standard buttons
11258 in order to conform to the current platform's standards. You simply
11259 need to add each `wx.Button` to the sizer, and be sure to create the
11260 buttons using the standard ID's. Then call `Realize` and the sizer
11261 will take care of the rest.
11262
11263 """
11264 def __repr__(self):
11265 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11266 def __init__(self, *args, **kwargs):
11267 """__init__(self) -> StdDialogButtonSizer"""
11268 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
11269 self.this = newobj.this
11270 self.thisown = 1
11271 del newobj.thisown
11272 def AddButton(*args, **kwargs):
11273 """
11274 AddButton(self, wxButton button)
11275
11276 Use this to add the buttons to this sizer. Do not use the `Add`
11277 method in the base class.
11278 """
11279 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11280
11281 def Realize(*args, **kwargs):
11282 """
11283 Realize(self)
11284
11285 This funciton needs to be called after all the buttons have been added
11286 to the sizer. It will reorder them and position them in a platform
11287 specifc manner.
11288 """
11289 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
11290
11291 def SetAffirmativeButton(*args, **kwargs):
11292 """SetAffirmativeButton(self, wxButton button)"""
11293 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11294
11295 def SetNegativeButton(*args, **kwargs):
11296 """SetNegativeButton(self, wxButton button)"""
11297 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11298
11299 def SetCancelButton(*args, **kwargs):
11300 """SetCancelButton(self, wxButton button)"""
11301 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
11302
11303 def GetAffirmativeButton(*args, **kwargs):
11304 """GetAffirmativeButton(self) -> wxButton"""
11305 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11306
11307 def GetApplyButton(*args, **kwargs):
11308 """GetApplyButton(self) -> wxButton"""
11309 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11310
11311 def GetNegativeButton(*args, **kwargs):
11312 """GetNegativeButton(self) -> wxButton"""
11313 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11314
11315 def GetCancelButton(*args, **kwargs):
11316 """GetCancelButton(self) -> wxButton"""
11317 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11318
11319 def GetHelpButton(*args, **kwargs):
11320 """GetHelpButton(self) -> wxButton"""
11321 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11322
11323
11324 class StdDialogButtonSizerPtr(StdDialogButtonSizer):
11325 def __init__(self, this):
11326 self.this = this
11327 if not hasattr(self,"thisown"): self.thisown = 0
11328 self.__class__ = StdDialogButtonSizer
11329 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
11330
11331 #---------------------------------------------------------------------------
11332
11333 class GBPosition(object):
11334 """
11335 This class represents the position of an item in a virtual grid of
11336 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11337 typemaps that will automatically convert from a 2-element sequence of
11338 integers to a wx.GBPosition, so you can use the more pythonic
11339 representation of the position nearly transparently in Python code.
11340 """
11341 def __repr__(self):
11342 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11343 def __init__(self, *args, **kwargs):
11344 """
11345 __init__(self, int row=0, int col=0) -> GBPosition
11346
11347 This class represents the position of an item in a virtual grid of
11348 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11349 typemaps that will automatically convert from a 2-element sequence of
11350 integers to a wx.GBPosition, so you can use the more pythonic
11351 representation of the position nearly transparently in Python code.
11352 """
11353 newobj = _core_.new_GBPosition(*args, **kwargs)
11354 self.this = newobj.this
11355 self.thisown = 1
11356 del newobj.thisown
11357 def GetRow(*args, **kwargs):
11358 """GetRow(self) -> int"""
11359 return _core_.GBPosition_GetRow(*args, **kwargs)
11360
11361 def GetCol(*args, **kwargs):
11362 """GetCol(self) -> int"""
11363 return _core_.GBPosition_GetCol(*args, **kwargs)
11364
11365 def SetRow(*args, **kwargs):
11366 """SetRow(self, int row)"""
11367 return _core_.GBPosition_SetRow(*args, **kwargs)
11368
11369 def SetCol(*args, **kwargs):
11370 """SetCol(self, int col)"""
11371 return _core_.GBPosition_SetCol(*args, **kwargs)
11372
11373 def __eq__(*args, **kwargs):
11374 """__eq__(self, GBPosition other) -> bool"""
11375 return _core_.GBPosition___eq__(*args, **kwargs)
11376
11377 def __ne__(*args, **kwargs):
11378 """__ne__(self, GBPosition other) -> bool"""
11379 return _core_.GBPosition___ne__(*args, **kwargs)
11380
11381 def Set(*args, **kwargs):
11382 """Set(self, int row=0, int col=0)"""
11383 return _core_.GBPosition_Set(*args, **kwargs)
11384
11385 def Get(*args, **kwargs):
11386 """Get(self) -> PyObject"""
11387 return _core_.GBPosition_Get(*args, **kwargs)
11388
11389 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11390 def __str__(self): return str(self.Get())
11391 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11392 def __len__(self): return len(self.Get())
11393 def __getitem__(self, index): return self.Get()[index]
11394 def __setitem__(self, index, val):
11395 if index == 0: self.SetRow(val)
11396 elif index == 1: self.SetCol(val)
11397 else: raise IndexError
11398 def __nonzero__(self): return self.Get() != (0,0)
11399 __safe_for_unpickling__ = True
11400 def __reduce__(self): return (wx.GBPosition, self.Get())
11401
11402 row = property(GetRow, SetRow)
11403 col = property(GetCol, SetCol)
11404
11405
11406 class GBPositionPtr(GBPosition):
11407 def __init__(self, this):
11408 self.this = this
11409 if not hasattr(self,"thisown"): self.thisown = 0
11410 self.__class__ = GBPosition
11411 _core_.GBPosition_swigregister(GBPositionPtr)
11412
11413 class GBSpan(object):
11414 """
11415 This class is used to hold the row and column spanning attributes of
11416 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11417 automatically convert from a 2-element sequence of integers to a
11418 wx.GBSpan, so you can use the more pythonic representation of the span
11419 nearly transparently in Python code.
11420
11421 """
11422 def __repr__(self):
11423 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11424 def __init__(self, *args, **kwargs):
11425 """
11426 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11427
11428 Construct a new wxGBSpan, optionally setting the rowspan and
11429 colspan. The default is (1,1). (Meaning that the item occupies one
11430 cell in each direction.
11431 """
11432 newobj = _core_.new_GBSpan(*args, **kwargs)
11433 self.this = newobj.this
11434 self.thisown = 1
11435 del newobj.thisown
11436 def GetRowspan(*args, **kwargs):
11437 """GetRowspan(self) -> int"""
11438 return _core_.GBSpan_GetRowspan(*args, **kwargs)
11439
11440 def GetColspan(*args, **kwargs):
11441 """GetColspan(self) -> int"""
11442 return _core_.GBSpan_GetColspan(*args, **kwargs)
11443
11444 def SetRowspan(*args, **kwargs):
11445 """SetRowspan(self, int rowspan)"""
11446 return _core_.GBSpan_SetRowspan(*args, **kwargs)
11447
11448 def SetColspan(*args, **kwargs):
11449 """SetColspan(self, int colspan)"""
11450 return _core_.GBSpan_SetColspan(*args, **kwargs)
11451
11452 def __eq__(*args, **kwargs):
11453 """__eq__(self, GBSpan other) -> bool"""
11454 return _core_.GBSpan___eq__(*args, **kwargs)
11455
11456 def __ne__(*args, **kwargs):
11457 """__ne__(self, GBSpan other) -> bool"""
11458 return _core_.GBSpan___ne__(*args, **kwargs)
11459
11460 def Set(*args, **kwargs):
11461 """Set(self, int rowspan=1, int colspan=1)"""
11462 return _core_.GBSpan_Set(*args, **kwargs)
11463
11464 def Get(*args, **kwargs):
11465 """Get(self) -> PyObject"""
11466 return _core_.GBSpan_Get(*args, **kwargs)
11467
11468 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
11469 def __str__(self): return str(self.Get())
11470 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
11471 def __len__(self): return len(self.Get())
11472 def __getitem__(self, index): return self.Get()[index]
11473 def __setitem__(self, index, val):
11474 if index == 0: self.SetRowspan(val)
11475 elif index == 1: self.SetColspan(val)
11476 else: raise IndexError
11477 def __nonzero__(self): return self.Get() != (0,0)
11478 __safe_for_unpickling__ = True
11479 def __reduce__(self): return (wx.GBSpan, self.Get())
11480
11481 rowspan = property(GetRowspan, SetRowspan)
11482 colspan = property(GetColspan, SetColspan)
11483
11484
11485 class GBSpanPtr(GBSpan):
11486 def __init__(self, this):
11487 self.this = this
11488 if not hasattr(self,"thisown"): self.thisown = 0
11489 self.__class__ = GBSpan
11490 _core_.GBSpan_swigregister(GBSpanPtr)
11491
11492 class GBSizerItem(SizerItem):
11493 """
11494 The wx.GBSizerItem class is used to track the additional data about
11495 items in a `wx.GridBagSizer` such as the item's position in the grid
11496 and how many rows or columns it spans.
11497
11498 """
11499 def __repr__(self):
11500 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11501 def __init__(self, *args, **kwargs):
11502 """
11503 __init__(self) -> GBSizerItem
11504
11505 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
11506 size will need to be set, as well as a position and span before this
11507 item can be used in a Sizer.
11508
11509 You will probably never need to create a wx.GBSizerItem directly as they
11510 are created automatically when the sizer's Add method is called.
11511 """
11512 newobj = _core_.new_GBSizerItem(*args, **kwargs)
11513 self.this = newobj.this
11514 self.thisown = 1
11515 del newobj.thisown
11516 def GetPos(*args, **kwargs):
11517 """
11518 GetPos(self) -> GBPosition
11519
11520 Get the grid position of the item
11521 """
11522 return _core_.GBSizerItem_GetPos(*args, **kwargs)
11523
11524 def GetPosTuple(self): return self.GetPos().Get()
11525 def GetSpan(*args, **kwargs):
11526 """
11527 GetSpan(self) -> GBSpan
11528
11529 Get the row and column spanning of the item
11530 """
11531 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
11532
11533 def GetSpanTuple(self): return self.GetSpan().Get()
11534 def SetPos(*args, **kwargs):
11535 """
11536 SetPos(self, GBPosition pos) -> bool
11537
11538 If the item is already a member of a sizer then first ensure that
11539 there is no other item that would intersect with this one at the new
11540 position, then set the new position. Returns True if the change is
11541 successful and after the next Layout() the item will be moved.
11542 """
11543 return _core_.GBSizerItem_SetPos(*args, **kwargs)
11544
11545 def SetSpan(*args, **kwargs):
11546 """
11547 SetSpan(self, GBSpan span) -> bool
11548
11549 If the item is already a member of a sizer then first ensure that
11550 there is no other item that would intersect with this one with its new
11551 spanning size, then set the new spanning. Returns True if the change
11552 is successful and after the next Layout() the item will be resized.
11553
11554 """
11555 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
11556
11557 def Intersects(*args, **kwargs):
11558 """
11559 Intersects(self, GBSizerItem other) -> bool
11560
11561 Returns True if this item and the other item instersect.
11562 """
11563 return _core_.GBSizerItem_Intersects(*args, **kwargs)
11564
11565 def IntersectsPos(*args, **kwargs):
11566 """
11567 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
11568
11569 Returns True if the given pos/span would intersect with this item.
11570 """
11571 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
11572
11573 def GetEndPos(*args, **kwargs):
11574 """
11575 GetEndPos(self) -> GBPosition
11576
11577 Get the row and column of the endpoint of this item.
11578 """
11579 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
11580
11581 def GetGBSizer(*args, **kwargs):
11582 """
11583 GetGBSizer(self) -> GridBagSizer
11584
11585 Get the sizer this item is a member of.
11586 """
11587 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
11588
11589 def SetGBSizer(*args, **kwargs):
11590 """
11591 SetGBSizer(self, GridBagSizer sizer)
11592
11593 Set the sizer this item is a member of.
11594 """
11595 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
11596
11597
11598 class GBSizerItemPtr(GBSizerItem):
11599 def __init__(self, this):
11600 self.this = this
11601 if not hasattr(self,"thisown"): self.thisown = 0
11602 self.__class__ = GBSizerItem
11603 _core_.GBSizerItem_swigregister(GBSizerItemPtr)
11604 DefaultSpan = cvar.DefaultSpan
11605
11606 def GBSizerItemWindow(*args, **kwargs):
11607 """
11608 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
11609 int border, PyObject userData=None) -> GBSizerItem
11610
11611 Construct a `wx.GBSizerItem` for a window.
11612 """
11613 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
11614 val.thisown = 1
11615 return val
11616
11617 def GBSizerItemSizer(*args, **kwargs):
11618 """
11619 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
11620 int border, PyObject userData=None) -> GBSizerItem
11621
11622 Construct a `wx.GBSizerItem` for a sizer
11623 """
11624 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
11625 val.thisown = 1
11626 return val
11627
11628 def GBSizerItemSpacer(*args, **kwargs):
11629 """
11630 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
11631 int flag, int border, PyObject userData=None) -> GBSizerItem
11632
11633 Construct a `wx.GBSizerItem` for a spacer.
11634 """
11635 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
11636 val.thisown = 1
11637 return val
11638
11639 class GridBagSizer(FlexGridSizer):
11640 """
11641 A `wx.Sizer` that can lay out items in a virtual grid like a
11642 `wx.FlexGridSizer` but in this case explicit positioning of the items
11643 is allowed using `wx.GBPosition`, and items can optionally span more
11644 than one row and/or column using `wx.GBSpan`. The total size of the
11645 virtual grid is determined by the largest row and column that items are
11646 positioned at, adjusted for spanning.
11647
11648 """
11649 def __repr__(self):
11650 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11651 def __init__(self, *args, **kwargs):
11652 """
11653 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
11654
11655 Constructor, with optional parameters to specify the gap between the
11656 rows and columns.
11657 """
11658 newobj = _core_.new_GridBagSizer(*args, **kwargs)
11659 self.this = newobj.this
11660 self.thisown = 1
11661 del newobj.thisown
11662 self._setOORInfo(self)
11663
11664 def Add(*args, **kwargs):
11665 """
11666 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
11667 int border=0, userData=None) -> wx.GBSizerItem
11668
11669 Adds an item to the sizer at the grid cell *pos*, optionally spanning
11670 more than one row or column as specified with *span*. The remaining
11671 args behave similarly to `wx.Sizer.Add`.
11672
11673 Returns True if the item was successfully placed at the given cell
11674 position, False if something was already there.
11675
11676 """
11677 return _core_.GridBagSizer_Add(*args, **kwargs)
11678
11679 def AddItem(*args, **kwargs):
11680 """
11681 Add(self, GBSizerItem item) -> wx.GBSizerItem
11682
11683 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
11684 the item was successfully placed at its given cell position, False if
11685 something was already there.
11686 """
11687 return _core_.GridBagSizer_AddItem(*args, **kwargs)
11688
11689 def GetCellSize(*args, **kwargs):
11690 """
11691 GetCellSize(self, int row, int col) -> Size
11692
11693 Get the size of the specified cell, including hgap and
11694 vgap. Only valid after a Layout.
11695 """
11696 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
11697
11698 def GetEmptyCellSize(*args, **kwargs):
11699 """
11700 GetEmptyCellSize(self) -> Size
11701
11702 Get the size used for cells in the grid with no item.
11703 """
11704 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
11705
11706 def SetEmptyCellSize(*args, **kwargs):
11707 """
11708 SetEmptyCellSize(self, Size sz)
11709
11710 Set the size used for cells in the grid with no item.
11711 """
11712 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
11713
11714 def GetItemPosition(*args):
11715 """
11716 GetItemPosition(self, item) -> GBPosition
11717
11718 Get the grid position of the specified *item* where *item* is either a
11719 window or subsizer that is a member of this sizer, or a zero-based
11720 index of an item.
11721 """
11722 return _core_.GridBagSizer_GetItemPosition(*args)
11723
11724 def SetItemPosition(*args):
11725 """
11726 SetItemPosition(self, item, GBPosition pos) -> bool
11727
11728 Set the grid position of the specified *item* where *item* is either a
11729 window or subsizer that is a member of this sizer, or a zero-based
11730 index of an item. Returns True on success. If the move is not
11731 allowed (because an item is already there) then False is returned.
11732
11733 """
11734 return _core_.GridBagSizer_SetItemPosition(*args)
11735
11736 def GetItemSpan(*args):
11737 """
11738 GetItemSpan(self, item) -> GBSpan
11739
11740 Get the row/col spanning of the specified *item* where *item* is
11741 either a window or subsizer that is a member of this sizer, or a
11742 zero-based index of an item.
11743 """
11744 return _core_.GridBagSizer_GetItemSpan(*args)
11745
11746 def SetItemSpan(*args):
11747 """
11748 SetItemSpan(self, item, GBSpan span) -> bool
11749
11750 Set the row/col spanning of the specified *item* where *item* is
11751 either a window or subsizer that is a member of this sizer, or a
11752 zero-based index of an item. Returns True on success. If the move is
11753 not allowed (because an item is already there) then False is returned.
11754 """
11755 return _core_.GridBagSizer_SetItemSpan(*args)
11756
11757 def FindItem(*args):
11758 """
11759 FindItem(self, item) -> GBSizerItem
11760
11761 Find the sizer item for the given window or subsizer, returns None if
11762 not found. (non-recursive)
11763 """
11764 return _core_.GridBagSizer_FindItem(*args)
11765
11766 def FindItemAtPosition(*args, **kwargs):
11767 """
11768 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
11769
11770 Return the sizer item for the given grid cell, or None if there is no
11771 item at that position. (non-recursive)
11772 """
11773 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
11774
11775 def FindItemAtPoint(*args, **kwargs):
11776 """
11777 FindItemAtPoint(self, Point pt) -> GBSizerItem
11778
11779 Return the sizer item located at the point given in *pt*, or None if
11780 there is no item at that point. The (x,y) coordinates in pt correspond
11781 to the client coordinates of the window using the sizer for
11782 layout. (non-recursive)
11783 """
11784 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
11785
11786 def CheckForIntersection(*args, **kwargs):
11787 """
11788 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
11789
11790 Look at all items and see if any intersect (or would overlap) the
11791 given *item*. Returns True if so, False if there would be no overlap.
11792 If an *excludeItem* is given then it will not be checked for
11793 intersection, for example it may be the item we are checking the
11794 position of.
11795
11796 """
11797 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
11798
11799 def CheckForIntersectionPos(*args, **kwargs):
11800 """
11801 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
11802
11803 Look at all items and see if any intersect (or would overlap) the
11804 given position and span. Returns True if so, False if there would be
11805 no overlap. If an *excludeItem* is given then it will not be checked
11806 for intersection, for example it may be the item we are checking the
11807 position of.
11808 """
11809 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
11810
11811
11812 class GridBagSizerPtr(GridBagSizer):
11813 def __init__(self, this):
11814 self.this = this
11815 if not hasattr(self,"thisown"): self.thisown = 0
11816 self.__class__ = GridBagSizer
11817 _core_.GridBagSizer_swigregister(GridBagSizerPtr)
11818
11819 #---------------------------------------------------------------------------
11820
11821 Left = _core_.Left
11822 Top = _core_.Top
11823 Right = _core_.Right
11824 Bottom = _core_.Bottom
11825 Width = _core_.Width
11826 Height = _core_.Height
11827 Centre = _core_.Centre
11828 Center = _core_.Center
11829 CentreX = _core_.CentreX
11830 CentreY = _core_.CentreY
11831 Unconstrained = _core_.Unconstrained
11832 AsIs = _core_.AsIs
11833 PercentOf = _core_.PercentOf
11834 Above = _core_.Above
11835 Below = _core_.Below
11836 LeftOf = _core_.LeftOf
11837 RightOf = _core_.RightOf
11838 SameAs = _core_.SameAs
11839 Absolute = _core_.Absolute
11840 class IndividualLayoutConstraint(Object):
11841 """
11842 Objects of this class are stored in the `wx.LayoutConstraints` class as
11843 one of eight possible constraints that a window can be involved in.
11844 You will never need to create an instance of
11845 wx.IndividualLayoutConstraint, rather you should create a
11846 `wx.LayoutConstraints` instance and use the individual contstraints
11847 that it contains.
11848 """
11849 def __init__(self): raise RuntimeError, "No constructor defined"
11850 def __repr__(self):
11851 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11852 def Set(*args, **kwargs):
11853 """
11854 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
11855
11856 Sets the properties of the constraint. Normally called by one of the
11857 convenience functions such as Above, RightOf, SameAs.
11858 """
11859 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
11860
11861 def LeftOf(*args, **kwargs):
11862 """
11863 LeftOf(self, Window sibling, int marg=0)
11864
11865 Constrains this edge to be to the left of the given window, with an
11866 optional margin. Implicitly, this is relative to the left edge of the
11867 other window.
11868 """
11869 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
11870
11871 def RightOf(*args, **kwargs):
11872 """
11873 RightOf(self, Window sibling, int marg=0)
11874
11875 Constrains this edge to be to the right of the given window, with an
11876 optional margin. Implicitly, this is relative to the right edge of the
11877 other window.
11878 """
11879 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
11880
11881 def Above(*args, **kwargs):
11882 """
11883 Above(self, Window sibling, int marg=0)
11884
11885 Constrains this edge to be above the given window, with an optional
11886 margin. Implicitly, this is relative to the top edge of the other
11887 window.
11888 """
11889 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
11890
11891 def Below(*args, **kwargs):
11892 """
11893 Below(self, Window sibling, int marg=0)
11894
11895 Constrains this edge to be below the given window, with an optional
11896 margin. Implicitly, this is relative to the bottom edge of the other
11897 window.
11898 """
11899 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
11900
11901 def SameAs(*args, **kwargs):
11902 """
11903 SameAs(self, Window otherW, int edge, int marg=0)
11904
11905 Constrains this edge or dimension to be to the same as the edge of the
11906 given window, with an optional margin.
11907 """
11908 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
11909
11910 def PercentOf(*args, **kwargs):
11911 """
11912 PercentOf(self, Window otherW, int wh, int per)
11913
11914 Constrains this edge or dimension to be to a percentage of the given
11915 window, with an optional margin.
11916 """
11917 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
11918
11919 def Absolute(*args, **kwargs):
11920 """
11921 Absolute(self, int val)
11922
11923 Constrains this edge or dimension to be the given absolute value.
11924 """
11925 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
11926
11927 def Unconstrained(*args, **kwargs):
11928 """
11929 Unconstrained(self)
11930
11931 Sets this edge or dimension to be unconstrained, that is, dependent on
11932 other edges and dimensions from which this value can be deduced.
11933 """
11934 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
11935
11936 def AsIs(*args, **kwargs):
11937 """
11938 AsIs(self)
11939
11940 Sets this edge or constraint to be whatever the window's value is at
11941 the moment. If either of the width and height constraints are *as is*,
11942 the window will not be resized, but moved instead. This is important
11943 when considering panel items which are intended to have a default
11944 size, such as a button, which may take its size from the size of the
11945 button label.
11946 """
11947 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
11948
11949 def GetOtherWindow(*args, **kwargs):
11950 """GetOtherWindow(self) -> Window"""
11951 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
11952
11953 def GetMyEdge(*args, **kwargs):
11954 """GetMyEdge(self) -> int"""
11955 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
11956
11957 def SetEdge(*args, **kwargs):
11958 """SetEdge(self, int which)"""
11959 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
11960
11961 def SetValue(*args, **kwargs):
11962 """SetValue(self, int v)"""
11963 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
11964
11965 def GetMargin(*args, **kwargs):
11966 """GetMargin(self) -> int"""
11967 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
11968
11969 def SetMargin(*args, **kwargs):
11970 """SetMargin(self, int m)"""
11971 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
11972
11973 def GetValue(*args, **kwargs):
11974 """GetValue(self) -> int"""
11975 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
11976
11977 def GetPercent(*args, **kwargs):
11978 """GetPercent(self) -> int"""
11979 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
11980
11981 def GetOtherEdge(*args, **kwargs):
11982 """GetOtherEdge(self) -> int"""
11983 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
11984
11985 def GetDone(*args, **kwargs):
11986 """GetDone(self) -> bool"""
11987 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
11988
11989 def SetDone(*args, **kwargs):
11990 """SetDone(self, bool d)"""
11991 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
11992
11993 def GetRelationship(*args, **kwargs):
11994 """GetRelationship(self) -> int"""
11995 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
11996
11997 def SetRelationship(*args, **kwargs):
11998 """SetRelationship(self, int r)"""
11999 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12000
12001 def ResetIfWin(*args, **kwargs):
12002 """
12003 ResetIfWin(self, Window otherW) -> bool
12004
12005 Reset constraint if it mentions otherWin
12006 """
12007 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12008
12009 def SatisfyConstraint(*args, **kwargs):
12010 """
12011 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12012
12013 Try to satisfy constraint
12014 """
12015 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12016
12017 def GetEdge(*args, **kwargs):
12018 """
12019 GetEdge(self, int which, Window thisWin, Window other) -> int
12020
12021 Get the value of this edge or dimension, or if this
12022 is not determinable, -1.
12023 """
12024 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12025
12026
12027 class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
12028 def __init__(self, this):
12029 self.this = this
12030 if not hasattr(self,"thisown"): self.thisown = 0
12031 self.__class__ = IndividualLayoutConstraint
12032 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
12033
12034 class LayoutConstraints(Object):
12035 """
12036 **Note:** constraints are now deprecated and you should use sizers
12037 instead.
12038
12039 Objects of this class can be associated with a window to define its
12040 layout constraints, with respect to siblings or its parent.
12041
12042 The class consists of the following eight constraints of class
12043 wx.IndividualLayoutConstraint, some or all of which should be accessed
12044 directly to set the appropriate constraints.
12045
12046 * left: represents the left hand edge of the window
12047 * right: represents the right hand edge of the window
12048 * top: represents the top edge of the window
12049 * bottom: represents the bottom edge of the window
12050 * width: represents the width of the window
12051 * height: represents the height of the window
12052 * centreX: represents the horizontal centre point of the window
12053 * centreY: represents the vertical centre point of the window
12054
12055 Most constraints are initially set to have the relationship
12056 wxUnconstrained, which means that their values should be calculated by
12057 looking at known constraints. The exceptions are width and height,
12058 which are set to wxAsIs to ensure that if the user does not specify a
12059 constraint, the existing width and height will be used, to be
12060 compatible with panel items which often have take a default size. If
12061 the constraint is ``wx.AsIs``, the dimension will not be changed.
12062
12063 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12064
12065 """
12066 def __repr__(self):
12067 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12068 left = property(_core_.LayoutConstraints_left_get)
12069 top = property(_core_.LayoutConstraints_top_get)
12070 right = property(_core_.LayoutConstraints_right_get)
12071 bottom = property(_core_.LayoutConstraints_bottom_get)
12072 width = property(_core_.LayoutConstraints_width_get)
12073 height = property(_core_.LayoutConstraints_height_get)
12074 centreX = property(_core_.LayoutConstraints_centreX_get)
12075 centreY = property(_core_.LayoutConstraints_centreY_get)
12076 def __init__(self, *args, **kwargs):
12077 """__init__(self) -> LayoutConstraints"""
12078 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
12079 self.this = newobj.this
12080 self.thisown = 1
12081 del newobj.thisown
12082 def SatisfyConstraints(*args, **kwargs):
12083 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12084 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12085
12086 def AreSatisfied(*args, **kwargs):
12087 """AreSatisfied(self) -> bool"""
12088 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12089
12090
12091 class LayoutConstraintsPtr(LayoutConstraints):
12092 def __init__(self, this):
12093 self.this = this
12094 if not hasattr(self,"thisown"): self.thisown = 0
12095 self.__class__ = LayoutConstraints
12096 _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
12097
12098 #----------------------------------------------------------------------------
12099
12100 # Use Python's bool constants if available, make some if not
12101 try:
12102 True
12103 except NameError:
12104 __builtins__.True = 1==1
12105 __builtins__.False = 1==0
12106 def bool(value): return not not value
12107 __builtins__.bool = bool
12108
12109
12110
12111 # workarounds for bad wxRTTI names
12112 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12113 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12114 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12115
12116
12117 #----------------------------------------------------------------------------
12118 # Load version numbers from __version__... Ensure that major and minor
12119 # versions are the same for both wxPython and wxWidgets.
12120
12121 from __version__ import *
12122 __version__ = VERSION_STRING
12123
12124 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12125 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
12126 if RELEASE_VERSION != _core_.RELEASE_VERSION:
12127 import warnings
12128 warnings.warn("wxPython/wxWidgets release number mismatch")
12129
12130 #----------------------------------------------------------------------------
12131
12132 # Set wxPython's default string<-->unicode conversion encoding from
12133 # the locale, but only if Python's default hasn't been changed. (We
12134 # assume that if the user has customized it already then that is the
12135 # encoding we need to use as well.)
12136 #
12137 # The encoding selected here is used when string or unicode objects
12138 # need to be converted in order to pass them to wxWidgets. Please be
12139 # aware that the default encoding within the same locale may be
12140 # slightly different on different platforms. For example, please see
12141 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12142 # between the common latin/roman encodings.
12143
12144 default = _sys.getdefaultencoding()
12145 if default == 'ascii':
12146 import locale
12147 import codecs
12148 try:
12149 default = locale.getdefaultlocale()[1]
12150 codecs.lookup(default)
12151 except (ValueError, LookupError, TypeError):
12152 default = _sys.getdefaultencoding()
12153 del locale
12154 del codecs
12155 if default:
12156 wx.SetDefaultPyEncoding(default)
12157 del default
12158
12159 #----------------------------------------------------------------------------
12160
12161 class PyDeadObjectError(AttributeError):
12162 pass
12163
12164 class _wxPyDeadObject(object):
12165 """
12166 Instances of wx objects that are OOR capable will have their __class__
12167 changed to this class when the C++ object is deleted. This should help
12168 prevent crashes due to referencing a bogus C++ pointer.
12169 """
12170 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12171 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12172
12173 def __repr__(self):
12174 if not hasattr(self, "_name"):
12175 self._name = "[unknown]"
12176 return self.reprStr % self._name
12177
12178 def __getattr__(self, *args):
12179 if not hasattr(self, "_name"):
12180 self._name = "[unknown]"
12181 raise PyDeadObjectError(self.attrStr % self._name)
12182
12183 def __nonzero__(self):
12184 return 0
12185
12186
12187
12188 class PyUnbornObjectError(AttributeError):
12189 pass
12190
12191 class _wxPyUnbornObject(object):
12192 """
12193 Some stock objects are created when the wx._core module is
12194 imported, but their C++ instance is not created until the wx.App
12195 object is created and initialized. These object instances will
12196 temporarily have their __class__ changed to this class so an
12197 exception will be raised if they are used before the C++ instance
12198 is ready.
12199 """
12200
12201 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12202 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12203
12204 def __repr__(self):
12205 #if not hasattr(self, "_name"):
12206 # self._name = "[unknown]"
12207 return self.reprStr #% self._name
12208
12209 def __getattr__(self, *args):
12210 #if not hasattr(self, "_name"):
12211 # self._name = "[unknown]"
12212 raise PyUnbornObjectError(self.attrStr) # % self._name )
12213
12214 def __nonzero__(self):
12215 return 0
12216
12217
12218 #----------------------------------------------------------------------------
12219
12220 def CallAfter(callable, *args, **kw):
12221 """
12222 Call the specified function after the current and pending event
12223 handlers have been completed. This is also good for making GUI
12224 method calls from non-GUI threads. Any extra positional or
12225 keyword args are passed on to the callable when it is called.
12226
12227 :see: `wx.FutureCall`
12228 """
12229 app = wx.GetApp()
12230 assert app is not None, 'No wx.App created yet'
12231
12232 if not hasattr(app, "_CallAfterId"):
12233 app._CallAfterId = wx.NewEventType()
12234 app.Connect(-1, -1, app._CallAfterId,
12235 lambda event: event.callable(*event.args, **event.kw) )
12236 evt = wx.PyEvent()
12237 evt.SetEventType(app._CallAfterId)
12238 evt.callable = callable
12239 evt.args = args
12240 evt.kw = kw
12241 wx.PostEvent(app, evt)
12242
12243 #----------------------------------------------------------------------------
12244
12245
12246 class FutureCall:
12247 """
12248 A convenience class for `wx.Timer`, that calls the given callable
12249 object once after the given amount of milliseconds, passing any
12250 positional or keyword args. The return value of the callable is
12251 availbale after it has been run with the `GetResult` method.
12252
12253 If you don't need to get the return value or restart the timer
12254 then there is no need to hold a reference to this object. It will
12255 hold a reference to itself while the timer is running (the timer
12256 has a reference to self.Notify) but the cycle will be broken when
12257 the timer completes, automatically cleaning up the wx.FutureCall
12258 object.
12259
12260 :see: `wx.CallAfter`
12261 """
12262 def __init__(self, millis, callable, *args, **kwargs):
12263 self.millis = millis
12264 self.callable = callable
12265 self.SetArgs(*args, **kwargs)
12266 self.runCount = 0
12267 self.running = False
12268 self.hasRun = False
12269 self.result = None
12270 self.timer = None
12271 self.Start()
12272
12273 def __del__(self):
12274 self.Stop()
12275
12276
12277 def Start(self, millis=None, *args, **kwargs):
12278 """
12279 (Re)start the timer
12280 """
12281 self.hasRun = False
12282 if millis is not None:
12283 self.millis = millis
12284 if args or kwargs:
12285 self.SetArgs(*args, **kwargs)
12286 self.Stop()
12287 self.timer = wx.PyTimer(self.Notify)
12288 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12289 self.running = True
12290 Restart = Start
12291
12292
12293 def Stop(self):
12294 """
12295 Stop and destroy the timer.
12296 """
12297 if self.timer is not None:
12298 self.timer.Stop()
12299 self.timer = None
12300
12301
12302 def GetInterval(self):
12303 if self.timer is not None:
12304 return self.timer.GetInterval()
12305 else:
12306 return 0
12307
12308
12309 def IsRunning(self):
12310 return self.timer is not None and self.timer.IsRunning()
12311
12312
12313 def SetArgs(self, *args, **kwargs):
12314 """
12315 (Re)set the args passed to the callable object. This is
12316 useful in conjunction with Restart if you want to schedule a
12317 new call to the same callable object but with different
12318 parameters.
12319 """
12320 self.args = args
12321 self.kwargs = kwargs
12322
12323
12324 def HasRun(self):
12325 return self.hasRun
12326
12327 def GetResult(self):
12328 return self.result
12329
12330 def Notify(self):
12331 """
12332 The timer has expired so call the callable.
12333 """
12334 if self.callable and getattr(self.callable, 'im_self', True):
12335 self.runCount += 1
12336 self.running = False
12337 self.result = self.callable(*self.args, **self.kwargs)
12338 self.hasRun = True
12339 if not self.running:
12340 # if it wasn't restarted, then cleanup
12341 wx.CallAfter(self.Stop)
12342
12343
12344
12345 #----------------------------------------------------------------------------
12346 # Control which items in this module should be documented by epydoc.
12347 # We allow only classes and functions, which will help reduce the size
12348 # of the docs by filtering out the zillions of constants, EVT objects,
12349 # and etc that don't make much sense by themselves, but are instead
12350 # documented (or will be) as part of the classes/functions/methods
12351 # where they should be used.
12352
12353 class __DocFilter:
12354 """
12355 A filter for epydoc that only allows non-Ptr classes and
12356 fucntions, in order to reduce the clutter in the API docs.
12357 """
12358 def __init__(self, globals):
12359 self._globals = globals
12360
12361 def __call__(self, name):
12362 import types
12363 obj = self._globals.get(name, None)
12364 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12365 return False
12366 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
12367 return False
12368 return True
12369
12370 #----------------------------------------------------------------------------
12371 #----------------------------------------------------------------------------
12372
12373 # Import other modules in this package that should show up in the
12374 # "core" wx namespace
12375 from _gdi import *
12376 from _windows import *
12377 from _controls import *
12378 from _misc import *
12379
12380
12381 # Fixup the stock objects since they can't be used yet. (They will be
12382 # restored in wx.PyApp.OnInit.)
12383 _core_._wxPyFixStockObjects()
12384
12385 #----------------------------------------------------------------------------
12386 #----------------------------------------------------------------------------
12387
12388