]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/gtk/_core.py
1c5b51411638e55299a171b38fbc8e2d76c5df57
[wxWidgets.git] / wxPython / src / gtk / _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 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
89 WANTS_CHARS = _core_.WANTS_CHARS
90 POPUP_WINDOW = _core_.POPUP_WINDOW
91 CENTER_FRAME = _core_.CENTER_FRAME
92 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
93 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
94 ED_CLIENT_MARGIN = _core_.ED_CLIENT_MARGIN
95 ED_BUTTONS_BOTTOM = _core_.ED_BUTTONS_BOTTOM
96 ED_BUTTONS_RIGHT = _core_.ED_BUTTONS_RIGHT
97 ED_STATIC_LINE = _core_.ED_STATIC_LINE
98 EXT_DIALOG_STYLE = _core_.EXT_DIALOG_STYLE
99 CLIP_CHILDREN = _core_.CLIP_CHILDREN
100 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
101 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
102 RETAINED = _core_.RETAINED
103 BACKINGSTORE = _core_.BACKINGSTORE
104 COLOURED = _core_.COLOURED
105 FIXED_LENGTH = _core_.FIXED_LENGTH
106 LB_NEEDED_SB = _core_.LB_NEEDED_SB
107 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
108 LB_SORT = _core_.LB_SORT
109 LB_SINGLE = _core_.LB_SINGLE
110 LB_MULTIPLE = _core_.LB_MULTIPLE
111 LB_EXTENDED = _core_.LB_EXTENDED
112 LB_OWNERDRAW = _core_.LB_OWNERDRAW
113 LB_HSCROLL = _core_.LB_HSCROLL
114 PROCESS_ENTER = _core_.PROCESS_ENTER
115 PASSWORD = _core_.PASSWORD
116 CB_SIMPLE = _core_.CB_SIMPLE
117 CB_DROPDOWN = _core_.CB_DROPDOWN
118 CB_SORT = _core_.CB_SORT
119 CB_READONLY = _core_.CB_READONLY
120 RA_HORIZONTAL = _core_.RA_HORIZONTAL
121 RA_VERTICAL = _core_.RA_VERTICAL
122 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
123 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
124 RB_GROUP = _core_.RB_GROUP
125 RB_SINGLE = _core_.RB_SINGLE
126 SB_HORIZONTAL = _core_.SB_HORIZONTAL
127 SB_VERTICAL = _core_.SB_VERTICAL
128 ST_SIZEGRIP = _core_.ST_SIZEGRIP
129 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
130 FLOOD_SURFACE = _core_.FLOOD_SURFACE
131 FLOOD_BORDER = _core_.FLOOD_BORDER
132 ODDEVEN_RULE = _core_.ODDEVEN_RULE
133 WINDING_RULE = _core_.WINDING_RULE
134 TOOL_TOP = _core_.TOOL_TOP
135 TOOL_BOTTOM = _core_.TOOL_BOTTOM
136 TOOL_LEFT = _core_.TOOL_LEFT
137 TOOL_RIGHT = _core_.TOOL_RIGHT
138 OK = _core_.OK
139 YES_NO = _core_.YES_NO
140 CANCEL = _core_.CANCEL
141 YES = _core_.YES
142 NO = _core_.NO
143 NO_DEFAULT = _core_.NO_DEFAULT
144 YES_DEFAULT = _core_.YES_DEFAULT
145 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
146 ICON_HAND = _core_.ICON_HAND
147 ICON_QUESTION = _core_.ICON_QUESTION
148 ICON_INFORMATION = _core_.ICON_INFORMATION
149 ICON_STOP = _core_.ICON_STOP
150 ICON_ASTERISK = _core_.ICON_ASTERISK
151 ICON_MASK = _core_.ICON_MASK
152 ICON_WARNING = _core_.ICON_WARNING
153 ICON_ERROR = _core_.ICON_ERROR
154 FORWARD = _core_.FORWARD
155 BACKWARD = _core_.BACKWARD
156 RESET = _core_.RESET
157 HELP = _core_.HELP
158 MORE = _core_.MORE
159 SETUP = _core_.SETUP
160 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
161 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
162 SIZE_AUTO = _core_.SIZE_AUTO
163 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
164 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
165 PORTRAIT = _core_.PORTRAIT
166 LANDSCAPE = _core_.LANDSCAPE
167 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
168 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
169 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
170 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
171 ID_ANY = _core_.ID_ANY
172 ID_SEPARATOR = _core_.ID_SEPARATOR
173 ID_LOWEST = _core_.ID_LOWEST
174 ID_OPEN = _core_.ID_OPEN
175 ID_CLOSE = _core_.ID_CLOSE
176 ID_NEW = _core_.ID_NEW
177 ID_SAVE = _core_.ID_SAVE
178 ID_SAVEAS = _core_.ID_SAVEAS
179 ID_REVERT = _core_.ID_REVERT
180 ID_EXIT = _core_.ID_EXIT
181 ID_UNDO = _core_.ID_UNDO
182 ID_REDO = _core_.ID_REDO
183 ID_HELP = _core_.ID_HELP
184 ID_PRINT = _core_.ID_PRINT
185 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
186 ID_PREVIEW = _core_.ID_PREVIEW
187 ID_ABOUT = _core_.ID_ABOUT
188 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
189 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
190 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
191 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
192 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
193 ID_PREFERENCES = _core_.ID_PREFERENCES
194 ID_CUT = _core_.ID_CUT
195 ID_COPY = _core_.ID_COPY
196 ID_PASTE = _core_.ID_PASTE
197 ID_CLEAR = _core_.ID_CLEAR
198 ID_FIND = _core_.ID_FIND
199 ID_DUPLICATE = _core_.ID_DUPLICATE
200 ID_SELECTALL = _core_.ID_SELECTALL
201 ID_DELETE = _core_.ID_DELETE
202 ID_REPLACE = _core_.ID_REPLACE
203 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
204 ID_PROPERTIES = _core_.ID_PROPERTIES
205 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
206 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
207 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
208 ID_VIEW_LIST = _core_.ID_VIEW_LIST
209 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
210 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
211 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
212 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
213 ID_FILE1 = _core_.ID_FILE1
214 ID_FILE2 = _core_.ID_FILE2
215 ID_FILE3 = _core_.ID_FILE3
216 ID_FILE4 = _core_.ID_FILE4
217 ID_FILE5 = _core_.ID_FILE5
218 ID_FILE6 = _core_.ID_FILE6
219 ID_FILE7 = _core_.ID_FILE7
220 ID_FILE8 = _core_.ID_FILE8
221 ID_FILE9 = _core_.ID_FILE9
222 ID_OK = _core_.ID_OK
223 ID_CANCEL = _core_.ID_CANCEL
224 ID_APPLY = _core_.ID_APPLY
225 ID_YES = _core_.ID_YES
226 ID_NO = _core_.ID_NO
227 ID_STATIC = _core_.ID_STATIC
228 ID_FORWARD = _core_.ID_FORWARD
229 ID_BACKWARD = _core_.ID_BACKWARD
230 ID_DEFAULT = _core_.ID_DEFAULT
231 ID_MORE = _core_.ID_MORE
232 ID_SETUP = _core_.ID_SETUP
233 ID_RESET = _core_.ID_RESET
234 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
235 ID_YESTOALL = _core_.ID_YESTOALL
236 ID_NOTOALL = _core_.ID_NOTOALL
237 ID_ABORT = _core_.ID_ABORT
238 ID_RETRY = _core_.ID_RETRY
239 ID_IGNORE = _core_.ID_IGNORE
240 ID_ADD = _core_.ID_ADD
241 ID_REMOVE = _core_.ID_REMOVE
242 ID_UP = _core_.ID_UP
243 ID_DOWN = _core_.ID_DOWN
244 ID_HOME = _core_.ID_HOME
245 ID_REFRESH = _core_.ID_REFRESH
246 ID_STOP = _core_.ID_STOP
247 ID_INDEX = _core_.ID_INDEX
248 ID_BOLD = _core_.ID_BOLD
249 ID_ITALIC = _core_.ID_ITALIC
250 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
251 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
252 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
253 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
254 ID_UNDERLINE = _core_.ID_UNDERLINE
255 ID_INDENT = _core_.ID_INDENT
256 ID_UNINDENT = _core_.ID_UNINDENT
257 ID_ZOOM_100 = _core_.ID_ZOOM_100
258 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
259 ID_ZOOM_IN = _core_.ID_ZOOM_IN
260 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
261 ID_UNDELETE = _core_.ID_UNDELETE
262 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
263 ID_HIGHEST = _core_.ID_HIGHEST
264 OPEN = _core_.OPEN
265 SAVE = _core_.SAVE
266 HIDE_READONLY = _core_.HIDE_READONLY
267 OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
268 FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
269 MULTIPLE = _core_.MULTIPLE
270 CHANGE_DIR = _core_.CHANGE_DIR
271 ACCEL_ALT = _core_.ACCEL_ALT
272 ACCEL_CTRL = _core_.ACCEL_CTRL
273 ACCEL_SHIFT = _core_.ACCEL_SHIFT
274 ACCEL_NORMAL = _core_.ACCEL_NORMAL
275 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
276 PD_APP_MODAL = _core_.PD_APP_MODAL
277 PD_CAN_ABORT = _core_.PD_CAN_ABORT
278 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
279 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
280 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
281 PD_SMOOTH = _core_.PD_SMOOTH
282 PD_CAN_SKIP = _core_.PD_CAN_SKIP
283 DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
284 DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
285 MENU_TEAROFF = _core_.MENU_TEAROFF
286 MB_DOCKABLE = _core_.MB_DOCKABLE
287 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
288 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
289 LI_HORIZONTAL = _core_.LI_HORIZONTAL
290 LI_VERTICAL = _core_.LI_VERTICAL
291 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
292 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
293 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
294 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
295 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
296 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
297 MM_TEXT = _core_.MM_TEXT
298 MM_LOMETRIC = _core_.MM_LOMETRIC
299 MM_HIMETRIC = _core_.MM_HIMETRIC
300 MM_LOENGLISH = _core_.MM_LOENGLISH
301 MM_HIENGLISH = _core_.MM_HIENGLISH
302 MM_TWIPS = _core_.MM_TWIPS
303 MM_ISOTROPIC = _core_.MM_ISOTROPIC
304 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
305 MM_POINTS = _core_.MM_POINTS
306 MM_METRIC = _core_.MM_METRIC
307 CENTRE = _core_.CENTRE
308 CENTER = _core_.CENTER
309 HORIZONTAL = _core_.HORIZONTAL
310 VERTICAL = _core_.VERTICAL
311 BOTH = _core_.BOTH
312 LEFT = _core_.LEFT
313 RIGHT = _core_.RIGHT
314 UP = _core_.UP
315 DOWN = _core_.DOWN
316 TOP = _core_.TOP
317 BOTTOM = _core_.BOTTOM
318 NORTH = _core_.NORTH
319 SOUTH = _core_.SOUTH
320 WEST = _core_.WEST
321 EAST = _core_.EAST
322 ALL = _core_.ALL
323 ALIGN_NOT = _core_.ALIGN_NOT
324 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
325 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
326 ALIGN_LEFT = _core_.ALIGN_LEFT
327 ALIGN_TOP = _core_.ALIGN_TOP
328 ALIGN_RIGHT = _core_.ALIGN_RIGHT
329 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
330 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
331 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
332 ALIGN_CENTER = _core_.ALIGN_CENTER
333 ALIGN_CENTRE = _core_.ALIGN_CENTRE
334 ALIGN_MASK = _core_.ALIGN_MASK
335 STRETCH_NOT = _core_.STRETCH_NOT
336 SHRINK = _core_.SHRINK
337 GROW = _core_.GROW
338 EXPAND = _core_.EXPAND
339 SHAPED = _core_.SHAPED
340 FIXED_MINSIZE = _core_.FIXED_MINSIZE
341 TILE = _core_.TILE
342 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
343 BORDER_DEFAULT = _core_.BORDER_DEFAULT
344 BORDER_NONE = _core_.BORDER_NONE
345 BORDER_STATIC = _core_.BORDER_STATIC
346 BORDER_SIMPLE = _core_.BORDER_SIMPLE
347 BORDER_RAISED = _core_.BORDER_RAISED
348 BORDER_SUNKEN = _core_.BORDER_SUNKEN
349 BORDER_DOUBLE = _core_.BORDER_DOUBLE
350 BORDER_MASK = _core_.BORDER_MASK
351 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
352 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
353 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
354 DEFAULT = _core_.DEFAULT
355 DECORATIVE = _core_.DECORATIVE
356 ROMAN = _core_.ROMAN
357 SCRIPT = _core_.SCRIPT
358 SWISS = _core_.SWISS
359 MODERN = _core_.MODERN
360 TELETYPE = _core_.TELETYPE
361 VARIABLE = _core_.VARIABLE
362 FIXED = _core_.FIXED
363 NORMAL = _core_.NORMAL
364 LIGHT = _core_.LIGHT
365 BOLD = _core_.BOLD
366 ITALIC = _core_.ITALIC
367 SLANT = _core_.SLANT
368 SOLID = _core_.SOLID
369 DOT = _core_.DOT
370 LONG_DASH = _core_.LONG_DASH
371 SHORT_DASH = _core_.SHORT_DASH
372 DOT_DASH = _core_.DOT_DASH
373 USER_DASH = _core_.USER_DASH
374 TRANSPARENT = _core_.TRANSPARENT
375 STIPPLE = _core_.STIPPLE
376 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
377 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
378 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
379 CROSS_HATCH = _core_.CROSS_HATCH
380 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
381 VERTICAL_HATCH = _core_.VERTICAL_HATCH
382 JOIN_BEVEL = _core_.JOIN_BEVEL
383 JOIN_MITER = _core_.JOIN_MITER
384 JOIN_ROUND = _core_.JOIN_ROUND
385 CAP_ROUND = _core_.CAP_ROUND
386 CAP_PROJECTING = _core_.CAP_PROJECTING
387 CAP_BUTT = _core_.CAP_BUTT
388 CLEAR = _core_.CLEAR
389 XOR = _core_.XOR
390 INVERT = _core_.INVERT
391 OR_REVERSE = _core_.OR_REVERSE
392 AND_REVERSE = _core_.AND_REVERSE
393 COPY = _core_.COPY
394 AND = _core_.AND
395 AND_INVERT = _core_.AND_INVERT
396 NO_OP = _core_.NO_OP
397 NOR = _core_.NOR
398 EQUIV = _core_.EQUIV
399 SRC_INVERT = _core_.SRC_INVERT
400 OR_INVERT = _core_.OR_INVERT
401 NAND = _core_.NAND
402 OR = _core_.OR
403 SET = _core_.SET
404 WXK_BACK = _core_.WXK_BACK
405 WXK_TAB = _core_.WXK_TAB
406 WXK_RETURN = _core_.WXK_RETURN
407 WXK_ESCAPE = _core_.WXK_ESCAPE
408 WXK_SPACE = _core_.WXK_SPACE
409 WXK_DELETE = _core_.WXK_DELETE
410 WXK_START = _core_.WXK_START
411 WXK_LBUTTON = _core_.WXK_LBUTTON
412 WXK_RBUTTON = _core_.WXK_RBUTTON
413 WXK_CANCEL = _core_.WXK_CANCEL
414 WXK_MBUTTON = _core_.WXK_MBUTTON
415 WXK_CLEAR = _core_.WXK_CLEAR
416 WXK_SHIFT = _core_.WXK_SHIFT
417 WXK_ALT = _core_.WXK_ALT
418 WXK_CONTROL = _core_.WXK_CONTROL
419 WXK_MENU = _core_.WXK_MENU
420 WXK_PAUSE = _core_.WXK_PAUSE
421 WXK_CAPITAL = _core_.WXK_CAPITAL
422 WXK_PRIOR = _core_.WXK_PRIOR
423 WXK_NEXT = _core_.WXK_NEXT
424 WXK_END = _core_.WXK_END
425 WXK_HOME = _core_.WXK_HOME
426 WXK_LEFT = _core_.WXK_LEFT
427 WXK_UP = _core_.WXK_UP
428 WXK_RIGHT = _core_.WXK_RIGHT
429 WXK_DOWN = _core_.WXK_DOWN
430 WXK_SELECT = _core_.WXK_SELECT
431 WXK_PRINT = _core_.WXK_PRINT
432 WXK_EXECUTE = _core_.WXK_EXECUTE
433 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
434 WXK_INSERT = _core_.WXK_INSERT
435 WXK_HELP = _core_.WXK_HELP
436 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
437 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
438 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
439 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
440 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
441 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
442 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
443 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
444 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
445 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
446 WXK_MULTIPLY = _core_.WXK_MULTIPLY
447 WXK_ADD = _core_.WXK_ADD
448 WXK_SEPARATOR = _core_.WXK_SEPARATOR
449 WXK_SUBTRACT = _core_.WXK_SUBTRACT
450 WXK_DECIMAL = _core_.WXK_DECIMAL
451 WXK_DIVIDE = _core_.WXK_DIVIDE
452 WXK_F1 = _core_.WXK_F1
453 WXK_F2 = _core_.WXK_F2
454 WXK_F3 = _core_.WXK_F3
455 WXK_F4 = _core_.WXK_F4
456 WXK_F5 = _core_.WXK_F5
457 WXK_F6 = _core_.WXK_F6
458 WXK_F7 = _core_.WXK_F7
459 WXK_F8 = _core_.WXK_F8
460 WXK_F9 = _core_.WXK_F9
461 WXK_F10 = _core_.WXK_F10
462 WXK_F11 = _core_.WXK_F11
463 WXK_F12 = _core_.WXK_F12
464 WXK_F13 = _core_.WXK_F13
465 WXK_F14 = _core_.WXK_F14
466 WXK_F15 = _core_.WXK_F15
467 WXK_F16 = _core_.WXK_F16
468 WXK_F17 = _core_.WXK_F17
469 WXK_F18 = _core_.WXK_F18
470 WXK_F19 = _core_.WXK_F19
471 WXK_F20 = _core_.WXK_F20
472 WXK_F21 = _core_.WXK_F21
473 WXK_F22 = _core_.WXK_F22
474 WXK_F23 = _core_.WXK_F23
475 WXK_F24 = _core_.WXK_F24
476 WXK_NUMLOCK = _core_.WXK_NUMLOCK
477 WXK_SCROLL = _core_.WXK_SCROLL
478 WXK_PAGEUP = _core_.WXK_PAGEUP
479 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
480 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
481 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
482 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
483 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
484 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
485 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
486 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
487 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
488 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
489 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
490 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
491 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
492 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
493 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
494 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
495 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
496 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
497 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
498 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
499 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
500 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
501 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
502 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
503 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
504 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
505 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
506 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
507 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
508 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
509 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
510 PAPER_NONE = _core_.PAPER_NONE
511 PAPER_LETTER = _core_.PAPER_LETTER
512 PAPER_LEGAL = _core_.PAPER_LEGAL
513 PAPER_A4 = _core_.PAPER_A4
514 PAPER_CSHEET = _core_.PAPER_CSHEET
515 PAPER_DSHEET = _core_.PAPER_DSHEET
516 PAPER_ESHEET = _core_.PAPER_ESHEET
517 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
518 PAPER_TABLOID = _core_.PAPER_TABLOID
519 PAPER_LEDGER = _core_.PAPER_LEDGER
520 PAPER_STATEMENT = _core_.PAPER_STATEMENT
521 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
522 PAPER_A3 = _core_.PAPER_A3
523 PAPER_A4SMALL = _core_.PAPER_A4SMALL
524 PAPER_A5 = _core_.PAPER_A5
525 PAPER_B4 = _core_.PAPER_B4
526 PAPER_B5 = _core_.PAPER_B5
527 PAPER_FOLIO = _core_.PAPER_FOLIO
528 PAPER_QUARTO = _core_.PAPER_QUARTO
529 PAPER_10X14 = _core_.PAPER_10X14
530 PAPER_11X17 = _core_.PAPER_11X17
531 PAPER_NOTE = _core_.PAPER_NOTE
532 PAPER_ENV_9 = _core_.PAPER_ENV_9
533 PAPER_ENV_10 = _core_.PAPER_ENV_10
534 PAPER_ENV_11 = _core_.PAPER_ENV_11
535 PAPER_ENV_12 = _core_.PAPER_ENV_12
536 PAPER_ENV_14 = _core_.PAPER_ENV_14
537 PAPER_ENV_DL = _core_.PAPER_ENV_DL
538 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
539 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
540 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
541 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
542 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
543 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
544 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
545 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
546 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
547 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
548 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
549 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
550 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
551 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
552 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
553 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
554 PAPER_9X11 = _core_.PAPER_9X11
555 PAPER_10X11 = _core_.PAPER_10X11
556 PAPER_15X11 = _core_.PAPER_15X11
557 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
558 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
559 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
560 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
561 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
562 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
563 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
564 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
565 PAPER_A_PLUS = _core_.PAPER_A_PLUS
566 PAPER_B_PLUS = _core_.PAPER_B_PLUS
567 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
568 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
569 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
570 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
571 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
572 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
573 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
574 PAPER_A2 = _core_.PAPER_A2
575 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
576 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
577 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
578 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
579 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
580 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
581 ITEM_NORMAL = _core_.ITEM_NORMAL
582 ITEM_CHECK = _core_.ITEM_CHECK
583 ITEM_RADIO = _core_.ITEM_RADIO
584 ITEM_MAX = _core_.ITEM_MAX
585 HT_NOWHERE = _core_.HT_NOWHERE
586 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
587 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
588 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
589 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
590 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
591 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
592 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
593 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
594 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
595 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
596 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
597 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
598 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
599 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
600 HT_MAX = _core_.HT_MAX
601 MOD_NONE = _core_.MOD_NONE
602 MOD_ALT = _core_.MOD_ALT
603 MOD_CONTROL = _core_.MOD_CONTROL
604 MOD_SHIFT = _core_.MOD_SHIFT
605 MOD_WIN = _core_.MOD_WIN
606 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
607 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
608 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
609 #---------------------------------------------------------------------------
610
611 class Object(object):
612 """
613 The base class for most wx objects, although in wxPython not
614 much functionality is needed nor exposed.
615 """
616 def __init__(self): raise RuntimeError, "No constructor defined"
617 def __repr__(self):
618 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
619 def GetClassName(*args, **kwargs):
620 """
621 GetClassName(self) -> String
622
623 Returns the class name of the C++ class using wxRTTI.
624 """
625 return _core_.Object_GetClassName(*args, **kwargs)
626
627 def Destroy(*args, **kwargs):
628 """
629 Destroy(self)
630
631 Deletes the C++ object this Python object is a proxy for.
632 """
633 return _core_.Object_Destroy(*args, **kwargs)
634
635
636 class ObjectPtr(Object):
637 def __init__(self, this):
638 self.this = this
639 if not hasattr(self,"thisown"): self.thisown = 0
640 self.__class__ = Object
641 _core_.Object_swigregister(ObjectPtr)
642 _wxPySetDictionary = _core_._wxPySetDictionary
643
644 _wxPyFixStockObjects = _core_._wxPyFixStockObjects
645
646 cvar = _core_.cvar
647 EmptyString = cvar.EmptyString
648
649 #---------------------------------------------------------------------------
650
651 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
652 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
653 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
654 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
655 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
656 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
657 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
658 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
659 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
660 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
661 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
662 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
663 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
664 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
665 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
666 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
667 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
668 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
669 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
670 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
671 CURSOR_NONE = _core_.CURSOR_NONE
672 CURSOR_ARROW = _core_.CURSOR_ARROW
673 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
674 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
675 CURSOR_CHAR = _core_.CURSOR_CHAR
676 CURSOR_CROSS = _core_.CURSOR_CROSS
677 CURSOR_HAND = _core_.CURSOR_HAND
678 CURSOR_IBEAM = _core_.CURSOR_IBEAM
679 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
680 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
681 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
682 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
683 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
684 CURSOR_PENCIL = _core_.CURSOR_PENCIL
685 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
686 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
687 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
688 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
689 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
690 CURSOR_SIZENS = _core_.CURSOR_SIZENS
691 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
692 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
693 CURSOR_SIZING = _core_.CURSOR_SIZING
694 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
695 CURSOR_WAIT = _core_.CURSOR_WAIT
696 CURSOR_WATCH = _core_.CURSOR_WATCH
697 CURSOR_BLANK = _core_.CURSOR_BLANK
698 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
699 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
700 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
701 CURSOR_MAX = _core_.CURSOR_MAX
702 #---------------------------------------------------------------------------
703
704 class Size(object):
705 """
706 wx.Size is a useful data structure used to represent the size of
707 something. It simply contians integer width and height
708 proprtites. In most places in wxPython where a wx.Size is
709 expected a (width, height) tuple can be used instead.
710 """
711 def __repr__(self):
712 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
713 width = property(_core_.Size_width_get, _core_.Size_width_set)
714 height = property(_core_.Size_height_get, _core_.Size_height_set)
715 x = width; y = height
716 def __init__(self, *args, **kwargs):
717 """
718 __init__(self, int w=0, int h=0) -> Size
719
720 Creates a size object.
721 """
722 newobj = _core_.new_Size(*args, **kwargs)
723 self.this = newobj.this
724 self.thisown = 1
725 del newobj.thisown
726 def __del__(self, destroy=_core_.delete_Size):
727 """__del__(self)"""
728 try:
729 if self.thisown: destroy(self)
730 except: pass
731
732 def __eq__(*args, **kwargs):
733 """
734 __eq__(self, Size sz) -> bool
735
736 Test for equality of wx.Size objects.
737 """
738 return _core_.Size___eq__(*args, **kwargs)
739
740 def __ne__(*args, **kwargs):
741 """
742 __ne__(self, Size sz) -> bool
743
744 Test for inequality.
745 """
746 return _core_.Size___ne__(*args, **kwargs)
747
748 def __add__(*args, **kwargs):
749 """
750 __add__(self, Size sz) -> Size
751
752 Add sz's proprties to this and return the result.
753 """
754 return _core_.Size___add__(*args, **kwargs)
755
756 def __sub__(*args, **kwargs):
757 """
758 __sub__(self, Size sz) -> Size
759
760 Subtract sz's properties from this and return the result.
761 """
762 return _core_.Size___sub__(*args, **kwargs)
763
764 def IncTo(*args, **kwargs):
765 """
766 IncTo(self, Size sz)
767
768 Increments this object so that both of its dimensions are not less
769 than the corresponding dimensions of the size.
770 """
771 return _core_.Size_IncTo(*args, **kwargs)
772
773 def DecTo(*args, **kwargs):
774 """
775 DecTo(self, Size sz)
776
777 Decrements this object so that both of its dimensions are not greater
778 than the corresponding dimensions of the size.
779 """
780 return _core_.Size_DecTo(*args, **kwargs)
781
782 def Set(*args, **kwargs):
783 """
784 Set(self, int w, int h)
785
786 Set both width and height.
787 """
788 return _core_.Size_Set(*args, **kwargs)
789
790 def SetWidth(*args, **kwargs):
791 """SetWidth(self, int w)"""
792 return _core_.Size_SetWidth(*args, **kwargs)
793
794 def SetHeight(*args, **kwargs):
795 """SetHeight(self, int h)"""
796 return _core_.Size_SetHeight(*args, **kwargs)
797
798 def GetWidth(*args, **kwargs):
799 """GetWidth(self) -> int"""
800 return _core_.Size_GetWidth(*args, **kwargs)
801
802 def GetHeight(*args, **kwargs):
803 """GetHeight(self) -> int"""
804 return _core_.Size_GetHeight(*args, **kwargs)
805
806 def IsFullySpecified(*args, **kwargs):
807 """
808 IsFullySpecified(self) -> bool
809
810 Returns True if both components of the size are non-default values.
811 """
812 return _core_.Size_IsFullySpecified(*args, **kwargs)
813
814 def SetDefaults(*args, **kwargs):
815 """
816 SetDefaults(self, Size size)
817
818 Combine this size with the other one replacing the default components
819 of this object (i.e. equal to -1) with those of the other.
820 """
821 return _core_.Size_SetDefaults(*args, **kwargs)
822
823 def Get(*args, **kwargs):
824 """
825 Get() -> (width,height)
826
827 Returns the width and height properties as a tuple.
828 """
829 return _core_.Size_Get(*args, **kwargs)
830
831 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
832 def __str__(self): return str(self.Get())
833 def __repr__(self): return 'wx.Size'+str(self.Get())
834 def __len__(self): return len(self.Get())
835 def __getitem__(self, index): return self.Get()[index]
836 def __setitem__(self, index, val):
837 if index == 0: self.width = val
838 elif index == 1: self.height = val
839 else: raise IndexError
840 def __nonzero__(self): return self.Get() != (0,0)
841 __safe_for_unpickling__ = True
842 def __reduce__(self): return (wx.Size, self.Get())
843
844
845 class SizePtr(Size):
846 def __init__(self, this):
847 self.this = this
848 if not hasattr(self,"thisown"): self.thisown = 0
849 self.__class__ = Size
850 _core_.Size_swigregister(SizePtr)
851
852 #---------------------------------------------------------------------------
853
854 class RealPoint(object):
855 """
856 A data structure for representing a point or position with floating
857 point x and y properties. In wxPython most places that expect a
858 wx.RealPoint can also accept a (x,y) tuple.
859 """
860 def __repr__(self):
861 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
862 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
863 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
864 def __init__(self, *args, **kwargs):
865 """
866 __init__(self, double x=0.0, double y=0.0) -> RealPoint
867
868 Create a wx.RealPoint object
869 """
870 newobj = _core_.new_RealPoint(*args, **kwargs)
871 self.this = newobj.this
872 self.thisown = 1
873 del newobj.thisown
874 def __del__(self, destroy=_core_.delete_RealPoint):
875 """__del__(self)"""
876 try:
877 if self.thisown: destroy(self)
878 except: pass
879
880 def __eq__(*args, **kwargs):
881 """
882 __eq__(self, RealPoint pt) -> bool
883
884 Test for equality of wx.RealPoint objects.
885 """
886 return _core_.RealPoint___eq__(*args, **kwargs)
887
888 def __ne__(*args, **kwargs):
889 """
890 __ne__(self, RealPoint pt) -> bool
891
892 Test for inequality of wx.RealPoint objects.
893 """
894 return _core_.RealPoint___ne__(*args, **kwargs)
895
896 def __add__(*args, **kwargs):
897 """
898 __add__(self, RealPoint pt) -> RealPoint
899
900 Add pt's proprties to this and return the result.
901 """
902 return _core_.RealPoint___add__(*args, **kwargs)
903
904 def __sub__(*args, **kwargs):
905 """
906 __sub__(self, RealPoint pt) -> RealPoint
907
908 Subtract pt's proprties from this and return the result
909 """
910 return _core_.RealPoint___sub__(*args, **kwargs)
911
912 def Set(*args, **kwargs):
913 """
914 Set(self, double x, double y)
915
916 Set both the x and y properties
917 """
918 return _core_.RealPoint_Set(*args, **kwargs)
919
920 def Get(*args, **kwargs):
921 """
922 Get() -> (x,y)
923
924 Return the x and y properties as a tuple.
925 """
926 return _core_.RealPoint_Get(*args, **kwargs)
927
928 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
929 def __str__(self): return str(self.Get())
930 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
931 def __len__(self): return len(self.Get())
932 def __getitem__(self, index): return self.Get()[index]
933 def __setitem__(self, index, val):
934 if index == 0: self.x = val
935 elif index == 1: self.y = val
936 else: raise IndexError
937 def __nonzero__(self): return self.Get() != (0.0, 0.0)
938 __safe_for_unpickling__ = True
939 def __reduce__(self): return (wx.RealPoint, self.Get())
940
941
942 class RealPointPtr(RealPoint):
943 def __init__(self, this):
944 self.this = this
945 if not hasattr(self,"thisown"): self.thisown = 0
946 self.__class__ = RealPoint
947 _core_.RealPoint_swigregister(RealPointPtr)
948
949 #---------------------------------------------------------------------------
950
951 class Point(object):
952 """
953 A data structure for representing a point or position with integer x
954 and y properties. Most places in wxPython that expect a wx.Point can
955 also accept a (x,y) tuple.
956 """
957 def __repr__(self):
958 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
959 x = property(_core_.Point_x_get, _core_.Point_x_set)
960 y = property(_core_.Point_y_get, _core_.Point_y_set)
961 def __init__(self, *args, **kwargs):
962 """
963 __init__(self, int x=0, int y=0) -> Point
964
965 Create a wx.Point object
966 """
967 newobj = _core_.new_Point(*args, **kwargs)
968 self.this = newobj.this
969 self.thisown = 1
970 del newobj.thisown
971 def __del__(self, destroy=_core_.delete_Point):
972 """__del__(self)"""
973 try:
974 if self.thisown: destroy(self)
975 except: pass
976
977 def __eq__(*args, **kwargs):
978 """
979 __eq__(self, Point pt) -> bool
980
981 Test for equality of wx.Point objects.
982 """
983 return _core_.Point___eq__(*args, **kwargs)
984
985 def __ne__(*args, **kwargs):
986 """
987 __ne__(self, Point pt) -> bool
988
989 Test for inequality of wx.Point objects.
990 """
991 return _core_.Point___ne__(*args, **kwargs)
992
993 def __add__(*args, **kwargs):
994 """
995 __add__(self, Point pt) -> Point
996
997 Add pt's proprties to this and return the result.
998 """
999 return _core_.Point___add__(*args, **kwargs)
1000
1001 def __sub__(*args, **kwargs):
1002 """
1003 __sub__(self, Point pt) -> Point
1004
1005 Subtract pt's proprties from this and return the result
1006 """
1007 return _core_.Point___sub__(*args, **kwargs)
1008
1009 def __iadd__(*args, **kwargs):
1010 """
1011 __iadd__(self, Point pt) -> Point
1012
1013 Add pt to this object.
1014 """
1015 return _core_.Point___iadd__(*args, **kwargs)
1016
1017 def __isub__(*args, **kwargs):
1018 """
1019 __isub__(self, Point pt) -> Point
1020
1021 Subtract pt from this object.
1022 """
1023 return _core_.Point___isub__(*args, **kwargs)
1024
1025 def Set(*args, **kwargs):
1026 """
1027 Set(self, long x, long y)
1028
1029 Set both the x and y properties
1030 """
1031 return _core_.Point_Set(*args, **kwargs)
1032
1033 def Get(*args, **kwargs):
1034 """
1035 Get() -> (x,y)
1036
1037 Return the x and y properties as a tuple.
1038 """
1039 return _core_.Point_Get(*args, **kwargs)
1040
1041 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1042 def __str__(self): return str(self.Get())
1043 def __repr__(self): return 'wx.Point'+str(self.Get())
1044 def __len__(self): return len(self.Get())
1045 def __getitem__(self, index): return self.Get()[index]
1046 def __setitem__(self, index, val):
1047 if index == 0: self.x = val
1048 elif index == 1: self.y = val
1049 else: raise IndexError
1050 def __nonzero__(self): return self.Get() != (0,0)
1051 __safe_for_unpickling__ = True
1052 def __reduce__(self): return (wx.Point, self.Get())
1053
1054
1055 class PointPtr(Point):
1056 def __init__(self, this):
1057 self.this = this
1058 if not hasattr(self,"thisown"): self.thisown = 0
1059 self.__class__ = Point
1060 _core_.Point_swigregister(PointPtr)
1061
1062 #---------------------------------------------------------------------------
1063
1064 class Rect(object):
1065 """
1066 A class for representing and manipulating rectangles. It has x, y,
1067 width and height properties. In wxPython most palces that expect a
1068 wx.Rect can also accept a (x,y,width,height) tuple.
1069 """
1070 def __repr__(self):
1071 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1072 def __init__(self, *args, **kwargs):
1073 """
1074 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1075
1076 Create a new Rect object.
1077 """
1078 newobj = _core_.new_Rect(*args, **kwargs)
1079 self.this = newobj.this
1080 self.thisown = 1
1081 del newobj.thisown
1082 def __del__(self, destroy=_core_.delete_Rect):
1083 """__del__(self)"""
1084 try:
1085 if self.thisown: destroy(self)
1086 except: pass
1087
1088 def GetX(*args, **kwargs):
1089 """GetX(self) -> int"""
1090 return _core_.Rect_GetX(*args, **kwargs)
1091
1092 def SetX(*args, **kwargs):
1093 """SetX(self, int x)"""
1094 return _core_.Rect_SetX(*args, **kwargs)
1095
1096 def GetY(*args, **kwargs):
1097 """GetY(self) -> int"""
1098 return _core_.Rect_GetY(*args, **kwargs)
1099
1100 def SetY(*args, **kwargs):
1101 """SetY(self, int y)"""
1102 return _core_.Rect_SetY(*args, **kwargs)
1103
1104 def GetWidth(*args, **kwargs):
1105 """GetWidth(self) -> int"""
1106 return _core_.Rect_GetWidth(*args, **kwargs)
1107
1108 def SetWidth(*args, **kwargs):
1109 """SetWidth(self, int w)"""
1110 return _core_.Rect_SetWidth(*args, **kwargs)
1111
1112 def GetHeight(*args, **kwargs):
1113 """GetHeight(self) -> int"""
1114 return _core_.Rect_GetHeight(*args, **kwargs)
1115
1116 def SetHeight(*args, **kwargs):
1117 """SetHeight(self, int h)"""
1118 return _core_.Rect_SetHeight(*args, **kwargs)
1119
1120 def GetPosition(*args, **kwargs):
1121 """GetPosition(self) -> Point"""
1122 return _core_.Rect_GetPosition(*args, **kwargs)
1123
1124 def SetPosition(*args, **kwargs):
1125 """SetPosition(self, Point p)"""
1126 return _core_.Rect_SetPosition(*args, **kwargs)
1127
1128 def GetSize(*args, **kwargs):
1129 """GetSize(self) -> Size"""
1130 return _core_.Rect_GetSize(*args, **kwargs)
1131
1132 def SetSize(*args, **kwargs):
1133 """SetSize(self, Size s)"""
1134 return _core_.Rect_SetSize(*args, **kwargs)
1135
1136 def GetTopLeft(*args, **kwargs):
1137 """GetTopLeft(self) -> Point"""
1138 return _core_.Rect_GetTopLeft(*args, **kwargs)
1139
1140 def SetTopLeft(*args, **kwargs):
1141 """SetTopLeft(self, Point p)"""
1142 return _core_.Rect_SetTopLeft(*args, **kwargs)
1143
1144 def GetBottomRight(*args, **kwargs):
1145 """GetBottomRight(self) -> Point"""
1146 return _core_.Rect_GetBottomRight(*args, **kwargs)
1147
1148 def SetBottomRight(*args, **kwargs):
1149 """SetBottomRight(self, Point p)"""
1150 return _core_.Rect_SetBottomRight(*args, **kwargs)
1151
1152 def GetLeft(*args, **kwargs):
1153 """GetLeft(self) -> int"""
1154 return _core_.Rect_GetLeft(*args, **kwargs)
1155
1156 def GetTop(*args, **kwargs):
1157 """GetTop(self) -> int"""
1158 return _core_.Rect_GetTop(*args, **kwargs)
1159
1160 def GetBottom(*args, **kwargs):
1161 """GetBottom(self) -> int"""
1162 return _core_.Rect_GetBottom(*args, **kwargs)
1163
1164 def GetRight(*args, **kwargs):
1165 """GetRight(self) -> int"""
1166 return _core_.Rect_GetRight(*args, **kwargs)
1167
1168 def SetLeft(*args, **kwargs):
1169 """SetLeft(self, int left)"""
1170 return _core_.Rect_SetLeft(*args, **kwargs)
1171
1172 def SetRight(*args, **kwargs):
1173 """SetRight(self, int right)"""
1174 return _core_.Rect_SetRight(*args, **kwargs)
1175
1176 def SetTop(*args, **kwargs):
1177 """SetTop(self, int top)"""
1178 return _core_.Rect_SetTop(*args, **kwargs)
1179
1180 def SetBottom(*args, **kwargs):
1181 """SetBottom(self, int bottom)"""
1182 return _core_.Rect_SetBottom(*args, **kwargs)
1183
1184 position = property(GetPosition, SetPosition)
1185 size = property(GetSize, SetSize)
1186 left = property(GetLeft, SetLeft)
1187 right = property(GetRight, SetRight)
1188 top = property(GetTop, SetTop)
1189 bottom = property(GetBottom, SetBottom)
1190
1191 def Inflate(*args, **kwargs):
1192 """
1193 Inflate(self, int dx, int dy) -> Rect
1194
1195 Increase the rectangle size by dx in x direction and dy in y
1196 direction. Both (or one of) parameters may be negative to decrease the
1197 rectangle size.
1198 """
1199 return _core_.Rect_Inflate(*args, **kwargs)
1200
1201 def Deflate(*args, **kwargs):
1202 """
1203 Deflate(self, int dx, int dy) -> Rect
1204
1205 Decrease the rectangle size by dx in x direction and dy in y
1206 direction. Both (or one of) parameters may be negative to increase the
1207 rectngle size. This method is the opposite of Inflate.
1208 """
1209 return _core_.Rect_Deflate(*args, **kwargs)
1210
1211 def OffsetXY(*args, **kwargs):
1212 """
1213 OffsetXY(self, int dx, int dy)
1214
1215 Moves the rectangle by the specified offset. If dx is positive, the
1216 rectangle is moved to the right, if dy is positive, it is moved to the
1217 bottom, otherwise it is moved to the left or top respectively.
1218 """
1219 return _core_.Rect_OffsetXY(*args, **kwargs)
1220
1221 def Offset(*args, **kwargs):
1222 """
1223 Offset(self, Point pt)
1224
1225 Same as OffsetXY but uses dx,dy from Point
1226 """
1227 return _core_.Rect_Offset(*args, **kwargs)
1228
1229 def Intersect(*args, **kwargs):
1230 """
1231 Intersect(self, Rect rect) -> Rect
1232
1233 Returns the intersectsion of this rectangle and rect.
1234 """
1235 return _core_.Rect_Intersect(*args, **kwargs)
1236
1237 def Union(*args, **kwargs):
1238 """
1239 Union(self, Rect rect) -> Rect
1240
1241 Returns the union of this rectangle and rect.
1242 """
1243 return _core_.Rect_Union(*args, **kwargs)
1244
1245 def __add__(*args, **kwargs):
1246 """
1247 __add__(self, Rect rect) -> Rect
1248
1249 Add the properties of rect to this rectangle and return the result.
1250 """
1251 return _core_.Rect___add__(*args, **kwargs)
1252
1253 def __iadd__(*args, **kwargs):
1254 """
1255 __iadd__(self, Rect rect) -> Rect
1256
1257 Add the properties of rect to this rectangle, updating this rectangle.
1258 """
1259 return _core_.Rect___iadd__(*args, **kwargs)
1260
1261 def __eq__(*args, **kwargs):
1262 """
1263 __eq__(self, Rect rect) -> bool
1264
1265 Test for equality.
1266 """
1267 return _core_.Rect___eq__(*args, **kwargs)
1268
1269 def __ne__(*args, **kwargs):
1270 """
1271 __ne__(self, Rect rect) -> bool
1272
1273 Test for inequality.
1274 """
1275 return _core_.Rect___ne__(*args, **kwargs)
1276
1277 def InsideXY(*args, **kwargs):
1278 """
1279 InsideXY(self, int x, int y) -> bool
1280
1281 Return True if the point is (not strcitly) inside the rect.
1282 """
1283 return _core_.Rect_InsideXY(*args, **kwargs)
1284
1285 def Inside(*args, **kwargs):
1286 """
1287 Inside(self, Point pt) -> bool
1288
1289 Return True if the point is (not strcitly) inside the rect.
1290 """
1291 return _core_.Rect_Inside(*args, **kwargs)
1292
1293 def Intersects(*args, **kwargs):
1294 """
1295 Intersects(self, Rect rect) -> bool
1296
1297 Returns True if the rectangles have a non empty intersection.
1298 """
1299 return _core_.Rect_Intersects(*args, **kwargs)
1300
1301 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1302 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1303 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1304 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1305 def Set(*args, **kwargs):
1306 """
1307 Set(self, int x=0, int y=0, int width=0, int height=0)
1308
1309 Set all rectangle properties.
1310 """
1311 return _core_.Rect_Set(*args, **kwargs)
1312
1313 def Get(*args, **kwargs):
1314 """
1315 Get() -> (x,y,width,height)
1316
1317 Return the rectangle properties as a tuple.
1318 """
1319 return _core_.Rect_Get(*args, **kwargs)
1320
1321 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1322 def __str__(self): return str(self.Get())
1323 def __repr__(self): return 'wx.Rect'+str(self.Get())
1324 def __len__(self): return len(self.Get())
1325 def __getitem__(self, index): return self.Get()[index]
1326 def __setitem__(self, index, val):
1327 if index == 0: self.x = val
1328 elif index == 1: self.y = val
1329 elif index == 2: self.width = val
1330 elif index == 3: self.height = val
1331 else: raise IndexError
1332 def __nonzero__(self): return self.Get() != (0,0,0,0)
1333 __safe_for_unpickling__ = True
1334 def __reduce__(self): return (wx.Rect, self.Get())
1335
1336
1337 class RectPtr(Rect):
1338 def __init__(self, this):
1339 self.this = this
1340 if not hasattr(self,"thisown"): self.thisown = 0
1341 self.__class__ = Rect
1342 _core_.Rect_swigregister(RectPtr)
1343
1344 def RectPP(*args, **kwargs):
1345 """
1346 RectPP(Point topLeft, Point bottomRight) -> Rect
1347
1348 Create a new Rect object from Points representing two corners.
1349 """
1350 val = _core_.new_RectPP(*args, **kwargs)
1351 val.thisown = 1
1352 return val
1353
1354 def RectPS(*args, **kwargs):
1355 """
1356 RectPS(Point pos, Size size) -> Rect
1357
1358 Create a new Rect from a position and size.
1359 """
1360 val = _core_.new_RectPS(*args, **kwargs)
1361 val.thisown = 1
1362 return val
1363
1364 def RectS(*args, **kwargs):
1365 """
1366 RectS(Size size) -> Rect
1367
1368 Create a new Rect from a size only.
1369 """
1370 val = _core_.new_RectS(*args, **kwargs)
1371 val.thisown = 1
1372 return val
1373
1374
1375 def IntersectRect(*args, **kwargs):
1376 """
1377 IntersectRect(Rect r1, Rect r2) -> Rect
1378
1379 Calculate and return the intersection of r1 and r2.
1380 """
1381 return _core_.IntersectRect(*args, **kwargs)
1382 #---------------------------------------------------------------------------
1383
1384 class Point2D(object):
1385 """
1386 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1387 with floating point values.
1388 """
1389 def __repr__(self):
1390 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1391 def __init__(self, *args, **kwargs):
1392 """
1393 __init__(self, double x=0.0, double y=0.0) -> Point2D
1394
1395 Create a w.Point2D object.
1396 """
1397 newobj = _core_.new_Point2D(*args, **kwargs)
1398 self.this = newobj.this
1399 self.thisown = 1
1400 del newobj.thisown
1401 def GetFloor(*args, **kwargs):
1402 """
1403 GetFloor() -> (x,y)
1404
1405 Convert to integer
1406 """
1407 return _core_.Point2D_GetFloor(*args, **kwargs)
1408
1409 def GetRounded(*args, **kwargs):
1410 """
1411 GetRounded() -> (x,y)
1412
1413 Convert to integer
1414 """
1415 return _core_.Point2D_GetRounded(*args, **kwargs)
1416
1417 def GetVectorLength(*args, **kwargs):
1418 """GetVectorLength(self) -> double"""
1419 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1420
1421 def GetVectorAngle(*args, **kwargs):
1422 """GetVectorAngle(self) -> double"""
1423 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1424
1425 def SetVectorLength(*args, **kwargs):
1426 """SetVectorLength(self, double length)"""
1427 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1428
1429 def SetVectorAngle(*args, **kwargs):
1430 """SetVectorAngle(self, double degrees)"""
1431 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1432
1433 def SetPolarCoordinates(self, angle, length):
1434 self.SetVectorLength(length)
1435 self.SetVectorAngle(angle)
1436 def Normalize(self):
1437 self.SetVectorLength(1.0)
1438
1439 def GetDistance(*args, **kwargs):
1440 """GetDistance(self, Point2D pt) -> double"""
1441 return _core_.Point2D_GetDistance(*args, **kwargs)
1442
1443 def GetDistanceSquare(*args, **kwargs):
1444 """GetDistanceSquare(self, Point2D pt) -> double"""
1445 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1446
1447 def GetDotProduct(*args, **kwargs):
1448 """GetDotProduct(self, Point2D vec) -> double"""
1449 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1450
1451 def GetCrossProduct(*args, **kwargs):
1452 """GetCrossProduct(self, Point2D vec) -> double"""
1453 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1454
1455 def __neg__(*args, **kwargs):
1456 """
1457 __neg__(self) -> Point2D
1458
1459 the reflection of this point
1460 """
1461 return _core_.Point2D___neg__(*args, **kwargs)
1462
1463 def __iadd__(*args, **kwargs):
1464 """__iadd__(self, Point2D pt) -> Point2D"""
1465 return _core_.Point2D___iadd__(*args, **kwargs)
1466
1467 def __isub__(*args, **kwargs):
1468 """__isub__(self, Point2D pt) -> Point2D"""
1469 return _core_.Point2D___isub__(*args, **kwargs)
1470
1471 def __imul__(*args, **kwargs):
1472 """__imul__(self, Point2D pt) -> Point2D"""
1473 return _core_.Point2D___imul__(*args, **kwargs)
1474
1475 def __idiv__(*args, **kwargs):
1476 """__idiv__(self, Point2D pt) -> Point2D"""
1477 return _core_.Point2D___idiv__(*args, **kwargs)
1478
1479 def __eq__(*args, **kwargs):
1480 """
1481 __eq__(self, Point2D pt) -> bool
1482
1483 Test for equality
1484 """
1485 return _core_.Point2D___eq__(*args, **kwargs)
1486
1487 def __ne__(*args, **kwargs):
1488 """
1489 __ne__(self, Point2D pt) -> bool
1490
1491 Test for inequality
1492 """
1493 return _core_.Point2D___ne__(*args, **kwargs)
1494
1495 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1496 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1497 def Set(*args, **kwargs):
1498 """Set(self, double x=0, double y=0)"""
1499 return _core_.Point2D_Set(*args, **kwargs)
1500
1501 def Get(*args, **kwargs):
1502 """
1503 Get() -> (x,y)
1504
1505 Return x and y properties as a tuple.
1506 """
1507 return _core_.Point2D_Get(*args, **kwargs)
1508
1509 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1510 def __str__(self): return str(self.Get())
1511 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1512 def __len__(self): return len(self.Get())
1513 def __getitem__(self, index): return self.Get()[index]
1514 def __setitem__(self, index, val):
1515 if index == 0: self.x = val
1516 elif index == 1: self.y = val
1517 else: raise IndexError
1518 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1519 __safe_for_unpickling__ = True
1520 def __reduce__(self): return (wx.Point2D, self.Get())
1521
1522
1523 class Point2DPtr(Point2D):
1524 def __init__(self, this):
1525 self.this = this
1526 if not hasattr(self,"thisown"): self.thisown = 0
1527 self.__class__ = Point2D
1528 _core_.Point2D_swigregister(Point2DPtr)
1529
1530 def Point2DCopy(*args, **kwargs):
1531 """
1532 Point2DCopy(Point2D pt) -> Point2D
1533
1534 Create a w.Point2D object.
1535 """
1536 val = _core_.new_Point2DCopy(*args, **kwargs)
1537 val.thisown = 1
1538 return val
1539
1540 def Point2DFromPoint(*args, **kwargs):
1541 """
1542 Point2DFromPoint(Point pt) -> Point2D
1543
1544 Create a w.Point2D object.
1545 """
1546 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1547 val.thisown = 1
1548 return val
1549
1550 #---------------------------------------------------------------------------
1551
1552 FromStart = _core_.FromStart
1553 FromCurrent = _core_.FromCurrent
1554 FromEnd = _core_.FromEnd
1555 class InputStream(object):
1556 """Proxy of C++ InputStream class"""
1557 def __repr__(self):
1558 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1559 def __init__(self, *args, **kwargs):
1560 """__init__(self, PyObject p) -> InputStream"""
1561 newobj = _core_.new_InputStream(*args, **kwargs)
1562 self.this = newobj.this
1563 self.thisown = 1
1564 del newobj.thisown
1565 def __del__(self, destroy=_core_.delete_InputStream):
1566 """__del__(self)"""
1567 try:
1568 if self.thisown: destroy(self)
1569 except: pass
1570
1571 def close(*args, **kwargs):
1572 """close(self)"""
1573 return _core_.InputStream_close(*args, **kwargs)
1574
1575 def flush(*args, **kwargs):
1576 """flush(self)"""
1577 return _core_.InputStream_flush(*args, **kwargs)
1578
1579 def eof(*args, **kwargs):
1580 """eof(self) -> bool"""
1581 return _core_.InputStream_eof(*args, **kwargs)
1582
1583 def read(*args, **kwargs):
1584 """read(self, int size=-1) -> PyObject"""
1585 return _core_.InputStream_read(*args, **kwargs)
1586
1587 def readline(*args, **kwargs):
1588 """readline(self, int size=-1) -> PyObject"""
1589 return _core_.InputStream_readline(*args, **kwargs)
1590
1591 def readlines(*args, **kwargs):
1592 """readlines(self, int sizehint=-1) -> PyObject"""
1593 return _core_.InputStream_readlines(*args, **kwargs)
1594
1595 def seek(*args, **kwargs):
1596 """seek(self, int offset, int whence=0)"""
1597 return _core_.InputStream_seek(*args, **kwargs)
1598
1599 def tell(*args, **kwargs):
1600 """tell(self) -> int"""
1601 return _core_.InputStream_tell(*args, **kwargs)
1602
1603 def Peek(*args, **kwargs):
1604 """Peek(self) -> char"""
1605 return _core_.InputStream_Peek(*args, **kwargs)
1606
1607 def GetC(*args, **kwargs):
1608 """GetC(self) -> char"""
1609 return _core_.InputStream_GetC(*args, **kwargs)
1610
1611 def LastRead(*args, **kwargs):
1612 """LastRead(self) -> size_t"""
1613 return _core_.InputStream_LastRead(*args, **kwargs)
1614
1615 def CanRead(*args, **kwargs):
1616 """CanRead(self) -> bool"""
1617 return _core_.InputStream_CanRead(*args, **kwargs)
1618
1619 def Eof(*args, **kwargs):
1620 """Eof(self) -> bool"""
1621 return _core_.InputStream_Eof(*args, **kwargs)
1622
1623 def Ungetch(*args, **kwargs):
1624 """Ungetch(self, char c) -> bool"""
1625 return _core_.InputStream_Ungetch(*args, **kwargs)
1626
1627 def SeekI(*args, **kwargs):
1628 """SeekI(self, long pos, int mode=FromStart) -> long"""
1629 return _core_.InputStream_SeekI(*args, **kwargs)
1630
1631 def TellI(*args, **kwargs):
1632 """TellI(self) -> long"""
1633 return _core_.InputStream_TellI(*args, **kwargs)
1634
1635
1636 class InputStreamPtr(InputStream):
1637 def __init__(self, this):
1638 self.this = this
1639 if not hasattr(self,"thisown"): self.thisown = 0
1640 self.__class__ = InputStream
1641 _core_.InputStream_swigregister(InputStreamPtr)
1642 DefaultPosition = cvar.DefaultPosition
1643 DefaultSize = cvar.DefaultSize
1644
1645 class OutputStream(object):
1646 """Proxy of C++ OutputStream class"""
1647 def __init__(self): raise RuntimeError, "No constructor defined"
1648 def __repr__(self):
1649 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1650 def write(*args, **kwargs):
1651 """write(self, PyObject obj)"""
1652 return _core_.OutputStream_write(*args, **kwargs)
1653
1654
1655 class OutputStreamPtr(OutputStream):
1656 def __init__(self, this):
1657 self.this = this
1658 if not hasattr(self,"thisown"): self.thisown = 0
1659 self.__class__ = OutputStream
1660 _core_.OutputStream_swigregister(OutputStreamPtr)
1661
1662 #---------------------------------------------------------------------------
1663
1664 class FSFile(Object):
1665 """Proxy of C++ FSFile class"""
1666 def __repr__(self):
1667 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1668 def __init__(self, *args, **kwargs):
1669 """
1670 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1671 DateTime modif) -> FSFile
1672 """
1673 newobj = _core_.new_FSFile(*args, **kwargs)
1674 self.this = newobj.this
1675 self.thisown = 1
1676 del newobj.thisown
1677 self.thisown = 0 # It will normally be deleted by the user of the wxFileSystem
1678
1679 def __del__(self, destroy=_core_.delete_FSFile):
1680 """__del__(self)"""
1681 try:
1682 if self.thisown: destroy(self)
1683 except: pass
1684
1685 def GetStream(*args, **kwargs):
1686 """GetStream(self) -> InputStream"""
1687 return _core_.FSFile_GetStream(*args, **kwargs)
1688
1689 def GetMimeType(*args, **kwargs):
1690 """GetMimeType(self) -> String"""
1691 return _core_.FSFile_GetMimeType(*args, **kwargs)
1692
1693 def GetLocation(*args, **kwargs):
1694 """GetLocation(self) -> String"""
1695 return _core_.FSFile_GetLocation(*args, **kwargs)
1696
1697 def GetAnchor(*args, **kwargs):
1698 """GetAnchor(self) -> String"""
1699 return _core_.FSFile_GetAnchor(*args, **kwargs)
1700
1701 def GetModificationTime(*args, **kwargs):
1702 """GetModificationTime(self) -> DateTime"""
1703 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1704
1705
1706 class FSFilePtr(FSFile):
1707 def __init__(self, this):
1708 self.this = this
1709 if not hasattr(self,"thisown"): self.thisown = 0
1710 self.__class__ = FSFile
1711 _core_.FSFile_swigregister(FSFilePtr)
1712
1713 class CPPFileSystemHandler(object):
1714 """Proxy of C++ CPPFileSystemHandler class"""
1715 def __init__(self): raise RuntimeError, "No constructor defined"
1716 def __repr__(self):
1717 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1718
1719 class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1720 def __init__(self, this):
1721 self.this = this
1722 if not hasattr(self,"thisown"): self.thisown = 0
1723 self.__class__ = CPPFileSystemHandler
1724 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1725
1726 class FileSystemHandler(CPPFileSystemHandler):
1727 """Proxy of C++ FileSystemHandler class"""
1728 def __repr__(self):
1729 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1730 def __init__(self, *args, **kwargs):
1731 """__init__(self) -> FileSystemHandler"""
1732 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1733 self.this = newobj.this
1734 self.thisown = 1
1735 del newobj.thisown
1736 self._setCallbackInfo(self, FileSystemHandler)
1737
1738 def _setCallbackInfo(*args, **kwargs):
1739 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1740 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1741
1742 def CanOpen(*args, **kwargs):
1743 """CanOpen(self, String location) -> bool"""
1744 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1745
1746 def OpenFile(*args, **kwargs):
1747 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1748 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1749
1750 def FindFirst(*args, **kwargs):
1751 """FindFirst(self, String spec, int flags=0) -> String"""
1752 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1753
1754 def FindNext(*args, **kwargs):
1755 """FindNext(self) -> String"""
1756 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1757
1758 def GetProtocol(*args, **kwargs):
1759 """GetProtocol(self, String location) -> String"""
1760 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1761
1762 def GetLeftLocation(*args, **kwargs):
1763 """GetLeftLocation(self, String location) -> String"""
1764 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1765
1766 def GetAnchor(*args, **kwargs):
1767 """GetAnchor(self, String location) -> String"""
1768 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1769
1770 def GetRightLocation(*args, **kwargs):
1771 """GetRightLocation(self, String location) -> String"""
1772 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1773
1774 def GetMimeTypeFromExt(*args, **kwargs):
1775 """GetMimeTypeFromExt(self, String location) -> String"""
1776 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1777
1778
1779 class FileSystemHandlerPtr(FileSystemHandler):
1780 def __init__(self, this):
1781 self.this = this
1782 if not hasattr(self,"thisown"): self.thisown = 0
1783 self.__class__ = FileSystemHandler
1784 _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1785
1786 class FileSystem(Object):
1787 """Proxy of C++ FileSystem class"""
1788 def __repr__(self):
1789 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1790 def __init__(self, *args, **kwargs):
1791 """__init__(self) -> FileSystem"""
1792 newobj = _core_.new_FileSystem(*args, **kwargs)
1793 self.this = newobj.this
1794 self.thisown = 1
1795 del newobj.thisown
1796 def __del__(self, destroy=_core_.delete_FileSystem):
1797 """__del__(self)"""
1798 try:
1799 if self.thisown: destroy(self)
1800 except: pass
1801
1802 def ChangePathTo(*args, **kwargs):
1803 """ChangePathTo(self, String location, bool is_dir=False)"""
1804 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1805
1806 def GetPath(*args, **kwargs):
1807 """GetPath(self) -> String"""
1808 return _core_.FileSystem_GetPath(*args, **kwargs)
1809
1810 def OpenFile(*args, **kwargs):
1811 """OpenFile(self, String location) -> FSFile"""
1812 return _core_.FileSystem_OpenFile(*args, **kwargs)
1813
1814 def FindFirst(*args, **kwargs):
1815 """FindFirst(self, String spec, int flags=0) -> String"""
1816 return _core_.FileSystem_FindFirst(*args, **kwargs)
1817
1818 def FindNext(*args, **kwargs):
1819 """FindNext(self) -> String"""
1820 return _core_.FileSystem_FindNext(*args, **kwargs)
1821
1822 def AddHandler(*args, **kwargs):
1823 """AddHandler(CPPFileSystemHandler handler)"""
1824 return _core_.FileSystem_AddHandler(*args, **kwargs)
1825
1826 AddHandler = staticmethod(AddHandler)
1827 def CleanUpHandlers(*args, **kwargs):
1828 """CleanUpHandlers()"""
1829 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1830
1831 CleanUpHandlers = staticmethod(CleanUpHandlers)
1832 def FileNameToURL(*args, **kwargs):
1833 """FileNameToURL(String filename) -> String"""
1834 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1835
1836 FileNameToURL = staticmethod(FileNameToURL)
1837 def URLToFileName(*args, **kwargs):
1838 """URLToFileName(String url) -> String"""
1839 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1840
1841 URLToFileName = staticmethod(URLToFileName)
1842
1843 class FileSystemPtr(FileSystem):
1844 def __init__(self, this):
1845 self.this = this
1846 if not hasattr(self,"thisown"): self.thisown = 0
1847 self.__class__ = FileSystem
1848 _core_.FileSystem_swigregister(FileSystemPtr)
1849
1850 def FileSystem_AddHandler(*args, **kwargs):
1851 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1852 return _core_.FileSystem_AddHandler(*args, **kwargs)
1853
1854 def FileSystem_CleanUpHandlers(*args, **kwargs):
1855 """FileSystem_CleanUpHandlers()"""
1856 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1857
1858 def FileSystem_FileNameToURL(*args, **kwargs):
1859 """FileSystem_FileNameToURL(String filename) -> String"""
1860 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1861
1862 def FileSystem_URLToFileName(*args, **kwargs):
1863 """FileSystem_URLToFileName(String url) -> String"""
1864 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1865
1866 class InternetFSHandler(CPPFileSystemHandler):
1867 """Proxy of C++ InternetFSHandler class"""
1868 def __repr__(self):
1869 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1870 def __init__(self, *args, **kwargs):
1871 """__init__(self) -> InternetFSHandler"""
1872 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1873 self.this = newobj.this
1874 self.thisown = 1
1875 del newobj.thisown
1876 def CanOpen(*args, **kwargs):
1877 """CanOpen(self, String location) -> bool"""
1878 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1879
1880 def OpenFile(*args, **kwargs):
1881 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1882 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1883
1884
1885 class InternetFSHandlerPtr(InternetFSHandler):
1886 def __init__(self, this):
1887 self.this = this
1888 if not hasattr(self,"thisown"): self.thisown = 0
1889 self.__class__ = InternetFSHandler
1890 _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1891
1892 class ZipFSHandler(CPPFileSystemHandler):
1893 """Proxy of C++ ZipFSHandler class"""
1894 def __repr__(self):
1895 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1896 def __init__(self, *args, **kwargs):
1897 """__init__(self) -> ZipFSHandler"""
1898 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1899 self.this = newobj.this
1900 self.thisown = 1
1901 del newobj.thisown
1902 def CanOpen(*args, **kwargs):
1903 """CanOpen(self, String location) -> bool"""
1904 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1905
1906 def OpenFile(*args, **kwargs):
1907 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1908 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1909
1910 def FindFirst(*args, **kwargs):
1911 """FindFirst(self, String spec, int flags=0) -> String"""
1912 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1913
1914 def FindNext(*args, **kwargs):
1915 """FindNext(self) -> String"""
1916 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1917
1918
1919 class ZipFSHandlerPtr(ZipFSHandler):
1920 def __init__(self, this):
1921 self.this = this
1922 if not hasattr(self,"thisown"): self.thisown = 0
1923 self.__class__ = ZipFSHandler
1924 _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
1925
1926
1927 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1928 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1929 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1930
1931 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1932 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1933 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1934
1935 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1936 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1937 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1938 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1939 """
1940 Add 'file' to the memory filesystem. The dataItem parameter can
1941 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1942 arbitrary data. If a bitmap or image is used then the imgType
1943 parameter should specify what kind of image file it should be
1944 written as, wx.BITMAP_TYPE_PNG, etc.
1945 """
1946 if isinstance(dataItem, wx.Image):
1947 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1948 elif isinstance(dataItem, wx.Bitmap):
1949 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1950 elif type(dataItem) == str:
1951 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1952 else:
1953 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1954
1955 class MemoryFSHandler(CPPFileSystemHandler):
1956 """Proxy of C++ MemoryFSHandler class"""
1957 def __repr__(self):
1958 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1959 def __init__(self, *args, **kwargs):
1960 """__init__(self) -> MemoryFSHandler"""
1961 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
1962 self.this = newobj.this
1963 self.thisown = 1
1964 del newobj.thisown
1965 def RemoveFile(*args, **kwargs):
1966 """RemoveFile(String filename)"""
1967 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1968
1969 RemoveFile = staticmethod(RemoveFile)
1970 AddFile = staticmethod(MemoryFSHandler_AddFile)
1971 def CanOpen(*args, **kwargs):
1972 """CanOpen(self, String location) -> bool"""
1973 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1974
1975 def OpenFile(*args, **kwargs):
1976 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1977 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1978
1979 def FindFirst(*args, **kwargs):
1980 """FindFirst(self, String spec, int flags=0) -> String"""
1981 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1982
1983 def FindNext(*args, **kwargs):
1984 """FindNext(self) -> String"""
1985 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1986
1987
1988 class MemoryFSHandlerPtr(MemoryFSHandler):
1989 def __init__(self, this):
1990 self.this = this
1991 if not hasattr(self,"thisown"): self.thisown = 0
1992 self.__class__ = MemoryFSHandler
1993 _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
1994
1995 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1996 """MemoryFSHandler_RemoveFile(String filename)"""
1997 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1998
1999 #---------------------------------------------------------------------------
2000
2001 class ImageHandler(Object):
2002 """Proxy of C++ ImageHandler class"""
2003 def __init__(self): raise RuntimeError, "No constructor defined"
2004 def __repr__(self):
2005 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2006 def GetName(*args, **kwargs):
2007 """GetName(self) -> String"""
2008 return _core_.ImageHandler_GetName(*args, **kwargs)
2009
2010 def GetExtension(*args, **kwargs):
2011 """GetExtension(self) -> String"""
2012 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2013
2014 def GetType(*args, **kwargs):
2015 """GetType(self) -> long"""
2016 return _core_.ImageHandler_GetType(*args, **kwargs)
2017
2018 def GetMimeType(*args, **kwargs):
2019 """GetMimeType(self) -> String"""
2020 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2021
2022 def CanRead(*args, **kwargs):
2023 """CanRead(self, String name) -> bool"""
2024 return _core_.ImageHandler_CanRead(*args, **kwargs)
2025
2026 def SetName(*args, **kwargs):
2027 """SetName(self, String name)"""
2028 return _core_.ImageHandler_SetName(*args, **kwargs)
2029
2030 def SetExtension(*args, **kwargs):
2031 """SetExtension(self, String extension)"""
2032 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2033
2034 def SetType(*args, **kwargs):
2035 """SetType(self, long type)"""
2036 return _core_.ImageHandler_SetType(*args, **kwargs)
2037
2038 def SetMimeType(*args, **kwargs):
2039 """SetMimeType(self, String mimetype)"""
2040 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2041
2042
2043 class ImageHandlerPtr(ImageHandler):
2044 def __init__(self, this):
2045 self.this = this
2046 if not hasattr(self,"thisown"): self.thisown = 0
2047 self.__class__ = ImageHandler
2048 _core_.ImageHandler_swigregister(ImageHandlerPtr)
2049
2050 class ImageHistogram(object):
2051 """Proxy of C++ ImageHistogram class"""
2052 def __repr__(self):
2053 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2054 def __init__(self, *args, **kwargs):
2055 """__init__(self) -> ImageHistogram"""
2056 newobj = _core_.new_ImageHistogram(*args, **kwargs)
2057 self.this = newobj.this
2058 self.thisown = 1
2059 del newobj.thisown
2060 def MakeKey(*args, **kwargs):
2061 """
2062 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2063
2064 Get the key in the histogram for the given RGB values
2065 """
2066 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2067
2068 MakeKey = staticmethod(MakeKey)
2069 def FindFirstUnusedColour(*args, **kwargs):
2070 """
2071 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2072
2073 Find first colour that is not used in the image and has higher RGB
2074 values than startR, startG, startB. Returns a tuple consisting of a
2075 success flag and rgb values.
2076 """
2077 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2078
2079
2080 class ImageHistogramPtr(ImageHistogram):
2081 def __init__(self, this):
2082 self.this = this
2083 if not hasattr(self,"thisown"): self.thisown = 0
2084 self.__class__ = ImageHistogram
2085 _core_.ImageHistogram_swigregister(ImageHistogramPtr)
2086
2087 def ImageHistogram_MakeKey(*args, **kwargs):
2088 """
2089 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2090
2091 Get the key in the histogram for the given RGB values
2092 """
2093 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2094
2095 class Image(Object):
2096 """Proxy of C++ Image class"""
2097 def __repr__(self):
2098 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2099 def __init__(self, *args, **kwargs):
2100 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2101 newobj = _core_.new_Image(*args, **kwargs)
2102 self.this = newobj.this
2103 self.thisown = 1
2104 del newobj.thisown
2105 def __del__(self, destroy=_core_.delete_Image):
2106 """__del__(self)"""
2107 try:
2108 if self.thisown: destroy(self)
2109 except: pass
2110
2111 def Create(*args, **kwargs):
2112 """Create(self, int width, int height)"""
2113 return _core_.Image_Create(*args, **kwargs)
2114
2115 def Destroy(*args, **kwargs):
2116 """
2117 Destroy(self)
2118
2119 Deletes the C++ object this Python object is a proxy for.
2120 """
2121 return _core_.Image_Destroy(*args, **kwargs)
2122
2123 def Scale(*args, **kwargs):
2124 """Scale(self, int width, int height) -> Image"""
2125 return _core_.Image_Scale(*args, **kwargs)
2126
2127 def ShrinkBy(*args, **kwargs):
2128 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
2129 return _core_.Image_ShrinkBy(*args, **kwargs)
2130
2131 def Rescale(*args, **kwargs):
2132 """Rescale(self, int width, int height) -> Image"""
2133 return _core_.Image_Rescale(*args, **kwargs)
2134
2135 def SetRGB(*args, **kwargs):
2136 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
2137 return _core_.Image_SetRGB(*args, **kwargs)
2138
2139 def GetRed(*args, **kwargs):
2140 """GetRed(self, int x, int y) -> unsigned char"""
2141 return _core_.Image_GetRed(*args, **kwargs)
2142
2143 def GetGreen(*args, **kwargs):
2144 """GetGreen(self, int x, int y) -> unsigned char"""
2145 return _core_.Image_GetGreen(*args, **kwargs)
2146
2147 def GetBlue(*args, **kwargs):
2148 """GetBlue(self, int x, int y) -> unsigned char"""
2149 return _core_.Image_GetBlue(*args, **kwargs)
2150
2151 def SetAlpha(*args, **kwargs):
2152 """SetAlpha(self, int x, int y, unsigned char alpha)"""
2153 return _core_.Image_SetAlpha(*args, **kwargs)
2154
2155 def GetAlpha(*args, **kwargs):
2156 """GetAlpha(self, int x, int y) -> unsigned char"""
2157 return _core_.Image_GetAlpha(*args, **kwargs)
2158
2159 def HasAlpha(*args, **kwargs):
2160 """HasAlpha(self) -> bool"""
2161 return _core_.Image_HasAlpha(*args, **kwargs)
2162
2163 def FindFirstUnusedColour(*args, **kwargs):
2164 """
2165 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2166
2167 Find first colour that is not used in the image and has higher RGB
2168 values than startR, startG, startB. Returns a tuple consisting of a
2169 success flag and rgb values.
2170 """
2171 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2172
2173 def ConvertAlphaToMask(*args, **kwargs):
2174 """
2175 ConvertAlphaToMask(self, byte threshold=128) -> bool
2176
2177 If the image has alpha channel, this method converts it to mask. All pixels
2178 with alpha value less than ``threshold`` are replaced with mask colour and the
2179 alpha channel is removed. Mask colour is chosen automatically using
2180 `FindFirstUnusedColour`.
2181
2182 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2183 nothing.
2184 """
2185 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2186
2187 def ConvertColourToAlpha(*args, **kwargs):
2188 """
2189 ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
2190
2191 This method converts an image where the original alpha information is
2192 only available as a shades of a colour (actually shades of grey)
2193 typically when you draw anti-aliased text into a bitmap. The DC
2194 drawing routines draw grey values on the black background although
2195 they actually mean to draw white with differnt alpha values. This
2196 method reverses it, assuming a black (!) background and white text.
2197 The method will then fill up the whole image with the colour given.
2198 """
2199 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2200
2201 def SetMaskFromImage(*args, **kwargs):
2202 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
2203 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2204
2205 def CanRead(*args, **kwargs):
2206 """CanRead(String name) -> bool"""
2207 return _core_.Image_CanRead(*args, **kwargs)
2208
2209 CanRead = staticmethod(CanRead)
2210 def GetImageCount(*args, **kwargs):
2211 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2212 return _core_.Image_GetImageCount(*args, **kwargs)
2213
2214 GetImageCount = staticmethod(GetImageCount)
2215 def LoadFile(*args, **kwargs):
2216 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2217 return _core_.Image_LoadFile(*args, **kwargs)
2218
2219 def LoadMimeFile(*args, **kwargs):
2220 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
2221 return _core_.Image_LoadMimeFile(*args, **kwargs)
2222
2223 def SaveFile(*args, **kwargs):
2224 """SaveFile(self, String name, int type) -> bool"""
2225 return _core_.Image_SaveFile(*args, **kwargs)
2226
2227 def SaveMimeFile(*args, **kwargs):
2228 """SaveMimeFile(self, String name, String mimetype) -> bool"""
2229 return _core_.Image_SaveMimeFile(*args, **kwargs)
2230
2231 def CanReadStream(*args, **kwargs):
2232 """CanReadStream(InputStream stream) -> bool"""
2233 return _core_.Image_CanReadStream(*args, **kwargs)
2234
2235 CanReadStream = staticmethod(CanReadStream)
2236 def LoadStream(*args, **kwargs):
2237 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2238 return _core_.Image_LoadStream(*args, **kwargs)
2239
2240 def LoadMimeStream(*args, **kwargs):
2241 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
2242 return _core_.Image_LoadMimeStream(*args, **kwargs)
2243
2244 def Ok(*args, **kwargs):
2245 """Ok(self) -> bool"""
2246 return _core_.Image_Ok(*args, **kwargs)
2247
2248 def GetWidth(*args, **kwargs):
2249 """GetWidth(self) -> int"""
2250 return _core_.Image_GetWidth(*args, **kwargs)
2251
2252 def GetHeight(*args, **kwargs):
2253 """GetHeight(self) -> int"""
2254 return _core_.Image_GetHeight(*args, **kwargs)
2255
2256 def GetSize(*args, **kwargs):
2257 """GetSize(self) -> Size"""
2258 return _core_.Image_GetSize(*args, **kwargs)
2259
2260 def GetSubImage(*args, **kwargs):
2261 """GetSubImage(self, Rect rect) -> Image"""
2262 return _core_.Image_GetSubImage(*args, **kwargs)
2263
2264 def Copy(*args, **kwargs):
2265 """Copy(self) -> Image"""
2266 return _core_.Image_Copy(*args, **kwargs)
2267
2268 def Paste(*args, **kwargs):
2269 """Paste(self, Image image, int x, int y)"""
2270 return _core_.Image_Paste(*args, **kwargs)
2271
2272 def GetData(*args, **kwargs):
2273 """GetData(self) -> PyObject"""
2274 return _core_.Image_GetData(*args, **kwargs)
2275
2276 def SetData(*args, **kwargs):
2277 """SetData(self, PyObject data)"""
2278 return _core_.Image_SetData(*args, **kwargs)
2279
2280 def GetDataBuffer(*args, **kwargs):
2281 """GetDataBuffer(self) -> PyObject"""
2282 return _core_.Image_GetDataBuffer(*args, **kwargs)
2283
2284 def SetDataBuffer(*args, **kwargs):
2285 """SetDataBuffer(self, PyObject data)"""
2286 return _core_.Image_SetDataBuffer(*args, **kwargs)
2287
2288 def GetAlphaData(*args, **kwargs):
2289 """GetAlphaData(self) -> PyObject"""
2290 return _core_.Image_GetAlphaData(*args, **kwargs)
2291
2292 def SetAlphaData(*args, **kwargs):
2293 """SetAlphaData(self, PyObject data)"""
2294 return _core_.Image_SetAlphaData(*args, **kwargs)
2295
2296 def GetAlphaBuffer(*args, **kwargs):
2297 """GetAlphaBuffer(self) -> PyObject"""
2298 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2299
2300 def SetAlphaBuffer(*args, **kwargs):
2301 """SetAlphaBuffer(self, PyObject data)"""
2302 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2303
2304 def SetMaskColour(*args, **kwargs):
2305 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
2306 return _core_.Image_SetMaskColour(*args, **kwargs)
2307
2308 def GetMaskRed(*args, **kwargs):
2309 """GetMaskRed(self) -> unsigned char"""
2310 return _core_.Image_GetMaskRed(*args, **kwargs)
2311
2312 def GetMaskGreen(*args, **kwargs):
2313 """GetMaskGreen(self) -> unsigned char"""
2314 return _core_.Image_GetMaskGreen(*args, **kwargs)
2315
2316 def GetMaskBlue(*args, **kwargs):
2317 """GetMaskBlue(self) -> unsigned char"""
2318 return _core_.Image_GetMaskBlue(*args, **kwargs)
2319
2320 def SetMask(*args, **kwargs):
2321 """SetMask(self, bool mask=True)"""
2322 return _core_.Image_SetMask(*args, **kwargs)
2323
2324 def HasMask(*args, **kwargs):
2325 """HasMask(self) -> bool"""
2326 return _core_.Image_HasMask(*args, **kwargs)
2327
2328 def Rotate(*args, **kwargs):
2329 """
2330 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2331 Point offset_after_rotation=None) -> Image
2332 """
2333 return _core_.Image_Rotate(*args, **kwargs)
2334
2335 def Rotate90(*args, **kwargs):
2336 """Rotate90(self, bool clockwise=True) -> Image"""
2337 return _core_.Image_Rotate90(*args, **kwargs)
2338
2339 def Mirror(*args, **kwargs):
2340 """Mirror(self, bool horizontally=True) -> Image"""
2341 return _core_.Image_Mirror(*args, **kwargs)
2342
2343 def Replace(*args, **kwargs):
2344 """
2345 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
2346 unsigned char r2, unsigned char g2, unsigned char b2)
2347 """
2348 return _core_.Image_Replace(*args, **kwargs)
2349
2350 def ConvertToMono(*args, **kwargs):
2351 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
2352 return _core_.Image_ConvertToMono(*args, **kwargs)
2353
2354 def SetOption(*args, **kwargs):
2355 """SetOption(self, String name, String value)"""
2356 return _core_.Image_SetOption(*args, **kwargs)
2357
2358 def SetOptionInt(*args, **kwargs):
2359 """SetOptionInt(self, String name, int value)"""
2360 return _core_.Image_SetOptionInt(*args, **kwargs)
2361
2362 def GetOption(*args, **kwargs):
2363 """GetOption(self, String name) -> String"""
2364 return _core_.Image_GetOption(*args, **kwargs)
2365
2366 def GetOptionInt(*args, **kwargs):
2367 """GetOptionInt(self, String name) -> int"""
2368 return _core_.Image_GetOptionInt(*args, **kwargs)
2369
2370 def HasOption(*args, **kwargs):
2371 """HasOption(self, String name) -> bool"""
2372 return _core_.Image_HasOption(*args, **kwargs)
2373
2374 def CountColours(*args, **kwargs):
2375 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2376 return _core_.Image_CountColours(*args, **kwargs)
2377
2378 def ComputeHistogram(*args, **kwargs):
2379 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2380 return _core_.Image_ComputeHistogram(*args, **kwargs)
2381
2382 def AddHandler(*args, **kwargs):
2383 """AddHandler(ImageHandler handler)"""
2384 return _core_.Image_AddHandler(*args, **kwargs)
2385
2386 AddHandler = staticmethod(AddHandler)
2387 def InsertHandler(*args, **kwargs):
2388 """InsertHandler(ImageHandler handler)"""
2389 return _core_.Image_InsertHandler(*args, **kwargs)
2390
2391 InsertHandler = staticmethod(InsertHandler)
2392 def RemoveHandler(*args, **kwargs):
2393 """RemoveHandler(String name) -> bool"""
2394 return _core_.Image_RemoveHandler(*args, **kwargs)
2395
2396 RemoveHandler = staticmethod(RemoveHandler)
2397 def GetImageExtWildcard(*args, **kwargs):
2398 """GetImageExtWildcard() -> String"""
2399 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2400
2401 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2402 def ConvertToBitmap(*args, **kwargs):
2403 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2404 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2405
2406 def ConvertToMonoBitmap(*args, **kwargs):
2407 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
2408 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2409
2410 def __nonzero__(self): return self.Ok()
2411
2412 class ImagePtr(Image):
2413 def __init__(self, this):
2414 self.this = this
2415 if not hasattr(self,"thisown"): self.thisown = 0
2416 self.__class__ = Image
2417 _core_.Image_swigregister(ImagePtr)
2418
2419 def ImageFromMime(*args, **kwargs):
2420 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
2421 val = _core_.new_ImageFromMime(*args, **kwargs)
2422 val.thisown = 1
2423 return val
2424
2425 def ImageFromStream(*args, **kwargs):
2426 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2427 val = _core_.new_ImageFromStream(*args, **kwargs)
2428 val.thisown = 1
2429 return val
2430
2431 def ImageFromStreamMime(*args, **kwargs):
2432 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
2433 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2434 val.thisown = 1
2435 return val
2436
2437 def EmptyImage(*args, **kwargs):
2438 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2439 val = _core_.new_EmptyImage(*args, **kwargs)
2440 val.thisown = 1
2441 return val
2442
2443 def ImageFromBitmap(*args, **kwargs):
2444 """ImageFromBitmap(Bitmap bitmap) -> Image"""
2445 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2446 val.thisown = 1
2447 return val
2448
2449 def ImageFromData(*args, **kwargs):
2450 """ImageFromData(int width, int height, unsigned char data) -> Image"""
2451 val = _core_.new_ImageFromData(*args, **kwargs)
2452 val.thisown = 1
2453 return val
2454
2455 def ImageFromDataWithAlpha(*args, **kwargs):
2456 """ImageFromDataWithAlpha(int width, int height, unsigned char data, unsigned char alpha) -> Image"""
2457 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2458 val.thisown = 1
2459 return val
2460
2461 def Image_CanRead(*args, **kwargs):
2462 """Image_CanRead(String name) -> bool"""
2463 return _core_.Image_CanRead(*args, **kwargs)
2464
2465 def Image_GetImageCount(*args, **kwargs):
2466 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2467 return _core_.Image_GetImageCount(*args, **kwargs)
2468
2469 def Image_CanReadStream(*args, **kwargs):
2470 """Image_CanReadStream(InputStream stream) -> bool"""
2471 return _core_.Image_CanReadStream(*args, **kwargs)
2472
2473 def Image_AddHandler(*args, **kwargs):
2474 """Image_AddHandler(ImageHandler handler)"""
2475 return _core_.Image_AddHandler(*args, **kwargs)
2476
2477 def Image_InsertHandler(*args, **kwargs):
2478 """Image_InsertHandler(ImageHandler handler)"""
2479 return _core_.Image_InsertHandler(*args, **kwargs)
2480
2481 def Image_RemoveHandler(*args, **kwargs):
2482 """Image_RemoveHandler(String name) -> bool"""
2483 return _core_.Image_RemoveHandler(*args, **kwargs)
2484
2485 def Image_GetImageExtWildcard(*args, **kwargs):
2486 """Image_GetImageExtWildcard() -> String"""
2487 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2488
2489 def InitAllImageHandlers():
2490 """
2491 The former functionality of InitAllImageHanders is now done internal to
2492 the _core_ extension module and so this function has become a simple NOP.
2493 """
2494 pass
2495
2496 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2497 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2498 BMP_24BPP = _core_.BMP_24BPP
2499 BMP_8BPP = _core_.BMP_8BPP
2500 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2501 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2502 BMP_8BPP_RED = _core_.BMP_8BPP_RED
2503 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2504 BMP_4BPP = _core_.BMP_4BPP
2505 BMP_1BPP = _core_.BMP_1BPP
2506 BMP_1BPP_BW = _core_.BMP_1BPP_BW
2507 class BMPHandler(ImageHandler):
2508 """Proxy of C++ BMPHandler class"""
2509 def __repr__(self):
2510 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2511 def __init__(self, *args, **kwargs):
2512 """__init__(self) -> BMPHandler"""
2513 newobj = _core_.new_BMPHandler(*args, **kwargs)
2514 self.this = newobj.this
2515 self.thisown = 1
2516 del newobj.thisown
2517
2518 class BMPHandlerPtr(BMPHandler):
2519 def __init__(self, this):
2520 self.this = this
2521 if not hasattr(self,"thisown"): self.thisown = 0
2522 self.__class__ = BMPHandler
2523 _core_.BMPHandler_swigregister(BMPHandlerPtr)
2524 NullImage = cvar.NullImage
2525 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2526 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2527 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2528 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2529 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2530
2531 class ICOHandler(BMPHandler):
2532 """Proxy of C++ ICOHandler class"""
2533 def __repr__(self):
2534 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2535 def __init__(self, *args, **kwargs):
2536 """__init__(self) -> ICOHandler"""
2537 newobj = _core_.new_ICOHandler(*args, **kwargs)
2538 self.this = newobj.this
2539 self.thisown = 1
2540 del newobj.thisown
2541
2542 class ICOHandlerPtr(ICOHandler):
2543 def __init__(self, this):
2544 self.this = this
2545 if not hasattr(self,"thisown"): self.thisown = 0
2546 self.__class__ = ICOHandler
2547 _core_.ICOHandler_swigregister(ICOHandlerPtr)
2548
2549 class CURHandler(ICOHandler):
2550 """Proxy of C++ CURHandler class"""
2551 def __repr__(self):
2552 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2553 def __init__(self, *args, **kwargs):
2554 """__init__(self) -> CURHandler"""
2555 newobj = _core_.new_CURHandler(*args, **kwargs)
2556 self.this = newobj.this
2557 self.thisown = 1
2558 del newobj.thisown
2559
2560 class CURHandlerPtr(CURHandler):
2561 def __init__(self, this):
2562 self.this = this
2563 if not hasattr(self,"thisown"): self.thisown = 0
2564 self.__class__ = CURHandler
2565 _core_.CURHandler_swigregister(CURHandlerPtr)
2566
2567 class ANIHandler(CURHandler):
2568 """Proxy of C++ ANIHandler class"""
2569 def __repr__(self):
2570 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2571 def __init__(self, *args, **kwargs):
2572 """__init__(self) -> ANIHandler"""
2573 newobj = _core_.new_ANIHandler(*args, **kwargs)
2574 self.this = newobj.this
2575 self.thisown = 1
2576 del newobj.thisown
2577
2578 class ANIHandlerPtr(ANIHandler):
2579 def __init__(self, this):
2580 self.this = this
2581 if not hasattr(self,"thisown"): self.thisown = 0
2582 self.__class__ = ANIHandler
2583 _core_.ANIHandler_swigregister(ANIHandlerPtr)
2584
2585 class PNGHandler(ImageHandler):
2586 """Proxy of C++ PNGHandler class"""
2587 def __repr__(self):
2588 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2589 def __init__(self, *args, **kwargs):
2590 """__init__(self) -> PNGHandler"""
2591 newobj = _core_.new_PNGHandler(*args, **kwargs)
2592 self.this = newobj.this
2593 self.thisown = 1
2594 del newobj.thisown
2595
2596 class PNGHandlerPtr(PNGHandler):
2597 def __init__(self, this):
2598 self.this = this
2599 if not hasattr(self,"thisown"): self.thisown = 0
2600 self.__class__ = PNGHandler
2601 _core_.PNGHandler_swigregister(PNGHandlerPtr)
2602
2603 class GIFHandler(ImageHandler):
2604 """Proxy of C++ GIFHandler class"""
2605 def __repr__(self):
2606 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2607 def __init__(self, *args, **kwargs):
2608 """__init__(self) -> GIFHandler"""
2609 newobj = _core_.new_GIFHandler(*args, **kwargs)
2610 self.this = newobj.this
2611 self.thisown = 1
2612 del newobj.thisown
2613
2614 class GIFHandlerPtr(GIFHandler):
2615 def __init__(self, this):
2616 self.this = this
2617 if not hasattr(self,"thisown"): self.thisown = 0
2618 self.__class__ = GIFHandler
2619 _core_.GIFHandler_swigregister(GIFHandlerPtr)
2620
2621 class PCXHandler(ImageHandler):
2622 """Proxy of C++ PCXHandler class"""
2623 def __repr__(self):
2624 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2625 def __init__(self, *args, **kwargs):
2626 """__init__(self) -> PCXHandler"""
2627 newobj = _core_.new_PCXHandler(*args, **kwargs)
2628 self.this = newobj.this
2629 self.thisown = 1
2630 del newobj.thisown
2631
2632 class PCXHandlerPtr(PCXHandler):
2633 def __init__(self, this):
2634 self.this = this
2635 if not hasattr(self,"thisown"): self.thisown = 0
2636 self.__class__ = PCXHandler
2637 _core_.PCXHandler_swigregister(PCXHandlerPtr)
2638
2639 class JPEGHandler(ImageHandler):
2640 """Proxy of C++ JPEGHandler class"""
2641 def __repr__(self):
2642 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2643 def __init__(self, *args, **kwargs):
2644 """__init__(self) -> JPEGHandler"""
2645 newobj = _core_.new_JPEGHandler(*args, **kwargs)
2646 self.this = newobj.this
2647 self.thisown = 1
2648 del newobj.thisown
2649
2650 class JPEGHandlerPtr(JPEGHandler):
2651 def __init__(self, this):
2652 self.this = this
2653 if not hasattr(self,"thisown"): self.thisown = 0
2654 self.__class__ = JPEGHandler
2655 _core_.JPEGHandler_swigregister(JPEGHandlerPtr)
2656
2657 class PNMHandler(ImageHandler):
2658 """Proxy of C++ PNMHandler class"""
2659 def __repr__(self):
2660 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2661 def __init__(self, *args, **kwargs):
2662 """__init__(self) -> PNMHandler"""
2663 newobj = _core_.new_PNMHandler(*args, **kwargs)
2664 self.this = newobj.this
2665 self.thisown = 1
2666 del newobj.thisown
2667
2668 class PNMHandlerPtr(PNMHandler):
2669 def __init__(self, this):
2670 self.this = this
2671 if not hasattr(self,"thisown"): self.thisown = 0
2672 self.__class__ = PNMHandler
2673 _core_.PNMHandler_swigregister(PNMHandlerPtr)
2674
2675 class XPMHandler(ImageHandler):
2676 """Proxy of C++ XPMHandler class"""
2677 def __repr__(self):
2678 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2679 def __init__(self, *args, **kwargs):
2680 """__init__(self) -> XPMHandler"""
2681 newobj = _core_.new_XPMHandler(*args, **kwargs)
2682 self.this = newobj.this
2683 self.thisown = 1
2684 del newobj.thisown
2685
2686 class XPMHandlerPtr(XPMHandler):
2687 def __init__(self, this):
2688 self.this = this
2689 if not hasattr(self,"thisown"): self.thisown = 0
2690 self.__class__ = XPMHandler
2691 _core_.XPMHandler_swigregister(XPMHandlerPtr)
2692
2693 class TIFFHandler(ImageHandler):
2694 """Proxy of C++ TIFFHandler class"""
2695 def __repr__(self):
2696 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2697 def __init__(self, *args, **kwargs):
2698 """__init__(self) -> TIFFHandler"""
2699 newobj = _core_.new_TIFFHandler(*args, **kwargs)
2700 self.this = newobj.this
2701 self.thisown = 1
2702 del newobj.thisown
2703
2704 class TIFFHandlerPtr(TIFFHandler):
2705 def __init__(self, this):
2706 self.this = this
2707 if not hasattr(self,"thisown"): self.thisown = 0
2708 self.__class__ = TIFFHandler
2709 _core_.TIFFHandler_swigregister(TIFFHandlerPtr)
2710
2711 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2712 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2713 class Quantize(object):
2714 """Performs quantization, or colour reduction, on a wxImage."""
2715 def __init__(self): raise RuntimeError, "No constructor defined"
2716 def __repr__(self):
2717 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2718 def Quantize(*args, **kwargs):
2719 """
2720 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2721
2722 Reduce the colours in the source image and put the result into the
2723 destination image, setting the palette in the destination if
2724 needed. Both images may be the same, to overwrite the source image.
2725 """
2726 return _core_.Quantize_Quantize(*args, **kwargs)
2727
2728 Quantize = staticmethod(Quantize)
2729
2730 class QuantizePtr(Quantize):
2731 def __init__(self, this):
2732 self.this = this
2733 if not hasattr(self,"thisown"): self.thisown = 0
2734 self.__class__ = Quantize
2735 _core_.Quantize_swigregister(QuantizePtr)
2736
2737 def Quantize_Quantize(*args, **kwargs):
2738 """
2739 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2740
2741 Reduce the colours in the source image and put the result into the
2742 destination image, setting the palette in the destination if
2743 needed. Both images may be the same, to overwrite the source image.
2744 """
2745 return _core_.Quantize_Quantize(*args, **kwargs)
2746
2747 #---------------------------------------------------------------------------
2748
2749 class EvtHandler(Object):
2750 """Proxy of C++ EvtHandler class"""
2751 def __repr__(self):
2752 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2753 def __init__(self, *args, **kwargs):
2754 """__init__(self) -> EvtHandler"""
2755 newobj = _core_.new_EvtHandler(*args, **kwargs)
2756 self.this = newobj.this
2757 self.thisown = 1
2758 del newobj.thisown
2759 def GetNextHandler(*args, **kwargs):
2760 """GetNextHandler(self) -> EvtHandler"""
2761 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
2762
2763 def GetPreviousHandler(*args, **kwargs):
2764 """GetPreviousHandler(self) -> EvtHandler"""
2765 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
2766
2767 def SetNextHandler(*args, **kwargs):
2768 """SetNextHandler(self, EvtHandler handler)"""
2769 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
2770
2771 def SetPreviousHandler(*args, **kwargs):
2772 """SetPreviousHandler(self, EvtHandler handler)"""
2773 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
2774
2775 def GetEvtHandlerEnabled(*args, **kwargs):
2776 """GetEvtHandlerEnabled(self) -> bool"""
2777 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
2778
2779 def SetEvtHandlerEnabled(*args, **kwargs):
2780 """SetEvtHandlerEnabled(self, bool enabled)"""
2781 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
2782
2783 def ProcessEvent(*args, **kwargs):
2784 """ProcessEvent(self, Event event) -> bool"""
2785 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
2786
2787 def AddPendingEvent(*args, **kwargs):
2788 """AddPendingEvent(self, Event event)"""
2789 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
2790
2791 def ProcessPendingEvents(*args, **kwargs):
2792 """ProcessPendingEvents(self)"""
2793 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
2794
2795 def Connect(*args, **kwargs):
2796 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
2797 return _core_.EvtHandler_Connect(*args, **kwargs)
2798
2799 def Disconnect(*args, **kwargs):
2800 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
2801 return _core_.EvtHandler_Disconnect(*args, **kwargs)
2802
2803 def _setOORInfo(*args, **kwargs):
2804 """_setOORInfo(self, PyObject _self, bool incref=True)"""
2805 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
2806
2807 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2808 """
2809 Bind an event to an event handler.
2810
2811 :param event: One of the EVT_* objects that specifies the
2812 type of event to bind,
2813
2814 :param handler: A callable object to be invoked when the
2815 event is delivered to self. Pass None to
2816 disconnect an event handler.
2817
2818 :param source: Sometimes the event originates from a
2819 different window than self, but you still
2820 want to catch it in self. (For example, a
2821 button event delivered to a frame.) By
2822 passing the source of the event, the event
2823 handling system is able to differentiate
2824 between the same event type from different
2825 controls.
2826
2827 :param id: Used to spcify the event source by ID instead
2828 of instance.
2829
2830 :param id2: Used when it is desirable to bind a handler
2831 to a range of IDs, such as with EVT_MENU_RANGE.
2832 """
2833 if source is not None:
2834 id = source.GetId()
2835 event.Bind(self, id, id2, handler)
2836
2837 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2838 """
2839 Disconencts the event handler binding for event from self.
2840 Returns True if successful.
2841 """
2842 if source is not None:
2843 id = source.GetId()
2844 return event.Unbind(self, id, id2)
2845
2846
2847 class EvtHandlerPtr(EvtHandler):
2848 def __init__(self, this):
2849 self.this = this
2850 if not hasattr(self,"thisown"): self.thisown = 0
2851 self.__class__ = EvtHandler
2852 _core_.EvtHandler_swigregister(EvtHandlerPtr)
2853
2854 #---------------------------------------------------------------------------
2855
2856 class PyEventBinder(object):
2857 """
2858 Instances of this class are used to bind specific events to event
2859 handlers.
2860 """
2861 def __init__(self, evtType, expectedIDs=0):
2862 if expectedIDs not in [0, 1, 2]:
2863 raise ValueError, "Invalid number of expectedIDs"
2864 self.expectedIDs = expectedIDs
2865
2866 if type(evtType) == list or type(evtType) == tuple:
2867 self.evtType = evtType
2868 else:
2869 self.evtType = [evtType]
2870
2871
2872 def Bind(self, target, id1, id2, function):
2873 """Bind this set of event types to target."""
2874 for et in self.evtType:
2875 target.Connect(id1, id2, et, function)
2876
2877
2878 def Unbind(self, target, id1, id2):
2879 """Remove an event binding."""
2880 success = 0
2881 for et in self.evtType:
2882 success += target.Disconnect(id1, id2, et)
2883 return success != 0
2884
2885
2886 def __call__(self, *args):
2887 """
2888 For backwards compatibility with the old EVT_* functions.
2889 Should be called with either (window, func), (window, ID,
2890 func) or (window, ID1, ID2, func) parameters depending on the
2891 type of the event.
2892 """
2893 assert len(args) == 2 + self.expectedIDs
2894 id1 = wx.ID_ANY
2895 id2 = wx.ID_ANY
2896 target = args[0]
2897 if self.expectedIDs == 0:
2898 func = args[1]
2899 elif self.expectedIDs == 1:
2900 id1 = args[1]
2901 func = args[2]
2902 elif self.expectedIDs == 2:
2903 id1 = args[1]
2904 id2 = args[2]
2905 func = args[3]
2906 else:
2907 raise ValueError, "Unexpected number of IDs"
2908
2909 self.Bind(target, id1, id2, func)
2910
2911
2912 # These two are square pegs that don't fit the PyEventBinder hole...
2913 def EVT_COMMAND(win, id, cmd, func):
2914 win.Connect(id, -1, cmd, func)
2915 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2916 win.Connect(id1, id2, cmd, func)
2917
2918
2919 #---------------------------------------------------------------------------
2920
2921 #---------------------------------------------------------------------------
2922
2923 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
2924 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
2925
2926 def NewEventType(*args, **kwargs):
2927 """NewEventType() -> wxEventType"""
2928 return _core_.NewEventType(*args, **kwargs)
2929 wxEVT_NULL = _core_.wxEVT_NULL
2930 wxEVT_FIRST = _core_.wxEVT_FIRST
2931 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
2932 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
2933 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
2934 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
2935 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
2936 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
2937 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
2938 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
2939 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
2940 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
2941 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
2942 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
2943 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
2944 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
2945 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
2946 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
2947 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
2948 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
2949 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
2950 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
2951 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
2952 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
2953 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
2954 wxEVT_MOTION = _core_.wxEVT_MOTION
2955 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
2956 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
2957 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
2958 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
2959 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
2960 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
2961 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
2962 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
2963 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
2964 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
2965 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
2966 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
2967 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
2968 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
2969 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
2970 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
2971 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
2972 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
2973 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
2974 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
2975 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
2976 wxEVT_CHAR = _core_.wxEVT_CHAR
2977 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
2978 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
2979 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
2980 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
2981 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
2982 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
2983 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
2984 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
2985 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
2986 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
2987 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
2988 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
2989 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
2990 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
2991 wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
2992 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
2993 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
2994 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
2995 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
2996 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
2997 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
2998 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
2999 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3000 wxEVT_SIZE = _core_.wxEVT_SIZE
3001 wxEVT_MOVE = _core_.wxEVT_MOVE
3002 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3003 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3004 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3005 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3006 wxEVT_POWER = _core_.wxEVT_POWER
3007 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3008 wxEVT_CREATE = _core_.wxEVT_CREATE
3009 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3010 wxEVT_SHOW = _core_.wxEVT_SHOW
3011 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3012 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3013 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3014 wxEVT_PAINT = _core_.wxEVT_PAINT
3015 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3016 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3017 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3018 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3019 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3020 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3021 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3022 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3023 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3024 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3025 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3026 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3027 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3028 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3029 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3030 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3031 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3032 wxEVT_IDLE = _core_.wxEVT_IDLE
3033 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3034 wxEVT_SIZING = _core_.wxEVT_SIZING
3035 wxEVT_MOVING = _core_.wxEVT_MOVING
3036 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3037 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3038 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3039 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3040 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3041 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3042 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3043 #
3044 # Create some event binders
3045 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3046 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3047 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3048 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3049 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3050 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3051 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3052 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3053 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3054 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3055 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3056 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3057 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3058 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3059 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3060 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3061 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3062 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3063 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3064 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3065 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3066 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3067 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3068 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3069 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3070 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3071 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3072 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3073 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3074 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3075 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3076 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3077 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3078 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3079 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3080 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3081 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3082 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3083 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3084 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3085
3086 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3087 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3088 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3089 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3090 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3091 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3092 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3093 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3094 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3095 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3096 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3097 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3098 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3099
3100 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3101 wxEVT_LEFT_UP,
3102 wxEVT_MIDDLE_DOWN,
3103 wxEVT_MIDDLE_UP,
3104 wxEVT_RIGHT_DOWN,
3105 wxEVT_RIGHT_UP,
3106 wxEVT_MOTION,
3107 wxEVT_LEFT_DCLICK,
3108 wxEVT_MIDDLE_DCLICK,
3109 wxEVT_RIGHT_DCLICK,
3110 wxEVT_ENTER_WINDOW,
3111 wxEVT_LEAVE_WINDOW,
3112 wxEVT_MOUSEWHEEL
3113 ])
3114
3115
3116 # Scrolling from wxWindow (sent to wxScrolledWindow)
3117 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3118 wxEVT_SCROLLWIN_BOTTOM,
3119 wxEVT_SCROLLWIN_LINEUP,
3120 wxEVT_SCROLLWIN_LINEDOWN,
3121 wxEVT_SCROLLWIN_PAGEUP,
3122 wxEVT_SCROLLWIN_PAGEDOWN,
3123 wxEVT_SCROLLWIN_THUMBTRACK,
3124 wxEVT_SCROLLWIN_THUMBRELEASE,
3125 ])
3126
3127 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3128 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3129 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3130 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3131 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3132 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3133 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3134 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3135
3136 # Scrolling from wxSlider and wxScrollBar
3137 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3138 wxEVT_SCROLL_BOTTOM,
3139 wxEVT_SCROLL_LINEUP,
3140 wxEVT_SCROLL_LINEDOWN,
3141 wxEVT_SCROLL_PAGEUP,
3142 wxEVT_SCROLL_PAGEDOWN,
3143 wxEVT_SCROLL_THUMBTRACK,
3144 wxEVT_SCROLL_THUMBRELEASE,
3145 wxEVT_SCROLL_ENDSCROLL,
3146 ])
3147
3148 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3149 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3150 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3151 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3152 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3153 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3154 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3155 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3156 EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3157
3158 # Scrolling from wxSlider and wxScrollBar, with an id
3159 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3160 wxEVT_SCROLL_BOTTOM,
3161 wxEVT_SCROLL_LINEUP,
3162 wxEVT_SCROLL_LINEDOWN,
3163 wxEVT_SCROLL_PAGEUP,
3164 wxEVT_SCROLL_PAGEDOWN,
3165 wxEVT_SCROLL_THUMBTRACK,
3166 wxEVT_SCROLL_THUMBRELEASE,
3167 wxEVT_SCROLL_ENDSCROLL,
3168 ], 1)
3169
3170 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3171 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3172 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3173 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3174 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3175 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3176 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3177 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3178 EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3179
3180 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3181 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3182 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3183 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3184 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3185 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3186 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3187 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3188 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3189 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3190
3191 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3192 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3193 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3194 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3195 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3196 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3197 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3198 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3199 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3200
3201
3202 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3203 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3204 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3205 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3206 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3207 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3208 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3209
3210 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3211
3212 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3213 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3214
3215 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3216
3217
3218
3219 #---------------------------------------------------------------------------
3220
3221 class Event(Object):
3222 """Proxy of C++ Event class"""
3223 def __init__(self): raise RuntimeError, "No constructor defined"
3224 def __repr__(self):
3225 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3226 def __del__(self, destroy=_core_.delete_Event):
3227 """__del__(self)"""
3228 try:
3229 if self.thisown: destroy(self)
3230 except: pass
3231
3232 def SetEventType(*args, **kwargs):
3233 """SetEventType(self, wxEventType typ)"""
3234 return _core_.Event_SetEventType(*args, **kwargs)
3235
3236 def GetEventType(*args, **kwargs):
3237 """GetEventType(self) -> wxEventType"""
3238 return _core_.Event_GetEventType(*args, **kwargs)
3239
3240 def GetEventObject(*args, **kwargs):
3241 """GetEventObject(self) -> Object"""
3242 return _core_.Event_GetEventObject(*args, **kwargs)
3243
3244 def SetEventObject(*args, **kwargs):
3245 """SetEventObject(self, Object obj)"""
3246 return _core_.Event_SetEventObject(*args, **kwargs)
3247
3248 def GetTimestamp(*args, **kwargs):
3249 """GetTimestamp(self) -> long"""
3250 return _core_.Event_GetTimestamp(*args, **kwargs)
3251
3252 def SetTimestamp(*args, **kwargs):
3253 """SetTimestamp(self, long ts=0)"""
3254 return _core_.Event_SetTimestamp(*args, **kwargs)
3255
3256 def GetId(*args, **kwargs):
3257 """GetId(self) -> int"""
3258 return _core_.Event_GetId(*args, **kwargs)
3259
3260 def SetId(*args, **kwargs):
3261 """SetId(self, int Id)"""
3262 return _core_.Event_SetId(*args, **kwargs)
3263
3264 def IsCommandEvent(*args, **kwargs):
3265 """IsCommandEvent(self) -> bool"""
3266 return _core_.Event_IsCommandEvent(*args, **kwargs)
3267
3268 def Skip(*args, **kwargs):
3269 """
3270 Skip(self, bool skip=True)
3271
3272 Called by an event handler, it controls whether additional event
3273 handlers bound to this event will be called after the current event
3274 handler returns. Skip(false) (the default setting) will prevent
3275 additional event handlers from being called and control will be
3276 returned to the sender of the event immediately after the current
3277 handler has finished. Skip(True) will cause the event processing
3278 system to continue searching for a handler function for this event.
3279
3280 """
3281 return _core_.Event_Skip(*args, **kwargs)
3282
3283 def GetSkipped(*args, **kwargs):
3284 """GetSkipped(self) -> bool"""
3285 return _core_.Event_GetSkipped(*args, **kwargs)
3286
3287 def ShouldPropagate(*args, **kwargs):
3288 """ShouldPropagate(self) -> bool"""
3289 return _core_.Event_ShouldPropagate(*args, **kwargs)
3290
3291 def StopPropagation(*args, **kwargs):
3292 """StopPropagation(self) -> int"""
3293 return _core_.Event_StopPropagation(*args, **kwargs)
3294
3295 def ResumePropagation(*args, **kwargs):
3296 """ResumePropagation(self, int propagationLevel)"""
3297 return _core_.Event_ResumePropagation(*args, **kwargs)
3298
3299 def Clone(*args, **kwargs):
3300 """Clone(self) -> Event"""
3301 return _core_.Event_Clone(*args, **kwargs)
3302
3303
3304 class EventPtr(Event):
3305 def __init__(self, this):
3306 self.this = this
3307 if not hasattr(self,"thisown"): self.thisown = 0
3308 self.__class__ = Event
3309 _core_.Event_swigregister(EventPtr)
3310
3311 #---------------------------------------------------------------------------
3312
3313 class PropagationDisabler(object):
3314 """Proxy of C++ PropagationDisabler class"""
3315 def __repr__(self):
3316 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3317 def __init__(self, *args, **kwargs):
3318 """__init__(self, Event event) -> PropagationDisabler"""
3319 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
3320 self.this = newobj.this
3321 self.thisown = 1
3322 del newobj.thisown
3323 def __del__(self, destroy=_core_.delete_PropagationDisabler):
3324 """__del__(self)"""
3325 try:
3326 if self.thisown: destroy(self)
3327 except: pass
3328
3329
3330 class PropagationDisablerPtr(PropagationDisabler):
3331 def __init__(self, this):
3332 self.this = this
3333 if not hasattr(self,"thisown"): self.thisown = 0
3334 self.__class__ = PropagationDisabler
3335 _core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
3336
3337 class PropagateOnce(object):
3338 """Proxy of C++ PropagateOnce class"""
3339 def __repr__(self):
3340 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3341 def __init__(self, *args, **kwargs):
3342 """__init__(self, Event event) -> PropagateOnce"""
3343 newobj = _core_.new_PropagateOnce(*args, **kwargs)
3344 self.this = newobj.this
3345 self.thisown = 1
3346 del newobj.thisown
3347 def __del__(self, destroy=_core_.delete_PropagateOnce):
3348 """__del__(self)"""
3349 try:
3350 if self.thisown: destroy(self)
3351 except: pass
3352
3353
3354 class PropagateOncePtr(PropagateOnce):
3355 def __init__(self, this):
3356 self.this = this
3357 if not hasattr(self,"thisown"): self.thisown = 0
3358 self.__class__ = PropagateOnce
3359 _core_.PropagateOnce_swigregister(PropagateOncePtr)
3360
3361 #---------------------------------------------------------------------------
3362
3363 class CommandEvent(Event):
3364 """Proxy of C++ CommandEvent class"""
3365 def __repr__(self):
3366 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3367 def __init__(self, *args, **kwargs):
3368 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
3369 newobj = _core_.new_CommandEvent(*args, **kwargs)
3370 self.this = newobj.this
3371 self.thisown = 1
3372 del newobj.thisown
3373 def GetSelection(*args, **kwargs):
3374 """GetSelection(self) -> int"""
3375 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3376
3377 def SetString(*args, **kwargs):
3378 """SetString(self, String s)"""
3379 return _core_.CommandEvent_SetString(*args, **kwargs)
3380
3381 def GetString(*args, **kwargs):
3382 """GetString(self) -> String"""
3383 return _core_.CommandEvent_GetString(*args, **kwargs)
3384
3385 def IsChecked(*args, **kwargs):
3386 """IsChecked(self) -> bool"""
3387 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3388
3389 Checked = IsChecked
3390 def IsSelection(*args, **kwargs):
3391 """IsSelection(self) -> bool"""
3392 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3393
3394 def SetExtraLong(*args, **kwargs):
3395 """SetExtraLong(self, long extraLong)"""
3396 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3397
3398 def GetExtraLong(*args, **kwargs):
3399 """GetExtraLong(self) -> long"""
3400 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3401
3402 def SetInt(*args, **kwargs):
3403 """SetInt(self, int i)"""
3404 return _core_.CommandEvent_SetInt(*args, **kwargs)
3405
3406 def GetInt(*args, **kwargs):
3407 """GetInt(self) -> long"""
3408 return _core_.CommandEvent_GetInt(*args, **kwargs)
3409
3410 def Clone(*args, **kwargs):
3411 """Clone(self) -> Event"""
3412 return _core_.CommandEvent_Clone(*args, **kwargs)
3413
3414
3415 class CommandEventPtr(CommandEvent):
3416 def __init__(self, this):
3417 self.this = this
3418 if not hasattr(self,"thisown"): self.thisown = 0
3419 self.__class__ = CommandEvent
3420 _core_.CommandEvent_swigregister(CommandEventPtr)
3421
3422 #---------------------------------------------------------------------------
3423
3424 class NotifyEvent(CommandEvent):
3425 """Proxy of C++ NotifyEvent class"""
3426 def __repr__(self):
3427 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3428 def __init__(self, *args, **kwargs):
3429 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
3430 newobj = _core_.new_NotifyEvent(*args, **kwargs)
3431 self.this = newobj.this
3432 self.thisown = 1
3433 del newobj.thisown
3434 def Veto(*args, **kwargs):
3435 """Veto(self)"""
3436 return _core_.NotifyEvent_Veto(*args, **kwargs)
3437
3438 def Allow(*args, **kwargs):
3439 """Allow(self)"""
3440 return _core_.NotifyEvent_Allow(*args, **kwargs)
3441
3442 def IsAllowed(*args, **kwargs):
3443 """IsAllowed(self) -> bool"""
3444 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
3445
3446
3447 class NotifyEventPtr(NotifyEvent):
3448 def __init__(self, this):
3449 self.this = this
3450 if not hasattr(self,"thisown"): self.thisown = 0
3451 self.__class__ = NotifyEvent
3452 _core_.NotifyEvent_swigregister(NotifyEventPtr)
3453
3454 #---------------------------------------------------------------------------
3455
3456 class ScrollEvent(CommandEvent):
3457 """Proxy of C++ ScrollEvent class"""
3458 def __repr__(self):
3459 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3460 def __init__(self, *args, **kwargs):
3461 """
3462 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
3463 int orient=0) -> ScrollEvent
3464 """
3465 newobj = _core_.new_ScrollEvent(*args, **kwargs)
3466 self.this = newobj.this
3467 self.thisown = 1
3468 del newobj.thisown
3469 def GetOrientation(*args, **kwargs):
3470 """GetOrientation(self) -> int"""
3471 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
3472
3473 def GetPosition(*args, **kwargs):
3474 """GetPosition(self) -> int"""
3475 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
3476
3477 def SetOrientation(*args, **kwargs):
3478 """SetOrientation(self, int orient)"""
3479 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
3480
3481 def SetPosition(*args, **kwargs):
3482 """SetPosition(self, int pos)"""
3483 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
3484
3485
3486 class ScrollEventPtr(ScrollEvent):
3487 def __init__(self, this):
3488 self.this = this
3489 if not hasattr(self,"thisown"): self.thisown = 0
3490 self.__class__ = ScrollEvent
3491 _core_.ScrollEvent_swigregister(ScrollEventPtr)
3492
3493 #---------------------------------------------------------------------------
3494
3495 class ScrollWinEvent(Event):
3496 """Proxy of C++ ScrollWinEvent class"""
3497 def __repr__(self):
3498 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3499 def __init__(self, *args, **kwargs):
3500 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
3501 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
3502 self.this = newobj.this
3503 self.thisown = 1
3504 del newobj.thisown
3505 def GetOrientation(*args, **kwargs):
3506 """GetOrientation(self) -> int"""
3507 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
3508
3509 def GetPosition(*args, **kwargs):
3510 """GetPosition(self) -> int"""
3511 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
3512
3513 def SetOrientation(*args, **kwargs):
3514 """SetOrientation(self, int orient)"""
3515 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
3516
3517 def SetPosition(*args, **kwargs):
3518 """SetPosition(self, int pos)"""
3519 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
3520
3521
3522 class ScrollWinEventPtr(ScrollWinEvent):
3523 def __init__(self, this):
3524 self.this = this
3525 if not hasattr(self,"thisown"): self.thisown = 0
3526 self.__class__ = ScrollWinEvent
3527 _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
3528
3529 #---------------------------------------------------------------------------
3530
3531 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3532 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3533 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3534 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3535 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
3536 class MouseEvent(Event):
3537 """Proxy of C++ MouseEvent class"""
3538 def __repr__(self):
3539 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3540 def __init__(self, *args, **kwargs):
3541 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
3542 newobj = _core_.new_MouseEvent(*args, **kwargs)
3543 self.this = newobj.this
3544 self.thisown = 1
3545 del newobj.thisown
3546 def IsButton(*args, **kwargs):
3547 """IsButton(self) -> bool"""
3548 return _core_.MouseEvent_IsButton(*args, **kwargs)
3549
3550 def ButtonDown(*args, **kwargs):
3551 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
3552 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
3553
3554 def ButtonDClick(*args, **kwargs):
3555 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
3556 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
3557
3558 def ButtonUp(*args, **kwargs):
3559 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
3560 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
3561
3562 def Button(*args, **kwargs):
3563 """Button(self, int but) -> bool"""
3564 return _core_.MouseEvent_Button(*args, **kwargs)
3565
3566 def ButtonIsDown(*args, **kwargs):
3567 """ButtonIsDown(self, int but) -> bool"""
3568 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
3569
3570 def GetButton(*args, **kwargs):
3571 """GetButton(self) -> int"""
3572 return _core_.MouseEvent_GetButton(*args, **kwargs)
3573
3574 def ControlDown(*args, **kwargs):
3575 """ControlDown(self) -> bool"""
3576 return _core_.MouseEvent_ControlDown(*args, **kwargs)
3577
3578 def MetaDown(*args, **kwargs):
3579 """MetaDown(self) -> bool"""
3580 return _core_.MouseEvent_MetaDown(*args, **kwargs)
3581
3582 def AltDown(*args, **kwargs):
3583 """AltDown(self) -> bool"""
3584 return _core_.MouseEvent_AltDown(*args, **kwargs)
3585
3586 def ShiftDown(*args, **kwargs):
3587 """ShiftDown(self) -> bool"""
3588 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
3589
3590 def CmdDown(*args, **kwargs):
3591 """
3592 CmdDown(self) -> bool
3593
3594 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3595 platforms but the special "Apple" (a.k.a as "Command") key on
3596 Macs: it makes often sense to use it instead of, say, `ControlDown`
3597 because Cmd key is used for the same thing under Mac as Ctrl
3598 elsewhere. The Ctrl still exists, it's just not used for this
3599 purpose. So for non-Mac platforms this is the same as `ControlDown`
3600 and Macs this is the same as `MetaDown`.
3601 """
3602 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3603
3604 def LeftDown(*args, **kwargs):
3605 """LeftDown(self) -> bool"""
3606 return _core_.MouseEvent_LeftDown(*args, **kwargs)
3607
3608 def MiddleDown(*args, **kwargs):
3609 """MiddleDown(self) -> bool"""
3610 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
3611
3612 def RightDown(*args, **kwargs):
3613 """RightDown(self) -> bool"""
3614 return _core_.MouseEvent_RightDown(*args, **kwargs)
3615
3616 def LeftUp(*args, **kwargs):
3617 """LeftUp(self) -> bool"""
3618 return _core_.MouseEvent_LeftUp(*args, **kwargs)
3619
3620 def MiddleUp(*args, **kwargs):
3621 """MiddleUp(self) -> bool"""
3622 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
3623
3624 def RightUp(*args, **kwargs):
3625 """RightUp(self) -> bool"""
3626 return _core_.MouseEvent_RightUp(*args, **kwargs)
3627
3628 def LeftDClick(*args, **kwargs):
3629 """LeftDClick(self) -> bool"""
3630 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
3631
3632 def MiddleDClick(*args, **kwargs):
3633 """MiddleDClick(self) -> bool"""
3634 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
3635
3636 def RightDClick(*args, **kwargs):
3637 """RightDClick(self) -> bool"""
3638 return _core_.MouseEvent_RightDClick(*args, **kwargs)
3639
3640 def LeftIsDown(*args, **kwargs):
3641 """LeftIsDown(self) -> bool"""
3642 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
3643
3644 def MiddleIsDown(*args, **kwargs):
3645 """MiddleIsDown(self) -> bool"""
3646 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
3647
3648 def RightIsDown(*args, **kwargs):
3649 """RightIsDown(self) -> bool"""
3650 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
3651
3652 def Dragging(*args, **kwargs):
3653 """Dragging(self) -> bool"""
3654 return _core_.MouseEvent_Dragging(*args, **kwargs)
3655
3656 def Moving(*args, **kwargs):
3657 """Moving(self) -> bool"""
3658 return _core_.MouseEvent_Moving(*args, **kwargs)
3659
3660 def Entering(*args, **kwargs):
3661 """Entering(self) -> bool"""
3662 return _core_.MouseEvent_Entering(*args, **kwargs)
3663
3664 def Leaving(*args, **kwargs):
3665 """Leaving(self) -> bool"""
3666 return _core_.MouseEvent_Leaving(*args, **kwargs)
3667
3668 def GetPosition(*args, **kwargs):
3669 """
3670 GetPosition(self) -> Point
3671
3672 Returns the position of the mouse in window coordinates when the event
3673 happened.
3674 """
3675 return _core_.MouseEvent_GetPosition(*args, **kwargs)
3676
3677 def GetPositionTuple(*args, **kwargs):
3678 """
3679 GetPositionTuple() -> (x,y)
3680
3681 Returns the position of the mouse in window coordinates when the event
3682 happened.
3683 """
3684 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
3685
3686 def GetLogicalPosition(*args, **kwargs):
3687 """GetLogicalPosition(self, DC dc) -> Point"""
3688 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
3689
3690 def GetX(*args, **kwargs):
3691 """GetX(self) -> int"""
3692 return _core_.MouseEvent_GetX(*args, **kwargs)
3693
3694 def GetY(*args, **kwargs):
3695 """GetY(self) -> int"""
3696 return _core_.MouseEvent_GetY(*args, **kwargs)
3697
3698 def GetWheelRotation(*args, **kwargs):
3699 """GetWheelRotation(self) -> int"""
3700 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
3701
3702 def GetWheelDelta(*args, **kwargs):
3703 """GetWheelDelta(self) -> int"""
3704 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
3705
3706 def GetLinesPerAction(*args, **kwargs):
3707 """GetLinesPerAction(self) -> int"""
3708 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
3709
3710 def IsPageScroll(*args, **kwargs):
3711 """IsPageScroll(self) -> bool"""
3712 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3713
3714 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3715 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3716 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3717 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3718 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3719 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3720 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3721 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3722 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3723 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3724 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3725 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
3726
3727 class MouseEventPtr(MouseEvent):
3728 def __init__(self, this):
3729 self.this = this
3730 if not hasattr(self,"thisown"): self.thisown = 0
3731 self.__class__ = MouseEvent
3732 _core_.MouseEvent_swigregister(MouseEventPtr)
3733
3734 #---------------------------------------------------------------------------
3735
3736 class SetCursorEvent(Event):
3737 """Proxy of C++ SetCursorEvent class"""
3738 def __repr__(self):
3739 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3740 def __init__(self, *args, **kwargs):
3741 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
3742 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
3743 self.this = newobj.this
3744 self.thisown = 1
3745 del newobj.thisown
3746 def GetX(*args, **kwargs):
3747 """GetX(self) -> int"""
3748 return _core_.SetCursorEvent_GetX(*args, **kwargs)
3749
3750 def GetY(*args, **kwargs):
3751 """GetY(self) -> int"""
3752 return _core_.SetCursorEvent_GetY(*args, **kwargs)
3753
3754 def SetCursor(*args, **kwargs):
3755 """SetCursor(self, Cursor cursor)"""
3756 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
3757
3758 def GetCursor(*args, **kwargs):
3759 """GetCursor(self) -> Cursor"""
3760 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
3761
3762 def HasCursor(*args, **kwargs):
3763 """HasCursor(self) -> bool"""
3764 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
3765
3766
3767 class SetCursorEventPtr(SetCursorEvent):
3768 def __init__(self, this):
3769 self.this = this
3770 if not hasattr(self,"thisown"): self.thisown = 0
3771 self.__class__ = SetCursorEvent
3772 _core_.SetCursorEvent_swigregister(SetCursorEventPtr)
3773
3774 #---------------------------------------------------------------------------
3775
3776 class KeyEvent(Event):
3777 """Proxy of C++ KeyEvent class"""
3778 def __repr__(self):
3779 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3780 def __init__(self, *args, **kwargs):
3781 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
3782 newobj = _core_.new_KeyEvent(*args, **kwargs)
3783 self.this = newobj.this
3784 self.thisown = 1
3785 del newobj.thisown
3786 def ControlDown(*args, **kwargs):
3787 """ControlDown(self) -> bool"""
3788 return _core_.KeyEvent_ControlDown(*args, **kwargs)
3789
3790 def MetaDown(*args, **kwargs):
3791 """MetaDown(self) -> bool"""
3792 return _core_.KeyEvent_MetaDown(*args, **kwargs)
3793
3794 def AltDown(*args, **kwargs):
3795 """AltDown(self) -> bool"""
3796 return _core_.KeyEvent_AltDown(*args, **kwargs)
3797
3798 def ShiftDown(*args, **kwargs):
3799 """ShiftDown(self) -> bool"""
3800 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
3801
3802 def CmdDown(*args, **kwargs):
3803 """
3804 CmdDown(self) -> bool
3805
3806 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3807 platforms but the special "Apple" (a.k.a as "Command") key on
3808 Macs: it makes often sense to use it instead of, say, `ControlDown`
3809 because Cmd key is used for the same thing under Mac as Ctrl
3810 elsewhere. The Ctrl still exists, it's just not used for this
3811 purpose. So for non-Mac platforms this is the same as `ControlDown`
3812 and Macs this is the same as `MetaDown`.
3813 """
3814 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3815
3816 def HasModifiers(*args, **kwargs):
3817 """HasModifiers(self) -> bool"""
3818 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
3819
3820 def GetKeyCode(*args, **kwargs):
3821 """GetKeyCode(self) -> int"""
3822 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
3823
3824 KeyCode = GetKeyCode
3825 def GetUnicodeKey(*args, **kwargs):
3826 """GetUnicodeKey(self) -> int"""
3827 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
3828
3829 GetUniChar = GetUnicodeKey
3830 def GetRawKeyCode(*args, **kwargs):
3831 """GetRawKeyCode(self) -> unsigned int"""
3832 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
3833
3834 def GetRawKeyFlags(*args, **kwargs):
3835 """GetRawKeyFlags(self) -> unsigned int"""
3836 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
3837
3838 def GetPosition(*args, **kwargs):
3839 """
3840 GetPosition(self) -> Point
3841
3842 Find the position of the event.
3843 """
3844 return _core_.KeyEvent_GetPosition(*args, **kwargs)
3845
3846 def GetPositionTuple(*args, **kwargs):
3847 """
3848 GetPositionTuple() -> (x,y)
3849
3850 Find the position of the event.
3851 """
3852 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
3853
3854 def GetX(*args, **kwargs):
3855 """GetX(self) -> int"""
3856 return _core_.KeyEvent_GetX(*args, **kwargs)
3857
3858 def GetY(*args, **kwargs):
3859 """GetY(self) -> int"""
3860 return _core_.KeyEvent_GetY(*args, **kwargs)
3861
3862 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3863 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3864 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3865 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3866 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3867 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3868 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3869 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3870 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3871 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
3872
3873 class KeyEventPtr(KeyEvent):
3874 def __init__(self, this):
3875 self.this = this
3876 if not hasattr(self,"thisown"): self.thisown = 0
3877 self.__class__ = KeyEvent
3878 _core_.KeyEvent_swigregister(KeyEventPtr)
3879
3880 #---------------------------------------------------------------------------
3881
3882 class SizeEvent(Event):
3883 """Proxy of C++ SizeEvent class"""
3884 def __repr__(self):
3885 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3886 def __init__(self, *args, **kwargs):
3887 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
3888 newobj = _core_.new_SizeEvent(*args, **kwargs)
3889 self.this = newobj.this
3890 self.thisown = 1
3891 del newobj.thisown
3892 def GetSize(*args, **kwargs):
3893 """GetSize(self) -> Size"""
3894 return _core_.SizeEvent_GetSize(*args, **kwargs)
3895
3896 def GetRect(*args, **kwargs):
3897 """GetRect(self) -> Rect"""
3898 return _core_.SizeEvent_GetRect(*args, **kwargs)
3899
3900 def SetRect(*args, **kwargs):
3901 """SetRect(self, Rect rect)"""
3902 return _core_.SizeEvent_SetRect(*args, **kwargs)
3903
3904 def SetSize(*args, **kwargs):
3905 """SetSize(self, Size size)"""
3906 return _core_.SizeEvent_SetSize(*args, **kwargs)
3907
3908 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3909 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
3910
3911 class SizeEventPtr(SizeEvent):
3912 def __init__(self, this):
3913 self.this = this
3914 if not hasattr(self,"thisown"): self.thisown = 0
3915 self.__class__ = SizeEvent
3916 _core_.SizeEvent_swigregister(SizeEventPtr)
3917
3918 #---------------------------------------------------------------------------
3919
3920 class MoveEvent(Event):
3921 """Proxy of C++ MoveEvent class"""
3922 def __repr__(self):
3923 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3924 def __init__(self, *args, **kwargs):
3925 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
3926 newobj = _core_.new_MoveEvent(*args, **kwargs)
3927 self.this = newobj.this
3928 self.thisown = 1
3929 del newobj.thisown
3930 def GetPosition(*args, **kwargs):
3931 """GetPosition(self) -> Point"""
3932 return _core_.MoveEvent_GetPosition(*args, **kwargs)
3933
3934 def GetRect(*args, **kwargs):
3935 """GetRect(self) -> Rect"""
3936 return _core_.MoveEvent_GetRect(*args, **kwargs)
3937
3938 def SetRect(*args, **kwargs):
3939 """SetRect(self, Rect rect)"""
3940 return _core_.MoveEvent_SetRect(*args, **kwargs)
3941
3942 def SetPosition(*args, **kwargs):
3943 """SetPosition(self, Point pos)"""
3944 return _core_.MoveEvent_SetPosition(*args, **kwargs)
3945
3946 m_pos = property(GetPosition, SetPosition)
3947 m_rect = property(GetRect, SetRect)
3948
3949
3950 class MoveEventPtr(MoveEvent):
3951 def __init__(self, this):
3952 self.this = this
3953 if not hasattr(self,"thisown"): self.thisown = 0
3954 self.__class__ = MoveEvent
3955 _core_.MoveEvent_swigregister(MoveEventPtr)
3956
3957 #---------------------------------------------------------------------------
3958
3959 class PaintEvent(Event):
3960 """Proxy of C++ PaintEvent class"""
3961 def __repr__(self):
3962 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3963 def __init__(self, *args, **kwargs):
3964 """__init__(self, int Id=0) -> PaintEvent"""
3965 newobj = _core_.new_PaintEvent(*args, **kwargs)
3966 self.this = newobj.this
3967 self.thisown = 1
3968 del newobj.thisown
3969
3970 class PaintEventPtr(PaintEvent):
3971 def __init__(self, this):
3972 self.this = this
3973 if not hasattr(self,"thisown"): self.thisown = 0
3974 self.__class__ = PaintEvent
3975 _core_.PaintEvent_swigregister(PaintEventPtr)
3976
3977 class NcPaintEvent(Event):
3978 """Proxy of C++ NcPaintEvent class"""
3979 def __repr__(self):
3980 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3981 def __init__(self, *args, **kwargs):
3982 """__init__(self, int winid=0) -> NcPaintEvent"""
3983 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
3984 self.this = newobj.this
3985 self.thisown = 1
3986 del newobj.thisown
3987
3988 class NcPaintEventPtr(NcPaintEvent):
3989 def __init__(self, this):
3990 self.this = this
3991 if not hasattr(self,"thisown"): self.thisown = 0
3992 self.__class__ = NcPaintEvent
3993 _core_.NcPaintEvent_swigregister(NcPaintEventPtr)
3994
3995 #---------------------------------------------------------------------------
3996
3997 class EraseEvent(Event):
3998 """Proxy of C++ EraseEvent class"""
3999 def __repr__(self):
4000 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4001 def __init__(self, *args, **kwargs):
4002 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
4003 newobj = _core_.new_EraseEvent(*args, **kwargs)
4004 self.this = newobj.this
4005 self.thisown = 1
4006 del newobj.thisown
4007 def GetDC(*args, **kwargs):
4008 """GetDC(self) -> DC"""
4009 return _core_.EraseEvent_GetDC(*args, **kwargs)
4010
4011
4012 class EraseEventPtr(EraseEvent):
4013 def __init__(self, this):
4014 self.this = this
4015 if not hasattr(self,"thisown"): self.thisown = 0
4016 self.__class__ = EraseEvent
4017 _core_.EraseEvent_swigregister(EraseEventPtr)
4018
4019 #---------------------------------------------------------------------------
4020
4021 class FocusEvent(Event):
4022 """Proxy of C++ FocusEvent class"""
4023 def __repr__(self):
4024 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4025 def __init__(self, *args, **kwargs):
4026 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
4027 newobj = _core_.new_FocusEvent(*args, **kwargs)
4028 self.this = newobj.this
4029 self.thisown = 1
4030 del newobj.thisown
4031 def GetWindow(*args, **kwargs):
4032 """GetWindow(self) -> Window"""
4033 return _core_.FocusEvent_GetWindow(*args, **kwargs)
4034
4035 def SetWindow(*args, **kwargs):
4036 """SetWindow(self, Window win)"""
4037 return _core_.FocusEvent_SetWindow(*args, **kwargs)
4038
4039
4040 class FocusEventPtr(FocusEvent):
4041 def __init__(self, this):
4042 self.this = this
4043 if not hasattr(self,"thisown"): self.thisown = 0
4044 self.__class__ = FocusEvent
4045 _core_.FocusEvent_swigregister(FocusEventPtr)
4046
4047 #---------------------------------------------------------------------------
4048
4049 class ChildFocusEvent(CommandEvent):
4050 """Proxy of C++ ChildFocusEvent class"""
4051 def __repr__(self):
4052 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4053 def __init__(self, *args, **kwargs):
4054 """__init__(self, Window win=None) -> ChildFocusEvent"""
4055 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
4056 self.this = newobj.this
4057 self.thisown = 1
4058 del newobj.thisown
4059 def GetWindow(*args, **kwargs):
4060 """GetWindow(self) -> Window"""
4061 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
4062
4063
4064 class ChildFocusEventPtr(ChildFocusEvent):
4065 def __init__(self, this):
4066 self.this = this
4067 if not hasattr(self,"thisown"): self.thisown = 0
4068 self.__class__ = ChildFocusEvent
4069 _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
4070
4071 #---------------------------------------------------------------------------
4072
4073 class ActivateEvent(Event):
4074 """Proxy of C++ ActivateEvent class"""
4075 def __repr__(self):
4076 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4077 def __init__(self, *args, **kwargs):
4078 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
4079 newobj = _core_.new_ActivateEvent(*args, **kwargs)
4080 self.this = newobj.this
4081 self.thisown = 1
4082 del newobj.thisown
4083 def GetActive(*args, **kwargs):
4084 """GetActive(self) -> bool"""
4085 return _core_.ActivateEvent_GetActive(*args, **kwargs)
4086
4087
4088 class ActivateEventPtr(ActivateEvent):
4089 def __init__(self, this):
4090 self.this = this
4091 if not hasattr(self,"thisown"): self.thisown = 0
4092 self.__class__ = ActivateEvent
4093 _core_.ActivateEvent_swigregister(ActivateEventPtr)
4094
4095 #---------------------------------------------------------------------------
4096
4097 class InitDialogEvent(Event):
4098 """Proxy of C++ InitDialogEvent class"""
4099 def __repr__(self):
4100 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4101 def __init__(self, *args, **kwargs):
4102 """__init__(self, int Id=0) -> InitDialogEvent"""
4103 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
4104 self.this = newobj.this
4105 self.thisown = 1
4106 del newobj.thisown
4107
4108 class InitDialogEventPtr(InitDialogEvent):
4109 def __init__(self, this):
4110 self.this = this
4111 if not hasattr(self,"thisown"): self.thisown = 0
4112 self.__class__ = InitDialogEvent
4113 _core_.InitDialogEvent_swigregister(InitDialogEventPtr)
4114
4115 #---------------------------------------------------------------------------
4116
4117 class MenuEvent(Event):
4118 """Proxy of C++ MenuEvent class"""
4119 def __repr__(self):
4120 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4121 def __init__(self, *args, **kwargs):
4122 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
4123 newobj = _core_.new_MenuEvent(*args, **kwargs)
4124 self.this = newobj.this
4125 self.thisown = 1
4126 del newobj.thisown
4127 def GetMenuId(*args, **kwargs):
4128 """GetMenuId(self) -> int"""
4129 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
4130
4131 def IsPopup(*args, **kwargs):
4132 """IsPopup(self) -> bool"""
4133 return _core_.MenuEvent_IsPopup(*args, **kwargs)
4134
4135 def GetMenu(*args, **kwargs):
4136 """GetMenu(self) -> Menu"""
4137 return _core_.MenuEvent_GetMenu(*args, **kwargs)
4138
4139
4140 class MenuEventPtr(MenuEvent):
4141 def __init__(self, this):
4142 self.this = this
4143 if not hasattr(self,"thisown"): self.thisown = 0
4144 self.__class__ = MenuEvent
4145 _core_.MenuEvent_swigregister(MenuEventPtr)
4146
4147 #---------------------------------------------------------------------------
4148
4149 class CloseEvent(Event):
4150 """Proxy of C++ CloseEvent class"""
4151 def __repr__(self):
4152 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4153 def __init__(self, *args, **kwargs):
4154 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
4155 newobj = _core_.new_CloseEvent(*args, **kwargs)
4156 self.this = newobj.this
4157 self.thisown = 1
4158 del newobj.thisown
4159 def SetLoggingOff(*args, **kwargs):
4160 """SetLoggingOff(self, bool logOff)"""
4161 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
4162
4163 def GetLoggingOff(*args, **kwargs):
4164 """GetLoggingOff(self) -> bool"""
4165 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
4166
4167 def Veto(*args, **kwargs):
4168 """Veto(self, bool veto=True)"""
4169 return _core_.CloseEvent_Veto(*args, **kwargs)
4170
4171 def SetCanVeto(*args, **kwargs):
4172 """SetCanVeto(self, bool canVeto)"""
4173 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
4174
4175 def CanVeto(*args, **kwargs):
4176 """CanVeto(self) -> bool"""
4177 return _core_.CloseEvent_CanVeto(*args, **kwargs)
4178
4179 def GetVeto(*args, **kwargs):
4180 """GetVeto(self) -> bool"""
4181 return _core_.CloseEvent_GetVeto(*args, **kwargs)
4182
4183
4184 class CloseEventPtr(CloseEvent):
4185 def __init__(self, this):
4186 self.this = this
4187 if not hasattr(self,"thisown"): self.thisown = 0
4188 self.__class__ = CloseEvent
4189 _core_.CloseEvent_swigregister(CloseEventPtr)
4190
4191 #---------------------------------------------------------------------------
4192
4193 class ShowEvent(Event):
4194 """Proxy of C++ ShowEvent class"""
4195 def __repr__(self):
4196 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4197 def __init__(self, *args, **kwargs):
4198 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
4199 newobj = _core_.new_ShowEvent(*args, **kwargs)
4200 self.this = newobj.this
4201 self.thisown = 1
4202 del newobj.thisown
4203 def SetShow(*args, **kwargs):
4204 """SetShow(self, bool show)"""
4205 return _core_.ShowEvent_SetShow(*args, **kwargs)
4206
4207 def GetShow(*args, **kwargs):
4208 """GetShow(self) -> bool"""
4209 return _core_.ShowEvent_GetShow(*args, **kwargs)
4210
4211
4212 class ShowEventPtr(ShowEvent):
4213 def __init__(self, this):
4214 self.this = this
4215 if not hasattr(self,"thisown"): self.thisown = 0
4216 self.__class__ = ShowEvent
4217 _core_.ShowEvent_swigregister(ShowEventPtr)
4218
4219 #---------------------------------------------------------------------------
4220
4221 class IconizeEvent(Event):
4222 """Proxy of C++ IconizeEvent class"""
4223 def __repr__(self):
4224 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4225 def __init__(self, *args, **kwargs):
4226 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
4227 newobj = _core_.new_IconizeEvent(*args, **kwargs)
4228 self.this = newobj.this
4229 self.thisown = 1
4230 del newobj.thisown
4231 def Iconized(*args, **kwargs):
4232 """Iconized(self) -> bool"""
4233 return _core_.IconizeEvent_Iconized(*args, **kwargs)
4234
4235
4236 class IconizeEventPtr(IconizeEvent):
4237 def __init__(self, this):
4238 self.this = this
4239 if not hasattr(self,"thisown"): self.thisown = 0
4240 self.__class__ = IconizeEvent
4241 _core_.IconizeEvent_swigregister(IconizeEventPtr)
4242
4243 #---------------------------------------------------------------------------
4244
4245 class MaximizeEvent(Event):
4246 """Proxy of C++ MaximizeEvent class"""
4247 def __repr__(self):
4248 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4249 def __init__(self, *args, **kwargs):
4250 """__init__(self, int id=0) -> MaximizeEvent"""
4251 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
4252 self.this = newobj.this
4253 self.thisown = 1
4254 del newobj.thisown
4255
4256 class MaximizeEventPtr(MaximizeEvent):
4257 def __init__(self, this):
4258 self.this = this
4259 if not hasattr(self,"thisown"): self.thisown = 0
4260 self.__class__ = MaximizeEvent
4261 _core_.MaximizeEvent_swigregister(MaximizeEventPtr)
4262
4263 #---------------------------------------------------------------------------
4264
4265 class DropFilesEvent(Event):
4266 """Proxy of C++ DropFilesEvent class"""
4267 def __init__(self): raise RuntimeError, "No constructor defined"
4268 def __repr__(self):
4269 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4270 def GetPosition(*args, **kwargs):
4271 """GetPosition(self) -> Point"""
4272 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
4273
4274 def GetNumberOfFiles(*args, **kwargs):
4275 """GetNumberOfFiles(self) -> int"""
4276 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
4277
4278 def GetFiles(*args, **kwargs):
4279 """GetFiles(self) -> PyObject"""
4280 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
4281
4282
4283 class DropFilesEventPtr(DropFilesEvent):
4284 def __init__(self, this):
4285 self.this = this
4286 if not hasattr(self,"thisown"): self.thisown = 0
4287 self.__class__ = DropFilesEvent
4288 _core_.DropFilesEvent_swigregister(DropFilesEventPtr)
4289
4290 #---------------------------------------------------------------------------
4291
4292 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4293 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
4294 class UpdateUIEvent(CommandEvent):
4295 """Proxy of C++ UpdateUIEvent class"""
4296 def __repr__(self):
4297 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4298 def __init__(self, *args, **kwargs):
4299 """__init__(self, int commandId=0) -> UpdateUIEvent"""
4300 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
4301 self.this = newobj.this
4302 self.thisown = 1
4303 del newobj.thisown
4304 def GetChecked(*args, **kwargs):
4305 """GetChecked(self) -> bool"""
4306 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
4307
4308 def GetEnabled(*args, **kwargs):
4309 """GetEnabled(self) -> bool"""
4310 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
4311
4312 def GetText(*args, **kwargs):
4313 """GetText(self) -> String"""
4314 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
4315
4316 def GetSetText(*args, **kwargs):
4317 """GetSetText(self) -> bool"""
4318 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
4319
4320 def GetSetChecked(*args, **kwargs):
4321 """GetSetChecked(self) -> bool"""
4322 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
4323
4324 def GetSetEnabled(*args, **kwargs):
4325 """GetSetEnabled(self) -> bool"""
4326 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
4327
4328 def Check(*args, **kwargs):
4329 """Check(self, bool check)"""
4330 return _core_.UpdateUIEvent_Check(*args, **kwargs)
4331
4332 def Enable(*args, **kwargs):
4333 """Enable(self, bool enable)"""
4334 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
4335
4336 def SetText(*args, **kwargs):
4337 """SetText(self, String text)"""
4338 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
4339
4340 def SetUpdateInterval(*args, **kwargs):
4341 """SetUpdateInterval(long updateInterval)"""
4342 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4343
4344 SetUpdateInterval = staticmethod(SetUpdateInterval)
4345 def GetUpdateInterval(*args, **kwargs):
4346 """GetUpdateInterval() -> long"""
4347 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4348
4349 GetUpdateInterval = staticmethod(GetUpdateInterval)
4350 def CanUpdate(*args, **kwargs):
4351 """CanUpdate(Window win) -> bool"""
4352 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4353
4354 CanUpdate = staticmethod(CanUpdate)
4355 def ResetUpdateTime(*args, **kwargs):
4356 """ResetUpdateTime()"""
4357 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4358
4359 ResetUpdateTime = staticmethod(ResetUpdateTime)
4360 def SetMode(*args, **kwargs):
4361 """SetMode(int mode)"""
4362 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4363
4364 SetMode = staticmethod(SetMode)
4365 def GetMode(*args, **kwargs):
4366 """GetMode() -> int"""
4367 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4368
4369 GetMode = staticmethod(GetMode)
4370
4371 class UpdateUIEventPtr(UpdateUIEvent):
4372 def __init__(self, this):
4373 self.this = this
4374 if not hasattr(self,"thisown"): self.thisown = 0
4375 self.__class__ = UpdateUIEvent
4376 _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
4377
4378 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4379 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
4380 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4381
4382 def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4383 """UpdateUIEvent_GetUpdateInterval() -> long"""
4384 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4385
4386 def UpdateUIEvent_CanUpdate(*args, **kwargs):
4387 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
4388 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4389
4390 def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4391 """UpdateUIEvent_ResetUpdateTime()"""
4392 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4393
4394 def UpdateUIEvent_SetMode(*args, **kwargs):
4395 """UpdateUIEvent_SetMode(int mode)"""
4396 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4397
4398 def UpdateUIEvent_GetMode(*args, **kwargs):
4399 """UpdateUIEvent_GetMode() -> int"""
4400 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4401
4402 #---------------------------------------------------------------------------
4403
4404 class SysColourChangedEvent(Event):
4405 """Proxy of C++ SysColourChangedEvent class"""
4406 def __repr__(self):
4407 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4408 def __init__(self, *args, **kwargs):
4409 """__init__(self) -> SysColourChangedEvent"""
4410 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
4411 self.this = newobj.this
4412 self.thisown = 1
4413 del newobj.thisown
4414
4415 class SysColourChangedEventPtr(SysColourChangedEvent):
4416 def __init__(self, this):
4417 self.this = this
4418 if not hasattr(self,"thisown"): self.thisown = 0
4419 self.__class__ = SysColourChangedEvent
4420 _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
4421
4422 #---------------------------------------------------------------------------
4423
4424 class MouseCaptureChangedEvent(Event):
4425 """Proxy of C++ MouseCaptureChangedEvent class"""
4426 def __repr__(self):
4427 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4428 def __init__(self, *args, **kwargs):
4429 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
4430 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
4431 self.this = newobj.this
4432 self.thisown = 1
4433 del newobj.thisown
4434 def GetCapturedWindow(*args, **kwargs):
4435 """GetCapturedWindow(self) -> Window"""
4436 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
4437
4438
4439 class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4440 def __init__(self, this):
4441 self.this = this
4442 if not hasattr(self,"thisown"): self.thisown = 0
4443 self.__class__ = MouseCaptureChangedEvent
4444 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
4445
4446 #---------------------------------------------------------------------------
4447
4448 class DisplayChangedEvent(Event):
4449 """Proxy of C++ DisplayChangedEvent class"""
4450 def __repr__(self):
4451 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4452 def __init__(self, *args, **kwargs):
4453 """__init__(self) -> DisplayChangedEvent"""
4454 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
4455 self.this = newobj.this
4456 self.thisown = 1
4457 del newobj.thisown
4458
4459 class DisplayChangedEventPtr(DisplayChangedEvent):
4460 def __init__(self, this):
4461 self.this = this
4462 if not hasattr(self,"thisown"): self.thisown = 0
4463 self.__class__ = DisplayChangedEvent
4464 _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
4465
4466 #---------------------------------------------------------------------------
4467
4468 class PaletteChangedEvent(Event):
4469 """Proxy of C++ PaletteChangedEvent class"""
4470 def __repr__(self):
4471 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4472 def __init__(self, *args, **kwargs):
4473 """__init__(self, int id=0) -> PaletteChangedEvent"""
4474 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
4475 self.this = newobj.this
4476 self.thisown = 1
4477 del newobj.thisown
4478 def SetChangedWindow(*args, **kwargs):
4479 """SetChangedWindow(self, Window win)"""
4480 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
4481
4482 def GetChangedWindow(*args, **kwargs):
4483 """GetChangedWindow(self) -> Window"""
4484 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
4485
4486
4487 class PaletteChangedEventPtr(PaletteChangedEvent):
4488 def __init__(self, this):
4489 self.this = this
4490 if not hasattr(self,"thisown"): self.thisown = 0
4491 self.__class__ = PaletteChangedEvent
4492 _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
4493
4494 #---------------------------------------------------------------------------
4495
4496 class QueryNewPaletteEvent(Event):
4497 """Proxy of C++ QueryNewPaletteEvent class"""
4498 def __repr__(self):
4499 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4500 def __init__(self, *args, **kwargs):
4501 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
4502 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
4503 self.this = newobj.this
4504 self.thisown = 1
4505 del newobj.thisown
4506 def SetPaletteRealized(*args, **kwargs):
4507 """SetPaletteRealized(self, bool realized)"""
4508 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
4509
4510 def GetPaletteRealized(*args, **kwargs):
4511 """GetPaletteRealized(self) -> bool"""
4512 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
4513
4514
4515 class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4516 def __init__(self, this):
4517 self.this = this
4518 if not hasattr(self,"thisown"): self.thisown = 0
4519 self.__class__ = QueryNewPaletteEvent
4520 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
4521
4522 #---------------------------------------------------------------------------
4523
4524 class NavigationKeyEvent(Event):
4525 """Proxy of C++ NavigationKeyEvent class"""
4526 def __repr__(self):
4527 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4528 def __init__(self, *args, **kwargs):
4529 """__init__(self) -> NavigationKeyEvent"""
4530 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
4531 self.this = newobj.this
4532 self.thisown = 1
4533 del newobj.thisown
4534 def GetDirection(*args, **kwargs):
4535 """GetDirection(self) -> bool"""
4536 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
4537
4538 def SetDirection(*args, **kwargs):
4539 """SetDirection(self, bool forward)"""
4540 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
4541
4542 def IsWindowChange(*args, **kwargs):
4543 """IsWindowChange(self) -> bool"""
4544 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
4545
4546 def SetWindowChange(*args, **kwargs):
4547 """SetWindowChange(self, bool ischange)"""
4548 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
4549
4550 def SetFlags(*args, **kwargs):
4551 """SetFlags(self, long flags)"""
4552 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4553
4554 def GetCurrentFocus(*args, **kwargs):
4555 """GetCurrentFocus(self) -> Window"""
4556 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
4557
4558 def SetCurrentFocus(*args, **kwargs):
4559 """SetCurrentFocus(self, Window win)"""
4560 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
4561
4562 IsBackward = _core_.NavigationKeyEvent_IsBackward
4563 IsForward = _core_.NavigationKeyEvent_IsForward
4564 WinChange = _core_.NavigationKeyEvent_WinChange
4565
4566 class NavigationKeyEventPtr(NavigationKeyEvent):
4567 def __init__(self, this):
4568 self.this = this
4569 if not hasattr(self,"thisown"): self.thisown = 0
4570 self.__class__ = NavigationKeyEvent
4571 _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
4572
4573 #---------------------------------------------------------------------------
4574
4575 class WindowCreateEvent(CommandEvent):
4576 """Proxy of C++ WindowCreateEvent class"""
4577 def __repr__(self):
4578 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4579 def __init__(self, *args, **kwargs):
4580 """__init__(self, Window win=None) -> WindowCreateEvent"""
4581 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
4582 self.this = newobj.this
4583 self.thisown = 1
4584 del newobj.thisown
4585 def GetWindow(*args, **kwargs):
4586 """GetWindow(self) -> Window"""
4587 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
4588
4589
4590 class WindowCreateEventPtr(WindowCreateEvent):
4591 def __init__(self, this):
4592 self.this = this
4593 if not hasattr(self,"thisown"): self.thisown = 0
4594 self.__class__ = WindowCreateEvent
4595 _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
4596
4597 class WindowDestroyEvent(CommandEvent):
4598 """Proxy of C++ WindowDestroyEvent class"""
4599 def __repr__(self):
4600 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4601 def __init__(self, *args, **kwargs):
4602 """__init__(self, Window win=None) -> WindowDestroyEvent"""
4603 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
4604 self.this = newobj.this
4605 self.thisown = 1
4606 del newobj.thisown
4607 def GetWindow(*args, **kwargs):
4608 """GetWindow(self) -> Window"""
4609 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
4610
4611
4612 class WindowDestroyEventPtr(WindowDestroyEvent):
4613 def __init__(self, this):
4614 self.this = this
4615 if not hasattr(self,"thisown"): self.thisown = 0
4616 self.__class__ = WindowDestroyEvent
4617 _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
4618
4619 #---------------------------------------------------------------------------
4620
4621 class ContextMenuEvent(CommandEvent):
4622 """Proxy of C++ ContextMenuEvent class"""
4623 def __repr__(self):
4624 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4625 def __init__(self, *args, **kwargs):
4626 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
4627 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
4628 self.this = newobj.this
4629 self.thisown = 1
4630 del newobj.thisown
4631 def GetPosition(*args, **kwargs):
4632 """GetPosition(self) -> Point"""
4633 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
4634
4635 def SetPosition(*args, **kwargs):
4636 """SetPosition(self, Point pos)"""
4637 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
4638
4639
4640 class ContextMenuEventPtr(ContextMenuEvent):
4641 def __init__(self, this):
4642 self.this = this
4643 if not hasattr(self,"thisown"): self.thisown = 0
4644 self.__class__ = ContextMenuEvent
4645 _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
4646
4647 #---------------------------------------------------------------------------
4648
4649 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4650 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
4651 class IdleEvent(Event):
4652 """Proxy of C++ IdleEvent class"""
4653 def __repr__(self):
4654 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4655 def __init__(self, *args, **kwargs):
4656 """__init__(self) -> IdleEvent"""
4657 newobj = _core_.new_IdleEvent(*args, **kwargs)
4658 self.this = newobj.this
4659 self.thisown = 1
4660 del newobj.thisown
4661 def RequestMore(*args, **kwargs):
4662 """RequestMore(self, bool needMore=True)"""
4663 return _core_.IdleEvent_RequestMore(*args, **kwargs)
4664
4665 def MoreRequested(*args, **kwargs):
4666 """MoreRequested(self) -> bool"""
4667 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
4668
4669 def SetMode(*args, **kwargs):
4670 """SetMode(int mode)"""
4671 return _core_.IdleEvent_SetMode(*args, **kwargs)
4672
4673 SetMode = staticmethod(SetMode)
4674 def GetMode(*args, **kwargs):
4675 """GetMode() -> int"""
4676 return _core_.IdleEvent_GetMode(*args, **kwargs)
4677
4678 GetMode = staticmethod(GetMode)
4679 def CanSend(*args, **kwargs):
4680 """CanSend(Window win) -> bool"""
4681 return _core_.IdleEvent_CanSend(*args, **kwargs)
4682
4683 CanSend = staticmethod(CanSend)
4684
4685 class IdleEventPtr(IdleEvent):
4686 def __init__(self, this):
4687 self.this = this
4688 if not hasattr(self,"thisown"): self.thisown = 0
4689 self.__class__ = IdleEvent
4690 _core_.IdleEvent_swigregister(IdleEventPtr)
4691
4692 def IdleEvent_SetMode(*args, **kwargs):
4693 """IdleEvent_SetMode(int mode)"""
4694 return _core_.IdleEvent_SetMode(*args, **kwargs)
4695
4696 def IdleEvent_GetMode(*args, **kwargs):
4697 """IdleEvent_GetMode() -> int"""
4698 return _core_.IdleEvent_GetMode(*args, **kwargs)
4699
4700 def IdleEvent_CanSend(*args, **kwargs):
4701 """IdleEvent_CanSend(Window win) -> bool"""
4702 return _core_.IdleEvent_CanSend(*args, **kwargs)
4703
4704 #---------------------------------------------------------------------------
4705
4706 class PyEvent(Event):
4707 """Proxy of C++ PyEvent class"""
4708 def __repr__(self):
4709 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4710 def __init__(self, *args, **kwargs):
4711 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
4712 newobj = _core_.new_PyEvent(*args, **kwargs)
4713 self.this = newobj.this
4714 self.thisown = 1
4715 del newobj.thisown
4716 self.SetSelf(self)
4717
4718 def __del__(self, destroy=_core_.delete_PyEvent):
4719 """__del__(self)"""
4720 try:
4721 if self.thisown: destroy(self)
4722 except: pass
4723
4724 def SetSelf(*args, **kwargs):
4725 """SetSelf(self, PyObject self)"""
4726 return _core_.PyEvent_SetSelf(*args, **kwargs)
4727
4728 def GetSelf(*args, **kwargs):
4729 """GetSelf(self) -> PyObject"""
4730 return _core_.PyEvent_GetSelf(*args, **kwargs)
4731
4732
4733 class PyEventPtr(PyEvent):
4734 def __init__(self, this):
4735 self.this = this
4736 if not hasattr(self,"thisown"): self.thisown = 0
4737 self.__class__ = PyEvent
4738 _core_.PyEvent_swigregister(PyEventPtr)
4739
4740 class PyCommandEvent(CommandEvent):
4741 """Proxy of C++ PyCommandEvent class"""
4742 def __repr__(self):
4743 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4744 def __init__(self, *args, **kwargs):
4745 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
4746 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
4747 self.this = newobj.this
4748 self.thisown = 1
4749 del newobj.thisown
4750 self.SetSelf(self)
4751
4752 def __del__(self, destroy=_core_.delete_PyCommandEvent):
4753 """__del__(self)"""
4754 try:
4755 if self.thisown: destroy(self)
4756 except: pass
4757
4758 def SetSelf(*args, **kwargs):
4759 """SetSelf(self, PyObject self)"""
4760 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
4761
4762 def GetSelf(*args, **kwargs):
4763 """GetSelf(self) -> PyObject"""
4764 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
4765
4766
4767 class PyCommandEventPtr(PyCommandEvent):
4768 def __init__(self, this):
4769 self.this = this
4770 if not hasattr(self,"thisown"): self.thisown = 0
4771 self.__class__ = PyCommandEvent
4772 _core_.PyCommandEvent_swigregister(PyCommandEventPtr)
4773
4774 #---------------------------------------------------------------------------
4775
4776 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4777 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4778 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4779 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4780 PRINT_WINDOWS = _core_.PRINT_WINDOWS
4781 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
4782 class PyApp(EvtHandler):
4783 """
4784 The ``wx.PyApp`` class is an *implementation detail*, please use the
4785 `wx.App` class (or some other derived class) instead.
4786 """
4787 def __repr__(self):
4788 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4789 def __init__(self, *args, **kwargs):
4790 """
4791 __init__(self) -> PyApp
4792
4793 Create a new application object, starting the bootstrap process.
4794 """
4795 newobj = _core_.new_PyApp(*args, **kwargs)
4796 self.this = newobj.this
4797 self.thisown = 1
4798 del newobj.thisown
4799 self._setCallbackInfo(self, PyApp)
4800 self._setOORInfo(self)
4801
4802 def __del__(self, destroy=_core_.delete_PyApp):
4803 """__del__(self)"""
4804 try:
4805 if self.thisown: destroy(self)
4806 except: pass
4807
4808 def _setCallbackInfo(*args, **kwargs):
4809 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
4810 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
4811
4812 def GetAppName(*args, **kwargs):
4813 """
4814 GetAppName(self) -> String
4815
4816 Get the application name.
4817 """
4818 return _core_.PyApp_GetAppName(*args, **kwargs)
4819
4820 def SetAppName(*args, **kwargs):
4821 """
4822 SetAppName(self, String name)
4823
4824 Set the application name. This value may be used automatically by
4825 `wx.Config` and such.
4826 """
4827 return _core_.PyApp_SetAppName(*args, **kwargs)
4828
4829 def GetClassName(*args, **kwargs):
4830 """
4831 GetClassName(self) -> String
4832
4833 Get the application's class name.
4834 """
4835 return _core_.PyApp_GetClassName(*args, **kwargs)
4836
4837 def SetClassName(*args, **kwargs):
4838 """
4839 SetClassName(self, String name)
4840
4841 Set the application's class name. This value may be used for
4842 X-resources if applicable for the platform
4843 """
4844 return _core_.PyApp_SetClassName(*args, **kwargs)
4845
4846 def GetVendorName(*args, **kwargs):
4847 """
4848 GetVendorName(self) -> String
4849
4850 Get the application's vendor name.
4851 """
4852 return _core_.PyApp_GetVendorName(*args, **kwargs)
4853
4854 def SetVendorName(*args, **kwargs):
4855 """
4856 SetVendorName(self, String name)
4857
4858 Set the application's vendor name. This value may be used
4859 automatically by `wx.Config` and such.
4860 """
4861 return _core_.PyApp_SetVendorName(*args, **kwargs)
4862
4863 def GetTraits(*args, **kwargs):
4864 """
4865 GetTraits(self) -> wxAppTraits
4866
4867 Return (and create if necessary) the app traits object to which we
4868 delegate for everything which either should be configurable by the
4869 user (then he can change the default behaviour simply by overriding
4870 CreateTraits() and returning his own traits object) or which is
4871 GUI/console dependent as then wx.AppTraits allows us to abstract the
4872 differences behind the common facade.
4873
4874 :todo: Add support for overriding CreateAppTraits in wxPython.
4875 """
4876 return _core_.PyApp_GetTraits(*args, **kwargs)
4877
4878 def ProcessPendingEvents(*args, **kwargs):
4879 """
4880 ProcessPendingEvents(self)
4881
4882 Process all events in the Pending Events list -- it is necessary to
4883 call this function to process posted events. This normally happens
4884 during each event loop iteration.
4885 """
4886 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
4887
4888 def Yield(*args, **kwargs):
4889 """
4890 Yield(self, bool onlyIfNeeded=False) -> bool
4891
4892 Process all currently pending events right now, instead of waiting
4893 until return to the event loop. It is an error to call ``Yield``
4894 recursively unless the value of ``onlyIfNeeded`` is True.
4895
4896 :warning: This function is dangerous as it can lead to unexpected
4897 reentrancies (i.e. when called from an event handler it may
4898 result in calling the same event handler again), use with
4899 extreme care or, better, don't use at all!
4900
4901 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
4902
4903 """
4904 return _core_.PyApp_Yield(*args, **kwargs)
4905
4906 def WakeUpIdle(*args, **kwargs):
4907 """
4908 WakeUpIdle(self)
4909
4910 Make sure that idle events are sent again.
4911 :see: `wx.WakeUpIdle`
4912 """
4913 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
4914
4915 def IsMainLoopRunning(*args, **kwargs):
4916 """
4917 IsMainLoopRunning() -> bool
4918
4919 Returns True if we're running the main loop, i.e. if the events can
4920 currently be dispatched.
4921 """
4922 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
4923
4924 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
4925 def MainLoop(*args, **kwargs):
4926 """
4927 MainLoop(self) -> int
4928
4929 Execute the main GUI loop, the function doesn't normally return until
4930 all top level windows have been closed and destroyed.
4931 """
4932 return _core_.PyApp_MainLoop(*args, **kwargs)
4933
4934 def Exit(*args, **kwargs):
4935 """
4936 Exit(self)
4937
4938 Exit the main loop thus terminating the application.
4939 :see: `wx.Exit`
4940 """
4941 return _core_.PyApp_Exit(*args, **kwargs)
4942
4943 def ExitMainLoop(*args, **kwargs):
4944 """
4945 ExitMainLoop(self)
4946
4947 Exit the main GUI loop during the next iteration of the main
4948 loop, (i.e. it does not stop the program immediately!)
4949 """
4950 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
4951
4952 def Pending(*args, **kwargs):
4953 """
4954 Pending(self) -> bool
4955
4956 Returns True if there are unprocessed events in the event queue.
4957 """
4958 return _core_.PyApp_Pending(*args, **kwargs)
4959
4960 def Dispatch(*args, **kwargs):
4961 """
4962 Dispatch(self) -> bool
4963
4964 Process the first event in the event queue (blocks until an event
4965 appears if there are none currently)
4966 """
4967 return _core_.PyApp_Dispatch(*args, **kwargs)
4968
4969 def ProcessIdle(*args, **kwargs):
4970 """
4971 ProcessIdle(self) -> bool
4972
4973 Called from the MainLoop when the application becomes idle (there are
4974 no pending events) and sends a `wx.IdleEvent` to all interested
4975 parties. Returns True if more idle events are needed, False if not.
4976 """
4977 return _core_.PyApp_ProcessIdle(*args, **kwargs)
4978
4979 def SendIdleEvents(*args, **kwargs):
4980 """
4981 SendIdleEvents(self, Window win, IdleEvent event) -> bool
4982
4983 Send idle event to window and all subwindows. Returns True if more
4984 idle time is requested.
4985 """
4986 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
4987
4988 def IsActive(*args, **kwargs):
4989 """
4990 IsActive(self) -> bool
4991
4992 Return True if our app has focus.
4993 """
4994 return _core_.PyApp_IsActive(*args, **kwargs)
4995
4996 def SetTopWindow(*args, **kwargs):
4997 """
4998 SetTopWindow(self, Window win)
4999
5000 Set the *main* top level window
5001 """
5002 return _core_.PyApp_SetTopWindow(*args, **kwargs)
5003
5004 def GetTopWindow(*args, **kwargs):
5005 """
5006 GetTopWindow(self) -> Window
5007
5008 Return the *main* top level window (if it hadn't been set previously
5009 with SetTopWindow(), will return just some top level window and, if
5010 there not any, will return None)
5011 """
5012 return _core_.PyApp_GetTopWindow(*args, **kwargs)
5013
5014 def SetExitOnFrameDelete(*args, **kwargs):
5015 """
5016 SetExitOnFrameDelete(self, bool flag)
5017
5018 Control the exit behaviour: by default, the program will exit the main
5019 loop (and so, usually, terminate) when the last top-level program
5020 window is deleted. Beware that if you disable this behaviour (with
5021 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
5022 explicitly from somewhere.
5023 """
5024 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
5025
5026 def GetExitOnFrameDelete(*args, **kwargs):
5027 """
5028 GetExitOnFrameDelete(self) -> bool
5029
5030 Get the current exit behaviour setting.
5031 """
5032 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
5033
5034 def SetUseBestVisual(*args, **kwargs):
5035 """
5036 SetUseBestVisual(self, bool flag)
5037
5038 Set whether the app should try to use the best available visual on
5039 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
5040 """
5041 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
5042
5043 def GetUseBestVisual(*args, **kwargs):
5044 """
5045 GetUseBestVisual(self) -> bool
5046
5047 Get current UseBestVisual setting.
5048 """
5049 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
5050
5051 def SetPrintMode(*args, **kwargs):
5052 """SetPrintMode(self, int mode)"""
5053 return _core_.PyApp_SetPrintMode(*args, **kwargs)
5054
5055 def GetPrintMode(*args, **kwargs):
5056 """GetPrintMode(self) -> int"""
5057 return _core_.PyApp_GetPrintMode(*args, **kwargs)
5058
5059 def SetAssertMode(*args, **kwargs):
5060 """
5061 SetAssertMode(self, int mode)
5062
5063 Set the OnAssert behaviour for debug and hybrid builds.
5064 """
5065 return _core_.PyApp_SetAssertMode(*args, **kwargs)
5066
5067 def GetAssertMode(*args, **kwargs):
5068 """
5069 GetAssertMode(self) -> int
5070
5071 Get the current OnAssert behaviour setting.
5072 """
5073 return _core_.PyApp_GetAssertMode(*args, **kwargs)
5074
5075 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
5076 """GetMacSupportPCMenuShortcuts() -> bool"""
5077 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5078
5079 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
5080 def GetMacAboutMenuItemId(*args, **kwargs):
5081 """GetMacAboutMenuItemId() -> long"""
5082 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5083
5084 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
5085 def GetMacPreferencesMenuItemId(*args, **kwargs):
5086 """GetMacPreferencesMenuItemId() -> long"""
5087 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5088
5089 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
5090 def GetMacExitMenuItemId(*args, **kwargs):
5091 """GetMacExitMenuItemId() -> long"""
5092 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5093
5094 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
5095 def GetMacHelpMenuTitleName(*args, **kwargs):
5096 """GetMacHelpMenuTitleName() -> String"""
5097 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5098
5099 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
5100 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
5101 """SetMacSupportPCMenuShortcuts(bool val)"""
5102 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5103
5104 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
5105 def SetMacAboutMenuItemId(*args, **kwargs):
5106 """SetMacAboutMenuItemId(long val)"""
5107 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5108
5109 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
5110 def SetMacPreferencesMenuItemId(*args, **kwargs):
5111 """SetMacPreferencesMenuItemId(long val)"""
5112 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5113
5114 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
5115 def SetMacExitMenuItemId(*args, **kwargs):
5116 """SetMacExitMenuItemId(long val)"""
5117 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5118
5119 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
5120 def SetMacHelpMenuTitleName(*args, **kwargs):
5121 """SetMacHelpMenuTitleName(String val)"""
5122 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5123
5124 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
5125 def _BootstrapApp(*args, **kwargs):
5126 """
5127 _BootstrapApp(self)
5128
5129 For internal use only
5130 """
5131 return _core_.PyApp__BootstrapApp(*args, **kwargs)
5132
5133 def GetComCtl32Version(*args, **kwargs):
5134 """
5135 GetComCtl32Version() -> int
5136
5137 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5138 it wasn't found at all. Raises an exception on non-Windows platforms.
5139 """
5140 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5141
5142 GetComCtl32Version = staticmethod(GetComCtl32Version)
5143
5144 class PyAppPtr(PyApp):
5145 def __init__(self, this):
5146 self.this = this
5147 if not hasattr(self,"thisown"): self.thisown = 0
5148 self.__class__ = PyApp
5149 _core_.PyApp_swigregister(PyAppPtr)
5150
5151 def PyApp_IsMainLoopRunning(*args, **kwargs):
5152 """
5153 PyApp_IsMainLoopRunning() -> bool
5154
5155 Returns True if we're running the main loop, i.e. if the events can
5156 currently be dispatched.
5157 """
5158 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5159
5160 def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5161 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
5162 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5163
5164 def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5165 """PyApp_GetMacAboutMenuItemId() -> long"""
5166 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5167
5168 def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5169 """PyApp_GetMacPreferencesMenuItemId() -> long"""
5170 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5171
5172 def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5173 """PyApp_GetMacExitMenuItemId() -> long"""
5174 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5175
5176 def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
5177 """PyApp_GetMacHelpMenuTitleName() -> String"""
5178 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5179
5180 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5181 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
5182 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5183
5184 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5185 """PyApp_SetMacAboutMenuItemId(long val)"""
5186 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5187
5188 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5189 """PyApp_SetMacPreferencesMenuItemId(long val)"""
5190 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5191
5192 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5193 """PyApp_SetMacExitMenuItemId(long val)"""
5194 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5195
5196 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
5197 """PyApp_SetMacHelpMenuTitleName(String val)"""
5198 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5199
5200 def PyApp_GetComCtl32Version(*args, **kwargs):
5201 """
5202 PyApp_GetComCtl32Version() -> int
5203
5204 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5205 it wasn't found at all. Raises an exception on non-Windows platforms.
5206 """
5207 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5208
5209 #---------------------------------------------------------------------------
5210
5211
5212 def Exit(*args, **kwargs):
5213 """
5214 Exit()
5215
5216 Force an exit of the application. Convenience for wx.GetApp().Exit()
5217 """
5218 return _core_.Exit(*args, **kwargs)
5219
5220 def Yield(*args, **kwargs):
5221 """
5222 Yield() -> bool
5223
5224 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5225 """
5226 return _core_.Yield(*args, **kwargs)
5227
5228 def YieldIfNeeded(*args, **kwargs):
5229 """
5230 YieldIfNeeded() -> bool
5231
5232 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5233 """
5234 return _core_.YieldIfNeeded(*args, **kwargs)
5235
5236 def SafeYield(*args, **kwargs):
5237 """
5238 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
5239
5240 This function is similar to `wx.Yield`, except that it disables the
5241 user input to all program windows before calling `wx.Yield` and
5242 re-enables it again afterwards. If ``win`` is not None, this window
5243 will remain enabled, allowing the implementation of some limited user
5244 interaction.
5245
5246 :Returns: the result of the call to `wx.Yield`.
5247 """
5248 return _core_.SafeYield(*args, **kwargs)
5249
5250 def WakeUpIdle(*args, **kwargs):
5251 """
5252 WakeUpIdle()
5253
5254 Cause the message queue to become empty again, so idle events will be
5255 sent.
5256 """
5257 return _core_.WakeUpIdle(*args, **kwargs)
5258
5259 def PostEvent(*args, **kwargs):
5260 """
5261 PostEvent(EvtHandler dest, Event event)
5262
5263 Send an event to a window or other wx.EvtHandler to be processed
5264 later.
5265 """
5266 return _core_.PostEvent(*args, **kwargs)
5267
5268 def App_CleanUp(*args, **kwargs):
5269 """
5270 App_CleanUp()
5271
5272 For internal use only, it is used to cleanup after wxWidgets when
5273 Python shuts down.
5274 """
5275 return _core_.App_CleanUp(*args, **kwargs)
5276
5277 def GetApp(*args, **kwargs):
5278 """
5279 GetApp() -> PyApp
5280
5281 Return a reference to the current wx.App object.
5282 """
5283 return _core_.GetApp(*args, **kwargs)
5284
5285 def SetDefaultPyEncoding(*args, **kwargs):
5286 """
5287 SetDefaultPyEncoding(string encoding)
5288
5289 Sets the encoding that wxPython will use when it needs to convert a
5290 Python string or unicode object to or from a wxString.
5291
5292 The default encoding is the value of ``locale.getdefaultlocale()[1]``
5293 but please be aware that the default encoding within the same locale
5294 may be slightly different on different platforms. For example, please
5295 see http://www.alanwood.net/demos/charsetdiffs.html for differences
5296 between the common latin/roman encodings.
5297 """
5298 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5299
5300 def GetDefaultPyEncoding(*args, **kwargs):
5301 """
5302 GetDefaultPyEncoding() -> string
5303
5304 Gets the current encoding that wxPython will use when it needs to
5305 convert a Python string or unicode object to or from a wxString.
5306 """
5307 return _core_.GetDefaultPyEncoding(*args, **kwargs)
5308 #----------------------------------------------------------------------
5309
5310 class PyOnDemandOutputWindow:
5311 """
5312 A class that can be used for redirecting Python's stdout and
5313 stderr streams. It will do nothing until something is wrriten to
5314 the stream at which point it will create a Frame with a text area
5315 and write the text there.
5316 """
5317 def __init__(self, title = "wxPython: stdout/stderr"):
5318 self.frame = None
5319 self.title = title
5320 self.pos = wx.DefaultPosition
5321 self.size = (450, 300)
5322 self.parent = None
5323
5324 def SetParent(self, parent):
5325 """Set the window to be used as the popup Frame's parent."""
5326 self.parent = parent
5327
5328
5329 def CreateOutputWindow(self, st):
5330 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5331 style=wx.DEFAULT_FRAME_STYLE)
5332 self.text = wx.TextCtrl(self.frame, -1, "",
5333 style=wx.TE_MULTILINE|wx.TE_READONLY)
5334 self.text.AppendText(st)
5335 self.frame.Show(True)
5336 EVT_CLOSE(self.frame, self.OnCloseWindow)
5337
5338
5339 def OnCloseWindow(self, event):
5340 if self.frame is not None:
5341 self.frame.Destroy()
5342 self.frame = None
5343 self.text = None
5344
5345
5346 # These methods provide the file-like output behaviour.
5347 def write(self, text):
5348 """
5349 Create the output window if needed and write the string to it.
5350 If not called in the context of the gui thread then uses
5351 CallAfter to do the work there.
5352 """
5353 if self.frame is None:
5354 if not wx.Thread_IsMain():
5355 wx.CallAfter(self.CreateOutputWindow, text)
5356 else:
5357 self.CreateOutputWindow(text)
5358 else:
5359 if not wx.Thread_IsMain():
5360 wx.CallAfter(self.text.AppendText, text)
5361 else:
5362 self.text.AppendText(text)
5363
5364
5365 def close(self):
5366 if self.frame is not None:
5367 wx.CallAfter(self.frame.Close)
5368
5369
5370 def flush(self):
5371 pass
5372
5373
5374
5375 #----------------------------------------------------------------------
5376
5377 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5378
5379 class App(wx.PyApp):
5380 """
5381 The ``wx.App`` class represents the application and is used to:
5382
5383 * bootstrap the wxPython system and initialize the underlying
5384 gui toolkit
5385 * set and get application-wide properties
5386 * implement the windowing system main message or event loop,
5387 and to dispatch events to window instances
5388 * etc.
5389
5390 Every application must have a ``wx.App`` instance, and all
5391 creation of UI objects should be delayed until after the
5392 ``wx.App`` object has been created in order to ensure that the gui
5393 platform and wxWidgets have been fully initialized.
5394
5395 Normally you would derive from this class and implement an
5396 ``OnInit`` method that creates a frame and then calls
5397 ``self.SetTopWindow(frame)``.
5398
5399 :see: `wx.PySimpleApp` for a simpler app class that can be used
5400 directly.
5401 """
5402
5403 outputWindowClass = PyOnDemandOutputWindow
5404
5405 def __init__(self, redirect=_defRedirect, filename=None,
5406 useBestVisual=False, clearSigInt=True):
5407 """
5408 Construct a ``wx.App`` object.
5409
5410 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5411 redirected? Defaults to True on Windows and Mac, False
5412 otherwise. If `filename` is None then output will be
5413 redirected to a window that pops up as needed. (You can
5414 control what kind of window is created for the output by
5415 resetting the class variable ``outputWindowClass`` to a
5416 class of your choosing.)
5417
5418 :param filename: The name of a file to redirect output to, if
5419 redirect is True.
5420
5421 :param useBestVisual: Should the app try to use the best
5422 available visual provided by the system (only relevant on
5423 systems that have more than one visual.) This parameter
5424 must be used instead of calling `SetUseBestVisual` later
5425 on because it must be set before the underlying GUI
5426 toolkit is initialized.
5427
5428 :param clearSigInt: Should SIGINT be cleared? This allows the
5429 app to terminate upon a Ctrl-C in the console like other
5430 GUI apps will.
5431
5432 :note: You should override OnInit to do applicaition
5433 initialization to ensure that the system, toolkit and
5434 wxWidgets are fully initialized.
5435 """
5436 wx.PyApp.__init__(self)
5437
5438 if wx.Platform == "__WXMAC__":
5439 try:
5440 import MacOS
5441 if not MacOS.WMAvailable():
5442 print """\
5443 This program needs access to the screen. Please run with 'pythonw',
5444 not 'python', and only when you are logged in on the main display of
5445 your Mac."""
5446 _sys.exit(1)
5447 except SystemExit:
5448 raise
5449 except:
5450 pass
5451
5452 # This has to be done before OnInit
5453 self.SetUseBestVisual(useBestVisual)
5454
5455 # Set the default handler for SIGINT. This fixes a problem
5456 # where if Ctrl-C is pressed in the console that started this
5457 # app then it will not appear to do anything, (not even send
5458 # KeyboardInterrupt???) but will later segfault on exit. By
5459 # setting the default handler then the app will exit, as
5460 # expected (depending on platform.)
5461 if clearSigInt:
5462 try:
5463 import signal
5464 signal.signal(signal.SIGINT, signal.SIG_DFL)
5465 except:
5466 pass
5467
5468 # Save and redirect the stdio to a window?
5469 self.stdioWin = None
5470 self.saveStdio = (_sys.stdout, _sys.stderr)
5471 if redirect:
5472 self.RedirectStdio(filename)
5473
5474 # Use Python's install prefix as the default
5475 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
5476
5477 # This finishes the initialization of wxWindows and then calls
5478 # the OnInit that should be present in the derived class
5479 self._BootstrapApp()
5480
5481
5482 def __del__(self):
5483 try:
5484 self.RestoreStdio() # Just in case the MainLoop was overridden
5485 except:
5486 pass
5487
5488
5489 def SetTopWindow(self, frame):
5490 """Set the \"main\" top level window"""
5491 if self.stdioWin:
5492 self.stdioWin.SetParent(frame)
5493 wx.PyApp.SetTopWindow(self, frame)
5494
5495
5496 def MainLoop(self):
5497 """Execute the main GUI event loop"""
5498 wx.PyApp.MainLoop(self)
5499 self.RestoreStdio()
5500
5501
5502 def RedirectStdio(self, filename=None):
5503 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
5504 if filename:
5505 _sys.stdout = _sys.stderr = open(filename, 'a')
5506 else:
5507 self.stdioWin = self.outputWindowClass()
5508 _sys.stdout = _sys.stderr = self.stdioWin
5509
5510
5511 def RestoreStdio(self):
5512 _sys.stdout, _sys.stderr = self.saveStdio
5513
5514
5515 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5516 """
5517 Set the title, position and/or size of the output window if
5518 the stdio has been redirected. This should be called before
5519 any output would cause the output window to be created.
5520 """
5521 if self.stdioWin:
5522 if title is not None:
5523 self.stdioWin.title = title
5524 if pos is not None:
5525 self.stdioWin.pos = pos
5526 if size is not None:
5527 self.stdioWin.size = size
5528
5529
5530
5531
5532 # change from wx.PyApp_XX to wx.App_XX
5533 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5534 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5535 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5536 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5537 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5538 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5539 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5540 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5541 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5542 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5543 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
5544
5545 #----------------------------------------------------------------------------
5546
5547 class PySimpleApp(wx.App):
5548 """
5549 A simple application class. You can just create one of these and
5550 then then make your top level windows later, and not have to worry
5551 about OnInit. For example::
5552
5553 app = wx.PySimpleApp()
5554 frame = wx.Frame(None, title='Hello World')
5555 frame.Show()
5556 app.MainLoop()
5557
5558 :see: `wx.App`
5559 """
5560
5561 def __init__(self, redirect=False, filename=None,
5562 useBestVisual=False, clearSigInt=True):
5563 """
5564 :see: `wx.App.__init__`
5565 """
5566 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
5567
5568 def OnInit(self):
5569 return True
5570
5571
5572
5573 # Is anybody using this one?
5574 class PyWidgetTester(wx.App):
5575 def __init__(self, size = (250, 100)):
5576 self.size = size
5577 wx.App.__init__(self, 0)
5578
5579 def OnInit(self):
5580 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
5581 self.SetTopWindow(self.frame)
5582 return True
5583
5584 def SetWidget(self, widgetClass, *args, **kwargs):
5585 w = widgetClass(self.frame, *args, **kwargs)
5586 self.frame.Show(True)
5587
5588 #----------------------------------------------------------------------------
5589 # DO NOT hold any other references to this object. This is how we
5590 # know when to cleanup system resources that wxWidgets is holding. When
5591 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
5592 # goes to zero and it calls the wx.App_CleanUp function.
5593
5594 class __wxPyCleanup:
5595 def __init__(self):
5596 self.cleanup = _core_.App_CleanUp
5597 def __del__(self):
5598 self.cleanup()
5599
5600 _sys.__wxPythonCleanup = __wxPyCleanup()
5601
5602 ## # another possible solution, but it gets called too early...
5603 ## import atexit
5604 ## atexit.register(_core_.wxApp_CleanUp)
5605
5606
5607 #----------------------------------------------------------------------------
5608
5609 #---------------------------------------------------------------------------
5610
5611 class EventLoop(object):
5612 """Proxy of C++ EventLoop class"""
5613 def __repr__(self):
5614 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5615 def __init__(self, *args, **kwargs):
5616 """__init__(self) -> EventLoop"""
5617 newobj = _core_.new_EventLoop(*args, **kwargs)
5618 self.this = newobj.this
5619 self.thisown = 1
5620 del newobj.thisown
5621 def __del__(self, destroy=_core_.delete_EventLoop):
5622 """__del__(self)"""
5623 try:
5624 if self.thisown: destroy(self)
5625 except: pass
5626
5627 def Run(*args, **kwargs):
5628 """Run(self) -> int"""
5629 return _core_.EventLoop_Run(*args, **kwargs)
5630
5631 def Exit(*args, **kwargs):
5632 """Exit(self, int rc=0)"""
5633 return _core_.EventLoop_Exit(*args, **kwargs)
5634
5635 def Pending(*args, **kwargs):
5636 """Pending(self) -> bool"""
5637 return _core_.EventLoop_Pending(*args, **kwargs)
5638
5639 def Dispatch(*args, **kwargs):
5640 """Dispatch(self) -> bool"""
5641 return _core_.EventLoop_Dispatch(*args, **kwargs)
5642
5643 def IsRunning(*args, **kwargs):
5644 """IsRunning(self) -> bool"""
5645 return _core_.EventLoop_IsRunning(*args, **kwargs)
5646
5647 def GetActive(*args, **kwargs):
5648 """GetActive() -> EventLoop"""
5649 return _core_.EventLoop_GetActive(*args, **kwargs)
5650
5651 GetActive = staticmethod(GetActive)
5652 def SetActive(*args, **kwargs):
5653 """SetActive(EventLoop loop)"""
5654 return _core_.EventLoop_SetActive(*args, **kwargs)
5655
5656 SetActive = staticmethod(SetActive)
5657
5658 class EventLoopPtr(EventLoop):
5659 def __init__(self, this):
5660 self.this = this
5661 if not hasattr(self,"thisown"): self.thisown = 0
5662 self.__class__ = EventLoop
5663 _core_.EventLoop_swigregister(EventLoopPtr)
5664
5665 def EventLoop_GetActive(*args, **kwargs):
5666 """EventLoop_GetActive() -> EventLoop"""
5667 return _core_.EventLoop_GetActive(*args, **kwargs)
5668
5669 def EventLoop_SetActive(*args, **kwargs):
5670 """EventLoop_SetActive(EventLoop loop)"""
5671 return _core_.EventLoop_SetActive(*args, **kwargs)
5672
5673 #---------------------------------------------------------------------------
5674
5675 class AcceleratorEntry(object):
5676 """
5677 A class used to define items in an `wx.AcceleratorTable`. wxPython
5678 programs can choose to use wx.AcceleratorEntry objects, but using a
5679 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
5680 as well. See `__init__` for of the tuple values.
5681
5682 :see: `wx.AcceleratorTable`
5683 """
5684 def __repr__(self):
5685 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5686 def __init__(self, *args, **kwargs):
5687 """
5688 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5689
5690 Construct a wx.AcceleratorEntry.
5691 """
5692 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
5693 self.this = newobj.this
5694 self.thisown = 1
5695 del newobj.thisown
5696 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
5697 """__del__(self)"""
5698 try:
5699 if self.thisown: destroy(self)
5700 except: pass
5701
5702 def Set(*args, **kwargs):
5703 """
5704 Set(self, int flags, int keyCode, int cmd)
5705
5706 (Re)set the attributes of a wx.AcceleratorEntry.
5707 :see `__init__`
5708 """
5709 return _core_.AcceleratorEntry_Set(*args, **kwargs)
5710
5711 def GetFlags(*args, **kwargs):
5712 """
5713 GetFlags(self) -> int
5714
5715 Get the AcceleratorEntry's flags.
5716 """
5717 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
5718
5719 def GetKeyCode(*args, **kwargs):
5720 """
5721 GetKeyCode(self) -> int
5722
5723 Get the AcceleratorEntry's keycode.
5724 """
5725 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
5726
5727 def GetCommand(*args, **kwargs):
5728 """
5729 GetCommand(self) -> int
5730
5731 Get the AcceleratorEntry's command ID.
5732 """
5733 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
5734
5735
5736 class AcceleratorEntryPtr(AcceleratorEntry):
5737 def __init__(self, this):
5738 self.this = this
5739 if not hasattr(self,"thisown"): self.thisown = 0
5740 self.__class__ = AcceleratorEntry
5741 _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
5742
5743 class AcceleratorTable(Object):
5744 """
5745 An accelerator table allows the application to specify a table of
5746 keyboard shortcuts for menus or other commands. On Windows, menu or
5747 button commands are supported; on GTK, only menu commands are
5748 supported.
5749 """
5750 def __repr__(self):
5751 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5752 def __init__(self, *args, **kwargs):
5753 """
5754 __init__(entries) -> AcceleratorTable
5755
5756 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5757 items or or of 3-tuples (flags, keyCode, cmdID)
5758
5759 :see: `wx.AcceleratorEntry`
5760 """
5761 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
5762 self.this = newobj.this
5763 self.thisown = 1
5764 del newobj.thisown
5765 def __del__(self, destroy=_core_.delete_AcceleratorTable):
5766 """__del__(self)"""
5767 try:
5768 if self.thisown: destroy(self)
5769 except: pass
5770
5771 def Ok(*args, **kwargs):
5772 """Ok(self) -> bool"""
5773 return _core_.AcceleratorTable_Ok(*args, **kwargs)
5774
5775
5776 class AcceleratorTablePtr(AcceleratorTable):
5777 def __init__(self, this):
5778 self.this = this
5779 if not hasattr(self,"thisown"): self.thisown = 0
5780 self.__class__ = AcceleratorTable
5781 _core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
5782
5783
5784 def GetAccelFromString(*args, **kwargs):
5785 """GetAccelFromString(String label) -> AcceleratorEntry"""
5786 return _core_.GetAccelFromString(*args, **kwargs)
5787 #---------------------------------------------------------------------------
5788
5789 class VisualAttributes(object):
5790 """struct containing all the visual attributes of a control"""
5791 def __repr__(self):
5792 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5793 def __init__(self, *args, **kwargs):
5794 """
5795 __init__(self) -> VisualAttributes
5796
5797 struct containing all the visual attributes of a control
5798 """
5799 newobj = _core_.new_VisualAttributes(*args, **kwargs)
5800 self.this = newobj.this
5801 self.thisown = 1
5802 del newobj.thisown
5803 def __del__(self, destroy=_core_.delete_VisualAttributes):
5804 """__del__(self)"""
5805 try:
5806 if self.thisown: destroy(self)
5807 except: pass
5808
5809 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5810 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5811 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
5812
5813 class VisualAttributesPtr(VisualAttributes):
5814 def __init__(self, this):
5815 self.this = this
5816 if not hasattr(self,"thisown"): self.thisown = 0
5817 self.__class__ = VisualAttributes
5818 _core_.VisualAttributes_swigregister(VisualAttributesPtr)
5819 NullAcceleratorTable = cvar.NullAcceleratorTable
5820 PanelNameStr = cvar.PanelNameStr
5821
5822 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5823 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5824 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5825 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5826 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
5827 class Window(EvtHandler):
5828 """
5829 wx.Window is the base class for all windows and represents any visible
5830 object on the screen. All controls, top level windows and so on are
5831 wx.Windows. Sizers and device contexts are not however, as they don't
5832 appear on screen themselves.
5833
5834 """
5835 def __repr__(self):
5836 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5837 def __init__(self, *args, **kwargs):
5838 """
5839 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
5840 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
5841
5842 Construct and show a generic Window.
5843 """
5844 newobj = _core_.new_Window(*args, **kwargs)
5845 self.this = newobj.this
5846 self.thisown = 1
5847 del newobj.thisown
5848 self._setOORInfo(self)
5849
5850 def Create(*args, **kwargs):
5851 """
5852 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
5853 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
5854
5855 Create the GUI part of the Window for 2-phase creation mode.
5856 """
5857 return _core_.Window_Create(*args, **kwargs)
5858
5859 def Close(*args, **kwargs):
5860 """
5861 Close(self, bool force=False) -> bool
5862
5863 This function simply generates a EVT_CLOSE event whose handler usually
5864 tries to close the window. It doesn't close the window itself,
5865 however. If force is False (the default) then the window's close
5866 handler will be allowed to veto the destruction of the window.
5867 """
5868 return _core_.Window_Close(*args, **kwargs)
5869
5870 def Destroy(*args, **kwargs):
5871 """
5872 Destroy(self) -> bool
5873
5874 Destroys the window safely. Frames and dialogs are not destroyed
5875 immediately when this function is called -- they are added to a list
5876 of windows to be deleted on idle time, when all the window's events
5877 have been processed. This prevents problems with events being sent to
5878 non-existent windows.
5879
5880 Returns True if the window has either been successfully deleted, or it
5881 has been added to the list of windows pending real deletion.
5882 """
5883 return _core_.Window_Destroy(*args, **kwargs)
5884
5885 def DestroyChildren(*args, **kwargs):
5886 """
5887 DestroyChildren(self) -> bool
5888
5889 Destroys all children of a window. Called automatically by the
5890 destructor.
5891 """
5892 return _core_.Window_DestroyChildren(*args, **kwargs)
5893
5894 def IsBeingDeleted(*args, **kwargs):
5895 """
5896 IsBeingDeleted(self) -> bool
5897
5898 Is the window in the process of being deleted?
5899 """
5900 return _core_.Window_IsBeingDeleted(*args, **kwargs)
5901
5902 def SetTitle(*args, **kwargs):
5903 """
5904 SetTitle(self, String title)
5905
5906 Sets the window's title. Applicable only to frames and dialogs.
5907 """
5908 return _core_.Window_SetTitle(*args, **kwargs)
5909
5910 def GetTitle(*args, **kwargs):
5911 """
5912 GetTitle(self) -> String
5913
5914 Gets the window's title. Applicable only to frames and dialogs.
5915 """
5916 return _core_.Window_GetTitle(*args, **kwargs)
5917
5918 def SetLabel(*args, **kwargs):
5919 """
5920 SetLabel(self, String label)
5921
5922 Set the text which the window shows in its label if applicable.
5923 """
5924 return _core_.Window_SetLabel(*args, **kwargs)
5925
5926 def GetLabel(*args, **kwargs):
5927 """
5928 GetLabel(self) -> String
5929
5930 Generic way of getting a label from any window, for identification
5931 purposes. The interpretation of this function differs from class to
5932 class. For frames and dialogs, the value returned is the title. For
5933 buttons or static text controls, it is the button text. This function
5934 can be useful for meta-programs such as testing tools or special-needs
5935 access programs)which need to identify windows by name.
5936 """
5937 return _core_.Window_GetLabel(*args, **kwargs)
5938
5939 def SetName(*args, **kwargs):
5940 """
5941 SetName(self, String name)
5942
5943 Sets the window's name. The window name is used for ressource setting
5944 in X, it is not the same as the window title/label
5945 """
5946 return _core_.Window_SetName(*args, **kwargs)
5947
5948 def GetName(*args, **kwargs):
5949 """
5950 GetName(self) -> String
5951
5952 Returns the windows name. This name is not guaranteed to be unique;
5953 it is up to the programmer to supply an appropriate name in the window
5954 constructor or via wx.Window.SetName.
5955 """
5956 return _core_.Window_GetName(*args, **kwargs)
5957
5958 def SetWindowVariant(*args, **kwargs):
5959 """
5960 SetWindowVariant(self, int variant)
5961
5962 Sets the variant of the window/font size to use for this window, if
5963 the platform supports variants, for example, wxMac.
5964 """
5965 return _core_.Window_SetWindowVariant(*args, **kwargs)
5966
5967 def GetWindowVariant(*args, **kwargs):
5968 """GetWindowVariant(self) -> int"""
5969 return _core_.Window_GetWindowVariant(*args, **kwargs)
5970
5971 def SetId(*args, **kwargs):
5972 """
5973 SetId(self, int winid)
5974
5975 Sets the identifier of the window. Each window has an integer
5976 identifier. If the application has not provided one, an identifier
5977 will be generated. Normally, the identifier should be provided on
5978 creation and should not be modified subsequently.
5979 """
5980 return _core_.Window_SetId(*args, **kwargs)
5981
5982 def GetId(*args, **kwargs):
5983 """
5984 GetId(self) -> int
5985
5986 Returns the identifier of the window. Each window has an integer
5987 identifier. If the application has not provided one (or the default Id
5988 -1 is used) then an unique identifier with a negative value will be
5989 generated.
5990 """
5991 return _core_.Window_GetId(*args, **kwargs)
5992
5993 def NewControlId(*args, **kwargs):
5994 """
5995 NewControlId() -> int
5996
5997 Generate a control id for the controls which were not given one.
5998 """
5999 return _core_.Window_NewControlId(*args, **kwargs)
6000
6001 NewControlId = staticmethod(NewControlId)
6002 def NextControlId(*args, **kwargs):
6003 """
6004 NextControlId(int winid) -> int
6005
6006 Get the id of the control following the one with the given
6007 autogenerated) id
6008 """
6009 return _core_.Window_NextControlId(*args, **kwargs)
6010
6011 NextControlId = staticmethod(NextControlId)
6012 def PrevControlId(*args, **kwargs):
6013 """
6014 PrevControlId(int winid) -> int
6015
6016 Get the id of the control preceding the one with the given
6017 autogenerated) id
6018 """
6019 return _core_.Window_PrevControlId(*args, **kwargs)
6020
6021 PrevControlId = staticmethod(PrevControlId)
6022 def SetSize(*args, **kwargs):
6023 """
6024 SetSize(self, Size size)
6025
6026 Sets the size of the window in pixels.
6027 """
6028 return _core_.Window_SetSize(*args, **kwargs)
6029
6030 def SetDimensions(*args, **kwargs):
6031 """
6032 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
6033
6034 Sets the position and size of the window in pixels. The sizeFlags
6035 parameter indicates the interpretation of the other params if they are
6036 equal to -1.
6037
6038 ======================== ======================================
6039 wx.SIZE_AUTO A -1 indicates that a class-specific
6040 default should be used.
6041 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
6042 -1 values are supplied.
6043 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
6044 interpreted as real dimensions, not
6045 default values.
6046 ======================== ======================================
6047
6048 """
6049 return _core_.Window_SetDimensions(*args, **kwargs)
6050
6051 def SetRect(*args, **kwargs):
6052 """
6053 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
6054
6055 Sets the position and size of the window in pixels using a wx.Rect.
6056 """
6057 return _core_.Window_SetRect(*args, **kwargs)
6058
6059 def SetSizeWH(*args, **kwargs):
6060 """
6061 SetSizeWH(self, int width, int height)
6062
6063 Sets the size of the window in pixels.
6064 """
6065 return _core_.Window_SetSizeWH(*args, **kwargs)
6066
6067 def Move(*args, **kwargs):
6068 """
6069 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
6070
6071 Moves the window to the given position.
6072 """
6073 return _core_.Window_Move(*args, **kwargs)
6074
6075 SetPosition = Move
6076 def MoveXY(*args, **kwargs):
6077 """
6078 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
6079
6080 Moves the window to the given position.
6081 """
6082 return _core_.Window_MoveXY(*args, **kwargs)
6083
6084 def SetBestFittingSize(*args, **kwargs):
6085 """
6086 SetBestFittingSize(self, Size size=DefaultSize)
6087
6088 A 'Smart' SetSize that will fill in default size components with the
6089 window's *best size* values. Also set's the minsize for use with sizers.
6090 """
6091 return _core_.Window_SetBestFittingSize(*args, **kwargs)
6092
6093 def Raise(*args, **kwargs):
6094 """
6095 Raise(self)
6096
6097 Raises the window to the top of the window hierarchy if it is a
6098 managed window (dialog or frame).
6099 """
6100 return _core_.Window_Raise(*args, **kwargs)
6101
6102 def Lower(*args, **kwargs):
6103 """
6104 Lower(self)
6105
6106 Lowers the window to the bottom of the window hierarchy if it is a
6107 managed window (dialog or frame).
6108 """
6109 return _core_.Window_Lower(*args, **kwargs)
6110
6111 def SetClientSize(*args, **kwargs):
6112 """
6113 SetClientSize(self, Size size)
6114
6115 This sets the size of the window client area in pixels. Using this
6116 function to size a window tends to be more device-independent than
6117 wx.Window.SetSize, since the application need not worry about what
6118 dimensions the border or title bar have when trying to fit the window
6119 around panel items, for example.
6120 """
6121 return _core_.Window_SetClientSize(*args, **kwargs)
6122
6123 def SetClientSizeWH(*args, **kwargs):
6124 """
6125 SetClientSizeWH(self, int width, int height)
6126
6127 This sets the size of the window client area in pixels. Using this
6128 function to size a window tends to be more device-independent than
6129 wx.Window.SetSize, since the application need not worry about what
6130 dimensions the border or title bar have when trying to fit the window
6131 around panel items, for example.
6132 """
6133 return _core_.Window_SetClientSizeWH(*args, **kwargs)
6134
6135 def SetClientRect(*args, **kwargs):
6136 """
6137 SetClientRect(self, Rect rect)
6138
6139 This sets the size of the window client area in pixels. Using this
6140 function to size a window tends to be more device-independent than
6141 wx.Window.SetSize, since the application need not worry about what
6142 dimensions the border or title bar have when trying to fit the window
6143 around panel items, for example.
6144 """
6145 return _core_.Window_SetClientRect(*args, **kwargs)
6146
6147 def GetPosition(*args, **kwargs):
6148 """
6149 GetPosition(self) -> Point
6150
6151 Get the window's position.
6152 """
6153 return _core_.Window_GetPosition(*args, **kwargs)
6154
6155 def GetPositionTuple(*args, **kwargs):
6156 """
6157 GetPositionTuple() -> (x,y)
6158
6159 Get the window's position.
6160 """
6161 return _core_.Window_GetPositionTuple(*args, **kwargs)
6162
6163 def GetSize(*args, **kwargs):
6164 """
6165 GetSize(self) -> Size
6166
6167 Get the window size.
6168 """
6169 return _core_.Window_GetSize(*args, **kwargs)
6170
6171 def GetSizeTuple(*args, **kwargs):
6172 """
6173 GetSizeTuple() -> (width, height)
6174
6175 Get the window size.
6176 """
6177 return _core_.Window_GetSizeTuple(*args, **kwargs)
6178
6179 def GetRect(*args, **kwargs):
6180 """
6181 GetRect(self) -> Rect
6182
6183 Returns the size and position of the window as a wx.Rect object.
6184 """
6185 return _core_.Window_GetRect(*args, **kwargs)
6186
6187 def GetClientSize(*args, **kwargs):
6188 """
6189 GetClientSize(self) -> Size
6190
6191 This gets the size of the window's 'client area' in pixels. The client
6192 area is the area which may be drawn on by the programmer, excluding
6193 title bar, border, scrollbars, etc.
6194 """
6195 return _core_.Window_GetClientSize(*args, **kwargs)
6196
6197 def GetClientSizeTuple(*args, **kwargs):
6198 """
6199 GetClientSizeTuple() -> (width, height)
6200
6201 This gets the size of the window's 'client area' in pixels. The client
6202 area is the area which may be drawn on by the programmer, excluding
6203 title bar, border, scrollbars, etc.
6204 """
6205 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
6206
6207 def GetClientAreaOrigin(*args, **kwargs):
6208 """
6209 GetClientAreaOrigin(self) -> Point
6210
6211 Get the origin of the client area of the window relative to the
6212 window's top left corner (the client area may be shifted because of
6213 the borders, scrollbars, other decorations...)
6214 """
6215 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
6216
6217 def GetClientRect(*args, **kwargs):
6218 """
6219 GetClientRect(self) -> Rect
6220
6221 Get the client area position and size as a `wx.Rect` object.
6222 """
6223 return _core_.Window_GetClientRect(*args, **kwargs)
6224
6225 def GetBestSize(*args, **kwargs):
6226 """
6227 GetBestSize(self) -> Size
6228
6229 This function returns the best acceptable minimal size for the
6230 window, if applicable. For example, for a static text control, it will
6231 be the minimal size such that the control label is not truncated. For
6232 windows containing subwindows (suzh aswx.Panel), the size returned by
6233 this function will be the same as the size the window would have had
6234 after calling Fit.
6235 """
6236 return _core_.Window_GetBestSize(*args, **kwargs)
6237
6238 def GetBestSizeTuple(*args, **kwargs):
6239 """
6240 GetBestSizeTuple() -> (width, height)
6241
6242 This function returns the best acceptable minimal size for the
6243 window, if applicable. For example, for a static text control, it will
6244 be the minimal size such that the control label is not truncated. For
6245 windows containing subwindows (suzh aswx.Panel), the size returned by
6246 this function will be the same as the size the window would have had
6247 after calling Fit.
6248 """
6249 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
6250
6251 def InvalidateBestSize(*args, **kwargs):
6252 """
6253 InvalidateBestSize(self)
6254
6255 Reset the cached best size value so it will be recalculated the next
6256 time it is needed.
6257 """
6258 return _core_.Window_InvalidateBestSize(*args, **kwargs)
6259
6260 def GetBestFittingSize(*args, **kwargs):
6261 """
6262 GetBestFittingSize(self) -> Size
6263
6264 This function will merge the window's best size into the window's
6265 minimum size, giving priority to the min size components, and returns
6266 the results.
6267
6268 """
6269 return _core_.Window_GetBestFittingSize(*args, **kwargs)
6270
6271 def GetAdjustedBestSize(*args, **kwargs):
6272 """
6273 GetAdjustedBestSize(self) -> Size
6274
6275 This method is similar to GetBestSize, except in one
6276 thing. GetBestSize should return the minimum untruncated size of the
6277 window, while this method will return the largest of BestSize and any
6278 user specified minimum size. ie. it is the minimum size the window
6279 should currently be drawn at, not the minimal size it can possibly
6280 tolerate.
6281 """
6282 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
6283
6284 def Center(*args, **kwargs):
6285 """
6286 Center(self, int direction=BOTH)
6287
6288 Centers the window. The parameter specifies the direction for
6289 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6290 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6291 on the entire screen and not on its parent window. If it is a
6292 top-level window and has no parent then it will always be centered
6293 relative to the screen.
6294 """
6295 return _core_.Window_Center(*args, **kwargs)
6296
6297 Centre = Center
6298 def CenterOnScreen(*args, **kwargs):
6299 """
6300 CenterOnScreen(self, int dir=BOTH)
6301
6302 Center on screen (only works for top level windows)
6303 """
6304 return _core_.Window_CenterOnScreen(*args, **kwargs)
6305
6306 CentreOnScreen = CenterOnScreen
6307 def CenterOnParent(*args, **kwargs):
6308 """
6309 CenterOnParent(self, int dir=BOTH)
6310
6311 Center with respect to the the parent window
6312 """
6313 return _core_.Window_CenterOnParent(*args, **kwargs)
6314
6315 CentreOnParent = CenterOnParent
6316 def Fit(*args, **kwargs):
6317 """
6318 Fit(self)
6319
6320 Sizes the window so that it fits around its subwindows. This function
6321 won't do anything if there are no subwindows and will only really work
6322 correctly if sizers are used for the subwindows layout. Also, if the
6323 window has exactly one subwindow it is better (faster and the result
6324 is more precise as Fit adds some margin to account for fuzziness of
6325 its calculations) to call window.SetClientSize(child.GetSize())
6326 instead of calling Fit.
6327 """
6328 return _core_.Window_Fit(*args, **kwargs)
6329
6330 def FitInside(*args, **kwargs):
6331 """
6332 FitInside(self)
6333
6334 Similar to Fit, but sizes the interior (virtual) size of a
6335 window. Mainly useful with scrolled windows to reset scrollbars after
6336 sizing changes that do not trigger a size event, and/or scrolled
6337 windows without an interior sizer. This function similarly won't do
6338 anything if there are no subwindows.
6339 """
6340 return _core_.Window_FitInside(*args, **kwargs)
6341
6342 def SetSizeHints(*args, **kwargs):
6343 """
6344 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
6345 int incH=-1)
6346
6347 Allows specification of minimum and maximum window sizes, and window
6348 size increments. If a pair of values is not set (or set to -1), the
6349 default values will be used. If this function is called, the user
6350 will not be able to size the window outside the given bounds (if it is
6351 a top-level window.) Sizers will also inspect the minimum window size
6352 and will use that value if set when calculating layout.
6353
6354 The resizing increments are only significant under Motif or Xt.
6355 """
6356 return _core_.Window_SetSizeHints(*args, **kwargs)
6357
6358 def SetSizeHintsSz(*args, **kwargs):
6359 """
6360 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6361
6362 Allows specification of minimum and maximum window sizes, and window
6363 size increments. If a pair of values is not set (or set to -1), the
6364 default values will be used. If this function is called, the user
6365 will not be able to size the window outside the given bounds (if it is
6366 a top-level window.) Sizers will also inspect the minimum window size
6367 and will use that value if set when calculating layout.
6368
6369 The resizing increments are only significant under Motif or Xt.
6370 """
6371 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6372
6373 def SetVirtualSizeHints(*args, **kwargs):
6374 """
6375 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
6376
6377 Allows specification of minimum and maximum virtual window sizes. If a
6378 pair of values is not set (or set to -1), the default values will be
6379 used. If this function is called, the user will not be able to size
6380 the virtual area of the window outside the given bounds.
6381 """
6382 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6383
6384 def SetVirtualSizeHintsSz(*args, **kwargs):
6385 """
6386 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6387
6388 Allows specification of minimum and maximum virtual window sizes. If a
6389 pair of values is not set (or set to -1), the default values will be
6390 used. If this function is called, the user will not be able to size
6391 the virtual area of the window outside the given bounds.
6392 """
6393 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
6394
6395 def GetMaxSize(*args, **kwargs):
6396 """GetMaxSize(self) -> Size"""
6397 return _core_.Window_GetMaxSize(*args, **kwargs)
6398
6399 def GetMinSize(*args, **kwargs):
6400 """GetMinSize(self) -> Size"""
6401 return _core_.Window_GetMinSize(*args, **kwargs)
6402
6403 def SetMinSize(*args, **kwargs):
6404 """
6405 SetMinSize(self, Size minSize)
6406
6407 A more convenient method than `SetSizeHints` for setting just the
6408 min size.
6409 """
6410 return _core_.Window_SetMinSize(*args, **kwargs)
6411
6412 def SetMaxSize(*args, **kwargs):
6413 """
6414 SetMaxSize(self, Size maxSize)
6415
6416 A more convenient method than `SetSizeHints` for setting just the
6417 max size.
6418 """
6419 return _core_.Window_SetMaxSize(*args, **kwargs)
6420
6421 def GetMinWidth(*args, **kwargs):
6422 """GetMinWidth(self) -> int"""
6423 return _core_.Window_GetMinWidth(*args, **kwargs)
6424
6425 def GetMinHeight(*args, **kwargs):
6426 """GetMinHeight(self) -> int"""
6427 return _core_.Window_GetMinHeight(*args, **kwargs)
6428
6429 def GetMaxWidth(*args, **kwargs):
6430 """GetMaxWidth(self) -> int"""
6431 return _core_.Window_GetMaxWidth(*args, **kwargs)
6432
6433 def GetMaxHeight(*args, **kwargs):
6434 """GetMaxHeight(self) -> int"""
6435 return _core_.Window_GetMaxHeight(*args, **kwargs)
6436
6437 def SetVirtualSize(*args, **kwargs):
6438 """
6439 SetVirtualSize(self, Size size)
6440
6441 Set the the virtual size of a window in pixels. For most windows this
6442 is just the client area of the window, but for some like scrolled
6443 windows it is more or less independent of the screen window size.
6444 """
6445 return _core_.Window_SetVirtualSize(*args, **kwargs)
6446
6447 def SetVirtualSizeWH(*args, **kwargs):
6448 """
6449 SetVirtualSizeWH(self, int w, int h)
6450
6451 Set the the virtual size of a window in pixels. For most windows this
6452 is just the client area of the window, but for some like scrolled
6453 windows it is more or less independent of the screen window size.
6454 """
6455 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
6456
6457 def GetVirtualSize(*args, **kwargs):
6458 """
6459 GetVirtualSize(self) -> Size
6460
6461 Get the the virtual size of the window in pixels. For most windows
6462 this is just the client area of the window, but for some like scrolled
6463 windows it is more or less independent of the screen window size.
6464 """
6465 return _core_.Window_GetVirtualSize(*args, **kwargs)
6466
6467 def GetVirtualSizeTuple(*args, **kwargs):
6468 """
6469 GetVirtualSizeTuple() -> (width, height)
6470
6471 Get the the virtual size of the window in pixels. For most windows
6472 this is just the client area of the window, but for some like scrolled
6473 windows it is more or less independent of the screen window size.
6474 """
6475 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
6476
6477 def GetBestVirtualSize(*args, **kwargs):
6478 """
6479 GetBestVirtualSize(self) -> Size
6480
6481 Return the largest of ClientSize and BestSize (as determined by a
6482 sizer, interior children, or other means)
6483 """
6484 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
6485
6486 def Show(*args, **kwargs):
6487 """
6488 Show(self, bool show=True) -> bool
6489
6490 Shows or hides the window. You may need to call Raise for a top level
6491 window if you want to bring it to top, although this is not needed if
6492 Show is called immediately after the frame creation. Returns True if
6493 the window has been shown or hidden or False if nothing was done
6494 because it already was in the requested state.
6495 """
6496 return _core_.Window_Show(*args, **kwargs)
6497
6498 def Hide(*args, **kwargs):
6499 """
6500 Hide(self) -> bool
6501
6502 Equivalent to calling Show(False).
6503 """
6504 return _core_.Window_Hide(*args, **kwargs)
6505
6506 def Enable(*args, **kwargs):
6507 """
6508 Enable(self, bool enable=True) -> bool
6509
6510 Enable or disable the window for user input. Note that when a parent
6511 window is disabled, all of its children are disabled as well and they
6512 are reenabled again when the parent is. Returns true if the window
6513 has been enabled or disabled, false if nothing was done, i.e. if the
6514 window had already been in the specified state.
6515 """
6516 return _core_.Window_Enable(*args, **kwargs)
6517
6518 def Disable(*args, **kwargs):
6519 """
6520 Disable(self) -> bool
6521
6522 Disables the window, same as Enable(false).
6523 """
6524 return _core_.Window_Disable(*args, **kwargs)
6525
6526 def IsShown(*args, **kwargs):
6527 """
6528 IsShown(self) -> bool
6529
6530 Returns true if the window is shown, false if it has been hidden.
6531 """
6532 return _core_.Window_IsShown(*args, **kwargs)
6533
6534 def IsEnabled(*args, **kwargs):
6535 """
6536 IsEnabled(self) -> bool
6537
6538 Returns true if the window is enabled for input, false otherwise.
6539 """
6540 return _core_.Window_IsEnabled(*args, **kwargs)
6541
6542 def SetWindowStyleFlag(*args, **kwargs):
6543 """
6544 SetWindowStyleFlag(self, long style)
6545
6546 Sets the style of the window. Please note that some styles cannot be
6547 changed after the window creation and that Refresh() might need to be
6548 called after changing the others for the change to take place
6549 immediately.
6550 """
6551 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
6552
6553 def GetWindowStyleFlag(*args, **kwargs):
6554 """
6555 GetWindowStyleFlag(self) -> long
6556
6557 Gets the window style that was passed to the constructor or Create
6558 method.
6559 """
6560 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
6561
6562 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
6563 def HasFlag(*args, **kwargs):
6564 """
6565 HasFlag(self, int flag) -> bool
6566
6567 Test if the given style is set for this window.
6568 """
6569 return _core_.Window_HasFlag(*args, **kwargs)
6570
6571 def IsRetained(*args, **kwargs):
6572 """
6573 IsRetained(self) -> bool
6574
6575 Returns true if the window is retained, false otherwise. Retained
6576 windows are only available on X platforms.
6577 """
6578 return _core_.Window_IsRetained(*args, **kwargs)
6579
6580 def SetExtraStyle(*args, **kwargs):
6581 """
6582 SetExtraStyle(self, long exStyle)
6583
6584 Sets the extra style bits for the window. Extra styles are the less
6585 often used style bits which can't be set with the constructor or with
6586 SetWindowStyleFlag()
6587 """
6588 return _core_.Window_SetExtraStyle(*args, **kwargs)
6589
6590 def GetExtraStyle(*args, **kwargs):
6591 """
6592 GetExtraStyle(self) -> long
6593
6594 Returns the extra style bits for the window.
6595 """
6596 return _core_.Window_GetExtraStyle(*args, **kwargs)
6597
6598 def MakeModal(*args, **kwargs):
6599 """
6600 MakeModal(self, bool modal=True)
6601
6602 Disables all other windows in the application so that the user can
6603 only interact with this window. Passing False will reverse this
6604 effect.
6605 """
6606 return _core_.Window_MakeModal(*args, **kwargs)
6607
6608 def SetThemeEnabled(*args, **kwargs):
6609 """
6610 SetThemeEnabled(self, bool enableTheme)
6611
6612 This function tells a window if it should use the system's "theme"
6613 code to draw the windows' background instead if its own background
6614 drawing code. This will only have an effect on platforms that support
6615 the notion of themes in user defined windows. One such platform is
6616 GTK+ where windows can have (very colourful) backgrounds defined by a
6617 user's selected theme.
6618
6619 Dialogs, notebook pages and the status bar have this flag set to true
6620 by default so that the default look and feel is simulated best.
6621 """
6622 return _core_.Window_SetThemeEnabled(*args, **kwargs)
6623
6624 def GetThemeEnabled(*args, **kwargs):
6625 """
6626 GetThemeEnabled(self) -> bool
6627
6628 Return the themeEnabled flag.
6629 """
6630 return _core_.Window_GetThemeEnabled(*args, **kwargs)
6631
6632 def SetFocus(*args, **kwargs):
6633 """
6634 SetFocus(self)
6635
6636 Set's the focus to this window, allowing it to receive keyboard input.
6637 """
6638 return _core_.Window_SetFocus(*args, **kwargs)
6639
6640 def SetFocusFromKbd(*args, **kwargs):
6641 """
6642 SetFocusFromKbd(self)
6643
6644 Set focus to this window as the result of a keyboard action. Normally
6645 only called internally.
6646 """
6647 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
6648
6649 def FindFocus(*args, **kwargs):
6650 """
6651 FindFocus() -> Window
6652
6653 Returns the window or control that currently has the keyboard focus,
6654 or None.
6655 """
6656 return _core_.Window_FindFocus(*args, **kwargs)
6657
6658 FindFocus = staticmethod(FindFocus)
6659 def AcceptsFocus(*args, **kwargs):
6660 """
6661 AcceptsFocus(self) -> bool
6662
6663 Can this window have focus?
6664 """
6665 return _core_.Window_AcceptsFocus(*args, **kwargs)
6666
6667 def AcceptsFocusFromKeyboard(*args, **kwargs):
6668 """
6669 AcceptsFocusFromKeyboard(self) -> bool
6670
6671 Can this window be given focus by keyboard navigation? if not, the
6672 only way to give it focus (provided it accepts it at all) is to click
6673 it.
6674 """
6675 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
6676
6677 def GetDefaultItem(*args, **kwargs):
6678 """
6679 GetDefaultItem(self) -> Window
6680
6681 Get the default child of this parent, i.e. the one which is activated
6682 by pressing <Enter> such as the OK button on a wx.Dialog.
6683 """
6684 return _core_.Window_GetDefaultItem(*args, **kwargs)
6685
6686 def SetDefaultItem(*args, **kwargs):
6687 """
6688 SetDefaultItem(self, Window child) -> Window
6689
6690 Set this child as default, return the old default.
6691 """
6692 return _core_.Window_SetDefaultItem(*args, **kwargs)
6693
6694 def SetTmpDefaultItem(*args, **kwargs):
6695 """
6696 SetTmpDefaultItem(self, Window win)
6697
6698 Set this child as temporary default
6699 """
6700 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
6701
6702 def Navigate(*args, **kwargs):
6703 """
6704 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6705
6706 Does keyboard navigation from this window to another, by sending a
6707 `wx.NavigationKeyEvent`.
6708 """
6709 return _core_.Window_Navigate(*args, **kwargs)
6710
6711 def MoveAfterInTabOrder(*args, **kwargs):
6712 """
6713 MoveAfterInTabOrder(self, Window win)
6714
6715 Moves this window in the tab navigation order after the specified
6716 sibling window. This means that when the user presses the TAB key on
6717 that other window, the focus switches to this window.
6718
6719 The default tab order is the same as creation order. This function
6720 and `MoveBeforeInTabOrder` allow to change it after creating all the
6721 windows.
6722
6723 """
6724 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6725
6726 def MoveBeforeInTabOrder(*args, **kwargs):
6727 """
6728 MoveBeforeInTabOrder(self, Window win)
6729
6730 Same as `MoveAfterInTabOrder` except that it inserts this window just
6731 before win instead of putting it right after it.
6732 """
6733 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6734
6735 def GetChildren(*args, **kwargs):
6736 """
6737 GetChildren(self) -> PyObject
6738
6739 Returns a list of the window's children. NOTE: Currently this is a
6740 copy of the child window list maintained by the window, so the return
6741 value of this function is only valid as long as the window's children
6742 do not change.
6743 """
6744 return _core_.Window_GetChildren(*args, **kwargs)
6745
6746 def GetParent(*args, **kwargs):
6747 """
6748 GetParent(self) -> Window
6749
6750 Returns the parent window of this window, or None if there isn't one.
6751 """
6752 return _core_.Window_GetParent(*args, **kwargs)
6753
6754 def GetGrandParent(*args, **kwargs):
6755 """
6756 GetGrandParent(self) -> Window
6757
6758 Returns the parent of the parent of this window, or None if there
6759 isn't one.
6760 """
6761 return _core_.Window_GetGrandParent(*args, **kwargs)
6762
6763 def IsTopLevel(*args, **kwargs):
6764 """
6765 IsTopLevel(self) -> bool
6766
6767 Returns true if the given window is a top-level one. Currently all
6768 frames and dialogs are always considered to be top-level windows (even
6769 if they have a parent window).
6770 """
6771 return _core_.Window_IsTopLevel(*args, **kwargs)
6772
6773 def Reparent(*args, **kwargs):
6774 """
6775 Reparent(self, Window newParent) -> bool
6776
6777 Reparents the window, i.e the window will be removed from its current
6778 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6779 re-inserted into another. Available on Windows and GTK. Returns True
6780 if the parent was changed, False otherwise (error or newParent ==
6781 oldParent)
6782 """
6783 return _core_.Window_Reparent(*args, **kwargs)
6784
6785 def AddChild(*args, **kwargs):
6786 """
6787 AddChild(self, Window child)
6788
6789 Adds a child window. This is called automatically by window creation
6790 functions so should not be required by the application programmer.
6791 """
6792 return _core_.Window_AddChild(*args, **kwargs)
6793
6794 def RemoveChild(*args, **kwargs):
6795 """
6796 RemoveChild(self, Window child)
6797
6798 Removes a child window. This is called automatically by window
6799 deletion functions so should not be required by the application
6800 programmer.
6801 """
6802 return _core_.Window_RemoveChild(*args, **kwargs)
6803
6804 def FindWindowById(*args, **kwargs):
6805 """
6806 FindWindowById(self, long winid) -> Window
6807
6808 Find a chld of this window by window ID
6809 """
6810 return _core_.Window_FindWindowById(*args, **kwargs)
6811
6812 def FindWindowByName(*args, **kwargs):
6813 """
6814 FindWindowByName(self, String name) -> Window
6815
6816 Find a child of this window by name
6817 """
6818 return _core_.Window_FindWindowByName(*args, **kwargs)
6819
6820 def GetEventHandler(*args, **kwargs):
6821 """
6822 GetEventHandler(self) -> EvtHandler
6823
6824 Returns the event handler for this window. By default, the window is
6825 its own event handler.
6826 """
6827 return _core_.Window_GetEventHandler(*args, **kwargs)
6828
6829 def SetEventHandler(*args, **kwargs):
6830 """
6831 SetEventHandler(self, EvtHandler handler)
6832
6833 Sets the event handler for this window. An event handler is an object
6834 that is capable of processing the events sent to a window. By default,
6835 the window is its own event handler, but an application may wish to
6836 substitute another, for example to allow central implementation of
6837 event-handling for a variety of different window classes.
6838
6839 It is usually better to use `wx.Window.PushEventHandler` since this sets
6840 up a chain of event handlers, where an event not handled by one event
6841 handler is handed to the next one in the chain.
6842 """
6843 return _core_.Window_SetEventHandler(*args, **kwargs)
6844
6845 def PushEventHandler(*args, **kwargs):
6846 """
6847 PushEventHandler(self, EvtHandler handler)
6848
6849 Pushes this event handler onto the event handler stack for the window.
6850 An event handler is an object that is capable of processing the events
6851 sent to a window. By default, the window is its own event handler, but
6852 an application may wish to substitute another, for example to allow
6853 central implementation of event-handling for a variety of different
6854 window classes.
6855
6856 wx.Window.PushEventHandler allows an application to set up a chain of
6857 event handlers, where an event not handled by one event handler is
6858 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
6859 remove the event handler.
6860 """
6861 return _core_.Window_PushEventHandler(*args, **kwargs)
6862
6863 def PopEventHandler(*args, **kwargs):
6864 """
6865 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
6866
6867 Removes and returns the top-most event handler on the event handler
6868 stack. If deleteHandler is True then the wx.EvtHandler object will be
6869 destroyed after it is popped.
6870 """
6871 return _core_.Window_PopEventHandler(*args, **kwargs)
6872
6873 def RemoveEventHandler(*args, **kwargs):
6874 """
6875 RemoveEventHandler(self, EvtHandler handler) -> bool
6876
6877 Find the given handler in the event handler chain and remove (but not
6878 delete) it from the event handler chain, return True if it was found
6879 and False otherwise (this also results in an assert failure so this
6880 function should only be called when the handler is supposed to be
6881 there.)
6882 """
6883 return _core_.Window_RemoveEventHandler(*args, **kwargs)
6884
6885 def SetValidator(*args, **kwargs):
6886 """
6887 SetValidator(self, Validator validator)
6888
6889 Deletes the current validator (if any) and sets the window validator,
6890 having called wx.Validator.Clone to create a new validator of this
6891 type.
6892 """
6893 return _core_.Window_SetValidator(*args, **kwargs)
6894
6895 def GetValidator(*args, **kwargs):
6896 """
6897 GetValidator(self) -> Validator
6898
6899 Returns a pointer to the current validator for the window, or None if
6900 there is none.
6901 """
6902 return _core_.Window_GetValidator(*args, **kwargs)
6903
6904 def Validate(*args, **kwargs):
6905 """
6906 Validate(self) -> bool
6907
6908 Validates the current values of the child controls using their
6909 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6910 style flag set, the method will also call Validate() of all child
6911 windows. Returns false if any of the validations failed.
6912 """
6913 return _core_.Window_Validate(*args, **kwargs)
6914
6915 def TransferDataToWindow(*args, **kwargs):
6916 """
6917 TransferDataToWindow(self) -> bool
6918
6919 Transfers values to child controls from data areas specified by their
6920 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6921 style flag set, the method will also call TransferDataToWindow() of
6922 all child windows.
6923 """
6924 return _core_.Window_TransferDataToWindow(*args, **kwargs)
6925
6926 def TransferDataFromWindow(*args, **kwargs):
6927 """
6928 TransferDataFromWindow(self) -> bool
6929
6930 Transfers values from child controls to data areas specified by their
6931 validators. Returns false if a transfer failed. If the window has
6932 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
6933 also call TransferDataFromWindow() of all child windows.
6934 """
6935 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
6936
6937 def InitDialog(*args, **kwargs):
6938 """
6939 InitDialog(self)
6940
6941 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
6942 to the dialog via validators.
6943 """
6944 return _core_.Window_InitDialog(*args, **kwargs)
6945
6946 def SetAcceleratorTable(*args, **kwargs):
6947 """
6948 SetAcceleratorTable(self, AcceleratorTable accel)
6949
6950 Sets the accelerator table for this window.
6951 """
6952 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
6953
6954 def GetAcceleratorTable(*args, **kwargs):
6955 """
6956 GetAcceleratorTable(self) -> AcceleratorTable
6957
6958 Gets the accelerator table for this window.
6959 """
6960 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
6961
6962 def RegisterHotKey(*args, **kwargs):
6963 """
6964 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
6965
6966 Registers a system wide hotkey. Every time the user presses the hotkey
6967 registered here, this window will receive a hotkey event. It will
6968 receive the event even if the application is in the background and
6969 does not have the input focus because the user is working with some
6970 other application. To bind an event handler function to this hotkey
6971 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
6972 hotkey was registered successfully.
6973 """
6974 return _core_.Window_RegisterHotKey(*args, **kwargs)
6975
6976 def UnregisterHotKey(*args, **kwargs):
6977 """
6978 UnregisterHotKey(self, int hotkeyId) -> bool
6979
6980 Unregisters a system wide hotkey.
6981 """
6982 return _core_.Window_UnregisterHotKey(*args, **kwargs)
6983
6984 def ConvertDialogPointToPixels(*args, **kwargs):
6985 """
6986 ConvertDialogPointToPixels(self, Point pt) -> Point
6987
6988 Converts a point or size from dialog units to pixels. Dialog units
6989 are used for maintaining a dialog's proportions even if the font
6990 changes. For the x dimension, the dialog units are multiplied by the
6991 average character width and then divided by 4. For the y dimension,
6992 the dialog units are multiplied by the average character height and
6993 then divided by 8.
6994 """
6995 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
6996
6997 def ConvertDialogSizeToPixels(*args, **kwargs):
6998 """
6999 ConvertDialogSizeToPixels(self, Size sz) -> Size
7000
7001 Converts a point or size from dialog units to pixels. Dialog units
7002 are used for maintaining a dialog's proportions even if the font
7003 changes. For the x dimension, the dialog units are multiplied by the
7004 average character width and then divided by 4. For the y dimension,
7005 the dialog units are multiplied by the average character height and
7006 then divided by 8.
7007 """
7008 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
7009
7010 def DLG_PNT(*args, **kwargs):
7011 """
7012 DLG_PNT(self, Point pt) -> Point
7013
7014 Converts a point or size from dialog units to pixels. Dialog units
7015 are used for maintaining a dialog's proportions even if the font
7016 changes. For the x dimension, the dialog units are multiplied by the
7017 average character width and then divided by 4. For the y dimension,
7018 the dialog units are multiplied by the average character height and
7019 then divided by 8.
7020 """
7021 return _core_.Window_DLG_PNT(*args, **kwargs)
7022
7023 def DLG_SZE(*args, **kwargs):
7024 """
7025 DLG_SZE(self, Size sz) -> Size
7026
7027 Converts a point or size from dialog units to pixels. Dialog units
7028 are used for maintaining a dialog's proportions even if the font
7029 changes. For the x dimension, the dialog units are multiplied by the
7030 average character width and then divided by 4. For the y dimension,
7031 the dialog units are multiplied by the average character height and
7032 then divided by 8.
7033 """
7034 return _core_.Window_DLG_SZE(*args, **kwargs)
7035
7036 def ConvertPixelPointToDialog(*args, **kwargs):
7037 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
7038 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
7039
7040 def ConvertPixelSizeToDialog(*args, **kwargs):
7041 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
7042 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
7043
7044 def WarpPointer(*args, **kwargs):
7045 """
7046 WarpPointer(self, int x, int y)
7047
7048 Moves the pointer to the given position on the window.
7049
7050 NOTE: This function is not supported under Mac because Apple Human
7051 Interface Guidelines forbid moving the mouse cursor programmatically.
7052 """
7053 return _core_.Window_WarpPointer(*args, **kwargs)
7054
7055 def CaptureMouse(*args, **kwargs):
7056 """
7057 CaptureMouse(self)
7058
7059 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
7060 release the capture.
7061
7062 Note that wxWindows maintains the stack of windows having captured the
7063 mouse and when the mouse is released the capture returns to the window
7064 which had had captured it previously and it is only really released if
7065 there were no previous window. In particular, this means that you must
7066 release the mouse as many times as you capture it.
7067 """
7068 return _core_.Window_CaptureMouse(*args, **kwargs)
7069
7070 def ReleaseMouse(*args, **kwargs):
7071 """
7072 ReleaseMouse(self)
7073
7074 Releases mouse input captured with wx.Window.CaptureMouse.
7075 """
7076 return _core_.Window_ReleaseMouse(*args, **kwargs)
7077
7078 def GetCapture(*args, **kwargs):
7079 """
7080 GetCapture() -> Window
7081
7082 Returns the window which currently captures the mouse or None
7083 """
7084 return _core_.Window_GetCapture(*args, **kwargs)
7085
7086 GetCapture = staticmethod(GetCapture)
7087 def HasCapture(*args, **kwargs):
7088 """
7089 HasCapture(self) -> bool
7090
7091 Returns true if this window has the current mouse capture.
7092 """
7093 return _core_.Window_HasCapture(*args, **kwargs)
7094
7095 def Refresh(*args, **kwargs):
7096 """
7097 Refresh(self, bool eraseBackground=True, Rect rect=None)
7098
7099 Mark the specified rectangle (or the whole window) as "dirty" so it
7100 will be repainted. Causes an EVT_PAINT event to be generated and sent
7101 to the window.
7102 """
7103 return _core_.Window_Refresh(*args, **kwargs)
7104
7105 def RefreshRect(*args, **kwargs):
7106 """
7107 RefreshRect(self, Rect rect)
7108
7109 Redraws the contents of the given rectangle: the area inside it will
7110 be repainted. This is the same as Refresh but has a nicer syntax.
7111 """
7112 return _core_.Window_RefreshRect(*args, **kwargs)
7113
7114 def Update(*args, **kwargs):
7115 """
7116 Update(self)
7117
7118 Calling this method immediately repaints the invalidated area of the
7119 window instead of waiting for the EVT_PAINT event to happen, (normally
7120 this would usually only happen when the flow of control returns to the
7121 event loop.) Notice that this function doesn't refresh the window and
7122 does nothing if the window has been already repainted. Use Refresh
7123 first if you want to immediately redraw the window (or some portion of
7124 it) unconditionally.
7125 """
7126 return _core_.Window_Update(*args, **kwargs)
7127
7128 def ClearBackground(*args, **kwargs):
7129 """
7130 ClearBackground(self)
7131
7132 Clears the window by filling it with the current background
7133 colour. Does not cause an erase background event to be generated.
7134 """
7135 return _core_.Window_ClearBackground(*args, **kwargs)
7136
7137 def Freeze(*args, **kwargs):
7138 """
7139 Freeze(self)
7140
7141 Freezes the window or, in other words, prevents any updates from
7142 taking place on screen, the window is not redrawn at all. Thaw must be
7143 called to reenable window redrawing. Calls to Freeze/Thaw may be
7144 nested, with the actual Thaw being delayed until all the nesting has
7145 been undone.
7146
7147 This method is useful for visual appearance optimization (for example,
7148 it is a good idea to use it before inserting large amount of text into
7149 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
7150 for all controls so it is mostly just a hint to wxWindows and not a
7151 mandatory directive.
7152 """
7153 return _core_.Window_Freeze(*args, **kwargs)
7154
7155 def Thaw(*args, **kwargs):
7156 """
7157 Thaw(self)
7158
7159 Reenables window updating after a previous call to Freeze. Calls to
7160 Freeze/Thaw may be nested, so Thaw must be called the same number of
7161 times that Freeze was before the window will be updated.
7162 """
7163 return _core_.Window_Thaw(*args, **kwargs)
7164
7165 def PrepareDC(*args, **kwargs):
7166 """
7167 PrepareDC(self, DC dc)
7168
7169 Call this function to prepare the device context for drawing a
7170 scrolled image. It sets the device origin according to the current
7171 scroll position.
7172 """
7173 return _core_.Window_PrepareDC(*args, **kwargs)
7174
7175 def GetUpdateRegion(*args, **kwargs):
7176 """
7177 GetUpdateRegion(self) -> Region
7178
7179 Returns the region specifying which parts of the window have been
7180 damaged. Should only be called within an EVT_PAINT handler.
7181 """
7182 return _core_.Window_GetUpdateRegion(*args, **kwargs)
7183
7184 def GetUpdateClientRect(*args, **kwargs):
7185 """
7186 GetUpdateClientRect(self) -> Rect
7187
7188 Get the update rectangle region bounding box in client coords.
7189 """
7190 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
7191
7192 def IsExposed(*args, **kwargs):
7193 """
7194 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
7195
7196 Returns true if the given point or rectangle area has been exposed
7197 since the last repaint. Call this in an paint event handler to
7198 optimize redrawing by only redrawing those areas, which have been
7199 exposed.
7200 """
7201 return _core_.Window_IsExposed(*args, **kwargs)
7202
7203 def IsExposedPoint(*args, **kwargs):
7204 """
7205 IsExposedPoint(self, Point pt) -> bool
7206
7207 Returns true if the given point or rectangle area has been exposed
7208 since the last repaint. Call this in an paint event handler to
7209 optimize redrawing by only redrawing those areas, which have been
7210 exposed.
7211 """
7212 return _core_.Window_IsExposedPoint(*args, **kwargs)
7213
7214 def IsExposedRect(*args, **kwargs):
7215 """
7216 IsExposedRect(self, Rect rect) -> bool
7217
7218 Returns true if the given point or rectangle area has been exposed
7219 since the last repaint. Call this in an paint event handler to
7220 optimize redrawing by only redrawing those areas, which have been
7221 exposed.
7222 """
7223 return _core_.Window_IsExposedRect(*args, **kwargs)
7224
7225 def GetDefaultAttributes(*args, **kwargs):
7226 """
7227 GetDefaultAttributes(self) -> VisualAttributes
7228
7229 Get the default attributes for an instance of this class. This is
7230 useful if you want to use the same font or colour in your own control
7231 as in a standard control -- which is a much better idea than hard
7232 coding specific colours or fonts which might look completely out of
7233 place on the user's system, especially if it uses themes.
7234 """
7235 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
7236
7237 def GetClassDefaultAttributes(*args, **kwargs):
7238 """
7239 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7240
7241 Get the default attributes for this class. This is useful if you want
7242 to use the same font or colour in your own control as in a standard
7243 control -- which is a much better idea than hard coding specific
7244 colours or fonts which might look completely out of place on the
7245 user's system, especially if it uses themes.
7246
7247 The variant parameter is only relevant under Mac currently and is
7248 ignore under other platforms. Under Mac, it will change the size of
7249 the returned font. See `wx.Window.SetWindowVariant` for more about
7250 this.
7251 """
7252 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7253
7254 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
7255 def SetBackgroundColour(*args, **kwargs):
7256 """
7257 SetBackgroundColour(self, Colour colour) -> bool
7258
7259 Sets the background colour of the window. Returns True if the colour
7260 was changed. The background colour is usually painted by the default
7261 EVT_ERASE_BACKGROUND event handler function under Windows and
7262 automatically under GTK. Using `wx.NullColour` will reset the window
7263 to the default background colour.
7264
7265 Note that setting the background colour may not cause an immediate
7266 refresh, so you may wish to call `ClearBackground` or `Refresh` after
7267 calling this function.
7268
7269 Using this function will disable attempts to use themes for this
7270 window, if the system supports them. Use with care since usually the
7271 themes represent the appearance chosen by the user to be used for all
7272 applications on the system.
7273 """
7274 return _core_.Window_SetBackgroundColour(*args, **kwargs)
7275
7276 def SetOwnBackgroundColour(*args, **kwargs):
7277 """SetOwnBackgroundColour(self, Colour colour)"""
7278 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
7279
7280 def SetForegroundColour(*args, **kwargs):
7281 """
7282 SetForegroundColour(self, Colour colour) -> bool
7283
7284 Sets the foreground colour of the window. Returns True is the colour
7285 was changed. The interpretation of foreground colour is dependent on
7286 the window class; it may be the text colour or other colour, or it may
7287 not be used at all.
7288 """
7289 return _core_.Window_SetForegroundColour(*args, **kwargs)
7290
7291 def SetOwnForegroundColour(*args, **kwargs):
7292 """SetOwnForegroundColour(self, Colour colour)"""
7293 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
7294
7295 def GetBackgroundColour(*args, **kwargs):
7296 """
7297 GetBackgroundColour(self) -> Colour
7298
7299 Returns the background colour of the window.
7300 """
7301 return _core_.Window_GetBackgroundColour(*args, **kwargs)
7302
7303 def GetForegroundColour(*args, **kwargs):
7304 """
7305 GetForegroundColour(self) -> Colour
7306
7307 Returns the foreground colour of the window. The interpretation of
7308 foreground colour is dependent on the window class; it may be the text
7309 colour or other colour, or it may not be used at all.
7310 """
7311 return _core_.Window_GetForegroundColour(*args, **kwargs)
7312
7313 def SetBackgroundStyle(*args, **kwargs):
7314 """
7315 SetBackgroundStyle(self, int style) -> bool
7316
7317 Returns the background style of the window. The background style
7318 indicates how the background of the window is drawn.
7319
7320 ====================== ========================================
7321 wx.BG_STYLE_SYSTEM The background colour or pattern should
7322 be determined by the system
7323 wx.BG_STYLE_COLOUR The background should be a solid colour
7324 wx.BG_STYLE_CUSTOM The background will be implemented by the
7325 application.
7326 ====================== ========================================
7327
7328 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7329 a custom background, such as a tiled bitmap. Currently the style has
7330 no effect on other platforms.
7331
7332 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7333 """
7334 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
7335
7336 def GetBackgroundStyle(*args, **kwargs):
7337 """
7338 GetBackgroundStyle(self) -> int
7339
7340 Returns the background style of the window.
7341
7342 :see: `SetBackgroundStyle`
7343 """
7344 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
7345
7346 def HasTransparentBackground(*args, **kwargs):
7347 """
7348 HasTransparentBackground(self) -> bool
7349
7350 Returns True if this window's background is transparent (as, for
7351 example, for `wx.StaticText`) and should show the parent window's
7352 background.
7353
7354 This method is mostly used internally by the library itself and you
7355 normally shouldn't have to call it. You may, however, have to override
7356 it in your custom control classes to ensure that background is painted
7357 correctly.
7358 """
7359 return _core_.Window_HasTransparentBackground(*args, **kwargs)
7360
7361 def SetCursor(*args, **kwargs):
7362 """
7363 SetCursor(self, Cursor cursor) -> bool
7364
7365 Sets the window's cursor. Notice that the window cursor also sets it
7366 for the children of the window implicitly.
7367
7368 The cursor may be wx.NullCursor in which case the window cursor will
7369 be reset back to default.
7370 """
7371 return _core_.Window_SetCursor(*args, **kwargs)
7372
7373 def GetCursor(*args, **kwargs):
7374 """
7375 GetCursor(self) -> Cursor
7376
7377 Return the cursor associated with this window.
7378 """
7379 return _core_.Window_GetCursor(*args, **kwargs)
7380
7381 def SetFont(*args, **kwargs):
7382 """
7383 SetFont(self, Font font) -> bool
7384
7385 Sets the font for this window.
7386 """
7387 return _core_.Window_SetFont(*args, **kwargs)
7388
7389 def SetOwnFont(*args, **kwargs):
7390 """SetOwnFont(self, Font font)"""
7391 return _core_.Window_SetOwnFont(*args, **kwargs)
7392
7393 def GetFont(*args, **kwargs):
7394 """
7395 GetFont(self) -> Font
7396
7397 Returns the default font used for this window.
7398 """
7399 return _core_.Window_GetFont(*args, **kwargs)
7400
7401 def SetCaret(*args, **kwargs):
7402 """
7403 SetCaret(self, Caret caret)
7404
7405 Sets the caret associated with the window.
7406 """
7407 return _core_.Window_SetCaret(*args, **kwargs)
7408
7409 def GetCaret(*args, **kwargs):
7410 """
7411 GetCaret(self) -> Caret
7412
7413 Returns the caret associated with the window.
7414 """
7415 return _core_.Window_GetCaret(*args, **kwargs)
7416
7417 def GetCharHeight(*args, **kwargs):
7418 """
7419 GetCharHeight(self) -> int
7420
7421 Get the (average) character size for the current font.
7422 """
7423 return _core_.Window_GetCharHeight(*args, **kwargs)
7424
7425 def GetCharWidth(*args, **kwargs):
7426 """
7427 GetCharWidth(self) -> int
7428
7429 Get the (average) character size for the current font.
7430 """
7431 return _core_.Window_GetCharWidth(*args, **kwargs)
7432
7433 def GetTextExtent(*args, **kwargs):
7434 """
7435 GetTextExtent(String string) -> (width, height)
7436
7437 Get the width and height of the text using the current font.
7438 """
7439 return _core_.Window_GetTextExtent(*args, **kwargs)
7440
7441 def GetFullTextExtent(*args, **kwargs):
7442 """
7443 GetFullTextExtent(String string, Font font=None) ->
7444 (width, height, descent, externalLeading)
7445
7446 Get the width, height, decent and leading of the text using the
7447 current or specified font.
7448 """
7449 return _core_.Window_GetFullTextExtent(*args, **kwargs)
7450
7451 def ClientToScreenXY(*args, **kwargs):
7452 """
7453 ClientToScreenXY(int x, int y) -> (x,y)
7454
7455 Converts to screen coordinates from coordinates relative to this window.
7456 """
7457 return _core_.Window_ClientToScreenXY(*args, **kwargs)
7458
7459 def ScreenToClientXY(*args, **kwargs):
7460 """
7461 ScreenToClientXY(int x, int y) -> (x,y)
7462
7463 Converts from screen to client window coordinates.
7464 """
7465 return _core_.Window_ScreenToClientXY(*args, **kwargs)
7466
7467 def ClientToScreen(*args, **kwargs):
7468 """
7469 ClientToScreen(self, Point pt) -> Point
7470
7471 Converts to screen coordinates from coordinates relative to this window.
7472 """
7473 return _core_.Window_ClientToScreen(*args, **kwargs)
7474
7475 def ScreenToClient(*args, **kwargs):
7476 """
7477 ScreenToClient(self, Point pt) -> Point
7478
7479 Converts from screen to client window coordinates.
7480 """
7481 return _core_.Window_ScreenToClient(*args, **kwargs)
7482
7483 def HitTestXY(*args, **kwargs):
7484 """
7485 HitTestXY(self, int x, int y) -> int
7486
7487 Test where the given (in client coords) point lies
7488 """
7489 return _core_.Window_HitTestXY(*args, **kwargs)
7490
7491 def HitTest(*args, **kwargs):
7492 """
7493 HitTest(self, Point pt) -> int
7494
7495 Test where the given (in client coords) point lies
7496 """
7497 return _core_.Window_HitTest(*args, **kwargs)
7498
7499 def GetBorder(*args):
7500 """
7501 GetBorder(self, long flags) -> int
7502 GetBorder(self) -> int
7503
7504 Get border for the flags of this window
7505 """
7506 return _core_.Window_GetBorder(*args)
7507
7508 def UpdateWindowUI(*args, **kwargs):
7509 """
7510 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
7511
7512 This function sends EVT_UPDATE_UI events to the window. The particular
7513 implementation depends on the window; for example a wx.ToolBar will
7514 send an update UI event for each toolbar button, and a wx.Frame will
7515 send an update UI event for each menubar menu item. You can call this
7516 function from your application to ensure that your UI is up-to-date at
7517 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7518 concerned). This may be necessary if you have called
7519 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7520 limit the overhead that wxWindows incurs by sending update UI events
7521 in idle time.
7522 """
7523 return _core_.Window_UpdateWindowUI(*args, **kwargs)
7524
7525 def PopupMenuXY(*args, **kwargs):
7526 """
7527 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
7528
7529 Pops up the given menu at the specified coordinates, relative to this window,
7530 and returns control when the user has dismissed the menu. If a menu item is
7531 selected, the corresponding menu event is generated and will be processed as
7532 usual. If the default position is given then the current position of the
7533 mouse cursor will be used.
7534 """
7535 return _core_.Window_PopupMenuXY(*args, **kwargs)
7536
7537 def PopupMenu(*args, **kwargs):
7538 """
7539 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
7540
7541 Pops up the given menu at the specified coordinates, relative to this window,
7542 and returns control when the user has dismissed the menu. If a menu item is
7543 selected, the corresponding menu event is generated and will be processed as
7544 usual. If the default position is given then the current position of the
7545 mouse cursor will be used.
7546 """
7547 return _core_.Window_PopupMenu(*args, **kwargs)
7548
7549 def GetHandle(*args, **kwargs):
7550 """
7551 GetHandle(self) -> long
7552
7553 Returns the platform-specific handle (as a long integer) of the
7554 physical window. Currently on wxMac it returns the handle of the
7555 toplevel parent of the window.
7556 """
7557 return _core_.Window_GetHandle(*args, **kwargs)
7558
7559 def AssociateHandle(*args, **kwargs):
7560 """
7561 AssociateHandle(self, long handle)
7562
7563 Associate the window with a new native handle
7564 """
7565 return _core_.Window_AssociateHandle(*args, **kwargs)
7566
7567 def DissociateHandle(*args, **kwargs):
7568 """
7569 DissociateHandle(self)
7570
7571 Dissociate the current native handle from the window
7572 """
7573 return _core_.Window_DissociateHandle(*args, **kwargs)
7574
7575 def HasScrollbar(*args, **kwargs):
7576 """
7577 HasScrollbar(self, int orient) -> bool
7578
7579 Does the window have the scrollbar for this orientation?
7580 """
7581 return _core_.Window_HasScrollbar(*args, **kwargs)
7582
7583 def SetScrollbar(*args, **kwargs):
7584 """
7585 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
7586 bool refresh=True)
7587
7588 Sets the scrollbar properties of a built-in scrollbar.
7589 """
7590 return _core_.Window_SetScrollbar(*args, **kwargs)
7591
7592 def SetScrollPos(*args, **kwargs):
7593 """
7594 SetScrollPos(self, int orientation, int pos, bool refresh=True)
7595
7596 Sets the position of one of the built-in scrollbars.
7597 """
7598 return _core_.Window_SetScrollPos(*args, **kwargs)
7599
7600 def GetScrollPos(*args, **kwargs):
7601 """
7602 GetScrollPos(self, int orientation) -> int
7603
7604 Returns the built-in scrollbar position.
7605 """
7606 return _core_.Window_GetScrollPos(*args, **kwargs)
7607
7608 def GetScrollThumb(*args, **kwargs):
7609 """
7610 GetScrollThumb(self, int orientation) -> int
7611
7612 Returns the built-in scrollbar thumb size.
7613 """
7614 return _core_.Window_GetScrollThumb(*args, **kwargs)
7615
7616 def GetScrollRange(*args, **kwargs):
7617 """
7618 GetScrollRange(self, int orientation) -> int
7619
7620 Returns the built-in scrollbar range.
7621 """
7622 return _core_.Window_GetScrollRange(*args, **kwargs)
7623
7624 def ScrollWindow(*args, **kwargs):
7625 """
7626 ScrollWindow(self, int dx, int dy, Rect rect=None)
7627
7628 Physically scrolls the pixels in the window and move child windows
7629 accordingly. Use this function to optimise your scrolling
7630 implementations, to minimise the area that must be redrawn. Note that
7631 it is rarely required to call this function from a user program.
7632 """
7633 return _core_.Window_ScrollWindow(*args, **kwargs)
7634
7635 def ScrollLines(*args, **kwargs):
7636 """
7637 ScrollLines(self, int lines) -> bool
7638
7639 If the platform and window class supports it, scrolls the window by
7640 the given number of lines down, if lines is positive, or up if lines
7641 is negative. Returns True if the window was scrolled, False if it was
7642 already on top/bottom and nothing was done.
7643 """
7644 return _core_.Window_ScrollLines(*args, **kwargs)
7645
7646 def ScrollPages(*args, **kwargs):
7647 """
7648 ScrollPages(self, int pages) -> bool
7649
7650 If the platform and window class supports it, scrolls the window by
7651 the given number of pages down, if pages is positive, or up if pages
7652 is negative. Returns True if the window was scrolled, False if it was
7653 already on top/bottom and nothing was done.
7654 """
7655 return _core_.Window_ScrollPages(*args, **kwargs)
7656
7657 def LineUp(*args, **kwargs):
7658 """
7659 LineUp(self) -> bool
7660
7661 This is just a wrapper for ScrollLines(-1).
7662 """
7663 return _core_.Window_LineUp(*args, **kwargs)
7664
7665 def LineDown(*args, **kwargs):
7666 """
7667 LineDown(self) -> bool
7668
7669 This is just a wrapper for ScrollLines(1).
7670 """
7671 return _core_.Window_LineDown(*args, **kwargs)
7672
7673 def PageUp(*args, **kwargs):
7674 """
7675 PageUp(self) -> bool
7676
7677 This is just a wrapper for ScrollPages(-1).
7678 """
7679 return _core_.Window_PageUp(*args, **kwargs)
7680
7681 def PageDown(*args, **kwargs):
7682 """
7683 PageDown(self) -> bool
7684
7685 This is just a wrapper for ScrollPages(1).
7686 """
7687 return _core_.Window_PageDown(*args, **kwargs)
7688
7689 def SetHelpText(*args, **kwargs):
7690 """
7691 SetHelpText(self, String text)
7692
7693 Sets the help text to be used as context-sensitive help for this
7694 window. Note that the text is actually stored by the current
7695 wxHelpProvider implementation, and not in the window object itself.
7696 """
7697 return _core_.Window_SetHelpText(*args, **kwargs)
7698
7699 def SetHelpTextForId(*args, **kwargs):
7700 """
7701 SetHelpTextForId(self, String text)
7702
7703 Associate this help text with all windows with the same id as this
7704 one.
7705 """
7706 return _core_.Window_SetHelpTextForId(*args, **kwargs)
7707
7708 def GetHelpText(*args, **kwargs):
7709 """
7710 GetHelpText(self) -> String
7711
7712 Gets the help text to be used as context-sensitive help for this
7713 window. Note that the text is actually stored by the current
7714 wxHelpProvider implementation, and not in the window object itself.
7715 """
7716 return _core_.Window_GetHelpText(*args, **kwargs)
7717
7718 def SetToolTipString(*args, **kwargs):
7719 """
7720 SetToolTipString(self, String tip)
7721
7722 Attach a tooltip to the window.
7723 """
7724 return _core_.Window_SetToolTipString(*args, **kwargs)
7725
7726 def SetToolTip(*args, **kwargs):
7727 """
7728 SetToolTip(self, ToolTip tip)
7729
7730 Attach a tooltip to the window.
7731 """
7732 return _core_.Window_SetToolTip(*args, **kwargs)
7733
7734 def GetToolTip(*args, **kwargs):
7735 """
7736 GetToolTip(self) -> ToolTip
7737
7738 get the associated tooltip or None if none
7739 """
7740 return _core_.Window_GetToolTip(*args, **kwargs)
7741
7742 def SetDropTarget(*args, **kwargs):
7743 """
7744 SetDropTarget(self, DropTarget dropTarget)
7745
7746 Associates a drop target with this window. If the window already has
7747 a drop target, it is deleted.
7748 """
7749 return _core_.Window_SetDropTarget(*args, **kwargs)
7750
7751 def GetDropTarget(*args, **kwargs):
7752 """
7753 GetDropTarget(self) -> DropTarget
7754
7755 Returns the associated drop target, which may be None.
7756 """
7757 return _core_.Window_GetDropTarget(*args, **kwargs)
7758
7759 def SetConstraints(*args, **kwargs):
7760 """
7761 SetConstraints(self, LayoutConstraints constraints)
7762
7763 Sets the window to have the given layout constraints. If an existing
7764 layout constraints object is already owned by the window, it will be
7765 deleted. Pass None to disassociate and delete the window's current
7766 constraints.
7767
7768 You must call SetAutoLayout to tell a window to use the constraints
7769 automatically in its default EVT_SIZE handler; otherwise, you must
7770 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7771 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7772 effect.
7773 """
7774 return _core_.Window_SetConstraints(*args, **kwargs)
7775
7776 def GetConstraints(*args, **kwargs):
7777 """
7778 GetConstraints(self) -> LayoutConstraints
7779
7780 Returns a pointer to the window's layout constraints, or None if there
7781 are none.
7782 """
7783 return _core_.Window_GetConstraints(*args, **kwargs)
7784
7785 def SetAutoLayout(*args, **kwargs):
7786 """
7787 SetAutoLayout(self, bool autoLayout)
7788
7789 Determines whether the Layout function will be called automatically
7790 when the window is resized. It is called implicitly by SetSizer but
7791 if you use SetConstraints you should call it manually or otherwise the
7792 window layout won't be correctly updated when its size changes.
7793 """
7794 return _core_.Window_SetAutoLayout(*args, **kwargs)
7795
7796 def GetAutoLayout(*args, **kwargs):
7797 """
7798 GetAutoLayout(self) -> bool
7799
7800 Returns the current autoLayout setting
7801 """
7802 return _core_.Window_GetAutoLayout(*args, **kwargs)
7803
7804 def Layout(*args, **kwargs):
7805 """
7806 Layout(self) -> bool
7807
7808 Invokes the constraint-based layout algorithm or the sizer-based
7809 algorithm for this window. See SetAutoLayout: when auto layout is on,
7810 this function gets called automatically by the default EVT_SIZE
7811 handler when the window is resized.
7812 """
7813 return _core_.Window_Layout(*args, **kwargs)
7814
7815 def SetSizer(*args, **kwargs):
7816 """
7817 SetSizer(self, Sizer sizer, bool deleteOld=True)
7818
7819 Sets the window to have the given layout sizer. The window will then
7820 own the object, and will take care of its deletion. If an existing
7821 layout sizer object is already owned by the window, it will be deleted
7822 if the deleteOld parameter is true. Note that this function will also
7823 call SetAutoLayout implicitly with a True parameter if the sizer is
7824 non-None, and False otherwise.
7825 """
7826 return _core_.Window_SetSizer(*args, **kwargs)
7827
7828 def SetSizerAndFit(*args, **kwargs):
7829 """
7830 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
7831
7832 The same as SetSizer, except it also sets the size hints for the
7833 window based on the sizer's minimum size.
7834 """
7835 return _core_.Window_SetSizerAndFit(*args, **kwargs)
7836
7837 def GetSizer(*args, **kwargs):
7838 """
7839 GetSizer(self) -> Sizer
7840
7841 Return the sizer associated with the window by a previous call to
7842 SetSizer or None if there isn't one.
7843 """
7844 return _core_.Window_GetSizer(*args, **kwargs)
7845
7846 def SetContainingSizer(*args, **kwargs):
7847 """
7848 SetContainingSizer(self, Sizer sizer)
7849
7850 This normally does not need to be called by application code. It is
7851 called internally when a window is added to a sizer, and is used so
7852 the window can remove itself from the sizer when it is destroyed.
7853 """
7854 return _core_.Window_SetContainingSizer(*args, **kwargs)
7855
7856 def GetContainingSizer(*args, **kwargs):
7857 """
7858 GetContainingSizer(self) -> Sizer
7859
7860 Return the sizer that this window is a member of, if any, otherwise None.
7861 """
7862 return _core_.Window_GetContainingSizer(*args, **kwargs)
7863
7864 def InheritAttributes(*args, **kwargs):
7865 """
7866 InheritAttributes(self)
7867
7868 This function is (or should be, in case of custom controls) called
7869 during window creation to intelligently set up the window visual
7870 attributes, that is the font and the foreground and background
7871 colours.
7872
7873 By 'intelligently' the following is meant: by default, all windows use
7874 their own default attributes. However if some of the parent's
7875 attributes are explicitly changed (that is, using SetFont and not
7876 SetOwnFont) and if the corresponding attribute hadn't been
7877 explicitly set for this window itself, then this window takes the same
7878 value as used by the parent. In addition, if the window overrides
7879 ShouldInheritColours to return false, the colours will not be changed
7880 no matter what and only the font might.
7881
7882 This rather complicated logic is necessary in order to accommodate the
7883 different usage scenarios. The most common one is when all default
7884 attributes are used and in this case, nothing should be inherited as
7885 in modern GUIs different controls use different fonts (and colours)
7886 than their siblings so they can't inherit the same value from the
7887 parent. However it was also deemed desirable to allow to simply change
7888 the attributes of all children at once by just changing the font or
7889 colour of their common parent, hence in this case we do inherit the
7890 parents attributes.
7891
7892 """
7893 return _core_.Window_InheritAttributes(*args, **kwargs)
7894
7895 def ShouldInheritColours(*args, **kwargs):
7896 """
7897 ShouldInheritColours(self) -> bool
7898
7899 Return true from here to allow the colours of this window to be
7900 changed by InheritAttributes, returning false forbids inheriting them
7901 from the parent window.
7902
7903 The base class version returns false, but this method is overridden in
7904 wxControl where it returns true.
7905 """
7906 return _core_.Window_ShouldInheritColours(*args, **kwargs)
7907
7908 def PostCreate(self, pre):
7909 """
7910 Phase 3 of the 2-phase create <wink!>
7911 Call this method after precreating the window with the 2-phase create method.
7912 """
7913 self.this = pre.this
7914 self.thisown = pre.thisown
7915 pre.thisown = 0
7916 if hasattr(self, '_setOORInfo'):
7917 self._setOORInfo(self)
7918 if hasattr(self, '_setCallbackInfo'):
7919 self._setCallbackInfo(self, self.__class__)
7920
7921
7922 class WindowPtr(Window):
7923 def __init__(self, this):
7924 self.this = this
7925 if not hasattr(self,"thisown"): self.thisown = 0
7926 self.__class__ = Window
7927 _core_.Window_swigregister(WindowPtr)
7928
7929 def PreWindow(*args, **kwargs):
7930 """
7931 PreWindow() -> Window
7932
7933 Precreate a Window for 2-phase creation.
7934 """
7935 val = _core_.new_PreWindow(*args, **kwargs)
7936 val.thisown = 1
7937 return val
7938
7939 def Window_NewControlId(*args, **kwargs):
7940 """
7941 Window_NewControlId() -> int
7942
7943 Generate a control id for the controls which were not given one.
7944 """
7945 return _core_.Window_NewControlId(*args, **kwargs)
7946
7947 def Window_NextControlId(*args, **kwargs):
7948 """
7949 Window_NextControlId(int winid) -> int
7950
7951 Get the id of the control following the one with the given
7952 autogenerated) id
7953 """
7954 return _core_.Window_NextControlId(*args, **kwargs)
7955
7956 def Window_PrevControlId(*args, **kwargs):
7957 """
7958 Window_PrevControlId(int winid) -> int
7959
7960 Get the id of the control preceding the one with the given
7961 autogenerated) id
7962 """
7963 return _core_.Window_PrevControlId(*args, **kwargs)
7964
7965 def Window_FindFocus(*args, **kwargs):
7966 """
7967 Window_FindFocus() -> Window
7968
7969 Returns the window or control that currently has the keyboard focus,
7970 or None.
7971 """
7972 return _core_.Window_FindFocus(*args, **kwargs)
7973
7974 def Window_GetCapture(*args, **kwargs):
7975 """
7976 Window_GetCapture() -> Window
7977
7978 Returns the window which currently captures the mouse or None
7979 """
7980 return _core_.Window_GetCapture(*args, **kwargs)
7981
7982 def Window_GetClassDefaultAttributes(*args, **kwargs):
7983 """
7984 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7985
7986 Get the default attributes for this class. This is useful if you want
7987 to use the same font or colour in your own control as in a standard
7988 control -- which is a much better idea than hard coding specific
7989 colours or fonts which might look completely out of place on the
7990 user's system, especially if it uses themes.
7991
7992 The variant parameter is only relevant under Mac currently and is
7993 ignore under other platforms. Under Mac, it will change the size of
7994 the returned font. See `wx.Window.SetWindowVariant` for more about
7995 this.
7996 """
7997 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7998
7999 def DLG_PNT(win, point_or_x, y=None):
8000 """
8001 Convenience function for converting a Point or (x,y) in
8002 dialog units to pixel units.
8003 """
8004 if y is None:
8005 return win.ConvertDialogPointToPixels(point_or_x)
8006 else:
8007 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
8008
8009 def DLG_SZE(win, size_width, height=None):
8010 """
8011 Convenience function for converting a Size or (w,h) in
8012 dialog units to pixel units.
8013 """
8014 if height is None:
8015 return win.ConvertDialogSizeToPixels(size_width)
8016 else:
8017 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
8018
8019
8020 def FindWindowById(*args, **kwargs):
8021 """
8022 FindWindowById(long id, Window parent=None) -> Window
8023
8024 Find the first window in the application with the given id. If parent
8025 is None, the search will start from all top-level frames and dialog
8026 boxes; if non-None, the search will be limited to the given window
8027 hierarchy. The search is recursive in both cases.
8028 """
8029 return _core_.FindWindowById(*args, **kwargs)
8030
8031 def FindWindowByName(*args, **kwargs):
8032 """
8033 FindWindowByName(String name, Window parent=None) -> Window
8034
8035 Find a window by its name (as given in a window constructor or Create
8036 function call). If parent is None, the search will start from all
8037 top-level frames and dialog boxes; if non-None, the search will be
8038 limited to the given window hierarchy. The search is recursive in both
8039 cases.
8040
8041 If no window with such name is found, wx.FindWindowByLabel is called.
8042 """
8043 return _core_.FindWindowByName(*args, **kwargs)
8044
8045 def FindWindowByLabel(*args, **kwargs):
8046 """
8047 FindWindowByLabel(String label, Window parent=None) -> Window
8048
8049 Find a window by its label. Depending on the type of window, the label
8050 may be a window title or panel item label. If parent is None, the
8051 search will start from all top-level frames and dialog boxes; if
8052 non-None, the search will be limited to the given window
8053 hierarchy. The search is recursive in both cases.
8054 """
8055 return _core_.FindWindowByLabel(*args, **kwargs)
8056
8057 def Window_FromHWND(*args, **kwargs):
8058 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
8059 return _core_.Window_FromHWND(*args, **kwargs)
8060 #---------------------------------------------------------------------------
8061
8062 class Validator(EvtHandler):
8063 """Proxy of C++ Validator class"""
8064 def __repr__(self):
8065 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8066 def __init__(self, *args, **kwargs):
8067 """__init__(self) -> Validator"""
8068 newobj = _core_.new_Validator(*args, **kwargs)
8069 self.this = newobj.this
8070 self.thisown = 1
8071 del newobj.thisown
8072 self._setOORInfo(self)
8073
8074 def Clone(*args, **kwargs):
8075 """Clone(self) -> Validator"""
8076 return _core_.Validator_Clone(*args, **kwargs)
8077
8078 def Validate(*args, **kwargs):
8079 """Validate(self, Window parent) -> bool"""
8080 return _core_.Validator_Validate(*args, **kwargs)
8081
8082 def TransferToWindow(*args, **kwargs):
8083 """TransferToWindow(self) -> bool"""
8084 return _core_.Validator_TransferToWindow(*args, **kwargs)
8085
8086 def TransferFromWindow(*args, **kwargs):
8087 """TransferFromWindow(self) -> bool"""
8088 return _core_.Validator_TransferFromWindow(*args, **kwargs)
8089
8090 def GetWindow(*args, **kwargs):
8091 """GetWindow(self) -> Window"""
8092 return _core_.Validator_GetWindow(*args, **kwargs)
8093
8094 def SetWindow(*args, **kwargs):
8095 """SetWindow(self, Window window)"""
8096 return _core_.Validator_SetWindow(*args, **kwargs)
8097
8098 def IsSilent(*args, **kwargs):
8099 """IsSilent() -> bool"""
8100 return _core_.Validator_IsSilent(*args, **kwargs)
8101
8102 IsSilent = staticmethod(IsSilent)
8103 def SetBellOnError(*args, **kwargs):
8104 """SetBellOnError(int doIt=True)"""
8105 return _core_.Validator_SetBellOnError(*args, **kwargs)
8106
8107 SetBellOnError = staticmethod(SetBellOnError)
8108
8109 class ValidatorPtr(Validator):
8110 def __init__(self, this):
8111 self.this = this
8112 if not hasattr(self,"thisown"): self.thisown = 0
8113 self.__class__ = Validator
8114 _core_.Validator_swigregister(ValidatorPtr)
8115
8116 def Validator_IsSilent(*args, **kwargs):
8117 """Validator_IsSilent() -> bool"""
8118 return _core_.Validator_IsSilent(*args, **kwargs)
8119
8120 def Validator_SetBellOnError(*args, **kwargs):
8121 """Validator_SetBellOnError(int doIt=True)"""
8122 return _core_.Validator_SetBellOnError(*args, **kwargs)
8123
8124 class PyValidator(Validator):
8125 """Proxy of C++ PyValidator class"""
8126 def __repr__(self):
8127 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8128 def __init__(self, *args, **kwargs):
8129 """__init__(self) -> PyValidator"""
8130 newobj = _core_.new_PyValidator(*args, **kwargs)
8131 self.this = newobj.this
8132 self.thisown = 1
8133 del newobj.thisown
8134
8135 self._setCallbackInfo(self, PyValidator, 1)
8136 self._setOORInfo(self)
8137
8138 def _setCallbackInfo(*args, **kwargs):
8139 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
8140 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
8141
8142
8143 class PyValidatorPtr(PyValidator):
8144 def __init__(self, this):
8145 self.this = this
8146 if not hasattr(self,"thisown"): self.thisown = 0
8147 self.__class__ = PyValidator
8148 _core_.PyValidator_swigregister(PyValidatorPtr)
8149
8150 #---------------------------------------------------------------------------
8151
8152 class Menu(EvtHandler):
8153 """Proxy of C++ Menu class"""
8154 def __repr__(self):
8155 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8156 def __init__(self, *args, **kwargs):
8157 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
8158 newobj = _core_.new_Menu(*args, **kwargs)
8159 self.this = newobj.this
8160 self.thisown = 1
8161 del newobj.thisown
8162 self._setOORInfo(self)
8163
8164 def Append(*args, **kwargs):
8165 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8166 return _core_.Menu_Append(*args, **kwargs)
8167
8168 def AppendSeparator(*args, **kwargs):
8169 """AppendSeparator(self) -> MenuItem"""
8170 return _core_.Menu_AppendSeparator(*args, **kwargs)
8171
8172 def AppendCheckItem(*args, **kwargs):
8173 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8174 return _core_.Menu_AppendCheckItem(*args, **kwargs)
8175
8176 def AppendRadioItem(*args, **kwargs):
8177 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8178 return _core_.Menu_AppendRadioItem(*args, **kwargs)
8179
8180 def AppendMenu(*args, **kwargs):
8181 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8182 return _core_.Menu_AppendMenu(*args, **kwargs)
8183
8184 def AppendItem(*args, **kwargs):
8185 """AppendItem(self, MenuItem item) -> MenuItem"""
8186 return _core_.Menu_AppendItem(*args, **kwargs)
8187
8188 def Break(*args, **kwargs):
8189 """Break(self)"""
8190 return _core_.Menu_Break(*args, **kwargs)
8191
8192 def InsertItem(*args, **kwargs):
8193 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
8194 return _core_.Menu_InsertItem(*args, **kwargs)
8195
8196 def Insert(*args, **kwargs):
8197 """
8198 Insert(self, size_t pos, int id, String text, String help=EmptyString,
8199 int kind=ITEM_NORMAL) -> MenuItem
8200 """
8201 return _core_.Menu_Insert(*args, **kwargs)
8202
8203 def InsertSeparator(*args, **kwargs):
8204 """InsertSeparator(self, size_t pos) -> MenuItem"""
8205 return _core_.Menu_InsertSeparator(*args, **kwargs)
8206
8207 def InsertCheckItem(*args, **kwargs):
8208 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8209 return _core_.Menu_InsertCheckItem(*args, **kwargs)
8210
8211 def InsertRadioItem(*args, **kwargs):
8212 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8213 return _core_.Menu_InsertRadioItem(*args, **kwargs)
8214
8215 def InsertMenu(*args, **kwargs):
8216 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8217 return _core_.Menu_InsertMenu(*args, **kwargs)
8218
8219 def PrependItem(*args, **kwargs):
8220 """PrependItem(self, MenuItem item) -> MenuItem"""
8221 return _core_.Menu_PrependItem(*args, **kwargs)
8222
8223 def Prepend(*args, **kwargs):
8224 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8225 return _core_.Menu_Prepend(*args, **kwargs)
8226
8227 def PrependSeparator(*args, **kwargs):
8228 """PrependSeparator(self) -> MenuItem"""
8229 return _core_.Menu_PrependSeparator(*args, **kwargs)
8230
8231 def PrependCheckItem(*args, **kwargs):
8232 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8233 return _core_.Menu_PrependCheckItem(*args, **kwargs)
8234
8235 def PrependRadioItem(*args, **kwargs):
8236 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8237 return _core_.Menu_PrependRadioItem(*args, **kwargs)
8238
8239 def PrependMenu(*args, **kwargs):
8240 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8241 return _core_.Menu_PrependMenu(*args, **kwargs)
8242
8243 def Remove(*args, **kwargs):
8244 """Remove(self, int id) -> MenuItem"""
8245 return _core_.Menu_Remove(*args, **kwargs)
8246
8247 def RemoveItem(*args, **kwargs):
8248 """RemoveItem(self, MenuItem item) -> MenuItem"""
8249 return _core_.Menu_RemoveItem(*args, **kwargs)
8250
8251 def Delete(*args, **kwargs):
8252 """Delete(self, int id) -> bool"""
8253 return _core_.Menu_Delete(*args, **kwargs)
8254
8255 def DeleteItem(*args, **kwargs):
8256 """DeleteItem(self, MenuItem item) -> bool"""
8257 return _core_.Menu_DeleteItem(*args, **kwargs)
8258
8259 def Destroy(*args, **kwargs):
8260 """
8261 Destroy(self)
8262
8263 Deletes the C++ object this Python object is a proxy for.
8264 """
8265 return _core_.Menu_Destroy(*args, **kwargs)
8266
8267 def DestroyId(*args, **kwargs):
8268 """
8269 DestroyId(self, int id) -> bool
8270
8271 Deletes the C++ object this Python object is a proxy for.
8272 """
8273 return _core_.Menu_DestroyId(*args, **kwargs)
8274
8275 def DestroyItem(*args, **kwargs):
8276 """
8277 DestroyItem(self, MenuItem item) -> bool
8278
8279 Deletes the C++ object this Python object is a proxy for.
8280 """
8281 return _core_.Menu_DestroyItem(*args, **kwargs)
8282
8283 def GetMenuItemCount(*args, **kwargs):
8284 """GetMenuItemCount(self) -> size_t"""
8285 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
8286
8287 def GetMenuItems(*args, **kwargs):
8288 """GetMenuItems(self) -> PyObject"""
8289 return _core_.Menu_GetMenuItems(*args, **kwargs)
8290
8291 def FindItem(*args, **kwargs):
8292 """FindItem(self, String item) -> int"""
8293 return _core_.Menu_FindItem(*args, **kwargs)
8294
8295 def FindItemById(*args, **kwargs):
8296 """FindItemById(self, int id) -> MenuItem"""
8297 return _core_.Menu_FindItemById(*args, **kwargs)
8298
8299 def FindItemByPosition(*args, **kwargs):
8300 """FindItemByPosition(self, size_t position) -> MenuItem"""
8301 return _core_.Menu_FindItemByPosition(*args, **kwargs)
8302
8303 def Enable(*args, **kwargs):
8304 """Enable(self, int id, bool enable)"""
8305 return _core_.Menu_Enable(*args, **kwargs)
8306
8307 def IsEnabled(*args, **kwargs):
8308 """IsEnabled(self, int id) -> bool"""
8309 return _core_.Menu_IsEnabled(*args, **kwargs)
8310
8311 def Check(*args, **kwargs):
8312 """Check(self, int id, bool check)"""
8313 return _core_.Menu_Check(*args, **kwargs)
8314
8315 def IsChecked(*args, **kwargs):
8316 """IsChecked(self, int id) -> bool"""
8317 return _core_.Menu_IsChecked(*args, **kwargs)
8318
8319 def SetLabel(*args, **kwargs):
8320 """SetLabel(self, int id, String label)"""
8321 return _core_.Menu_SetLabel(*args, **kwargs)
8322
8323 def GetLabel(*args, **kwargs):
8324 """GetLabel(self, int id) -> String"""
8325 return _core_.Menu_GetLabel(*args, **kwargs)
8326
8327 def SetHelpString(*args, **kwargs):
8328 """SetHelpString(self, int id, String helpString)"""
8329 return _core_.Menu_SetHelpString(*args, **kwargs)
8330
8331 def GetHelpString(*args, **kwargs):
8332 """GetHelpString(self, int id) -> String"""
8333 return _core_.Menu_GetHelpString(*args, **kwargs)
8334
8335 def SetTitle(*args, **kwargs):
8336 """SetTitle(self, String title)"""
8337 return _core_.Menu_SetTitle(*args, **kwargs)
8338
8339 def GetTitle(*args, **kwargs):
8340 """GetTitle(self) -> String"""
8341 return _core_.Menu_GetTitle(*args, **kwargs)
8342
8343 def SetEventHandler(*args, **kwargs):
8344 """SetEventHandler(self, EvtHandler handler)"""
8345 return _core_.Menu_SetEventHandler(*args, **kwargs)
8346
8347 def GetEventHandler(*args, **kwargs):
8348 """GetEventHandler(self) -> EvtHandler"""
8349 return _core_.Menu_GetEventHandler(*args, **kwargs)
8350
8351 def SetInvokingWindow(*args, **kwargs):
8352 """SetInvokingWindow(self, Window win)"""
8353 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
8354
8355 def GetInvokingWindow(*args, **kwargs):
8356 """GetInvokingWindow(self) -> Window"""
8357 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
8358
8359 def GetStyle(*args, **kwargs):
8360 """GetStyle(self) -> long"""
8361 return _core_.Menu_GetStyle(*args, **kwargs)
8362
8363 def UpdateUI(*args, **kwargs):
8364 """UpdateUI(self, EvtHandler source=None)"""
8365 return _core_.Menu_UpdateUI(*args, **kwargs)
8366
8367 def GetMenuBar(*args, **kwargs):
8368 """GetMenuBar(self) -> MenuBar"""
8369 return _core_.Menu_GetMenuBar(*args, **kwargs)
8370
8371 def Attach(*args, **kwargs):
8372 """Attach(self, wxMenuBarBase menubar)"""
8373 return _core_.Menu_Attach(*args, **kwargs)
8374
8375 def Detach(*args, **kwargs):
8376 """Detach(self)"""
8377 return _core_.Menu_Detach(*args, **kwargs)
8378
8379 def IsAttached(*args, **kwargs):
8380 """IsAttached(self) -> bool"""
8381 return _core_.Menu_IsAttached(*args, **kwargs)
8382
8383 def SetParent(*args, **kwargs):
8384 """SetParent(self, Menu parent)"""
8385 return _core_.Menu_SetParent(*args, **kwargs)
8386
8387 def GetParent(*args, **kwargs):
8388 """GetParent(self) -> Menu"""
8389 return _core_.Menu_GetParent(*args, **kwargs)
8390
8391
8392 class MenuPtr(Menu):
8393 def __init__(self, this):
8394 self.this = this
8395 if not hasattr(self,"thisown"): self.thisown = 0
8396 self.__class__ = Menu
8397 _core_.Menu_swigregister(MenuPtr)
8398 DefaultValidator = cvar.DefaultValidator
8399
8400 #---------------------------------------------------------------------------
8401
8402 class MenuBar(Window):
8403 """Proxy of C++ MenuBar class"""
8404 def __repr__(self):
8405 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8406 def __init__(self, *args, **kwargs):
8407 """__init__(self, long style=0) -> MenuBar"""
8408 newobj = _core_.new_MenuBar(*args, **kwargs)
8409 self.this = newobj.this
8410 self.thisown = 1
8411 del newobj.thisown
8412 self._setOORInfo(self)
8413
8414 def Append(*args, **kwargs):
8415 """Append(self, Menu menu, String title) -> bool"""
8416 return _core_.MenuBar_Append(*args, **kwargs)
8417
8418 def Insert(*args, **kwargs):
8419 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
8420 return _core_.MenuBar_Insert(*args, **kwargs)
8421
8422 def GetMenuCount(*args, **kwargs):
8423 """GetMenuCount(self) -> size_t"""
8424 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
8425
8426 def GetMenu(*args, **kwargs):
8427 """GetMenu(self, size_t pos) -> Menu"""
8428 return _core_.MenuBar_GetMenu(*args, **kwargs)
8429
8430 def Replace(*args, **kwargs):
8431 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
8432 return _core_.MenuBar_Replace(*args, **kwargs)
8433
8434 def Remove(*args, **kwargs):
8435 """Remove(self, size_t pos) -> Menu"""
8436 return _core_.MenuBar_Remove(*args, **kwargs)
8437
8438 def EnableTop(*args, **kwargs):
8439 """EnableTop(self, size_t pos, bool enable)"""
8440 return _core_.MenuBar_EnableTop(*args, **kwargs)
8441
8442 def IsEnabledTop(*args, **kwargs):
8443 """IsEnabledTop(self, size_t pos) -> bool"""
8444 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
8445
8446 def SetLabelTop(*args, **kwargs):
8447 """SetLabelTop(self, size_t pos, String label)"""
8448 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
8449
8450 def GetLabelTop(*args, **kwargs):
8451 """GetLabelTop(self, size_t pos) -> String"""
8452 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
8453
8454 def FindMenuItem(*args, **kwargs):
8455 """FindMenuItem(self, String menu, String item) -> int"""
8456 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
8457
8458 def FindItemById(*args, **kwargs):
8459 """FindItemById(self, int id) -> MenuItem"""
8460 return _core_.MenuBar_FindItemById(*args, **kwargs)
8461
8462 def FindMenu(*args, **kwargs):
8463 """FindMenu(self, String title) -> int"""
8464 return _core_.MenuBar_FindMenu(*args, **kwargs)
8465
8466 def Enable(*args, **kwargs):
8467 """Enable(self, int id, bool enable)"""
8468 return _core_.MenuBar_Enable(*args, **kwargs)
8469
8470 def Check(*args, **kwargs):
8471 """Check(self, int id, bool check)"""
8472 return _core_.MenuBar_Check(*args, **kwargs)
8473
8474 def IsChecked(*args, **kwargs):
8475 """IsChecked(self, int id) -> bool"""
8476 return _core_.MenuBar_IsChecked(*args, **kwargs)
8477
8478 def IsEnabled(*args, **kwargs):
8479 """IsEnabled(self, int id) -> bool"""
8480 return _core_.MenuBar_IsEnabled(*args, **kwargs)
8481
8482 def SetLabel(*args, **kwargs):
8483 """SetLabel(self, int id, String label)"""
8484 return _core_.MenuBar_SetLabel(*args, **kwargs)
8485
8486 def GetLabel(*args, **kwargs):
8487 """GetLabel(self, int id) -> String"""
8488 return _core_.MenuBar_GetLabel(*args, **kwargs)
8489
8490 def SetHelpString(*args, **kwargs):
8491 """SetHelpString(self, int id, String helpString)"""
8492 return _core_.MenuBar_SetHelpString(*args, **kwargs)
8493
8494 def GetHelpString(*args, **kwargs):
8495 """GetHelpString(self, int id) -> String"""
8496 return _core_.MenuBar_GetHelpString(*args, **kwargs)
8497
8498 def GetFrame(*args, **kwargs):
8499 """GetFrame(self) -> wxFrame"""
8500 return _core_.MenuBar_GetFrame(*args, **kwargs)
8501
8502 def IsAttached(*args, **kwargs):
8503 """IsAttached(self) -> bool"""
8504 return _core_.MenuBar_IsAttached(*args, **kwargs)
8505
8506 def Attach(*args, **kwargs):
8507 """Attach(self, wxFrame frame)"""
8508 return _core_.MenuBar_Attach(*args, **kwargs)
8509
8510 def Detach(*args, **kwargs):
8511 """Detach(self)"""
8512 return _core_.MenuBar_Detach(*args, **kwargs)
8513
8514
8515 class MenuBarPtr(MenuBar):
8516 def __init__(self, this):
8517 self.this = this
8518 if not hasattr(self,"thisown"): self.thisown = 0
8519 self.__class__ = MenuBar
8520 _core_.MenuBar_swigregister(MenuBarPtr)
8521
8522 #---------------------------------------------------------------------------
8523
8524 class MenuItem(Object):
8525 """Proxy of C++ MenuItem class"""
8526 def __repr__(self):
8527 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8528 def __init__(self, *args, **kwargs):
8529 """
8530 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
8531 String help=EmptyString, int kind=ITEM_NORMAL,
8532 Menu subMenu=None) -> MenuItem
8533 """
8534 newobj = _core_.new_MenuItem(*args, **kwargs)
8535 self.this = newobj.this
8536 self.thisown = 1
8537 del newobj.thisown
8538 def GetMenu(*args, **kwargs):
8539 """GetMenu(self) -> Menu"""
8540 return _core_.MenuItem_GetMenu(*args, **kwargs)
8541
8542 def SetMenu(*args, **kwargs):
8543 """SetMenu(self, Menu menu)"""
8544 return _core_.MenuItem_SetMenu(*args, **kwargs)
8545
8546 def SetId(*args, **kwargs):
8547 """SetId(self, int id)"""
8548 return _core_.MenuItem_SetId(*args, **kwargs)
8549
8550 def GetId(*args, **kwargs):
8551 """GetId(self) -> int"""
8552 return _core_.MenuItem_GetId(*args, **kwargs)
8553
8554 def IsSeparator(*args, **kwargs):
8555 """IsSeparator(self) -> bool"""
8556 return _core_.MenuItem_IsSeparator(*args, **kwargs)
8557
8558 def SetText(*args, **kwargs):
8559 """SetText(self, String str)"""
8560 return _core_.MenuItem_SetText(*args, **kwargs)
8561
8562 def GetLabel(*args, **kwargs):
8563 """GetLabel(self) -> String"""
8564 return _core_.MenuItem_GetLabel(*args, **kwargs)
8565
8566 def GetText(*args, **kwargs):
8567 """GetText(self) -> String"""
8568 return _core_.MenuItem_GetText(*args, **kwargs)
8569
8570 def GetLabelFromText(*args, **kwargs):
8571 """GetLabelFromText(String text) -> String"""
8572 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8573
8574 GetLabelFromText = staticmethod(GetLabelFromText)
8575 def GetKind(*args, **kwargs):
8576 """GetKind(self) -> int"""
8577 return _core_.MenuItem_GetKind(*args, **kwargs)
8578
8579 def SetKind(*args, **kwargs):
8580 """SetKind(self, int kind)"""
8581 return _core_.MenuItem_SetKind(*args, **kwargs)
8582
8583 def SetCheckable(*args, **kwargs):
8584 """SetCheckable(self, bool checkable)"""
8585 return _core_.MenuItem_SetCheckable(*args, **kwargs)
8586
8587 def IsCheckable(*args, **kwargs):
8588 """IsCheckable(self) -> bool"""
8589 return _core_.MenuItem_IsCheckable(*args, **kwargs)
8590
8591 def IsSubMenu(*args, **kwargs):
8592 """IsSubMenu(self) -> bool"""
8593 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
8594
8595 def SetSubMenu(*args, **kwargs):
8596 """SetSubMenu(self, Menu menu)"""
8597 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
8598
8599 def GetSubMenu(*args, **kwargs):
8600 """GetSubMenu(self) -> Menu"""
8601 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
8602
8603 def Enable(*args, **kwargs):
8604 """Enable(self, bool enable=True)"""
8605 return _core_.MenuItem_Enable(*args, **kwargs)
8606
8607 def IsEnabled(*args, **kwargs):
8608 """IsEnabled(self) -> bool"""
8609 return _core_.MenuItem_IsEnabled(*args, **kwargs)
8610
8611 def Check(*args, **kwargs):
8612 """Check(self, bool check=True)"""
8613 return _core_.MenuItem_Check(*args, **kwargs)
8614
8615 def IsChecked(*args, **kwargs):
8616 """IsChecked(self) -> bool"""
8617 return _core_.MenuItem_IsChecked(*args, **kwargs)
8618
8619 def Toggle(*args, **kwargs):
8620 """Toggle(self)"""
8621 return _core_.MenuItem_Toggle(*args, **kwargs)
8622
8623 def SetHelp(*args, **kwargs):
8624 """SetHelp(self, String str)"""
8625 return _core_.MenuItem_SetHelp(*args, **kwargs)
8626
8627 def GetHelp(*args, **kwargs):
8628 """GetHelp(self) -> String"""
8629 return _core_.MenuItem_GetHelp(*args, **kwargs)
8630
8631 def GetAccel(*args, **kwargs):
8632 """GetAccel(self) -> AcceleratorEntry"""
8633 return _core_.MenuItem_GetAccel(*args, **kwargs)
8634
8635 def SetAccel(*args, **kwargs):
8636 """SetAccel(self, AcceleratorEntry accel)"""
8637 return _core_.MenuItem_SetAccel(*args, **kwargs)
8638
8639 def GetDefaultMarginWidth(*args, **kwargs):
8640 """GetDefaultMarginWidth() -> int"""
8641 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8642
8643 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8644 def SetBitmap(*args, **kwargs):
8645 """SetBitmap(self, Bitmap bitmap)"""
8646 return _core_.MenuItem_SetBitmap(*args, **kwargs)
8647
8648 def GetBitmap(*args, **kwargs):
8649 """GetBitmap(self) -> Bitmap"""
8650 return _core_.MenuItem_GetBitmap(*args, **kwargs)
8651
8652
8653 class MenuItemPtr(MenuItem):
8654 def __init__(self, this):
8655 self.this = this
8656 if not hasattr(self,"thisown"): self.thisown = 0
8657 self.__class__ = MenuItem
8658 _core_.MenuItem_swigregister(MenuItemPtr)
8659
8660 def MenuItem_GetLabelFromText(*args, **kwargs):
8661 """MenuItem_GetLabelFromText(String text) -> String"""
8662 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8663
8664 def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8665 """MenuItem_GetDefaultMarginWidth() -> int"""
8666 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8667
8668 #---------------------------------------------------------------------------
8669
8670 class Control(Window):
8671 """
8672 This is the base class for a control or 'widget'.
8673
8674 A control is generally a small window which processes user input
8675 and/or displays one or more item of data.
8676 """
8677 def __repr__(self):
8678 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8679 def __init__(self, *args, **kwargs):
8680 """
8681 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8682 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8683 String name=ControlNameStr) -> Control
8684
8685 Create a Control. Normally you should only call this from a subclass'
8686 __init__ as a plain old wx.Control is not very useful.
8687 """
8688 newobj = _core_.new_Control(*args, **kwargs)
8689 self.this = newobj.this
8690 self.thisown = 1
8691 del newobj.thisown
8692 self._setOORInfo(self)
8693
8694 def Create(*args, **kwargs):
8695 """
8696 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8697 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8698 String name=ControlNameStr) -> bool
8699
8700 Do the 2nd phase and create the GUI control.
8701 """
8702 return _core_.Control_Create(*args, **kwargs)
8703
8704 def Command(*args, **kwargs):
8705 """
8706 Command(self, CommandEvent event)
8707
8708 Simulates the effect of the user issuing a command to the item.
8709
8710 :see: `wx.CommandEvent`
8711
8712 """
8713 return _core_.Control_Command(*args, **kwargs)
8714
8715 def GetLabel(*args, **kwargs):
8716 """
8717 GetLabel(self) -> String
8718
8719 Return a control's text.
8720 """
8721 return _core_.Control_GetLabel(*args, **kwargs)
8722
8723 def SetLabel(*args, **kwargs):
8724 """
8725 SetLabel(self, String label)
8726
8727 Sets the item's text.
8728 """
8729 return _core_.Control_SetLabel(*args, **kwargs)
8730
8731 def GetClassDefaultAttributes(*args, **kwargs):
8732 """
8733 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8734
8735 Get the default attributes for this class. This is useful if you want
8736 to use the same font or colour in your own control as in a standard
8737 control -- which is a much better idea than hard coding specific
8738 colours or fonts which might look completely out of place on the
8739 user's system, especially if it uses themes.
8740
8741 The variant parameter is only relevant under Mac currently and is
8742 ignore under other platforms. Under Mac, it will change the size of
8743 the returned font. See `wx.Window.SetWindowVariant` for more about
8744 this.
8745 """
8746 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8747
8748 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8749
8750 class ControlPtr(Control):
8751 def __init__(self, this):
8752 self.this = this
8753 if not hasattr(self,"thisown"): self.thisown = 0
8754 self.__class__ = Control
8755 _core_.Control_swigregister(ControlPtr)
8756 ControlNameStr = cvar.ControlNameStr
8757
8758 def PreControl(*args, **kwargs):
8759 """
8760 PreControl() -> Control
8761
8762 Precreate a Control control for 2-phase creation
8763 """
8764 val = _core_.new_PreControl(*args, **kwargs)
8765 val.thisown = 1
8766 return val
8767
8768 def Control_GetClassDefaultAttributes(*args, **kwargs):
8769 """
8770 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8771
8772 Get the default attributes for this class. This is useful if you want
8773 to use the same font or colour in your own control as in a standard
8774 control -- which is a much better idea than hard coding specific
8775 colours or fonts which might look completely out of place on the
8776 user's system, especially if it uses themes.
8777
8778 The variant parameter is only relevant under Mac currently and is
8779 ignore under other platforms. Under Mac, it will change the size of
8780 the returned font. See `wx.Window.SetWindowVariant` for more about
8781 this.
8782 """
8783 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8784
8785 #---------------------------------------------------------------------------
8786
8787 class ItemContainer(object):
8788 """
8789 wx.ItemContainer defines an interface which is implemented by all
8790 controls which have string subitems, each of which may be selected,
8791 such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well as
8792 `wx.ComboBox` which implements an extended interface deriving from
8793 this one.
8794
8795 It defines the methods for accessing the control's items and although
8796 each of the derived classes implements them differently, they still
8797 all conform to the same interface.
8798
8799 The items in a wx.ItemContainer have (non empty) string labels and,
8800 optionally, client data associated with them.
8801
8802 """
8803 def __init__(self): raise RuntimeError, "No constructor defined"
8804 def __repr__(self):
8805 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8806 def Append(*args, **kwargs):
8807 """
8808 Append(self, String item, PyObject clientData=None) -> int
8809
8810 Adds the item to the control, associating the given data with the item
8811 if not None. The return value is the index of the newly added item
8812 which may be different from the last one if the control is sorted (e.g.
8813 has wx.LB_SORT or wx.CB_SORT style).
8814 """
8815 return _core_.ItemContainer_Append(*args, **kwargs)
8816
8817 def AppendItems(*args, **kwargs):
8818 """
8819 AppendItems(self, List strings)
8820
8821 Apend several items at once to the control. Notice that calling this
8822 method may be much faster than appending the items one by one if you
8823 need to add a lot of items.
8824 """
8825 return _core_.ItemContainer_AppendItems(*args, **kwargs)
8826
8827 def Insert(*args, **kwargs):
8828 """
8829 Insert(self, String item, int pos, PyObject clientData=None) -> int
8830
8831 Insert an item into the control before the item at the ``pos`` index,
8832 optionally associating some data object with the item.
8833 """
8834 return _core_.ItemContainer_Insert(*args, **kwargs)
8835
8836 def Clear(*args, **kwargs):
8837 """
8838 Clear(self)
8839
8840 Removes all items from the control.
8841 """
8842 return _core_.ItemContainer_Clear(*args, **kwargs)
8843
8844 def Delete(*args, **kwargs):
8845 """
8846 Delete(self, int n)
8847
8848 Deletes the item at the zero-based index 'n' from the control. Note
8849 that it is an error (signalled by a `wx.PyAssertionError` exception if
8850 enabled) to remove an item with the index negative or greater or equal
8851 than the number of items in the control.
8852 """
8853 return _core_.ItemContainer_Delete(*args, **kwargs)
8854
8855 def GetCount(*args, **kwargs):
8856 """
8857 GetCount(self) -> int
8858
8859 Returns the number of items in the control.
8860 """
8861 return _core_.ItemContainer_GetCount(*args, **kwargs)
8862
8863 def IsEmpty(*args, **kwargs):
8864 """
8865 IsEmpty(self) -> bool
8866
8867 Returns True if the control is empty or False if it has some items.
8868 """
8869 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
8870
8871 def GetString(*args, **kwargs):
8872 """
8873 GetString(self, int n) -> String
8874
8875 Returns the label of the item with the given index.
8876 """
8877 return _core_.ItemContainer_GetString(*args, **kwargs)
8878
8879 def GetStrings(*args, **kwargs):
8880 """GetStrings(self) -> wxArrayString"""
8881 return _core_.ItemContainer_GetStrings(*args, **kwargs)
8882
8883 def SetString(*args, **kwargs):
8884 """
8885 SetString(self, int n, String s)
8886
8887 Sets the label for the given item.
8888 """
8889 return _core_.ItemContainer_SetString(*args, **kwargs)
8890
8891 def FindString(*args, **kwargs):
8892 """
8893 FindString(self, String s) -> int
8894
8895 Finds an item whose label matches the given string. Returns the
8896 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
8897 found.
8898 """
8899 return _core_.ItemContainer_FindString(*args, **kwargs)
8900
8901 def Select(*args, **kwargs):
8902 """
8903 Select(self, int n)
8904
8905 Sets the item at index 'n' to be the selected item.
8906 """
8907 return _core_.ItemContainer_Select(*args, **kwargs)
8908
8909 SetSelection = Select
8910 def GetSelection(*args, **kwargs):
8911 """
8912 GetSelection(self) -> int
8913
8914 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
8915 is selected.
8916 """
8917 return _core_.ItemContainer_GetSelection(*args, **kwargs)
8918
8919 def GetStringSelection(*args, **kwargs):
8920 """
8921 GetStringSelection(self) -> String
8922
8923 Returns the label of the selected item or an empty string if no item
8924 is selected.
8925 """
8926 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
8927
8928 def GetClientData(*args, **kwargs):
8929 """
8930 GetClientData(self, int n) -> PyObject
8931
8932 Returns the client data associated with the given item, (if any.)
8933 """
8934 return _core_.ItemContainer_GetClientData(*args, **kwargs)
8935
8936 def SetClientData(*args, **kwargs):
8937 """
8938 SetClientData(self, int n, PyObject clientData)
8939
8940 Associate the given client data with the item at position n.
8941 """
8942 return _core_.ItemContainer_SetClientData(*args, **kwargs)
8943
8944
8945 class ItemContainerPtr(ItemContainer):
8946 def __init__(self, this):
8947 self.this = this
8948 if not hasattr(self,"thisown"): self.thisown = 0
8949 self.__class__ = ItemContainer
8950 _core_.ItemContainer_swigregister(ItemContainerPtr)
8951
8952 #---------------------------------------------------------------------------
8953
8954 class ControlWithItems(Control,ItemContainer):
8955 """
8956 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
8957 wx.Control class, and is used for the base class of various controls
8958 that have items.
8959 """
8960 def __init__(self): raise RuntimeError, "No constructor defined"
8961 def __repr__(self):
8962 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8963
8964 class ControlWithItemsPtr(ControlWithItems):
8965 def __init__(self, this):
8966 self.this = this
8967 if not hasattr(self,"thisown"): self.thisown = 0
8968 self.__class__ = ControlWithItems
8969 _core_.ControlWithItems_swigregister(ControlWithItemsPtr)
8970
8971 #---------------------------------------------------------------------------
8972
8973 class SizerItem(Object):
8974 """
8975 The wx.SizerItem class is used to track the position, size and other
8976 attributes of each item managed by a `wx.Sizer`. In normal usage user
8977 code should never need to deal directly with a wx.SizerItem, but
8978 custom classes derived from `wx.PySizer` will probably need to use the
8979 collection of wx.SizerItems held by wx.Sizer when calculating layout.
8980
8981 :see: `wx.Sizer`, `wx.GBSizerItem`
8982 """
8983 def __repr__(self):
8984 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8985 def __init__(self, *args, **kwargs):
8986 """
8987 __init__(self) -> SizerItem
8988
8989 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
8990 size will need to be set before this item can be used in a Sizer.
8991
8992 You will probably never need to create a wx.SizerItem directly as they
8993 are created automatically when the sizer's Add, Insert or Prepend
8994 methods are called.
8995
8996 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
8997 """
8998 newobj = _core_.new_SizerItem(*args, **kwargs)
8999 self.this = newobj.this
9000 self.thisown = 1
9001 del newobj.thisown
9002 def DeleteWindows(*args, **kwargs):
9003 """
9004 DeleteWindows(self)
9005
9006 Destroy the window or the windows in a subsizer, depending on the type
9007 of item.
9008 """
9009 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
9010
9011 def DetachSizer(*args, **kwargs):
9012 """
9013 DetachSizer(self)
9014
9015 Enable deleting the SizerItem without destroying the contained sizer.
9016 """
9017 return _core_.SizerItem_DetachSizer(*args, **kwargs)
9018
9019 def GetSize(*args, **kwargs):
9020 """
9021 GetSize(self) -> Size
9022
9023 Get the current size of the item, as set in the last Layout.
9024 """
9025 return _core_.SizerItem_GetSize(*args, **kwargs)
9026
9027 def CalcMin(*args, **kwargs):
9028 """
9029 CalcMin(self) -> Size
9030
9031 Calculates the minimum desired size for the item, including any space
9032 needed by borders.
9033 """
9034 return _core_.SizerItem_CalcMin(*args, **kwargs)
9035
9036 def SetDimension(*args, **kwargs):
9037 """
9038 SetDimension(self, Point pos, Size size)
9039
9040 Set the position and size of the space allocated for this item by the
9041 sizer, and adjust the position and size of the item (window or
9042 subsizer) to be within that space taking alignment and borders into
9043 account.
9044 """
9045 return _core_.SizerItem_SetDimension(*args, **kwargs)
9046
9047 def GetMinSize(*args, **kwargs):
9048 """
9049 GetMinSize(self) -> Size
9050
9051 Get the minimum size needed for the item.
9052 """
9053 return _core_.SizerItem_GetMinSize(*args, **kwargs)
9054
9055 def GetMinSizeWithBorder(*args, **kwargs):
9056 """
9057 GetMinSizeWithBorder(self) -> Size
9058
9059 Get the minimum size needed for the item with space for the borders
9060 added, if needed.
9061 """
9062 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
9063
9064 def SetInitSize(*args, **kwargs):
9065 """SetInitSize(self, int x, int y)"""
9066 return _core_.SizerItem_SetInitSize(*args, **kwargs)
9067
9068 def SetRatioWH(*args, **kwargs):
9069 """
9070 SetRatioWH(self, int width, int height)
9071
9072 Set the ratio item attribute.
9073 """
9074 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
9075
9076 def SetRatioSize(*args, **kwargs):
9077 """
9078 SetRatioSize(self, Size size)
9079
9080 Set the ratio item attribute.
9081 """
9082 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
9083
9084 def SetRatio(*args, **kwargs):
9085 """
9086 SetRatio(self, float ratio)
9087
9088 Set the ratio item attribute.
9089 """
9090 return _core_.SizerItem_SetRatio(*args, **kwargs)
9091
9092 def GetRatio(*args, **kwargs):
9093 """
9094 GetRatio(self) -> float
9095
9096 Set the ratio item attribute.
9097 """
9098 return _core_.SizerItem_GetRatio(*args, **kwargs)
9099
9100 def GetRect(*args, **kwargs):
9101 """
9102 GetRect(self) -> Rect
9103
9104 Returns the rectangle that the sizer item should occupy
9105 """
9106 return _core_.SizerItem_GetRect(*args, **kwargs)
9107
9108 def IsWindow(*args, **kwargs):
9109 """
9110 IsWindow(self) -> bool
9111
9112 Is this sizer item a window?
9113 """
9114 return _core_.SizerItem_IsWindow(*args, **kwargs)
9115
9116 def IsSizer(*args, **kwargs):
9117 """
9118 IsSizer(self) -> bool
9119
9120 Is this sizer item a subsizer?
9121 """
9122 return _core_.SizerItem_IsSizer(*args, **kwargs)
9123
9124 def IsSpacer(*args, **kwargs):
9125 """
9126 IsSpacer(self) -> bool
9127
9128 Is this sizer item a spacer?
9129 """
9130 return _core_.SizerItem_IsSpacer(*args, **kwargs)
9131
9132 def SetProportion(*args, **kwargs):
9133 """
9134 SetProportion(self, int proportion)
9135
9136 Set the proportion value for this item.
9137 """
9138 return _core_.SizerItem_SetProportion(*args, **kwargs)
9139
9140 def GetProportion(*args, **kwargs):
9141 """
9142 GetProportion(self) -> int
9143
9144 Get the proportion value for this item.
9145 """
9146 return _core_.SizerItem_GetProportion(*args, **kwargs)
9147
9148 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
9149 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
9150 def SetFlag(*args, **kwargs):
9151 """
9152 SetFlag(self, int flag)
9153
9154 Set the flag value for this item.
9155 """
9156 return _core_.SizerItem_SetFlag(*args, **kwargs)
9157
9158 def GetFlag(*args, **kwargs):
9159 """
9160 GetFlag(self) -> int
9161
9162 Get the flag value for this item.
9163 """
9164 return _core_.SizerItem_GetFlag(*args, **kwargs)
9165
9166 def SetBorder(*args, **kwargs):
9167 """
9168 SetBorder(self, int border)
9169
9170 Set the border value for this item.
9171 """
9172 return _core_.SizerItem_SetBorder(*args, **kwargs)
9173
9174 def GetBorder(*args, **kwargs):
9175 """
9176 GetBorder(self) -> int
9177
9178 Get the border value for this item.
9179 """
9180 return _core_.SizerItem_GetBorder(*args, **kwargs)
9181
9182 def GetWindow(*args, **kwargs):
9183 """
9184 GetWindow(self) -> Window
9185
9186 Get the window (if any) that is managed by this sizer item.
9187 """
9188 return _core_.SizerItem_GetWindow(*args, **kwargs)
9189
9190 def SetWindow(*args, **kwargs):
9191 """
9192 SetWindow(self, Window window)
9193
9194 Set the window to be managed by this sizer item.
9195 """
9196 return _core_.SizerItem_SetWindow(*args, **kwargs)
9197
9198 def GetSizer(*args, **kwargs):
9199 """
9200 GetSizer(self) -> Sizer
9201
9202 Get the subsizer (if any) that is managed by this sizer item.
9203 """
9204 return _core_.SizerItem_GetSizer(*args, **kwargs)
9205
9206 def SetSizer(*args, **kwargs):
9207 """
9208 SetSizer(self, Sizer sizer)
9209
9210 Set the subsizer to be managed by this sizer item.
9211 """
9212 return _core_.SizerItem_SetSizer(*args, **kwargs)
9213
9214 def GetSpacer(*args, **kwargs):
9215 """
9216 GetSpacer(self) -> Size
9217
9218 Get the size of the spacer managed by this sizer item.
9219 """
9220 return _core_.SizerItem_GetSpacer(*args, **kwargs)
9221
9222 def SetSpacer(*args, **kwargs):
9223 """
9224 SetSpacer(self, Size size)
9225
9226 Set the size of the spacer to be managed by this sizer item.
9227 """
9228 return _core_.SizerItem_SetSpacer(*args, **kwargs)
9229
9230 def Show(*args, **kwargs):
9231 """
9232 Show(self, bool show)
9233
9234 Set the show item attribute, which sizers use to determine if the item
9235 is to be made part of the layout or not. If the item is tracking a
9236 window then it is shown or hidden as needed.
9237 """
9238 return _core_.SizerItem_Show(*args, **kwargs)
9239
9240 def IsShown(*args, **kwargs):
9241 """
9242 IsShown(self) -> bool
9243
9244 Is the item to be shown in the layout?
9245 """
9246 return _core_.SizerItem_IsShown(*args, **kwargs)
9247
9248 def GetPosition(*args, **kwargs):
9249 """
9250 GetPosition(self) -> Point
9251
9252 Returns the current position of the item, as set in the last Layout.
9253 """
9254 return _core_.SizerItem_GetPosition(*args, **kwargs)
9255
9256 def GetUserData(*args, **kwargs):
9257 """
9258 GetUserData(self) -> PyObject
9259
9260 Returns the userData associated with this sizer item, or None if there
9261 isn't any.
9262 """
9263 return _core_.SizerItem_GetUserData(*args, **kwargs)
9264
9265
9266 class SizerItemPtr(SizerItem):
9267 def __init__(self, this):
9268 self.this = this
9269 if not hasattr(self,"thisown"): self.thisown = 0
9270 self.__class__ = SizerItem
9271 _core_.SizerItem_swigregister(SizerItemPtr)
9272
9273 def SizerItemWindow(*args, **kwargs):
9274 """
9275 SizerItemWindow(Window window, int proportion, int flag, int border,
9276 PyObject userData=None) -> SizerItem
9277
9278 Constructs a `wx.SizerItem` for tracking a window.
9279 """
9280 val = _core_.new_SizerItemWindow(*args, **kwargs)
9281 val.thisown = 1
9282 return val
9283
9284 def SizerItemSpacer(*args, **kwargs):
9285 """
9286 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
9287 PyObject userData=None) -> SizerItem
9288
9289 Constructs a `wx.SizerItem` for tracking a spacer.
9290 """
9291 val = _core_.new_SizerItemSpacer(*args, **kwargs)
9292 val.thisown = 1
9293 return val
9294
9295 def SizerItemSizer(*args, **kwargs):
9296 """
9297 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
9298 PyObject userData=None) -> SizerItem
9299
9300 Constructs a `wx.SizerItem` for tracking a subsizer
9301 """
9302 val = _core_.new_SizerItemSizer(*args, **kwargs)
9303 val.thisown = 1
9304 return val
9305
9306 class Sizer(Object):
9307 """
9308 wx.Sizer is the abstract base class used for laying out subwindows in
9309 a window. You cannot use wx.Sizer directly; instead, you will have to
9310 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9311 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9312 and `wx.GridBagSizer`.
9313
9314 The concept implemented by sizers in wxWidgets is closely related to
9315 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9316 toolkit or the Qt toolkit. It is based upon the idea of the individual
9317 subwindows reporting their minimal required size and their ability to
9318 get stretched if the size of the parent window has changed. This will
9319 most often mean that the programmer does not set the original size of
9320 a dialog in the beginning, rather the dialog will assigned a sizer and
9321 this sizer will be queried about the recommended size. The sizer in
9322 turn will query its children, which can be normal windows or contorls,
9323 empty space or other sizers, so that a hierarchy of sizers can be
9324 constructed. Note that wxSizer does not derive from wxWindow and thus
9325 do not interfere with tab ordering and requires very little resources
9326 compared to a real window on screen.
9327
9328 What makes sizers so well fitted for use in wxWidgets is the fact that
9329 every control reports its own minimal size and the algorithm can
9330 handle differences in font sizes or different window (dialog item)
9331 sizes on different platforms without problems. If for example the
9332 standard font as well as the overall design of Mac widgets requires
9333 more space than on Windows, then the initial size of a dialog using a
9334 sizer will automatically be bigger on Mac than on Windows.
9335 """
9336 def __init__(self): raise RuntimeError, "No constructor defined"
9337 def __repr__(self):
9338 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9339 def _setOORInfo(*args, **kwargs):
9340 """_setOORInfo(self, PyObject _self)"""
9341 return _core_.Sizer__setOORInfo(*args, **kwargs)
9342
9343 def Add(*args, **kwargs):
9344 """
9345 Add(self, item, int proportion=0, int flag=0, int border=0,
9346 PyObject userData=None) -> wx.SizerItem
9347
9348 Appends a child item to the sizer.
9349 """
9350 return _core_.Sizer_Add(*args, **kwargs)
9351
9352 def Insert(*args, **kwargs):
9353 """
9354 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
9355 PyObject userData=None) -> wx.SizerItem
9356
9357 Inserts a new item into the list of items managed by this sizer before
9358 the item at index *before*. See `Add` for a description of the parameters.
9359 """
9360 return _core_.Sizer_Insert(*args, **kwargs)
9361
9362 def Prepend(*args, **kwargs):
9363 """
9364 Prepend(self, item, int proportion=0, int flag=0, int border=0,
9365 PyObject userData=None) -> wx.SizerItem
9366
9367 Adds a new item to the begining of the list of sizer items managed by
9368 this sizer. See `Add` for a description of the parameters.
9369 """
9370 return _core_.Sizer_Prepend(*args, **kwargs)
9371
9372 def Remove(*args, **kwargs):
9373 """
9374 Remove(self, item) -> bool
9375
9376 Removes an item from the sizer and destroys it. This method does not
9377 cause any layout or resizing to take place, call `Layout` to update
9378 the layout on screen after removing a child from the sizer. The
9379 *item* parameter can be either a window, a sizer, or the zero-based
9380 index of an item to remove. Returns True if the child item was found
9381 and removed.
9382 """
9383 return _core_.Sizer_Remove(*args, **kwargs)
9384
9385 def Detach(*args, **kwargs):
9386 """
9387 Detach(self, item) -> bool
9388
9389 Detaches an item from the sizer without destroying it. This method
9390 does not cause any layout or resizing to take place, call `Layout` to
9391 do so. The *item* parameter can be either a window, a sizer, or the
9392 zero-based index of the item to be detached. Returns True if the child item
9393 was found and detached.
9394 """
9395 return _core_.Sizer_Detach(*args, **kwargs)
9396
9397 def GetItem(*args, **kwargs):
9398 """
9399 GetItem(self, item) -> wx.SizerItem
9400
9401 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9402 parameter can be either a window, a sizer, or the zero-based index of
9403 the item to be detached.
9404 """
9405 return _core_.Sizer_GetItem(*args, **kwargs)
9406
9407 def _SetItemMinSize(*args, **kwargs):
9408 """_SetItemMinSize(self, PyObject item, Size size)"""
9409 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
9410
9411 def SetItemMinSize(self, item, *args):
9412 """
9413 SetItemMinSize(self, item, Size size)
9414
9415 Sets the minimum size that will be allocated for an item in the sizer.
9416 The *item* parameter can be either a window, a sizer, or the
9417 zero-based index of the item. If a window or sizer is given then it
9418 will be searched for recursivly in subsizers if neccessary.
9419 """
9420 if len(args) == 2:
9421 # for backward compatibility accept separate width,height args too
9422 return self._SetItemMinSize(item, args)
9423 else:
9424 return self._SetItemMinSize(item, args[0])
9425
9426 def AddItem(*args, **kwargs):
9427 """
9428 AddItem(self, SizerItem item)
9429
9430 Adds a `wx.SizerItem` to the sizer.
9431 """
9432 return _core_.Sizer_AddItem(*args, **kwargs)
9433
9434 def InsertItem(*args, **kwargs):
9435 """
9436 InsertItem(self, int index, SizerItem item)
9437
9438 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9439 """
9440 return _core_.Sizer_InsertItem(*args, **kwargs)
9441
9442 def PrependItem(*args, **kwargs):
9443 """
9444 PrependItem(self, SizerItem item)
9445
9446 Prepends a `wx.SizerItem` to the sizer.
9447 """
9448 return _core_.Sizer_PrependItem(*args, **kwargs)
9449
9450 def AddMany(self, items):
9451 """
9452 AddMany is a convenience method for adding several items
9453 to a sizer at one time. Simply pass it a list of tuples,
9454 where each tuple consists of the parameters that you
9455 would normally pass to the `Add` method.
9456 """
9457 for item in items:
9458 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9459 item = (item, )
9460 self.Add(*item)
9461
9462 # for backwards compatibility only, please do not use in new code
9463 AddWindow = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
9464 AddSizer = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
9465 AddSpacer = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
9466 PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
9467 PrependSizer = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
9468 PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
9469 InsertWindow = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
9470 InsertSizer = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
9471 InsertSpacer = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
9472 RemoveWindow = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
9473 RemoveSizer = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
9474 RemovePos = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
9475
9476
9477 def SetDimension(*args, **kwargs):
9478 """
9479 SetDimension(self, int x, int y, int width, int height)
9480
9481 Call this to force the sizer to take the given dimension and thus
9482 force the items owned by the sizer to resize themselves according to
9483 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9484 methods.
9485 """
9486 return _core_.Sizer_SetDimension(*args, **kwargs)
9487
9488 def SetMinSize(*args, **kwargs):
9489 """
9490 SetMinSize(self, Size size)
9491
9492 Call this to give the sizer a minimal size. Normally, the sizer will
9493 calculate its minimal size based purely on how much space its children
9494 need. After calling this method `GetMinSize` will return either the
9495 minimal size as requested by its children or the minimal size set
9496 here, depending on which is bigger.
9497 """
9498 return _core_.Sizer_SetMinSize(*args, **kwargs)
9499
9500 def GetSize(*args, **kwargs):
9501 """
9502 GetSize(self) -> Size
9503
9504 Returns the current size of the space managed by the sizer.
9505 """
9506 return _core_.Sizer_GetSize(*args, **kwargs)
9507
9508 def GetPosition(*args, **kwargs):
9509 """
9510 GetPosition(self) -> Point
9511
9512 Returns the current position of the sizer's managed space.
9513 """
9514 return _core_.Sizer_GetPosition(*args, **kwargs)
9515
9516 def GetMinSize(*args, **kwargs):
9517 """
9518 GetMinSize(self) -> Size
9519
9520 Returns the minimal size of the sizer. This is either the combined
9521 minimal size of all the children and their borders or the minimal size
9522 set by SetMinSize, depending on which is bigger.
9523 """
9524 return _core_.Sizer_GetMinSize(*args, **kwargs)
9525
9526 def GetSizeTuple(self):
9527 return self.GetSize().Get()
9528 def GetPositionTuple(self):
9529 return self.GetPosition().Get()
9530 def GetMinSizeTuple(self):
9531 return self.GetMinSize().Get()
9532
9533 def RecalcSizes(*args, **kwargs):
9534 """
9535 RecalcSizes(self)
9536
9537 Using the sizes calculated by `CalcMin` reposition and resize all the
9538 items managed by this sizer. You should not need to call this directly as
9539 it is called by `Layout`.
9540 """
9541 return _core_.Sizer_RecalcSizes(*args, **kwargs)
9542
9543 def CalcMin(*args, **kwargs):
9544 """
9545 CalcMin(self) -> Size
9546
9547 This method is where the sizer will do the actual calculation of its
9548 children's minimal sizes. You should not need to call this directly as
9549 it is called by `Layout`.
9550 """
9551 return _core_.Sizer_CalcMin(*args, **kwargs)
9552
9553 def Layout(*args, **kwargs):
9554 """
9555 Layout(self)
9556
9557 This method will force the recalculation and layout of the items
9558 controlled by the sizer using the current space allocated to the
9559 sizer. Normally this is called automatically from the owning window's
9560 EVT_SIZE handler, but it is also useful to call it from user code when
9561 one of the items in a sizer change size, or items are added or
9562 removed.
9563 """
9564 return _core_.Sizer_Layout(*args, **kwargs)
9565
9566 def Fit(*args, **kwargs):
9567 """
9568 Fit(self, Window window) -> Size
9569
9570 Tell the sizer to resize the *window* to match the sizer's minimal
9571 size. This is commonly done in the constructor of the window itself in
9572 order to set its initial size to match the needs of the children as
9573 determined by the sizer. Returns the new size.
9574
9575 For a top level window this is the total window size, not the client size.
9576 """
9577 return _core_.Sizer_Fit(*args, **kwargs)
9578
9579 def FitInside(*args, **kwargs):
9580 """
9581 FitInside(self, Window window)
9582
9583 Tell the sizer to resize the *virtual size* of the *window* to match the
9584 sizer's minimal size. This will not alter the on screen size of the
9585 window, but may cause the addition/removal/alteration of scrollbars
9586 required to view the virtual area in windows which manage it.
9587
9588 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9589
9590 """
9591 return _core_.Sizer_FitInside(*args, **kwargs)
9592
9593 def SetSizeHints(*args, **kwargs):
9594 """
9595 SetSizeHints(self, Window window)
9596
9597 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9598 match the sizer's minimal size. This is commonly done in the
9599 constructor of the window itself if the window is resizable (as are
9600 many dialogs under Unix and frames on probably all platforms) in order
9601 to prevent the window from being sized smaller than the minimal size
9602 required by the sizer.
9603 """
9604 return _core_.Sizer_SetSizeHints(*args, **kwargs)
9605
9606 def SetVirtualSizeHints(*args, **kwargs):
9607 """
9608 SetVirtualSizeHints(self, Window window)
9609
9610 Tell the sizer to set the minimal size of the window virtual area to
9611 match the sizer's minimal size. For windows with managed scrollbars
9612 this will set them appropriately.
9613
9614 :see: `wx.ScrolledWindow.SetScrollbars`
9615
9616 """
9617 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
9618
9619 def Clear(*args, **kwargs):
9620 """
9621 Clear(self, bool deleteWindows=False)
9622
9623 Clear all items from the sizer, optionally destroying the window items
9624 as well.
9625 """
9626 return _core_.Sizer_Clear(*args, **kwargs)
9627
9628 def DeleteWindows(*args, **kwargs):
9629 """
9630 DeleteWindows(self)
9631
9632 Destroy all windows managed by the sizer.
9633 """
9634 return _core_.Sizer_DeleteWindows(*args, **kwargs)
9635
9636 def GetChildren(*args, **kwargs):
9637 """
9638 GetChildren(self) -> list
9639
9640 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9641 """
9642 return _core_.Sizer_GetChildren(*args, **kwargs)
9643
9644 def Show(*args, **kwargs):
9645 """
9646 Show(self, item, bool show=True, bool recursive=false) -> bool
9647
9648 Shows or hides an item managed by the sizer. To make a sizer item
9649 disappear or reappear, use Show followed by `Layout`. The *item*
9650 parameter can be either a window, a sizer, or the zero-based index of
9651 the item. Use the recursive parameter to show or hide an item in a
9652 subsizer. Returns True if the item was found.
9653 """
9654 return _core_.Sizer_Show(*args, **kwargs)
9655
9656 def IsShown(*args, **kwargs):
9657 """
9658 IsShown(self, item)
9659
9660 Determines if the item is currently shown. sizer. To make a sizer
9661 item disappear or reappear, use Show followed by `Layout`. The *item*
9662 parameter can be either a window, a sizer, or the zero-based index of
9663 the item.
9664 """
9665 return _core_.Sizer_IsShown(*args, **kwargs)
9666
9667 def Hide(self, item, recursive=False):
9668 """
9669 A convenience method for Show(item, False, recursive).
9670 """
9671 return self.Show(item, False, recursive)
9672
9673 def ShowItems(*args, **kwargs):
9674 """
9675 ShowItems(self, bool show)
9676
9677 Recursively call `wx.SizerItem.Show` on all sizer items.
9678 """
9679 return _core_.Sizer_ShowItems(*args, **kwargs)
9680
9681
9682 class SizerPtr(Sizer):
9683 def __init__(self, this):
9684 self.this = this
9685 if not hasattr(self,"thisown"): self.thisown = 0
9686 self.__class__ = Sizer
9687 _core_.Sizer_swigregister(SizerPtr)
9688
9689 class PySizer(Sizer):
9690 """
9691 wx.PySizer is a special version of `wx.Sizer` that has been
9692 instrumented to allow the C++ virtual methods to be overloaded in
9693 Python derived classes. You would derive from this class if you are
9694 wanting to implement a custom sizer in Python code. Simply implement
9695 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9696 For example::
9697
9698 class MySizer(wx.PySizer):
9699 def __init__(self):
9700 wx.PySizer.__init__(self)
9701
9702 def CalcMin(self):
9703 for item in self.GetChildren():
9704 # calculate the total minimum width and height needed
9705 # by all items in the sizer according to this sizer's
9706 # layout algorithm.
9707 ...
9708 return wx.Size(width, height)
9709
9710 def RecalcSizes(self):
9711 # find the space allotted to this sizer
9712 pos = self.GetPosition()
9713 size = self.GetSize()
9714 for item in self.GetChildren():
9715 # Recalculate (if necessary) the position and size of
9716 # each item and then call item.SetDimension to do the
9717 # actual positioning and sizing of the items within the
9718 # space alloted to this sizer.
9719 ...
9720 item.SetDimension(itemPos, itemSize)
9721
9722
9723 When `Layout` is called it first calls `CalcMin` followed by
9724 `RecalcSizes` so you can optimize a bit by saving the results of
9725 `CalcMin` and reusing them in `RecalcSizes`.
9726
9727 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9728
9729
9730 """
9731 def __repr__(self):
9732 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9733 def __init__(self, *args, **kwargs):
9734 """
9735 __init__(self) -> PySizer
9736
9737 Creates a wx.PySizer. Must be called from the __init__ in the derived
9738 class.
9739 """
9740 newobj = _core_.new_PySizer(*args, **kwargs)
9741 self.this = newobj.this
9742 self.thisown = 1
9743 del newobj.thisown
9744 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
9745
9746 def _setCallbackInfo(*args, **kwargs):
9747 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
9748 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
9749
9750
9751 class PySizerPtr(PySizer):
9752 def __init__(self, this):
9753 self.this = this
9754 if not hasattr(self,"thisown"): self.thisown = 0
9755 self.__class__ = PySizer
9756 _core_.PySizer_swigregister(PySizerPtr)
9757
9758 #---------------------------------------------------------------------------
9759
9760 class BoxSizer(Sizer):
9761 """
9762 The basic idea behind a box sizer is that windows will most often be
9763 laid out in rather simple basic geometry, typically in a row or a
9764 column or nested hierarchies of either. A wx.BoxSizer will lay out
9765 its items in a simple row or column, depending on the orientation
9766 parameter passed to the constructor.
9767 """
9768 def __repr__(self):
9769 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9770 def __init__(self, *args, **kwargs):
9771 """
9772 __init__(self, int orient=HORIZONTAL) -> BoxSizer
9773
9774 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
9775 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
9776 sizer.
9777 """
9778 newobj = _core_.new_BoxSizer(*args, **kwargs)
9779 self.this = newobj.this
9780 self.thisown = 1
9781 del newobj.thisown
9782 self._setOORInfo(self)
9783
9784 def GetOrientation(*args, **kwargs):
9785 """
9786 GetOrientation(self) -> int
9787
9788 Returns the current orientation of the sizer.
9789 """
9790 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
9791
9792 def SetOrientation(*args, **kwargs):
9793 """
9794 SetOrientation(self, int orient)
9795
9796 Resets the orientation of the sizer.
9797 """
9798 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
9799
9800
9801 class BoxSizerPtr(BoxSizer):
9802 def __init__(self, this):
9803 self.this = this
9804 if not hasattr(self,"thisown"): self.thisown = 0
9805 self.__class__ = BoxSizer
9806 _core_.BoxSizer_swigregister(BoxSizerPtr)
9807
9808 #---------------------------------------------------------------------------
9809
9810 class StaticBoxSizer(BoxSizer):
9811 """
9812 wx.StaticBoxSizer derives from and functions identically to the
9813 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
9814 manages. Note that this static box must be created separately and
9815 passed to the sizer constructor.
9816 """
9817 def __repr__(self):
9818 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9819 def __init__(self, *args, **kwargs):
9820 """
9821 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
9822
9823 Constructor. It takes an associated static box and the orientation
9824 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
9825 ``wx.HORIZONTAL``.
9826 """
9827 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
9828 self.this = newobj.this
9829 self.thisown = 1
9830 del newobj.thisown
9831 self._setOORInfo(self)
9832
9833 def GetStaticBox(*args, **kwargs):
9834 """
9835 GetStaticBox(self) -> StaticBox
9836
9837 Returns the static box associated with this sizer.
9838 """
9839 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
9840
9841
9842 class StaticBoxSizerPtr(StaticBoxSizer):
9843 def __init__(self, this):
9844 self.this = this
9845 if not hasattr(self,"thisown"): self.thisown = 0
9846 self.__class__ = StaticBoxSizer
9847 _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
9848
9849 #---------------------------------------------------------------------------
9850
9851 class GridSizer(Sizer):
9852 """
9853 A grid sizer is a sizer which lays out its children in a
9854 two-dimensional table with all cells having the same size. In other
9855 words, the width of each cell within the grid is the width of the
9856 widest item added to the sizer and the height of each grid cell is the
9857 height of the tallest item. An optional vertical and/or horizontal
9858 gap between items can also be specified (in pixels.)
9859
9860 Items are placed in the cells of the grid in the order they are added,
9861 in row-major order. In other words, the first row is filled first,
9862 then the second, and so on until all items have been added. (If
9863 neccessary, additional rows will be added as items are added.) If you
9864 need to have greater control over the cells that items are placed in
9865 then use the `wx.GridBagSizer`.
9866
9867 """
9868 def __repr__(self):
9869 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9870 def __init__(self, *args, **kwargs):
9871 """
9872 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
9873
9874 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
9875 of columns and rows in the sizer - if either of the parameters is
9876 zero, it will be calculated to from the total number of children in
9877 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9878 define extra space between all children.
9879 """
9880 newobj = _core_.new_GridSizer(*args, **kwargs)
9881 self.this = newobj.this
9882 self.thisown = 1
9883 del newobj.thisown
9884 self._setOORInfo(self)
9885
9886 def SetCols(*args, **kwargs):
9887 """
9888 SetCols(self, int cols)
9889
9890 Sets the number of columns in the sizer.
9891 """
9892 return _core_.GridSizer_SetCols(*args, **kwargs)
9893
9894 def SetRows(*args, **kwargs):
9895 """
9896 SetRows(self, int rows)
9897
9898 Sets the number of rows in the sizer.
9899 """
9900 return _core_.GridSizer_SetRows(*args, **kwargs)
9901
9902 def SetVGap(*args, **kwargs):
9903 """
9904 SetVGap(self, int gap)
9905
9906 Sets the vertical gap (in pixels) between the cells in the sizer.
9907 """
9908 return _core_.GridSizer_SetVGap(*args, **kwargs)
9909
9910 def SetHGap(*args, **kwargs):
9911 """
9912 SetHGap(self, int gap)
9913
9914 Sets the horizontal gap (in pixels) between cells in the sizer
9915 """
9916 return _core_.GridSizer_SetHGap(*args, **kwargs)
9917
9918 def GetCols(*args, **kwargs):
9919 """
9920 GetCols(self) -> int
9921
9922 Returns the number of columns in the sizer.
9923 """
9924 return _core_.GridSizer_GetCols(*args, **kwargs)
9925
9926 def GetRows(*args, **kwargs):
9927 """
9928 GetRows(self) -> int
9929
9930 Returns the number of rows in the sizer.
9931 """
9932 return _core_.GridSizer_GetRows(*args, **kwargs)
9933
9934 def GetVGap(*args, **kwargs):
9935 """
9936 GetVGap(self) -> int
9937
9938 Returns the vertical gap (in pixels) between the cells in the sizer.
9939 """
9940 return _core_.GridSizer_GetVGap(*args, **kwargs)
9941
9942 def GetHGap(*args, **kwargs):
9943 """
9944 GetHGap(self) -> int
9945
9946 Returns the horizontal gap (in pixels) between cells in the sizer.
9947 """
9948 return _core_.GridSizer_GetHGap(*args, **kwargs)
9949
9950
9951 class GridSizerPtr(GridSizer):
9952 def __init__(self, this):
9953 self.this = this
9954 if not hasattr(self,"thisown"): self.thisown = 0
9955 self.__class__ = GridSizer
9956 _core_.GridSizer_swigregister(GridSizerPtr)
9957
9958 #---------------------------------------------------------------------------
9959
9960 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
9961 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
9962 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
9963 class FlexGridSizer(GridSizer):
9964 """
9965 A flex grid sizer is a sizer which lays out its children in a
9966 two-dimensional table with all table cells in one row having the same
9967 height and all cells in one column having the same width, but all
9968 rows or all columns are not necessarily the same height or width as in
9969 the `wx.GridSizer`.
9970
9971 wx.FlexGridSizer can also size items equally in one direction but
9972 unequally ("flexibly") in the other. If the sizer is only flexible
9973 in one direction (this can be changed using `SetFlexibleDirection`), it
9974 needs to be decided how the sizer should grow in the other ("non
9975 flexible") direction in order to fill the available space. The
9976 `SetNonFlexibleGrowMode` method serves this purpose.
9977
9978
9979 """
9980 def __repr__(self):
9981 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9982 def __init__(self, *args, **kwargs):
9983 """
9984 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
9985
9986 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
9987 number of columns and rows in the sizer - if either of the parameters
9988 is zero, it will be calculated to from the total number of children in
9989 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9990 define extra space between all children.
9991 """
9992 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
9993 self.this = newobj.this
9994 self.thisown = 1
9995 del newobj.thisown
9996 self._setOORInfo(self)
9997
9998 def AddGrowableRow(*args, **kwargs):
9999 """
10000 AddGrowableRow(self, size_t idx, int proportion=0)
10001
10002 Specifies that row *idx* (starting from zero) should be grown if there
10003 is extra space available to the sizer.
10004
10005 The *proportion* parameter has the same meaning as the stretch factor
10006 for the box sizers except that if all proportions are 0, then all
10007 columns are resized equally (instead of not being resized at all).
10008 """
10009 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
10010
10011 def RemoveGrowableRow(*args, **kwargs):
10012 """
10013 RemoveGrowableRow(self, size_t idx)
10014
10015 Specifies that row *idx* is no longer growable.
10016 """
10017 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
10018
10019 def AddGrowableCol(*args, **kwargs):
10020 """
10021 AddGrowableCol(self, size_t idx, int proportion=0)
10022
10023 Specifies that column *idx* (starting from zero) should be grown if
10024 there is extra space available to the sizer.
10025
10026 The *proportion* parameter has the same meaning as the stretch factor
10027 for the box sizers except that if all proportions are 0, then all
10028 columns are resized equally (instead of not being resized at all).
10029 """
10030 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
10031
10032 def RemoveGrowableCol(*args, **kwargs):
10033 """
10034 RemoveGrowableCol(self, size_t idx)
10035
10036 Specifies that column *idx* is no longer growable.
10037 """
10038 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
10039
10040 def SetFlexibleDirection(*args, **kwargs):
10041 """
10042 SetFlexibleDirection(self, int direction)
10043
10044 Specifies whether the sizer should flexibly resize its columns, rows,
10045 or both. Argument *direction* can be one of the following values. Any
10046 other value is ignored.
10047
10048 ============== =======================================
10049 wx.VERTICAL Rows are flexibly sized.
10050 wx.HORIZONTAL Columns are flexibly sized.
10051 wx.BOTH Both rows and columns are flexibly sized
10052 (this is the default value).
10053 ============== =======================================
10054
10055 Note that this method does not trigger relayout.
10056
10057 """
10058 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
10059
10060 def GetFlexibleDirection(*args, **kwargs):
10061 """
10062 GetFlexibleDirection(self) -> int
10063
10064 Returns a value that specifies whether the sizer
10065 flexibly resizes its columns, rows, or both (default).
10066
10067 :see: `SetFlexibleDirection`
10068 """
10069 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
10070
10071 def SetNonFlexibleGrowMode(*args, **kwargs):
10072 """
10073 SetNonFlexibleGrowMode(self, int mode)
10074
10075 Specifies how the sizer should grow in the non-flexible direction if
10076 there is one (so `SetFlexibleDirection` must have been called
10077 previously). Argument *mode* can be one of the following values:
10078
10079 ========================== =================================================
10080 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
10081 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
10082 `AddGrowableCol` and `AddGrowableRow`. In this
10083 case equal sizing applies to minimum sizes of
10084 columns or rows (this is the default value).
10085 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
10086 the non flexible direction, whether they are
10087 growable or not in the flexbile direction.
10088 ========================== =================================================
10089
10090 Note that this method does not trigger relayout.
10091
10092
10093 """
10094 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
10095
10096 def GetNonFlexibleGrowMode(*args, **kwargs):
10097 """
10098 GetNonFlexibleGrowMode(self) -> int
10099
10100 Returns the value that specifies how the sizer grows in the
10101 non-flexible direction if there is one.
10102
10103 :see: `SetNonFlexibleGrowMode`
10104 """
10105 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
10106
10107 def GetRowHeights(*args, **kwargs):
10108 """
10109 GetRowHeights(self) -> list
10110
10111 Returns a list of integers representing the heights of each of the
10112 rows in the sizer.
10113 """
10114 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
10115
10116 def GetColWidths(*args, **kwargs):
10117 """
10118 GetColWidths(self) -> list
10119
10120 Returns a list of integers representing the widths of each of the
10121 columns in the sizer.
10122 """
10123 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
10124
10125
10126 class FlexGridSizerPtr(FlexGridSizer):
10127 def __init__(self, this):
10128 self.this = this
10129 if not hasattr(self,"thisown"): self.thisown = 0
10130 self.__class__ = FlexGridSizer
10131 _core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
10132
10133 class StdDialogButtonSizer(BoxSizer):
10134 """
10135 A special sizer that knows how to order and position standard buttons
10136 in order to conform to the current platform's standards. You simply
10137 need to add each `wx.Button` to the sizer, and be sure to create the
10138 buttons using the standard ID's. Then call `Finalize` and the sizer
10139 will take care of the rest.
10140
10141 """
10142 def __repr__(self):
10143 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10144 def __init__(self, *args, **kwargs):
10145 """__init__(self) -> StdDialogButtonSizer"""
10146 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
10147 self.this = newobj.this
10148 self.thisown = 1
10149 del newobj.thisown
10150 def AddButton(*args, **kwargs):
10151 """
10152 AddButton(self, wxButton button)
10153
10154 Use this to add the buttons to this sizer. Do not use the `Add`
10155 method in the base class.
10156 """
10157 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
10158
10159 def Finalise(*args, **kwargs):
10160 """
10161 Finalise(self)
10162
10163 This funciton needs to be called after all the buttons have been added
10164 to the sizer. It will reorder them and position them in a platform
10165 specifc manner.
10166 """
10167 return _core_.StdDialogButtonSizer_Finalise(*args, **kwargs)
10168
10169 def SetAffirmativeButton(*args, **kwargs):
10170 """SetAffirmativeButton(self, wxButton button)"""
10171 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
10172
10173 def SetNegativeButton(*args, **kwargs):
10174 """SetNegativeButton(self, wxButton button)"""
10175 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
10176
10177 def SetCancelButton(*args, **kwargs):
10178 """SetCancelButton(self, wxButton button)"""
10179 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
10180
10181 def GetAffirmativeButton(*args, **kwargs):
10182 """GetAffirmativeButton(self) -> wxButton"""
10183 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
10184
10185 def GetApplyButton(*args, **kwargs):
10186 """GetApplyButton(self) -> wxButton"""
10187 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
10188
10189 def GetNegativeButton(*args, **kwargs):
10190 """GetNegativeButton(self) -> wxButton"""
10191 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
10192
10193 def GetCancelButton(*args, **kwargs):
10194 """GetCancelButton(self) -> wxButton"""
10195 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
10196
10197 def GetHelpButton(*args, **kwargs):
10198 """GetHelpButton(self) -> wxButton"""
10199 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
10200
10201
10202 class StdDialogButtonSizerPtr(StdDialogButtonSizer):
10203 def __init__(self, this):
10204 self.this = this
10205 if not hasattr(self,"thisown"): self.thisown = 0
10206 self.__class__ = StdDialogButtonSizer
10207 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
10208
10209 #---------------------------------------------------------------------------
10210
10211 class GBPosition(object):
10212 """
10213 This class represents the position of an item in a virtual grid of
10214 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10215 typemaps that will automatically convert from a 2-element sequence of
10216 integers to a wx.GBPosition, so you can use the more pythonic
10217 representation of the position nearly transparently in Python code.
10218 """
10219 def __repr__(self):
10220 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10221 def __init__(self, *args, **kwargs):
10222 """
10223 __init__(self, int row=0, int col=0) -> GBPosition
10224
10225 This class represents the position of an item in a virtual grid of
10226 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10227 typemaps that will automatically convert from a 2-element sequence of
10228 integers to a wx.GBPosition, so you can use the more pythonic
10229 representation of the position nearly transparently in Python code.
10230 """
10231 newobj = _core_.new_GBPosition(*args, **kwargs)
10232 self.this = newobj.this
10233 self.thisown = 1
10234 del newobj.thisown
10235 def GetRow(*args, **kwargs):
10236 """GetRow(self) -> int"""
10237 return _core_.GBPosition_GetRow(*args, **kwargs)
10238
10239 def GetCol(*args, **kwargs):
10240 """GetCol(self) -> int"""
10241 return _core_.GBPosition_GetCol(*args, **kwargs)
10242
10243 def SetRow(*args, **kwargs):
10244 """SetRow(self, int row)"""
10245 return _core_.GBPosition_SetRow(*args, **kwargs)
10246
10247 def SetCol(*args, **kwargs):
10248 """SetCol(self, int col)"""
10249 return _core_.GBPosition_SetCol(*args, **kwargs)
10250
10251 def __eq__(*args, **kwargs):
10252 """__eq__(self, GBPosition other) -> bool"""
10253 return _core_.GBPosition___eq__(*args, **kwargs)
10254
10255 def __ne__(*args, **kwargs):
10256 """__ne__(self, GBPosition other) -> bool"""
10257 return _core_.GBPosition___ne__(*args, **kwargs)
10258
10259 def Set(*args, **kwargs):
10260 """Set(self, int row=0, int col=0)"""
10261 return _core_.GBPosition_Set(*args, **kwargs)
10262
10263 def Get(*args, **kwargs):
10264 """Get(self) -> PyObject"""
10265 return _core_.GBPosition_Get(*args, **kwargs)
10266
10267 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
10268 def __str__(self): return str(self.Get())
10269 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
10270 def __len__(self): return len(self.Get())
10271 def __getitem__(self, index): return self.Get()[index]
10272 def __setitem__(self, index, val):
10273 if index == 0: self.SetRow(val)
10274 elif index == 1: self.SetCol(val)
10275 else: raise IndexError
10276 def __nonzero__(self): return self.Get() != (0,0)
10277 __safe_for_unpickling__ = True
10278 def __reduce__(self): return (wx.GBPosition, self.Get())
10279
10280 row = property(GetRow, SetRow)
10281 col = property(GetCol, SetCol)
10282
10283
10284 class GBPositionPtr(GBPosition):
10285 def __init__(self, this):
10286 self.this = this
10287 if not hasattr(self,"thisown"): self.thisown = 0
10288 self.__class__ = GBPosition
10289 _core_.GBPosition_swigregister(GBPositionPtr)
10290
10291 class GBSpan(object):
10292 """
10293 This class is used to hold the row and column spanning attributes of
10294 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10295 automatically convert from a 2-element sequence of integers to a
10296 wx.GBSpan, so you can use the more pythonic representation of the span
10297 nearly transparently in Python code.
10298
10299 """
10300 def __repr__(self):
10301 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10302 def __init__(self, *args, **kwargs):
10303 """
10304 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
10305
10306 Construct a new wxGBSpan, optionally setting the rowspan and
10307 colspan. The default is (1,1). (Meaning that the item occupies one
10308 cell in each direction.
10309 """
10310 newobj = _core_.new_GBSpan(*args, **kwargs)
10311 self.this = newobj.this
10312 self.thisown = 1
10313 del newobj.thisown
10314 def GetRowspan(*args, **kwargs):
10315 """GetRowspan(self) -> int"""
10316 return _core_.GBSpan_GetRowspan(*args, **kwargs)
10317
10318 def GetColspan(*args, **kwargs):
10319 """GetColspan(self) -> int"""
10320 return _core_.GBSpan_GetColspan(*args, **kwargs)
10321
10322 def SetRowspan(*args, **kwargs):
10323 """SetRowspan(self, int rowspan)"""
10324 return _core_.GBSpan_SetRowspan(*args, **kwargs)
10325
10326 def SetColspan(*args, **kwargs):
10327 """SetColspan(self, int colspan)"""
10328 return _core_.GBSpan_SetColspan(*args, **kwargs)
10329
10330 def __eq__(*args, **kwargs):
10331 """__eq__(self, GBSpan other) -> bool"""
10332 return _core_.GBSpan___eq__(*args, **kwargs)
10333
10334 def __ne__(*args, **kwargs):
10335 """__ne__(self, GBSpan other) -> bool"""
10336 return _core_.GBSpan___ne__(*args, **kwargs)
10337
10338 def Set(*args, **kwargs):
10339 """Set(self, int rowspan=1, int colspan=1)"""
10340 return _core_.GBSpan_Set(*args, **kwargs)
10341
10342 def Get(*args, **kwargs):
10343 """Get(self) -> PyObject"""
10344 return _core_.GBSpan_Get(*args, **kwargs)
10345
10346 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
10347 def __str__(self): return str(self.Get())
10348 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10349 def __len__(self): return len(self.Get())
10350 def __getitem__(self, index): return self.Get()[index]
10351 def __setitem__(self, index, val):
10352 if index == 0: self.SetRowspan(val)
10353 elif index == 1: self.SetColspan(val)
10354 else: raise IndexError
10355 def __nonzero__(self): return self.Get() != (0,0)
10356 __safe_for_unpickling__ = True
10357 def __reduce__(self): return (wx.GBSpan, self.Get())
10358
10359 rowspan = property(GetRowspan, SetRowspan)
10360 colspan = property(GetColspan, SetColspan)
10361
10362
10363 class GBSpanPtr(GBSpan):
10364 def __init__(self, this):
10365 self.this = this
10366 if not hasattr(self,"thisown"): self.thisown = 0
10367 self.__class__ = GBSpan
10368 _core_.GBSpan_swigregister(GBSpanPtr)
10369
10370 class GBSizerItem(SizerItem):
10371 """
10372 The wx.GBSizerItem class is used to track the additional data about
10373 items in a `wx.GridBagSizer` such as the item's position in the grid
10374 and how many rows or columns it spans.
10375
10376 """
10377 def __repr__(self):
10378 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10379 def __init__(self, *args, **kwargs):
10380 """
10381 __init__(self) -> GBSizerItem
10382
10383 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10384 size will need to be set, as well as a position and span before this
10385 item can be used in a Sizer.
10386
10387 You will probably never need to create a wx.GBSizerItem directly as they
10388 are created automatically when the sizer's Add method is called.
10389 """
10390 newobj = _core_.new_GBSizerItem(*args, **kwargs)
10391 self.this = newobj.this
10392 self.thisown = 1
10393 del newobj.thisown
10394 def GetPos(*args, **kwargs):
10395 """
10396 GetPos(self) -> GBPosition
10397
10398 Get the grid position of the item
10399 """
10400 return _core_.GBSizerItem_GetPos(*args, **kwargs)
10401
10402 def GetPosTuple(self): return self.GetPos().Get()
10403 def GetSpan(*args, **kwargs):
10404 """
10405 GetSpan(self) -> GBSpan
10406
10407 Get the row and column spanning of the item
10408 """
10409 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
10410
10411 def GetSpanTuple(self): return self.GetSpan().Get()
10412 def SetPos(*args, **kwargs):
10413 """
10414 SetPos(self, GBPosition pos) -> bool
10415
10416 If the item is already a member of a sizer then first ensure that
10417 there is no other item that would intersect with this one at the new
10418 position, then set the new position. Returns True if the change is
10419 successful and after the next Layout() the item will be moved.
10420 """
10421 return _core_.GBSizerItem_SetPos(*args, **kwargs)
10422
10423 def SetSpan(*args, **kwargs):
10424 """
10425 SetSpan(self, GBSpan span) -> bool
10426
10427 If the item is already a member of a sizer then first ensure that
10428 there is no other item that would intersect with this one with its new
10429 spanning size, then set the new spanning. Returns True if the change
10430 is successful and after the next Layout() the item will be resized.
10431
10432 """
10433 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
10434
10435 def Intersects(*args, **kwargs):
10436 """
10437 Intersects(self, GBSizerItem other) -> bool
10438
10439 Returns True if this item and the other item instersect.
10440 """
10441 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10442
10443 def IntersectsPos(*args, **kwargs):
10444 """
10445 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10446
10447 Returns True if the given pos/span would intersect with this item.
10448 """
10449 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
10450
10451 def GetEndPos(*args, **kwargs):
10452 """
10453 GetEndPos(self) -> GBPosition
10454
10455 Get the row and column of the endpoint of this item.
10456 """
10457 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
10458
10459 def GetGBSizer(*args, **kwargs):
10460 """
10461 GetGBSizer(self) -> GridBagSizer
10462
10463 Get the sizer this item is a member of.
10464 """
10465 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
10466
10467 def SetGBSizer(*args, **kwargs):
10468 """
10469 SetGBSizer(self, GridBagSizer sizer)
10470
10471 Set the sizer this item is a member of.
10472 """
10473 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
10474
10475
10476 class GBSizerItemPtr(GBSizerItem):
10477 def __init__(self, this):
10478 self.this = this
10479 if not hasattr(self,"thisown"): self.thisown = 0
10480 self.__class__ = GBSizerItem
10481 _core_.GBSizerItem_swigregister(GBSizerItemPtr)
10482 DefaultSpan = cvar.DefaultSpan
10483
10484 def GBSizerItemWindow(*args, **kwargs):
10485 """
10486 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
10487 int border, PyObject userData=None) -> GBSizerItem
10488
10489 Construct a `wx.GBSizerItem` for a window.
10490 """
10491 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
10492 val.thisown = 1
10493 return val
10494
10495 def GBSizerItemSizer(*args, **kwargs):
10496 """
10497 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
10498 int border, PyObject userData=None) -> GBSizerItem
10499
10500 Construct a `wx.GBSizerItem` for a sizer
10501 """
10502 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
10503 val.thisown = 1
10504 return val
10505
10506 def GBSizerItemSpacer(*args, **kwargs):
10507 """
10508 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
10509 int flag, int border, PyObject userData=None) -> GBSizerItem
10510
10511 Construct a `wx.GBSizerItem` for a spacer.
10512 """
10513 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
10514 val.thisown = 1
10515 return val
10516
10517 class GridBagSizer(FlexGridSizer):
10518 """
10519 A `wx.Sizer` that can lay out items in a virtual grid like a
10520 `wx.FlexGridSizer` but in this case explicit positioning of the items
10521 is allowed using `wx.GBPosition`, and items can optionally span more
10522 than one row and/or column using `wx.GBSpan`. The total size of the
10523 virtual grid is determined by the largest row and column that items are
10524 positioned at, adjusted for spanning.
10525
10526 """
10527 def __repr__(self):
10528 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10529 def __init__(self, *args, **kwargs):
10530 """
10531 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10532
10533 Constructor, with optional parameters to specify the gap between the
10534 rows and columns.
10535 """
10536 newobj = _core_.new_GridBagSizer(*args, **kwargs)
10537 self.this = newobj.this
10538 self.thisown = 1
10539 del newobj.thisown
10540 self._setOORInfo(self)
10541
10542 def Add(*args, **kwargs):
10543 """
10544 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
10545 int border=0, userData=None) -> wx.GBSizerItem
10546
10547 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10548 more than one row or column as specified with *span*. The remaining
10549 args behave similarly to `wx.Sizer.Add`.
10550
10551 Returns True if the item was successfully placed at the given cell
10552 position, False if something was already there.
10553
10554 """
10555 return _core_.GridBagSizer_Add(*args, **kwargs)
10556
10557 def AddItem(*args, **kwargs):
10558 """
10559 Add(self, GBSizerItem item) -> wx.GBSizerItem
10560
10561 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10562 the item was successfully placed at its given cell position, False if
10563 something was already there.
10564 """
10565 return _core_.GridBagSizer_AddItem(*args, **kwargs)
10566
10567 def GetCellSize(*args, **kwargs):
10568 """
10569 GetCellSize(self, int row, int col) -> Size
10570
10571 Get the size of the specified cell, including hgap and
10572 vgap. Only valid after a Layout.
10573 """
10574 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
10575
10576 def GetEmptyCellSize(*args, **kwargs):
10577 """
10578 GetEmptyCellSize(self) -> Size
10579
10580 Get the size used for cells in the grid with no item.
10581 """
10582 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
10583
10584 def SetEmptyCellSize(*args, **kwargs):
10585 """
10586 SetEmptyCellSize(self, Size sz)
10587
10588 Set the size used for cells in the grid with no item.
10589 """
10590 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
10591
10592 def GetItemPosition(*args):
10593 """
10594 GetItemPosition(self, item) -> GBPosition
10595
10596 Get the grid position of the specified *item* where *item* is either a
10597 window or subsizer that is a member of this sizer, or a zero-based
10598 index of an item.
10599 """
10600 return _core_.GridBagSizer_GetItemPosition(*args)
10601
10602 def SetItemPosition(*args):
10603 """
10604 SetItemPosition(self, item, GBPosition pos) -> bool
10605
10606 Set the grid position of the specified *item* where *item* is either a
10607 window or subsizer that is a member of this sizer, or a zero-based
10608 index of an item. Returns True on success. If the move is not
10609 allowed (because an item is already there) then False is returned.
10610
10611 """
10612 return _core_.GridBagSizer_SetItemPosition(*args)
10613
10614 def GetItemSpan(*args):
10615 """
10616 GetItemSpan(self, item) -> GBSpan
10617
10618 Get the row/col spanning of the specified *item* where *item* is
10619 either a window or subsizer that is a member of this sizer, or a
10620 zero-based index of an item.
10621 """
10622 return _core_.GridBagSizer_GetItemSpan(*args)
10623
10624 def SetItemSpan(*args):
10625 """
10626 SetItemSpan(self, item, GBSpan span) -> bool
10627
10628 Set the row/col spanning of the specified *item* where *item* is
10629 either a window or subsizer that is a member of this sizer, or a
10630 zero-based index of an item. Returns True on success. If the move is
10631 not allowed (because an item is already there) then False is returned.
10632 """
10633 return _core_.GridBagSizer_SetItemSpan(*args)
10634
10635 def FindItem(*args):
10636 """
10637 FindItem(self, item) -> GBSizerItem
10638
10639 Find the sizer item for the given window or subsizer, returns None if
10640 not found. (non-recursive)
10641 """
10642 return _core_.GridBagSizer_FindItem(*args)
10643
10644 def FindItemAtPosition(*args, **kwargs):
10645 """
10646 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10647
10648 Return the sizer item for the given grid cell, or None if there is no
10649 item at that position. (non-recursive)
10650 """
10651 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
10652
10653 def FindItemAtPoint(*args, **kwargs):
10654 """
10655 FindItemAtPoint(self, Point pt) -> GBSizerItem
10656
10657 Return the sizer item located at the point given in *pt*, or None if
10658 there is no item at that point. The (x,y) coordinates in pt correspond
10659 to the client coordinates of the window using the sizer for
10660 layout. (non-recursive)
10661 """
10662 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
10663
10664 def CheckForIntersection(*args, **kwargs):
10665 """
10666 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
10667
10668 Look at all items and see if any intersect (or would overlap) the
10669 given *item*. Returns True if so, False if there would be no overlap.
10670 If an *excludeItem* is given then it will not be checked for
10671 intersection, for example it may be the item we are checking the
10672 position of.
10673
10674 """
10675 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
10676
10677 def CheckForIntersectionPos(*args, **kwargs):
10678 """
10679 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10680
10681 Look at all items and see if any intersect (or would overlap) the
10682 given position and span. Returns True if so, False if there would be
10683 no overlap. If an *excludeItem* is given then it will not be checked
10684 for intersection, for example it may be the item we are checking the
10685 position of.
10686 """
10687 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
10688
10689
10690 class GridBagSizerPtr(GridBagSizer):
10691 def __init__(self, this):
10692 self.this = this
10693 if not hasattr(self,"thisown"): self.thisown = 0
10694 self.__class__ = GridBagSizer
10695 _core_.GridBagSizer_swigregister(GridBagSizerPtr)
10696
10697 #---------------------------------------------------------------------------
10698
10699 Left = _core_.Left
10700 Top = _core_.Top
10701 Right = _core_.Right
10702 Bottom = _core_.Bottom
10703 Width = _core_.Width
10704 Height = _core_.Height
10705 Centre = _core_.Centre
10706 Center = _core_.Center
10707 CentreX = _core_.CentreX
10708 CentreY = _core_.CentreY
10709 Unconstrained = _core_.Unconstrained
10710 AsIs = _core_.AsIs
10711 PercentOf = _core_.PercentOf
10712 Above = _core_.Above
10713 Below = _core_.Below
10714 LeftOf = _core_.LeftOf
10715 RightOf = _core_.RightOf
10716 SameAs = _core_.SameAs
10717 Absolute = _core_.Absolute
10718 class IndividualLayoutConstraint(Object):
10719 """
10720 Objects of this class are stored in the `wx.LayoutConstraints` class as
10721 one of eight possible constraints that a window can be involved in.
10722 You will never need to create an instance of
10723 wx.IndividualLayoutConstraint, rather you should create a
10724 `wx.LayoutConstraints` instance and use the individual contstraints
10725 that it contains.
10726 """
10727 def __init__(self): raise RuntimeError, "No constructor defined"
10728 def __repr__(self):
10729 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10730 def Set(*args, **kwargs):
10731 """
10732 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10733
10734 Sets the properties of the constraint. Normally called by one of the
10735 convenience functions such as Above, RightOf, SameAs.
10736 """
10737 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
10738
10739 def LeftOf(*args, **kwargs):
10740 """
10741 LeftOf(self, Window sibling, int marg=0)
10742
10743 Constrains this edge to be to the left of the given window, with an
10744 optional margin. Implicitly, this is relative to the left edge of the
10745 other window.
10746 """
10747 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
10748
10749 def RightOf(*args, **kwargs):
10750 """
10751 RightOf(self, Window sibling, int marg=0)
10752
10753 Constrains this edge to be to the right of the given window, with an
10754 optional margin. Implicitly, this is relative to the right edge of the
10755 other window.
10756 """
10757 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
10758
10759 def Above(*args, **kwargs):
10760 """
10761 Above(self, Window sibling, int marg=0)
10762
10763 Constrains this edge to be above the given window, with an optional
10764 margin. Implicitly, this is relative to the top edge of the other
10765 window.
10766 """
10767 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
10768
10769 def Below(*args, **kwargs):
10770 """
10771 Below(self, Window sibling, int marg=0)
10772
10773 Constrains this edge to be below the given window, with an optional
10774 margin. Implicitly, this is relative to the bottom edge of the other
10775 window.
10776 """
10777 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
10778
10779 def SameAs(*args, **kwargs):
10780 """
10781 SameAs(self, Window otherW, int edge, int marg=0)
10782
10783 Constrains this edge or dimension to be to the same as the edge of the
10784 given window, with an optional margin.
10785 """
10786 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
10787
10788 def PercentOf(*args, **kwargs):
10789 """
10790 PercentOf(self, Window otherW, int wh, int per)
10791
10792 Constrains this edge or dimension to be to a percentage of the given
10793 window, with an optional margin.
10794 """
10795 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
10796
10797 def Absolute(*args, **kwargs):
10798 """
10799 Absolute(self, int val)
10800
10801 Constrains this edge or dimension to be the given absolute value.
10802 """
10803 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
10804
10805 def Unconstrained(*args, **kwargs):
10806 """
10807 Unconstrained(self)
10808
10809 Sets this edge or dimension to be unconstrained, that is, dependent on
10810 other edges and dimensions from which this value can be deduced.
10811 """
10812 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
10813
10814 def AsIs(*args, **kwargs):
10815 """
10816 AsIs(self)
10817
10818 Sets this edge or constraint to be whatever the window's value is at
10819 the moment. If either of the width and height constraints are *as is*,
10820 the window will not be resized, but moved instead. This is important
10821 when considering panel items which are intended to have a default
10822 size, such as a button, which may take its size from the size of the
10823 button label.
10824 """
10825 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
10826
10827 def GetOtherWindow(*args, **kwargs):
10828 """GetOtherWindow(self) -> Window"""
10829 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
10830
10831 def GetMyEdge(*args, **kwargs):
10832 """GetMyEdge(self) -> int"""
10833 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
10834
10835 def SetEdge(*args, **kwargs):
10836 """SetEdge(self, int which)"""
10837 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
10838
10839 def SetValue(*args, **kwargs):
10840 """SetValue(self, int v)"""
10841 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
10842
10843 def GetMargin(*args, **kwargs):
10844 """GetMargin(self) -> int"""
10845 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
10846
10847 def SetMargin(*args, **kwargs):
10848 """SetMargin(self, int m)"""
10849 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
10850
10851 def GetValue(*args, **kwargs):
10852 """GetValue(self) -> int"""
10853 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
10854
10855 def GetPercent(*args, **kwargs):
10856 """GetPercent(self) -> int"""
10857 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
10858
10859 def GetOtherEdge(*args, **kwargs):
10860 """GetOtherEdge(self) -> int"""
10861 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
10862
10863 def GetDone(*args, **kwargs):
10864 """GetDone(self) -> bool"""
10865 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
10866
10867 def SetDone(*args, **kwargs):
10868 """SetDone(self, bool d)"""
10869 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
10870
10871 def GetRelationship(*args, **kwargs):
10872 """GetRelationship(self) -> int"""
10873 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
10874
10875 def SetRelationship(*args, **kwargs):
10876 """SetRelationship(self, int r)"""
10877 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
10878
10879 def ResetIfWin(*args, **kwargs):
10880 """
10881 ResetIfWin(self, Window otherW) -> bool
10882
10883 Reset constraint if it mentions otherWin
10884 """
10885 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
10886
10887 def SatisfyConstraint(*args, **kwargs):
10888 """
10889 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
10890
10891 Try to satisfy constraint
10892 """
10893 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
10894
10895 def GetEdge(*args, **kwargs):
10896 """
10897 GetEdge(self, int which, Window thisWin, Window other) -> int
10898
10899 Get the value of this edge or dimension, or if this
10900 is not determinable, -1.
10901 """
10902 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
10903
10904
10905 class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
10906 def __init__(self, this):
10907 self.this = this
10908 if not hasattr(self,"thisown"): self.thisown = 0
10909 self.__class__ = IndividualLayoutConstraint
10910 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
10911
10912 class LayoutConstraints(Object):
10913 """
10914 **Note:** constraints are now deprecated and you should use sizers
10915 instead.
10916
10917 Objects of this class can be associated with a window to define its
10918 layout constraints, with respect to siblings or its parent.
10919
10920 The class consists of the following eight constraints of class
10921 wx.IndividualLayoutConstraint, some or all of which should be accessed
10922 directly to set the appropriate constraints.
10923
10924 * left: represents the left hand edge of the window
10925 * right: represents the right hand edge of the window
10926 * top: represents the top edge of the window
10927 * bottom: represents the bottom edge of the window
10928 * width: represents the width of the window
10929 * height: represents the height of the window
10930 * centreX: represents the horizontal centre point of the window
10931 * centreY: represents the vertical centre point of the window
10932
10933 Most constraints are initially set to have the relationship
10934 wxUnconstrained, which means that their values should be calculated by
10935 looking at known constraints. The exceptions are width and height,
10936 which are set to wxAsIs to ensure that if the user does not specify a
10937 constraint, the existing width and height will be used, to be
10938 compatible with panel items which often have take a default size. If
10939 the constraint is ``wx.AsIs``, the dimension will not be changed.
10940
10941 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
10942
10943 """
10944 def __repr__(self):
10945 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10946 left = property(_core_.LayoutConstraints_left_get)
10947 top = property(_core_.LayoutConstraints_top_get)
10948 right = property(_core_.LayoutConstraints_right_get)
10949 bottom = property(_core_.LayoutConstraints_bottom_get)
10950 width = property(_core_.LayoutConstraints_width_get)
10951 height = property(_core_.LayoutConstraints_height_get)
10952 centreX = property(_core_.LayoutConstraints_centreX_get)
10953 centreY = property(_core_.LayoutConstraints_centreY_get)
10954 def __init__(self, *args, **kwargs):
10955 """__init__(self) -> LayoutConstraints"""
10956 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
10957 self.this = newobj.this
10958 self.thisown = 1
10959 del newobj.thisown
10960 def SatisfyConstraints(*args, **kwargs):
10961 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
10962 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
10963
10964 def AreSatisfied(*args, **kwargs):
10965 """AreSatisfied(self) -> bool"""
10966 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
10967
10968
10969 class LayoutConstraintsPtr(LayoutConstraints):
10970 def __init__(self, this):
10971 self.this = this
10972 if not hasattr(self,"thisown"): self.thisown = 0
10973 self.__class__ = LayoutConstraints
10974 _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
10975
10976 #----------------------------------------------------------------------------
10977
10978 # Use Python's bool constants if available, make some if not
10979 try:
10980 True
10981 except NameError:
10982 __builtins__.True = 1==1
10983 __builtins__.False = 1==0
10984 def bool(value): return not not value
10985 __builtins__.bool = bool
10986
10987
10988
10989 # workarounds for bad wxRTTI names
10990 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
10991 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
10992 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
10993
10994
10995 #----------------------------------------------------------------------------
10996 # Load version numbers from __version__... Ensure that major and minor
10997 # versions are the same for both wxPython and wxWidgets.
10998
10999 from __version__ import *
11000 __version__ = VERSION_STRING
11001
11002 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
11003 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
11004 if RELEASE_VERSION != _core_.RELEASE_VERSION:
11005 import warnings
11006 warnings.warn("wxPython/wxWidgets release number mismatch")
11007
11008 #----------------------------------------------------------------------------
11009
11010 # Set the default string<-->unicode conversion encoding from the
11011 # locale. This encoding is used when string or unicode objects need
11012 # to be converted in order to pass them to wxWidgets. Please be aware
11013 # that the default encoding within the same locale may be slightly
11014 # different on different platforms. For example, please see
11015 # http://www.alanwood.net/demos/charsetdiffs.html for differences
11016 # between the common latin/roman encodings.
11017 import locale
11018 default = locale.getdefaultlocale()[1]
11019 if default:
11020 wx.SetDefaultPyEncoding(default)
11021 del default
11022 del locale
11023
11024 #----------------------------------------------------------------------------
11025
11026 class PyDeadObjectError(AttributeError):
11027 pass
11028
11029 class _wxPyDeadObject(object):
11030 """
11031 Instances of wx objects that are OOR capable will have their __class__
11032 changed to this class when the C++ object is deleted. This should help
11033 prevent crashes due to referencing a bogus C++ pointer.
11034 """
11035 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
11036 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
11037
11038 def __repr__(self):
11039 if not hasattr(self, "_name"):
11040 self._name = "[unknown]"
11041 return self.reprStr % self._name
11042
11043 def __getattr__(self, *args):
11044 if not hasattr(self, "_name"):
11045 self._name = "[unknown]"
11046 raise PyDeadObjectError(self.attrStr % self._name)
11047
11048 def __nonzero__(self):
11049 return 0
11050
11051
11052
11053 class PyUnbornObjectError(AttributeError):
11054 pass
11055
11056 class _wxPyUnbornObject(object):
11057 """
11058 Some stock objects are created when the wx._core module is
11059 imported, but their C++ instance is not created until the wx.App
11060 object is created and initialized. These object instances will
11061 temporarily have their __class__ changed to this class so an
11062 exception will be raised if they are used before the C++ instance
11063 is ready.
11064 """
11065
11066 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
11067 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
11068
11069 def __repr__(self):
11070 #if not hasattr(self, "_name"):
11071 # self._name = "[unknown]"
11072 return self.reprStr #% self._name
11073
11074 def __getattr__(self, *args):
11075 #if not hasattr(self, "_name"):
11076 # self._name = "[unknown]"
11077 raise PyUnbornObjectError(self.attrStr) # % self._name )
11078
11079 def __nonzero__(self):
11080 return 0
11081
11082
11083 #----------------------------------------------------------------------------
11084
11085 def CallAfter(callable, *args, **kw):
11086 """
11087 Call the specified function after the current and pending event
11088 handlers have been completed. This is also good for making GUI
11089 method calls from non-GUI threads. Any extra positional or
11090 keyword args are passed on to the callable when it is called.
11091
11092 :see: `wx.FutureCall`
11093 """
11094 app = wx.GetApp()
11095 assert app is not None, 'No wx.App created yet'
11096
11097 if not hasattr(app, "_CallAfterId"):
11098 app._CallAfterId = wx.NewEventType()
11099 app.Connect(-1, -1, app._CallAfterId,
11100 lambda event: event.callable(*event.args, **event.kw) )
11101 evt = wx.PyEvent()
11102 evt.SetEventType(app._CallAfterId)
11103 evt.callable = callable
11104 evt.args = args
11105 evt.kw = kw
11106 wx.PostEvent(app, evt)
11107
11108 #----------------------------------------------------------------------------
11109
11110
11111 class FutureCall:
11112 """
11113 A convenience class for `wx.Timer`, that calls the given callable
11114 object once after the given amount of milliseconds, passing any
11115 positional or keyword args. The return value of the callable is
11116 availbale after it has been run with the `GetResult` method.
11117
11118 If you don't need to get the return value or restart the timer
11119 then there is no need to hold a reference to this object. It will
11120 hold a reference to itself while the timer is running (the timer
11121 has a reference to self.Notify) but the cycle will be broken when
11122 the timer completes, automatically cleaning up the wx.FutureCall
11123 object.
11124
11125 :see: `wx.CallAfter`
11126 """
11127 def __init__(self, millis, callable, *args, **kwargs):
11128 self.millis = millis
11129 self.callable = callable
11130 self.SetArgs(*args, **kwargs)
11131 self.runCount = 0
11132 self.running = False
11133 self.hasRun = False
11134 self.result = None
11135 self.timer = None
11136 self.Start()
11137
11138 def __del__(self):
11139 self.Stop()
11140
11141
11142 def Start(self, millis=None, *args, **kwargs):
11143 """
11144 (Re)start the timer
11145 """
11146 self.hasRun = False
11147 if millis is not None:
11148 self.millis = millis
11149 if args or kwargs:
11150 self.SetArgs(*args, **kwargs)
11151 self.Stop()
11152 self.timer = wx.PyTimer(self.Notify)
11153 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
11154 self.running = True
11155 Restart = Start
11156
11157
11158 def Stop(self):
11159 """
11160 Stop and destroy the timer.
11161 """
11162 if self.timer is not None:
11163 self.timer.Stop()
11164 self.timer = None
11165
11166
11167 def GetInterval(self):
11168 if self.timer is not None:
11169 return self.timer.GetInterval()
11170 else:
11171 return 0
11172
11173
11174 def IsRunning(self):
11175 return self.timer is not None and self.timer.IsRunning()
11176
11177
11178 def SetArgs(self, *args, **kwargs):
11179 """
11180 (Re)set the args passed to the callable object. This is
11181 useful in conjunction with Restart if you want to schedule a
11182 new call to the same callable object but with different
11183 parameters.
11184 """
11185 self.args = args
11186 self.kwargs = kwargs
11187
11188
11189 def HasRun(self):
11190 return self.hasRun
11191
11192 def GetResult(self):
11193 return self.result
11194
11195 def Notify(self):
11196 """
11197 The timer has expired so call the callable.
11198 """
11199 if self.callable and getattr(self.callable, 'im_self', True):
11200 self.runCount += 1
11201 self.running = False
11202 self.result = self.callable(*self.args, **self.kwargs)
11203 self.hasRun = True
11204 if not self.running:
11205 # if it wasn't restarted, then cleanup
11206 wx.CallAfter(self.Stop)
11207
11208
11209
11210 #----------------------------------------------------------------------------
11211 # Control which items in this module should be documented by epydoc.
11212 # We allow only classes and functions, which will help reduce the size
11213 # of the docs by filtering out the zillions of constants, EVT objects,
11214 # and etc that don't make much sense by themselves, but are instead
11215 # documented (or will be) as part of the classes/functions/methods
11216 # where they should be used.
11217
11218 class __DocFilter:
11219 """
11220 A filter for epydoc that only allows non-Ptr classes and
11221 fucntions, in order to reduce the clutter in the API docs.
11222 """
11223 def __init__(self, globals):
11224 self._globals = globals
11225
11226 def __call__(self, name):
11227 import types
11228 obj = self._globals.get(name, None)
11229 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
11230 return False
11231 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
11232 return False
11233 return True
11234
11235 #----------------------------------------------------------------------------
11236 #----------------------------------------------------------------------------
11237
11238 # Import other modules in this package that should show up in the
11239 # "core" wx namespace
11240 from _gdi import *
11241 from _windows import *
11242 from _controls import *
11243 from _misc import *
11244
11245
11246 # Fixup the stock objects since they can't be used yet. (They will be
11247 # restored in wx.PyApp.OnInit.)
11248 _core_._wxPyFixStockObjects()
11249
11250 #----------------------------------------------------------------------------
11251 #----------------------------------------------------------------------------
11252
11253