]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/msw/_core.py
src/common/wxchar.cpps/wxConvLocal/wxConvLibs/g as otherwise we may fail to convert...
[wxWidgets.git] / wxPython / src / msw / _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 CLIP_CHILDREN = _core_.CLIP_CHILDREN
95 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
96 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
97 RETAINED = _core_.RETAINED
98 BACKINGSTORE = _core_.BACKINGSTORE
99 COLOURED = _core_.COLOURED
100 FIXED_LENGTH = _core_.FIXED_LENGTH
101 LB_NEEDED_SB = _core_.LB_NEEDED_SB
102 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
103 LB_SORT = _core_.LB_SORT
104 LB_SINGLE = _core_.LB_SINGLE
105 LB_MULTIPLE = _core_.LB_MULTIPLE
106 LB_EXTENDED = _core_.LB_EXTENDED
107 LB_OWNERDRAW = _core_.LB_OWNERDRAW
108 LB_HSCROLL = _core_.LB_HSCROLL
109 PROCESS_ENTER = _core_.PROCESS_ENTER
110 PASSWORD = _core_.PASSWORD
111 CB_SIMPLE = _core_.CB_SIMPLE
112 CB_DROPDOWN = _core_.CB_DROPDOWN
113 CB_SORT = _core_.CB_SORT
114 CB_READONLY = _core_.CB_READONLY
115 RA_HORIZONTAL = _core_.RA_HORIZONTAL
116 RA_VERTICAL = _core_.RA_VERTICAL
117 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
118 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
119 RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
120 RB_GROUP = _core_.RB_GROUP
121 RB_SINGLE = _core_.RB_SINGLE
122 SB_HORIZONTAL = _core_.SB_HORIZONTAL
123 SB_VERTICAL = _core_.SB_VERTICAL
124 RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
125 ST_SIZEGRIP = _core_.ST_SIZEGRIP
126 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
127 FLOOD_SURFACE = _core_.FLOOD_SURFACE
128 FLOOD_BORDER = _core_.FLOOD_BORDER
129 ODDEVEN_RULE = _core_.ODDEVEN_RULE
130 WINDING_RULE = _core_.WINDING_RULE
131 TOOL_TOP = _core_.TOOL_TOP
132 TOOL_BOTTOM = _core_.TOOL_BOTTOM
133 TOOL_LEFT = _core_.TOOL_LEFT
134 TOOL_RIGHT = _core_.TOOL_RIGHT
135 OK = _core_.OK
136 YES_NO = _core_.YES_NO
137 CANCEL = _core_.CANCEL
138 YES = _core_.YES
139 NO = _core_.NO
140 NO_DEFAULT = _core_.NO_DEFAULT
141 YES_DEFAULT = _core_.YES_DEFAULT
142 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
143 ICON_HAND = _core_.ICON_HAND
144 ICON_QUESTION = _core_.ICON_QUESTION
145 ICON_INFORMATION = _core_.ICON_INFORMATION
146 ICON_STOP = _core_.ICON_STOP
147 ICON_ASTERISK = _core_.ICON_ASTERISK
148 ICON_MASK = _core_.ICON_MASK
149 ICON_WARNING = _core_.ICON_WARNING
150 ICON_ERROR = _core_.ICON_ERROR
151 FORWARD = _core_.FORWARD
152 BACKWARD = _core_.BACKWARD
153 RESET = _core_.RESET
154 HELP = _core_.HELP
155 MORE = _core_.MORE
156 SETUP = _core_.SETUP
157 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
158 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
159 SIZE_AUTO = _core_.SIZE_AUTO
160 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
161 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
162 PORTRAIT = _core_.PORTRAIT
163 LANDSCAPE = _core_.LANDSCAPE
164 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
165 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
166 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
167 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
168 ID_ANY = _core_.ID_ANY
169 ID_SEPARATOR = _core_.ID_SEPARATOR
170 ID_LOWEST = _core_.ID_LOWEST
171 ID_OPEN = _core_.ID_OPEN
172 ID_CLOSE = _core_.ID_CLOSE
173 ID_NEW = _core_.ID_NEW
174 ID_SAVE = _core_.ID_SAVE
175 ID_SAVEAS = _core_.ID_SAVEAS
176 ID_REVERT = _core_.ID_REVERT
177 ID_EXIT = _core_.ID_EXIT
178 ID_UNDO = _core_.ID_UNDO
179 ID_REDO = _core_.ID_REDO
180 ID_HELP = _core_.ID_HELP
181 ID_PRINT = _core_.ID_PRINT
182 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
183 ID_PREVIEW = _core_.ID_PREVIEW
184 ID_ABOUT = _core_.ID_ABOUT
185 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
186 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
187 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
188 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
189 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
190 ID_PREFERENCES = _core_.ID_PREFERENCES
191 ID_CUT = _core_.ID_CUT
192 ID_COPY = _core_.ID_COPY
193 ID_PASTE = _core_.ID_PASTE
194 ID_CLEAR = _core_.ID_CLEAR
195 ID_FIND = _core_.ID_FIND
196 ID_DUPLICATE = _core_.ID_DUPLICATE
197 ID_SELECTALL = _core_.ID_SELECTALL
198 ID_DELETE = _core_.ID_DELETE
199 ID_REPLACE = _core_.ID_REPLACE
200 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
201 ID_PROPERTIES = _core_.ID_PROPERTIES
202 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
203 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
204 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
205 ID_VIEW_LIST = _core_.ID_VIEW_LIST
206 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
207 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
208 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
209 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
210 ID_FILE1 = _core_.ID_FILE1
211 ID_FILE2 = _core_.ID_FILE2
212 ID_FILE3 = _core_.ID_FILE3
213 ID_FILE4 = _core_.ID_FILE4
214 ID_FILE5 = _core_.ID_FILE5
215 ID_FILE6 = _core_.ID_FILE6
216 ID_FILE7 = _core_.ID_FILE7
217 ID_FILE8 = _core_.ID_FILE8
218 ID_FILE9 = _core_.ID_FILE9
219 ID_OK = _core_.ID_OK
220 ID_CANCEL = _core_.ID_CANCEL
221 ID_APPLY = _core_.ID_APPLY
222 ID_YES = _core_.ID_YES
223 ID_NO = _core_.ID_NO
224 ID_STATIC = _core_.ID_STATIC
225 ID_FORWARD = _core_.ID_FORWARD
226 ID_BACKWARD = _core_.ID_BACKWARD
227 ID_DEFAULT = _core_.ID_DEFAULT
228 ID_MORE = _core_.ID_MORE
229 ID_SETUP = _core_.ID_SETUP
230 ID_RESET = _core_.ID_RESET
231 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
232 ID_YESTOALL = _core_.ID_YESTOALL
233 ID_NOTOALL = _core_.ID_NOTOALL
234 ID_ABORT = _core_.ID_ABORT
235 ID_RETRY = _core_.ID_RETRY
236 ID_IGNORE = _core_.ID_IGNORE
237 ID_ADD = _core_.ID_ADD
238 ID_REMOVE = _core_.ID_REMOVE
239 ID_UP = _core_.ID_UP
240 ID_DOWN = _core_.ID_DOWN
241 ID_HOME = _core_.ID_HOME
242 ID_REFRESH = _core_.ID_REFRESH
243 ID_STOP = _core_.ID_STOP
244 ID_INDEX = _core_.ID_INDEX
245 ID_BOLD = _core_.ID_BOLD
246 ID_ITALIC = _core_.ID_ITALIC
247 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
248 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
249 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
250 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
251 ID_UNDERLINE = _core_.ID_UNDERLINE
252 ID_INDENT = _core_.ID_INDENT
253 ID_UNINDENT = _core_.ID_UNINDENT
254 ID_ZOOM_100 = _core_.ID_ZOOM_100
255 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
256 ID_ZOOM_IN = _core_.ID_ZOOM_IN
257 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
258 ID_UNDELETE = _core_.ID_UNDELETE
259 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
260 ID_HIGHEST = _core_.ID_HIGHEST
261 OPEN = _core_.OPEN
262 SAVE = _core_.SAVE
263 HIDE_READONLY = _core_.HIDE_READONLY
264 OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
265 FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
266 MULTIPLE = _core_.MULTIPLE
267 CHANGE_DIR = _core_.CHANGE_DIR
268 ACCEL_ALT = _core_.ACCEL_ALT
269 ACCEL_CTRL = _core_.ACCEL_CTRL
270 ACCEL_SHIFT = _core_.ACCEL_SHIFT
271 ACCEL_NORMAL = _core_.ACCEL_NORMAL
272 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
273 PD_APP_MODAL = _core_.PD_APP_MODAL
274 PD_CAN_ABORT = _core_.PD_CAN_ABORT
275 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
276 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
277 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
278 PD_SMOOTH = _core_.PD_SMOOTH
279 PD_CAN_SKIP = _core_.PD_CAN_SKIP
280 DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
281 DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
282 MENU_TEAROFF = _core_.MENU_TEAROFF
283 MB_DOCKABLE = _core_.MB_DOCKABLE
284 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
285 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
286 LI_HORIZONTAL = _core_.LI_HORIZONTAL
287 LI_VERTICAL = _core_.LI_VERTICAL
288 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
289 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
290 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
291 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
292 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
293 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
294 MM_TEXT = _core_.MM_TEXT
295 MM_LOMETRIC = _core_.MM_LOMETRIC
296 MM_HIMETRIC = _core_.MM_HIMETRIC
297 MM_LOENGLISH = _core_.MM_LOENGLISH
298 MM_HIENGLISH = _core_.MM_HIENGLISH
299 MM_TWIPS = _core_.MM_TWIPS
300 MM_ISOTROPIC = _core_.MM_ISOTROPIC
301 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
302 MM_POINTS = _core_.MM_POINTS
303 MM_METRIC = _core_.MM_METRIC
304 CENTRE = _core_.CENTRE
305 CENTER = _core_.CENTER
306 HORIZONTAL = _core_.HORIZONTAL
307 VERTICAL = _core_.VERTICAL
308 BOTH = _core_.BOTH
309 LEFT = _core_.LEFT
310 RIGHT = _core_.RIGHT
311 UP = _core_.UP
312 DOWN = _core_.DOWN
313 TOP = _core_.TOP
314 BOTTOM = _core_.BOTTOM
315 NORTH = _core_.NORTH
316 SOUTH = _core_.SOUTH
317 WEST = _core_.WEST
318 EAST = _core_.EAST
319 ALL = _core_.ALL
320 ALIGN_NOT = _core_.ALIGN_NOT
321 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
322 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
323 ALIGN_LEFT = _core_.ALIGN_LEFT
324 ALIGN_TOP = _core_.ALIGN_TOP
325 ALIGN_RIGHT = _core_.ALIGN_RIGHT
326 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
327 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
328 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
329 ALIGN_CENTER = _core_.ALIGN_CENTER
330 ALIGN_CENTRE = _core_.ALIGN_CENTRE
331 ALIGN_MASK = _core_.ALIGN_MASK
332 STRETCH_NOT = _core_.STRETCH_NOT
333 SHRINK = _core_.SHRINK
334 GROW = _core_.GROW
335 EXPAND = _core_.EXPAND
336 SHAPED = _core_.SHAPED
337 FIXED_MINSIZE = _core_.FIXED_MINSIZE
338 TILE = _core_.TILE
339 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
340 BORDER_DEFAULT = _core_.BORDER_DEFAULT
341 BORDER_NONE = _core_.BORDER_NONE
342 BORDER_STATIC = _core_.BORDER_STATIC
343 BORDER_SIMPLE = _core_.BORDER_SIMPLE
344 BORDER_RAISED = _core_.BORDER_RAISED
345 BORDER_SUNKEN = _core_.BORDER_SUNKEN
346 BORDER_DOUBLE = _core_.BORDER_DOUBLE
347 BORDER_MASK = _core_.BORDER_MASK
348 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
349 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
350 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
351 DEFAULT = _core_.DEFAULT
352 DECORATIVE = _core_.DECORATIVE
353 ROMAN = _core_.ROMAN
354 SCRIPT = _core_.SCRIPT
355 SWISS = _core_.SWISS
356 MODERN = _core_.MODERN
357 TELETYPE = _core_.TELETYPE
358 VARIABLE = _core_.VARIABLE
359 FIXED = _core_.FIXED
360 NORMAL = _core_.NORMAL
361 LIGHT = _core_.LIGHT
362 BOLD = _core_.BOLD
363 ITALIC = _core_.ITALIC
364 SLANT = _core_.SLANT
365 SOLID = _core_.SOLID
366 DOT = _core_.DOT
367 LONG_DASH = _core_.LONG_DASH
368 SHORT_DASH = _core_.SHORT_DASH
369 DOT_DASH = _core_.DOT_DASH
370 USER_DASH = _core_.USER_DASH
371 TRANSPARENT = _core_.TRANSPARENT
372 STIPPLE = _core_.STIPPLE
373 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
374 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
375 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
376 CROSS_HATCH = _core_.CROSS_HATCH
377 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
378 VERTICAL_HATCH = _core_.VERTICAL_HATCH
379 JOIN_BEVEL = _core_.JOIN_BEVEL
380 JOIN_MITER = _core_.JOIN_MITER
381 JOIN_ROUND = _core_.JOIN_ROUND
382 CAP_ROUND = _core_.CAP_ROUND
383 CAP_PROJECTING = _core_.CAP_PROJECTING
384 CAP_BUTT = _core_.CAP_BUTT
385 CLEAR = _core_.CLEAR
386 XOR = _core_.XOR
387 INVERT = _core_.INVERT
388 OR_REVERSE = _core_.OR_REVERSE
389 AND_REVERSE = _core_.AND_REVERSE
390 COPY = _core_.COPY
391 AND = _core_.AND
392 AND_INVERT = _core_.AND_INVERT
393 NO_OP = _core_.NO_OP
394 NOR = _core_.NOR
395 EQUIV = _core_.EQUIV
396 SRC_INVERT = _core_.SRC_INVERT
397 OR_INVERT = _core_.OR_INVERT
398 NAND = _core_.NAND
399 OR = _core_.OR
400 SET = _core_.SET
401 WXK_BACK = _core_.WXK_BACK
402 WXK_TAB = _core_.WXK_TAB
403 WXK_RETURN = _core_.WXK_RETURN
404 WXK_ESCAPE = _core_.WXK_ESCAPE
405 WXK_SPACE = _core_.WXK_SPACE
406 WXK_DELETE = _core_.WXK_DELETE
407 WXK_START = _core_.WXK_START
408 WXK_LBUTTON = _core_.WXK_LBUTTON
409 WXK_RBUTTON = _core_.WXK_RBUTTON
410 WXK_CANCEL = _core_.WXK_CANCEL
411 WXK_MBUTTON = _core_.WXK_MBUTTON
412 WXK_CLEAR = _core_.WXK_CLEAR
413 WXK_SHIFT = _core_.WXK_SHIFT
414 WXK_ALT = _core_.WXK_ALT
415 WXK_CONTROL = _core_.WXK_CONTROL
416 WXK_MENU = _core_.WXK_MENU
417 WXK_PAUSE = _core_.WXK_PAUSE
418 WXK_CAPITAL = _core_.WXK_CAPITAL
419 WXK_PRIOR = _core_.WXK_PRIOR
420 WXK_NEXT = _core_.WXK_NEXT
421 WXK_END = _core_.WXK_END
422 WXK_HOME = _core_.WXK_HOME
423 WXK_LEFT = _core_.WXK_LEFT
424 WXK_UP = _core_.WXK_UP
425 WXK_RIGHT = _core_.WXK_RIGHT
426 WXK_DOWN = _core_.WXK_DOWN
427 WXK_SELECT = _core_.WXK_SELECT
428 WXK_PRINT = _core_.WXK_PRINT
429 WXK_EXECUTE = _core_.WXK_EXECUTE
430 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
431 WXK_INSERT = _core_.WXK_INSERT
432 WXK_HELP = _core_.WXK_HELP
433 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
434 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
435 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
436 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
437 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
438 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
439 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
440 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
441 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
442 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
443 WXK_MULTIPLY = _core_.WXK_MULTIPLY
444 WXK_ADD = _core_.WXK_ADD
445 WXK_SEPARATOR = _core_.WXK_SEPARATOR
446 WXK_SUBTRACT = _core_.WXK_SUBTRACT
447 WXK_DECIMAL = _core_.WXK_DECIMAL
448 WXK_DIVIDE = _core_.WXK_DIVIDE
449 WXK_F1 = _core_.WXK_F1
450 WXK_F2 = _core_.WXK_F2
451 WXK_F3 = _core_.WXK_F3
452 WXK_F4 = _core_.WXK_F4
453 WXK_F5 = _core_.WXK_F5
454 WXK_F6 = _core_.WXK_F6
455 WXK_F7 = _core_.WXK_F7
456 WXK_F8 = _core_.WXK_F8
457 WXK_F9 = _core_.WXK_F9
458 WXK_F10 = _core_.WXK_F10
459 WXK_F11 = _core_.WXK_F11
460 WXK_F12 = _core_.WXK_F12
461 WXK_F13 = _core_.WXK_F13
462 WXK_F14 = _core_.WXK_F14
463 WXK_F15 = _core_.WXK_F15
464 WXK_F16 = _core_.WXK_F16
465 WXK_F17 = _core_.WXK_F17
466 WXK_F18 = _core_.WXK_F18
467 WXK_F19 = _core_.WXK_F19
468 WXK_F20 = _core_.WXK_F20
469 WXK_F21 = _core_.WXK_F21
470 WXK_F22 = _core_.WXK_F22
471 WXK_F23 = _core_.WXK_F23
472 WXK_F24 = _core_.WXK_F24
473 WXK_NUMLOCK = _core_.WXK_NUMLOCK
474 WXK_SCROLL = _core_.WXK_SCROLL
475 WXK_PAGEUP = _core_.WXK_PAGEUP
476 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
477 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
478 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
479 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
480 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
481 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
482 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
483 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
484 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
485 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
486 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
487 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
488 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
489 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
490 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
491 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
492 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
493 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
494 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
495 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
496 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
497 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
498 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
499 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
500 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
501 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
502 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
503 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
504 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
505 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
506 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
507 WXK_COMMAND = _core_.WXK_COMMAND
508 WXK_SPECIAL1 = _core_.WXK_SPECIAL1
509 WXK_SPECIAL2 = _core_.WXK_SPECIAL2
510 WXK_SPECIAL3 = _core_.WXK_SPECIAL3
511 WXK_SPECIAL4 = _core_.WXK_SPECIAL4
512 WXK_SPECIAL5 = _core_.WXK_SPECIAL5
513 WXK_SPECIAL6 = _core_.WXK_SPECIAL6
514 WXK_SPECIAL7 = _core_.WXK_SPECIAL7
515 WXK_SPECIAL8 = _core_.WXK_SPECIAL8
516 WXK_SPECIAL9 = _core_.WXK_SPECIAL9
517 WXK_SPECIAL10 = _core_.WXK_SPECIAL10
518 WXK_SPECIAL11 = _core_.WXK_SPECIAL11
519 WXK_SPECIAL12 = _core_.WXK_SPECIAL12
520 WXK_SPECIAL13 = _core_.WXK_SPECIAL13
521 WXK_SPECIAL14 = _core_.WXK_SPECIAL14
522 WXK_SPECIAL15 = _core_.WXK_SPECIAL15
523 WXK_SPECIAL16 = _core_.WXK_SPECIAL16
524 WXK_SPECIAL17 = _core_.WXK_SPECIAL17
525 WXK_SPECIAL18 = _core_.WXK_SPECIAL18
526 WXK_SPECIAL19 = _core_.WXK_SPECIAL19
527 WXK_SPECIAL20 = _core_.WXK_SPECIAL20
528 PAPER_NONE = _core_.PAPER_NONE
529 PAPER_LETTER = _core_.PAPER_LETTER
530 PAPER_LEGAL = _core_.PAPER_LEGAL
531 PAPER_A4 = _core_.PAPER_A4
532 PAPER_CSHEET = _core_.PAPER_CSHEET
533 PAPER_DSHEET = _core_.PAPER_DSHEET
534 PAPER_ESHEET = _core_.PAPER_ESHEET
535 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
536 PAPER_TABLOID = _core_.PAPER_TABLOID
537 PAPER_LEDGER = _core_.PAPER_LEDGER
538 PAPER_STATEMENT = _core_.PAPER_STATEMENT
539 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
540 PAPER_A3 = _core_.PAPER_A3
541 PAPER_A4SMALL = _core_.PAPER_A4SMALL
542 PAPER_A5 = _core_.PAPER_A5
543 PAPER_B4 = _core_.PAPER_B4
544 PAPER_B5 = _core_.PAPER_B5
545 PAPER_FOLIO = _core_.PAPER_FOLIO
546 PAPER_QUARTO = _core_.PAPER_QUARTO
547 PAPER_10X14 = _core_.PAPER_10X14
548 PAPER_11X17 = _core_.PAPER_11X17
549 PAPER_NOTE = _core_.PAPER_NOTE
550 PAPER_ENV_9 = _core_.PAPER_ENV_9
551 PAPER_ENV_10 = _core_.PAPER_ENV_10
552 PAPER_ENV_11 = _core_.PAPER_ENV_11
553 PAPER_ENV_12 = _core_.PAPER_ENV_12
554 PAPER_ENV_14 = _core_.PAPER_ENV_14
555 PAPER_ENV_DL = _core_.PAPER_ENV_DL
556 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
557 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
558 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
559 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
560 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
561 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
562 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
563 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
564 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
565 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
566 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
567 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
568 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
569 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
570 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
571 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
572 PAPER_9X11 = _core_.PAPER_9X11
573 PAPER_10X11 = _core_.PAPER_10X11
574 PAPER_15X11 = _core_.PAPER_15X11
575 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
576 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
577 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
578 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
579 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
580 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
581 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
582 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
583 PAPER_A_PLUS = _core_.PAPER_A_PLUS
584 PAPER_B_PLUS = _core_.PAPER_B_PLUS
585 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
586 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
587 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
588 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
589 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
590 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
591 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
592 PAPER_A2 = _core_.PAPER_A2
593 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
594 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
595 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
596 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
597 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
598 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
599 ITEM_NORMAL = _core_.ITEM_NORMAL
600 ITEM_CHECK = _core_.ITEM_CHECK
601 ITEM_RADIO = _core_.ITEM_RADIO
602 ITEM_MAX = _core_.ITEM_MAX
603 HT_NOWHERE = _core_.HT_NOWHERE
604 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
605 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
606 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
607 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
608 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
609 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
610 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
611 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
612 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
613 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
614 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
615 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
616 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
617 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
618 HT_MAX = _core_.HT_MAX
619 MOD_NONE = _core_.MOD_NONE
620 MOD_ALT = _core_.MOD_ALT
621 MOD_CONTROL = _core_.MOD_CONTROL
622 MOD_SHIFT = _core_.MOD_SHIFT
623 MOD_WIN = _core_.MOD_WIN
624 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
625 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
626 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
627 #---------------------------------------------------------------------------
628
629 class Object(object):
630 """
631 The base class for most wx objects, although in wxPython not
632 much functionality is needed nor exposed.
633 """
634 def __init__(self): raise RuntimeError, "No constructor defined"
635 def __repr__(self):
636 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
637 def GetClassName(*args, **kwargs):
638 """
639 GetClassName(self) -> String
640
641 Returns the class name of the C++ class using wxRTTI.
642 """
643 return _core_.Object_GetClassName(*args, **kwargs)
644
645 def Destroy(*args, **kwargs):
646 """
647 Destroy(self)
648
649 Deletes the C++ object this Python object is a proxy for.
650 """
651 return _core_.Object_Destroy(*args, **kwargs)
652
653
654 class ObjectPtr(Object):
655 def __init__(self, this):
656 self.this = this
657 if not hasattr(self,"thisown"): self.thisown = 0
658 self.__class__ = Object
659 _core_.Object_swigregister(ObjectPtr)
660 _wxPySetDictionary = _core_._wxPySetDictionary
661
662 _wxPyFixStockObjects = _core_._wxPyFixStockObjects
663
664 cvar = _core_.cvar
665 EmptyString = cvar.EmptyString
666
667 #---------------------------------------------------------------------------
668
669 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
670 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
671 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
672 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
673 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
674 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
675 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
676 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
677 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
678 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
679 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
680 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
681 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
682 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
683 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
684 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
685 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
686 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
687 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
688 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
689 CURSOR_NONE = _core_.CURSOR_NONE
690 CURSOR_ARROW = _core_.CURSOR_ARROW
691 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
692 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
693 CURSOR_CHAR = _core_.CURSOR_CHAR
694 CURSOR_CROSS = _core_.CURSOR_CROSS
695 CURSOR_HAND = _core_.CURSOR_HAND
696 CURSOR_IBEAM = _core_.CURSOR_IBEAM
697 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
698 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
699 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
700 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
701 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
702 CURSOR_PENCIL = _core_.CURSOR_PENCIL
703 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
704 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
705 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
706 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
707 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
708 CURSOR_SIZENS = _core_.CURSOR_SIZENS
709 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
710 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
711 CURSOR_SIZING = _core_.CURSOR_SIZING
712 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
713 CURSOR_WAIT = _core_.CURSOR_WAIT
714 CURSOR_WATCH = _core_.CURSOR_WATCH
715 CURSOR_BLANK = _core_.CURSOR_BLANK
716 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
717 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
718 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
719 CURSOR_MAX = _core_.CURSOR_MAX
720 #---------------------------------------------------------------------------
721
722 class Size(object):
723 """
724 wx.Size is a useful data structure used to represent the size of
725 something. It simply contians integer width and height
726 proprtites. In most places in wxPython where a wx.Size is
727 expected a (width, height) tuple can be used instead.
728 """
729 def __repr__(self):
730 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
731 width = property(_core_.Size_width_get, _core_.Size_width_set)
732 height = property(_core_.Size_height_get, _core_.Size_height_set)
733 x = width; y = height
734 def __init__(self, *args, **kwargs):
735 """
736 __init__(self, int w=0, int h=0) -> Size
737
738 Creates a size object.
739 """
740 newobj = _core_.new_Size(*args, **kwargs)
741 self.this = newobj.this
742 self.thisown = 1
743 del newobj.thisown
744 def __del__(self, destroy=_core_.delete_Size):
745 """__del__(self)"""
746 try:
747 if self.thisown: destroy(self)
748 except: pass
749
750 def __eq__(*args, **kwargs):
751 """
752 __eq__(self, Size sz) -> bool
753
754 Test for equality of wx.Size objects.
755 """
756 return _core_.Size___eq__(*args, **kwargs)
757
758 def __ne__(*args, **kwargs):
759 """
760 __ne__(self, Size sz) -> bool
761
762 Test for inequality.
763 """
764 return _core_.Size___ne__(*args, **kwargs)
765
766 def __add__(*args, **kwargs):
767 """
768 __add__(self, Size sz) -> Size
769
770 Add sz's proprties to this and return the result.
771 """
772 return _core_.Size___add__(*args, **kwargs)
773
774 def __sub__(*args, **kwargs):
775 """
776 __sub__(self, Size sz) -> Size
777
778 Subtract sz's properties from this and return the result.
779 """
780 return _core_.Size___sub__(*args, **kwargs)
781
782 def IncTo(*args, **kwargs):
783 """
784 IncTo(self, Size sz)
785
786 Increments this object so that both of its dimensions are not less
787 than the corresponding dimensions of the size.
788 """
789 return _core_.Size_IncTo(*args, **kwargs)
790
791 def DecTo(*args, **kwargs):
792 """
793 DecTo(self, Size sz)
794
795 Decrements this object so that both of its dimensions are not greater
796 than the corresponding dimensions of the size.
797 """
798 return _core_.Size_DecTo(*args, **kwargs)
799
800 def Set(*args, **kwargs):
801 """
802 Set(self, int w, int h)
803
804 Set both width and height.
805 """
806 return _core_.Size_Set(*args, **kwargs)
807
808 def SetWidth(*args, **kwargs):
809 """SetWidth(self, int w)"""
810 return _core_.Size_SetWidth(*args, **kwargs)
811
812 def SetHeight(*args, **kwargs):
813 """SetHeight(self, int h)"""
814 return _core_.Size_SetHeight(*args, **kwargs)
815
816 def GetWidth(*args, **kwargs):
817 """GetWidth(self) -> int"""
818 return _core_.Size_GetWidth(*args, **kwargs)
819
820 def GetHeight(*args, **kwargs):
821 """GetHeight(self) -> int"""
822 return _core_.Size_GetHeight(*args, **kwargs)
823
824 def IsFullySpecified(*args, **kwargs):
825 """
826 IsFullySpecified(self) -> bool
827
828 Returns True if both components of the size are non-default values.
829 """
830 return _core_.Size_IsFullySpecified(*args, **kwargs)
831
832 def SetDefaults(*args, **kwargs):
833 """
834 SetDefaults(self, Size size)
835
836 Combine this size with the other one replacing the default components
837 of this object (i.e. equal to -1) with those of the other.
838 """
839 return _core_.Size_SetDefaults(*args, **kwargs)
840
841 def Get(*args, **kwargs):
842 """
843 Get() -> (width,height)
844
845 Returns the width and height properties as a tuple.
846 """
847 return _core_.Size_Get(*args, **kwargs)
848
849 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
850 def __str__(self): return str(self.Get())
851 def __repr__(self): return 'wx.Size'+str(self.Get())
852 def __len__(self): return len(self.Get())
853 def __getitem__(self, index): return self.Get()[index]
854 def __setitem__(self, index, val):
855 if index == 0: self.width = val
856 elif index == 1: self.height = val
857 else: raise IndexError
858 def __nonzero__(self): return self.Get() != (0,0)
859 __safe_for_unpickling__ = True
860 def __reduce__(self): return (wx.Size, self.Get())
861
862
863 class SizePtr(Size):
864 def __init__(self, this):
865 self.this = this
866 if not hasattr(self,"thisown"): self.thisown = 0
867 self.__class__ = Size
868 _core_.Size_swigregister(SizePtr)
869
870 #---------------------------------------------------------------------------
871
872 class RealPoint(object):
873 """
874 A data structure for representing a point or position with floating
875 point x and y properties. In wxPython most places that expect a
876 wx.RealPoint can also accept a (x,y) tuple.
877 """
878 def __repr__(self):
879 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
880 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
881 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
882 def __init__(self, *args, **kwargs):
883 """
884 __init__(self, double x=0.0, double y=0.0) -> RealPoint
885
886 Create a wx.RealPoint object
887 """
888 newobj = _core_.new_RealPoint(*args, **kwargs)
889 self.this = newobj.this
890 self.thisown = 1
891 del newobj.thisown
892 def __del__(self, destroy=_core_.delete_RealPoint):
893 """__del__(self)"""
894 try:
895 if self.thisown: destroy(self)
896 except: pass
897
898 def __eq__(*args, **kwargs):
899 """
900 __eq__(self, RealPoint pt) -> bool
901
902 Test for equality of wx.RealPoint objects.
903 """
904 return _core_.RealPoint___eq__(*args, **kwargs)
905
906 def __ne__(*args, **kwargs):
907 """
908 __ne__(self, RealPoint pt) -> bool
909
910 Test for inequality of wx.RealPoint objects.
911 """
912 return _core_.RealPoint___ne__(*args, **kwargs)
913
914 def __add__(*args, **kwargs):
915 """
916 __add__(self, RealPoint pt) -> RealPoint
917
918 Add pt's proprties to this and return the result.
919 """
920 return _core_.RealPoint___add__(*args, **kwargs)
921
922 def __sub__(*args, **kwargs):
923 """
924 __sub__(self, RealPoint pt) -> RealPoint
925
926 Subtract pt's proprties from this and return the result
927 """
928 return _core_.RealPoint___sub__(*args, **kwargs)
929
930 def Set(*args, **kwargs):
931 """
932 Set(self, double x, double y)
933
934 Set both the x and y properties
935 """
936 return _core_.RealPoint_Set(*args, **kwargs)
937
938 def Get(*args, **kwargs):
939 """
940 Get() -> (x,y)
941
942 Return the x and y properties as a tuple.
943 """
944 return _core_.RealPoint_Get(*args, **kwargs)
945
946 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
947 def __str__(self): return str(self.Get())
948 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
949 def __len__(self): return len(self.Get())
950 def __getitem__(self, index): return self.Get()[index]
951 def __setitem__(self, index, val):
952 if index == 0: self.x = val
953 elif index == 1: self.y = val
954 else: raise IndexError
955 def __nonzero__(self): return self.Get() != (0.0, 0.0)
956 __safe_for_unpickling__ = True
957 def __reduce__(self): return (wx.RealPoint, self.Get())
958
959
960 class RealPointPtr(RealPoint):
961 def __init__(self, this):
962 self.this = this
963 if not hasattr(self,"thisown"): self.thisown = 0
964 self.__class__ = RealPoint
965 _core_.RealPoint_swigregister(RealPointPtr)
966
967 #---------------------------------------------------------------------------
968
969 class Point(object):
970 """
971 A data structure for representing a point or position with integer x
972 and y properties. Most places in wxPython that expect a wx.Point can
973 also accept a (x,y) tuple.
974 """
975 def __repr__(self):
976 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
977 x = property(_core_.Point_x_get, _core_.Point_x_set)
978 y = property(_core_.Point_y_get, _core_.Point_y_set)
979 def __init__(self, *args, **kwargs):
980 """
981 __init__(self, int x=0, int y=0) -> Point
982
983 Create a wx.Point object
984 """
985 newobj = _core_.new_Point(*args, **kwargs)
986 self.this = newobj.this
987 self.thisown = 1
988 del newobj.thisown
989 def __del__(self, destroy=_core_.delete_Point):
990 """__del__(self)"""
991 try:
992 if self.thisown: destroy(self)
993 except: pass
994
995 def __eq__(*args, **kwargs):
996 """
997 __eq__(self, Point pt) -> bool
998
999 Test for equality of wx.Point objects.
1000 """
1001 return _core_.Point___eq__(*args, **kwargs)
1002
1003 def __ne__(*args, **kwargs):
1004 """
1005 __ne__(self, Point pt) -> bool
1006
1007 Test for inequality of wx.Point objects.
1008 """
1009 return _core_.Point___ne__(*args, **kwargs)
1010
1011 def __add__(*args, **kwargs):
1012 """
1013 __add__(self, Point pt) -> Point
1014
1015 Add pt's proprties to this and return the result.
1016 """
1017 return _core_.Point___add__(*args, **kwargs)
1018
1019 def __sub__(*args, **kwargs):
1020 """
1021 __sub__(self, Point pt) -> Point
1022
1023 Subtract pt's proprties from this and return the result
1024 """
1025 return _core_.Point___sub__(*args, **kwargs)
1026
1027 def __iadd__(*args, **kwargs):
1028 """
1029 __iadd__(self, Point pt) -> Point
1030
1031 Add pt to this object.
1032 """
1033 return _core_.Point___iadd__(*args, **kwargs)
1034
1035 def __isub__(*args, **kwargs):
1036 """
1037 __isub__(self, Point pt) -> Point
1038
1039 Subtract pt from this object.
1040 """
1041 return _core_.Point___isub__(*args, **kwargs)
1042
1043 def Set(*args, **kwargs):
1044 """
1045 Set(self, long x, long y)
1046
1047 Set both the x and y properties
1048 """
1049 return _core_.Point_Set(*args, **kwargs)
1050
1051 def Get(*args, **kwargs):
1052 """
1053 Get() -> (x,y)
1054
1055 Return the x and y properties as a tuple.
1056 """
1057 return _core_.Point_Get(*args, **kwargs)
1058
1059 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1060 def __str__(self): return str(self.Get())
1061 def __repr__(self): return 'wx.Point'+str(self.Get())
1062 def __len__(self): return len(self.Get())
1063 def __getitem__(self, index): return self.Get()[index]
1064 def __setitem__(self, index, val):
1065 if index == 0: self.x = val
1066 elif index == 1: self.y = val
1067 else: raise IndexError
1068 def __nonzero__(self): return self.Get() != (0,0)
1069 __safe_for_unpickling__ = True
1070 def __reduce__(self): return (wx.Point, self.Get())
1071
1072
1073 class PointPtr(Point):
1074 def __init__(self, this):
1075 self.this = this
1076 if not hasattr(self,"thisown"): self.thisown = 0
1077 self.__class__ = Point
1078 _core_.Point_swigregister(PointPtr)
1079
1080 #---------------------------------------------------------------------------
1081
1082 class Rect(object):
1083 """
1084 A class for representing and manipulating rectangles. It has x, y,
1085 width and height properties. In wxPython most palces that expect a
1086 wx.Rect can also accept a (x,y,width,height) tuple.
1087 """
1088 def __repr__(self):
1089 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1090 def __init__(self, *args, **kwargs):
1091 """
1092 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1093
1094 Create a new Rect object.
1095 """
1096 newobj = _core_.new_Rect(*args, **kwargs)
1097 self.this = newobj.this
1098 self.thisown = 1
1099 del newobj.thisown
1100 def __del__(self, destroy=_core_.delete_Rect):
1101 """__del__(self)"""
1102 try:
1103 if self.thisown: destroy(self)
1104 except: pass
1105
1106 def GetX(*args, **kwargs):
1107 """GetX(self) -> int"""
1108 return _core_.Rect_GetX(*args, **kwargs)
1109
1110 def SetX(*args, **kwargs):
1111 """SetX(self, int x)"""
1112 return _core_.Rect_SetX(*args, **kwargs)
1113
1114 def GetY(*args, **kwargs):
1115 """GetY(self) -> int"""
1116 return _core_.Rect_GetY(*args, **kwargs)
1117
1118 def SetY(*args, **kwargs):
1119 """SetY(self, int y)"""
1120 return _core_.Rect_SetY(*args, **kwargs)
1121
1122 def GetWidth(*args, **kwargs):
1123 """GetWidth(self) -> int"""
1124 return _core_.Rect_GetWidth(*args, **kwargs)
1125
1126 def SetWidth(*args, **kwargs):
1127 """SetWidth(self, int w)"""
1128 return _core_.Rect_SetWidth(*args, **kwargs)
1129
1130 def GetHeight(*args, **kwargs):
1131 """GetHeight(self) -> int"""
1132 return _core_.Rect_GetHeight(*args, **kwargs)
1133
1134 def SetHeight(*args, **kwargs):
1135 """SetHeight(self, int h)"""
1136 return _core_.Rect_SetHeight(*args, **kwargs)
1137
1138 def GetPosition(*args, **kwargs):
1139 """GetPosition(self) -> Point"""
1140 return _core_.Rect_GetPosition(*args, **kwargs)
1141
1142 def SetPosition(*args, **kwargs):
1143 """SetPosition(self, Point p)"""
1144 return _core_.Rect_SetPosition(*args, **kwargs)
1145
1146 def GetSize(*args, **kwargs):
1147 """GetSize(self) -> Size"""
1148 return _core_.Rect_GetSize(*args, **kwargs)
1149
1150 def SetSize(*args, **kwargs):
1151 """SetSize(self, Size s)"""
1152 return _core_.Rect_SetSize(*args, **kwargs)
1153
1154 def IsEmpty(*args, **kwargs):
1155 """IsEmpty(self) -> bool"""
1156 return _core_.Rect_IsEmpty(*args, **kwargs)
1157
1158 def GetTopLeft(*args, **kwargs):
1159 """GetTopLeft(self) -> Point"""
1160 return _core_.Rect_GetTopLeft(*args, **kwargs)
1161
1162 def SetTopLeft(*args, **kwargs):
1163 """SetTopLeft(self, Point p)"""
1164 return _core_.Rect_SetTopLeft(*args, **kwargs)
1165
1166 def GetBottomRight(*args, **kwargs):
1167 """GetBottomRight(self) -> Point"""
1168 return _core_.Rect_GetBottomRight(*args, **kwargs)
1169
1170 def SetBottomRight(*args, **kwargs):
1171 """SetBottomRight(self, Point p)"""
1172 return _core_.Rect_SetBottomRight(*args, **kwargs)
1173
1174 def GetLeft(*args, **kwargs):
1175 """GetLeft(self) -> int"""
1176 return _core_.Rect_GetLeft(*args, **kwargs)
1177
1178 def GetTop(*args, **kwargs):
1179 """GetTop(self) -> int"""
1180 return _core_.Rect_GetTop(*args, **kwargs)
1181
1182 def GetBottom(*args, **kwargs):
1183 """GetBottom(self) -> int"""
1184 return _core_.Rect_GetBottom(*args, **kwargs)
1185
1186 def GetRight(*args, **kwargs):
1187 """GetRight(self) -> int"""
1188 return _core_.Rect_GetRight(*args, **kwargs)
1189
1190 def SetLeft(*args, **kwargs):
1191 """SetLeft(self, int left)"""
1192 return _core_.Rect_SetLeft(*args, **kwargs)
1193
1194 def SetRight(*args, **kwargs):
1195 """SetRight(self, int right)"""
1196 return _core_.Rect_SetRight(*args, **kwargs)
1197
1198 def SetTop(*args, **kwargs):
1199 """SetTop(self, int top)"""
1200 return _core_.Rect_SetTop(*args, **kwargs)
1201
1202 def SetBottom(*args, **kwargs):
1203 """SetBottom(self, int bottom)"""
1204 return _core_.Rect_SetBottom(*args, **kwargs)
1205
1206 position = property(GetPosition, SetPosition)
1207 size = property(GetSize, SetSize)
1208 left = property(GetLeft, SetLeft)
1209 right = property(GetRight, SetRight)
1210 top = property(GetTop, SetTop)
1211 bottom = property(GetBottom, SetBottom)
1212
1213 def Inflate(*args, **kwargs):
1214 """
1215 Inflate(self, int dx, int dy) -> Rect
1216
1217 Increases the size of the rectangle.
1218
1219 The left border is moved farther left and the right border is moved
1220 farther right by ``dx``. The upper border is moved farther up and the
1221 bottom border is moved farther down by ``dy``. (Note the the width and
1222 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1223 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1224 opposite happens: the rectangle size decreases in the respective
1225 direction.
1226
1227 The change is made to the rectangle inplace, if instead you need a
1228 copy that is inflated, preserving the original then make the copy
1229 first::
1230
1231 copy = wx.Rect(*original)
1232 copy.Inflate(10,15)
1233
1234
1235 """
1236 return _core_.Rect_Inflate(*args, **kwargs)
1237
1238 def Deflate(*args, **kwargs):
1239 """
1240 Deflate(self, int dx, int dy) -> Rect
1241
1242 Decrease the rectangle size. This method is the opposite of `Inflate`
1243 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1244 `Inflate` for a full description.
1245 """
1246 return _core_.Rect_Deflate(*args, **kwargs)
1247
1248 def OffsetXY(*args, **kwargs):
1249 """
1250 OffsetXY(self, int dx, int dy)
1251
1252 Moves the rectangle by the specified offset. If dx is positive, the
1253 rectangle is moved to the right, if dy is positive, it is moved to the
1254 bottom, otherwise it is moved to the left or top respectively.
1255 """
1256 return _core_.Rect_OffsetXY(*args, **kwargs)
1257
1258 def Offset(*args, **kwargs):
1259 """
1260 Offset(self, Point pt)
1261
1262 Same as OffsetXY but uses dx,dy from Point
1263 """
1264 return _core_.Rect_Offset(*args, **kwargs)
1265
1266 def Intersect(*args, **kwargs):
1267 """
1268 Intersect(self, Rect rect) -> Rect
1269
1270 Returns the intersectsion of this rectangle and rect.
1271 """
1272 return _core_.Rect_Intersect(*args, **kwargs)
1273
1274 def Union(*args, **kwargs):
1275 """
1276 Union(self, Rect rect) -> Rect
1277
1278 Returns the union of this rectangle and rect.
1279 """
1280 return _core_.Rect_Union(*args, **kwargs)
1281
1282 def __add__(*args, **kwargs):
1283 """
1284 __add__(self, Rect rect) -> Rect
1285
1286 Add the properties of rect to this rectangle and return the result.
1287 """
1288 return _core_.Rect___add__(*args, **kwargs)
1289
1290 def __iadd__(*args, **kwargs):
1291 """
1292 __iadd__(self, Rect rect) -> Rect
1293
1294 Add the properties of rect to this rectangle, updating this rectangle.
1295 """
1296 return _core_.Rect___iadd__(*args, **kwargs)
1297
1298 def __eq__(*args, **kwargs):
1299 """
1300 __eq__(self, Rect rect) -> bool
1301
1302 Test for equality.
1303 """
1304 return _core_.Rect___eq__(*args, **kwargs)
1305
1306 def __ne__(*args, **kwargs):
1307 """
1308 __ne__(self, Rect rect) -> bool
1309
1310 Test for inequality.
1311 """
1312 return _core_.Rect___ne__(*args, **kwargs)
1313
1314 def InsideXY(*args, **kwargs):
1315 """
1316 InsideXY(self, int x, int y) -> bool
1317
1318 Return True if the point is (not strcitly) inside the rect.
1319 """
1320 return _core_.Rect_InsideXY(*args, **kwargs)
1321
1322 def Inside(*args, **kwargs):
1323 """
1324 Inside(self, Point pt) -> bool
1325
1326 Return True if the point is (not strcitly) inside the rect.
1327 """
1328 return _core_.Rect_Inside(*args, **kwargs)
1329
1330 def Intersects(*args, **kwargs):
1331 """
1332 Intersects(self, Rect rect) -> bool
1333
1334 Returns True if the rectangles have a non empty intersection.
1335 """
1336 return _core_.Rect_Intersects(*args, **kwargs)
1337
1338 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1339 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1340 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1341 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1342 def Set(*args, **kwargs):
1343 """
1344 Set(self, int x=0, int y=0, int width=0, int height=0)
1345
1346 Set all rectangle properties.
1347 """
1348 return _core_.Rect_Set(*args, **kwargs)
1349
1350 def Get(*args, **kwargs):
1351 """
1352 Get() -> (x,y,width,height)
1353
1354 Return the rectangle properties as a tuple.
1355 """
1356 return _core_.Rect_Get(*args, **kwargs)
1357
1358 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1359 def __str__(self): return str(self.Get())
1360 def __repr__(self): return 'wx.Rect'+str(self.Get())
1361 def __len__(self): return len(self.Get())
1362 def __getitem__(self, index): return self.Get()[index]
1363 def __setitem__(self, index, val):
1364 if index == 0: self.x = val
1365 elif index == 1: self.y = val
1366 elif index == 2: self.width = val
1367 elif index == 3: self.height = val
1368 else: raise IndexError
1369 def __nonzero__(self): return self.Get() != (0,0,0,0)
1370 __safe_for_unpickling__ = True
1371 def __reduce__(self): return (wx.Rect, self.Get())
1372
1373
1374 class RectPtr(Rect):
1375 def __init__(self, this):
1376 self.this = this
1377 if not hasattr(self,"thisown"): self.thisown = 0
1378 self.__class__ = Rect
1379 _core_.Rect_swigregister(RectPtr)
1380
1381 def RectPP(*args, **kwargs):
1382 """
1383 RectPP(Point topLeft, Point bottomRight) -> Rect
1384
1385 Create a new Rect object from Points representing two corners.
1386 """
1387 val = _core_.new_RectPP(*args, **kwargs)
1388 val.thisown = 1
1389 return val
1390
1391 def RectPS(*args, **kwargs):
1392 """
1393 RectPS(Point pos, Size size) -> Rect
1394
1395 Create a new Rect from a position and size.
1396 """
1397 val = _core_.new_RectPS(*args, **kwargs)
1398 val.thisown = 1
1399 return val
1400
1401 def RectS(*args, **kwargs):
1402 """
1403 RectS(Size size) -> Rect
1404
1405 Create a new Rect from a size only.
1406 """
1407 val = _core_.new_RectS(*args, **kwargs)
1408 val.thisown = 1
1409 return val
1410
1411
1412 def IntersectRect(*args, **kwargs):
1413 """
1414 IntersectRect(Rect r1, Rect r2) -> Rect
1415
1416 Calculate and return the intersection of r1 and r2.
1417 """
1418 return _core_.IntersectRect(*args, **kwargs)
1419 #---------------------------------------------------------------------------
1420
1421 class Point2D(object):
1422 """
1423 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1424 with floating point values.
1425 """
1426 def __repr__(self):
1427 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1428 def __init__(self, *args, **kwargs):
1429 """
1430 __init__(self, double x=0.0, double y=0.0) -> Point2D
1431
1432 Create a w.Point2D object.
1433 """
1434 newobj = _core_.new_Point2D(*args, **kwargs)
1435 self.this = newobj.this
1436 self.thisown = 1
1437 del newobj.thisown
1438 def GetFloor(*args, **kwargs):
1439 """
1440 GetFloor() -> (x,y)
1441
1442 Convert to integer
1443 """
1444 return _core_.Point2D_GetFloor(*args, **kwargs)
1445
1446 def GetRounded(*args, **kwargs):
1447 """
1448 GetRounded() -> (x,y)
1449
1450 Convert to integer
1451 """
1452 return _core_.Point2D_GetRounded(*args, **kwargs)
1453
1454 def GetVectorLength(*args, **kwargs):
1455 """GetVectorLength(self) -> double"""
1456 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1457
1458 def GetVectorAngle(*args, **kwargs):
1459 """GetVectorAngle(self) -> double"""
1460 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1461
1462 def SetVectorLength(*args, **kwargs):
1463 """SetVectorLength(self, double length)"""
1464 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1465
1466 def SetVectorAngle(*args, **kwargs):
1467 """SetVectorAngle(self, double degrees)"""
1468 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1469
1470 def SetPolarCoordinates(self, angle, length):
1471 self.SetVectorLength(length)
1472 self.SetVectorAngle(angle)
1473 def Normalize(self):
1474 self.SetVectorLength(1.0)
1475
1476 def GetDistance(*args, **kwargs):
1477 """GetDistance(self, Point2D pt) -> double"""
1478 return _core_.Point2D_GetDistance(*args, **kwargs)
1479
1480 def GetDistanceSquare(*args, **kwargs):
1481 """GetDistanceSquare(self, Point2D pt) -> double"""
1482 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1483
1484 def GetDotProduct(*args, **kwargs):
1485 """GetDotProduct(self, Point2D vec) -> double"""
1486 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1487
1488 def GetCrossProduct(*args, **kwargs):
1489 """GetCrossProduct(self, Point2D vec) -> double"""
1490 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1491
1492 def __neg__(*args, **kwargs):
1493 """
1494 __neg__(self) -> Point2D
1495
1496 the reflection of this point
1497 """
1498 return _core_.Point2D___neg__(*args, **kwargs)
1499
1500 def __iadd__(*args, **kwargs):
1501 """__iadd__(self, Point2D pt) -> Point2D"""
1502 return _core_.Point2D___iadd__(*args, **kwargs)
1503
1504 def __isub__(*args, **kwargs):
1505 """__isub__(self, Point2D pt) -> Point2D"""
1506 return _core_.Point2D___isub__(*args, **kwargs)
1507
1508 def __imul__(*args, **kwargs):
1509 """__imul__(self, Point2D pt) -> Point2D"""
1510 return _core_.Point2D___imul__(*args, **kwargs)
1511
1512 def __idiv__(*args, **kwargs):
1513 """__idiv__(self, Point2D pt) -> Point2D"""
1514 return _core_.Point2D___idiv__(*args, **kwargs)
1515
1516 def __eq__(*args, **kwargs):
1517 """
1518 __eq__(self, Point2D pt) -> bool
1519
1520 Test for equality
1521 """
1522 return _core_.Point2D___eq__(*args, **kwargs)
1523
1524 def __ne__(*args, **kwargs):
1525 """
1526 __ne__(self, Point2D pt) -> bool
1527
1528 Test for inequality
1529 """
1530 return _core_.Point2D___ne__(*args, **kwargs)
1531
1532 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1533 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1534 def Set(*args, **kwargs):
1535 """Set(self, double x=0, double y=0)"""
1536 return _core_.Point2D_Set(*args, **kwargs)
1537
1538 def Get(*args, **kwargs):
1539 """
1540 Get() -> (x,y)
1541
1542 Return x and y properties as a tuple.
1543 """
1544 return _core_.Point2D_Get(*args, **kwargs)
1545
1546 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1547 def __str__(self): return str(self.Get())
1548 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1549 def __len__(self): return len(self.Get())
1550 def __getitem__(self, index): return self.Get()[index]
1551 def __setitem__(self, index, val):
1552 if index == 0: self.x = val
1553 elif index == 1: self.y = val
1554 else: raise IndexError
1555 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1556 __safe_for_unpickling__ = True
1557 def __reduce__(self): return (wx.Point2D, self.Get())
1558
1559
1560 class Point2DPtr(Point2D):
1561 def __init__(self, this):
1562 self.this = this
1563 if not hasattr(self,"thisown"): self.thisown = 0
1564 self.__class__ = Point2D
1565 _core_.Point2D_swigregister(Point2DPtr)
1566
1567 def Point2DCopy(*args, **kwargs):
1568 """
1569 Point2DCopy(Point2D pt) -> Point2D
1570
1571 Create a w.Point2D object.
1572 """
1573 val = _core_.new_Point2DCopy(*args, **kwargs)
1574 val.thisown = 1
1575 return val
1576
1577 def Point2DFromPoint(*args, **kwargs):
1578 """
1579 Point2DFromPoint(Point pt) -> Point2D
1580
1581 Create a w.Point2D object.
1582 """
1583 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1584 val.thisown = 1
1585 return val
1586
1587 #---------------------------------------------------------------------------
1588
1589 FromStart = _core_.FromStart
1590 FromCurrent = _core_.FromCurrent
1591 FromEnd = _core_.FromEnd
1592 class InputStream(object):
1593 """Proxy of C++ InputStream class"""
1594 def __repr__(self):
1595 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1596 def __init__(self, *args, **kwargs):
1597 """__init__(self, PyObject p) -> InputStream"""
1598 newobj = _core_.new_InputStream(*args, **kwargs)
1599 self.this = newobj.this
1600 self.thisown = 1
1601 del newobj.thisown
1602 def __del__(self, destroy=_core_.delete_InputStream):
1603 """__del__(self)"""
1604 try:
1605 if self.thisown: destroy(self)
1606 except: pass
1607
1608 def close(*args, **kwargs):
1609 """close(self)"""
1610 return _core_.InputStream_close(*args, **kwargs)
1611
1612 def flush(*args, **kwargs):
1613 """flush(self)"""
1614 return _core_.InputStream_flush(*args, **kwargs)
1615
1616 def eof(*args, **kwargs):
1617 """eof(self) -> bool"""
1618 return _core_.InputStream_eof(*args, **kwargs)
1619
1620 def read(*args, **kwargs):
1621 """read(self, int size=-1) -> PyObject"""
1622 return _core_.InputStream_read(*args, **kwargs)
1623
1624 def readline(*args, **kwargs):
1625 """readline(self, int size=-1) -> PyObject"""
1626 return _core_.InputStream_readline(*args, **kwargs)
1627
1628 def readlines(*args, **kwargs):
1629 """readlines(self, int sizehint=-1) -> PyObject"""
1630 return _core_.InputStream_readlines(*args, **kwargs)
1631
1632 def seek(*args, **kwargs):
1633 """seek(self, int offset, int whence=0)"""
1634 return _core_.InputStream_seek(*args, **kwargs)
1635
1636 def tell(*args, **kwargs):
1637 """tell(self) -> int"""
1638 return _core_.InputStream_tell(*args, **kwargs)
1639
1640 def Peek(*args, **kwargs):
1641 """Peek(self) -> char"""
1642 return _core_.InputStream_Peek(*args, **kwargs)
1643
1644 def GetC(*args, **kwargs):
1645 """GetC(self) -> char"""
1646 return _core_.InputStream_GetC(*args, **kwargs)
1647
1648 def LastRead(*args, **kwargs):
1649 """LastRead(self) -> size_t"""
1650 return _core_.InputStream_LastRead(*args, **kwargs)
1651
1652 def CanRead(*args, **kwargs):
1653 """CanRead(self) -> bool"""
1654 return _core_.InputStream_CanRead(*args, **kwargs)
1655
1656 def Eof(*args, **kwargs):
1657 """Eof(self) -> bool"""
1658 return _core_.InputStream_Eof(*args, **kwargs)
1659
1660 def Ungetch(*args, **kwargs):
1661 """Ungetch(self, char c) -> bool"""
1662 return _core_.InputStream_Ungetch(*args, **kwargs)
1663
1664 def SeekI(*args, **kwargs):
1665 """SeekI(self, long pos, int mode=FromStart) -> long"""
1666 return _core_.InputStream_SeekI(*args, **kwargs)
1667
1668 def TellI(*args, **kwargs):
1669 """TellI(self) -> long"""
1670 return _core_.InputStream_TellI(*args, **kwargs)
1671
1672
1673 class InputStreamPtr(InputStream):
1674 def __init__(self, this):
1675 self.this = this
1676 if not hasattr(self,"thisown"): self.thisown = 0
1677 self.__class__ = InputStream
1678 _core_.InputStream_swigregister(InputStreamPtr)
1679 DefaultPosition = cvar.DefaultPosition
1680 DefaultSize = cvar.DefaultSize
1681
1682 class OutputStream(object):
1683 """Proxy of C++ OutputStream class"""
1684 def __init__(self): raise RuntimeError, "No constructor defined"
1685 def __repr__(self):
1686 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1687 def write(*args, **kwargs):
1688 """write(self, PyObject obj)"""
1689 return _core_.OutputStream_write(*args, **kwargs)
1690
1691
1692 class OutputStreamPtr(OutputStream):
1693 def __init__(self, this):
1694 self.this = this
1695 if not hasattr(self,"thisown"): self.thisown = 0
1696 self.__class__ = OutputStream
1697 _core_.OutputStream_swigregister(OutputStreamPtr)
1698
1699 #---------------------------------------------------------------------------
1700
1701 class FSFile(Object):
1702 """Proxy of C++ FSFile class"""
1703 def __repr__(self):
1704 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1705 def __init__(self, *args, **kwargs):
1706 """
1707 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1708 DateTime modif) -> FSFile
1709 """
1710 newobj = _core_.new_FSFile(*args, **kwargs)
1711 self.this = newobj.this
1712 self.thisown = 1
1713 del newobj.thisown
1714 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
1715
1716 def __del__(self, destroy=_core_.delete_FSFile):
1717 """__del__(self)"""
1718 try:
1719 if self.thisown: destroy(self)
1720 except: pass
1721
1722 def GetStream(*args, **kwargs):
1723 """GetStream(self) -> InputStream"""
1724 return _core_.FSFile_GetStream(*args, **kwargs)
1725
1726 def GetMimeType(*args, **kwargs):
1727 """GetMimeType(self) -> String"""
1728 return _core_.FSFile_GetMimeType(*args, **kwargs)
1729
1730 def GetLocation(*args, **kwargs):
1731 """GetLocation(self) -> String"""
1732 return _core_.FSFile_GetLocation(*args, **kwargs)
1733
1734 def GetAnchor(*args, **kwargs):
1735 """GetAnchor(self) -> String"""
1736 return _core_.FSFile_GetAnchor(*args, **kwargs)
1737
1738 def GetModificationTime(*args, **kwargs):
1739 """GetModificationTime(self) -> DateTime"""
1740 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1741
1742
1743 class FSFilePtr(FSFile):
1744 def __init__(self, this):
1745 self.this = this
1746 if not hasattr(self,"thisown"): self.thisown = 0
1747 self.__class__ = FSFile
1748 _core_.FSFile_swigregister(FSFilePtr)
1749
1750 class CPPFileSystemHandler(object):
1751 """Proxy of C++ CPPFileSystemHandler class"""
1752 def __init__(self): raise RuntimeError, "No constructor defined"
1753 def __repr__(self):
1754 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1755
1756 class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1757 def __init__(self, this):
1758 self.this = this
1759 if not hasattr(self,"thisown"): self.thisown = 0
1760 self.__class__ = CPPFileSystemHandler
1761 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1762
1763 class FileSystemHandler(CPPFileSystemHandler):
1764 """Proxy of C++ FileSystemHandler class"""
1765 def __repr__(self):
1766 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1767 def __init__(self, *args, **kwargs):
1768 """__init__(self) -> FileSystemHandler"""
1769 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1770 self.this = newobj.this
1771 self.thisown = 1
1772 del newobj.thisown
1773 self._setCallbackInfo(self, FileSystemHandler)
1774
1775 def _setCallbackInfo(*args, **kwargs):
1776 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1777 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1778
1779 def CanOpen(*args, **kwargs):
1780 """CanOpen(self, String location) -> bool"""
1781 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1782
1783 def OpenFile(*args, **kwargs):
1784 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1785 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1786
1787 def FindFirst(*args, **kwargs):
1788 """FindFirst(self, String spec, int flags=0) -> String"""
1789 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1790
1791 def FindNext(*args, **kwargs):
1792 """FindNext(self) -> String"""
1793 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1794
1795 def GetProtocol(*args, **kwargs):
1796 """GetProtocol(self, String location) -> String"""
1797 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1798
1799 def GetLeftLocation(*args, **kwargs):
1800 """GetLeftLocation(self, String location) -> String"""
1801 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1802
1803 def GetAnchor(*args, **kwargs):
1804 """GetAnchor(self, String location) -> String"""
1805 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1806
1807 def GetRightLocation(*args, **kwargs):
1808 """GetRightLocation(self, String location) -> String"""
1809 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1810
1811 def GetMimeTypeFromExt(*args, **kwargs):
1812 """GetMimeTypeFromExt(self, String location) -> String"""
1813 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1814
1815
1816 class FileSystemHandlerPtr(FileSystemHandler):
1817 def __init__(self, this):
1818 self.this = this
1819 if not hasattr(self,"thisown"): self.thisown = 0
1820 self.__class__ = FileSystemHandler
1821 _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1822
1823 class FileSystem(Object):
1824 """Proxy of C++ FileSystem class"""
1825 def __repr__(self):
1826 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1827 def __init__(self, *args, **kwargs):
1828 """__init__(self) -> FileSystem"""
1829 newobj = _core_.new_FileSystem(*args, **kwargs)
1830 self.this = newobj.this
1831 self.thisown = 1
1832 del newobj.thisown
1833 def __del__(self, destroy=_core_.delete_FileSystem):
1834 """__del__(self)"""
1835 try:
1836 if self.thisown: destroy(self)
1837 except: pass
1838
1839 def ChangePathTo(*args, **kwargs):
1840 """ChangePathTo(self, String location, bool is_dir=False)"""
1841 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1842
1843 def GetPath(*args, **kwargs):
1844 """GetPath(self) -> String"""
1845 return _core_.FileSystem_GetPath(*args, **kwargs)
1846
1847 def OpenFile(*args, **kwargs):
1848 """OpenFile(self, String location) -> FSFile"""
1849 return _core_.FileSystem_OpenFile(*args, **kwargs)
1850
1851 def FindFirst(*args, **kwargs):
1852 """FindFirst(self, String spec, int flags=0) -> String"""
1853 return _core_.FileSystem_FindFirst(*args, **kwargs)
1854
1855 def FindNext(*args, **kwargs):
1856 """FindNext(self) -> String"""
1857 return _core_.FileSystem_FindNext(*args, **kwargs)
1858
1859 def AddHandler(*args, **kwargs):
1860 """AddHandler(CPPFileSystemHandler handler)"""
1861 return _core_.FileSystem_AddHandler(*args, **kwargs)
1862
1863 AddHandler = staticmethod(AddHandler)
1864 def CleanUpHandlers(*args, **kwargs):
1865 """CleanUpHandlers()"""
1866 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1867
1868 CleanUpHandlers = staticmethod(CleanUpHandlers)
1869 def FileNameToURL(*args, **kwargs):
1870 """FileNameToURL(String filename) -> String"""
1871 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1872
1873 FileNameToURL = staticmethod(FileNameToURL)
1874 def URLToFileName(*args, **kwargs):
1875 """URLToFileName(String url) -> String"""
1876 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1877
1878 URLToFileName = staticmethod(URLToFileName)
1879
1880 class FileSystemPtr(FileSystem):
1881 def __init__(self, this):
1882 self.this = this
1883 if not hasattr(self,"thisown"): self.thisown = 0
1884 self.__class__ = FileSystem
1885 _core_.FileSystem_swigregister(FileSystemPtr)
1886
1887 def FileSystem_AddHandler(*args, **kwargs):
1888 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1889 return _core_.FileSystem_AddHandler(*args, **kwargs)
1890
1891 def FileSystem_CleanUpHandlers(*args, **kwargs):
1892 """FileSystem_CleanUpHandlers()"""
1893 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1894
1895 def FileSystem_FileNameToURL(*args, **kwargs):
1896 """FileSystem_FileNameToURL(String filename) -> String"""
1897 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1898
1899 def FileSystem_URLToFileName(*args, **kwargs):
1900 """FileSystem_URLToFileName(String url) -> String"""
1901 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1902
1903 class InternetFSHandler(CPPFileSystemHandler):
1904 """Proxy of C++ InternetFSHandler class"""
1905 def __repr__(self):
1906 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1907 def __init__(self, *args, **kwargs):
1908 """__init__(self) -> InternetFSHandler"""
1909 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1910 self.this = newobj.this
1911 self.thisown = 1
1912 del newobj.thisown
1913 def CanOpen(*args, **kwargs):
1914 """CanOpen(self, String location) -> bool"""
1915 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1916
1917 def OpenFile(*args, **kwargs):
1918 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1919 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1920
1921
1922 class InternetFSHandlerPtr(InternetFSHandler):
1923 def __init__(self, this):
1924 self.this = this
1925 if not hasattr(self,"thisown"): self.thisown = 0
1926 self.__class__ = InternetFSHandler
1927 _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1928
1929 class ZipFSHandler(CPPFileSystemHandler):
1930 """Proxy of C++ ZipFSHandler class"""
1931 def __repr__(self):
1932 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1933 def __init__(self, *args, **kwargs):
1934 """__init__(self) -> ZipFSHandler"""
1935 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1936 self.this = newobj.this
1937 self.thisown = 1
1938 del newobj.thisown
1939 def CanOpen(*args, **kwargs):
1940 """CanOpen(self, String location) -> bool"""
1941 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1942
1943 def OpenFile(*args, **kwargs):
1944 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1945 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1946
1947 def FindFirst(*args, **kwargs):
1948 """FindFirst(self, String spec, int flags=0) -> String"""
1949 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1950
1951 def FindNext(*args, **kwargs):
1952 """FindNext(self) -> String"""
1953 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1954
1955
1956 class ZipFSHandlerPtr(ZipFSHandler):
1957 def __init__(self, this):
1958 self.this = this
1959 if not hasattr(self,"thisown"): self.thisown = 0
1960 self.__class__ = ZipFSHandler
1961 _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
1962
1963
1964 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1965 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1966 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1967
1968 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1969 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1970 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1971
1972 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1973 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1974 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1975 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1976 """
1977 Add 'file' to the memory filesystem. The dataItem parameter can
1978 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1979 arbitrary data. If a bitmap or image is used then the imgType
1980 parameter should specify what kind of image file it should be
1981 written as, wx.BITMAP_TYPE_PNG, etc.
1982 """
1983 if isinstance(dataItem, wx.Image):
1984 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1985 elif isinstance(dataItem, wx.Bitmap):
1986 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1987 elif type(dataItem) == str:
1988 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1989 else:
1990 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1991
1992 class MemoryFSHandler(CPPFileSystemHandler):
1993 """Proxy of C++ MemoryFSHandler class"""
1994 def __repr__(self):
1995 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1996 def __init__(self, *args, **kwargs):
1997 """__init__(self) -> MemoryFSHandler"""
1998 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
1999 self.this = newobj.this
2000 self.thisown = 1
2001 del newobj.thisown
2002 def RemoveFile(*args, **kwargs):
2003 """RemoveFile(String filename)"""
2004 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2005
2006 RemoveFile = staticmethod(RemoveFile)
2007 AddFile = staticmethod(MemoryFSHandler_AddFile)
2008 def CanOpen(*args, **kwargs):
2009 """CanOpen(self, String location) -> bool"""
2010 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2011
2012 def OpenFile(*args, **kwargs):
2013 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2014 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2015
2016 def FindFirst(*args, **kwargs):
2017 """FindFirst(self, String spec, int flags=0) -> String"""
2018 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2019
2020 def FindNext(*args, **kwargs):
2021 """FindNext(self) -> String"""
2022 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2023
2024
2025 class MemoryFSHandlerPtr(MemoryFSHandler):
2026 def __init__(self, this):
2027 self.this = this
2028 if not hasattr(self,"thisown"): self.thisown = 0
2029 self.__class__ = MemoryFSHandler
2030 _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
2031
2032 def MemoryFSHandler_RemoveFile(*args, **kwargs):
2033 """MemoryFSHandler_RemoveFile(String filename)"""
2034 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2035
2036 #---------------------------------------------------------------------------
2037
2038 class ImageHandler(Object):
2039 """Proxy of C++ ImageHandler class"""
2040 def __init__(self): raise RuntimeError, "No constructor defined"
2041 def __repr__(self):
2042 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2043 def GetName(*args, **kwargs):
2044 """GetName(self) -> String"""
2045 return _core_.ImageHandler_GetName(*args, **kwargs)
2046
2047 def GetExtension(*args, **kwargs):
2048 """GetExtension(self) -> String"""
2049 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2050
2051 def GetType(*args, **kwargs):
2052 """GetType(self) -> long"""
2053 return _core_.ImageHandler_GetType(*args, **kwargs)
2054
2055 def GetMimeType(*args, **kwargs):
2056 """GetMimeType(self) -> String"""
2057 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2058
2059 def CanRead(*args, **kwargs):
2060 """CanRead(self, String name) -> bool"""
2061 return _core_.ImageHandler_CanRead(*args, **kwargs)
2062
2063 def SetName(*args, **kwargs):
2064 """SetName(self, String name)"""
2065 return _core_.ImageHandler_SetName(*args, **kwargs)
2066
2067 def SetExtension(*args, **kwargs):
2068 """SetExtension(self, String extension)"""
2069 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2070
2071 def SetType(*args, **kwargs):
2072 """SetType(self, long type)"""
2073 return _core_.ImageHandler_SetType(*args, **kwargs)
2074
2075 def SetMimeType(*args, **kwargs):
2076 """SetMimeType(self, String mimetype)"""
2077 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2078
2079
2080 class ImageHandlerPtr(ImageHandler):
2081 def __init__(self, this):
2082 self.this = this
2083 if not hasattr(self,"thisown"): self.thisown = 0
2084 self.__class__ = ImageHandler
2085 _core_.ImageHandler_swigregister(ImageHandlerPtr)
2086
2087 class ImageHistogram(object):
2088 """Proxy of C++ ImageHistogram class"""
2089 def __repr__(self):
2090 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2091 def __init__(self, *args, **kwargs):
2092 """__init__(self) -> ImageHistogram"""
2093 newobj = _core_.new_ImageHistogram(*args, **kwargs)
2094 self.this = newobj.this
2095 self.thisown = 1
2096 del newobj.thisown
2097 def MakeKey(*args, **kwargs):
2098 """
2099 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2100
2101 Get the key in the histogram for the given RGB values
2102 """
2103 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2104
2105 MakeKey = staticmethod(MakeKey)
2106 def FindFirstUnusedColour(*args, **kwargs):
2107 """
2108 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2109
2110 Find first colour that is not used in the image and has higher RGB
2111 values than startR, startG, startB. Returns a tuple consisting of a
2112 success flag and rgb values.
2113 """
2114 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2115
2116
2117 class ImageHistogramPtr(ImageHistogram):
2118 def __init__(self, this):
2119 self.this = this
2120 if not hasattr(self,"thisown"): self.thisown = 0
2121 self.__class__ = ImageHistogram
2122 _core_.ImageHistogram_swigregister(ImageHistogramPtr)
2123
2124 def ImageHistogram_MakeKey(*args, **kwargs):
2125 """
2126 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2127
2128 Get the key in the histogram for the given RGB values
2129 """
2130 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2131
2132 class Image(Object):
2133 """Proxy of C++ Image class"""
2134 def __repr__(self):
2135 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2136 def __init__(self, *args, **kwargs):
2137 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2138 newobj = _core_.new_Image(*args, **kwargs)
2139 self.this = newobj.this
2140 self.thisown = 1
2141 del newobj.thisown
2142 def __del__(self, destroy=_core_.delete_Image):
2143 """__del__(self)"""
2144 try:
2145 if self.thisown: destroy(self)
2146 except: pass
2147
2148 def Create(*args, **kwargs):
2149 """Create(self, int width, int height)"""
2150 return _core_.Image_Create(*args, **kwargs)
2151
2152 def Destroy(*args, **kwargs):
2153 """
2154 Destroy(self)
2155
2156 Deletes the C++ object this Python object is a proxy for.
2157 """
2158 return _core_.Image_Destroy(*args, **kwargs)
2159
2160 def Scale(*args, **kwargs):
2161 """Scale(self, int width, int height) -> Image"""
2162 return _core_.Image_Scale(*args, **kwargs)
2163
2164 def ShrinkBy(*args, **kwargs):
2165 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
2166 return _core_.Image_ShrinkBy(*args, **kwargs)
2167
2168 def Rescale(*args, **kwargs):
2169 """Rescale(self, int width, int height) -> Image"""
2170 return _core_.Image_Rescale(*args, **kwargs)
2171
2172 def Resize(*args, **kwargs):
2173 """Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image"""
2174 return _core_.Image_Resize(*args, **kwargs)
2175
2176 def SetRGB(*args, **kwargs):
2177 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
2178 return _core_.Image_SetRGB(*args, **kwargs)
2179
2180 def SetRGBRect(*args, **kwargs):
2181 """SetRGBRect(self, Rect rect, unsigned char r, unsigned char g, unsigned char b)"""
2182 return _core_.Image_SetRGBRect(*args, **kwargs)
2183
2184 def GetRed(*args, **kwargs):
2185 """GetRed(self, int x, int y) -> unsigned char"""
2186 return _core_.Image_GetRed(*args, **kwargs)
2187
2188 def GetGreen(*args, **kwargs):
2189 """GetGreen(self, int x, int y) -> unsigned char"""
2190 return _core_.Image_GetGreen(*args, **kwargs)
2191
2192 def GetBlue(*args, **kwargs):
2193 """GetBlue(self, int x, int y) -> unsigned char"""
2194 return _core_.Image_GetBlue(*args, **kwargs)
2195
2196 def SetAlpha(*args, **kwargs):
2197 """SetAlpha(self, int x, int y, unsigned char alpha)"""
2198 return _core_.Image_SetAlpha(*args, **kwargs)
2199
2200 def GetAlpha(*args, **kwargs):
2201 """GetAlpha(self, int x, int y) -> unsigned char"""
2202 return _core_.Image_GetAlpha(*args, **kwargs)
2203
2204 def HasAlpha(*args, **kwargs):
2205 """HasAlpha(self) -> bool"""
2206 return _core_.Image_HasAlpha(*args, **kwargs)
2207
2208 def InitAlpha(*args, **kwargs):
2209 """
2210 InitAlpha(self)
2211
2212 Initializes the image alpha channel data. It is an error to call it if
2213 the image already has alpha data. If it doesn't, alpha data will be by
2214 default initialized to all pixels being fully opaque. But if the image
2215 has a a mask colour, all mask pixels will be completely transparent.
2216 """
2217 return _core_.Image_InitAlpha(*args, **kwargs)
2218
2219 def FindFirstUnusedColour(*args, **kwargs):
2220 """
2221 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2222
2223 Find first colour that is not used in the image and has higher RGB
2224 values than startR, startG, startB. Returns a tuple consisting of a
2225 success flag and rgb values.
2226 """
2227 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2228
2229 def ConvertAlphaToMask(*args, **kwargs):
2230 """
2231 ConvertAlphaToMask(self, byte threshold=128) -> bool
2232
2233 If the image has alpha channel, this method converts it to mask. All pixels
2234 with alpha value less than ``threshold`` are replaced with mask colour and the
2235 alpha channel is removed. Mask colour is chosen automatically using
2236 `FindFirstUnusedColour`.
2237
2238 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2239 nothing.
2240 """
2241 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2242
2243 def ConvertColourToAlpha(*args, **kwargs):
2244 """
2245 ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
2246
2247 This method converts an image where the original alpha information is
2248 only available as a shades of a colour (actually shades of grey)
2249 typically when you draw anti-aliased text into a bitmap. The DC
2250 drawing routines draw grey values on the black background although
2251 they actually mean to draw white with differnt alpha values. This
2252 method reverses it, assuming a black (!) background and white text.
2253 The method will then fill up the whole image with the colour given.
2254 """
2255 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2256
2257 def SetMaskFromImage(*args, **kwargs):
2258 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
2259 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2260
2261 def CanRead(*args, **kwargs):
2262 """CanRead(String name) -> bool"""
2263 return _core_.Image_CanRead(*args, **kwargs)
2264
2265 CanRead = staticmethod(CanRead)
2266 def GetImageCount(*args, **kwargs):
2267 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2268 return _core_.Image_GetImageCount(*args, **kwargs)
2269
2270 GetImageCount = staticmethod(GetImageCount)
2271 def LoadFile(*args, **kwargs):
2272 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2273 return _core_.Image_LoadFile(*args, **kwargs)
2274
2275 def LoadMimeFile(*args, **kwargs):
2276 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
2277 return _core_.Image_LoadMimeFile(*args, **kwargs)
2278
2279 def SaveFile(*args, **kwargs):
2280 """SaveFile(self, String name, int type) -> bool"""
2281 return _core_.Image_SaveFile(*args, **kwargs)
2282
2283 def SaveMimeFile(*args, **kwargs):
2284 """SaveMimeFile(self, String name, String mimetype) -> bool"""
2285 return _core_.Image_SaveMimeFile(*args, **kwargs)
2286
2287 def CanReadStream(*args, **kwargs):
2288 """CanReadStream(InputStream stream) -> bool"""
2289 return _core_.Image_CanReadStream(*args, **kwargs)
2290
2291 CanReadStream = staticmethod(CanReadStream)
2292 def LoadStream(*args, **kwargs):
2293 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2294 return _core_.Image_LoadStream(*args, **kwargs)
2295
2296 def LoadMimeStream(*args, **kwargs):
2297 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
2298 return _core_.Image_LoadMimeStream(*args, **kwargs)
2299
2300 def Ok(*args, **kwargs):
2301 """Ok(self) -> bool"""
2302 return _core_.Image_Ok(*args, **kwargs)
2303
2304 def GetWidth(*args, **kwargs):
2305 """GetWidth(self) -> int"""
2306 return _core_.Image_GetWidth(*args, **kwargs)
2307
2308 def GetHeight(*args, **kwargs):
2309 """GetHeight(self) -> int"""
2310 return _core_.Image_GetHeight(*args, **kwargs)
2311
2312 def GetSize(*args, **kwargs):
2313 """GetSize(self) -> Size"""
2314 return _core_.Image_GetSize(*args, **kwargs)
2315
2316 def GetSubImage(*args, **kwargs):
2317 """GetSubImage(self, Rect rect) -> Image"""
2318 return _core_.Image_GetSubImage(*args, **kwargs)
2319
2320 def Size(*args, **kwargs):
2321 """Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image"""
2322 return _core_.Image_Size(*args, **kwargs)
2323
2324 def Copy(*args, **kwargs):
2325 """Copy(self) -> Image"""
2326 return _core_.Image_Copy(*args, **kwargs)
2327
2328 def Paste(*args, **kwargs):
2329 """Paste(self, Image image, int x, int y)"""
2330 return _core_.Image_Paste(*args, **kwargs)
2331
2332 def GetData(*args, **kwargs):
2333 """GetData(self) -> PyObject"""
2334 return _core_.Image_GetData(*args, **kwargs)
2335
2336 def SetData(*args, **kwargs):
2337 """SetData(self, PyObject data)"""
2338 return _core_.Image_SetData(*args, **kwargs)
2339
2340 def GetDataBuffer(*args, **kwargs):
2341 """GetDataBuffer(self) -> PyObject"""
2342 return _core_.Image_GetDataBuffer(*args, **kwargs)
2343
2344 def SetDataBuffer(*args, **kwargs):
2345 """SetDataBuffer(self, PyObject data)"""
2346 return _core_.Image_SetDataBuffer(*args, **kwargs)
2347
2348 def GetAlphaData(*args, **kwargs):
2349 """GetAlphaData(self) -> PyObject"""
2350 return _core_.Image_GetAlphaData(*args, **kwargs)
2351
2352 def SetAlphaData(*args, **kwargs):
2353 """SetAlphaData(self, PyObject data)"""
2354 return _core_.Image_SetAlphaData(*args, **kwargs)
2355
2356 def GetAlphaBuffer(*args, **kwargs):
2357 """GetAlphaBuffer(self) -> PyObject"""
2358 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2359
2360 def SetAlphaBuffer(*args, **kwargs):
2361 """SetAlphaBuffer(self, PyObject data)"""
2362 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2363
2364 def SetMaskColour(*args, **kwargs):
2365 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
2366 return _core_.Image_SetMaskColour(*args, **kwargs)
2367
2368 def GetOrFindMaskColour(*args, **kwargs):
2369 """
2370 GetOrFindMaskColour() -> (r,g,b)
2371
2372 Get the current mask colour or find a suitable colour.
2373 """
2374 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2375
2376 def GetMaskRed(*args, **kwargs):
2377 """GetMaskRed(self) -> unsigned char"""
2378 return _core_.Image_GetMaskRed(*args, **kwargs)
2379
2380 def GetMaskGreen(*args, **kwargs):
2381 """GetMaskGreen(self) -> unsigned char"""
2382 return _core_.Image_GetMaskGreen(*args, **kwargs)
2383
2384 def GetMaskBlue(*args, **kwargs):
2385 """GetMaskBlue(self) -> unsigned char"""
2386 return _core_.Image_GetMaskBlue(*args, **kwargs)
2387
2388 def SetMask(*args, **kwargs):
2389 """SetMask(self, bool mask=True)"""
2390 return _core_.Image_SetMask(*args, **kwargs)
2391
2392 def HasMask(*args, **kwargs):
2393 """HasMask(self) -> bool"""
2394 return _core_.Image_HasMask(*args, **kwargs)
2395
2396 def Rotate(*args, **kwargs):
2397 """
2398 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2399 Point offset_after_rotation=None) -> Image
2400 """
2401 return _core_.Image_Rotate(*args, **kwargs)
2402
2403 def Rotate90(*args, **kwargs):
2404 """Rotate90(self, bool clockwise=True) -> Image"""
2405 return _core_.Image_Rotate90(*args, **kwargs)
2406
2407 def Mirror(*args, **kwargs):
2408 """Mirror(self, bool horizontally=True) -> Image"""
2409 return _core_.Image_Mirror(*args, **kwargs)
2410
2411 def Replace(*args, **kwargs):
2412 """
2413 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
2414 unsigned char r2, unsigned char g2, unsigned char b2)
2415 """
2416 return _core_.Image_Replace(*args, **kwargs)
2417
2418 def ConvertToMono(*args, **kwargs):
2419 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
2420 return _core_.Image_ConvertToMono(*args, **kwargs)
2421
2422 def SetOption(*args, **kwargs):
2423 """SetOption(self, String name, String value)"""
2424 return _core_.Image_SetOption(*args, **kwargs)
2425
2426 def SetOptionInt(*args, **kwargs):
2427 """SetOptionInt(self, String name, int value)"""
2428 return _core_.Image_SetOptionInt(*args, **kwargs)
2429
2430 def GetOption(*args, **kwargs):
2431 """GetOption(self, String name) -> String"""
2432 return _core_.Image_GetOption(*args, **kwargs)
2433
2434 def GetOptionInt(*args, **kwargs):
2435 """GetOptionInt(self, String name) -> int"""
2436 return _core_.Image_GetOptionInt(*args, **kwargs)
2437
2438 def HasOption(*args, **kwargs):
2439 """HasOption(self, String name) -> bool"""
2440 return _core_.Image_HasOption(*args, **kwargs)
2441
2442 def CountColours(*args, **kwargs):
2443 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2444 return _core_.Image_CountColours(*args, **kwargs)
2445
2446 def ComputeHistogram(*args, **kwargs):
2447 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2448 return _core_.Image_ComputeHistogram(*args, **kwargs)
2449
2450 def AddHandler(*args, **kwargs):
2451 """AddHandler(ImageHandler handler)"""
2452 return _core_.Image_AddHandler(*args, **kwargs)
2453
2454 AddHandler = staticmethod(AddHandler)
2455 def InsertHandler(*args, **kwargs):
2456 """InsertHandler(ImageHandler handler)"""
2457 return _core_.Image_InsertHandler(*args, **kwargs)
2458
2459 InsertHandler = staticmethod(InsertHandler)
2460 def RemoveHandler(*args, **kwargs):
2461 """RemoveHandler(String name) -> bool"""
2462 return _core_.Image_RemoveHandler(*args, **kwargs)
2463
2464 RemoveHandler = staticmethod(RemoveHandler)
2465 def GetImageExtWildcard(*args, **kwargs):
2466 """GetImageExtWildcard() -> String"""
2467 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2468
2469 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2470 def ConvertToBitmap(*args, **kwargs):
2471 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2472 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2473
2474 def ConvertToMonoBitmap(*args, **kwargs):
2475 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
2476 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2477
2478 def __nonzero__(self): return self.Ok()
2479
2480 class ImagePtr(Image):
2481 def __init__(self, this):
2482 self.this = this
2483 if not hasattr(self,"thisown"): self.thisown = 0
2484 self.__class__ = Image
2485 _core_.Image_swigregister(ImagePtr)
2486
2487 def ImageFromMime(*args, **kwargs):
2488 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
2489 val = _core_.new_ImageFromMime(*args, **kwargs)
2490 val.thisown = 1
2491 return val
2492
2493 def ImageFromStream(*args, **kwargs):
2494 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2495 val = _core_.new_ImageFromStream(*args, **kwargs)
2496 val.thisown = 1
2497 return val
2498
2499 def ImageFromStreamMime(*args, **kwargs):
2500 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
2501 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2502 val.thisown = 1
2503 return val
2504
2505 def EmptyImage(*args, **kwargs):
2506 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2507 val = _core_.new_EmptyImage(*args, **kwargs)
2508 val.thisown = 1
2509 return val
2510
2511 def ImageFromBitmap(*args, **kwargs):
2512 """ImageFromBitmap(Bitmap bitmap) -> Image"""
2513 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2514 val.thisown = 1
2515 return val
2516
2517 def ImageFromData(*args, **kwargs):
2518 """ImageFromData(int width, int height, unsigned char data) -> Image"""
2519 val = _core_.new_ImageFromData(*args, **kwargs)
2520 val.thisown = 1
2521 return val
2522
2523 def ImageFromDataWithAlpha(*args, **kwargs):
2524 """ImageFromDataWithAlpha(int width, int height, unsigned char data, unsigned char alpha) -> Image"""
2525 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2526 val.thisown = 1
2527 return val
2528
2529 def Image_CanRead(*args, **kwargs):
2530 """Image_CanRead(String name) -> bool"""
2531 return _core_.Image_CanRead(*args, **kwargs)
2532
2533 def Image_GetImageCount(*args, **kwargs):
2534 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2535 return _core_.Image_GetImageCount(*args, **kwargs)
2536
2537 def Image_CanReadStream(*args, **kwargs):
2538 """Image_CanReadStream(InputStream stream) -> bool"""
2539 return _core_.Image_CanReadStream(*args, **kwargs)
2540
2541 def Image_AddHandler(*args, **kwargs):
2542 """Image_AddHandler(ImageHandler handler)"""
2543 return _core_.Image_AddHandler(*args, **kwargs)
2544
2545 def Image_InsertHandler(*args, **kwargs):
2546 """Image_InsertHandler(ImageHandler handler)"""
2547 return _core_.Image_InsertHandler(*args, **kwargs)
2548
2549 def Image_RemoveHandler(*args, **kwargs):
2550 """Image_RemoveHandler(String name) -> bool"""
2551 return _core_.Image_RemoveHandler(*args, **kwargs)
2552
2553 def Image_GetImageExtWildcard(*args, **kwargs):
2554 """Image_GetImageExtWildcard() -> String"""
2555 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2556
2557 def InitAllImageHandlers():
2558 """
2559 The former functionality of InitAllImageHanders is now done internal to
2560 the _core_ extension module and so this function has become a simple NOP.
2561 """
2562 pass
2563
2564 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2565 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2566 PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
2567 PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
2568 PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
2569 BMP_24BPP = _core_.BMP_24BPP
2570 BMP_8BPP = _core_.BMP_8BPP
2571 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2572 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2573 BMP_8BPP_RED = _core_.BMP_8BPP_RED
2574 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2575 BMP_4BPP = _core_.BMP_4BPP
2576 BMP_1BPP = _core_.BMP_1BPP
2577 BMP_1BPP_BW = _core_.BMP_1BPP_BW
2578 class BMPHandler(ImageHandler):
2579 """Proxy of C++ BMPHandler class"""
2580 def __repr__(self):
2581 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2582 def __init__(self, *args, **kwargs):
2583 """__init__(self) -> BMPHandler"""
2584 newobj = _core_.new_BMPHandler(*args, **kwargs)
2585 self.this = newobj.this
2586 self.thisown = 1
2587 del newobj.thisown
2588
2589 class BMPHandlerPtr(BMPHandler):
2590 def __init__(self, this):
2591 self.this = this
2592 if not hasattr(self,"thisown"): self.thisown = 0
2593 self.__class__ = BMPHandler
2594 _core_.BMPHandler_swigregister(BMPHandlerPtr)
2595 NullImage = cvar.NullImage
2596 IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
2597 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2598 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2599 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2600 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2601 IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
2602 IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
2603 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2604 IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
2605 IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
2606 IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
2607 IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
2608 IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
2609 IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
2610 IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
2611
2612 class ICOHandler(BMPHandler):
2613 """Proxy of C++ ICOHandler class"""
2614 def __repr__(self):
2615 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2616 def __init__(self, *args, **kwargs):
2617 """__init__(self) -> ICOHandler"""
2618 newobj = _core_.new_ICOHandler(*args, **kwargs)
2619 self.this = newobj.this
2620 self.thisown = 1
2621 del newobj.thisown
2622
2623 class ICOHandlerPtr(ICOHandler):
2624 def __init__(self, this):
2625 self.this = this
2626 if not hasattr(self,"thisown"): self.thisown = 0
2627 self.__class__ = ICOHandler
2628 _core_.ICOHandler_swigregister(ICOHandlerPtr)
2629
2630 class CURHandler(ICOHandler):
2631 """Proxy of C++ CURHandler class"""
2632 def __repr__(self):
2633 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2634 def __init__(self, *args, **kwargs):
2635 """__init__(self) -> CURHandler"""
2636 newobj = _core_.new_CURHandler(*args, **kwargs)
2637 self.this = newobj.this
2638 self.thisown = 1
2639 del newobj.thisown
2640
2641 class CURHandlerPtr(CURHandler):
2642 def __init__(self, this):
2643 self.this = this
2644 if not hasattr(self,"thisown"): self.thisown = 0
2645 self.__class__ = CURHandler
2646 _core_.CURHandler_swigregister(CURHandlerPtr)
2647
2648 class ANIHandler(CURHandler):
2649 """Proxy of C++ ANIHandler class"""
2650 def __repr__(self):
2651 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2652 def __init__(self, *args, **kwargs):
2653 """__init__(self) -> ANIHandler"""
2654 newobj = _core_.new_ANIHandler(*args, **kwargs)
2655 self.this = newobj.this
2656 self.thisown = 1
2657 del newobj.thisown
2658
2659 class ANIHandlerPtr(ANIHandler):
2660 def __init__(self, this):
2661 self.this = this
2662 if not hasattr(self,"thisown"): self.thisown = 0
2663 self.__class__ = ANIHandler
2664 _core_.ANIHandler_swigregister(ANIHandlerPtr)
2665
2666 class PNGHandler(ImageHandler):
2667 """Proxy of C++ PNGHandler class"""
2668 def __repr__(self):
2669 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2670 def __init__(self, *args, **kwargs):
2671 """__init__(self) -> PNGHandler"""
2672 newobj = _core_.new_PNGHandler(*args, **kwargs)
2673 self.this = newobj.this
2674 self.thisown = 1
2675 del newobj.thisown
2676
2677 class PNGHandlerPtr(PNGHandler):
2678 def __init__(self, this):
2679 self.this = this
2680 if not hasattr(self,"thisown"): self.thisown = 0
2681 self.__class__ = PNGHandler
2682 _core_.PNGHandler_swigregister(PNGHandlerPtr)
2683
2684 class GIFHandler(ImageHandler):
2685 """Proxy of C++ GIFHandler class"""
2686 def __repr__(self):
2687 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2688 def __init__(self, *args, **kwargs):
2689 """__init__(self) -> GIFHandler"""
2690 newobj = _core_.new_GIFHandler(*args, **kwargs)
2691 self.this = newobj.this
2692 self.thisown = 1
2693 del newobj.thisown
2694
2695 class GIFHandlerPtr(GIFHandler):
2696 def __init__(self, this):
2697 self.this = this
2698 if not hasattr(self,"thisown"): self.thisown = 0
2699 self.__class__ = GIFHandler
2700 _core_.GIFHandler_swigregister(GIFHandlerPtr)
2701
2702 class PCXHandler(ImageHandler):
2703 """Proxy of C++ PCXHandler class"""
2704 def __repr__(self):
2705 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2706 def __init__(self, *args, **kwargs):
2707 """__init__(self) -> PCXHandler"""
2708 newobj = _core_.new_PCXHandler(*args, **kwargs)
2709 self.this = newobj.this
2710 self.thisown = 1
2711 del newobj.thisown
2712
2713 class PCXHandlerPtr(PCXHandler):
2714 def __init__(self, this):
2715 self.this = this
2716 if not hasattr(self,"thisown"): self.thisown = 0
2717 self.__class__ = PCXHandler
2718 _core_.PCXHandler_swigregister(PCXHandlerPtr)
2719
2720 class JPEGHandler(ImageHandler):
2721 """Proxy of C++ JPEGHandler class"""
2722 def __repr__(self):
2723 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2724 def __init__(self, *args, **kwargs):
2725 """__init__(self) -> JPEGHandler"""
2726 newobj = _core_.new_JPEGHandler(*args, **kwargs)
2727 self.this = newobj.this
2728 self.thisown = 1
2729 del newobj.thisown
2730
2731 class JPEGHandlerPtr(JPEGHandler):
2732 def __init__(self, this):
2733 self.this = this
2734 if not hasattr(self,"thisown"): self.thisown = 0
2735 self.__class__ = JPEGHandler
2736 _core_.JPEGHandler_swigregister(JPEGHandlerPtr)
2737
2738 class PNMHandler(ImageHandler):
2739 """Proxy of C++ PNMHandler class"""
2740 def __repr__(self):
2741 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2742 def __init__(self, *args, **kwargs):
2743 """__init__(self) -> PNMHandler"""
2744 newobj = _core_.new_PNMHandler(*args, **kwargs)
2745 self.this = newobj.this
2746 self.thisown = 1
2747 del newobj.thisown
2748
2749 class PNMHandlerPtr(PNMHandler):
2750 def __init__(self, this):
2751 self.this = this
2752 if not hasattr(self,"thisown"): self.thisown = 0
2753 self.__class__ = PNMHandler
2754 _core_.PNMHandler_swigregister(PNMHandlerPtr)
2755
2756 class XPMHandler(ImageHandler):
2757 """Proxy of C++ XPMHandler class"""
2758 def __repr__(self):
2759 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2760 def __init__(self, *args, **kwargs):
2761 """__init__(self) -> XPMHandler"""
2762 newobj = _core_.new_XPMHandler(*args, **kwargs)
2763 self.this = newobj.this
2764 self.thisown = 1
2765 del newobj.thisown
2766
2767 class XPMHandlerPtr(XPMHandler):
2768 def __init__(self, this):
2769 self.this = this
2770 if not hasattr(self,"thisown"): self.thisown = 0
2771 self.__class__ = XPMHandler
2772 _core_.XPMHandler_swigregister(XPMHandlerPtr)
2773
2774 class TIFFHandler(ImageHandler):
2775 """Proxy of C++ TIFFHandler class"""
2776 def __repr__(self):
2777 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2778 def __init__(self, *args, **kwargs):
2779 """__init__(self) -> TIFFHandler"""
2780 newobj = _core_.new_TIFFHandler(*args, **kwargs)
2781 self.this = newobj.this
2782 self.thisown = 1
2783 del newobj.thisown
2784
2785 class TIFFHandlerPtr(TIFFHandler):
2786 def __init__(self, this):
2787 self.this = this
2788 if not hasattr(self,"thisown"): self.thisown = 0
2789 self.__class__ = TIFFHandler
2790 _core_.TIFFHandler_swigregister(TIFFHandlerPtr)
2791
2792 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2793 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2794 class Quantize(object):
2795 """Performs quantization, or colour reduction, on a wxImage."""
2796 def __init__(self): raise RuntimeError, "No constructor defined"
2797 def __repr__(self):
2798 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2799 def Quantize(*args, **kwargs):
2800 """
2801 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2802
2803 Reduce the colours in the source image and put the result into the
2804 destination image, setting the palette in the destination if
2805 needed. Both images may be the same, to overwrite the source image.
2806 """
2807 return _core_.Quantize_Quantize(*args, **kwargs)
2808
2809 Quantize = staticmethod(Quantize)
2810
2811 class QuantizePtr(Quantize):
2812 def __init__(self, this):
2813 self.this = this
2814 if not hasattr(self,"thisown"): self.thisown = 0
2815 self.__class__ = Quantize
2816 _core_.Quantize_swigregister(QuantizePtr)
2817
2818 def Quantize_Quantize(*args, **kwargs):
2819 """
2820 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2821
2822 Reduce the colours in the source image and put the result into the
2823 destination image, setting the palette in the destination if
2824 needed. Both images may be the same, to overwrite the source image.
2825 """
2826 return _core_.Quantize_Quantize(*args, **kwargs)
2827
2828 #---------------------------------------------------------------------------
2829
2830 class EvtHandler(Object):
2831 """Proxy of C++ EvtHandler class"""
2832 def __repr__(self):
2833 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2834 def __init__(self, *args, **kwargs):
2835 """__init__(self) -> EvtHandler"""
2836 newobj = _core_.new_EvtHandler(*args, **kwargs)
2837 self.this = newobj.this
2838 self.thisown = 1
2839 del newobj.thisown
2840 def GetNextHandler(*args, **kwargs):
2841 """GetNextHandler(self) -> EvtHandler"""
2842 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
2843
2844 def GetPreviousHandler(*args, **kwargs):
2845 """GetPreviousHandler(self) -> EvtHandler"""
2846 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
2847
2848 def SetNextHandler(*args, **kwargs):
2849 """SetNextHandler(self, EvtHandler handler)"""
2850 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
2851
2852 def SetPreviousHandler(*args, **kwargs):
2853 """SetPreviousHandler(self, EvtHandler handler)"""
2854 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
2855
2856 def GetEvtHandlerEnabled(*args, **kwargs):
2857 """GetEvtHandlerEnabled(self) -> bool"""
2858 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
2859
2860 def SetEvtHandlerEnabled(*args, **kwargs):
2861 """SetEvtHandlerEnabled(self, bool enabled)"""
2862 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
2863
2864 def ProcessEvent(*args, **kwargs):
2865 """ProcessEvent(self, Event event) -> bool"""
2866 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
2867
2868 def AddPendingEvent(*args, **kwargs):
2869 """AddPendingEvent(self, Event event)"""
2870 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
2871
2872 def ProcessPendingEvents(*args, **kwargs):
2873 """ProcessPendingEvents(self)"""
2874 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
2875
2876 def Connect(*args, **kwargs):
2877 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
2878 return _core_.EvtHandler_Connect(*args, **kwargs)
2879
2880 def Disconnect(*args, **kwargs):
2881 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
2882 return _core_.EvtHandler_Disconnect(*args, **kwargs)
2883
2884 def _setOORInfo(*args, **kwargs):
2885 """_setOORInfo(self, PyObject _self, bool incref=True)"""
2886 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
2887
2888 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2889 """
2890 Bind an event to an event handler.
2891
2892 :param event: One of the EVT_* objects that specifies the
2893 type of event to bind,
2894
2895 :param handler: A callable object to be invoked when the
2896 event is delivered to self. Pass None to
2897 disconnect an event handler.
2898
2899 :param source: Sometimes the event originates from a
2900 different window than self, but you still
2901 want to catch it in self. (For example, a
2902 button event delivered to a frame.) By
2903 passing the source of the event, the event
2904 handling system is able to differentiate
2905 between the same event type from different
2906 controls.
2907
2908 :param id: Used to spcify the event source by ID instead
2909 of instance.
2910
2911 :param id2: Used when it is desirable to bind a handler
2912 to a range of IDs, such as with EVT_MENU_RANGE.
2913 """
2914 if source is not None:
2915 id = source.GetId()
2916 event.Bind(self, id, id2, handler)
2917
2918 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2919 """
2920 Disconencts the event handler binding for event from self.
2921 Returns True if successful.
2922 """
2923 if source is not None:
2924 id = source.GetId()
2925 return event.Unbind(self, id, id2)
2926
2927
2928 class EvtHandlerPtr(EvtHandler):
2929 def __init__(self, this):
2930 self.this = this
2931 if not hasattr(self,"thisown"): self.thisown = 0
2932 self.__class__ = EvtHandler
2933 _core_.EvtHandler_swigregister(EvtHandlerPtr)
2934
2935 #---------------------------------------------------------------------------
2936
2937 class PyEventBinder(object):
2938 """
2939 Instances of this class are used to bind specific events to event
2940 handlers.
2941 """
2942 def __init__(self, evtType, expectedIDs=0):
2943 if expectedIDs not in [0, 1, 2]:
2944 raise ValueError, "Invalid number of expectedIDs"
2945 self.expectedIDs = expectedIDs
2946
2947 if type(evtType) == list or type(evtType) == tuple:
2948 self.evtType = evtType
2949 else:
2950 self.evtType = [evtType]
2951
2952
2953 def Bind(self, target, id1, id2, function):
2954 """Bind this set of event types to target."""
2955 for et in self.evtType:
2956 target.Connect(id1, id2, et, function)
2957
2958
2959 def Unbind(self, target, id1, id2):
2960 """Remove an event binding."""
2961 success = 0
2962 for et in self.evtType:
2963 success += target.Disconnect(id1, id2, et)
2964 return success != 0
2965
2966
2967 def __call__(self, *args):
2968 """
2969 For backwards compatibility with the old EVT_* functions.
2970 Should be called with either (window, func), (window, ID,
2971 func) or (window, ID1, ID2, func) parameters depending on the
2972 type of the event.
2973 """
2974 assert len(args) == 2 + self.expectedIDs
2975 id1 = wx.ID_ANY
2976 id2 = wx.ID_ANY
2977 target = args[0]
2978 if self.expectedIDs == 0:
2979 func = args[1]
2980 elif self.expectedIDs == 1:
2981 id1 = args[1]
2982 func = args[2]
2983 elif self.expectedIDs == 2:
2984 id1 = args[1]
2985 id2 = args[2]
2986 func = args[3]
2987 else:
2988 raise ValueError, "Unexpected number of IDs"
2989
2990 self.Bind(target, id1, id2, func)
2991
2992
2993 # These two are square pegs that don't fit the PyEventBinder hole...
2994 def EVT_COMMAND(win, id, cmd, func):
2995 win.Connect(id, -1, cmd, func)
2996 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2997 win.Connect(id1, id2, cmd, func)
2998
2999
3000 #---------------------------------------------------------------------------
3001
3002 #---------------------------------------------------------------------------
3003
3004 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3005 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3006
3007 def NewEventType(*args, **kwargs):
3008 """NewEventType() -> wxEventType"""
3009 return _core_.NewEventType(*args, **kwargs)
3010 wxEVT_NULL = _core_.wxEVT_NULL
3011 wxEVT_FIRST = _core_.wxEVT_FIRST
3012 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3013 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3014 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3015 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3016 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3017 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3018 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3019 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3020 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3021 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3022 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3023 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3024 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3025 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3026 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3027 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3028 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3029 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3030 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3031 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3032 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3033 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3034 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3035 wxEVT_MOTION = _core_.wxEVT_MOTION
3036 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3037 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3038 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3039 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3040 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3041 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3042 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3043 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3044 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3045 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3046 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3047 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3048 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3049 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3050 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3051 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3052 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3053 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3054 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3055 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3056 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3057 wxEVT_CHAR = _core_.wxEVT_CHAR
3058 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3059 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3060 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3061 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3062 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3063 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3064 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3065 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3066 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3067 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3068 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3069 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3070 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3071 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3072 wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
3073 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3074 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3075 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3076 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3077 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3078 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3079 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3080 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3081 wxEVT_SIZE = _core_.wxEVT_SIZE
3082 wxEVT_MOVE = _core_.wxEVT_MOVE
3083 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3084 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3085 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3086 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3087 wxEVT_POWER = _core_.wxEVT_POWER
3088 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3089 wxEVT_CREATE = _core_.wxEVT_CREATE
3090 wxEVT_DESTROY = _core_.wxEVT_DESTROY
3091 wxEVT_SHOW = _core_.wxEVT_SHOW
3092 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3093 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3094 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3095 wxEVT_PAINT = _core_.wxEVT_PAINT
3096 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3097 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3098 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3099 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3100 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3101 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3102 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3103 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3104 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3105 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3106 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3107 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3108 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3109 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3110 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3111 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3112 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3113 wxEVT_IDLE = _core_.wxEVT_IDLE
3114 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3115 wxEVT_SIZING = _core_.wxEVT_SIZING
3116 wxEVT_MOVING = _core_.wxEVT_MOVING
3117 wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3118 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3119 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3120 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3121 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3122 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3123 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3124 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3125 #
3126 # Create some event binders
3127 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3128 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3129 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3130 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3131 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3132 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3133 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3134 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3135 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3136 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3137 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3138 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3139 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3140 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3141 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3142 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3143 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3144 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3145 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3146 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3147 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3148 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3149 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3150 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3151 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
3152 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3153 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3154 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3155 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3156 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3157 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3158 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3159 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3160 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3161 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3162 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3163 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3164 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3165 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3166 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3167 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3168
3169 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3170 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3171 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3172 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3173 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3174 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3175 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3176 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3177 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3178 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3179 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3180 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3181 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3182
3183 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3184 wxEVT_LEFT_UP,
3185 wxEVT_MIDDLE_DOWN,
3186 wxEVT_MIDDLE_UP,
3187 wxEVT_RIGHT_DOWN,
3188 wxEVT_RIGHT_UP,
3189 wxEVT_MOTION,
3190 wxEVT_LEFT_DCLICK,
3191 wxEVT_MIDDLE_DCLICK,
3192 wxEVT_RIGHT_DCLICK,
3193 wxEVT_ENTER_WINDOW,
3194 wxEVT_LEAVE_WINDOW,
3195 wxEVT_MOUSEWHEEL
3196 ])
3197
3198
3199 # Scrolling from wxWindow (sent to wxScrolledWindow)
3200 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3201 wxEVT_SCROLLWIN_BOTTOM,
3202 wxEVT_SCROLLWIN_LINEUP,
3203 wxEVT_SCROLLWIN_LINEDOWN,
3204 wxEVT_SCROLLWIN_PAGEUP,
3205 wxEVT_SCROLLWIN_PAGEDOWN,
3206 wxEVT_SCROLLWIN_THUMBTRACK,
3207 wxEVT_SCROLLWIN_THUMBRELEASE,
3208 ])
3209
3210 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3211 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3212 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3213 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3214 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3215 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3216 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3217 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3218
3219 # Scrolling from wxSlider and wxScrollBar
3220 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3221 wxEVT_SCROLL_BOTTOM,
3222 wxEVT_SCROLL_LINEUP,
3223 wxEVT_SCROLL_LINEDOWN,
3224 wxEVT_SCROLL_PAGEUP,
3225 wxEVT_SCROLL_PAGEDOWN,
3226 wxEVT_SCROLL_THUMBTRACK,
3227 wxEVT_SCROLL_THUMBRELEASE,
3228 wxEVT_SCROLL_ENDSCROLL,
3229 ])
3230
3231 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3232 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3233 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3234 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3235 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3236 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3237 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3238 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3239 EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3240
3241 # Scrolling from wxSlider and wxScrollBar, with an id
3242 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3243 wxEVT_SCROLL_BOTTOM,
3244 wxEVT_SCROLL_LINEUP,
3245 wxEVT_SCROLL_LINEDOWN,
3246 wxEVT_SCROLL_PAGEUP,
3247 wxEVT_SCROLL_PAGEDOWN,
3248 wxEVT_SCROLL_THUMBTRACK,
3249 wxEVT_SCROLL_THUMBRELEASE,
3250 wxEVT_SCROLL_ENDSCROLL,
3251 ], 1)
3252
3253 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3254 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3255 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3256 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3257 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3258 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3259 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3260 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3261 EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3262
3263 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3264 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3265 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3266 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3267 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3268 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3269 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3270 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3271 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3272 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3273
3274 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3275 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3276 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3277 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3278 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3279 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3280 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3281 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3282 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3283
3284
3285 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3286 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3287 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3288 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3289 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3290 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3291 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3292
3293 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3294
3295 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3296 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3297
3298 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3299
3300
3301
3302 #---------------------------------------------------------------------------
3303
3304 class Event(Object):
3305 """Proxy of C++ Event class"""
3306 def __init__(self): raise RuntimeError, "No constructor defined"
3307 def __repr__(self):
3308 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3309 def __del__(self, destroy=_core_.delete_Event):
3310 """__del__(self)"""
3311 try:
3312 if self.thisown: destroy(self)
3313 except: pass
3314
3315 def SetEventType(*args, **kwargs):
3316 """SetEventType(self, wxEventType typ)"""
3317 return _core_.Event_SetEventType(*args, **kwargs)
3318
3319 def GetEventType(*args, **kwargs):
3320 """GetEventType(self) -> wxEventType"""
3321 return _core_.Event_GetEventType(*args, **kwargs)
3322
3323 def GetEventObject(*args, **kwargs):
3324 """GetEventObject(self) -> Object"""
3325 return _core_.Event_GetEventObject(*args, **kwargs)
3326
3327 def SetEventObject(*args, **kwargs):
3328 """SetEventObject(self, Object obj)"""
3329 return _core_.Event_SetEventObject(*args, **kwargs)
3330
3331 def GetTimestamp(*args, **kwargs):
3332 """GetTimestamp(self) -> long"""
3333 return _core_.Event_GetTimestamp(*args, **kwargs)
3334
3335 def SetTimestamp(*args, **kwargs):
3336 """SetTimestamp(self, long ts=0)"""
3337 return _core_.Event_SetTimestamp(*args, **kwargs)
3338
3339 def GetId(*args, **kwargs):
3340 """GetId(self) -> int"""
3341 return _core_.Event_GetId(*args, **kwargs)
3342
3343 def SetId(*args, **kwargs):
3344 """SetId(self, int Id)"""
3345 return _core_.Event_SetId(*args, **kwargs)
3346
3347 def IsCommandEvent(*args, **kwargs):
3348 """IsCommandEvent(self) -> bool"""
3349 return _core_.Event_IsCommandEvent(*args, **kwargs)
3350
3351 def Skip(*args, **kwargs):
3352 """
3353 Skip(self, bool skip=True)
3354
3355 Called by an event handler, it controls whether additional event
3356 handlers bound to this event will be called after the current event
3357 handler returns. Skip(false) (the default setting) will prevent
3358 additional event handlers from being called and control will be
3359 returned to the sender of the event immediately after the current
3360 handler has finished. Skip(True) will cause the event processing
3361 system to continue searching for a handler function for this event.
3362
3363 """
3364 return _core_.Event_Skip(*args, **kwargs)
3365
3366 def GetSkipped(*args, **kwargs):
3367 """GetSkipped(self) -> bool"""
3368 return _core_.Event_GetSkipped(*args, **kwargs)
3369
3370 def ShouldPropagate(*args, **kwargs):
3371 """ShouldPropagate(self) -> bool"""
3372 return _core_.Event_ShouldPropagate(*args, **kwargs)
3373
3374 def StopPropagation(*args, **kwargs):
3375 """StopPropagation(self) -> int"""
3376 return _core_.Event_StopPropagation(*args, **kwargs)
3377
3378 def ResumePropagation(*args, **kwargs):
3379 """ResumePropagation(self, int propagationLevel)"""
3380 return _core_.Event_ResumePropagation(*args, **kwargs)
3381
3382 def Clone(*args, **kwargs):
3383 """Clone(self) -> Event"""
3384 return _core_.Event_Clone(*args, **kwargs)
3385
3386
3387 class EventPtr(Event):
3388 def __init__(self, this):
3389 self.this = this
3390 if not hasattr(self,"thisown"): self.thisown = 0
3391 self.__class__ = Event
3392 _core_.Event_swigregister(EventPtr)
3393
3394 #---------------------------------------------------------------------------
3395
3396 class PropagationDisabler(object):
3397 """Proxy of C++ PropagationDisabler class"""
3398 def __repr__(self):
3399 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3400 def __init__(self, *args, **kwargs):
3401 """__init__(self, Event event) -> PropagationDisabler"""
3402 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
3403 self.this = newobj.this
3404 self.thisown = 1
3405 del newobj.thisown
3406 def __del__(self, destroy=_core_.delete_PropagationDisabler):
3407 """__del__(self)"""
3408 try:
3409 if self.thisown: destroy(self)
3410 except: pass
3411
3412
3413 class PropagationDisablerPtr(PropagationDisabler):
3414 def __init__(self, this):
3415 self.this = this
3416 if not hasattr(self,"thisown"): self.thisown = 0
3417 self.__class__ = PropagationDisabler
3418 _core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
3419
3420 class PropagateOnce(object):
3421 """Proxy of C++ PropagateOnce class"""
3422 def __repr__(self):
3423 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3424 def __init__(self, *args, **kwargs):
3425 """__init__(self, Event event) -> PropagateOnce"""
3426 newobj = _core_.new_PropagateOnce(*args, **kwargs)
3427 self.this = newobj.this
3428 self.thisown = 1
3429 del newobj.thisown
3430 def __del__(self, destroy=_core_.delete_PropagateOnce):
3431 """__del__(self)"""
3432 try:
3433 if self.thisown: destroy(self)
3434 except: pass
3435
3436
3437 class PropagateOncePtr(PropagateOnce):
3438 def __init__(self, this):
3439 self.this = this
3440 if not hasattr(self,"thisown"): self.thisown = 0
3441 self.__class__ = PropagateOnce
3442 _core_.PropagateOnce_swigregister(PropagateOncePtr)
3443
3444 #---------------------------------------------------------------------------
3445
3446 class CommandEvent(Event):
3447 """Proxy of C++ CommandEvent class"""
3448 def __repr__(self):
3449 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3450 def __init__(self, *args, **kwargs):
3451 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
3452 newobj = _core_.new_CommandEvent(*args, **kwargs)
3453 self.this = newobj.this
3454 self.thisown = 1
3455 del newobj.thisown
3456 def GetSelection(*args, **kwargs):
3457 """GetSelection(self) -> int"""
3458 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3459
3460 def SetString(*args, **kwargs):
3461 """SetString(self, String s)"""
3462 return _core_.CommandEvent_SetString(*args, **kwargs)
3463
3464 def GetString(*args, **kwargs):
3465 """GetString(self) -> String"""
3466 return _core_.CommandEvent_GetString(*args, **kwargs)
3467
3468 def IsChecked(*args, **kwargs):
3469 """IsChecked(self) -> bool"""
3470 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3471
3472 Checked = IsChecked
3473 def IsSelection(*args, **kwargs):
3474 """IsSelection(self) -> bool"""
3475 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3476
3477 def SetExtraLong(*args, **kwargs):
3478 """SetExtraLong(self, long extraLong)"""
3479 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3480
3481 def GetExtraLong(*args, **kwargs):
3482 """GetExtraLong(self) -> long"""
3483 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3484
3485 def SetInt(*args, **kwargs):
3486 """SetInt(self, int i)"""
3487 return _core_.CommandEvent_SetInt(*args, **kwargs)
3488
3489 def GetInt(*args, **kwargs):
3490 """GetInt(self) -> long"""
3491 return _core_.CommandEvent_GetInt(*args, **kwargs)
3492
3493 def Clone(*args, **kwargs):
3494 """Clone(self) -> Event"""
3495 return _core_.CommandEvent_Clone(*args, **kwargs)
3496
3497
3498 class CommandEventPtr(CommandEvent):
3499 def __init__(self, this):
3500 self.this = this
3501 if not hasattr(self,"thisown"): self.thisown = 0
3502 self.__class__ = CommandEvent
3503 _core_.CommandEvent_swigregister(CommandEventPtr)
3504
3505 #---------------------------------------------------------------------------
3506
3507 class NotifyEvent(CommandEvent):
3508 """Proxy of C++ NotifyEvent class"""
3509 def __repr__(self):
3510 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3511 def __init__(self, *args, **kwargs):
3512 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
3513 newobj = _core_.new_NotifyEvent(*args, **kwargs)
3514 self.this = newobj.this
3515 self.thisown = 1
3516 del newobj.thisown
3517 def Veto(*args, **kwargs):
3518 """Veto(self)"""
3519 return _core_.NotifyEvent_Veto(*args, **kwargs)
3520
3521 def Allow(*args, **kwargs):
3522 """Allow(self)"""
3523 return _core_.NotifyEvent_Allow(*args, **kwargs)
3524
3525 def IsAllowed(*args, **kwargs):
3526 """IsAllowed(self) -> bool"""
3527 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
3528
3529
3530 class NotifyEventPtr(NotifyEvent):
3531 def __init__(self, this):
3532 self.this = this
3533 if not hasattr(self,"thisown"): self.thisown = 0
3534 self.__class__ = NotifyEvent
3535 _core_.NotifyEvent_swigregister(NotifyEventPtr)
3536
3537 #---------------------------------------------------------------------------
3538
3539 class ScrollEvent(CommandEvent):
3540 """Proxy of C++ ScrollEvent class"""
3541 def __repr__(self):
3542 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3543 def __init__(self, *args, **kwargs):
3544 """
3545 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
3546 int orient=0) -> ScrollEvent
3547 """
3548 newobj = _core_.new_ScrollEvent(*args, **kwargs)
3549 self.this = newobj.this
3550 self.thisown = 1
3551 del newobj.thisown
3552 def GetOrientation(*args, **kwargs):
3553 """GetOrientation(self) -> int"""
3554 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
3555
3556 def GetPosition(*args, **kwargs):
3557 """GetPosition(self) -> int"""
3558 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
3559
3560 def SetOrientation(*args, **kwargs):
3561 """SetOrientation(self, int orient)"""
3562 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
3563
3564 def SetPosition(*args, **kwargs):
3565 """SetPosition(self, int pos)"""
3566 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
3567
3568
3569 class ScrollEventPtr(ScrollEvent):
3570 def __init__(self, this):
3571 self.this = this
3572 if not hasattr(self,"thisown"): self.thisown = 0
3573 self.__class__ = ScrollEvent
3574 _core_.ScrollEvent_swigregister(ScrollEventPtr)
3575
3576 #---------------------------------------------------------------------------
3577
3578 class ScrollWinEvent(Event):
3579 """Proxy of C++ ScrollWinEvent class"""
3580 def __repr__(self):
3581 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3582 def __init__(self, *args, **kwargs):
3583 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
3584 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
3585 self.this = newobj.this
3586 self.thisown = 1
3587 del newobj.thisown
3588 def GetOrientation(*args, **kwargs):
3589 """GetOrientation(self) -> int"""
3590 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
3591
3592 def GetPosition(*args, **kwargs):
3593 """GetPosition(self) -> int"""
3594 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
3595
3596 def SetOrientation(*args, **kwargs):
3597 """SetOrientation(self, int orient)"""
3598 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
3599
3600 def SetPosition(*args, **kwargs):
3601 """SetPosition(self, int pos)"""
3602 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
3603
3604
3605 class ScrollWinEventPtr(ScrollWinEvent):
3606 def __init__(self, this):
3607 self.this = this
3608 if not hasattr(self,"thisown"): self.thisown = 0
3609 self.__class__ = ScrollWinEvent
3610 _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
3611
3612 #---------------------------------------------------------------------------
3613
3614 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3615 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3616 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3617 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3618 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
3619 class MouseEvent(Event):
3620 """Proxy of C++ MouseEvent class"""
3621 def __repr__(self):
3622 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3623 def __init__(self, *args, **kwargs):
3624 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
3625 newobj = _core_.new_MouseEvent(*args, **kwargs)
3626 self.this = newobj.this
3627 self.thisown = 1
3628 del newobj.thisown
3629 def IsButton(*args, **kwargs):
3630 """IsButton(self) -> bool"""
3631 return _core_.MouseEvent_IsButton(*args, **kwargs)
3632
3633 def ButtonDown(*args, **kwargs):
3634 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
3635 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
3636
3637 def ButtonDClick(*args, **kwargs):
3638 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
3639 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
3640
3641 def ButtonUp(*args, **kwargs):
3642 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
3643 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
3644
3645 def Button(*args, **kwargs):
3646 """Button(self, int but) -> bool"""
3647 return _core_.MouseEvent_Button(*args, **kwargs)
3648
3649 def ButtonIsDown(*args, **kwargs):
3650 """ButtonIsDown(self, int but) -> bool"""
3651 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
3652
3653 def GetButton(*args, **kwargs):
3654 """GetButton(self) -> int"""
3655 return _core_.MouseEvent_GetButton(*args, **kwargs)
3656
3657 def ControlDown(*args, **kwargs):
3658 """ControlDown(self) -> bool"""
3659 return _core_.MouseEvent_ControlDown(*args, **kwargs)
3660
3661 def MetaDown(*args, **kwargs):
3662 """MetaDown(self) -> bool"""
3663 return _core_.MouseEvent_MetaDown(*args, **kwargs)
3664
3665 def AltDown(*args, **kwargs):
3666 """AltDown(self) -> bool"""
3667 return _core_.MouseEvent_AltDown(*args, **kwargs)
3668
3669 def ShiftDown(*args, **kwargs):
3670 """ShiftDown(self) -> bool"""
3671 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
3672
3673 def CmdDown(*args, **kwargs):
3674 """
3675 CmdDown(self) -> bool
3676
3677 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3678 platforms but the special "Apple" (a.k.a as "Command") key on
3679 Macs: it makes often sense to use it instead of, say, `ControlDown`
3680 because Cmd key is used for the same thing under Mac as Ctrl
3681 elsewhere. The Ctrl still exists, it's just not used for this
3682 purpose. So for non-Mac platforms this is the same as `ControlDown`
3683 and Macs this is the same as `MetaDown`.
3684 """
3685 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3686
3687 def LeftDown(*args, **kwargs):
3688 """LeftDown(self) -> bool"""
3689 return _core_.MouseEvent_LeftDown(*args, **kwargs)
3690
3691 def MiddleDown(*args, **kwargs):
3692 """MiddleDown(self) -> bool"""
3693 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
3694
3695 def RightDown(*args, **kwargs):
3696 """RightDown(self) -> bool"""
3697 return _core_.MouseEvent_RightDown(*args, **kwargs)
3698
3699 def LeftUp(*args, **kwargs):
3700 """LeftUp(self) -> bool"""
3701 return _core_.MouseEvent_LeftUp(*args, **kwargs)
3702
3703 def MiddleUp(*args, **kwargs):
3704 """MiddleUp(self) -> bool"""
3705 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
3706
3707 def RightUp(*args, **kwargs):
3708 """RightUp(self) -> bool"""
3709 return _core_.MouseEvent_RightUp(*args, **kwargs)
3710
3711 def LeftDClick(*args, **kwargs):
3712 """LeftDClick(self) -> bool"""
3713 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
3714
3715 def MiddleDClick(*args, **kwargs):
3716 """MiddleDClick(self) -> bool"""
3717 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
3718
3719 def RightDClick(*args, **kwargs):
3720 """RightDClick(self) -> bool"""
3721 return _core_.MouseEvent_RightDClick(*args, **kwargs)
3722
3723 def LeftIsDown(*args, **kwargs):
3724 """LeftIsDown(self) -> bool"""
3725 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
3726
3727 def MiddleIsDown(*args, **kwargs):
3728 """MiddleIsDown(self) -> bool"""
3729 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
3730
3731 def RightIsDown(*args, **kwargs):
3732 """RightIsDown(self) -> bool"""
3733 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
3734
3735 def Dragging(*args, **kwargs):
3736 """Dragging(self) -> bool"""
3737 return _core_.MouseEvent_Dragging(*args, **kwargs)
3738
3739 def Moving(*args, **kwargs):
3740 """Moving(self) -> bool"""
3741 return _core_.MouseEvent_Moving(*args, **kwargs)
3742
3743 def Entering(*args, **kwargs):
3744 """Entering(self) -> bool"""
3745 return _core_.MouseEvent_Entering(*args, **kwargs)
3746
3747 def Leaving(*args, **kwargs):
3748 """Leaving(self) -> bool"""
3749 return _core_.MouseEvent_Leaving(*args, **kwargs)
3750
3751 def GetPosition(*args, **kwargs):
3752 """
3753 GetPosition(self) -> Point
3754
3755 Returns the position of the mouse in window coordinates when the event
3756 happened.
3757 """
3758 return _core_.MouseEvent_GetPosition(*args, **kwargs)
3759
3760 def GetPositionTuple(*args, **kwargs):
3761 """
3762 GetPositionTuple() -> (x,y)
3763
3764 Returns the position of the mouse in window coordinates when the event
3765 happened.
3766 """
3767 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
3768
3769 def GetLogicalPosition(*args, **kwargs):
3770 """GetLogicalPosition(self, DC dc) -> Point"""
3771 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
3772
3773 def GetX(*args, **kwargs):
3774 """GetX(self) -> int"""
3775 return _core_.MouseEvent_GetX(*args, **kwargs)
3776
3777 def GetY(*args, **kwargs):
3778 """GetY(self) -> int"""
3779 return _core_.MouseEvent_GetY(*args, **kwargs)
3780
3781 def GetWheelRotation(*args, **kwargs):
3782 """GetWheelRotation(self) -> int"""
3783 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
3784
3785 def GetWheelDelta(*args, **kwargs):
3786 """GetWheelDelta(self) -> int"""
3787 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
3788
3789 def GetLinesPerAction(*args, **kwargs):
3790 """GetLinesPerAction(self) -> int"""
3791 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
3792
3793 def IsPageScroll(*args, **kwargs):
3794 """IsPageScroll(self) -> bool"""
3795 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3796
3797 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3798 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3799 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3800 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3801 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3802 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3803 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3804 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3805 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3806 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3807 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3808 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
3809
3810 class MouseEventPtr(MouseEvent):
3811 def __init__(self, this):
3812 self.this = this
3813 if not hasattr(self,"thisown"): self.thisown = 0
3814 self.__class__ = MouseEvent
3815 _core_.MouseEvent_swigregister(MouseEventPtr)
3816
3817 #---------------------------------------------------------------------------
3818
3819 class SetCursorEvent(Event):
3820 """Proxy of C++ SetCursorEvent class"""
3821 def __repr__(self):
3822 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3823 def __init__(self, *args, **kwargs):
3824 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
3825 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
3826 self.this = newobj.this
3827 self.thisown = 1
3828 del newobj.thisown
3829 def GetX(*args, **kwargs):
3830 """GetX(self) -> int"""
3831 return _core_.SetCursorEvent_GetX(*args, **kwargs)
3832
3833 def GetY(*args, **kwargs):
3834 """GetY(self) -> int"""
3835 return _core_.SetCursorEvent_GetY(*args, **kwargs)
3836
3837 def SetCursor(*args, **kwargs):
3838 """SetCursor(self, Cursor cursor)"""
3839 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
3840
3841 def GetCursor(*args, **kwargs):
3842 """GetCursor(self) -> Cursor"""
3843 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
3844
3845 def HasCursor(*args, **kwargs):
3846 """HasCursor(self) -> bool"""
3847 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
3848
3849
3850 class SetCursorEventPtr(SetCursorEvent):
3851 def __init__(self, this):
3852 self.this = this
3853 if not hasattr(self,"thisown"): self.thisown = 0
3854 self.__class__ = SetCursorEvent
3855 _core_.SetCursorEvent_swigregister(SetCursorEventPtr)
3856
3857 #---------------------------------------------------------------------------
3858
3859 class KeyEvent(Event):
3860 """Proxy of C++ KeyEvent class"""
3861 def __repr__(self):
3862 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3863 def __init__(self, *args, **kwargs):
3864 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
3865 newobj = _core_.new_KeyEvent(*args, **kwargs)
3866 self.this = newobj.this
3867 self.thisown = 1
3868 del newobj.thisown
3869 def ControlDown(*args, **kwargs):
3870 """ControlDown(self) -> bool"""
3871 return _core_.KeyEvent_ControlDown(*args, **kwargs)
3872
3873 def MetaDown(*args, **kwargs):
3874 """MetaDown(self) -> bool"""
3875 return _core_.KeyEvent_MetaDown(*args, **kwargs)
3876
3877 def AltDown(*args, **kwargs):
3878 """AltDown(self) -> bool"""
3879 return _core_.KeyEvent_AltDown(*args, **kwargs)
3880
3881 def ShiftDown(*args, **kwargs):
3882 """ShiftDown(self) -> bool"""
3883 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
3884
3885 def CmdDown(*args, **kwargs):
3886 """
3887 CmdDown(self) -> bool
3888
3889 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3890 platforms but the special "Apple" (a.k.a as "Command") key on
3891 Macs: it makes often sense to use it instead of, say, `ControlDown`
3892 because Cmd key is used for the same thing under Mac as Ctrl
3893 elsewhere. The Ctrl still exists, it's just not used for this
3894 purpose. So for non-Mac platforms this is the same as `ControlDown`
3895 and Macs this is the same as `MetaDown`.
3896 """
3897 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3898
3899 def HasModifiers(*args, **kwargs):
3900 """HasModifiers(self) -> bool"""
3901 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
3902
3903 def GetKeyCode(*args, **kwargs):
3904 """GetKeyCode(self) -> int"""
3905 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
3906
3907 KeyCode = GetKeyCode
3908 def GetUnicodeKey(*args, **kwargs):
3909 """GetUnicodeKey(self) -> int"""
3910 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
3911
3912 GetUniChar = GetUnicodeKey
3913 def GetRawKeyCode(*args, **kwargs):
3914 """GetRawKeyCode(self) -> unsigned int"""
3915 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
3916
3917 def GetRawKeyFlags(*args, **kwargs):
3918 """GetRawKeyFlags(self) -> unsigned int"""
3919 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
3920
3921 def GetPosition(*args, **kwargs):
3922 """
3923 GetPosition(self) -> Point
3924
3925 Find the position of the event.
3926 """
3927 return _core_.KeyEvent_GetPosition(*args, **kwargs)
3928
3929 def GetPositionTuple(*args, **kwargs):
3930 """
3931 GetPositionTuple() -> (x,y)
3932
3933 Find the position of the event.
3934 """
3935 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
3936
3937 def GetX(*args, **kwargs):
3938 """GetX(self) -> int"""
3939 return _core_.KeyEvent_GetX(*args, **kwargs)
3940
3941 def GetY(*args, **kwargs):
3942 """GetY(self) -> int"""
3943 return _core_.KeyEvent_GetY(*args, **kwargs)
3944
3945 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3946 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3947 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3948 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3949 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3950 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3951 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3952 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3953 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3954 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
3955
3956 class KeyEventPtr(KeyEvent):
3957 def __init__(self, this):
3958 self.this = this
3959 if not hasattr(self,"thisown"): self.thisown = 0
3960 self.__class__ = KeyEvent
3961 _core_.KeyEvent_swigregister(KeyEventPtr)
3962
3963 #---------------------------------------------------------------------------
3964
3965 class SizeEvent(Event):
3966 """Proxy of C++ SizeEvent class"""
3967 def __repr__(self):
3968 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3969 def __init__(self, *args, **kwargs):
3970 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
3971 newobj = _core_.new_SizeEvent(*args, **kwargs)
3972 self.this = newobj.this
3973 self.thisown = 1
3974 del newobj.thisown
3975 def GetSize(*args, **kwargs):
3976 """GetSize(self) -> Size"""
3977 return _core_.SizeEvent_GetSize(*args, **kwargs)
3978
3979 def GetRect(*args, **kwargs):
3980 """GetRect(self) -> Rect"""
3981 return _core_.SizeEvent_GetRect(*args, **kwargs)
3982
3983 def SetRect(*args, **kwargs):
3984 """SetRect(self, Rect rect)"""
3985 return _core_.SizeEvent_SetRect(*args, **kwargs)
3986
3987 def SetSize(*args, **kwargs):
3988 """SetSize(self, Size size)"""
3989 return _core_.SizeEvent_SetSize(*args, **kwargs)
3990
3991 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3992 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
3993
3994 class SizeEventPtr(SizeEvent):
3995 def __init__(self, this):
3996 self.this = this
3997 if not hasattr(self,"thisown"): self.thisown = 0
3998 self.__class__ = SizeEvent
3999 _core_.SizeEvent_swigregister(SizeEventPtr)
4000
4001 #---------------------------------------------------------------------------
4002
4003 class MoveEvent(Event):
4004 """Proxy of C++ MoveEvent class"""
4005 def __repr__(self):
4006 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4007 def __init__(self, *args, **kwargs):
4008 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
4009 newobj = _core_.new_MoveEvent(*args, **kwargs)
4010 self.this = newobj.this
4011 self.thisown = 1
4012 del newobj.thisown
4013 def GetPosition(*args, **kwargs):
4014 """GetPosition(self) -> Point"""
4015 return _core_.MoveEvent_GetPosition(*args, **kwargs)
4016
4017 def GetRect(*args, **kwargs):
4018 """GetRect(self) -> Rect"""
4019 return _core_.MoveEvent_GetRect(*args, **kwargs)
4020
4021 def SetRect(*args, **kwargs):
4022 """SetRect(self, Rect rect)"""
4023 return _core_.MoveEvent_SetRect(*args, **kwargs)
4024
4025 def SetPosition(*args, **kwargs):
4026 """SetPosition(self, Point pos)"""
4027 return _core_.MoveEvent_SetPosition(*args, **kwargs)
4028
4029 m_pos = property(GetPosition, SetPosition)
4030 m_rect = property(GetRect, SetRect)
4031
4032
4033 class MoveEventPtr(MoveEvent):
4034 def __init__(self, this):
4035 self.this = this
4036 if not hasattr(self,"thisown"): self.thisown = 0
4037 self.__class__ = MoveEvent
4038 _core_.MoveEvent_swigregister(MoveEventPtr)
4039
4040 #---------------------------------------------------------------------------
4041
4042 class PaintEvent(Event):
4043 """Proxy of C++ PaintEvent class"""
4044 def __repr__(self):
4045 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4046 def __init__(self, *args, **kwargs):
4047 """__init__(self, int Id=0) -> PaintEvent"""
4048 newobj = _core_.new_PaintEvent(*args, **kwargs)
4049 self.this = newobj.this
4050 self.thisown = 1
4051 del newobj.thisown
4052
4053 class PaintEventPtr(PaintEvent):
4054 def __init__(self, this):
4055 self.this = this
4056 if not hasattr(self,"thisown"): self.thisown = 0
4057 self.__class__ = PaintEvent
4058 _core_.PaintEvent_swigregister(PaintEventPtr)
4059
4060 class NcPaintEvent(Event):
4061 """Proxy of C++ NcPaintEvent class"""
4062 def __repr__(self):
4063 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4064 def __init__(self, *args, **kwargs):
4065 """__init__(self, int winid=0) -> NcPaintEvent"""
4066 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
4067 self.this = newobj.this
4068 self.thisown = 1
4069 del newobj.thisown
4070
4071 class NcPaintEventPtr(NcPaintEvent):
4072 def __init__(self, this):
4073 self.this = this
4074 if not hasattr(self,"thisown"): self.thisown = 0
4075 self.__class__ = NcPaintEvent
4076 _core_.NcPaintEvent_swigregister(NcPaintEventPtr)
4077
4078 #---------------------------------------------------------------------------
4079
4080 class EraseEvent(Event):
4081 """Proxy of C++ EraseEvent class"""
4082 def __repr__(self):
4083 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4084 def __init__(self, *args, **kwargs):
4085 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
4086 newobj = _core_.new_EraseEvent(*args, **kwargs)
4087 self.this = newobj.this
4088 self.thisown = 1
4089 del newobj.thisown
4090 def GetDC(*args, **kwargs):
4091 """GetDC(self) -> DC"""
4092 return _core_.EraseEvent_GetDC(*args, **kwargs)
4093
4094
4095 class EraseEventPtr(EraseEvent):
4096 def __init__(self, this):
4097 self.this = this
4098 if not hasattr(self,"thisown"): self.thisown = 0
4099 self.__class__ = EraseEvent
4100 _core_.EraseEvent_swigregister(EraseEventPtr)
4101
4102 #---------------------------------------------------------------------------
4103
4104 class FocusEvent(Event):
4105 """Proxy of C++ FocusEvent class"""
4106 def __repr__(self):
4107 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4108 def __init__(self, *args, **kwargs):
4109 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
4110 newobj = _core_.new_FocusEvent(*args, **kwargs)
4111 self.this = newobj.this
4112 self.thisown = 1
4113 del newobj.thisown
4114 def GetWindow(*args, **kwargs):
4115 """GetWindow(self) -> Window"""
4116 return _core_.FocusEvent_GetWindow(*args, **kwargs)
4117
4118 def SetWindow(*args, **kwargs):
4119 """SetWindow(self, Window win)"""
4120 return _core_.FocusEvent_SetWindow(*args, **kwargs)
4121
4122
4123 class FocusEventPtr(FocusEvent):
4124 def __init__(self, this):
4125 self.this = this
4126 if not hasattr(self,"thisown"): self.thisown = 0
4127 self.__class__ = FocusEvent
4128 _core_.FocusEvent_swigregister(FocusEventPtr)
4129
4130 #---------------------------------------------------------------------------
4131
4132 class ChildFocusEvent(CommandEvent):
4133 """Proxy of C++ ChildFocusEvent class"""
4134 def __repr__(self):
4135 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4136 def __init__(self, *args, **kwargs):
4137 """__init__(self, Window win=None) -> ChildFocusEvent"""
4138 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
4139 self.this = newobj.this
4140 self.thisown = 1
4141 del newobj.thisown
4142 def GetWindow(*args, **kwargs):
4143 """GetWindow(self) -> Window"""
4144 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
4145
4146
4147 class ChildFocusEventPtr(ChildFocusEvent):
4148 def __init__(self, this):
4149 self.this = this
4150 if not hasattr(self,"thisown"): self.thisown = 0
4151 self.__class__ = ChildFocusEvent
4152 _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
4153
4154 #---------------------------------------------------------------------------
4155
4156 class ActivateEvent(Event):
4157 """Proxy of C++ ActivateEvent class"""
4158 def __repr__(self):
4159 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4160 def __init__(self, *args, **kwargs):
4161 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
4162 newobj = _core_.new_ActivateEvent(*args, **kwargs)
4163 self.this = newobj.this
4164 self.thisown = 1
4165 del newobj.thisown
4166 def GetActive(*args, **kwargs):
4167 """GetActive(self) -> bool"""
4168 return _core_.ActivateEvent_GetActive(*args, **kwargs)
4169
4170
4171 class ActivateEventPtr(ActivateEvent):
4172 def __init__(self, this):
4173 self.this = this
4174 if not hasattr(self,"thisown"): self.thisown = 0
4175 self.__class__ = ActivateEvent
4176 _core_.ActivateEvent_swigregister(ActivateEventPtr)
4177
4178 #---------------------------------------------------------------------------
4179
4180 class InitDialogEvent(Event):
4181 """Proxy of C++ InitDialogEvent class"""
4182 def __repr__(self):
4183 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4184 def __init__(self, *args, **kwargs):
4185 """__init__(self, int Id=0) -> InitDialogEvent"""
4186 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
4187 self.this = newobj.this
4188 self.thisown = 1
4189 del newobj.thisown
4190
4191 class InitDialogEventPtr(InitDialogEvent):
4192 def __init__(self, this):
4193 self.this = this
4194 if not hasattr(self,"thisown"): self.thisown = 0
4195 self.__class__ = InitDialogEvent
4196 _core_.InitDialogEvent_swigregister(InitDialogEventPtr)
4197
4198 #---------------------------------------------------------------------------
4199
4200 class MenuEvent(Event):
4201 """Proxy of C++ MenuEvent class"""
4202 def __repr__(self):
4203 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4204 def __init__(self, *args, **kwargs):
4205 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
4206 newobj = _core_.new_MenuEvent(*args, **kwargs)
4207 self.this = newobj.this
4208 self.thisown = 1
4209 del newobj.thisown
4210 def GetMenuId(*args, **kwargs):
4211 """GetMenuId(self) -> int"""
4212 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
4213
4214 def IsPopup(*args, **kwargs):
4215 """IsPopup(self) -> bool"""
4216 return _core_.MenuEvent_IsPopup(*args, **kwargs)
4217
4218 def GetMenu(*args, **kwargs):
4219 """GetMenu(self) -> Menu"""
4220 return _core_.MenuEvent_GetMenu(*args, **kwargs)
4221
4222
4223 class MenuEventPtr(MenuEvent):
4224 def __init__(self, this):
4225 self.this = this
4226 if not hasattr(self,"thisown"): self.thisown = 0
4227 self.__class__ = MenuEvent
4228 _core_.MenuEvent_swigregister(MenuEventPtr)
4229
4230 #---------------------------------------------------------------------------
4231
4232 class CloseEvent(Event):
4233 """Proxy of C++ CloseEvent class"""
4234 def __repr__(self):
4235 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4236 def __init__(self, *args, **kwargs):
4237 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
4238 newobj = _core_.new_CloseEvent(*args, **kwargs)
4239 self.this = newobj.this
4240 self.thisown = 1
4241 del newobj.thisown
4242 def SetLoggingOff(*args, **kwargs):
4243 """SetLoggingOff(self, bool logOff)"""
4244 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
4245
4246 def GetLoggingOff(*args, **kwargs):
4247 """GetLoggingOff(self) -> bool"""
4248 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
4249
4250 def Veto(*args, **kwargs):
4251 """Veto(self, bool veto=True)"""
4252 return _core_.CloseEvent_Veto(*args, **kwargs)
4253
4254 def SetCanVeto(*args, **kwargs):
4255 """SetCanVeto(self, bool canVeto)"""
4256 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
4257
4258 def CanVeto(*args, **kwargs):
4259 """CanVeto(self) -> bool"""
4260 return _core_.CloseEvent_CanVeto(*args, **kwargs)
4261
4262 def GetVeto(*args, **kwargs):
4263 """GetVeto(self) -> bool"""
4264 return _core_.CloseEvent_GetVeto(*args, **kwargs)
4265
4266
4267 class CloseEventPtr(CloseEvent):
4268 def __init__(self, this):
4269 self.this = this
4270 if not hasattr(self,"thisown"): self.thisown = 0
4271 self.__class__ = CloseEvent
4272 _core_.CloseEvent_swigregister(CloseEventPtr)
4273
4274 #---------------------------------------------------------------------------
4275
4276 class ShowEvent(Event):
4277 """Proxy of C++ ShowEvent class"""
4278 def __repr__(self):
4279 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4280 def __init__(self, *args, **kwargs):
4281 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
4282 newobj = _core_.new_ShowEvent(*args, **kwargs)
4283 self.this = newobj.this
4284 self.thisown = 1
4285 del newobj.thisown
4286 def SetShow(*args, **kwargs):
4287 """SetShow(self, bool show)"""
4288 return _core_.ShowEvent_SetShow(*args, **kwargs)
4289
4290 def GetShow(*args, **kwargs):
4291 """GetShow(self) -> bool"""
4292 return _core_.ShowEvent_GetShow(*args, **kwargs)
4293
4294
4295 class ShowEventPtr(ShowEvent):
4296 def __init__(self, this):
4297 self.this = this
4298 if not hasattr(self,"thisown"): self.thisown = 0
4299 self.__class__ = ShowEvent
4300 _core_.ShowEvent_swigregister(ShowEventPtr)
4301
4302 #---------------------------------------------------------------------------
4303
4304 class IconizeEvent(Event):
4305 """Proxy of C++ IconizeEvent class"""
4306 def __repr__(self):
4307 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4308 def __init__(self, *args, **kwargs):
4309 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
4310 newobj = _core_.new_IconizeEvent(*args, **kwargs)
4311 self.this = newobj.this
4312 self.thisown = 1
4313 del newobj.thisown
4314 def Iconized(*args, **kwargs):
4315 """Iconized(self) -> bool"""
4316 return _core_.IconizeEvent_Iconized(*args, **kwargs)
4317
4318
4319 class IconizeEventPtr(IconizeEvent):
4320 def __init__(self, this):
4321 self.this = this
4322 if not hasattr(self,"thisown"): self.thisown = 0
4323 self.__class__ = IconizeEvent
4324 _core_.IconizeEvent_swigregister(IconizeEventPtr)
4325
4326 #---------------------------------------------------------------------------
4327
4328 class MaximizeEvent(Event):
4329 """Proxy of C++ MaximizeEvent class"""
4330 def __repr__(self):
4331 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4332 def __init__(self, *args, **kwargs):
4333 """__init__(self, int id=0) -> MaximizeEvent"""
4334 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
4335 self.this = newobj.this
4336 self.thisown = 1
4337 del newobj.thisown
4338
4339 class MaximizeEventPtr(MaximizeEvent):
4340 def __init__(self, this):
4341 self.this = this
4342 if not hasattr(self,"thisown"): self.thisown = 0
4343 self.__class__ = MaximizeEvent
4344 _core_.MaximizeEvent_swigregister(MaximizeEventPtr)
4345
4346 #---------------------------------------------------------------------------
4347
4348 class DropFilesEvent(Event):
4349 """Proxy of C++ DropFilesEvent class"""
4350 def __init__(self): raise RuntimeError, "No constructor defined"
4351 def __repr__(self):
4352 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4353 def GetPosition(*args, **kwargs):
4354 """GetPosition(self) -> Point"""
4355 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
4356
4357 def GetNumberOfFiles(*args, **kwargs):
4358 """GetNumberOfFiles(self) -> int"""
4359 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
4360
4361 def GetFiles(*args, **kwargs):
4362 """GetFiles(self) -> PyObject"""
4363 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
4364
4365
4366 class DropFilesEventPtr(DropFilesEvent):
4367 def __init__(self, this):
4368 self.this = this
4369 if not hasattr(self,"thisown"): self.thisown = 0
4370 self.__class__ = DropFilesEvent
4371 _core_.DropFilesEvent_swigregister(DropFilesEventPtr)
4372
4373 #---------------------------------------------------------------------------
4374
4375 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4376 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
4377 class UpdateUIEvent(CommandEvent):
4378 """Proxy of C++ UpdateUIEvent class"""
4379 def __repr__(self):
4380 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4381 def __init__(self, *args, **kwargs):
4382 """__init__(self, int commandId=0) -> UpdateUIEvent"""
4383 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
4384 self.this = newobj.this
4385 self.thisown = 1
4386 del newobj.thisown
4387 def GetChecked(*args, **kwargs):
4388 """GetChecked(self) -> bool"""
4389 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
4390
4391 def GetEnabled(*args, **kwargs):
4392 """GetEnabled(self) -> bool"""
4393 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
4394
4395 def GetText(*args, **kwargs):
4396 """GetText(self) -> String"""
4397 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
4398
4399 def GetSetText(*args, **kwargs):
4400 """GetSetText(self) -> bool"""
4401 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
4402
4403 def GetSetChecked(*args, **kwargs):
4404 """GetSetChecked(self) -> bool"""
4405 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
4406
4407 def GetSetEnabled(*args, **kwargs):
4408 """GetSetEnabled(self) -> bool"""
4409 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
4410
4411 def Check(*args, **kwargs):
4412 """Check(self, bool check)"""
4413 return _core_.UpdateUIEvent_Check(*args, **kwargs)
4414
4415 def Enable(*args, **kwargs):
4416 """Enable(self, bool enable)"""
4417 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
4418
4419 def SetText(*args, **kwargs):
4420 """SetText(self, String text)"""
4421 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
4422
4423 def SetUpdateInterval(*args, **kwargs):
4424 """SetUpdateInterval(long updateInterval)"""
4425 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4426
4427 SetUpdateInterval = staticmethod(SetUpdateInterval)
4428 def GetUpdateInterval(*args, **kwargs):
4429 """GetUpdateInterval() -> long"""
4430 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4431
4432 GetUpdateInterval = staticmethod(GetUpdateInterval)
4433 def CanUpdate(*args, **kwargs):
4434 """CanUpdate(Window win) -> bool"""
4435 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4436
4437 CanUpdate = staticmethod(CanUpdate)
4438 def ResetUpdateTime(*args, **kwargs):
4439 """ResetUpdateTime()"""
4440 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4441
4442 ResetUpdateTime = staticmethod(ResetUpdateTime)
4443 def SetMode(*args, **kwargs):
4444 """SetMode(int mode)"""
4445 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4446
4447 SetMode = staticmethod(SetMode)
4448 def GetMode(*args, **kwargs):
4449 """GetMode() -> int"""
4450 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4451
4452 GetMode = staticmethod(GetMode)
4453
4454 class UpdateUIEventPtr(UpdateUIEvent):
4455 def __init__(self, this):
4456 self.this = this
4457 if not hasattr(self,"thisown"): self.thisown = 0
4458 self.__class__ = UpdateUIEvent
4459 _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
4460
4461 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4462 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
4463 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4464
4465 def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4466 """UpdateUIEvent_GetUpdateInterval() -> long"""
4467 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4468
4469 def UpdateUIEvent_CanUpdate(*args, **kwargs):
4470 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
4471 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4472
4473 def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4474 """UpdateUIEvent_ResetUpdateTime()"""
4475 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4476
4477 def UpdateUIEvent_SetMode(*args, **kwargs):
4478 """UpdateUIEvent_SetMode(int mode)"""
4479 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4480
4481 def UpdateUIEvent_GetMode(*args, **kwargs):
4482 """UpdateUIEvent_GetMode() -> int"""
4483 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4484
4485 #---------------------------------------------------------------------------
4486
4487 class SysColourChangedEvent(Event):
4488 """Proxy of C++ SysColourChangedEvent class"""
4489 def __repr__(self):
4490 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4491 def __init__(self, *args, **kwargs):
4492 """__init__(self) -> SysColourChangedEvent"""
4493 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
4494 self.this = newobj.this
4495 self.thisown = 1
4496 del newobj.thisown
4497
4498 class SysColourChangedEventPtr(SysColourChangedEvent):
4499 def __init__(self, this):
4500 self.this = this
4501 if not hasattr(self,"thisown"): self.thisown = 0
4502 self.__class__ = SysColourChangedEvent
4503 _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
4504
4505 #---------------------------------------------------------------------------
4506
4507 class MouseCaptureChangedEvent(Event):
4508 """Proxy of C++ MouseCaptureChangedEvent class"""
4509 def __repr__(self):
4510 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4511 def __init__(self, *args, **kwargs):
4512 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
4513 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
4514 self.this = newobj.this
4515 self.thisown = 1
4516 del newobj.thisown
4517 def GetCapturedWindow(*args, **kwargs):
4518 """GetCapturedWindow(self) -> Window"""
4519 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
4520
4521
4522 class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4523 def __init__(self, this):
4524 self.this = this
4525 if not hasattr(self,"thisown"): self.thisown = 0
4526 self.__class__ = MouseCaptureChangedEvent
4527 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
4528
4529 #---------------------------------------------------------------------------
4530
4531 class DisplayChangedEvent(Event):
4532 """Proxy of C++ DisplayChangedEvent class"""
4533 def __repr__(self):
4534 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4535 def __init__(self, *args, **kwargs):
4536 """__init__(self) -> DisplayChangedEvent"""
4537 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
4538 self.this = newobj.this
4539 self.thisown = 1
4540 del newobj.thisown
4541
4542 class DisplayChangedEventPtr(DisplayChangedEvent):
4543 def __init__(self, this):
4544 self.this = this
4545 if not hasattr(self,"thisown"): self.thisown = 0
4546 self.__class__ = DisplayChangedEvent
4547 _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
4548
4549 #---------------------------------------------------------------------------
4550
4551 class PaletteChangedEvent(Event):
4552 """Proxy of C++ PaletteChangedEvent class"""
4553 def __repr__(self):
4554 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4555 def __init__(self, *args, **kwargs):
4556 """__init__(self, int id=0) -> PaletteChangedEvent"""
4557 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
4558 self.this = newobj.this
4559 self.thisown = 1
4560 del newobj.thisown
4561 def SetChangedWindow(*args, **kwargs):
4562 """SetChangedWindow(self, Window win)"""
4563 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
4564
4565 def GetChangedWindow(*args, **kwargs):
4566 """GetChangedWindow(self) -> Window"""
4567 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
4568
4569
4570 class PaletteChangedEventPtr(PaletteChangedEvent):
4571 def __init__(self, this):
4572 self.this = this
4573 if not hasattr(self,"thisown"): self.thisown = 0
4574 self.__class__ = PaletteChangedEvent
4575 _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
4576
4577 #---------------------------------------------------------------------------
4578
4579 class QueryNewPaletteEvent(Event):
4580 """Proxy of C++ QueryNewPaletteEvent class"""
4581 def __repr__(self):
4582 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4583 def __init__(self, *args, **kwargs):
4584 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
4585 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
4586 self.this = newobj.this
4587 self.thisown = 1
4588 del newobj.thisown
4589 def SetPaletteRealized(*args, **kwargs):
4590 """SetPaletteRealized(self, bool realized)"""
4591 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
4592
4593 def GetPaletteRealized(*args, **kwargs):
4594 """GetPaletteRealized(self) -> bool"""
4595 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
4596
4597
4598 class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4599 def __init__(self, this):
4600 self.this = this
4601 if not hasattr(self,"thisown"): self.thisown = 0
4602 self.__class__ = QueryNewPaletteEvent
4603 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
4604
4605 #---------------------------------------------------------------------------
4606
4607 class NavigationKeyEvent(Event):
4608 """Proxy of C++ NavigationKeyEvent class"""
4609 def __repr__(self):
4610 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4611 def __init__(self, *args, **kwargs):
4612 """__init__(self) -> NavigationKeyEvent"""
4613 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
4614 self.this = newobj.this
4615 self.thisown = 1
4616 del newobj.thisown
4617 def GetDirection(*args, **kwargs):
4618 """GetDirection(self) -> bool"""
4619 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
4620
4621 def SetDirection(*args, **kwargs):
4622 """SetDirection(self, bool forward)"""
4623 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
4624
4625 def IsWindowChange(*args, **kwargs):
4626 """IsWindowChange(self) -> bool"""
4627 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
4628
4629 def SetWindowChange(*args, **kwargs):
4630 """SetWindowChange(self, bool ischange)"""
4631 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
4632
4633 def IsFromTab(*args, **kwargs):
4634 """IsFromTab(self) -> bool"""
4635 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
4636
4637 def SetFromTab(*args, **kwargs):
4638 """SetFromTab(self, bool bIs)"""
4639 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
4640
4641 def SetFlags(*args, **kwargs):
4642 """SetFlags(self, long flags)"""
4643 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4644
4645 def GetCurrentFocus(*args, **kwargs):
4646 """GetCurrentFocus(self) -> Window"""
4647 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
4648
4649 def SetCurrentFocus(*args, **kwargs):
4650 """SetCurrentFocus(self, Window win)"""
4651 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
4652
4653 IsBackward = _core_.NavigationKeyEvent_IsBackward
4654 IsForward = _core_.NavigationKeyEvent_IsForward
4655 WinChange = _core_.NavigationKeyEvent_WinChange
4656 FromTab = _core_.NavigationKeyEvent_FromTab
4657
4658 class NavigationKeyEventPtr(NavigationKeyEvent):
4659 def __init__(self, this):
4660 self.this = this
4661 if not hasattr(self,"thisown"): self.thisown = 0
4662 self.__class__ = NavigationKeyEvent
4663 _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
4664
4665 #---------------------------------------------------------------------------
4666
4667 class WindowCreateEvent(CommandEvent):
4668 """Proxy of C++ WindowCreateEvent class"""
4669 def __repr__(self):
4670 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4671 def __init__(self, *args, **kwargs):
4672 """__init__(self, Window win=None) -> WindowCreateEvent"""
4673 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
4674 self.this = newobj.this
4675 self.thisown = 1
4676 del newobj.thisown
4677 def GetWindow(*args, **kwargs):
4678 """GetWindow(self) -> Window"""
4679 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
4680
4681
4682 class WindowCreateEventPtr(WindowCreateEvent):
4683 def __init__(self, this):
4684 self.this = this
4685 if not hasattr(self,"thisown"): self.thisown = 0
4686 self.__class__ = WindowCreateEvent
4687 _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
4688
4689 class WindowDestroyEvent(CommandEvent):
4690 """Proxy of C++ WindowDestroyEvent class"""
4691 def __repr__(self):
4692 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4693 def __init__(self, *args, **kwargs):
4694 """__init__(self, Window win=None) -> WindowDestroyEvent"""
4695 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
4696 self.this = newobj.this
4697 self.thisown = 1
4698 del newobj.thisown
4699 def GetWindow(*args, **kwargs):
4700 """GetWindow(self) -> Window"""
4701 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
4702
4703
4704 class WindowDestroyEventPtr(WindowDestroyEvent):
4705 def __init__(self, this):
4706 self.this = this
4707 if not hasattr(self,"thisown"): self.thisown = 0
4708 self.__class__ = WindowDestroyEvent
4709 _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
4710
4711 #---------------------------------------------------------------------------
4712
4713 class ContextMenuEvent(CommandEvent):
4714 """Proxy of C++ ContextMenuEvent class"""
4715 def __repr__(self):
4716 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4717 def __init__(self, *args, **kwargs):
4718 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
4719 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
4720 self.this = newobj.this
4721 self.thisown = 1
4722 del newobj.thisown
4723 def GetPosition(*args, **kwargs):
4724 """GetPosition(self) -> Point"""
4725 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
4726
4727 def SetPosition(*args, **kwargs):
4728 """SetPosition(self, Point pos)"""
4729 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
4730
4731
4732 class ContextMenuEventPtr(ContextMenuEvent):
4733 def __init__(self, this):
4734 self.this = this
4735 if not hasattr(self,"thisown"): self.thisown = 0
4736 self.__class__ = ContextMenuEvent
4737 _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
4738
4739 #---------------------------------------------------------------------------
4740
4741 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4742 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
4743 class IdleEvent(Event):
4744 """Proxy of C++ IdleEvent class"""
4745 def __repr__(self):
4746 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4747 def __init__(self, *args, **kwargs):
4748 """__init__(self) -> IdleEvent"""
4749 newobj = _core_.new_IdleEvent(*args, **kwargs)
4750 self.this = newobj.this
4751 self.thisown = 1
4752 del newobj.thisown
4753 def RequestMore(*args, **kwargs):
4754 """RequestMore(self, bool needMore=True)"""
4755 return _core_.IdleEvent_RequestMore(*args, **kwargs)
4756
4757 def MoreRequested(*args, **kwargs):
4758 """MoreRequested(self) -> bool"""
4759 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
4760
4761 def SetMode(*args, **kwargs):
4762 """SetMode(int mode)"""
4763 return _core_.IdleEvent_SetMode(*args, **kwargs)
4764
4765 SetMode = staticmethod(SetMode)
4766 def GetMode(*args, **kwargs):
4767 """GetMode() -> int"""
4768 return _core_.IdleEvent_GetMode(*args, **kwargs)
4769
4770 GetMode = staticmethod(GetMode)
4771 def CanSend(*args, **kwargs):
4772 """CanSend(Window win) -> bool"""
4773 return _core_.IdleEvent_CanSend(*args, **kwargs)
4774
4775 CanSend = staticmethod(CanSend)
4776
4777 class IdleEventPtr(IdleEvent):
4778 def __init__(self, this):
4779 self.this = this
4780 if not hasattr(self,"thisown"): self.thisown = 0
4781 self.__class__ = IdleEvent
4782 _core_.IdleEvent_swigregister(IdleEventPtr)
4783
4784 def IdleEvent_SetMode(*args, **kwargs):
4785 """IdleEvent_SetMode(int mode)"""
4786 return _core_.IdleEvent_SetMode(*args, **kwargs)
4787
4788 def IdleEvent_GetMode(*args, **kwargs):
4789 """IdleEvent_GetMode() -> int"""
4790 return _core_.IdleEvent_GetMode(*args, **kwargs)
4791
4792 def IdleEvent_CanSend(*args, **kwargs):
4793 """IdleEvent_CanSend(Window win) -> bool"""
4794 return _core_.IdleEvent_CanSend(*args, **kwargs)
4795
4796 #---------------------------------------------------------------------------
4797
4798 class PyEvent(Event):
4799 """Proxy of C++ PyEvent class"""
4800 def __repr__(self):
4801 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4802 def __init__(self, *args, **kwargs):
4803 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
4804 newobj = _core_.new_PyEvent(*args, **kwargs)
4805 self.this = newobj.this
4806 self.thisown = 1
4807 del newobj.thisown
4808 self.SetSelf(self)
4809
4810 def __del__(self, destroy=_core_.delete_PyEvent):
4811 """__del__(self)"""
4812 try:
4813 if self.thisown: destroy(self)
4814 except: pass
4815
4816 def SetSelf(*args, **kwargs):
4817 """SetSelf(self, PyObject self)"""
4818 return _core_.PyEvent_SetSelf(*args, **kwargs)
4819
4820 def GetSelf(*args, **kwargs):
4821 """GetSelf(self) -> PyObject"""
4822 return _core_.PyEvent_GetSelf(*args, **kwargs)
4823
4824
4825 class PyEventPtr(PyEvent):
4826 def __init__(self, this):
4827 self.this = this
4828 if not hasattr(self,"thisown"): self.thisown = 0
4829 self.__class__ = PyEvent
4830 _core_.PyEvent_swigregister(PyEventPtr)
4831
4832 class PyCommandEvent(CommandEvent):
4833 """Proxy of C++ PyCommandEvent class"""
4834 def __repr__(self):
4835 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4836 def __init__(self, *args, **kwargs):
4837 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
4838 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
4839 self.this = newobj.this
4840 self.thisown = 1
4841 del newobj.thisown
4842 self.SetSelf(self)
4843
4844 def __del__(self, destroy=_core_.delete_PyCommandEvent):
4845 """__del__(self)"""
4846 try:
4847 if self.thisown: destroy(self)
4848 except: pass
4849
4850 def SetSelf(*args, **kwargs):
4851 """SetSelf(self, PyObject self)"""
4852 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
4853
4854 def GetSelf(*args, **kwargs):
4855 """GetSelf(self) -> PyObject"""
4856 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
4857
4858
4859 class PyCommandEventPtr(PyCommandEvent):
4860 def __init__(self, this):
4861 self.this = this
4862 if not hasattr(self,"thisown"): self.thisown = 0
4863 self.__class__ = PyCommandEvent
4864 _core_.PyCommandEvent_swigregister(PyCommandEventPtr)
4865
4866 class DateEvent(CommandEvent):
4867 """Proxy of C++ DateEvent class"""
4868 def __repr__(self):
4869 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4870 def __init__(self, *args, **kwargs):
4871 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
4872 newobj = _core_.new_DateEvent(*args, **kwargs)
4873 self.this = newobj.this
4874 self.thisown = 1
4875 del newobj.thisown
4876 def GetDate(*args, **kwargs):
4877 """GetDate(self) -> DateTime"""
4878 return _core_.DateEvent_GetDate(*args, **kwargs)
4879
4880 def SetDate(*args, **kwargs):
4881 """SetDate(self, DateTime date)"""
4882 return _core_.DateEvent_SetDate(*args, **kwargs)
4883
4884
4885 class DateEventPtr(DateEvent):
4886 def __init__(self, this):
4887 self.this = this
4888 if not hasattr(self,"thisown"): self.thisown = 0
4889 self.__class__ = DateEvent
4890 _core_.DateEvent_swigregister(DateEventPtr)
4891
4892 wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
4893 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
4894
4895 #---------------------------------------------------------------------------
4896
4897 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4898 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4899 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4900 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4901 PRINT_WINDOWS = _core_.PRINT_WINDOWS
4902 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
4903 class PyApp(EvtHandler):
4904 """
4905 The ``wx.PyApp`` class is an *implementation detail*, please use the
4906 `wx.App` class (or some other derived class) instead.
4907 """
4908 def __repr__(self):
4909 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4910 def __init__(self, *args, **kwargs):
4911 """
4912 __init__(self) -> PyApp
4913
4914 Create a new application object, starting the bootstrap process.
4915 """
4916 newobj = _core_.new_PyApp(*args, **kwargs)
4917 self.this = newobj.this
4918 self.thisown = 1
4919 del newobj.thisown
4920 self._setCallbackInfo(self, PyApp)
4921 self._setOORInfo(self)
4922
4923 def __del__(self, destroy=_core_.delete_PyApp):
4924 """__del__(self)"""
4925 try:
4926 if self.thisown: destroy(self)
4927 except: pass
4928
4929 def _setCallbackInfo(*args, **kwargs):
4930 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
4931 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
4932
4933 def GetAppName(*args, **kwargs):
4934 """
4935 GetAppName(self) -> String
4936
4937 Get the application name.
4938 """
4939 return _core_.PyApp_GetAppName(*args, **kwargs)
4940
4941 def SetAppName(*args, **kwargs):
4942 """
4943 SetAppName(self, String name)
4944
4945 Set the application name. This value may be used automatically by
4946 `wx.Config` and such.
4947 """
4948 return _core_.PyApp_SetAppName(*args, **kwargs)
4949
4950 def GetClassName(*args, **kwargs):
4951 """
4952 GetClassName(self) -> String
4953
4954 Get the application's class name.
4955 """
4956 return _core_.PyApp_GetClassName(*args, **kwargs)
4957
4958 def SetClassName(*args, **kwargs):
4959 """
4960 SetClassName(self, String name)
4961
4962 Set the application's class name. This value may be used for
4963 X-resources if applicable for the platform
4964 """
4965 return _core_.PyApp_SetClassName(*args, **kwargs)
4966
4967 def GetVendorName(*args, **kwargs):
4968 """
4969 GetVendorName(self) -> String
4970
4971 Get the application's vendor name.
4972 """
4973 return _core_.PyApp_GetVendorName(*args, **kwargs)
4974
4975 def SetVendorName(*args, **kwargs):
4976 """
4977 SetVendorName(self, String name)
4978
4979 Set the application's vendor name. This value may be used
4980 automatically by `wx.Config` and such.
4981 """
4982 return _core_.PyApp_SetVendorName(*args, **kwargs)
4983
4984 def GetTraits(*args, **kwargs):
4985 """
4986 GetTraits(self) -> wxAppTraits
4987
4988 Return (and create if necessary) the app traits object to which we
4989 delegate for everything which either should be configurable by the
4990 user (then he can change the default behaviour simply by overriding
4991 CreateTraits() and returning his own traits object) or which is
4992 GUI/console dependent as then wx.AppTraits allows us to abstract the
4993 differences behind the common facade.
4994
4995 :todo: Add support for overriding CreateAppTraits in wxPython.
4996 """
4997 return _core_.PyApp_GetTraits(*args, **kwargs)
4998
4999 def ProcessPendingEvents(*args, **kwargs):
5000 """
5001 ProcessPendingEvents(self)
5002
5003 Process all events in the Pending Events list -- it is necessary to
5004 call this function to process posted events. This normally happens
5005 during each event loop iteration.
5006 """
5007 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
5008
5009 def Yield(*args, **kwargs):
5010 """
5011 Yield(self, bool onlyIfNeeded=False) -> bool
5012
5013 Process all currently pending events right now, instead of waiting
5014 until return to the event loop. It is an error to call ``Yield``
5015 recursively unless the value of ``onlyIfNeeded`` is True.
5016
5017 :warning: This function is dangerous as it can lead to unexpected
5018 reentrancies (i.e. when called from an event handler it may
5019 result in calling the same event handler again), use with
5020 extreme care or, better, don't use at all!
5021
5022 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
5023
5024 """
5025 return _core_.PyApp_Yield(*args, **kwargs)
5026
5027 def WakeUpIdle(*args, **kwargs):
5028 """
5029 WakeUpIdle(self)
5030
5031 Make sure that idle events are sent again.
5032 :see: `wx.WakeUpIdle`
5033 """
5034 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
5035
5036 def IsMainLoopRunning(*args, **kwargs):
5037 """
5038 IsMainLoopRunning() -> bool
5039
5040 Returns True if we're running the main loop, i.e. if the events can
5041 currently be dispatched.
5042 """
5043 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5044
5045 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
5046 def MainLoop(*args, **kwargs):
5047 """
5048 MainLoop(self) -> int
5049
5050 Execute the main GUI loop, the function doesn't normally return until
5051 all top level windows have been closed and destroyed.
5052 """
5053 return _core_.PyApp_MainLoop(*args, **kwargs)
5054
5055 def Exit(*args, **kwargs):
5056 """
5057 Exit(self)
5058
5059 Exit the main loop thus terminating the application.
5060 :see: `wx.Exit`
5061 """
5062 return _core_.PyApp_Exit(*args, **kwargs)
5063
5064 def ExitMainLoop(*args, **kwargs):
5065 """
5066 ExitMainLoop(self)
5067
5068 Exit the main GUI loop during the next iteration of the main
5069 loop, (i.e. it does not stop the program immediately!)
5070 """
5071 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
5072
5073 def Pending(*args, **kwargs):
5074 """
5075 Pending(self) -> bool
5076
5077 Returns True if there are unprocessed events in the event queue.
5078 """
5079 return _core_.PyApp_Pending(*args, **kwargs)
5080
5081 def Dispatch(*args, **kwargs):
5082 """
5083 Dispatch(self) -> bool
5084
5085 Process the first event in the event queue (blocks until an event
5086 appears if there are none currently)
5087 """
5088 return _core_.PyApp_Dispatch(*args, **kwargs)
5089
5090 def ProcessIdle(*args, **kwargs):
5091 """
5092 ProcessIdle(self) -> bool
5093
5094 Called from the MainLoop when the application becomes idle (there are
5095 no pending events) and sends a `wx.IdleEvent` to all interested
5096 parties. Returns True if more idle events are needed, False if not.
5097 """
5098 return _core_.PyApp_ProcessIdle(*args, **kwargs)
5099
5100 def SendIdleEvents(*args, **kwargs):
5101 """
5102 SendIdleEvents(self, Window win, IdleEvent event) -> bool
5103
5104 Send idle event to window and all subwindows. Returns True if more
5105 idle time is requested.
5106 """
5107 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
5108
5109 def IsActive(*args, **kwargs):
5110 """
5111 IsActive(self) -> bool
5112
5113 Return True if our app has focus.
5114 """
5115 return _core_.PyApp_IsActive(*args, **kwargs)
5116
5117 def SetTopWindow(*args, **kwargs):
5118 """
5119 SetTopWindow(self, Window win)
5120
5121 Set the *main* top level window
5122 """
5123 return _core_.PyApp_SetTopWindow(*args, **kwargs)
5124
5125 def GetTopWindow(*args, **kwargs):
5126 """
5127 GetTopWindow(self) -> Window
5128
5129 Return the *main* top level window (if it hadn't been set previously
5130 with SetTopWindow(), will return just some top level window and, if
5131 there not any, will return None)
5132 """
5133 return _core_.PyApp_GetTopWindow(*args, **kwargs)
5134
5135 def SetExitOnFrameDelete(*args, **kwargs):
5136 """
5137 SetExitOnFrameDelete(self, bool flag)
5138
5139 Control the exit behaviour: by default, the program will exit the main
5140 loop (and so, usually, terminate) when the last top-level program
5141 window is deleted. Beware that if you disable this behaviour (with
5142 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
5143 explicitly from somewhere.
5144 """
5145 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
5146
5147 def GetExitOnFrameDelete(*args, **kwargs):
5148 """
5149 GetExitOnFrameDelete(self) -> bool
5150
5151 Get the current exit behaviour setting.
5152 """
5153 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
5154
5155 def SetUseBestVisual(*args, **kwargs):
5156 """
5157 SetUseBestVisual(self, bool flag)
5158
5159 Set whether the app should try to use the best available visual on
5160 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
5161 """
5162 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
5163
5164 def GetUseBestVisual(*args, **kwargs):
5165 """
5166 GetUseBestVisual(self) -> bool
5167
5168 Get current UseBestVisual setting.
5169 """
5170 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
5171
5172 def SetPrintMode(*args, **kwargs):
5173 """SetPrintMode(self, int mode)"""
5174 return _core_.PyApp_SetPrintMode(*args, **kwargs)
5175
5176 def GetPrintMode(*args, **kwargs):
5177 """GetPrintMode(self) -> int"""
5178 return _core_.PyApp_GetPrintMode(*args, **kwargs)
5179
5180 def SetAssertMode(*args, **kwargs):
5181 """
5182 SetAssertMode(self, int mode)
5183
5184 Set the OnAssert behaviour for debug and hybrid builds.
5185 """
5186 return _core_.PyApp_SetAssertMode(*args, **kwargs)
5187
5188 def GetAssertMode(*args, **kwargs):
5189 """
5190 GetAssertMode(self) -> int
5191
5192 Get the current OnAssert behaviour setting.
5193 """
5194 return _core_.PyApp_GetAssertMode(*args, **kwargs)
5195
5196 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
5197 """GetMacSupportPCMenuShortcuts() -> bool"""
5198 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5199
5200 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
5201 def GetMacAboutMenuItemId(*args, **kwargs):
5202 """GetMacAboutMenuItemId() -> long"""
5203 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5204
5205 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
5206 def GetMacPreferencesMenuItemId(*args, **kwargs):
5207 """GetMacPreferencesMenuItemId() -> long"""
5208 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5209
5210 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
5211 def GetMacExitMenuItemId(*args, **kwargs):
5212 """GetMacExitMenuItemId() -> long"""
5213 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5214
5215 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
5216 def GetMacHelpMenuTitleName(*args, **kwargs):
5217 """GetMacHelpMenuTitleName() -> String"""
5218 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5219
5220 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
5221 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
5222 """SetMacSupportPCMenuShortcuts(bool val)"""
5223 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5224
5225 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
5226 def SetMacAboutMenuItemId(*args, **kwargs):
5227 """SetMacAboutMenuItemId(long val)"""
5228 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5229
5230 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
5231 def SetMacPreferencesMenuItemId(*args, **kwargs):
5232 """SetMacPreferencesMenuItemId(long val)"""
5233 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5234
5235 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
5236 def SetMacExitMenuItemId(*args, **kwargs):
5237 """SetMacExitMenuItemId(long val)"""
5238 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5239
5240 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
5241 def SetMacHelpMenuTitleName(*args, **kwargs):
5242 """SetMacHelpMenuTitleName(String val)"""
5243 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5244
5245 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
5246 def _BootstrapApp(*args, **kwargs):
5247 """
5248 _BootstrapApp(self)
5249
5250 For internal use only
5251 """
5252 return _core_.PyApp__BootstrapApp(*args, **kwargs)
5253
5254 def GetComCtl32Version(*args, **kwargs):
5255 """
5256 GetComCtl32Version() -> int
5257
5258 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5259 it wasn't found at all. Raises an exception on non-Windows platforms.
5260 """
5261 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5262
5263 GetComCtl32Version = staticmethod(GetComCtl32Version)
5264
5265 class PyAppPtr(PyApp):
5266 def __init__(self, this):
5267 self.this = this
5268 if not hasattr(self,"thisown"): self.thisown = 0
5269 self.__class__ = PyApp
5270 _core_.PyApp_swigregister(PyAppPtr)
5271
5272 def PyApp_IsMainLoopRunning(*args, **kwargs):
5273 """
5274 PyApp_IsMainLoopRunning() -> bool
5275
5276 Returns True if we're running the main loop, i.e. if the events can
5277 currently be dispatched.
5278 """
5279 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5280
5281 def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5282 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
5283 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5284
5285 def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5286 """PyApp_GetMacAboutMenuItemId() -> long"""
5287 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5288
5289 def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5290 """PyApp_GetMacPreferencesMenuItemId() -> long"""
5291 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5292
5293 def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5294 """PyApp_GetMacExitMenuItemId() -> long"""
5295 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5296
5297 def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
5298 """PyApp_GetMacHelpMenuTitleName() -> String"""
5299 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5300
5301 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5302 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
5303 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5304
5305 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5306 """PyApp_SetMacAboutMenuItemId(long val)"""
5307 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5308
5309 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5310 """PyApp_SetMacPreferencesMenuItemId(long val)"""
5311 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5312
5313 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5314 """PyApp_SetMacExitMenuItemId(long val)"""
5315 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5316
5317 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
5318 """PyApp_SetMacHelpMenuTitleName(String val)"""
5319 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5320
5321 def PyApp_GetComCtl32Version(*args, **kwargs):
5322 """
5323 PyApp_GetComCtl32Version() -> int
5324
5325 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5326 it wasn't found at all. Raises an exception on non-Windows platforms.
5327 """
5328 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5329
5330 #---------------------------------------------------------------------------
5331
5332
5333 def Exit(*args, **kwargs):
5334 """
5335 Exit()
5336
5337 Force an exit of the application. Convenience for wx.GetApp().Exit()
5338 """
5339 return _core_.Exit(*args, **kwargs)
5340
5341 def Yield(*args, **kwargs):
5342 """
5343 Yield() -> bool
5344
5345 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5346 """
5347 return _core_.Yield(*args, **kwargs)
5348
5349 def YieldIfNeeded(*args, **kwargs):
5350 """
5351 YieldIfNeeded() -> bool
5352
5353 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5354 """
5355 return _core_.YieldIfNeeded(*args, **kwargs)
5356
5357 def SafeYield(*args, **kwargs):
5358 """
5359 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
5360
5361 This function is similar to `wx.Yield`, except that it disables the
5362 user input to all program windows before calling `wx.Yield` and
5363 re-enables it again afterwards. If ``win`` is not None, this window
5364 will remain enabled, allowing the implementation of some limited user
5365 interaction.
5366
5367 :Returns: the result of the call to `wx.Yield`.
5368 """
5369 return _core_.SafeYield(*args, **kwargs)
5370
5371 def WakeUpIdle(*args, **kwargs):
5372 """
5373 WakeUpIdle()
5374
5375 Cause the message queue to become empty again, so idle events will be
5376 sent.
5377 """
5378 return _core_.WakeUpIdle(*args, **kwargs)
5379
5380 def PostEvent(*args, **kwargs):
5381 """
5382 PostEvent(EvtHandler dest, Event event)
5383
5384 Send an event to a window or other wx.EvtHandler to be processed
5385 later.
5386 """
5387 return _core_.PostEvent(*args, **kwargs)
5388
5389 def App_CleanUp(*args, **kwargs):
5390 """
5391 App_CleanUp()
5392
5393 For internal use only, it is used to cleanup after wxWidgets when
5394 Python shuts down.
5395 """
5396 return _core_.App_CleanUp(*args, **kwargs)
5397
5398 def GetApp(*args, **kwargs):
5399 """
5400 GetApp() -> PyApp
5401
5402 Return a reference to the current wx.App object.
5403 """
5404 return _core_.GetApp(*args, **kwargs)
5405
5406 def SetDefaultPyEncoding(*args, **kwargs):
5407 """
5408 SetDefaultPyEncoding(string encoding)
5409
5410 Sets the encoding that wxPython will use when it needs to convert a
5411 Python string or unicode object to or from a wxString.
5412
5413 The default encoding is the value of ``locale.getdefaultlocale()[1]``
5414 but please be aware that the default encoding within the same locale
5415 may be slightly different on different platforms. For example, please
5416 see http://www.alanwood.net/demos/charsetdiffs.html for differences
5417 between the common latin/roman encodings.
5418 """
5419 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5420
5421 def GetDefaultPyEncoding(*args, **kwargs):
5422 """
5423 GetDefaultPyEncoding() -> string
5424
5425 Gets the current encoding that wxPython will use when it needs to
5426 convert a Python string or unicode object to or from a wxString.
5427 """
5428 return _core_.GetDefaultPyEncoding(*args, **kwargs)
5429 #----------------------------------------------------------------------
5430
5431 class PyOnDemandOutputWindow:
5432 """
5433 A class that can be used for redirecting Python's stdout and
5434 stderr streams. It will do nothing until something is wrriten to
5435 the stream at which point it will create a Frame with a text area
5436 and write the text there.
5437 """
5438 def __init__(self, title = "wxPython: stdout/stderr"):
5439 self.frame = None
5440 self.title = title
5441 self.pos = wx.DefaultPosition
5442 self.size = (450, 300)
5443 self.parent = None
5444
5445 def SetParent(self, parent):
5446 """Set the window to be used as the popup Frame's parent."""
5447 self.parent = parent
5448
5449
5450 def CreateOutputWindow(self, st):
5451 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5452 style=wx.DEFAULT_FRAME_STYLE)
5453 self.text = wx.TextCtrl(self.frame, -1, "",
5454 style=wx.TE_MULTILINE|wx.TE_READONLY)
5455 self.text.AppendText(st)
5456 self.frame.Show(True)
5457 EVT_CLOSE(self.frame, self.OnCloseWindow)
5458
5459
5460 def OnCloseWindow(self, event):
5461 if self.frame is not None:
5462 self.frame.Destroy()
5463 self.frame = None
5464 self.text = None
5465
5466
5467 # These methods provide the file-like output behaviour.
5468 def write(self, text):
5469 """
5470 Create the output window if needed and write the string to it.
5471 If not called in the context of the gui thread then uses
5472 CallAfter to do the work there.
5473 """
5474 if self.frame is None:
5475 if not wx.Thread_IsMain():
5476 wx.CallAfter(self.CreateOutputWindow, text)
5477 else:
5478 self.CreateOutputWindow(text)
5479 else:
5480 if not wx.Thread_IsMain():
5481 wx.CallAfter(self.text.AppendText, text)
5482 else:
5483 self.text.AppendText(text)
5484
5485
5486 def close(self):
5487 if self.frame is not None:
5488 wx.CallAfter(self.frame.Close)
5489
5490
5491 def flush(self):
5492 pass
5493
5494
5495
5496 #----------------------------------------------------------------------
5497
5498 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5499
5500 class App(wx.PyApp):
5501 """
5502 The ``wx.App`` class represents the application and is used to:
5503
5504 * bootstrap the wxPython system and initialize the underlying
5505 gui toolkit
5506 * set and get application-wide properties
5507 * implement the windowing system main message or event loop,
5508 and to dispatch events to window instances
5509 * etc.
5510
5511 Every application must have a ``wx.App`` instance, and all
5512 creation of UI objects should be delayed until after the
5513 ``wx.App`` object has been created in order to ensure that the gui
5514 platform and wxWidgets have been fully initialized.
5515
5516 Normally you would derive from this class and implement an
5517 ``OnInit`` method that creates a frame and then calls
5518 ``self.SetTopWindow(frame)``.
5519
5520 :see: `wx.PySimpleApp` for a simpler app class that can be used
5521 directly.
5522 """
5523
5524 outputWindowClass = PyOnDemandOutputWindow
5525
5526 def __init__(self, redirect=_defRedirect, filename=None,
5527 useBestVisual=False, clearSigInt=True):
5528 """
5529 Construct a ``wx.App`` object.
5530
5531 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5532 redirected? Defaults to True on Windows and Mac, False
5533 otherwise. If `filename` is None then output will be
5534 redirected to a window that pops up as needed. (You can
5535 control what kind of window is created for the output by
5536 resetting the class variable ``outputWindowClass`` to a
5537 class of your choosing.)
5538
5539 :param filename: The name of a file to redirect output to, if
5540 redirect is True.
5541
5542 :param useBestVisual: Should the app try to use the best
5543 available visual provided by the system (only relevant on
5544 systems that have more than one visual.) This parameter
5545 must be used instead of calling `SetUseBestVisual` later
5546 on because it must be set before the underlying GUI
5547 toolkit is initialized.
5548
5549 :param clearSigInt: Should SIGINT be cleared? This allows the
5550 app to terminate upon a Ctrl-C in the console like other
5551 GUI apps will.
5552
5553 :note: You should override OnInit to do applicaition
5554 initialization to ensure that the system, toolkit and
5555 wxWidgets are fully initialized.
5556 """
5557 wx.PyApp.__init__(self)
5558
5559 if wx.Platform == "__WXMAC__":
5560 try:
5561 import MacOS
5562 if not MacOS.WMAvailable():
5563 print """\
5564 This program needs access to the screen. Please run with 'pythonw',
5565 not 'python', and only when you are logged in on the main display of
5566 your Mac."""
5567 _sys.exit(1)
5568 except SystemExit:
5569 raise
5570 except:
5571 pass
5572
5573 # This has to be done before OnInit
5574 self.SetUseBestVisual(useBestVisual)
5575
5576 # Set the default handler for SIGINT. This fixes a problem
5577 # where if Ctrl-C is pressed in the console that started this
5578 # app then it will not appear to do anything, (not even send
5579 # KeyboardInterrupt???) but will later segfault on exit. By
5580 # setting the default handler then the app will exit, as
5581 # expected (depending on platform.)
5582 if clearSigInt:
5583 try:
5584 import signal
5585 signal.signal(signal.SIGINT, signal.SIG_DFL)
5586 except:
5587 pass
5588
5589 # Save and redirect the stdio to a window?
5590 self.stdioWin = None
5591 self.saveStdio = (_sys.stdout, _sys.stderr)
5592 if redirect:
5593 self.RedirectStdio(filename)
5594
5595 # Use Python's install prefix as the default
5596 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
5597
5598 # This finishes the initialization of wxWindows and then calls
5599 # the OnInit that should be present in the derived class
5600 self._BootstrapApp()
5601
5602
5603 def __del__(self):
5604 try:
5605 self.RestoreStdio() # Just in case the MainLoop was overridden
5606 except:
5607 pass
5608
5609
5610 def SetTopWindow(self, frame):
5611 """Set the \"main\" top level window"""
5612 if self.stdioWin:
5613 self.stdioWin.SetParent(frame)
5614 wx.PyApp.SetTopWindow(self, frame)
5615
5616
5617 def MainLoop(self):
5618 """Execute the main GUI event loop"""
5619 wx.PyApp.MainLoop(self)
5620 self.RestoreStdio()
5621
5622
5623 def RedirectStdio(self, filename=None):
5624 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
5625 if filename:
5626 _sys.stdout = _sys.stderr = open(filename, 'a')
5627 else:
5628 self.stdioWin = self.outputWindowClass()
5629 _sys.stdout = _sys.stderr = self.stdioWin
5630
5631
5632 def RestoreStdio(self):
5633 _sys.stdout, _sys.stderr = self.saveStdio
5634
5635
5636 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5637 """
5638 Set the title, position and/or size of the output window if
5639 the stdio has been redirected. This should be called before
5640 any output would cause the output window to be created.
5641 """
5642 if self.stdioWin:
5643 if title is not None:
5644 self.stdioWin.title = title
5645 if pos is not None:
5646 self.stdioWin.pos = pos
5647 if size is not None:
5648 self.stdioWin.size = size
5649
5650
5651
5652
5653 # change from wx.PyApp_XX to wx.App_XX
5654 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5655 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5656 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5657 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5658 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5659 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5660 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5661 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5662 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5663 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5664 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
5665
5666 #----------------------------------------------------------------------------
5667
5668 class PySimpleApp(wx.App):
5669 """
5670 A simple application class. You can just create one of these and
5671 then then make your top level windows later, and not have to worry
5672 about OnInit. For example::
5673
5674 app = wx.PySimpleApp()
5675 frame = wx.Frame(None, title='Hello World')
5676 frame.Show()
5677 app.MainLoop()
5678
5679 :see: `wx.App`
5680 """
5681
5682 def __init__(self, redirect=False, filename=None,
5683 useBestVisual=False, clearSigInt=True):
5684 """
5685 :see: `wx.App.__init__`
5686 """
5687 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
5688
5689 def OnInit(self):
5690 return True
5691
5692
5693
5694 # Is anybody using this one?
5695 class PyWidgetTester(wx.App):
5696 def __init__(self, size = (250, 100)):
5697 self.size = size
5698 wx.App.__init__(self, 0)
5699
5700 def OnInit(self):
5701 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
5702 self.SetTopWindow(self.frame)
5703 return True
5704
5705 def SetWidget(self, widgetClass, *args, **kwargs):
5706 w = widgetClass(self.frame, *args, **kwargs)
5707 self.frame.Show(True)
5708
5709 #----------------------------------------------------------------------------
5710 # DO NOT hold any other references to this object. This is how we
5711 # know when to cleanup system resources that wxWidgets is holding. When
5712 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
5713 # goes to zero and it calls the wx.App_CleanUp function.
5714
5715 class __wxPyCleanup:
5716 def __init__(self):
5717 self.cleanup = _core_.App_CleanUp
5718 def __del__(self):
5719 self.cleanup()
5720
5721 _sys.__wxPythonCleanup = __wxPyCleanup()
5722
5723 ## # another possible solution, but it gets called too early...
5724 ## import atexit
5725 ## atexit.register(_core_.wxApp_CleanUp)
5726
5727
5728 #----------------------------------------------------------------------------
5729
5730 #---------------------------------------------------------------------------
5731
5732 class EventLoop(object):
5733 """Proxy of C++ EventLoop class"""
5734 def __repr__(self):
5735 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5736 def __init__(self, *args, **kwargs):
5737 """__init__(self) -> EventLoop"""
5738 newobj = _core_.new_EventLoop(*args, **kwargs)
5739 self.this = newobj.this
5740 self.thisown = 1
5741 del newobj.thisown
5742 def __del__(self, destroy=_core_.delete_EventLoop):
5743 """__del__(self)"""
5744 try:
5745 if self.thisown: destroy(self)
5746 except: pass
5747
5748 def Run(*args, **kwargs):
5749 """Run(self) -> int"""
5750 return _core_.EventLoop_Run(*args, **kwargs)
5751
5752 def Exit(*args, **kwargs):
5753 """Exit(self, int rc=0)"""
5754 return _core_.EventLoop_Exit(*args, **kwargs)
5755
5756 def Pending(*args, **kwargs):
5757 """Pending(self) -> bool"""
5758 return _core_.EventLoop_Pending(*args, **kwargs)
5759
5760 def Dispatch(*args, **kwargs):
5761 """Dispatch(self) -> bool"""
5762 return _core_.EventLoop_Dispatch(*args, **kwargs)
5763
5764 def IsRunning(*args, **kwargs):
5765 """IsRunning(self) -> bool"""
5766 return _core_.EventLoop_IsRunning(*args, **kwargs)
5767
5768 def GetActive(*args, **kwargs):
5769 """GetActive() -> EventLoop"""
5770 return _core_.EventLoop_GetActive(*args, **kwargs)
5771
5772 GetActive = staticmethod(GetActive)
5773 def SetActive(*args, **kwargs):
5774 """SetActive(EventLoop loop)"""
5775 return _core_.EventLoop_SetActive(*args, **kwargs)
5776
5777 SetActive = staticmethod(SetActive)
5778
5779 class EventLoopPtr(EventLoop):
5780 def __init__(self, this):
5781 self.this = this
5782 if not hasattr(self,"thisown"): self.thisown = 0
5783 self.__class__ = EventLoop
5784 _core_.EventLoop_swigregister(EventLoopPtr)
5785
5786 def EventLoop_GetActive(*args, **kwargs):
5787 """EventLoop_GetActive() -> EventLoop"""
5788 return _core_.EventLoop_GetActive(*args, **kwargs)
5789
5790 def EventLoop_SetActive(*args, **kwargs):
5791 """EventLoop_SetActive(EventLoop loop)"""
5792 return _core_.EventLoop_SetActive(*args, **kwargs)
5793
5794 #---------------------------------------------------------------------------
5795
5796 class AcceleratorEntry(object):
5797 """
5798 A class used to define items in an `wx.AcceleratorTable`. wxPython
5799 programs can choose to use wx.AcceleratorEntry objects, but using a
5800 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
5801 as well. See `__init__` for of the tuple values.
5802
5803 :see: `wx.AcceleratorTable`
5804 """
5805 def __repr__(self):
5806 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5807 def __init__(self, *args, **kwargs):
5808 """
5809 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5810
5811 Construct a wx.AcceleratorEntry.
5812 """
5813 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
5814 self.this = newobj.this
5815 self.thisown = 1
5816 del newobj.thisown
5817 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
5818 """__del__(self)"""
5819 try:
5820 if self.thisown: destroy(self)
5821 except: pass
5822
5823 def Set(*args, **kwargs):
5824 """
5825 Set(self, int flags, int keyCode, int cmd)
5826
5827 (Re)set the attributes of a wx.AcceleratorEntry.
5828 :see `__init__`
5829 """
5830 return _core_.AcceleratorEntry_Set(*args, **kwargs)
5831
5832 def GetFlags(*args, **kwargs):
5833 """
5834 GetFlags(self) -> int
5835
5836 Get the AcceleratorEntry's flags.
5837 """
5838 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
5839
5840 def GetKeyCode(*args, **kwargs):
5841 """
5842 GetKeyCode(self) -> int
5843
5844 Get the AcceleratorEntry's keycode.
5845 """
5846 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
5847
5848 def GetCommand(*args, **kwargs):
5849 """
5850 GetCommand(self) -> int
5851
5852 Get the AcceleratorEntry's command ID.
5853 """
5854 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
5855
5856
5857 class AcceleratorEntryPtr(AcceleratorEntry):
5858 def __init__(self, this):
5859 self.this = this
5860 if not hasattr(self,"thisown"): self.thisown = 0
5861 self.__class__ = AcceleratorEntry
5862 _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
5863
5864 class AcceleratorTable(Object):
5865 """
5866 An accelerator table allows the application to specify a table of
5867 keyboard shortcuts for menus or other commands. On Windows, menu or
5868 button commands are supported; on GTK, only menu commands are
5869 supported.
5870 """
5871 def __repr__(self):
5872 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5873 def __init__(self, *args, **kwargs):
5874 """
5875 __init__(entries) -> AcceleratorTable
5876
5877 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5878 items or or of 3-tuples (flags, keyCode, cmdID)
5879
5880 :see: `wx.AcceleratorEntry`
5881 """
5882 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
5883 self.this = newobj.this
5884 self.thisown = 1
5885 del newobj.thisown
5886 def __del__(self, destroy=_core_.delete_AcceleratorTable):
5887 """__del__(self)"""
5888 try:
5889 if self.thisown: destroy(self)
5890 except: pass
5891
5892 def Ok(*args, **kwargs):
5893 """Ok(self) -> bool"""
5894 return _core_.AcceleratorTable_Ok(*args, **kwargs)
5895
5896
5897 class AcceleratorTablePtr(AcceleratorTable):
5898 def __init__(self, this):
5899 self.this = this
5900 if not hasattr(self,"thisown"): self.thisown = 0
5901 self.__class__ = AcceleratorTable
5902 _core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
5903
5904
5905 def GetAccelFromString(*args, **kwargs):
5906 """GetAccelFromString(String label) -> AcceleratorEntry"""
5907 return _core_.GetAccelFromString(*args, **kwargs)
5908 #---------------------------------------------------------------------------
5909
5910 class VisualAttributes(object):
5911 """struct containing all the visual attributes of a control"""
5912 def __repr__(self):
5913 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5914 def __init__(self, *args, **kwargs):
5915 """
5916 __init__(self) -> VisualAttributes
5917
5918 struct containing all the visual attributes of a control
5919 """
5920 newobj = _core_.new_VisualAttributes(*args, **kwargs)
5921 self.this = newobj.this
5922 self.thisown = 1
5923 del newobj.thisown
5924 def __del__(self, destroy=_core_.delete_VisualAttributes):
5925 """__del__(self)"""
5926 try:
5927 if self.thisown: destroy(self)
5928 except: pass
5929
5930 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5931 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5932 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
5933
5934 class VisualAttributesPtr(VisualAttributes):
5935 def __init__(self, this):
5936 self.this = this
5937 if not hasattr(self,"thisown"): self.thisown = 0
5938 self.__class__ = VisualAttributes
5939 _core_.VisualAttributes_swigregister(VisualAttributesPtr)
5940 NullAcceleratorTable = cvar.NullAcceleratorTable
5941 PanelNameStr = cvar.PanelNameStr
5942
5943 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5944 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5945 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5946 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5947 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
5948 class Window(EvtHandler):
5949 """
5950 wx.Window is the base class for all windows and represents any visible
5951 object on the screen. All controls, top level windows and so on are
5952 wx.Windows. Sizers and device contexts are not however, as they don't
5953 appear on screen themselves.
5954
5955 """
5956 def __repr__(self):
5957 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5958 def __init__(self, *args, **kwargs):
5959 """
5960 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
5961 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
5962
5963 Construct and show a generic Window.
5964 """
5965 newobj = _core_.new_Window(*args, **kwargs)
5966 self.this = newobj.this
5967 self.thisown = 1
5968 del newobj.thisown
5969 self._setOORInfo(self)
5970
5971 def Create(*args, **kwargs):
5972 """
5973 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
5974 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
5975
5976 Create the GUI part of the Window for 2-phase creation mode.
5977 """
5978 return _core_.Window_Create(*args, **kwargs)
5979
5980 def Close(*args, **kwargs):
5981 """
5982 Close(self, bool force=False) -> bool
5983
5984 This function simply generates a EVT_CLOSE event whose handler usually
5985 tries to close the window. It doesn't close the window itself,
5986 however. If force is False (the default) then the window's close
5987 handler will be allowed to veto the destruction of the window.
5988 """
5989 return _core_.Window_Close(*args, **kwargs)
5990
5991 def Destroy(*args, **kwargs):
5992 """
5993 Destroy(self) -> bool
5994
5995 Destroys the window safely. Frames and dialogs are not destroyed
5996 immediately when this function is called -- they are added to a list
5997 of windows to be deleted on idle time, when all the window's events
5998 have been processed. This prevents problems with events being sent to
5999 non-existent windows.
6000
6001 Returns True if the window has either been successfully deleted, or it
6002 has been added to the list of windows pending real deletion.
6003 """
6004 return _core_.Window_Destroy(*args, **kwargs)
6005
6006 def DestroyChildren(*args, **kwargs):
6007 """
6008 DestroyChildren(self) -> bool
6009
6010 Destroys all children of a window. Called automatically by the
6011 destructor.
6012 """
6013 return _core_.Window_DestroyChildren(*args, **kwargs)
6014
6015 def IsBeingDeleted(*args, **kwargs):
6016 """
6017 IsBeingDeleted(self) -> bool
6018
6019 Is the window in the process of being deleted?
6020 """
6021 return _core_.Window_IsBeingDeleted(*args, **kwargs)
6022
6023 def SetTitle(*args, **kwargs):
6024 """
6025 SetTitle(self, String title)
6026
6027 Sets the window's title. Applicable only to frames and dialogs.
6028 """
6029 return _core_.Window_SetTitle(*args, **kwargs)
6030
6031 def GetTitle(*args, **kwargs):
6032 """
6033 GetTitle(self) -> String
6034
6035 Gets the window's title. Applicable only to frames and dialogs.
6036 """
6037 return _core_.Window_GetTitle(*args, **kwargs)
6038
6039 def SetLabel(*args, **kwargs):
6040 """
6041 SetLabel(self, String label)
6042
6043 Set the text which the window shows in its label if applicable.
6044 """
6045 return _core_.Window_SetLabel(*args, **kwargs)
6046
6047 def GetLabel(*args, **kwargs):
6048 """
6049 GetLabel(self) -> String
6050
6051 Generic way of getting a label from any window, for identification
6052 purposes. The interpretation of this function differs from class to
6053 class. For frames and dialogs, the value returned is the title. For
6054 buttons or static text controls, it is the button text. This function
6055 can be useful for meta-programs such as testing tools or special-needs
6056 access programs)which need to identify windows by name.
6057 """
6058 return _core_.Window_GetLabel(*args, **kwargs)
6059
6060 def SetName(*args, **kwargs):
6061 """
6062 SetName(self, String name)
6063
6064 Sets the window's name. The window name is used for ressource setting
6065 in X, it is not the same as the window title/label
6066 """
6067 return _core_.Window_SetName(*args, **kwargs)
6068
6069 def GetName(*args, **kwargs):
6070 """
6071 GetName(self) -> String
6072
6073 Returns the windows name. This name is not guaranteed to be unique;
6074 it is up to the programmer to supply an appropriate name in the window
6075 constructor or via wx.Window.SetName.
6076 """
6077 return _core_.Window_GetName(*args, **kwargs)
6078
6079 def SetWindowVariant(*args, **kwargs):
6080 """
6081 SetWindowVariant(self, int variant)
6082
6083 Sets the variant of the window/font size to use for this window, if
6084 the platform supports variants, for example, wxMac.
6085 """
6086 return _core_.Window_SetWindowVariant(*args, **kwargs)
6087
6088 def GetWindowVariant(*args, **kwargs):
6089 """GetWindowVariant(self) -> int"""
6090 return _core_.Window_GetWindowVariant(*args, **kwargs)
6091
6092 def SetId(*args, **kwargs):
6093 """
6094 SetId(self, int winid)
6095
6096 Sets the identifier of the window. Each window has an integer
6097 identifier. If the application has not provided one, an identifier
6098 will be generated. Normally, the identifier should be provided on
6099 creation and should not be modified subsequently.
6100 """
6101 return _core_.Window_SetId(*args, **kwargs)
6102
6103 def GetId(*args, **kwargs):
6104 """
6105 GetId(self) -> int
6106
6107 Returns the identifier of the window. Each window has an integer
6108 identifier. If the application has not provided one (or the default Id
6109 -1 is used) then an unique identifier with a negative value will be
6110 generated.
6111 """
6112 return _core_.Window_GetId(*args, **kwargs)
6113
6114 def NewControlId(*args, **kwargs):
6115 """
6116 NewControlId() -> int
6117
6118 Generate a control id for the controls which were not given one.
6119 """
6120 return _core_.Window_NewControlId(*args, **kwargs)
6121
6122 NewControlId = staticmethod(NewControlId)
6123 def NextControlId(*args, **kwargs):
6124 """
6125 NextControlId(int winid) -> int
6126
6127 Get the id of the control following the one with the given
6128 autogenerated) id
6129 """
6130 return _core_.Window_NextControlId(*args, **kwargs)
6131
6132 NextControlId = staticmethod(NextControlId)
6133 def PrevControlId(*args, **kwargs):
6134 """
6135 PrevControlId(int winid) -> int
6136
6137 Get the id of the control preceding the one with the given
6138 autogenerated) id
6139 """
6140 return _core_.Window_PrevControlId(*args, **kwargs)
6141
6142 PrevControlId = staticmethod(PrevControlId)
6143 def SetSize(*args, **kwargs):
6144 """
6145 SetSize(self, Size size)
6146
6147 Sets the size of the window in pixels.
6148 """
6149 return _core_.Window_SetSize(*args, **kwargs)
6150
6151 def SetDimensions(*args, **kwargs):
6152 """
6153 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
6154
6155 Sets the position and size of the window in pixels. The sizeFlags
6156 parameter indicates the interpretation of the other params if they are
6157 equal to -1.
6158
6159 ======================== ======================================
6160 wx.SIZE_AUTO A -1 indicates that a class-specific
6161 default should be used.
6162 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
6163 -1 values are supplied.
6164 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
6165 interpreted as real dimensions, not
6166 default values.
6167 ======================== ======================================
6168
6169 """
6170 return _core_.Window_SetDimensions(*args, **kwargs)
6171
6172 def SetRect(*args, **kwargs):
6173 """
6174 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
6175
6176 Sets the position and size of the window in pixels using a wx.Rect.
6177 """
6178 return _core_.Window_SetRect(*args, **kwargs)
6179
6180 def SetSizeWH(*args, **kwargs):
6181 """
6182 SetSizeWH(self, int width, int height)
6183
6184 Sets the size of the window in pixels.
6185 """
6186 return _core_.Window_SetSizeWH(*args, **kwargs)
6187
6188 def Move(*args, **kwargs):
6189 """
6190 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
6191
6192 Moves the window to the given position.
6193 """
6194 return _core_.Window_Move(*args, **kwargs)
6195
6196 SetPosition = Move
6197 def MoveXY(*args, **kwargs):
6198 """
6199 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
6200
6201 Moves the window to the given position.
6202 """
6203 return _core_.Window_MoveXY(*args, **kwargs)
6204
6205 def SetBestFittingSize(*args, **kwargs):
6206 """
6207 SetBestFittingSize(self, Size size=DefaultSize)
6208
6209 A 'Smart' SetSize that will fill in default size components with the
6210 window's *best size* values. Also set's the minsize for use with sizers.
6211 """
6212 return _core_.Window_SetBestFittingSize(*args, **kwargs)
6213
6214 def Raise(*args, **kwargs):
6215 """
6216 Raise(self)
6217
6218 Raises the window to the top of the window hierarchy if it is a
6219 managed window (dialog or frame).
6220 """
6221 return _core_.Window_Raise(*args, **kwargs)
6222
6223 def Lower(*args, **kwargs):
6224 """
6225 Lower(self)
6226
6227 Lowers the window to the bottom of the window hierarchy if it is a
6228 managed window (dialog or frame).
6229 """
6230 return _core_.Window_Lower(*args, **kwargs)
6231
6232 def SetClientSize(*args, **kwargs):
6233 """
6234 SetClientSize(self, Size size)
6235
6236 This sets the size of the window client area in pixels. Using this
6237 function to size a window tends to be more device-independent than
6238 wx.Window.SetSize, since the application need not worry about what
6239 dimensions the border or title bar have when trying to fit the window
6240 around panel items, for example.
6241 """
6242 return _core_.Window_SetClientSize(*args, **kwargs)
6243
6244 def SetClientSizeWH(*args, **kwargs):
6245 """
6246 SetClientSizeWH(self, int width, int height)
6247
6248 This sets the size of the window client area in pixels. Using this
6249 function to size a window tends to be more device-independent than
6250 wx.Window.SetSize, since the application need not worry about what
6251 dimensions the border or title bar have when trying to fit the window
6252 around panel items, for example.
6253 """
6254 return _core_.Window_SetClientSizeWH(*args, **kwargs)
6255
6256 def SetClientRect(*args, **kwargs):
6257 """
6258 SetClientRect(self, Rect rect)
6259
6260 This sets the size of the window client area in pixels. Using this
6261 function to size a window tends to be more device-independent than
6262 wx.Window.SetSize, since the application need not worry about what
6263 dimensions the border or title bar have when trying to fit the window
6264 around panel items, for example.
6265 """
6266 return _core_.Window_SetClientRect(*args, **kwargs)
6267
6268 def GetPosition(*args, **kwargs):
6269 """
6270 GetPosition(self) -> Point
6271
6272 Get the window's position.
6273 """
6274 return _core_.Window_GetPosition(*args, **kwargs)
6275
6276 def GetPositionTuple(*args, **kwargs):
6277 """
6278 GetPositionTuple() -> (x,y)
6279
6280 Get the window's position.
6281 """
6282 return _core_.Window_GetPositionTuple(*args, **kwargs)
6283
6284 def GetSize(*args, **kwargs):
6285 """
6286 GetSize(self) -> Size
6287
6288 Get the window size.
6289 """
6290 return _core_.Window_GetSize(*args, **kwargs)
6291
6292 def GetSizeTuple(*args, **kwargs):
6293 """
6294 GetSizeTuple() -> (width, height)
6295
6296 Get the window size.
6297 """
6298 return _core_.Window_GetSizeTuple(*args, **kwargs)
6299
6300 def GetRect(*args, **kwargs):
6301 """
6302 GetRect(self) -> Rect
6303
6304 Returns the size and position of the window as a wx.Rect object.
6305 """
6306 return _core_.Window_GetRect(*args, **kwargs)
6307
6308 def GetClientSize(*args, **kwargs):
6309 """
6310 GetClientSize(self) -> Size
6311
6312 This gets the size of the window's 'client area' in pixels. The client
6313 area is the area which may be drawn on by the programmer, excluding
6314 title bar, border, scrollbars, etc.
6315 """
6316 return _core_.Window_GetClientSize(*args, **kwargs)
6317
6318 def GetClientSizeTuple(*args, **kwargs):
6319 """
6320 GetClientSizeTuple() -> (width, height)
6321
6322 This gets the size of the window's 'client area' in pixels. The client
6323 area is the area which may be drawn on by the programmer, excluding
6324 title bar, border, scrollbars, etc.
6325 """
6326 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
6327
6328 def GetClientAreaOrigin(*args, **kwargs):
6329 """
6330 GetClientAreaOrigin(self) -> Point
6331
6332 Get the origin of the client area of the window relative to the
6333 window's top left corner (the client area may be shifted because of
6334 the borders, scrollbars, other decorations...)
6335 """
6336 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
6337
6338 def GetClientRect(*args, **kwargs):
6339 """
6340 GetClientRect(self) -> Rect
6341
6342 Get the client area position and size as a `wx.Rect` object.
6343 """
6344 return _core_.Window_GetClientRect(*args, **kwargs)
6345
6346 def GetBestSize(*args, **kwargs):
6347 """
6348 GetBestSize(self) -> Size
6349
6350 This function returns the best acceptable minimal size for the
6351 window, if applicable. For example, for a static text control, it will
6352 be the minimal size such that the control label is not truncated. For
6353 windows containing subwindows (suzh aswx.Panel), the size returned by
6354 this function will be the same as the size the window would have had
6355 after calling Fit.
6356 """
6357 return _core_.Window_GetBestSize(*args, **kwargs)
6358
6359 def GetBestSizeTuple(*args, **kwargs):
6360 """
6361 GetBestSizeTuple() -> (width, height)
6362
6363 This function returns the best acceptable minimal size for the
6364 window, if applicable. For example, for a static text control, it will
6365 be the minimal size such that the control label is not truncated. For
6366 windows containing subwindows (suzh aswx.Panel), the size returned by
6367 this function will be the same as the size the window would have had
6368 after calling Fit.
6369 """
6370 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
6371
6372 def InvalidateBestSize(*args, **kwargs):
6373 """
6374 InvalidateBestSize(self)
6375
6376 Reset the cached best size value so it will be recalculated the next
6377 time it is needed.
6378 """
6379 return _core_.Window_InvalidateBestSize(*args, **kwargs)
6380
6381 def GetBestFittingSize(*args, **kwargs):
6382 """
6383 GetBestFittingSize(self) -> Size
6384
6385 This function will merge the window's best size into the window's
6386 minimum size, giving priority to the min size components, and returns
6387 the results.
6388
6389 """
6390 return _core_.Window_GetBestFittingSize(*args, **kwargs)
6391
6392 def GetAdjustedBestSize(*args, **kwargs):
6393 """
6394 GetAdjustedBestSize(self) -> Size
6395
6396 This method is similar to GetBestSize, except in one
6397 thing. GetBestSize should return the minimum untruncated size of the
6398 window, while this method will return the largest of BestSize and any
6399 user specified minimum size. ie. it is the minimum size the window
6400 should currently be drawn at, not the minimal size it can possibly
6401 tolerate.
6402 """
6403 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
6404
6405 def Center(*args, **kwargs):
6406 """
6407 Center(self, int direction=BOTH)
6408
6409 Centers the window. The parameter specifies the direction for
6410 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6411 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6412 on the entire screen and not on its parent window. If it is a
6413 top-level window and has no parent then it will always be centered
6414 relative to the screen.
6415 """
6416 return _core_.Window_Center(*args, **kwargs)
6417
6418 Centre = Center
6419 def CenterOnScreen(*args, **kwargs):
6420 """
6421 CenterOnScreen(self, int dir=BOTH)
6422
6423 Center on screen (only works for top level windows)
6424 """
6425 return _core_.Window_CenterOnScreen(*args, **kwargs)
6426
6427 CentreOnScreen = CenterOnScreen
6428 def CenterOnParent(*args, **kwargs):
6429 """
6430 CenterOnParent(self, int dir=BOTH)
6431
6432 Center with respect to the the parent window
6433 """
6434 return _core_.Window_CenterOnParent(*args, **kwargs)
6435
6436 CentreOnParent = CenterOnParent
6437 def Fit(*args, **kwargs):
6438 """
6439 Fit(self)
6440
6441 Sizes the window so that it fits around its subwindows. This function
6442 won't do anything if there are no subwindows and will only really work
6443 correctly if sizers are used for the subwindows layout. Also, if the
6444 window has exactly one subwindow it is better (faster and the result
6445 is more precise as Fit adds some margin to account for fuzziness of
6446 its calculations) to call window.SetClientSize(child.GetSize())
6447 instead of calling Fit.
6448 """
6449 return _core_.Window_Fit(*args, **kwargs)
6450
6451 def FitInside(*args, **kwargs):
6452 """
6453 FitInside(self)
6454
6455 Similar to Fit, but sizes the interior (virtual) size of a
6456 window. Mainly useful with scrolled windows to reset scrollbars after
6457 sizing changes that do not trigger a size event, and/or scrolled
6458 windows without an interior sizer. This function similarly won't do
6459 anything if there are no subwindows.
6460 """
6461 return _core_.Window_FitInside(*args, **kwargs)
6462
6463 def SetSizeHints(*args, **kwargs):
6464 """
6465 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
6466 int incH=-1)
6467
6468 Allows specification of minimum and maximum window sizes, and window
6469 size increments. If a pair of values is not set (or set to -1), the
6470 default values will be used. If this function is called, the user
6471 will not be able to size the window outside the given bounds (if it is
6472 a top-level window.) Sizers will also inspect the minimum window size
6473 and will use that value if set when calculating layout.
6474
6475 The resizing increments are only significant under Motif or Xt.
6476 """
6477 return _core_.Window_SetSizeHints(*args, **kwargs)
6478
6479 def SetSizeHintsSz(*args, **kwargs):
6480 """
6481 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6482
6483 Allows specification of minimum and maximum window sizes, and window
6484 size increments. If a pair of values is not set (or set to -1), the
6485 default values will be used. If this function is called, the user
6486 will not be able to size the window outside the given bounds (if it is
6487 a top-level window.) Sizers will also inspect the minimum window size
6488 and will use that value if set when calculating layout.
6489
6490 The resizing increments are only significant under Motif or Xt.
6491 """
6492 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6493
6494 def SetVirtualSizeHints(*args, **kwargs):
6495 """
6496 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
6497
6498 Allows specification of minimum and maximum virtual window sizes. If a
6499 pair of values is not set (or set to -1), the default values will be
6500 used. If this function is called, the user will not be able to size
6501 the virtual area of the window outside the given bounds.
6502 """
6503 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6504
6505 def SetVirtualSizeHintsSz(*args, **kwargs):
6506 """
6507 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6508
6509 Allows specification of minimum and maximum virtual window sizes. If a
6510 pair of values is not set (or set to -1), the default values will be
6511 used. If this function is called, the user will not be able to size
6512 the virtual area of the window outside the given bounds.
6513 """
6514 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
6515
6516 def GetMaxSize(*args, **kwargs):
6517 """GetMaxSize(self) -> Size"""
6518 return _core_.Window_GetMaxSize(*args, **kwargs)
6519
6520 def GetMinSize(*args, **kwargs):
6521 """GetMinSize(self) -> Size"""
6522 return _core_.Window_GetMinSize(*args, **kwargs)
6523
6524 def SetMinSize(*args, **kwargs):
6525 """
6526 SetMinSize(self, Size minSize)
6527
6528 A more convenient method than `SetSizeHints` for setting just the
6529 min size.
6530 """
6531 return _core_.Window_SetMinSize(*args, **kwargs)
6532
6533 def SetMaxSize(*args, **kwargs):
6534 """
6535 SetMaxSize(self, Size maxSize)
6536
6537 A more convenient method than `SetSizeHints` for setting just the
6538 max size.
6539 """
6540 return _core_.Window_SetMaxSize(*args, **kwargs)
6541
6542 def GetMinWidth(*args, **kwargs):
6543 """GetMinWidth(self) -> int"""
6544 return _core_.Window_GetMinWidth(*args, **kwargs)
6545
6546 def GetMinHeight(*args, **kwargs):
6547 """GetMinHeight(self) -> int"""
6548 return _core_.Window_GetMinHeight(*args, **kwargs)
6549
6550 def GetMaxWidth(*args, **kwargs):
6551 """GetMaxWidth(self) -> int"""
6552 return _core_.Window_GetMaxWidth(*args, **kwargs)
6553
6554 def GetMaxHeight(*args, **kwargs):
6555 """GetMaxHeight(self) -> int"""
6556 return _core_.Window_GetMaxHeight(*args, **kwargs)
6557
6558 def SetVirtualSize(*args, **kwargs):
6559 """
6560 SetVirtualSize(self, Size size)
6561
6562 Set the the virtual size of a window in pixels. For most windows this
6563 is just the client area of the window, but for some like scrolled
6564 windows it is more or less independent of the screen window size.
6565 """
6566 return _core_.Window_SetVirtualSize(*args, **kwargs)
6567
6568 def SetVirtualSizeWH(*args, **kwargs):
6569 """
6570 SetVirtualSizeWH(self, int w, int h)
6571
6572 Set the the virtual size of a window in pixels. For most windows this
6573 is just the client area of the window, but for some like scrolled
6574 windows it is more or less independent of the screen window size.
6575 """
6576 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
6577
6578 def GetVirtualSize(*args, **kwargs):
6579 """
6580 GetVirtualSize(self) -> Size
6581
6582 Get the the virtual size of the window in pixels. For most windows
6583 this is just the client area of the window, but for some like scrolled
6584 windows it is more or less independent of the screen window size.
6585 """
6586 return _core_.Window_GetVirtualSize(*args, **kwargs)
6587
6588 def GetVirtualSizeTuple(*args, **kwargs):
6589 """
6590 GetVirtualSizeTuple() -> (width, height)
6591
6592 Get the the virtual size of the window in pixels. For most windows
6593 this is just the client area of the window, but for some like scrolled
6594 windows it is more or less independent of the screen window size.
6595 """
6596 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
6597
6598 def GetBestVirtualSize(*args, **kwargs):
6599 """
6600 GetBestVirtualSize(self) -> Size
6601
6602 Return the largest of ClientSize and BestSize (as determined by a
6603 sizer, interior children, or other means)
6604 """
6605 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
6606
6607 def Show(*args, **kwargs):
6608 """
6609 Show(self, bool show=True) -> bool
6610
6611 Shows or hides the window. You may need to call Raise for a top level
6612 window if you want to bring it to top, although this is not needed if
6613 Show is called immediately after the frame creation. Returns True if
6614 the window has been shown or hidden or False if nothing was done
6615 because it already was in the requested state.
6616 """
6617 return _core_.Window_Show(*args, **kwargs)
6618
6619 def Hide(*args, **kwargs):
6620 """
6621 Hide(self) -> bool
6622
6623 Equivalent to calling Show(False).
6624 """
6625 return _core_.Window_Hide(*args, **kwargs)
6626
6627 def Enable(*args, **kwargs):
6628 """
6629 Enable(self, bool enable=True) -> bool
6630
6631 Enable or disable the window for user input. Note that when a parent
6632 window is disabled, all of its children are disabled as well and they
6633 are reenabled again when the parent is. Returns true if the window
6634 has been enabled or disabled, false if nothing was done, i.e. if the
6635 window had already been in the specified state.
6636 """
6637 return _core_.Window_Enable(*args, **kwargs)
6638
6639 def Disable(*args, **kwargs):
6640 """
6641 Disable(self) -> bool
6642
6643 Disables the window, same as Enable(false).
6644 """
6645 return _core_.Window_Disable(*args, **kwargs)
6646
6647 def IsShown(*args, **kwargs):
6648 """
6649 IsShown(self) -> bool
6650
6651 Returns true if the window is shown, false if it has been hidden.
6652 """
6653 return _core_.Window_IsShown(*args, **kwargs)
6654
6655 def IsEnabled(*args, **kwargs):
6656 """
6657 IsEnabled(self) -> bool
6658
6659 Returns true if the window is enabled for input, false otherwise.
6660 """
6661 return _core_.Window_IsEnabled(*args, **kwargs)
6662
6663 def SetWindowStyleFlag(*args, **kwargs):
6664 """
6665 SetWindowStyleFlag(self, long style)
6666
6667 Sets the style of the window. Please note that some styles cannot be
6668 changed after the window creation and that Refresh() might need to be
6669 called after changing the others for the change to take place
6670 immediately.
6671 """
6672 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
6673
6674 def GetWindowStyleFlag(*args, **kwargs):
6675 """
6676 GetWindowStyleFlag(self) -> long
6677
6678 Gets the window style that was passed to the constructor or Create
6679 method.
6680 """
6681 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
6682
6683 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
6684 def HasFlag(*args, **kwargs):
6685 """
6686 HasFlag(self, int flag) -> bool
6687
6688 Test if the given style is set for this window.
6689 """
6690 return _core_.Window_HasFlag(*args, **kwargs)
6691
6692 def IsRetained(*args, **kwargs):
6693 """
6694 IsRetained(self) -> bool
6695
6696 Returns true if the window is retained, false otherwise. Retained
6697 windows are only available on X platforms.
6698 """
6699 return _core_.Window_IsRetained(*args, **kwargs)
6700
6701 def SetExtraStyle(*args, **kwargs):
6702 """
6703 SetExtraStyle(self, long exStyle)
6704
6705 Sets the extra style bits for the window. Extra styles are the less
6706 often used style bits which can't be set with the constructor or with
6707 SetWindowStyleFlag()
6708 """
6709 return _core_.Window_SetExtraStyle(*args, **kwargs)
6710
6711 def GetExtraStyle(*args, **kwargs):
6712 """
6713 GetExtraStyle(self) -> long
6714
6715 Returns the extra style bits for the window.
6716 """
6717 return _core_.Window_GetExtraStyle(*args, **kwargs)
6718
6719 def MakeModal(*args, **kwargs):
6720 """
6721 MakeModal(self, bool modal=True)
6722
6723 Disables all other windows in the application so that the user can
6724 only interact with this window. Passing False will reverse this
6725 effect.
6726 """
6727 return _core_.Window_MakeModal(*args, **kwargs)
6728
6729 def SetThemeEnabled(*args, **kwargs):
6730 """
6731 SetThemeEnabled(self, bool enableTheme)
6732
6733 This function tells a window if it should use the system's "theme"
6734 code to draw the windows' background instead if its own background
6735 drawing code. This will only have an effect on platforms that support
6736 the notion of themes in user defined windows. One such platform is
6737 GTK+ where windows can have (very colourful) backgrounds defined by a
6738 user's selected theme.
6739
6740 Dialogs, notebook pages and the status bar have this flag set to true
6741 by default so that the default look and feel is simulated best.
6742 """
6743 return _core_.Window_SetThemeEnabled(*args, **kwargs)
6744
6745 def GetThemeEnabled(*args, **kwargs):
6746 """
6747 GetThemeEnabled(self) -> bool
6748
6749 Return the themeEnabled flag.
6750 """
6751 return _core_.Window_GetThemeEnabled(*args, **kwargs)
6752
6753 def SetFocus(*args, **kwargs):
6754 """
6755 SetFocus(self)
6756
6757 Set's the focus to this window, allowing it to receive keyboard input.
6758 """
6759 return _core_.Window_SetFocus(*args, **kwargs)
6760
6761 def SetFocusFromKbd(*args, **kwargs):
6762 """
6763 SetFocusFromKbd(self)
6764
6765 Set focus to this window as the result of a keyboard action. Normally
6766 only called internally.
6767 """
6768 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
6769
6770 def FindFocus(*args, **kwargs):
6771 """
6772 FindFocus() -> Window
6773
6774 Returns the window or control that currently has the keyboard focus,
6775 or None.
6776 """
6777 return _core_.Window_FindFocus(*args, **kwargs)
6778
6779 FindFocus = staticmethod(FindFocus)
6780 def AcceptsFocus(*args, **kwargs):
6781 """
6782 AcceptsFocus(self) -> bool
6783
6784 Can this window have focus?
6785 """
6786 return _core_.Window_AcceptsFocus(*args, **kwargs)
6787
6788 def AcceptsFocusFromKeyboard(*args, **kwargs):
6789 """
6790 AcceptsFocusFromKeyboard(self) -> bool
6791
6792 Can this window be given focus by keyboard navigation? if not, the
6793 only way to give it focus (provided it accepts it at all) is to click
6794 it.
6795 """
6796 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
6797
6798 def GetDefaultItem(*args, **kwargs):
6799 """
6800 GetDefaultItem(self) -> Window
6801
6802 Get the default child of this parent, i.e. the one which is activated
6803 by pressing <Enter> such as the OK button on a wx.Dialog.
6804 """
6805 return _core_.Window_GetDefaultItem(*args, **kwargs)
6806
6807 def SetDefaultItem(*args, **kwargs):
6808 """
6809 SetDefaultItem(self, Window child) -> Window
6810
6811 Set this child as default, return the old default.
6812 """
6813 return _core_.Window_SetDefaultItem(*args, **kwargs)
6814
6815 def SetTmpDefaultItem(*args, **kwargs):
6816 """
6817 SetTmpDefaultItem(self, Window win)
6818
6819 Set this child as temporary default
6820 """
6821 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
6822
6823 def Navigate(*args, **kwargs):
6824 """
6825 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6826
6827 Does keyboard navigation from this window to another, by sending a
6828 `wx.NavigationKeyEvent`.
6829 """
6830 return _core_.Window_Navigate(*args, **kwargs)
6831
6832 def MoveAfterInTabOrder(*args, **kwargs):
6833 """
6834 MoveAfterInTabOrder(self, Window win)
6835
6836 Moves this window in the tab navigation order after the specified
6837 sibling window. This means that when the user presses the TAB key on
6838 that other window, the focus switches to this window.
6839
6840 The default tab order is the same as creation order. This function
6841 and `MoveBeforeInTabOrder` allow to change it after creating all the
6842 windows.
6843
6844 """
6845 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6846
6847 def MoveBeforeInTabOrder(*args, **kwargs):
6848 """
6849 MoveBeforeInTabOrder(self, Window win)
6850
6851 Same as `MoveAfterInTabOrder` except that it inserts this window just
6852 before win instead of putting it right after it.
6853 """
6854 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6855
6856 def GetChildren(*args, **kwargs):
6857 """
6858 GetChildren(self) -> PyObject
6859
6860 Returns a list of the window's children. NOTE: Currently this is a
6861 copy of the child window list maintained by the window, so the return
6862 value of this function is only valid as long as the window's children
6863 do not change.
6864 """
6865 return _core_.Window_GetChildren(*args, **kwargs)
6866
6867 def GetParent(*args, **kwargs):
6868 """
6869 GetParent(self) -> Window
6870
6871 Returns the parent window of this window, or None if there isn't one.
6872 """
6873 return _core_.Window_GetParent(*args, **kwargs)
6874
6875 def GetGrandParent(*args, **kwargs):
6876 """
6877 GetGrandParent(self) -> Window
6878
6879 Returns the parent of the parent of this window, or None if there
6880 isn't one.
6881 """
6882 return _core_.Window_GetGrandParent(*args, **kwargs)
6883
6884 def IsTopLevel(*args, **kwargs):
6885 """
6886 IsTopLevel(self) -> bool
6887
6888 Returns true if the given window is a top-level one. Currently all
6889 frames and dialogs are always considered to be top-level windows (even
6890 if they have a parent window).
6891 """
6892 return _core_.Window_IsTopLevel(*args, **kwargs)
6893
6894 def Reparent(*args, **kwargs):
6895 """
6896 Reparent(self, Window newParent) -> bool
6897
6898 Reparents the window, i.e the window will be removed from its current
6899 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6900 re-inserted into another. Available on Windows and GTK. Returns True
6901 if the parent was changed, False otherwise (error or newParent ==
6902 oldParent)
6903 """
6904 return _core_.Window_Reparent(*args, **kwargs)
6905
6906 def AddChild(*args, **kwargs):
6907 """
6908 AddChild(self, Window child)
6909
6910 Adds a child window. This is called automatically by window creation
6911 functions so should not be required by the application programmer.
6912 """
6913 return _core_.Window_AddChild(*args, **kwargs)
6914
6915 def RemoveChild(*args, **kwargs):
6916 """
6917 RemoveChild(self, Window child)
6918
6919 Removes a child window. This is called automatically by window
6920 deletion functions so should not be required by the application
6921 programmer.
6922 """
6923 return _core_.Window_RemoveChild(*args, **kwargs)
6924
6925 def FindWindowById(*args, **kwargs):
6926 """
6927 FindWindowById(self, long winid) -> Window
6928
6929 Find a chld of this window by window ID
6930 """
6931 return _core_.Window_FindWindowById(*args, **kwargs)
6932
6933 def FindWindowByName(*args, **kwargs):
6934 """
6935 FindWindowByName(self, String name) -> Window
6936
6937 Find a child of this window by name
6938 """
6939 return _core_.Window_FindWindowByName(*args, **kwargs)
6940
6941 def GetEventHandler(*args, **kwargs):
6942 """
6943 GetEventHandler(self) -> EvtHandler
6944
6945 Returns the event handler for this window. By default, the window is
6946 its own event handler.
6947 """
6948 return _core_.Window_GetEventHandler(*args, **kwargs)
6949
6950 def SetEventHandler(*args, **kwargs):
6951 """
6952 SetEventHandler(self, EvtHandler handler)
6953
6954 Sets the event handler for this window. An event handler is an object
6955 that is capable of processing the events sent to a window. By default,
6956 the window is its own event handler, but an application may wish to
6957 substitute another, for example to allow central implementation of
6958 event-handling for a variety of different window classes.
6959
6960 It is usually better to use `wx.Window.PushEventHandler` since this sets
6961 up a chain of event handlers, where an event not handled by one event
6962 handler is handed to the next one in the chain.
6963 """
6964 return _core_.Window_SetEventHandler(*args, **kwargs)
6965
6966 def PushEventHandler(*args, **kwargs):
6967 """
6968 PushEventHandler(self, EvtHandler handler)
6969
6970 Pushes this event handler onto the event handler stack for the window.
6971 An event handler is an object that is capable of processing the events
6972 sent to a window. By default, the window is its own event handler, but
6973 an application may wish to substitute another, for example to allow
6974 central implementation of event-handling for a variety of different
6975 window classes.
6976
6977 wx.Window.PushEventHandler allows an application to set up a chain of
6978 event handlers, where an event not handled by one event handler is
6979 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
6980 remove the event handler.
6981 """
6982 return _core_.Window_PushEventHandler(*args, **kwargs)
6983
6984 def PopEventHandler(*args, **kwargs):
6985 """
6986 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
6987
6988 Removes and returns the top-most event handler on the event handler
6989 stack. If deleteHandler is True then the wx.EvtHandler object will be
6990 destroyed after it is popped.
6991 """
6992 return _core_.Window_PopEventHandler(*args, **kwargs)
6993
6994 def RemoveEventHandler(*args, **kwargs):
6995 """
6996 RemoveEventHandler(self, EvtHandler handler) -> bool
6997
6998 Find the given handler in the event handler chain and remove (but not
6999 delete) it from the event handler chain, return True if it was found
7000 and False otherwise (this also results in an assert failure so this
7001 function should only be called when the handler is supposed to be
7002 there.)
7003 """
7004 return _core_.Window_RemoveEventHandler(*args, **kwargs)
7005
7006 def SetValidator(*args, **kwargs):
7007 """
7008 SetValidator(self, Validator validator)
7009
7010 Deletes the current validator (if any) and sets the window validator,
7011 having called wx.Validator.Clone to create a new validator of this
7012 type.
7013 """
7014 return _core_.Window_SetValidator(*args, **kwargs)
7015
7016 def GetValidator(*args, **kwargs):
7017 """
7018 GetValidator(self) -> Validator
7019
7020 Returns a pointer to the current validator for the window, or None if
7021 there is none.
7022 """
7023 return _core_.Window_GetValidator(*args, **kwargs)
7024
7025 def Validate(*args, **kwargs):
7026 """
7027 Validate(self) -> bool
7028
7029 Validates the current values of the child controls using their
7030 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7031 style flag set, the method will also call Validate() of all child
7032 windows. Returns false if any of the validations failed.
7033 """
7034 return _core_.Window_Validate(*args, **kwargs)
7035
7036 def TransferDataToWindow(*args, **kwargs):
7037 """
7038 TransferDataToWindow(self) -> bool
7039
7040 Transfers values to child controls from data areas specified by their
7041 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7042 style flag set, the method will also call TransferDataToWindow() of
7043 all child windows.
7044 """
7045 return _core_.Window_TransferDataToWindow(*args, **kwargs)
7046
7047 def TransferDataFromWindow(*args, **kwargs):
7048 """
7049 TransferDataFromWindow(self) -> bool
7050
7051 Transfers values from child controls to data areas specified by their
7052 validators. Returns false if a transfer failed. If the window has
7053 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
7054 also call TransferDataFromWindow() of all child windows.
7055 """
7056 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
7057
7058 def InitDialog(*args, **kwargs):
7059 """
7060 InitDialog(self)
7061
7062 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
7063 to the dialog via validators.
7064 """
7065 return _core_.Window_InitDialog(*args, **kwargs)
7066
7067 def SetAcceleratorTable(*args, **kwargs):
7068 """
7069 SetAcceleratorTable(self, AcceleratorTable accel)
7070
7071 Sets the accelerator table for this window.
7072 """
7073 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
7074
7075 def GetAcceleratorTable(*args, **kwargs):
7076 """
7077 GetAcceleratorTable(self) -> AcceleratorTable
7078
7079 Gets the accelerator table for this window.
7080 """
7081 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
7082
7083 def RegisterHotKey(*args, **kwargs):
7084 """
7085 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
7086
7087 Registers a system wide hotkey. Every time the user presses the hotkey
7088 registered here, this window will receive a hotkey event. It will
7089 receive the event even if the application is in the background and
7090 does not have the input focus because the user is working with some
7091 other application. To bind an event handler function to this hotkey
7092 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
7093 hotkey was registered successfully.
7094 """
7095 return _core_.Window_RegisterHotKey(*args, **kwargs)
7096
7097 def UnregisterHotKey(*args, **kwargs):
7098 """
7099 UnregisterHotKey(self, int hotkeyId) -> bool
7100
7101 Unregisters a system wide hotkey.
7102 """
7103 return _core_.Window_UnregisterHotKey(*args, **kwargs)
7104
7105 def ConvertDialogPointToPixels(*args, **kwargs):
7106 """
7107 ConvertDialogPointToPixels(self, Point pt) -> Point
7108
7109 Converts a point or size from dialog units to pixels. Dialog units
7110 are used for maintaining a dialog's proportions even if the font
7111 changes. For the x dimension, the dialog units are multiplied by the
7112 average character width and then divided by 4. For the y dimension,
7113 the dialog units are multiplied by the average character height and
7114 then divided by 8.
7115 """
7116 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
7117
7118 def ConvertDialogSizeToPixels(*args, **kwargs):
7119 """
7120 ConvertDialogSizeToPixels(self, Size sz) -> Size
7121
7122 Converts a point or size from dialog units to pixels. Dialog units
7123 are used for maintaining a dialog's proportions even if the font
7124 changes. For the x dimension, the dialog units are multiplied by the
7125 average character width and then divided by 4. For the y dimension,
7126 the dialog units are multiplied by the average character height and
7127 then divided by 8.
7128 """
7129 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
7130
7131 def DLG_PNT(*args, **kwargs):
7132 """
7133 DLG_PNT(self, Point pt) -> Point
7134
7135 Converts a point or size from dialog units to pixels. Dialog units
7136 are used for maintaining a dialog's proportions even if the font
7137 changes. For the x dimension, the dialog units are multiplied by the
7138 average character width and then divided by 4. For the y dimension,
7139 the dialog units are multiplied by the average character height and
7140 then divided by 8.
7141 """
7142 return _core_.Window_DLG_PNT(*args, **kwargs)
7143
7144 def DLG_SZE(*args, **kwargs):
7145 """
7146 DLG_SZE(self, Size sz) -> Size
7147
7148 Converts a point or size from dialog units to pixels. Dialog units
7149 are used for maintaining a dialog's proportions even if the font
7150 changes. For the x dimension, the dialog units are multiplied by the
7151 average character width and then divided by 4. For the y dimension,
7152 the dialog units are multiplied by the average character height and
7153 then divided by 8.
7154 """
7155 return _core_.Window_DLG_SZE(*args, **kwargs)
7156
7157 def ConvertPixelPointToDialog(*args, **kwargs):
7158 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
7159 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
7160
7161 def ConvertPixelSizeToDialog(*args, **kwargs):
7162 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
7163 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
7164
7165 def WarpPointer(*args, **kwargs):
7166 """
7167 WarpPointer(self, int x, int y)
7168
7169 Moves the pointer to the given position on the window.
7170
7171 NOTE: This function is not supported under Mac because Apple Human
7172 Interface Guidelines forbid moving the mouse cursor programmatically.
7173 """
7174 return _core_.Window_WarpPointer(*args, **kwargs)
7175
7176 def CaptureMouse(*args, **kwargs):
7177 """
7178 CaptureMouse(self)
7179
7180 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
7181 release the capture.
7182
7183 Note that wxWindows maintains the stack of windows having captured the
7184 mouse and when the mouse is released the capture returns to the window
7185 which had had captured it previously and it is only really released if
7186 there were no previous window. In particular, this means that you must
7187 release the mouse as many times as you capture it.
7188 """
7189 return _core_.Window_CaptureMouse(*args, **kwargs)
7190
7191 def ReleaseMouse(*args, **kwargs):
7192 """
7193 ReleaseMouse(self)
7194
7195 Releases mouse input captured with wx.Window.CaptureMouse.
7196 """
7197 return _core_.Window_ReleaseMouse(*args, **kwargs)
7198
7199 def GetCapture(*args, **kwargs):
7200 """
7201 GetCapture() -> Window
7202
7203 Returns the window which currently captures the mouse or None
7204 """
7205 return _core_.Window_GetCapture(*args, **kwargs)
7206
7207 GetCapture = staticmethod(GetCapture)
7208 def HasCapture(*args, **kwargs):
7209 """
7210 HasCapture(self) -> bool
7211
7212 Returns true if this window has the current mouse capture.
7213 """
7214 return _core_.Window_HasCapture(*args, **kwargs)
7215
7216 def Refresh(*args, **kwargs):
7217 """
7218 Refresh(self, bool eraseBackground=True, Rect rect=None)
7219
7220 Mark the specified rectangle (or the whole window) as "dirty" so it
7221 will be repainted. Causes an EVT_PAINT event to be generated and sent
7222 to the window.
7223 """
7224 return _core_.Window_Refresh(*args, **kwargs)
7225
7226 def RefreshRect(*args, **kwargs):
7227 """
7228 RefreshRect(self, Rect rect, bool eraseBackground=True)
7229
7230 Redraws the contents of the given rectangle: the area inside it will
7231 be repainted. This is the same as Refresh but has a nicer syntax.
7232 """
7233 return _core_.Window_RefreshRect(*args, **kwargs)
7234
7235 def Update(*args, **kwargs):
7236 """
7237 Update(self)
7238
7239 Calling this method immediately repaints the invalidated area of the
7240 window instead of waiting for the EVT_PAINT event to happen, (normally
7241 this would usually only happen when the flow of control returns to the
7242 event loop.) Notice that this function doesn't refresh the window and
7243 does nothing if the window has been already repainted. Use Refresh
7244 first if you want to immediately redraw the window (or some portion of
7245 it) unconditionally.
7246 """
7247 return _core_.Window_Update(*args, **kwargs)
7248
7249 def ClearBackground(*args, **kwargs):
7250 """
7251 ClearBackground(self)
7252
7253 Clears the window by filling it with the current background
7254 colour. Does not cause an erase background event to be generated.
7255 """
7256 return _core_.Window_ClearBackground(*args, **kwargs)
7257
7258 def Freeze(*args, **kwargs):
7259 """
7260 Freeze(self)
7261
7262 Freezes the window or, in other words, prevents any updates from
7263 taking place on screen, the window is not redrawn at all. Thaw must be
7264 called to reenable window redrawing. Calls to Freeze/Thaw may be
7265 nested, with the actual Thaw being delayed until all the nesting has
7266 been undone.
7267
7268 This method is useful for visual appearance optimization (for example,
7269 it is a good idea to use it before inserting large amount of text into
7270 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
7271 for all controls so it is mostly just a hint to wxWindows and not a
7272 mandatory directive.
7273 """
7274 return _core_.Window_Freeze(*args, **kwargs)
7275
7276 def Thaw(*args, **kwargs):
7277 """
7278 Thaw(self)
7279
7280 Reenables window updating after a previous call to Freeze. Calls to
7281 Freeze/Thaw may be nested, so Thaw must be called the same number of
7282 times that Freeze was before the window will be updated.
7283 """
7284 return _core_.Window_Thaw(*args, **kwargs)
7285
7286 def PrepareDC(*args, **kwargs):
7287 """
7288 PrepareDC(self, DC dc)
7289
7290 Call this function to prepare the device context for drawing a
7291 scrolled image. It sets the device origin according to the current
7292 scroll position.
7293 """
7294 return _core_.Window_PrepareDC(*args, **kwargs)
7295
7296 def GetUpdateRegion(*args, **kwargs):
7297 """
7298 GetUpdateRegion(self) -> Region
7299
7300 Returns the region specifying which parts of the window have been
7301 damaged. Should only be called within an EVT_PAINT handler.
7302 """
7303 return _core_.Window_GetUpdateRegion(*args, **kwargs)
7304
7305 def GetUpdateClientRect(*args, **kwargs):
7306 """
7307 GetUpdateClientRect(self) -> Rect
7308
7309 Get the update rectangle region bounding box in client coords.
7310 """
7311 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
7312
7313 def IsExposed(*args, **kwargs):
7314 """
7315 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
7316
7317 Returns true if the given point or rectangle area has been exposed
7318 since the last repaint. Call this in an paint event handler to
7319 optimize redrawing by only redrawing those areas, which have been
7320 exposed.
7321 """
7322 return _core_.Window_IsExposed(*args, **kwargs)
7323
7324 def IsExposedPoint(*args, **kwargs):
7325 """
7326 IsExposedPoint(self, Point pt) -> bool
7327
7328 Returns true if the given point or rectangle area has been exposed
7329 since the last repaint. Call this in an paint event handler to
7330 optimize redrawing by only redrawing those areas, which have been
7331 exposed.
7332 """
7333 return _core_.Window_IsExposedPoint(*args, **kwargs)
7334
7335 def IsExposedRect(*args, **kwargs):
7336 """
7337 IsExposedRect(self, Rect rect) -> bool
7338
7339 Returns true if the given point or rectangle area has been exposed
7340 since the last repaint. Call this in an paint event handler to
7341 optimize redrawing by only redrawing those areas, which have been
7342 exposed.
7343 """
7344 return _core_.Window_IsExposedRect(*args, **kwargs)
7345
7346 def GetDefaultAttributes(*args, **kwargs):
7347 """
7348 GetDefaultAttributes(self) -> VisualAttributes
7349
7350 Get the default attributes for an instance of this class. This is
7351 useful if you want to use the same font or colour in your own control
7352 as in a standard control -- which is a much better idea than hard
7353 coding specific colours or fonts which might look completely out of
7354 place on the user's system, especially if it uses themes.
7355 """
7356 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
7357
7358 def GetClassDefaultAttributes(*args, **kwargs):
7359 """
7360 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7361
7362 Get the default attributes for this class. This is useful if you want
7363 to use the same font or colour in your own control as in a standard
7364 control -- which is a much better idea than hard coding specific
7365 colours or fonts which might look completely out of place on the
7366 user's system, especially if it uses themes.
7367
7368 The variant parameter is only relevant under Mac currently and is
7369 ignore under other platforms. Under Mac, it will change the size of
7370 the returned font. See `wx.Window.SetWindowVariant` for more about
7371 this.
7372 """
7373 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7374
7375 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
7376 def SetBackgroundColour(*args, **kwargs):
7377 """
7378 SetBackgroundColour(self, Colour colour) -> bool
7379
7380 Sets the background colour of the window. Returns True if the colour
7381 was changed. The background colour is usually painted by the default
7382 EVT_ERASE_BACKGROUND event handler function under Windows and
7383 automatically under GTK. Using `wx.NullColour` will reset the window
7384 to the default background colour.
7385
7386 Note that setting the background colour may not cause an immediate
7387 refresh, so you may wish to call `ClearBackground` or `Refresh` after
7388 calling this function.
7389
7390 Using this function will disable attempts to use themes for this
7391 window, if the system supports them. Use with care since usually the
7392 themes represent the appearance chosen by the user to be used for all
7393 applications on the system.
7394 """
7395 return _core_.Window_SetBackgroundColour(*args, **kwargs)
7396
7397 def SetOwnBackgroundColour(*args, **kwargs):
7398 """SetOwnBackgroundColour(self, Colour colour)"""
7399 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
7400
7401 def SetForegroundColour(*args, **kwargs):
7402 """
7403 SetForegroundColour(self, Colour colour) -> bool
7404
7405 Sets the foreground colour of the window. Returns True is the colour
7406 was changed. The interpretation of foreground colour is dependent on
7407 the window class; it may be the text colour or other colour, or it may
7408 not be used at all.
7409 """
7410 return _core_.Window_SetForegroundColour(*args, **kwargs)
7411
7412 def SetOwnForegroundColour(*args, **kwargs):
7413 """SetOwnForegroundColour(self, Colour colour)"""
7414 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
7415
7416 def GetBackgroundColour(*args, **kwargs):
7417 """
7418 GetBackgroundColour(self) -> Colour
7419
7420 Returns the background colour of the window.
7421 """
7422 return _core_.Window_GetBackgroundColour(*args, **kwargs)
7423
7424 def GetForegroundColour(*args, **kwargs):
7425 """
7426 GetForegroundColour(self) -> Colour
7427
7428 Returns the foreground colour of the window. The interpretation of
7429 foreground colour is dependent on the window class; it may be the text
7430 colour or other colour, or it may not be used at all.
7431 """
7432 return _core_.Window_GetForegroundColour(*args, **kwargs)
7433
7434 def InheritsBackgroundColour(*args, **kwargs):
7435 """InheritsBackgroundColour(self) -> bool"""
7436 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
7437
7438 def UseBgCol(*args, **kwargs):
7439 """UseBgCol(self) -> bool"""
7440 return _core_.Window_UseBgCol(*args, **kwargs)
7441
7442 def SetBackgroundStyle(*args, **kwargs):
7443 """
7444 SetBackgroundStyle(self, int style) -> bool
7445
7446 Returns the background style of the window. The background style
7447 indicates how the background of the window is drawn.
7448
7449 ====================== ========================================
7450 wx.BG_STYLE_SYSTEM The background colour or pattern should
7451 be determined by the system
7452 wx.BG_STYLE_COLOUR The background should be a solid colour
7453 wx.BG_STYLE_CUSTOM The background will be implemented by the
7454 application.
7455 ====================== ========================================
7456
7457 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7458 a custom background, such as a tiled bitmap. Currently the style has
7459 no effect on other platforms.
7460
7461 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7462 """
7463 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
7464
7465 def GetBackgroundStyle(*args, **kwargs):
7466 """
7467 GetBackgroundStyle(self) -> int
7468
7469 Returns the background style of the window.
7470
7471 :see: `SetBackgroundStyle`
7472 """
7473 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
7474
7475 def HasTransparentBackground(*args, **kwargs):
7476 """
7477 HasTransparentBackground(self) -> bool
7478
7479 Returns True if this window's background is transparent (as, for
7480 example, for `wx.StaticText`) and should show the parent window's
7481 background.
7482
7483 This method is mostly used internally by the library itself and you
7484 normally shouldn't have to call it. You may, however, have to override
7485 it in your custom control classes to ensure that background is painted
7486 correctly.
7487 """
7488 return _core_.Window_HasTransparentBackground(*args, **kwargs)
7489
7490 def SetCursor(*args, **kwargs):
7491 """
7492 SetCursor(self, Cursor cursor) -> bool
7493
7494 Sets the window's cursor. Notice that the window cursor also sets it
7495 for the children of the window implicitly.
7496
7497 The cursor may be wx.NullCursor in which case the window cursor will
7498 be reset back to default.
7499 """
7500 return _core_.Window_SetCursor(*args, **kwargs)
7501
7502 def GetCursor(*args, **kwargs):
7503 """
7504 GetCursor(self) -> Cursor
7505
7506 Return the cursor associated with this window.
7507 """
7508 return _core_.Window_GetCursor(*args, **kwargs)
7509
7510 def SetFont(*args, **kwargs):
7511 """
7512 SetFont(self, Font font) -> bool
7513
7514 Sets the font for this window.
7515 """
7516 return _core_.Window_SetFont(*args, **kwargs)
7517
7518 def SetOwnFont(*args, **kwargs):
7519 """SetOwnFont(self, Font font)"""
7520 return _core_.Window_SetOwnFont(*args, **kwargs)
7521
7522 def GetFont(*args, **kwargs):
7523 """
7524 GetFont(self) -> Font
7525
7526 Returns the default font used for this window.
7527 """
7528 return _core_.Window_GetFont(*args, **kwargs)
7529
7530 def SetCaret(*args, **kwargs):
7531 """
7532 SetCaret(self, Caret caret)
7533
7534 Sets the caret associated with the window.
7535 """
7536 return _core_.Window_SetCaret(*args, **kwargs)
7537
7538 def GetCaret(*args, **kwargs):
7539 """
7540 GetCaret(self) -> Caret
7541
7542 Returns the caret associated with the window.
7543 """
7544 return _core_.Window_GetCaret(*args, **kwargs)
7545
7546 def GetCharHeight(*args, **kwargs):
7547 """
7548 GetCharHeight(self) -> int
7549
7550 Get the (average) character size for the current font.
7551 """
7552 return _core_.Window_GetCharHeight(*args, **kwargs)
7553
7554 def GetCharWidth(*args, **kwargs):
7555 """
7556 GetCharWidth(self) -> int
7557
7558 Get the (average) character size for the current font.
7559 """
7560 return _core_.Window_GetCharWidth(*args, **kwargs)
7561
7562 def GetTextExtent(*args, **kwargs):
7563 """
7564 GetTextExtent(String string) -> (width, height)
7565
7566 Get the width and height of the text using the current font.
7567 """
7568 return _core_.Window_GetTextExtent(*args, **kwargs)
7569
7570 def GetFullTextExtent(*args, **kwargs):
7571 """
7572 GetFullTextExtent(String string, Font font=None) ->
7573 (width, height, descent, externalLeading)
7574
7575 Get the width, height, decent and leading of the text using the
7576 current or specified font.
7577 """
7578 return _core_.Window_GetFullTextExtent(*args, **kwargs)
7579
7580 def ClientToScreenXY(*args, **kwargs):
7581 """
7582 ClientToScreenXY(int x, int y) -> (x,y)
7583
7584 Converts to screen coordinates from coordinates relative to this window.
7585 """
7586 return _core_.Window_ClientToScreenXY(*args, **kwargs)
7587
7588 def ScreenToClientXY(*args, **kwargs):
7589 """
7590 ScreenToClientXY(int x, int y) -> (x,y)
7591
7592 Converts from screen to client window coordinates.
7593 """
7594 return _core_.Window_ScreenToClientXY(*args, **kwargs)
7595
7596 def ClientToScreen(*args, **kwargs):
7597 """
7598 ClientToScreen(self, Point pt) -> Point
7599
7600 Converts to screen coordinates from coordinates relative to this window.
7601 """
7602 return _core_.Window_ClientToScreen(*args, **kwargs)
7603
7604 def ScreenToClient(*args, **kwargs):
7605 """
7606 ScreenToClient(self, Point pt) -> Point
7607
7608 Converts from screen to client window coordinates.
7609 """
7610 return _core_.Window_ScreenToClient(*args, **kwargs)
7611
7612 def HitTestXY(*args, **kwargs):
7613 """
7614 HitTestXY(self, int x, int y) -> int
7615
7616 Test where the given (in client coords) point lies
7617 """
7618 return _core_.Window_HitTestXY(*args, **kwargs)
7619
7620 def HitTest(*args, **kwargs):
7621 """
7622 HitTest(self, Point pt) -> int
7623
7624 Test where the given (in client coords) point lies
7625 """
7626 return _core_.Window_HitTest(*args, **kwargs)
7627
7628 def GetBorder(*args):
7629 """
7630 GetBorder(self, long flags) -> int
7631 GetBorder(self) -> int
7632
7633 Get border for the flags of this window
7634 """
7635 return _core_.Window_GetBorder(*args)
7636
7637 def UpdateWindowUI(*args, **kwargs):
7638 """
7639 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
7640
7641 This function sends EVT_UPDATE_UI events to the window. The particular
7642 implementation depends on the window; for example a wx.ToolBar will
7643 send an update UI event for each toolbar button, and a wx.Frame will
7644 send an update UI event for each menubar menu item. You can call this
7645 function from your application to ensure that your UI is up-to-date at
7646 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7647 concerned). This may be necessary if you have called
7648 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7649 limit the overhead that wxWindows incurs by sending update UI events
7650 in idle time.
7651 """
7652 return _core_.Window_UpdateWindowUI(*args, **kwargs)
7653
7654 def PopupMenuXY(*args, **kwargs):
7655 """
7656 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
7657
7658 Pops up the given menu at the specified coordinates, relative to this window,
7659 and returns control when the user has dismissed the menu. If a menu item is
7660 selected, the corresponding menu event is generated and will be processed as
7661 usual. If the default position is given then the current position of the
7662 mouse cursor will be used.
7663 """
7664 return _core_.Window_PopupMenuXY(*args, **kwargs)
7665
7666 def PopupMenu(*args, **kwargs):
7667 """
7668 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
7669
7670 Pops up the given menu at the specified coordinates, relative to this window,
7671 and returns control when the user has dismissed the menu. If a menu item is
7672 selected, the corresponding menu event is generated and will be processed as
7673 usual. If the default position is given then the current position of the
7674 mouse cursor will be used.
7675 """
7676 return _core_.Window_PopupMenu(*args, **kwargs)
7677
7678 def GetHandle(*args, **kwargs):
7679 """
7680 GetHandle(self) -> long
7681
7682 Returns the platform-specific handle (as a long integer) of the
7683 physical window. Currently on wxMac it returns the handle of the
7684 toplevel parent of the window.
7685 """
7686 return _core_.Window_GetHandle(*args, **kwargs)
7687
7688 def AssociateHandle(*args, **kwargs):
7689 """
7690 AssociateHandle(self, long handle)
7691
7692 Associate the window with a new native handle
7693 """
7694 return _core_.Window_AssociateHandle(*args, **kwargs)
7695
7696 def DissociateHandle(*args, **kwargs):
7697 """
7698 DissociateHandle(self)
7699
7700 Dissociate the current native handle from the window
7701 """
7702 return _core_.Window_DissociateHandle(*args, **kwargs)
7703
7704 def OnPaint(*args, **kwargs):
7705 """OnPaint(self, PaintEvent event)"""
7706 return _core_.Window_OnPaint(*args, **kwargs)
7707
7708 def HasScrollbar(*args, **kwargs):
7709 """
7710 HasScrollbar(self, int orient) -> bool
7711
7712 Does the window have the scrollbar for this orientation?
7713 """
7714 return _core_.Window_HasScrollbar(*args, **kwargs)
7715
7716 def SetScrollbar(*args, **kwargs):
7717 """
7718 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
7719 bool refresh=True)
7720
7721 Sets the scrollbar properties of a built-in scrollbar.
7722 """
7723 return _core_.Window_SetScrollbar(*args, **kwargs)
7724
7725 def SetScrollPos(*args, **kwargs):
7726 """
7727 SetScrollPos(self, int orientation, int pos, bool refresh=True)
7728
7729 Sets the position of one of the built-in scrollbars.
7730 """
7731 return _core_.Window_SetScrollPos(*args, **kwargs)
7732
7733 def GetScrollPos(*args, **kwargs):
7734 """
7735 GetScrollPos(self, int orientation) -> int
7736
7737 Returns the built-in scrollbar position.
7738 """
7739 return _core_.Window_GetScrollPos(*args, **kwargs)
7740
7741 def GetScrollThumb(*args, **kwargs):
7742 """
7743 GetScrollThumb(self, int orientation) -> int
7744
7745 Returns the built-in scrollbar thumb size.
7746 """
7747 return _core_.Window_GetScrollThumb(*args, **kwargs)
7748
7749 def GetScrollRange(*args, **kwargs):
7750 """
7751 GetScrollRange(self, int orientation) -> int
7752
7753 Returns the built-in scrollbar range.
7754 """
7755 return _core_.Window_GetScrollRange(*args, **kwargs)
7756
7757 def ScrollWindow(*args, **kwargs):
7758 """
7759 ScrollWindow(self, int dx, int dy, Rect rect=None)
7760
7761 Physically scrolls the pixels in the window and move child windows
7762 accordingly. Use this function to optimise your scrolling
7763 implementations, to minimise the area that must be redrawn. Note that
7764 it is rarely required to call this function from a user program.
7765 """
7766 return _core_.Window_ScrollWindow(*args, **kwargs)
7767
7768 def ScrollLines(*args, **kwargs):
7769 """
7770 ScrollLines(self, int lines) -> bool
7771
7772 If the platform and window class supports it, scrolls the window by
7773 the given number of lines down, if lines is positive, or up if lines
7774 is negative. Returns True if the window was scrolled, False if it was
7775 already on top/bottom and nothing was done.
7776 """
7777 return _core_.Window_ScrollLines(*args, **kwargs)
7778
7779 def ScrollPages(*args, **kwargs):
7780 """
7781 ScrollPages(self, int pages) -> bool
7782
7783 If the platform and window class supports it, scrolls the window by
7784 the given number of pages down, if pages is positive, or up if pages
7785 is negative. Returns True if the window was scrolled, False if it was
7786 already on top/bottom and nothing was done.
7787 """
7788 return _core_.Window_ScrollPages(*args, **kwargs)
7789
7790 def LineUp(*args, **kwargs):
7791 """
7792 LineUp(self) -> bool
7793
7794 This is just a wrapper for ScrollLines(-1).
7795 """
7796 return _core_.Window_LineUp(*args, **kwargs)
7797
7798 def LineDown(*args, **kwargs):
7799 """
7800 LineDown(self) -> bool
7801
7802 This is just a wrapper for ScrollLines(1).
7803 """
7804 return _core_.Window_LineDown(*args, **kwargs)
7805
7806 def PageUp(*args, **kwargs):
7807 """
7808 PageUp(self) -> bool
7809
7810 This is just a wrapper for ScrollPages(-1).
7811 """
7812 return _core_.Window_PageUp(*args, **kwargs)
7813
7814 def PageDown(*args, **kwargs):
7815 """
7816 PageDown(self) -> bool
7817
7818 This is just a wrapper for ScrollPages(1).
7819 """
7820 return _core_.Window_PageDown(*args, **kwargs)
7821
7822 def SetHelpText(*args, **kwargs):
7823 """
7824 SetHelpText(self, String text)
7825
7826 Sets the help text to be used as context-sensitive help for this
7827 window. Note that the text is actually stored by the current
7828 wxHelpProvider implementation, and not in the window object itself.
7829 """
7830 return _core_.Window_SetHelpText(*args, **kwargs)
7831
7832 def SetHelpTextForId(*args, **kwargs):
7833 """
7834 SetHelpTextForId(self, String text)
7835
7836 Associate this help text with all windows with the same id as this
7837 one.
7838 """
7839 return _core_.Window_SetHelpTextForId(*args, **kwargs)
7840
7841 def GetHelpText(*args, **kwargs):
7842 """
7843 GetHelpText(self) -> String
7844
7845 Gets the help text to be used as context-sensitive help for this
7846 window. Note that the text is actually stored by the current
7847 wxHelpProvider implementation, and not in the window object itself.
7848 """
7849 return _core_.Window_GetHelpText(*args, **kwargs)
7850
7851 def SetToolTipString(*args, **kwargs):
7852 """
7853 SetToolTipString(self, String tip)
7854
7855 Attach a tooltip to the window.
7856 """
7857 return _core_.Window_SetToolTipString(*args, **kwargs)
7858
7859 def SetToolTip(*args, **kwargs):
7860 """
7861 SetToolTip(self, ToolTip tip)
7862
7863 Attach a tooltip to the window.
7864 """
7865 return _core_.Window_SetToolTip(*args, **kwargs)
7866
7867 def GetToolTip(*args, **kwargs):
7868 """
7869 GetToolTip(self) -> ToolTip
7870
7871 get the associated tooltip or None if none
7872 """
7873 return _core_.Window_GetToolTip(*args, **kwargs)
7874
7875 def SetDropTarget(*args, **kwargs):
7876 """
7877 SetDropTarget(self, DropTarget dropTarget)
7878
7879 Associates a drop target with this window. If the window already has
7880 a drop target, it is deleted.
7881 """
7882 return _core_.Window_SetDropTarget(*args, **kwargs)
7883
7884 def GetDropTarget(*args, **kwargs):
7885 """
7886 GetDropTarget(self) -> DropTarget
7887
7888 Returns the associated drop target, which may be None.
7889 """
7890 return _core_.Window_GetDropTarget(*args, **kwargs)
7891
7892 def DragAcceptFiles(*args, **kwargs):
7893 """
7894 DragAcceptFiles(self, bool accept)
7895
7896 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
7897 Only available on Windows.
7898 """
7899 return _core_.Window_DragAcceptFiles(*args, **kwargs)
7900
7901 def SetConstraints(*args, **kwargs):
7902 """
7903 SetConstraints(self, LayoutConstraints constraints)
7904
7905 Sets the window to have the given layout constraints. If an existing
7906 layout constraints object is already owned by the window, it will be
7907 deleted. Pass None to disassociate and delete the window's current
7908 constraints.
7909
7910 You must call SetAutoLayout to tell a window to use the constraints
7911 automatically in its default EVT_SIZE handler; otherwise, you must
7912 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7913 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7914 effect.
7915 """
7916 return _core_.Window_SetConstraints(*args, **kwargs)
7917
7918 def GetConstraints(*args, **kwargs):
7919 """
7920 GetConstraints(self) -> LayoutConstraints
7921
7922 Returns a pointer to the window's layout constraints, or None if there
7923 are none.
7924 """
7925 return _core_.Window_GetConstraints(*args, **kwargs)
7926
7927 def SetAutoLayout(*args, **kwargs):
7928 """
7929 SetAutoLayout(self, bool autoLayout)
7930
7931 Determines whether the Layout function will be called automatically
7932 when the window is resized. It is called implicitly by SetSizer but
7933 if you use SetConstraints you should call it manually or otherwise the
7934 window layout won't be correctly updated when its size changes.
7935 """
7936 return _core_.Window_SetAutoLayout(*args, **kwargs)
7937
7938 def GetAutoLayout(*args, **kwargs):
7939 """
7940 GetAutoLayout(self) -> bool
7941
7942 Returns the current autoLayout setting
7943 """
7944 return _core_.Window_GetAutoLayout(*args, **kwargs)
7945
7946 def Layout(*args, **kwargs):
7947 """
7948 Layout(self) -> bool
7949
7950 Invokes the constraint-based layout algorithm or the sizer-based
7951 algorithm for this window. See SetAutoLayout: when auto layout is on,
7952 this function gets called automatically by the default EVT_SIZE
7953 handler when the window is resized.
7954 """
7955 return _core_.Window_Layout(*args, **kwargs)
7956
7957 def SetSizer(*args, **kwargs):
7958 """
7959 SetSizer(self, Sizer sizer, bool deleteOld=True)
7960
7961 Sets the window to have the given layout sizer. The window will then
7962 own the object, and will take care of its deletion. If an existing
7963 layout sizer object is already owned by the window, it will be deleted
7964 if the deleteOld parameter is true. Note that this function will also
7965 call SetAutoLayout implicitly with a True parameter if the sizer is
7966 non-None, and False otherwise.
7967 """
7968 return _core_.Window_SetSizer(*args, **kwargs)
7969
7970 def SetSizerAndFit(*args, **kwargs):
7971 """
7972 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
7973
7974 The same as SetSizer, except it also sets the size hints for the
7975 window based on the sizer's minimum size.
7976 """
7977 return _core_.Window_SetSizerAndFit(*args, **kwargs)
7978
7979 def GetSizer(*args, **kwargs):
7980 """
7981 GetSizer(self) -> Sizer
7982
7983 Return the sizer associated with the window by a previous call to
7984 SetSizer or None if there isn't one.
7985 """
7986 return _core_.Window_GetSizer(*args, **kwargs)
7987
7988 def SetContainingSizer(*args, **kwargs):
7989 """
7990 SetContainingSizer(self, Sizer sizer)
7991
7992 This normally does not need to be called by application code. It is
7993 called internally when a window is added to a sizer, and is used so
7994 the window can remove itself from the sizer when it is destroyed.
7995 """
7996 return _core_.Window_SetContainingSizer(*args, **kwargs)
7997
7998 def GetContainingSizer(*args, **kwargs):
7999 """
8000 GetContainingSizer(self) -> Sizer
8001
8002 Return the sizer that this window is a member of, if any, otherwise None.
8003 """
8004 return _core_.Window_GetContainingSizer(*args, **kwargs)
8005
8006 def InheritAttributes(*args, **kwargs):
8007 """
8008 InheritAttributes(self)
8009
8010 This function is (or should be, in case of custom controls) called
8011 during window creation to intelligently set up the window visual
8012 attributes, that is the font and the foreground and background
8013 colours.
8014
8015 By 'intelligently' the following is meant: by default, all windows use
8016 their own default attributes. However if some of the parent's
8017 attributes are explicitly changed (that is, using SetFont and not
8018 SetOwnFont) and if the corresponding attribute hadn't been
8019 explicitly set for this window itself, then this window takes the same
8020 value as used by the parent. In addition, if the window overrides
8021 ShouldInheritColours to return false, the colours will not be changed
8022 no matter what and only the font might.
8023
8024 This rather complicated logic is necessary in order to accommodate the
8025 different usage scenarios. The most common one is when all default
8026 attributes are used and in this case, nothing should be inherited as
8027 in modern GUIs different controls use different fonts (and colours)
8028 than their siblings so they can't inherit the same value from the
8029 parent. However it was also deemed desirable to allow to simply change
8030 the attributes of all children at once by just changing the font or
8031 colour of their common parent, hence in this case we do inherit the
8032 parents attributes.
8033
8034 """
8035 return _core_.Window_InheritAttributes(*args, **kwargs)
8036
8037 def ShouldInheritColours(*args, **kwargs):
8038 """
8039 ShouldInheritColours(self) -> bool
8040
8041 Return true from here to allow the colours of this window to be
8042 changed by InheritAttributes, returning false forbids inheriting them
8043 from the parent window.
8044
8045 The base class version returns false, but this method is overridden in
8046 wxControl where it returns true.
8047 """
8048 return _core_.Window_ShouldInheritColours(*args, **kwargs)
8049
8050 def PostCreate(self, pre):
8051 """
8052 Phase 3 of the 2-phase create <wink!>
8053 Call this method after precreating the window with the 2-phase create method.
8054 """
8055 self.this = pre.this
8056 self.thisown = pre.thisown
8057 pre.thisown = 0
8058 if hasattr(self, '_setOORInfo'):
8059 self._setOORInfo(self)
8060 if hasattr(self, '_setCallbackInfo'):
8061 self._setCallbackInfo(self, self.__class__)
8062
8063
8064 class WindowPtr(Window):
8065 def __init__(self, this):
8066 self.this = this
8067 if not hasattr(self,"thisown"): self.thisown = 0
8068 self.__class__ = Window
8069 _core_.Window_swigregister(WindowPtr)
8070
8071 def PreWindow(*args, **kwargs):
8072 """
8073 PreWindow() -> Window
8074
8075 Precreate a Window for 2-phase creation.
8076 """
8077 val = _core_.new_PreWindow(*args, **kwargs)
8078 val.thisown = 1
8079 return val
8080
8081 def Window_NewControlId(*args, **kwargs):
8082 """
8083 Window_NewControlId() -> int
8084
8085 Generate a control id for the controls which were not given one.
8086 """
8087 return _core_.Window_NewControlId(*args, **kwargs)
8088
8089 def Window_NextControlId(*args, **kwargs):
8090 """
8091 Window_NextControlId(int winid) -> int
8092
8093 Get the id of the control following the one with the given
8094 autogenerated) id
8095 """
8096 return _core_.Window_NextControlId(*args, **kwargs)
8097
8098 def Window_PrevControlId(*args, **kwargs):
8099 """
8100 Window_PrevControlId(int winid) -> int
8101
8102 Get the id of the control preceding the one with the given
8103 autogenerated) id
8104 """
8105 return _core_.Window_PrevControlId(*args, **kwargs)
8106
8107 def Window_FindFocus(*args, **kwargs):
8108 """
8109 Window_FindFocus() -> Window
8110
8111 Returns the window or control that currently has the keyboard focus,
8112 or None.
8113 """
8114 return _core_.Window_FindFocus(*args, **kwargs)
8115
8116 def Window_GetCapture(*args, **kwargs):
8117 """
8118 Window_GetCapture() -> Window
8119
8120 Returns the window which currently captures the mouse or None
8121 """
8122 return _core_.Window_GetCapture(*args, **kwargs)
8123
8124 def Window_GetClassDefaultAttributes(*args, **kwargs):
8125 """
8126 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8127
8128 Get the default attributes for this class. This is useful if you want
8129 to use the same font or colour in your own control as in a standard
8130 control -- which is a much better idea than hard coding specific
8131 colours or fonts which might look completely out of place on the
8132 user's system, especially if it uses themes.
8133
8134 The variant parameter is only relevant under Mac currently and is
8135 ignore under other platforms. Under Mac, it will change the size of
8136 the returned font. See `wx.Window.SetWindowVariant` for more about
8137 this.
8138 """
8139 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8140
8141 def DLG_PNT(win, point_or_x, y=None):
8142 """
8143 Convenience function for converting a Point or (x,y) in
8144 dialog units to pixel units.
8145 """
8146 if y is None:
8147 return win.ConvertDialogPointToPixels(point_or_x)
8148 else:
8149 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
8150
8151 def DLG_SZE(win, size_width, height=None):
8152 """
8153 Convenience function for converting a Size or (w,h) in
8154 dialog units to pixel units.
8155 """
8156 if height is None:
8157 return win.ConvertDialogSizeToPixels(size_width)
8158 else:
8159 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
8160
8161
8162 def FindWindowById(*args, **kwargs):
8163 """
8164 FindWindowById(long id, Window parent=None) -> Window
8165
8166 Find the first window in the application with the given id. If parent
8167 is None, the search will start from all top-level frames and dialog
8168 boxes; if non-None, the search will be limited to the given window
8169 hierarchy. The search is recursive in both cases.
8170 """
8171 return _core_.FindWindowById(*args, **kwargs)
8172
8173 def FindWindowByName(*args, **kwargs):
8174 """
8175 FindWindowByName(String name, Window parent=None) -> Window
8176
8177 Find a window by its name (as given in a window constructor or Create
8178 function call). If parent is None, the search will start from all
8179 top-level frames and dialog boxes; if non-None, the search will be
8180 limited to the given window hierarchy. The search is recursive in both
8181 cases.
8182
8183 If no window with such name is found, wx.FindWindowByLabel is called.
8184 """
8185 return _core_.FindWindowByName(*args, **kwargs)
8186
8187 def FindWindowByLabel(*args, **kwargs):
8188 """
8189 FindWindowByLabel(String label, Window parent=None) -> Window
8190
8191 Find a window by its label. Depending on the type of window, the label
8192 may be a window title or panel item label. If parent is None, the
8193 search will start from all top-level frames and dialog boxes; if
8194 non-None, the search will be limited to the given window
8195 hierarchy. The search is recursive in both cases.
8196 """
8197 return _core_.FindWindowByLabel(*args, **kwargs)
8198
8199 def Window_FromHWND(*args, **kwargs):
8200 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
8201 return _core_.Window_FromHWND(*args, **kwargs)
8202 #---------------------------------------------------------------------------
8203
8204 class Validator(EvtHandler):
8205 """Proxy of C++ Validator class"""
8206 def __repr__(self):
8207 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8208 def __init__(self, *args, **kwargs):
8209 """__init__(self) -> Validator"""
8210 newobj = _core_.new_Validator(*args, **kwargs)
8211 self.this = newobj.this
8212 self.thisown = 1
8213 del newobj.thisown
8214 self._setOORInfo(self)
8215
8216 def Clone(*args, **kwargs):
8217 """Clone(self) -> Validator"""
8218 return _core_.Validator_Clone(*args, **kwargs)
8219
8220 def Validate(*args, **kwargs):
8221 """Validate(self, Window parent) -> bool"""
8222 return _core_.Validator_Validate(*args, **kwargs)
8223
8224 def TransferToWindow(*args, **kwargs):
8225 """TransferToWindow(self) -> bool"""
8226 return _core_.Validator_TransferToWindow(*args, **kwargs)
8227
8228 def TransferFromWindow(*args, **kwargs):
8229 """TransferFromWindow(self) -> bool"""
8230 return _core_.Validator_TransferFromWindow(*args, **kwargs)
8231
8232 def GetWindow(*args, **kwargs):
8233 """GetWindow(self) -> Window"""
8234 return _core_.Validator_GetWindow(*args, **kwargs)
8235
8236 def SetWindow(*args, **kwargs):
8237 """SetWindow(self, Window window)"""
8238 return _core_.Validator_SetWindow(*args, **kwargs)
8239
8240 def IsSilent(*args, **kwargs):
8241 """IsSilent() -> bool"""
8242 return _core_.Validator_IsSilent(*args, **kwargs)
8243
8244 IsSilent = staticmethod(IsSilent)
8245 def SetBellOnError(*args, **kwargs):
8246 """SetBellOnError(int doIt=True)"""
8247 return _core_.Validator_SetBellOnError(*args, **kwargs)
8248
8249 SetBellOnError = staticmethod(SetBellOnError)
8250
8251 class ValidatorPtr(Validator):
8252 def __init__(self, this):
8253 self.this = this
8254 if not hasattr(self,"thisown"): self.thisown = 0
8255 self.__class__ = Validator
8256 _core_.Validator_swigregister(ValidatorPtr)
8257
8258 def Validator_IsSilent(*args, **kwargs):
8259 """Validator_IsSilent() -> bool"""
8260 return _core_.Validator_IsSilent(*args, **kwargs)
8261
8262 def Validator_SetBellOnError(*args, **kwargs):
8263 """Validator_SetBellOnError(int doIt=True)"""
8264 return _core_.Validator_SetBellOnError(*args, **kwargs)
8265
8266 class PyValidator(Validator):
8267 """Proxy of C++ PyValidator class"""
8268 def __repr__(self):
8269 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8270 def __init__(self, *args, **kwargs):
8271 """__init__(self) -> PyValidator"""
8272 newobj = _core_.new_PyValidator(*args, **kwargs)
8273 self.this = newobj.this
8274 self.thisown = 1
8275 del newobj.thisown
8276
8277 self._setCallbackInfo(self, PyValidator, 1)
8278 self._setOORInfo(self)
8279
8280 def _setCallbackInfo(*args, **kwargs):
8281 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
8282 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
8283
8284
8285 class PyValidatorPtr(PyValidator):
8286 def __init__(self, this):
8287 self.this = this
8288 if not hasattr(self,"thisown"): self.thisown = 0
8289 self.__class__ = PyValidator
8290 _core_.PyValidator_swigregister(PyValidatorPtr)
8291
8292 #---------------------------------------------------------------------------
8293
8294 class Menu(EvtHandler):
8295 """Proxy of C++ Menu class"""
8296 def __repr__(self):
8297 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8298 def __init__(self, *args, **kwargs):
8299 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
8300 newobj = _core_.new_Menu(*args, **kwargs)
8301 self.this = newobj.this
8302 self.thisown = 1
8303 del newobj.thisown
8304 self._setOORInfo(self)
8305
8306 def Append(*args, **kwargs):
8307 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8308 return _core_.Menu_Append(*args, **kwargs)
8309
8310 def AppendSeparator(*args, **kwargs):
8311 """AppendSeparator(self) -> MenuItem"""
8312 return _core_.Menu_AppendSeparator(*args, **kwargs)
8313
8314 def AppendCheckItem(*args, **kwargs):
8315 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8316 return _core_.Menu_AppendCheckItem(*args, **kwargs)
8317
8318 def AppendRadioItem(*args, **kwargs):
8319 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8320 return _core_.Menu_AppendRadioItem(*args, **kwargs)
8321
8322 def AppendMenu(*args, **kwargs):
8323 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8324 return _core_.Menu_AppendMenu(*args, **kwargs)
8325
8326 def AppendItem(*args, **kwargs):
8327 """AppendItem(self, MenuItem item) -> MenuItem"""
8328 return _core_.Menu_AppendItem(*args, **kwargs)
8329
8330 def Break(*args, **kwargs):
8331 """Break(self)"""
8332 return _core_.Menu_Break(*args, **kwargs)
8333
8334 def InsertItem(*args, **kwargs):
8335 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
8336 return _core_.Menu_InsertItem(*args, **kwargs)
8337
8338 def Insert(*args, **kwargs):
8339 """
8340 Insert(self, size_t pos, int id, String text, String help=EmptyString,
8341 int kind=ITEM_NORMAL) -> MenuItem
8342 """
8343 return _core_.Menu_Insert(*args, **kwargs)
8344
8345 def InsertSeparator(*args, **kwargs):
8346 """InsertSeparator(self, size_t pos) -> MenuItem"""
8347 return _core_.Menu_InsertSeparator(*args, **kwargs)
8348
8349 def InsertCheckItem(*args, **kwargs):
8350 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8351 return _core_.Menu_InsertCheckItem(*args, **kwargs)
8352
8353 def InsertRadioItem(*args, **kwargs):
8354 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8355 return _core_.Menu_InsertRadioItem(*args, **kwargs)
8356
8357 def InsertMenu(*args, **kwargs):
8358 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8359 return _core_.Menu_InsertMenu(*args, **kwargs)
8360
8361 def PrependItem(*args, **kwargs):
8362 """PrependItem(self, MenuItem item) -> MenuItem"""
8363 return _core_.Menu_PrependItem(*args, **kwargs)
8364
8365 def Prepend(*args, **kwargs):
8366 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8367 return _core_.Menu_Prepend(*args, **kwargs)
8368
8369 def PrependSeparator(*args, **kwargs):
8370 """PrependSeparator(self) -> MenuItem"""
8371 return _core_.Menu_PrependSeparator(*args, **kwargs)
8372
8373 def PrependCheckItem(*args, **kwargs):
8374 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8375 return _core_.Menu_PrependCheckItem(*args, **kwargs)
8376
8377 def PrependRadioItem(*args, **kwargs):
8378 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8379 return _core_.Menu_PrependRadioItem(*args, **kwargs)
8380
8381 def PrependMenu(*args, **kwargs):
8382 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8383 return _core_.Menu_PrependMenu(*args, **kwargs)
8384
8385 def Remove(*args, **kwargs):
8386 """Remove(self, int id) -> MenuItem"""
8387 return _core_.Menu_Remove(*args, **kwargs)
8388
8389 def RemoveItem(*args, **kwargs):
8390 """RemoveItem(self, MenuItem item) -> MenuItem"""
8391 return _core_.Menu_RemoveItem(*args, **kwargs)
8392
8393 def Delete(*args, **kwargs):
8394 """Delete(self, int id) -> bool"""
8395 return _core_.Menu_Delete(*args, **kwargs)
8396
8397 def DeleteItem(*args, **kwargs):
8398 """DeleteItem(self, MenuItem item) -> bool"""
8399 return _core_.Menu_DeleteItem(*args, **kwargs)
8400
8401 def Destroy(*args, **kwargs):
8402 """
8403 Destroy(self)
8404
8405 Deletes the C++ object this Python object is a proxy for.
8406 """
8407 return _core_.Menu_Destroy(*args, **kwargs)
8408
8409 def DestroyId(*args, **kwargs):
8410 """
8411 DestroyId(self, int id) -> bool
8412
8413 Deletes the C++ object this Python object is a proxy for.
8414 """
8415 return _core_.Menu_DestroyId(*args, **kwargs)
8416
8417 def DestroyItem(*args, **kwargs):
8418 """
8419 DestroyItem(self, MenuItem item) -> bool
8420
8421 Deletes the C++ object this Python object is a proxy for.
8422 """
8423 return _core_.Menu_DestroyItem(*args, **kwargs)
8424
8425 def GetMenuItemCount(*args, **kwargs):
8426 """GetMenuItemCount(self) -> size_t"""
8427 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
8428
8429 def GetMenuItems(*args, **kwargs):
8430 """GetMenuItems(self) -> PyObject"""
8431 return _core_.Menu_GetMenuItems(*args, **kwargs)
8432
8433 def FindItem(*args, **kwargs):
8434 """FindItem(self, String item) -> int"""
8435 return _core_.Menu_FindItem(*args, **kwargs)
8436
8437 def FindItemById(*args, **kwargs):
8438 """FindItemById(self, int id) -> MenuItem"""
8439 return _core_.Menu_FindItemById(*args, **kwargs)
8440
8441 def FindItemByPosition(*args, **kwargs):
8442 """FindItemByPosition(self, size_t position) -> MenuItem"""
8443 return _core_.Menu_FindItemByPosition(*args, **kwargs)
8444
8445 def Enable(*args, **kwargs):
8446 """Enable(self, int id, bool enable)"""
8447 return _core_.Menu_Enable(*args, **kwargs)
8448
8449 def IsEnabled(*args, **kwargs):
8450 """IsEnabled(self, int id) -> bool"""
8451 return _core_.Menu_IsEnabled(*args, **kwargs)
8452
8453 def Check(*args, **kwargs):
8454 """Check(self, int id, bool check)"""
8455 return _core_.Menu_Check(*args, **kwargs)
8456
8457 def IsChecked(*args, **kwargs):
8458 """IsChecked(self, int id) -> bool"""
8459 return _core_.Menu_IsChecked(*args, **kwargs)
8460
8461 def SetLabel(*args, **kwargs):
8462 """SetLabel(self, int id, String label)"""
8463 return _core_.Menu_SetLabel(*args, **kwargs)
8464
8465 def GetLabel(*args, **kwargs):
8466 """GetLabel(self, int id) -> String"""
8467 return _core_.Menu_GetLabel(*args, **kwargs)
8468
8469 def SetHelpString(*args, **kwargs):
8470 """SetHelpString(self, int id, String helpString)"""
8471 return _core_.Menu_SetHelpString(*args, **kwargs)
8472
8473 def GetHelpString(*args, **kwargs):
8474 """GetHelpString(self, int id) -> String"""
8475 return _core_.Menu_GetHelpString(*args, **kwargs)
8476
8477 def SetTitle(*args, **kwargs):
8478 """SetTitle(self, String title)"""
8479 return _core_.Menu_SetTitle(*args, **kwargs)
8480
8481 def GetTitle(*args, **kwargs):
8482 """GetTitle(self) -> String"""
8483 return _core_.Menu_GetTitle(*args, **kwargs)
8484
8485 def SetEventHandler(*args, **kwargs):
8486 """SetEventHandler(self, EvtHandler handler)"""
8487 return _core_.Menu_SetEventHandler(*args, **kwargs)
8488
8489 def GetEventHandler(*args, **kwargs):
8490 """GetEventHandler(self) -> EvtHandler"""
8491 return _core_.Menu_GetEventHandler(*args, **kwargs)
8492
8493 def SetInvokingWindow(*args, **kwargs):
8494 """SetInvokingWindow(self, Window win)"""
8495 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
8496
8497 def GetInvokingWindow(*args, **kwargs):
8498 """GetInvokingWindow(self) -> Window"""
8499 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
8500
8501 def GetStyle(*args, **kwargs):
8502 """GetStyle(self) -> long"""
8503 return _core_.Menu_GetStyle(*args, **kwargs)
8504
8505 def UpdateUI(*args, **kwargs):
8506 """UpdateUI(self, EvtHandler source=None)"""
8507 return _core_.Menu_UpdateUI(*args, **kwargs)
8508
8509 def GetMenuBar(*args, **kwargs):
8510 """GetMenuBar(self) -> MenuBar"""
8511 return _core_.Menu_GetMenuBar(*args, **kwargs)
8512
8513 def Attach(*args, **kwargs):
8514 """Attach(self, wxMenuBarBase menubar)"""
8515 return _core_.Menu_Attach(*args, **kwargs)
8516
8517 def Detach(*args, **kwargs):
8518 """Detach(self)"""
8519 return _core_.Menu_Detach(*args, **kwargs)
8520
8521 def IsAttached(*args, **kwargs):
8522 """IsAttached(self) -> bool"""
8523 return _core_.Menu_IsAttached(*args, **kwargs)
8524
8525 def SetParent(*args, **kwargs):
8526 """SetParent(self, Menu parent)"""
8527 return _core_.Menu_SetParent(*args, **kwargs)
8528
8529 def GetParent(*args, **kwargs):
8530 """GetParent(self) -> Menu"""
8531 return _core_.Menu_GetParent(*args, **kwargs)
8532
8533
8534 class MenuPtr(Menu):
8535 def __init__(self, this):
8536 self.this = this
8537 if not hasattr(self,"thisown"): self.thisown = 0
8538 self.__class__ = Menu
8539 _core_.Menu_swigregister(MenuPtr)
8540 DefaultValidator = cvar.DefaultValidator
8541
8542 #---------------------------------------------------------------------------
8543
8544 class MenuBar(Window):
8545 """Proxy of C++ MenuBar class"""
8546 def __repr__(self):
8547 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8548 def __init__(self, *args, **kwargs):
8549 """__init__(self, long style=0) -> MenuBar"""
8550 newobj = _core_.new_MenuBar(*args, **kwargs)
8551 self.this = newobj.this
8552 self.thisown = 1
8553 del newobj.thisown
8554 self._setOORInfo(self)
8555
8556 def Append(*args, **kwargs):
8557 """Append(self, Menu menu, String title) -> bool"""
8558 return _core_.MenuBar_Append(*args, **kwargs)
8559
8560 def Insert(*args, **kwargs):
8561 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
8562 return _core_.MenuBar_Insert(*args, **kwargs)
8563
8564 def GetMenuCount(*args, **kwargs):
8565 """GetMenuCount(self) -> size_t"""
8566 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
8567
8568 def GetMenu(*args, **kwargs):
8569 """GetMenu(self, size_t pos) -> Menu"""
8570 return _core_.MenuBar_GetMenu(*args, **kwargs)
8571
8572 def Replace(*args, **kwargs):
8573 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
8574 return _core_.MenuBar_Replace(*args, **kwargs)
8575
8576 def Remove(*args, **kwargs):
8577 """Remove(self, size_t pos) -> Menu"""
8578 return _core_.MenuBar_Remove(*args, **kwargs)
8579
8580 def EnableTop(*args, **kwargs):
8581 """EnableTop(self, size_t pos, bool enable)"""
8582 return _core_.MenuBar_EnableTop(*args, **kwargs)
8583
8584 def IsEnabledTop(*args, **kwargs):
8585 """IsEnabledTop(self, size_t pos) -> bool"""
8586 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
8587
8588 def SetLabelTop(*args, **kwargs):
8589 """SetLabelTop(self, size_t pos, String label)"""
8590 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
8591
8592 def GetLabelTop(*args, **kwargs):
8593 """GetLabelTop(self, size_t pos) -> String"""
8594 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
8595
8596 def FindMenuItem(*args, **kwargs):
8597 """FindMenuItem(self, String menu, String item) -> int"""
8598 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
8599
8600 def FindItemById(*args, **kwargs):
8601 """FindItemById(self, int id) -> MenuItem"""
8602 return _core_.MenuBar_FindItemById(*args, **kwargs)
8603
8604 def FindMenu(*args, **kwargs):
8605 """FindMenu(self, String title) -> int"""
8606 return _core_.MenuBar_FindMenu(*args, **kwargs)
8607
8608 def Enable(*args, **kwargs):
8609 """Enable(self, int id, bool enable)"""
8610 return _core_.MenuBar_Enable(*args, **kwargs)
8611
8612 def Check(*args, **kwargs):
8613 """Check(self, int id, bool check)"""
8614 return _core_.MenuBar_Check(*args, **kwargs)
8615
8616 def IsChecked(*args, **kwargs):
8617 """IsChecked(self, int id) -> bool"""
8618 return _core_.MenuBar_IsChecked(*args, **kwargs)
8619
8620 def IsEnabled(*args, **kwargs):
8621 """IsEnabled(self, int id) -> bool"""
8622 return _core_.MenuBar_IsEnabled(*args, **kwargs)
8623
8624 def SetLabel(*args, **kwargs):
8625 """SetLabel(self, int id, String label)"""
8626 return _core_.MenuBar_SetLabel(*args, **kwargs)
8627
8628 def GetLabel(*args, **kwargs):
8629 """GetLabel(self, int id) -> String"""
8630 return _core_.MenuBar_GetLabel(*args, **kwargs)
8631
8632 def SetHelpString(*args, **kwargs):
8633 """SetHelpString(self, int id, String helpString)"""
8634 return _core_.MenuBar_SetHelpString(*args, **kwargs)
8635
8636 def GetHelpString(*args, **kwargs):
8637 """GetHelpString(self, int id) -> String"""
8638 return _core_.MenuBar_GetHelpString(*args, **kwargs)
8639
8640 def GetFrame(*args, **kwargs):
8641 """GetFrame(self) -> wxFrame"""
8642 return _core_.MenuBar_GetFrame(*args, **kwargs)
8643
8644 def IsAttached(*args, **kwargs):
8645 """IsAttached(self) -> bool"""
8646 return _core_.MenuBar_IsAttached(*args, **kwargs)
8647
8648 def Attach(*args, **kwargs):
8649 """Attach(self, wxFrame frame)"""
8650 return _core_.MenuBar_Attach(*args, **kwargs)
8651
8652 def Detach(*args, **kwargs):
8653 """Detach(self)"""
8654 return _core_.MenuBar_Detach(*args, **kwargs)
8655
8656
8657 class MenuBarPtr(MenuBar):
8658 def __init__(self, this):
8659 self.this = this
8660 if not hasattr(self,"thisown"): self.thisown = 0
8661 self.__class__ = MenuBar
8662 _core_.MenuBar_swigregister(MenuBarPtr)
8663
8664 #---------------------------------------------------------------------------
8665
8666 class MenuItem(Object):
8667 """Proxy of C++ MenuItem class"""
8668 def __repr__(self):
8669 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8670 def __init__(self, *args, **kwargs):
8671 """
8672 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
8673 String help=EmptyString, int kind=ITEM_NORMAL,
8674 Menu subMenu=None) -> MenuItem
8675 """
8676 newobj = _core_.new_MenuItem(*args, **kwargs)
8677 self.this = newobj.this
8678 self.thisown = 1
8679 del newobj.thisown
8680 def GetMenu(*args, **kwargs):
8681 """GetMenu(self) -> Menu"""
8682 return _core_.MenuItem_GetMenu(*args, **kwargs)
8683
8684 def SetMenu(*args, **kwargs):
8685 """SetMenu(self, Menu menu)"""
8686 return _core_.MenuItem_SetMenu(*args, **kwargs)
8687
8688 def SetId(*args, **kwargs):
8689 """SetId(self, int id)"""
8690 return _core_.MenuItem_SetId(*args, **kwargs)
8691
8692 def GetId(*args, **kwargs):
8693 """GetId(self) -> int"""
8694 return _core_.MenuItem_GetId(*args, **kwargs)
8695
8696 def IsSeparator(*args, **kwargs):
8697 """IsSeparator(self) -> bool"""
8698 return _core_.MenuItem_IsSeparator(*args, **kwargs)
8699
8700 def SetText(*args, **kwargs):
8701 """SetText(self, String str)"""
8702 return _core_.MenuItem_SetText(*args, **kwargs)
8703
8704 def GetLabel(*args, **kwargs):
8705 """GetLabel(self) -> String"""
8706 return _core_.MenuItem_GetLabel(*args, **kwargs)
8707
8708 def GetText(*args, **kwargs):
8709 """GetText(self) -> String"""
8710 return _core_.MenuItem_GetText(*args, **kwargs)
8711
8712 def GetLabelFromText(*args, **kwargs):
8713 """GetLabelFromText(String text) -> String"""
8714 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8715
8716 GetLabelFromText = staticmethod(GetLabelFromText)
8717 def GetKind(*args, **kwargs):
8718 """GetKind(self) -> int"""
8719 return _core_.MenuItem_GetKind(*args, **kwargs)
8720
8721 def SetKind(*args, **kwargs):
8722 """SetKind(self, int kind)"""
8723 return _core_.MenuItem_SetKind(*args, **kwargs)
8724
8725 def SetCheckable(*args, **kwargs):
8726 """SetCheckable(self, bool checkable)"""
8727 return _core_.MenuItem_SetCheckable(*args, **kwargs)
8728
8729 def IsCheckable(*args, **kwargs):
8730 """IsCheckable(self) -> bool"""
8731 return _core_.MenuItem_IsCheckable(*args, **kwargs)
8732
8733 def IsSubMenu(*args, **kwargs):
8734 """IsSubMenu(self) -> bool"""
8735 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
8736
8737 def SetSubMenu(*args, **kwargs):
8738 """SetSubMenu(self, Menu menu)"""
8739 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
8740
8741 def GetSubMenu(*args, **kwargs):
8742 """GetSubMenu(self) -> Menu"""
8743 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
8744
8745 def Enable(*args, **kwargs):
8746 """Enable(self, bool enable=True)"""
8747 return _core_.MenuItem_Enable(*args, **kwargs)
8748
8749 def IsEnabled(*args, **kwargs):
8750 """IsEnabled(self) -> bool"""
8751 return _core_.MenuItem_IsEnabled(*args, **kwargs)
8752
8753 def Check(*args, **kwargs):
8754 """Check(self, bool check=True)"""
8755 return _core_.MenuItem_Check(*args, **kwargs)
8756
8757 def IsChecked(*args, **kwargs):
8758 """IsChecked(self) -> bool"""
8759 return _core_.MenuItem_IsChecked(*args, **kwargs)
8760
8761 def Toggle(*args, **kwargs):
8762 """Toggle(self)"""
8763 return _core_.MenuItem_Toggle(*args, **kwargs)
8764
8765 def SetHelp(*args, **kwargs):
8766 """SetHelp(self, String str)"""
8767 return _core_.MenuItem_SetHelp(*args, **kwargs)
8768
8769 def GetHelp(*args, **kwargs):
8770 """GetHelp(self) -> String"""
8771 return _core_.MenuItem_GetHelp(*args, **kwargs)
8772
8773 def GetAccel(*args, **kwargs):
8774 """GetAccel(self) -> AcceleratorEntry"""
8775 return _core_.MenuItem_GetAccel(*args, **kwargs)
8776
8777 def SetAccel(*args, **kwargs):
8778 """SetAccel(self, AcceleratorEntry accel)"""
8779 return _core_.MenuItem_SetAccel(*args, **kwargs)
8780
8781 def SetFont(*args, **kwargs):
8782 """SetFont(self, Font font)"""
8783 return _core_.MenuItem_SetFont(*args, **kwargs)
8784
8785 def GetFont(*args, **kwargs):
8786 """GetFont(self) -> Font"""
8787 return _core_.MenuItem_GetFont(*args, **kwargs)
8788
8789 def SetTextColour(*args, **kwargs):
8790 """SetTextColour(self, Colour colText)"""
8791 return _core_.MenuItem_SetTextColour(*args, **kwargs)
8792
8793 def GetTextColour(*args, **kwargs):
8794 """GetTextColour(self) -> Colour"""
8795 return _core_.MenuItem_GetTextColour(*args, **kwargs)
8796
8797 def SetBackgroundColour(*args, **kwargs):
8798 """SetBackgroundColour(self, Colour colBack)"""
8799 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
8800
8801 def GetBackgroundColour(*args, **kwargs):
8802 """GetBackgroundColour(self) -> Colour"""
8803 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
8804
8805 def SetBitmaps(*args, **kwargs):
8806 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
8807 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
8808
8809 def SetDisabledBitmap(*args, **kwargs):
8810 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
8811 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
8812
8813 def GetDisabledBitmap(*args, **kwargs):
8814 """GetDisabledBitmap(self) -> Bitmap"""
8815 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
8816
8817 def SetMarginWidth(*args, **kwargs):
8818 """SetMarginWidth(self, int nWidth)"""
8819 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
8820
8821 def GetMarginWidth(*args, **kwargs):
8822 """GetMarginWidth(self) -> int"""
8823 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
8824
8825 def GetDefaultMarginWidth(*args, **kwargs):
8826 """GetDefaultMarginWidth() -> int"""
8827 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8828
8829 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8830 def IsOwnerDrawn(*args, **kwargs):
8831 """IsOwnerDrawn(self) -> bool"""
8832 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
8833
8834 def SetOwnerDrawn(*args, **kwargs):
8835 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
8836 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
8837
8838 def ResetOwnerDrawn(*args, **kwargs):
8839 """ResetOwnerDrawn(self)"""
8840 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
8841
8842 def SetBitmap(*args, **kwargs):
8843 """SetBitmap(self, Bitmap bitmap)"""
8844 return _core_.MenuItem_SetBitmap(*args, **kwargs)
8845
8846 def GetBitmap(*args, **kwargs):
8847 """GetBitmap(self) -> Bitmap"""
8848 return _core_.MenuItem_GetBitmap(*args, **kwargs)
8849
8850
8851 class MenuItemPtr(MenuItem):
8852 def __init__(self, this):
8853 self.this = this
8854 if not hasattr(self,"thisown"): self.thisown = 0
8855 self.__class__ = MenuItem
8856 _core_.MenuItem_swigregister(MenuItemPtr)
8857
8858 def MenuItem_GetLabelFromText(*args, **kwargs):
8859 """MenuItem_GetLabelFromText(String text) -> String"""
8860 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8861
8862 def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8863 """MenuItem_GetDefaultMarginWidth() -> int"""
8864 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8865
8866 #---------------------------------------------------------------------------
8867
8868 class Control(Window):
8869 """
8870 This is the base class for a control or 'widget'.
8871
8872 A control is generally a small window which processes user input
8873 and/or displays one or more item of data.
8874 """
8875 def __repr__(self):
8876 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8877 def __init__(self, *args, **kwargs):
8878 """
8879 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8880 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8881 String name=ControlNameStr) -> Control
8882
8883 Create a Control. Normally you should only call this from a subclass'
8884 __init__ as a plain old wx.Control is not very useful.
8885 """
8886 newobj = _core_.new_Control(*args, **kwargs)
8887 self.this = newobj.this
8888 self.thisown = 1
8889 del newobj.thisown
8890 self._setOORInfo(self)
8891
8892 def Create(*args, **kwargs):
8893 """
8894 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8895 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8896 String name=ControlNameStr) -> bool
8897
8898 Do the 2nd phase and create the GUI control.
8899 """
8900 return _core_.Control_Create(*args, **kwargs)
8901
8902 def Command(*args, **kwargs):
8903 """
8904 Command(self, CommandEvent event)
8905
8906 Simulates the effect of the user issuing a command to the item.
8907
8908 :see: `wx.CommandEvent`
8909
8910 """
8911 return _core_.Control_Command(*args, **kwargs)
8912
8913 def GetLabel(*args, **kwargs):
8914 """
8915 GetLabel(self) -> String
8916
8917 Return a control's text.
8918 """
8919 return _core_.Control_GetLabel(*args, **kwargs)
8920
8921 def SetLabel(*args, **kwargs):
8922 """
8923 SetLabel(self, String label)
8924
8925 Sets the item's text.
8926 """
8927 return _core_.Control_SetLabel(*args, **kwargs)
8928
8929 def GetClassDefaultAttributes(*args, **kwargs):
8930 """
8931 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8932
8933 Get the default attributes for this class. This is useful if you want
8934 to use the same font or colour in your own control as in a standard
8935 control -- which is a much better idea than hard coding specific
8936 colours or fonts which might look completely out of place on the
8937 user's system, especially if it uses themes.
8938
8939 The variant parameter is only relevant under Mac currently and is
8940 ignore under other platforms. Under Mac, it will change the size of
8941 the returned font. See `wx.Window.SetWindowVariant` for more about
8942 this.
8943 """
8944 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8945
8946 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8947
8948 class ControlPtr(Control):
8949 def __init__(self, this):
8950 self.this = this
8951 if not hasattr(self,"thisown"): self.thisown = 0
8952 self.__class__ = Control
8953 _core_.Control_swigregister(ControlPtr)
8954 ControlNameStr = cvar.ControlNameStr
8955
8956 def PreControl(*args, **kwargs):
8957 """
8958 PreControl() -> Control
8959
8960 Precreate a Control control for 2-phase creation
8961 """
8962 val = _core_.new_PreControl(*args, **kwargs)
8963 val.thisown = 1
8964 return val
8965
8966 def Control_GetClassDefaultAttributes(*args, **kwargs):
8967 """
8968 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8969
8970 Get the default attributes for this class. This is useful if you want
8971 to use the same font or colour in your own control as in a standard
8972 control -- which is a much better idea than hard coding specific
8973 colours or fonts which might look completely out of place on the
8974 user's system, especially if it uses themes.
8975
8976 The variant parameter is only relevant under Mac currently and is
8977 ignore under other platforms. Under Mac, it will change the size of
8978 the returned font. See `wx.Window.SetWindowVariant` for more about
8979 this.
8980 """
8981 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8982
8983 #---------------------------------------------------------------------------
8984
8985 class ItemContainer(object):
8986 """
8987 The wx.ItemContainer class defines an interface which is implemented
8988 by all controls which have string subitems, each of which may be
8989 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
8990 as `wx.ComboBox` which implements an extended interface deriving from
8991 this one.
8992
8993 It defines the methods for accessing the control's items and although
8994 each of the derived classes implements them differently, they still
8995 all conform to the same interface.
8996
8997 The items in a wx.ItemContainer have (non empty) string labels and,
8998 optionally, client data associated with them.
8999
9000 """
9001 def __init__(self): raise RuntimeError, "No constructor defined"
9002 def __repr__(self):
9003 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9004 def Append(*args, **kwargs):
9005 """
9006 Append(self, String item, PyObject clientData=None) -> int
9007
9008 Adds the item to the control, associating the given data with the item
9009 if not None. The return value is the index of the newly added item
9010 which may be different from the last one if the control is sorted (e.g.
9011 has wx.LB_SORT or wx.CB_SORT style).
9012 """
9013 return _core_.ItemContainer_Append(*args, **kwargs)
9014
9015 def AppendItems(*args, **kwargs):
9016 """
9017 AppendItems(self, List strings)
9018
9019 Apend several items at once to the control. Notice that calling this
9020 method may be much faster than appending the items one by one if you
9021 need to add a lot of items.
9022 """
9023 return _core_.ItemContainer_AppendItems(*args, **kwargs)
9024
9025 def Insert(*args, **kwargs):
9026 """
9027 Insert(self, String item, int pos, PyObject clientData=None) -> int
9028
9029 Insert an item into the control before the item at the ``pos`` index,
9030 optionally associating some data object with the item.
9031 """
9032 return _core_.ItemContainer_Insert(*args, **kwargs)
9033
9034 def Clear(*args, **kwargs):
9035 """
9036 Clear(self)
9037
9038 Removes all items from the control.
9039 """
9040 return _core_.ItemContainer_Clear(*args, **kwargs)
9041
9042 def Delete(*args, **kwargs):
9043 """
9044 Delete(self, int n)
9045
9046 Deletes the item at the zero-based index 'n' from the control. Note
9047 that it is an error (signalled by a `wx.PyAssertionError` exception if
9048 enabled) to remove an item with the index negative or greater or equal
9049 than the number of items in the control.
9050 """
9051 return _core_.ItemContainer_Delete(*args, **kwargs)
9052
9053 def GetClientData(*args, **kwargs):
9054 """
9055 GetClientData(self, int n) -> PyObject
9056
9057 Returns the client data associated with the given item, (if any.)
9058 """
9059 return _core_.ItemContainer_GetClientData(*args, **kwargs)
9060
9061 def SetClientData(*args, **kwargs):
9062 """
9063 SetClientData(self, int n, PyObject clientData)
9064
9065 Associate the given client data with the item at position n.
9066 """
9067 return _core_.ItemContainer_SetClientData(*args, **kwargs)
9068
9069 def GetCount(*args, **kwargs):
9070 """
9071 GetCount(self) -> int
9072
9073 Returns the number of items in the control.
9074 """
9075 return _core_.ItemContainer_GetCount(*args, **kwargs)
9076
9077 def IsEmpty(*args, **kwargs):
9078 """
9079 IsEmpty(self) -> bool
9080
9081 Returns True if the control is empty or False if it has some items.
9082 """
9083 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
9084
9085 def GetString(*args, **kwargs):
9086 """
9087 GetString(self, int n) -> String
9088
9089 Returns the label of the item with the given index.
9090 """
9091 return _core_.ItemContainer_GetString(*args, **kwargs)
9092
9093 def GetStrings(*args, **kwargs):
9094 """GetStrings(self) -> wxArrayString"""
9095 return _core_.ItemContainer_GetStrings(*args, **kwargs)
9096
9097 def SetString(*args, **kwargs):
9098 """
9099 SetString(self, int n, String s)
9100
9101 Sets the label for the given item.
9102 """
9103 return _core_.ItemContainer_SetString(*args, **kwargs)
9104
9105 def FindString(*args, **kwargs):
9106 """
9107 FindString(self, String s) -> int
9108
9109 Finds an item whose label matches the given string. Returns the
9110 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
9111 found.
9112 """
9113 return _core_.ItemContainer_FindString(*args, **kwargs)
9114
9115 def SetSelection(*args, **kwargs):
9116 """
9117 SetSelection(self, int n)
9118
9119 Sets the item at index 'n' to be the selected item.
9120 """
9121 return _core_.ItemContainer_SetSelection(*args, **kwargs)
9122
9123 def GetSelection(*args, **kwargs):
9124 """
9125 GetSelection(self) -> int
9126
9127 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
9128 is selected.
9129 """
9130 return _core_.ItemContainer_GetSelection(*args, **kwargs)
9131
9132 def SetStringSelection(*args, **kwargs):
9133 """SetStringSelection(self, String s) -> bool"""
9134 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
9135
9136 def GetStringSelection(*args, **kwargs):
9137 """
9138 GetStringSelection(self) -> String
9139
9140 Returns the label of the selected item or an empty string if no item
9141 is selected.
9142 """
9143 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
9144
9145 def Select(*args, **kwargs):
9146 """
9147 Select(self, int n)
9148
9149 This is the same as `SetSelection` and exists only because it is
9150 slightly more natural for controls which support multiple selection.
9151 """
9152 return _core_.ItemContainer_Select(*args, **kwargs)
9153
9154
9155 class ItemContainerPtr(ItemContainer):
9156 def __init__(self, this):
9157 self.this = this
9158 if not hasattr(self,"thisown"): self.thisown = 0
9159 self.__class__ = ItemContainer
9160 _core_.ItemContainer_swigregister(ItemContainerPtr)
9161
9162 #---------------------------------------------------------------------------
9163
9164 class ControlWithItems(Control,ItemContainer):
9165 """
9166 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
9167 wx.Control class, and is used for the base class of various controls
9168 that have items.
9169 """
9170 def __init__(self): raise RuntimeError, "No constructor defined"
9171 def __repr__(self):
9172 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9173
9174 class ControlWithItemsPtr(ControlWithItems):
9175 def __init__(self, this):
9176 self.this = this
9177 if not hasattr(self,"thisown"): self.thisown = 0
9178 self.__class__ = ControlWithItems
9179 _core_.ControlWithItems_swigregister(ControlWithItemsPtr)
9180
9181 #---------------------------------------------------------------------------
9182
9183 class SizerItem(Object):
9184 """
9185 The wx.SizerItem class is used to track the position, size and other
9186 attributes of each item managed by a `wx.Sizer`. In normal usage user
9187 code should never need to deal directly with a wx.SizerItem, but
9188 custom classes derived from `wx.PySizer` will probably need to use the
9189 collection of wx.SizerItems held by wx.Sizer when calculating layout.
9190
9191 :see: `wx.Sizer`, `wx.GBSizerItem`
9192 """
9193 def __repr__(self):
9194 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9195 def __init__(self, *args, **kwargs):
9196 """
9197 __init__(self) -> SizerItem
9198
9199 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
9200 size will need to be set before this item can be used in a Sizer.
9201
9202 You will probably never need to create a wx.SizerItem directly as they
9203 are created automatically when the sizer's Add, Insert or Prepend
9204 methods are called.
9205
9206 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
9207 """
9208 newobj = _core_.new_SizerItem(*args, **kwargs)
9209 self.this = newobj.this
9210 self.thisown = 1
9211 del newobj.thisown
9212 def DeleteWindows(*args, **kwargs):
9213 """
9214 DeleteWindows(self)
9215
9216 Destroy the window or the windows in a subsizer, depending on the type
9217 of item.
9218 """
9219 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
9220
9221 def DetachSizer(*args, **kwargs):
9222 """
9223 DetachSizer(self)
9224
9225 Enable deleting the SizerItem without destroying the contained sizer.
9226 """
9227 return _core_.SizerItem_DetachSizer(*args, **kwargs)
9228
9229 def GetSize(*args, **kwargs):
9230 """
9231 GetSize(self) -> Size
9232
9233 Get the current size of the item, as set in the last Layout.
9234 """
9235 return _core_.SizerItem_GetSize(*args, **kwargs)
9236
9237 def CalcMin(*args, **kwargs):
9238 """
9239 CalcMin(self) -> Size
9240
9241 Calculates the minimum desired size for the item, including any space
9242 needed by borders.
9243 """
9244 return _core_.SizerItem_CalcMin(*args, **kwargs)
9245
9246 def SetDimension(*args, **kwargs):
9247 """
9248 SetDimension(self, Point pos, Size size)
9249
9250 Set the position and size of the space allocated for this item by the
9251 sizer, and adjust the position and size of the item (window or
9252 subsizer) to be within that space taking alignment and borders into
9253 account.
9254 """
9255 return _core_.SizerItem_SetDimension(*args, **kwargs)
9256
9257 def GetMinSize(*args, **kwargs):
9258 """
9259 GetMinSize(self) -> Size
9260
9261 Get the minimum size needed for the item.
9262 """
9263 return _core_.SizerItem_GetMinSize(*args, **kwargs)
9264
9265 def GetMinSizeWithBorder(*args, **kwargs):
9266 """
9267 GetMinSizeWithBorder(self) -> Size
9268
9269 Get the minimum size needed for the item with space for the borders
9270 added, if needed.
9271 """
9272 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
9273
9274 def SetInitSize(*args, **kwargs):
9275 """SetInitSize(self, int x, int y)"""
9276 return _core_.SizerItem_SetInitSize(*args, **kwargs)
9277
9278 def SetRatioWH(*args, **kwargs):
9279 """
9280 SetRatioWH(self, int width, int height)
9281
9282 Set the ratio item attribute.
9283 """
9284 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
9285
9286 def SetRatioSize(*args, **kwargs):
9287 """
9288 SetRatioSize(self, Size size)
9289
9290 Set the ratio item attribute.
9291 """
9292 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
9293
9294 def SetRatio(*args, **kwargs):
9295 """
9296 SetRatio(self, float ratio)
9297
9298 Set the ratio item attribute.
9299 """
9300 return _core_.SizerItem_SetRatio(*args, **kwargs)
9301
9302 def GetRatio(*args, **kwargs):
9303 """
9304 GetRatio(self) -> float
9305
9306 Set the ratio item attribute.
9307 """
9308 return _core_.SizerItem_GetRatio(*args, **kwargs)
9309
9310 def GetRect(*args, **kwargs):
9311 """
9312 GetRect(self) -> Rect
9313
9314 Returns the rectangle that the sizer item should occupy
9315 """
9316 return _core_.SizerItem_GetRect(*args, **kwargs)
9317
9318 def IsWindow(*args, **kwargs):
9319 """
9320 IsWindow(self) -> bool
9321
9322 Is this sizer item a window?
9323 """
9324 return _core_.SizerItem_IsWindow(*args, **kwargs)
9325
9326 def IsSizer(*args, **kwargs):
9327 """
9328 IsSizer(self) -> bool
9329
9330 Is this sizer item a subsizer?
9331 """
9332 return _core_.SizerItem_IsSizer(*args, **kwargs)
9333
9334 def IsSpacer(*args, **kwargs):
9335 """
9336 IsSpacer(self) -> bool
9337
9338 Is this sizer item a spacer?
9339 """
9340 return _core_.SizerItem_IsSpacer(*args, **kwargs)
9341
9342 def SetProportion(*args, **kwargs):
9343 """
9344 SetProportion(self, int proportion)
9345
9346 Set the proportion value for this item.
9347 """
9348 return _core_.SizerItem_SetProportion(*args, **kwargs)
9349
9350 def GetProportion(*args, **kwargs):
9351 """
9352 GetProportion(self) -> int
9353
9354 Get the proportion value for this item.
9355 """
9356 return _core_.SizerItem_GetProportion(*args, **kwargs)
9357
9358 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
9359 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
9360 def SetFlag(*args, **kwargs):
9361 """
9362 SetFlag(self, int flag)
9363
9364 Set the flag value for this item.
9365 """
9366 return _core_.SizerItem_SetFlag(*args, **kwargs)
9367
9368 def GetFlag(*args, **kwargs):
9369 """
9370 GetFlag(self) -> int
9371
9372 Get the flag value for this item.
9373 """
9374 return _core_.SizerItem_GetFlag(*args, **kwargs)
9375
9376 def SetBorder(*args, **kwargs):
9377 """
9378 SetBorder(self, int border)
9379
9380 Set the border value for this item.
9381 """
9382 return _core_.SizerItem_SetBorder(*args, **kwargs)
9383
9384 def GetBorder(*args, **kwargs):
9385 """
9386 GetBorder(self) -> int
9387
9388 Get the border value for this item.
9389 """
9390 return _core_.SizerItem_GetBorder(*args, **kwargs)
9391
9392 def GetWindow(*args, **kwargs):
9393 """
9394 GetWindow(self) -> Window
9395
9396 Get the window (if any) that is managed by this sizer item.
9397 """
9398 return _core_.SizerItem_GetWindow(*args, **kwargs)
9399
9400 def SetWindow(*args, **kwargs):
9401 """
9402 SetWindow(self, Window window)
9403
9404 Set the window to be managed by this sizer item.
9405 """
9406 return _core_.SizerItem_SetWindow(*args, **kwargs)
9407
9408 def GetSizer(*args, **kwargs):
9409 """
9410 GetSizer(self) -> Sizer
9411
9412 Get the subsizer (if any) that is managed by this sizer item.
9413 """
9414 return _core_.SizerItem_GetSizer(*args, **kwargs)
9415
9416 def SetSizer(*args, **kwargs):
9417 """
9418 SetSizer(self, Sizer sizer)
9419
9420 Set the subsizer to be managed by this sizer item.
9421 """
9422 return _core_.SizerItem_SetSizer(*args, **kwargs)
9423
9424 def GetSpacer(*args, **kwargs):
9425 """
9426 GetSpacer(self) -> Size
9427
9428 Get the size of the spacer managed by this sizer item.
9429 """
9430 return _core_.SizerItem_GetSpacer(*args, **kwargs)
9431
9432 def SetSpacer(*args, **kwargs):
9433 """
9434 SetSpacer(self, Size size)
9435
9436 Set the size of the spacer to be managed by this sizer item.
9437 """
9438 return _core_.SizerItem_SetSpacer(*args, **kwargs)
9439
9440 def Show(*args, **kwargs):
9441 """
9442 Show(self, bool show)
9443
9444 Set the show item attribute, which sizers use to determine if the item
9445 is to be made part of the layout or not. If the item is tracking a
9446 window then it is shown or hidden as needed.
9447 """
9448 return _core_.SizerItem_Show(*args, **kwargs)
9449
9450 def IsShown(*args, **kwargs):
9451 """
9452 IsShown(self) -> bool
9453
9454 Is the item to be shown in the layout?
9455 """
9456 return _core_.SizerItem_IsShown(*args, **kwargs)
9457
9458 def GetPosition(*args, **kwargs):
9459 """
9460 GetPosition(self) -> Point
9461
9462 Returns the current position of the item, as set in the last Layout.
9463 """
9464 return _core_.SizerItem_GetPosition(*args, **kwargs)
9465
9466 def GetUserData(*args, **kwargs):
9467 """
9468 GetUserData(self) -> PyObject
9469
9470 Returns the userData associated with this sizer item, or None if there
9471 isn't any.
9472 """
9473 return _core_.SizerItem_GetUserData(*args, **kwargs)
9474
9475
9476 class SizerItemPtr(SizerItem):
9477 def __init__(self, this):
9478 self.this = this
9479 if not hasattr(self,"thisown"): self.thisown = 0
9480 self.__class__ = SizerItem
9481 _core_.SizerItem_swigregister(SizerItemPtr)
9482
9483 def SizerItemWindow(*args, **kwargs):
9484 """
9485 SizerItemWindow(Window window, int proportion, int flag, int border,
9486 PyObject userData=None) -> SizerItem
9487
9488 Constructs a `wx.SizerItem` for tracking a window.
9489 """
9490 val = _core_.new_SizerItemWindow(*args, **kwargs)
9491 val.thisown = 1
9492 return val
9493
9494 def SizerItemSpacer(*args, **kwargs):
9495 """
9496 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
9497 PyObject userData=None) -> SizerItem
9498
9499 Constructs a `wx.SizerItem` for tracking a spacer.
9500 """
9501 val = _core_.new_SizerItemSpacer(*args, **kwargs)
9502 val.thisown = 1
9503 return val
9504
9505 def SizerItemSizer(*args, **kwargs):
9506 """
9507 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
9508 PyObject userData=None) -> SizerItem
9509
9510 Constructs a `wx.SizerItem` for tracking a subsizer
9511 """
9512 val = _core_.new_SizerItemSizer(*args, **kwargs)
9513 val.thisown = 1
9514 return val
9515
9516 class Sizer(Object):
9517 """
9518 wx.Sizer is the abstract base class used for laying out subwindows in
9519 a window. You cannot use wx.Sizer directly; instead, you will have to
9520 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9521 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9522 and `wx.GridBagSizer`.
9523
9524 The concept implemented by sizers in wxWidgets is closely related to
9525 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9526 toolkit or the Qt toolkit. It is based upon the idea of the individual
9527 subwindows reporting their minimal required size and their ability to
9528 get stretched if the size of the parent window has changed. This will
9529 most often mean that the programmer does not set the original size of
9530 a dialog in the beginning, rather the dialog will assigned a sizer and
9531 this sizer will be queried about the recommended size. The sizer in
9532 turn will query its children, which can be normal windows or contorls,
9533 empty space or other sizers, so that a hierarchy of sizers can be
9534 constructed. Note that wxSizer does not derive from wxWindow and thus
9535 do not interfere with tab ordering and requires very little resources
9536 compared to a real window on screen.
9537
9538 What makes sizers so well fitted for use in wxWidgets is the fact that
9539 every control reports its own minimal size and the algorithm can
9540 handle differences in font sizes or different window (dialog item)
9541 sizes on different platforms without problems. If for example the
9542 standard font as well as the overall design of Mac widgets requires
9543 more space than on Windows, then the initial size of a dialog using a
9544 sizer will automatically be bigger on Mac than on Windows.
9545 """
9546 def __init__(self): raise RuntimeError, "No constructor defined"
9547 def __repr__(self):
9548 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9549 def _setOORInfo(*args, **kwargs):
9550 """_setOORInfo(self, PyObject _self)"""
9551 return _core_.Sizer__setOORInfo(*args, **kwargs)
9552
9553 def Add(*args, **kwargs):
9554 """
9555 Add(self, item, int proportion=0, int flag=0, int border=0,
9556 PyObject userData=None) -> wx.SizerItem
9557
9558 Appends a child item to the sizer.
9559 """
9560 return _core_.Sizer_Add(*args, **kwargs)
9561
9562 def Insert(*args, **kwargs):
9563 """
9564 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
9565 PyObject userData=None) -> wx.SizerItem
9566
9567 Inserts a new item into the list of items managed by this sizer before
9568 the item at index *before*. See `Add` for a description of the parameters.
9569 """
9570 return _core_.Sizer_Insert(*args, **kwargs)
9571
9572 def Prepend(*args, **kwargs):
9573 """
9574 Prepend(self, item, int proportion=0, int flag=0, int border=0,
9575 PyObject userData=None) -> wx.SizerItem
9576
9577 Adds a new item to the begining of the list of sizer items managed by
9578 this sizer. See `Add` for a description of the parameters.
9579 """
9580 return _core_.Sizer_Prepend(*args, **kwargs)
9581
9582 def Remove(*args, **kwargs):
9583 """
9584 Remove(self, item) -> bool
9585
9586 Removes an item from the sizer and destroys it. This method does not
9587 cause any layout or resizing to take place, call `Layout` to update
9588 the layout on screen after removing a child from the sizer. The
9589 *item* parameter can be either a window, a sizer, or the zero-based
9590 index of an item to remove. Returns True if the child item was found
9591 and removed.
9592 """
9593 return _core_.Sizer_Remove(*args, **kwargs)
9594
9595 def Detach(*args, **kwargs):
9596 """
9597 Detach(self, item) -> bool
9598
9599 Detaches an item from the sizer without destroying it. This method
9600 does not cause any layout or resizing to take place, call `Layout` to
9601 do so. The *item* parameter can be either a window, a sizer, or the
9602 zero-based index of the item to be detached. Returns True if the child item
9603 was found and detached.
9604 """
9605 return _core_.Sizer_Detach(*args, **kwargs)
9606
9607 def GetItem(*args, **kwargs):
9608 """
9609 GetItem(self, item) -> wx.SizerItem
9610
9611 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9612 parameter can be either a window, a sizer, or the zero-based index of
9613 the item to be detached.
9614 """
9615 return _core_.Sizer_GetItem(*args, **kwargs)
9616
9617 def _SetItemMinSize(*args, **kwargs):
9618 """_SetItemMinSize(self, PyObject item, Size size)"""
9619 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
9620
9621 def SetItemMinSize(self, item, *args):
9622 """
9623 SetItemMinSize(self, item, Size size)
9624
9625 Sets the minimum size that will be allocated for an item in the sizer.
9626 The *item* parameter can be either a window, a sizer, or the
9627 zero-based index of the item. If a window or sizer is given then it
9628 will be searched for recursivly in subsizers if neccessary.
9629 """
9630 if len(args) == 2:
9631 # for backward compatibility accept separate width,height args too
9632 return self._SetItemMinSize(item, args)
9633 else:
9634 return self._SetItemMinSize(item, args[0])
9635
9636 def AddItem(*args, **kwargs):
9637 """
9638 AddItem(self, SizerItem item)
9639
9640 Adds a `wx.SizerItem` to the sizer.
9641 """
9642 return _core_.Sizer_AddItem(*args, **kwargs)
9643
9644 def InsertItem(*args, **kwargs):
9645 """
9646 InsertItem(self, int index, SizerItem item)
9647
9648 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9649 """
9650 return _core_.Sizer_InsertItem(*args, **kwargs)
9651
9652 def PrependItem(*args, **kwargs):
9653 """
9654 PrependItem(self, SizerItem item)
9655
9656 Prepends a `wx.SizerItem` to the sizer.
9657 """
9658 return _core_.Sizer_PrependItem(*args, **kwargs)
9659
9660 def AddMany(self, items):
9661 """
9662 AddMany is a convenience method for adding several items
9663 to a sizer at one time. Simply pass it a list of tuples,
9664 where each tuple consists of the parameters that you
9665 would normally pass to the `Add` method.
9666 """
9667 for item in items:
9668 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9669 item = (item, )
9670 self.Add(*item)
9671
9672 # for backwards compatibility only, please do not use in new code
9673 def AddWindow(self, *args, **kw):
9674 """Compatibility alias for `Add`."""
9675 return self.Add(*args, **kw)
9676 def AddSizer(self, *args, **kw):
9677 """Compatibility alias for `Add`."""
9678 return self.Add(*args, **kw)
9679 def AddSpacer(self, *args, **kw):
9680 """Compatibility alias for `Add`."""
9681 return self.Add(*args, **kw)
9682
9683 def PrependWindow(self, *args, **kw):
9684 """Compatibility alias for `Prepend`."""
9685 return self.Prepend(*args, **kw)
9686 def PrependSizer(self, *args, **kw):
9687 """Compatibility alias for `Prepend`."""
9688 return self.Prepend(*args, **kw)
9689 def PrependSpacer(self, *args, **kw):
9690 """Compatibility alias for `Prepend`."""
9691 return self.Prepend(*args, **kw)
9692
9693 def InsertWindow(self, *args, **kw):
9694 """Compatibility alias for `Insert`."""
9695 return self.Insert(*args, **kw)
9696 def InsertSizer(self, *args, **kw):
9697 """Compatibility alias for `Insert`."""
9698 return self.Insert(*args, **kw)
9699 def InsertSpacer(self, *args, **kw):
9700 """Compatibility alias for `Insert`."""
9701 return self.Insert(*args, **kw)
9702
9703 def RemoveWindow(self, *args, **kw):
9704 """Compatibility alias for `Remove`."""
9705 return self.Remove(*args, **kw)
9706 def RemoveSizer(self, *args, **kw):
9707 """Compatibility alias for `Remove`."""
9708 return self.Remove(*args, **kw)
9709 def RemovePos(self, *args, **kw):
9710 """Compatibility alias for `Remove`."""
9711 return self.Remove(*args, **kw)
9712
9713
9714 def SetDimension(*args, **kwargs):
9715 """
9716 SetDimension(self, int x, int y, int width, int height)
9717
9718 Call this to force the sizer to take the given dimension and thus
9719 force the items owned by the sizer to resize themselves according to
9720 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9721 methods.
9722 """
9723 return _core_.Sizer_SetDimension(*args, **kwargs)
9724
9725 def SetMinSize(*args, **kwargs):
9726 """
9727 SetMinSize(self, Size size)
9728
9729 Call this to give the sizer a minimal size. Normally, the sizer will
9730 calculate its minimal size based purely on how much space its children
9731 need. After calling this method `GetMinSize` will return either the
9732 minimal size as requested by its children or the minimal size set
9733 here, depending on which is bigger.
9734 """
9735 return _core_.Sizer_SetMinSize(*args, **kwargs)
9736
9737 def GetSize(*args, **kwargs):
9738 """
9739 GetSize(self) -> Size
9740
9741 Returns the current size of the space managed by the sizer.
9742 """
9743 return _core_.Sizer_GetSize(*args, **kwargs)
9744
9745 def GetPosition(*args, **kwargs):
9746 """
9747 GetPosition(self) -> Point
9748
9749 Returns the current position of the sizer's managed space.
9750 """
9751 return _core_.Sizer_GetPosition(*args, **kwargs)
9752
9753 def GetMinSize(*args, **kwargs):
9754 """
9755 GetMinSize(self) -> Size
9756
9757 Returns the minimal size of the sizer. This is either the combined
9758 minimal size of all the children and their borders or the minimal size
9759 set by SetMinSize, depending on which is bigger.
9760 """
9761 return _core_.Sizer_GetMinSize(*args, **kwargs)
9762
9763 def GetSizeTuple(self):
9764 return self.GetSize().Get()
9765 def GetPositionTuple(self):
9766 return self.GetPosition().Get()
9767 def GetMinSizeTuple(self):
9768 return self.GetMinSize().Get()
9769
9770 def RecalcSizes(*args, **kwargs):
9771 """
9772 RecalcSizes(self)
9773
9774 Using the sizes calculated by `CalcMin` reposition and resize all the
9775 items managed by this sizer. You should not need to call this directly as
9776 it is called by `Layout`.
9777 """
9778 return _core_.Sizer_RecalcSizes(*args, **kwargs)
9779
9780 def CalcMin(*args, **kwargs):
9781 """
9782 CalcMin(self) -> Size
9783
9784 This method is where the sizer will do the actual calculation of its
9785 children's minimal sizes. You should not need to call this directly as
9786 it is called by `Layout`.
9787 """
9788 return _core_.Sizer_CalcMin(*args, **kwargs)
9789
9790 def Layout(*args, **kwargs):
9791 """
9792 Layout(self)
9793
9794 This method will force the recalculation and layout of the items
9795 controlled by the sizer using the current space allocated to the
9796 sizer. Normally this is called automatically from the owning window's
9797 EVT_SIZE handler, but it is also useful to call it from user code when
9798 one of the items in a sizer change size, or items are added or
9799 removed.
9800 """
9801 return _core_.Sizer_Layout(*args, **kwargs)
9802
9803 def Fit(*args, **kwargs):
9804 """
9805 Fit(self, Window window) -> Size
9806
9807 Tell the sizer to resize the *window* to match the sizer's minimal
9808 size. This is commonly done in the constructor of the window itself in
9809 order to set its initial size to match the needs of the children as
9810 determined by the sizer. Returns the new size.
9811
9812 For a top level window this is the total window size, not the client size.
9813 """
9814 return _core_.Sizer_Fit(*args, **kwargs)
9815
9816 def FitInside(*args, **kwargs):
9817 """
9818 FitInside(self, Window window)
9819
9820 Tell the sizer to resize the *virtual size* of the *window* to match the
9821 sizer's minimal size. This will not alter the on screen size of the
9822 window, but may cause the addition/removal/alteration of scrollbars
9823 required to view the virtual area in windows which manage it.
9824
9825 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9826
9827 """
9828 return _core_.Sizer_FitInside(*args, **kwargs)
9829
9830 def SetSizeHints(*args, **kwargs):
9831 """
9832 SetSizeHints(self, Window window)
9833
9834 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9835 match the sizer's minimal size. This is commonly done in the
9836 constructor of the window itself if the window is resizable (as are
9837 many dialogs under Unix and frames on probably all platforms) in order
9838 to prevent the window from being sized smaller than the minimal size
9839 required by the sizer.
9840 """
9841 return _core_.Sizer_SetSizeHints(*args, **kwargs)
9842
9843 def SetVirtualSizeHints(*args, **kwargs):
9844 """
9845 SetVirtualSizeHints(self, Window window)
9846
9847 Tell the sizer to set the minimal size of the window virtual area to
9848 match the sizer's minimal size. For windows with managed scrollbars
9849 this will set them appropriately.
9850
9851 :see: `wx.ScrolledWindow.SetScrollbars`
9852
9853 """
9854 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
9855
9856 def Clear(*args, **kwargs):
9857 """
9858 Clear(self, bool deleteWindows=False)
9859
9860 Clear all items from the sizer, optionally destroying the window items
9861 as well.
9862 """
9863 return _core_.Sizer_Clear(*args, **kwargs)
9864
9865 def DeleteWindows(*args, **kwargs):
9866 """
9867 DeleteWindows(self)
9868
9869 Destroy all windows managed by the sizer.
9870 """
9871 return _core_.Sizer_DeleteWindows(*args, **kwargs)
9872
9873 def GetChildren(*args, **kwargs):
9874 """
9875 GetChildren(self) -> list
9876
9877 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9878 """
9879 return _core_.Sizer_GetChildren(*args, **kwargs)
9880
9881 def Show(*args, **kwargs):
9882 """
9883 Show(self, item, bool show=True, bool recursive=false) -> bool
9884
9885 Shows or hides an item managed by the sizer. To make a sizer item
9886 disappear or reappear, use Show followed by `Layout`. The *item*
9887 parameter can be either a window, a sizer, or the zero-based index of
9888 the item. Use the recursive parameter to show or hide an item in a
9889 subsizer. Returns True if the item was found.
9890 """
9891 return _core_.Sizer_Show(*args, **kwargs)
9892
9893 def IsShown(*args, **kwargs):
9894 """
9895 IsShown(self, item)
9896
9897 Determines if the item is currently shown. sizer. To make a sizer
9898 item disappear or reappear, use Show followed by `Layout`. The *item*
9899 parameter can be either a window, a sizer, or the zero-based index of
9900 the item.
9901 """
9902 return _core_.Sizer_IsShown(*args, **kwargs)
9903
9904 def Hide(self, item, recursive=False):
9905 """
9906 A convenience method for `Show`(item, False, recursive).
9907 """
9908 return self.Show(item, False, recursive)
9909
9910 def ShowItems(*args, **kwargs):
9911 """
9912 ShowItems(self, bool show)
9913
9914 Recursively call `wx.SizerItem.Show` on all sizer items.
9915 """
9916 return _core_.Sizer_ShowItems(*args, **kwargs)
9917
9918
9919 class SizerPtr(Sizer):
9920 def __init__(self, this):
9921 self.this = this
9922 if not hasattr(self,"thisown"): self.thisown = 0
9923 self.__class__ = Sizer
9924 _core_.Sizer_swigregister(SizerPtr)
9925
9926 class PySizer(Sizer):
9927 """
9928 wx.PySizer is a special version of `wx.Sizer` that has been
9929 instrumented to allow the C++ virtual methods to be overloaded in
9930 Python derived classes. You would derive from this class if you are
9931 wanting to implement a custom sizer in Python code. Simply implement
9932 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9933 For example::
9934
9935 class MySizer(wx.PySizer):
9936 def __init__(self):
9937 wx.PySizer.__init__(self)
9938
9939 def CalcMin(self):
9940 for item in self.GetChildren():
9941 # calculate the total minimum width and height needed
9942 # by all items in the sizer according to this sizer's
9943 # layout algorithm.
9944 ...
9945 return wx.Size(width, height)
9946
9947 def RecalcSizes(self):
9948 # find the space allotted to this sizer
9949 pos = self.GetPosition()
9950 size = self.GetSize()
9951 for item in self.GetChildren():
9952 # Recalculate (if necessary) the position and size of
9953 # each item and then call item.SetDimension to do the
9954 # actual positioning and sizing of the items within the
9955 # space alloted to this sizer.
9956 ...
9957 item.SetDimension(itemPos, itemSize)
9958
9959
9960 When `Layout` is called it first calls `CalcMin` followed by
9961 `RecalcSizes` so you can optimize a bit by saving the results of
9962 `CalcMin` and reusing them in `RecalcSizes`.
9963
9964 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9965
9966
9967 """
9968 def __repr__(self):
9969 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9970 def __init__(self, *args, **kwargs):
9971 """
9972 __init__(self) -> PySizer
9973
9974 Creates a wx.PySizer. Must be called from the __init__ in the derived
9975 class.
9976 """
9977 newobj = _core_.new_PySizer(*args, **kwargs)
9978 self.this = newobj.this
9979 self.thisown = 1
9980 del newobj.thisown
9981 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
9982
9983 def _setCallbackInfo(*args, **kwargs):
9984 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
9985 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
9986
9987
9988 class PySizerPtr(PySizer):
9989 def __init__(self, this):
9990 self.this = this
9991 if not hasattr(self,"thisown"): self.thisown = 0
9992 self.__class__ = PySizer
9993 _core_.PySizer_swigregister(PySizerPtr)
9994
9995 #---------------------------------------------------------------------------
9996
9997 class BoxSizer(Sizer):
9998 """
9999 The basic idea behind a box sizer is that windows will most often be
10000 laid out in rather simple basic geometry, typically in a row or a
10001 column or nested hierarchies of either. A wx.BoxSizer will lay out
10002 its items in a simple row or column, depending on the orientation
10003 parameter passed to the constructor.
10004 """
10005 def __repr__(self):
10006 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10007 def __init__(self, *args, **kwargs):
10008 """
10009 __init__(self, int orient=HORIZONTAL) -> BoxSizer
10010
10011 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
10012 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
10013 sizer.
10014 """
10015 newobj = _core_.new_BoxSizer(*args, **kwargs)
10016 self.this = newobj.this
10017 self.thisown = 1
10018 del newobj.thisown
10019 self._setOORInfo(self)
10020
10021 def GetOrientation(*args, **kwargs):
10022 """
10023 GetOrientation(self) -> int
10024
10025 Returns the current orientation of the sizer.
10026 """
10027 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
10028
10029 def SetOrientation(*args, **kwargs):
10030 """
10031 SetOrientation(self, int orient)
10032
10033 Resets the orientation of the sizer.
10034 """
10035 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
10036
10037
10038 class BoxSizerPtr(BoxSizer):
10039 def __init__(self, this):
10040 self.this = this
10041 if not hasattr(self,"thisown"): self.thisown = 0
10042 self.__class__ = BoxSizer
10043 _core_.BoxSizer_swigregister(BoxSizerPtr)
10044
10045 #---------------------------------------------------------------------------
10046
10047 class StaticBoxSizer(BoxSizer):
10048 """
10049 wx.StaticBoxSizer derives from and functions identically to the
10050 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
10051 manages. Note that this static box must be created separately and
10052 passed to the sizer constructor.
10053 """
10054 def __repr__(self):
10055 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10056 def __init__(self, *args, **kwargs):
10057 """
10058 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
10059
10060 Constructor. It takes an associated static box and the orientation
10061 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
10062 ``wx.HORIZONTAL``.
10063 """
10064 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
10065 self.this = newobj.this
10066 self.thisown = 1
10067 del newobj.thisown
10068 self._setOORInfo(self)
10069
10070 def GetStaticBox(*args, **kwargs):
10071 """
10072 GetStaticBox(self) -> StaticBox
10073
10074 Returns the static box associated with this sizer.
10075 """
10076 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
10077
10078
10079 class StaticBoxSizerPtr(StaticBoxSizer):
10080 def __init__(self, this):
10081 self.this = this
10082 if not hasattr(self,"thisown"): self.thisown = 0
10083 self.__class__ = StaticBoxSizer
10084 _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
10085
10086 #---------------------------------------------------------------------------
10087
10088 class GridSizer(Sizer):
10089 """
10090 A grid sizer is a sizer which lays out its children in a
10091 two-dimensional table with all cells having the same size. In other
10092 words, the width of each cell within the grid is the width of the
10093 widest item added to the sizer and the height of each grid cell is the
10094 height of the tallest item. An optional vertical and/or horizontal
10095 gap between items can also be specified (in pixels.)
10096
10097 Items are placed in the cells of the grid in the order they are added,
10098 in row-major order. In other words, the first row is filled first,
10099 then the second, and so on until all items have been added. (If
10100 neccessary, additional rows will be added as items are added.) If you
10101 need to have greater control over the cells that items are placed in
10102 then use the `wx.GridBagSizer`.
10103
10104 """
10105 def __repr__(self):
10106 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10107 def __init__(self, *args, **kwargs):
10108 """
10109 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
10110
10111 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
10112 of columns and rows in the sizer - if either of the parameters is
10113 zero, it will be calculated to from the total number of children in
10114 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
10115 define extra space between all children.
10116 """
10117 newobj = _core_.new_GridSizer(*args, **kwargs)
10118 self.this = newobj.this
10119 self.thisown = 1
10120 del newobj.thisown
10121 self._setOORInfo(self)
10122
10123 def SetCols(*args, **kwargs):
10124 """
10125 SetCols(self, int cols)
10126
10127 Sets the number of columns in the sizer.
10128 """
10129 return _core_.GridSizer_SetCols(*args, **kwargs)
10130
10131 def SetRows(*args, **kwargs):
10132 """
10133 SetRows(self, int rows)
10134
10135 Sets the number of rows in the sizer.
10136 """
10137 return _core_.GridSizer_SetRows(*args, **kwargs)
10138
10139 def SetVGap(*args, **kwargs):
10140 """
10141 SetVGap(self, int gap)
10142
10143 Sets the vertical gap (in pixels) between the cells in the sizer.
10144 """
10145 return _core_.GridSizer_SetVGap(*args, **kwargs)
10146
10147 def SetHGap(*args, **kwargs):
10148 """
10149 SetHGap(self, int gap)
10150
10151 Sets the horizontal gap (in pixels) between cells in the sizer
10152 """
10153 return _core_.GridSizer_SetHGap(*args, **kwargs)
10154
10155 def GetCols(*args, **kwargs):
10156 """
10157 GetCols(self) -> int
10158
10159 Returns the number of columns in the sizer.
10160 """
10161 return _core_.GridSizer_GetCols(*args, **kwargs)
10162
10163 def GetRows(*args, **kwargs):
10164 """
10165 GetRows(self) -> int
10166
10167 Returns the number of rows in the sizer.
10168 """
10169 return _core_.GridSizer_GetRows(*args, **kwargs)
10170
10171 def GetVGap(*args, **kwargs):
10172 """
10173 GetVGap(self) -> int
10174
10175 Returns the vertical gap (in pixels) between the cells in the sizer.
10176 """
10177 return _core_.GridSizer_GetVGap(*args, **kwargs)
10178
10179 def GetHGap(*args, **kwargs):
10180 """
10181 GetHGap(self) -> int
10182
10183 Returns the horizontal gap (in pixels) between cells in the sizer.
10184 """
10185 return _core_.GridSizer_GetHGap(*args, **kwargs)
10186
10187
10188 class GridSizerPtr(GridSizer):
10189 def __init__(self, this):
10190 self.this = this
10191 if not hasattr(self,"thisown"): self.thisown = 0
10192 self.__class__ = GridSizer
10193 _core_.GridSizer_swigregister(GridSizerPtr)
10194
10195 #---------------------------------------------------------------------------
10196
10197 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
10198 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
10199 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
10200 class FlexGridSizer(GridSizer):
10201 """
10202 A flex grid sizer is a sizer which lays out its children in a
10203 two-dimensional table with all table cells in one row having the same
10204 height and all cells in one column having the same width, but all
10205 rows or all columns are not necessarily the same height or width as in
10206 the `wx.GridSizer`.
10207
10208 wx.FlexGridSizer can also size items equally in one direction but
10209 unequally ("flexibly") in the other. If the sizer is only flexible
10210 in one direction (this can be changed using `SetFlexibleDirection`), it
10211 needs to be decided how the sizer should grow in the other ("non
10212 flexible") direction in order to fill the available space. The
10213 `SetNonFlexibleGrowMode` method serves this purpose.
10214
10215
10216 """
10217 def __repr__(self):
10218 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10219 def __init__(self, *args, **kwargs):
10220 """
10221 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
10222
10223 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
10224 number of columns and rows in the sizer - if either of the parameters
10225 is zero, it will be calculated to from the total number of children in
10226 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
10227 define extra space between all children.
10228 """
10229 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
10230 self.this = newobj.this
10231 self.thisown = 1
10232 del newobj.thisown
10233 self._setOORInfo(self)
10234
10235 def AddGrowableRow(*args, **kwargs):
10236 """
10237 AddGrowableRow(self, size_t idx, int proportion=0)
10238
10239 Specifies that row *idx* (starting from zero) should be grown if there
10240 is extra space available to the sizer.
10241
10242 The *proportion* parameter has the same meaning as the stretch factor
10243 for the box sizers except that if all proportions are 0, then all
10244 columns are resized equally (instead of not being resized at all).
10245 """
10246 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
10247
10248 def RemoveGrowableRow(*args, **kwargs):
10249 """
10250 RemoveGrowableRow(self, size_t idx)
10251
10252 Specifies that row *idx* is no longer growable.
10253 """
10254 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
10255
10256 def AddGrowableCol(*args, **kwargs):
10257 """
10258 AddGrowableCol(self, size_t idx, int proportion=0)
10259
10260 Specifies that column *idx* (starting from zero) should be grown if
10261 there is extra space available to the sizer.
10262
10263 The *proportion* parameter has the same meaning as the stretch factor
10264 for the box sizers except that if all proportions are 0, then all
10265 columns are resized equally (instead of not being resized at all).
10266 """
10267 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
10268
10269 def RemoveGrowableCol(*args, **kwargs):
10270 """
10271 RemoveGrowableCol(self, size_t idx)
10272
10273 Specifies that column *idx* is no longer growable.
10274 """
10275 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
10276
10277 def SetFlexibleDirection(*args, **kwargs):
10278 """
10279 SetFlexibleDirection(self, int direction)
10280
10281 Specifies whether the sizer should flexibly resize its columns, rows,
10282 or both. Argument *direction* can be one of the following values. Any
10283 other value is ignored.
10284
10285 ============== =======================================
10286 wx.VERTICAL Rows are flexibly sized.
10287 wx.HORIZONTAL Columns are flexibly sized.
10288 wx.BOTH Both rows and columns are flexibly sized
10289 (this is the default value).
10290 ============== =======================================
10291
10292 Note that this method does not trigger relayout.
10293
10294 """
10295 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
10296
10297 def GetFlexibleDirection(*args, **kwargs):
10298 """
10299 GetFlexibleDirection(self) -> int
10300
10301 Returns a value that specifies whether the sizer
10302 flexibly resizes its columns, rows, or both (default).
10303
10304 :see: `SetFlexibleDirection`
10305 """
10306 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
10307
10308 def SetNonFlexibleGrowMode(*args, **kwargs):
10309 """
10310 SetNonFlexibleGrowMode(self, int mode)
10311
10312 Specifies how the sizer should grow in the non-flexible direction if
10313 there is one (so `SetFlexibleDirection` must have been called
10314 previously). Argument *mode* can be one of the following values:
10315
10316 ========================== =================================================
10317 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
10318 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
10319 `AddGrowableCol` and `AddGrowableRow`. In this
10320 case equal sizing applies to minimum sizes of
10321 columns or rows (this is the default value).
10322 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
10323 the non flexible direction, whether they are
10324 growable or not in the flexbile direction.
10325 ========================== =================================================
10326
10327 Note that this method does not trigger relayout.
10328
10329
10330 """
10331 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
10332
10333 def GetNonFlexibleGrowMode(*args, **kwargs):
10334 """
10335 GetNonFlexibleGrowMode(self) -> int
10336
10337 Returns the value that specifies how the sizer grows in the
10338 non-flexible direction if there is one.
10339
10340 :see: `SetNonFlexibleGrowMode`
10341 """
10342 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
10343
10344 def GetRowHeights(*args, **kwargs):
10345 """
10346 GetRowHeights(self) -> list
10347
10348 Returns a list of integers representing the heights of each of the
10349 rows in the sizer.
10350 """
10351 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
10352
10353 def GetColWidths(*args, **kwargs):
10354 """
10355 GetColWidths(self) -> list
10356
10357 Returns a list of integers representing the widths of each of the
10358 columns in the sizer.
10359 """
10360 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
10361
10362
10363 class FlexGridSizerPtr(FlexGridSizer):
10364 def __init__(self, this):
10365 self.this = this
10366 if not hasattr(self,"thisown"): self.thisown = 0
10367 self.__class__ = FlexGridSizer
10368 _core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
10369
10370 class StdDialogButtonSizer(BoxSizer):
10371 """
10372 A special sizer that knows how to order and position standard buttons
10373 in order to conform to the current platform's standards. You simply
10374 need to add each `wx.Button` to the sizer, and be sure to create the
10375 buttons using the standard ID's. Then call `Realize` and the sizer
10376 will take care of the rest.
10377
10378 """
10379 def __repr__(self):
10380 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10381 def __init__(self, *args, **kwargs):
10382 """__init__(self) -> StdDialogButtonSizer"""
10383 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
10384 self.this = newobj.this
10385 self.thisown = 1
10386 del newobj.thisown
10387 def AddButton(*args, **kwargs):
10388 """
10389 AddButton(self, wxButton button)
10390
10391 Use this to add the buttons to this sizer. Do not use the `Add`
10392 method in the base class.
10393 """
10394 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
10395
10396 def Realize(*args, **kwargs):
10397 """
10398 Realize(self)
10399
10400 This funciton needs to be called after all the buttons have been added
10401 to the sizer. It will reorder them and position them in a platform
10402 specifc manner.
10403 """
10404 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
10405
10406 def SetAffirmativeButton(*args, **kwargs):
10407 """SetAffirmativeButton(self, wxButton button)"""
10408 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
10409
10410 def SetNegativeButton(*args, **kwargs):
10411 """SetNegativeButton(self, wxButton button)"""
10412 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
10413
10414 def SetCancelButton(*args, **kwargs):
10415 """SetCancelButton(self, wxButton button)"""
10416 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
10417
10418 def GetAffirmativeButton(*args, **kwargs):
10419 """GetAffirmativeButton(self) -> wxButton"""
10420 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
10421
10422 def GetApplyButton(*args, **kwargs):
10423 """GetApplyButton(self) -> wxButton"""
10424 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
10425
10426 def GetNegativeButton(*args, **kwargs):
10427 """GetNegativeButton(self) -> wxButton"""
10428 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
10429
10430 def GetCancelButton(*args, **kwargs):
10431 """GetCancelButton(self) -> wxButton"""
10432 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
10433
10434 def GetHelpButton(*args, **kwargs):
10435 """GetHelpButton(self) -> wxButton"""
10436 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
10437
10438
10439 class StdDialogButtonSizerPtr(StdDialogButtonSizer):
10440 def __init__(self, this):
10441 self.this = this
10442 if not hasattr(self,"thisown"): self.thisown = 0
10443 self.__class__ = StdDialogButtonSizer
10444 _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
10445
10446 #---------------------------------------------------------------------------
10447
10448 class GBPosition(object):
10449 """
10450 This class represents the position of an item in a virtual grid of
10451 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10452 typemaps that will automatically convert from a 2-element sequence of
10453 integers to a wx.GBPosition, so you can use the more pythonic
10454 representation of the position nearly transparently in Python code.
10455 """
10456 def __repr__(self):
10457 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10458 def __init__(self, *args, **kwargs):
10459 """
10460 __init__(self, int row=0, int col=0) -> GBPosition
10461
10462 This class represents the position of an item in a virtual grid of
10463 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10464 typemaps that will automatically convert from a 2-element sequence of
10465 integers to a wx.GBPosition, so you can use the more pythonic
10466 representation of the position nearly transparently in Python code.
10467 """
10468 newobj = _core_.new_GBPosition(*args, **kwargs)
10469 self.this = newobj.this
10470 self.thisown = 1
10471 del newobj.thisown
10472 def GetRow(*args, **kwargs):
10473 """GetRow(self) -> int"""
10474 return _core_.GBPosition_GetRow(*args, **kwargs)
10475
10476 def GetCol(*args, **kwargs):
10477 """GetCol(self) -> int"""
10478 return _core_.GBPosition_GetCol(*args, **kwargs)
10479
10480 def SetRow(*args, **kwargs):
10481 """SetRow(self, int row)"""
10482 return _core_.GBPosition_SetRow(*args, **kwargs)
10483
10484 def SetCol(*args, **kwargs):
10485 """SetCol(self, int col)"""
10486 return _core_.GBPosition_SetCol(*args, **kwargs)
10487
10488 def __eq__(*args, **kwargs):
10489 """__eq__(self, GBPosition other) -> bool"""
10490 return _core_.GBPosition___eq__(*args, **kwargs)
10491
10492 def __ne__(*args, **kwargs):
10493 """__ne__(self, GBPosition other) -> bool"""
10494 return _core_.GBPosition___ne__(*args, **kwargs)
10495
10496 def Set(*args, **kwargs):
10497 """Set(self, int row=0, int col=0)"""
10498 return _core_.GBPosition_Set(*args, **kwargs)
10499
10500 def Get(*args, **kwargs):
10501 """Get(self) -> PyObject"""
10502 return _core_.GBPosition_Get(*args, **kwargs)
10503
10504 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
10505 def __str__(self): return str(self.Get())
10506 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
10507 def __len__(self): return len(self.Get())
10508 def __getitem__(self, index): return self.Get()[index]
10509 def __setitem__(self, index, val):
10510 if index == 0: self.SetRow(val)
10511 elif index == 1: self.SetCol(val)
10512 else: raise IndexError
10513 def __nonzero__(self): return self.Get() != (0,0)
10514 __safe_for_unpickling__ = True
10515 def __reduce__(self): return (wx.GBPosition, self.Get())
10516
10517 row = property(GetRow, SetRow)
10518 col = property(GetCol, SetCol)
10519
10520
10521 class GBPositionPtr(GBPosition):
10522 def __init__(self, this):
10523 self.this = this
10524 if not hasattr(self,"thisown"): self.thisown = 0
10525 self.__class__ = GBPosition
10526 _core_.GBPosition_swigregister(GBPositionPtr)
10527
10528 class GBSpan(object):
10529 """
10530 This class is used to hold the row and column spanning attributes of
10531 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10532 automatically convert from a 2-element sequence of integers to a
10533 wx.GBSpan, so you can use the more pythonic representation of the span
10534 nearly transparently in Python code.
10535
10536 """
10537 def __repr__(self):
10538 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10539 def __init__(self, *args, **kwargs):
10540 """
10541 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
10542
10543 Construct a new wxGBSpan, optionally setting the rowspan and
10544 colspan. The default is (1,1). (Meaning that the item occupies one
10545 cell in each direction.
10546 """
10547 newobj = _core_.new_GBSpan(*args, **kwargs)
10548 self.this = newobj.this
10549 self.thisown = 1
10550 del newobj.thisown
10551 def GetRowspan(*args, **kwargs):
10552 """GetRowspan(self) -> int"""
10553 return _core_.GBSpan_GetRowspan(*args, **kwargs)
10554
10555 def GetColspan(*args, **kwargs):
10556 """GetColspan(self) -> int"""
10557 return _core_.GBSpan_GetColspan(*args, **kwargs)
10558
10559 def SetRowspan(*args, **kwargs):
10560 """SetRowspan(self, int rowspan)"""
10561 return _core_.GBSpan_SetRowspan(*args, **kwargs)
10562
10563 def SetColspan(*args, **kwargs):
10564 """SetColspan(self, int colspan)"""
10565 return _core_.GBSpan_SetColspan(*args, **kwargs)
10566
10567 def __eq__(*args, **kwargs):
10568 """__eq__(self, GBSpan other) -> bool"""
10569 return _core_.GBSpan___eq__(*args, **kwargs)
10570
10571 def __ne__(*args, **kwargs):
10572 """__ne__(self, GBSpan other) -> bool"""
10573 return _core_.GBSpan___ne__(*args, **kwargs)
10574
10575 def Set(*args, **kwargs):
10576 """Set(self, int rowspan=1, int colspan=1)"""
10577 return _core_.GBSpan_Set(*args, **kwargs)
10578
10579 def Get(*args, **kwargs):
10580 """Get(self) -> PyObject"""
10581 return _core_.GBSpan_Get(*args, **kwargs)
10582
10583 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
10584 def __str__(self): return str(self.Get())
10585 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10586 def __len__(self): return len(self.Get())
10587 def __getitem__(self, index): return self.Get()[index]
10588 def __setitem__(self, index, val):
10589 if index == 0: self.SetRowspan(val)
10590 elif index == 1: self.SetColspan(val)
10591 else: raise IndexError
10592 def __nonzero__(self): return self.Get() != (0,0)
10593 __safe_for_unpickling__ = True
10594 def __reduce__(self): return (wx.GBSpan, self.Get())
10595
10596 rowspan = property(GetRowspan, SetRowspan)
10597 colspan = property(GetColspan, SetColspan)
10598
10599
10600 class GBSpanPtr(GBSpan):
10601 def __init__(self, this):
10602 self.this = this
10603 if not hasattr(self,"thisown"): self.thisown = 0
10604 self.__class__ = GBSpan
10605 _core_.GBSpan_swigregister(GBSpanPtr)
10606
10607 class GBSizerItem(SizerItem):
10608 """
10609 The wx.GBSizerItem class is used to track the additional data about
10610 items in a `wx.GridBagSizer` such as the item's position in the grid
10611 and how many rows or columns it spans.
10612
10613 """
10614 def __repr__(self):
10615 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10616 def __init__(self, *args, **kwargs):
10617 """
10618 __init__(self) -> GBSizerItem
10619
10620 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10621 size will need to be set, as well as a position and span before this
10622 item can be used in a Sizer.
10623
10624 You will probably never need to create a wx.GBSizerItem directly as they
10625 are created automatically when the sizer's Add method is called.
10626 """
10627 newobj = _core_.new_GBSizerItem(*args, **kwargs)
10628 self.this = newobj.this
10629 self.thisown = 1
10630 del newobj.thisown
10631 def GetPos(*args, **kwargs):
10632 """
10633 GetPos(self) -> GBPosition
10634
10635 Get the grid position of the item
10636 """
10637 return _core_.GBSizerItem_GetPos(*args, **kwargs)
10638
10639 def GetPosTuple(self): return self.GetPos().Get()
10640 def GetSpan(*args, **kwargs):
10641 """
10642 GetSpan(self) -> GBSpan
10643
10644 Get the row and column spanning of the item
10645 """
10646 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
10647
10648 def GetSpanTuple(self): return self.GetSpan().Get()
10649 def SetPos(*args, **kwargs):
10650 """
10651 SetPos(self, GBPosition pos) -> bool
10652
10653 If the item is already a member of a sizer then first ensure that
10654 there is no other item that would intersect with this one at the new
10655 position, then set the new position. Returns True if the change is
10656 successful and after the next Layout() the item will be moved.
10657 """
10658 return _core_.GBSizerItem_SetPos(*args, **kwargs)
10659
10660 def SetSpan(*args, **kwargs):
10661 """
10662 SetSpan(self, GBSpan span) -> bool
10663
10664 If the item is already a member of a sizer then first ensure that
10665 there is no other item that would intersect with this one with its new
10666 spanning size, then set the new spanning. Returns True if the change
10667 is successful and after the next Layout() the item will be resized.
10668
10669 """
10670 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
10671
10672 def Intersects(*args, **kwargs):
10673 """
10674 Intersects(self, GBSizerItem other) -> bool
10675
10676 Returns True if this item and the other item instersect.
10677 """
10678 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10679
10680 def IntersectsPos(*args, **kwargs):
10681 """
10682 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10683
10684 Returns True if the given pos/span would intersect with this item.
10685 """
10686 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
10687
10688 def GetEndPos(*args, **kwargs):
10689 """
10690 GetEndPos(self) -> GBPosition
10691
10692 Get the row and column of the endpoint of this item.
10693 """
10694 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
10695
10696 def GetGBSizer(*args, **kwargs):
10697 """
10698 GetGBSizer(self) -> GridBagSizer
10699
10700 Get the sizer this item is a member of.
10701 """
10702 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
10703
10704 def SetGBSizer(*args, **kwargs):
10705 """
10706 SetGBSizer(self, GridBagSizer sizer)
10707
10708 Set the sizer this item is a member of.
10709 """
10710 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
10711
10712
10713 class GBSizerItemPtr(GBSizerItem):
10714 def __init__(self, this):
10715 self.this = this
10716 if not hasattr(self,"thisown"): self.thisown = 0
10717 self.__class__ = GBSizerItem
10718 _core_.GBSizerItem_swigregister(GBSizerItemPtr)
10719 DefaultSpan = cvar.DefaultSpan
10720
10721 def GBSizerItemWindow(*args, **kwargs):
10722 """
10723 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
10724 int border, PyObject userData=None) -> GBSizerItem
10725
10726 Construct a `wx.GBSizerItem` for a window.
10727 """
10728 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
10729 val.thisown = 1
10730 return val
10731
10732 def GBSizerItemSizer(*args, **kwargs):
10733 """
10734 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
10735 int border, PyObject userData=None) -> GBSizerItem
10736
10737 Construct a `wx.GBSizerItem` for a sizer
10738 """
10739 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
10740 val.thisown = 1
10741 return val
10742
10743 def GBSizerItemSpacer(*args, **kwargs):
10744 """
10745 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
10746 int flag, int border, PyObject userData=None) -> GBSizerItem
10747
10748 Construct a `wx.GBSizerItem` for a spacer.
10749 """
10750 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
10751 val.thisown = 1
10752 return val
10753
10754 class GridBagSizer(FlexGridSizer):
10755 """
10756 A `wx.Sizer` that can lay out items in a virtual grid like a
10757 `wx.FlexGridSizer` but in this case explicit positioning of the items
10758 is allowed using `wx.GBPosition`, and items can optionally span more
10759 than one row and/or column using `wx.GBSpan`. The total size of the
10760 virtual grid is determined by the largest row and column that items are
10761 positioned at, adjusted for spanning.
10762
10763 """
10764 def __repr__(self):
10765 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10766 def __init__(self, *args, **kwargs):
10767 """
10768 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10769
10770 Constructor, with optional parameters to specify the gap between the
10771 rows and columns.
10772 """
10773 newobj = _core_.new_GridBagSizer(*args, **kwargs)
10774 self.this = newobj.this
10775 self.thisown = 1
10776 del newobj.thisown
10777 self._setOORInfo(self)
10778
10779 def Add(*args, **kwargs):
10780 """
10781 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
10782 int border=0, userData=None) -> wx.GBSizerItem
10783
10784 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10785 more than one row or column as specified with *span*. The remaining
10786 args behave similarly to `wx.Sizer.Add`.
10787
10788 Returns True if the item was successfully placed at the given cell
10789 position, False if something was already there.
10790
10791 """
10792 return _core_.GridBagSizer_Add(*args, **kwargs)
10793
10794 def AddItem(*args, **kwargs):
10795 """
10796 Add(self, GBSizerItem item) -> wx.GBSizerItem
10797
10798 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10799 the item was successfully placed at its given cell position, False if
10800 something was already there.
10801 """
10802 return _core_.GridBagSizer_AddItem(*args, **kwargs)
10803
10804 def GetCellSize(*args, **kwargs):
10805 """
10806 GetCellSize(self, int row, int col) -> Size
10807
10808 Get the size of the specified cell, including hgap and
10809 vgap. Only valid after a Layout.
10810 """
10811 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
10812
10813 def GetEmptyCellSize(*args, **kwargs):
10814 """
10815 GetEmptyCellSize(self) -> Size
10816
10817 Get the size used for cells in the grid with no item.
10818 """
10819 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
10820
10821 def SetEmptyCellSize(*args, **kwargs):
10822 """
10823 SetEmptyCellSize(self, Size sz)
10824
10825 Set the size used for cells in the grid with no item.
10826 """
10827 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
10828
10829 def GetItemPosition(*args):
10830 """
10831 GetItemPosition(self, item) -> GBPosition
10832
10833 Get the grid position of the specified *item* where *item* is either a
10834 window or subsizer that is a member of this sizer, or a zero-based
10835 index of an item.
10836 """
10837 return _core_.GridBagSizer_GetItemPosition(*args)
10838
10839 def SetItemPosition(*args):
10840 """
10841 SetItemPosition(self, item, GBPosition pos) -> bool
10842
10843 Set the grid position of the specified *item* where *item* is either a
10844 window or subsizer that is a member of this sizer, or a zero-based
10845 index of an item. Returns True on success. If the move is not
10846 allowed (because an item is already there) then False is returned.
10847
10848 """
10849 return _core_.GridBagSizer_SetItemPosition(*args)
10850
10851 def GetItemSpan(*args):
10852 """
10853 GetItemSpan(self, item) -> GBSpan
10854
10855 Get the row/col spanning of the specified *item* where *item* is
10856 either a window or subsizer that is a member of this sizer, or a
10857 zero-based index of an item.
10858 """
10859 return _core_.GridBagSizer_GetItemSpan(*args)
10860
10861 def SetItemSpan(*args):
10862 """
10863 SetItemSpan(self, item, GBSpan span) -> bool
10864
10865 Set the row/col spanning of the specified *item* where *item* is
10866 either a window or subsizer that is a member of this sizer, or a
10867 zero-based index of an item. Returns True on success. If the move is
10868 not allowed (because an item is already there) then False is returned.
10869 """
10870 return _core_.GridBagSizer_SetItemSpan(*args)
10871
10872 def FindItem(*args):
10873 """
10874 FindItem(self, item) -> GBSizerItem
10875
10876 Find the sizer item for the given window or subsizer, returns None if
10877 not found. (non-recursive)
10878 """
10879 return _core_.GridBagSizer_FindItem(*args)
10880
10881 def FindItemAtPosition(*args, **kwargs):
10882 """
10883 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10884
10885 Return the sizer item for the given grid cell, or None if there is no
10886 item at that position. (non-recursive)
10887 """
10888 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
10889
10890 def FindItemAtPoint(*args, **kwargs):
10891 """
10892 FindItemAtPoint(self, Point pt) -> GBSizerItem
10893
10894 Return the sizer item located at the point given in *pt*, or None if
10895 there is no item at that point. The (x,y) coordinates in pt correspond
10896 to the client coordinates of the window using the sizer for
10897 layout. (non-recursive)
10898 """
10899 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
10900
10901 def CheckForIntersection(*args, **kwargs):
10902 """
10903 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
10904
10905 Look at all items and see if any intersect (or would overlap) the
10906 given *item*. Returns True if so, False if there would be no overlap.
10907 If an *excludeItem* is given then it will not be checked for
10908 intersection, for example it may be the item we are checking the
10909 position of.
10910
10911 """
10912 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
10913
10914 def CheckForIntersectionPos(*args, **kwargs):
10915 """
10916 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10917
10918 Look at all items and see if any intersect (or would overlap) the
10919 given position and span. Returns True if so, False if there would be
10920 no overlap. If an *excludeItem* is given then it will not be checked
10921 for intersection, for example it may be the item we are checking the
10922 position of.
10923 """
10924 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
10925
10926
10927 class GridBagSizerPtr(GridBagSizer):
10928 def __init__(self, this):
10929 self.this = this
10930 if not hasattr(self,"thisown"): self.thisown = 0
10931 self.__class__ = GridBagSizer
10932 _core_.GridBagSizer_swigregister(GridBagSizerPtr)
10933
10934 #---------------------------------------------------------------------------
10935
10936 Left = _core_.Left
10937 Top = _core_.Top
10938 Right = _core_.Right
10939 Bottom = _core_.Bottom
10940 Width = _core_.Width
10941 Height = _core_.Height
10942 Centre = _core_.Centre
10943 Center = _core_.Center
10944 CentreX = _core_.CentreX
10945 CentreY = _core_.CentreY
10946 Unconstrained = _core_.Unconstrained
10947 AsIs = _core_.AsIs
10948 PercentOf = _core_.PercentOf
10949 Above = _core_.Above
10950 Below = _core_.Below
10951 LeftOf = _core_.LeftOf
10952 RightOf = _core_.RightOf
10953 SameAs = _core_.SameAs
10954 Absolute = _core_.Absolute
10955 class IndividualLayoutConstraint(Object):
10956 """
10957 Objects of this class are stored in the `wx.LayoutConstraints` class as
10958 one of eight possible constraints that a window can be involved in.
10959 You will never need to create an instance of
10960 wx.IndividualLayoutConstraint, rather you should create a
10961 `wx.LayoutConstraints` instance and use the individual contstraints
10962 that it contains.
10963 """
10964 def __init__(self): raise RuntimeError, "No constructor defined"
10965 def __repr__(self):
10966 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10967 def Set(*args, **kwargs):
10968 """
10969 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10970
10971 Sets the properties of the constraint. Normally called by one of the
10972 convenience functions such as Above, RightOf, SameAs.
10973 """
10974 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
10975
10976 def LeftOf(*args, **kwargs):
10977 """
10978 LeftOf(self, Window sibling, int marg=0)
10979
10980 Constrains this edge to be to the left of the given window, with an
10981 optional margin. Implicitly, this is relative to the left edge of the
10982 other window.
10983 """
10984 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
10985
10986 def RightOf(*args, **kwargs):
10987 """
10988 RightOf(self, Window sibling, int marg=0)
10989
10990 Constrains this edge to be to the right of the given window, with an
10991 optional margin. Implicitly, this is relative to the right edge of the
10992 other window.
10993 """
10994 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
10995
10996 def Above(*args, **kwargs):
10997 """
10998 Above(self, Window sibling, int marg=0)
10999
11000 Constrains this edge to be above the given window, with an optional
11001 margin. Implicitly, this is relative to the top edge of the other
11002 window.
11003 """
11004 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
11005
11006 def Below(*args, **kwargs):
11007 """
11008 Below(self, Window sibling, int marg=0)
11009
11010 Constrains this edge to be below the given window, with an optional
11011 margin. Implicitly, this is relative to the bottom edge of the other
11012 window.
11013 """
11014 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
11015
11016 def SameAs(*args, **kwargs):
11017 """
11018 SameAs(self, Window otherW, int edge, int marg=0)
11019
11020 Constrains this edge or dimension to be to the same as the edge of the
11021 given window, with an optional margin.
11022 """
11023 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
11024
11025 def PercentOf(*args, **kwargs):
11026 """
11027 PercentOf(self, Window otherW, int wh, int per)
11028
11029 Constrains this edge or dimension to be to a percentage of the given
11030 window, with an optional margin.
11031 """
11032 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
11033
11034 def Absolute(*args, **kwargs):
11035 """
11036 Absolute(self, int val)
11037
11038 Constrains this edge or dimension to be the given absolute value.
11039 """
11040 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
11041
11042 def Unconstrained(*args, **kwargs):
11043 """
11044 Unconstrained(self)
11045
11046 Sets this edge or dimension to be unconstrained, that is, dependent on
11047 other edges and dimensions from which this value can be deduced.
11048 """
11049 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
11050
11051 def AsIs(*args, **kwargs):
11052 """
11053 AsIs(self)
11054
11055 Sets this edge or constraint to be whatever the window's value is at
11056 the moment. If either of the width and height constraints are *as is*,
11057 the window will not be resized, but moved instead. This is important
11058 when considering panel items which are intended to have a default
11059 size, such as a button, which may take its size from the size of the
11060 button label.
11061 """
11062 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
11063
11064 def GetOtherWindow(*args, **kwargs):
11065 """GetOtherWindow(self) -> Window"""
11066 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
11067
11068 def GetMyEdge(*args, **kwargs):
11069 """GetMyEdge(self) -> int"""
11070 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
11071
11072 def SetEdge(*args, **kwargs):
11073 """SetEdge(self, int which)"""
11074 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
11075
11076 def SetValue(*args, **kwargs):
11077 """SetValue(self, int v)"""
11078 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
11079
11080 def GetMargin(*args, **kwargs):
11081 """GetMargin(self) -> int"""
11082 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
11083
11084 def SetMargin(*args, **kwargs):
11085 """SetMargin(self, int m)"""
11086 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
11087
11088 def GetValue(*args, **kwargs):
11089 """GetValue(self) -> int"""
11090 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
11091
11092 def GetPercent(*args, **kwargs):
11093 """GetPercent(self) -> int"""
11094 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
11095
11096 def GetOtherEdge(*args, **kwargs):
11097 """GetOtherEdge(self) -> int"""
11098 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
11099
11100 def GetDone(*args, **kwargs):
11101 """GetDone(self) -> bool"""
11102 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
11103
11104 def SetDone(*args, **kwargs):
11105 """SetDone(self, bool d)"""
11106 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
11107
11108 def GetRelationship(*args, **kwargs):
11109 """GetRelationship(self) -> int"""
11110 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
11111
11112 def SetRelationship(*args, **kwargs):
11113 """SetRelationship(self, int r)"""
11114 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
11115
11116 def ResetIfWin(*args, **kwargs):
11117 """
11118 ResetIfWin(self, Window otherW) -> bool
11119
11120 Reset constraint if it mentions otherWin
11121 """
11122 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
11123
11124 def SatisfyConstraint(*args, **kwargs):
11125 """
11126 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
11127
11128 Try to satisfy constraint
11129 """
11130 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
11131
11132 def GetEdge(*args, **kwargs):
11133 """
11134 GetEdge(self, int which, Window thisWin, Window other) -> int
11135
11136 Get the value of this edge or dimension, or if this
11137 is not determinable, -1.
11138 """
11139 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
11140
11141
11142 class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
11143 def __init__(self, this):
11144 self.this = this
11145 if not hasattr(self,"thisown"): self.thisown = 0
11146 self.__class__ = IndividualLayoutConstraint
11147 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
11148
11149 class LayoutConstraints(Object):
11150 """
11151 **Note:** constraints are now deprecated and you should use sizers
11152 instead.
11153
11154 Objects of this class can be associated with a window to define its
11155 layout constraints, with respect to siblings or its parent.
11156
11157 The class consists of the following eight constraints of class
11158 wx.IndividualLayoutConstraint, some or all of which should be accessed
11159 directly to set the appropriate constraints.
11160
11161 * left: represents the left hand edge of the window
11162 * right: represents the right hand edge of the window
11163 * top: represents the top edge of the window
11164 * bottom: represents the bottom edge of the window
11165 * width: represents the width of the window
11166 * height: represents the height of the window
11167 * centreX: represents the horizontal centre point of the window
11168 * centreY: represents the vertical centre point of the window
11169
11170 Most constraints are initially set to have the relationship
11171 wxUnconstrained, which means that their values should be calculated by
11172 looking at known constraints. The exceptions are width and height,
11173 which are set to wxAsIs to ensure that if the user does not specify a
11174 constraint, the existing width and height will be used, to be
11175 compatible with panel items which often have take a default size. If
11176 the constraint is ``wx.AsIs``, the dimension will not be changed.
11177
11178 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
11179
11180 """
11181 def __repr__(self):
11182 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11183 left = property(_core_.LayoutConstraints_left_get)
11184 top = property(_core_.LayoutConstraints_top_get)
11185 right = property(_core_.LayoutConstraints_right_get)
11186 bottom = property(_core_.LayoutConstraints_bottom_get)
11187 width = property(_core_.LayoutConstraints_width_get)
11188 height = property(_core_.LayoutConstraints_height_get)
11189 centreX = property(_core_.LayoutConstraints_centreX_get)
11190 centreY = property(_core_.LayoutConstraints_centreY_get)
11191 def __init__(self, *args, **kwargs):
11192 """__init__(self) -> LayoutConstraints"""
11193 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
11194 self.this = newobj.this
11195 self.thisown = 1
11196 del newobj.thisown
11197 def SatisfyConstraints(*args, **kwargs):
11198 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
11199 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
11200
11201 def AreSatisfied(*args, **kwargs):
11202 """AreSatisfied(self) -> bool"""
11203 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
11204
11205
11206 class LayoutConstraintsPtr(LayoutConstraints):
11207 def __init__(self, this):
11208 self.this = this
11209 if not hasattr(self,"thisown"): self.thisown = 0
11210 self.__class__ = LayoutConstraints
11211 _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
11212
11213 #----------------------------------------------------------------------------
11214
11215 # Use Python's bool constants if available, make some if not
11216 try:
11217 True
11218 except NameError:
11219 __builtins__.True = 1==1
11220 __builtins__.False = 1==0
11221 def bool(value): return not not value
11222 __builtins__.bool = bool
11223
11224
11225
11226 # workarounds for bad wxRTTI names
11227 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
11228 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
11229 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
11230
11231
11232 #----------------------------------------------------------------------------
11233 # Load version numbers from __version__... Ensure that major and minor
11234 # versions are the same for both wxPython and wxWidgets.
11235
11236 from __version__ import *
11237 __version__ = VERSION_STRING
11238
11239 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
11240 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
11241 if RELEASE_VERSION != _core_.RELEASE_VERSION:
11242 import warnings
11243 warnings.warn("wxPython/wxWidgets release number mismatch")
11244
11245 #----------------------------------------------------------------------------
11246
11247 # Set the default string<-->unicode conversion encoding from the
11248 # locale. This encoding is used when string or unicode objects need
11249 # to be converted in order to pass them to wxWidgets. Please be aware
11250 # that the default encoding within the same locale may be slightly
11251 # different on different platforms. For example, please see
11252 # http://www.alanwood.net/demos/charsetdiffs.html for differences
11253 # between the common latin/roman encodings.
11254 import locale
11255 import codecs
11256 try:
11257 default = locale.getdefaultlocale()[1]
11258 codecs.lookup(default)
11259 except (ValueError, LookupError):
11260 default = _sys.getdefaultencoding()
11261 if default:
11262 wx.SetDefaultPyEncoding(default)
11263 del default
11264 del locale
11265 del codecs
11266
11267 #----------------------------------------------------------------------------
11268
11269 class PyDeadObjectError(AttributeError):
11270 pass
11271
11272 class _wxPyDeadObject(object):
11273 """
11274 Instances of wx objects that are OOR capable will have their __class__
11275 changed to this class when the C++ object is deleted. This should help
11276 prevent crashes due to referencing a bogus C++ pointer.
11277 """
11278 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
11279 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
11280
11281 def __repr__(self):
11282 if not hasattr(self, "_name"):
11283 self._name = "[unknown]"
11284 return self.reprStr % self._name
11285
11286 def __getattr__(self, *args):
11287 if not hasattr(self, "_name"):
11288 self._name = "[unknown]"
11289 raise PyDeadObjectError(self.attrStr % self._name)
11290
11291 def __nonzero__(self):
11292 return 0
11293
11294
11295
11296 class PyUnbornObjectError(AttributeError):
11297 pass
11298
11299 class _wxPyUnbornObject(object):
11300 """
11301 Some stock objects are created when the wx._core module is
11302 imported, but their C++ instance is not created until the wx.App
11303 object is created and initialized. These object instances will
11304 temporarily have their __class__ changed to this class so an
11305 exception will be raised if they are used before the C++ instance
11306 is ready.
11307 """
11308
11309 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
11310 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
11311
11312 def __repr__(self):
11313 #if not hasattr(self, "_name"):
11314 # self._name = "[unknown]"
11315 return self.reprStr #% self._name
11316
11317 def __getattr__(self, *args):
11318 #if not hasattr(self, "_name"):
11319 # self._name = "[unknown]"
11320 raise PyUnbornObjectError(self.attrStr) # % self._name )
11321
11322 def __nonzero__(self):
11323 return 0
11324
11325
11326 #----------------------------------------------------------------------------
11327
11328 def CallAfter(callable, *args, **kw):
11329 """
11330 Call the specified function after the current and pending event
11331 handlers have been completed. This is also good for making GUI
11332 method calls from non-GUI threads. Any extra positional or
11333 keyword args are passed on to the callable when it is called.
11334
11335 :see: `wx.FutureCall`
11336 """
11337 app = wx.GetApp()
11338 assert app is not None, 'No wx.App created yet'
11339
11340 if not hasattr(app, "_CallAfterId"):
11341 app._CallAfterId = wx.NewEventType()
11342 app.Connect(-1, -1, app._CallAfterId,
11343 lambda event: event.callable(*event.args, **event.kw) )
11344 evt = wx.PyEvent()
11345 evt.SetEventType(app._CallAfterId)
11346 evt.callable = callable
11347 evt.args = args
11348 evt.kw = kw
11349 wx.PostEvent(app, evt)
11350
11351 #----------------------------------------------------------------------------
11352
11353
11354 class FutureCall:
11355 """
11356 A convenience class for `wx.Timer`, that calls the given callable
11357 object once after the given amount of milliseconds, passing any
11358 positional or keyword args. The return value of the callable is
11359 availbale after it has been run with the `GetResult` method.
11360
11361 If you don't need to get the return value or restart the timer
11362 then there is no need to hold a reference to this object. It will
11363 hold a reference to itself while the timer is running (the timer
11364 has a reference to self.Notify) but the cycle will be broken when
11365 the timer completes, automatically cleaning up the wx.FutureCall
11366 object.
11367
11368 :see: `wx.CallAfter`
11369 """
11370 def __init__(self, millis, callable, *args, **kwargs):
11371 self.millis = millis
11372 self.callable = callable
11373 self.SetArgs(*args, **kwargs)
11374 self.runCount = 0
11375 self.running = False
11376 self.hasRun = False
11377 self.result = None
11378 self.timer = None
11379 self.Start()
11380
11381 def __del__(self):
11382 self.Stop()
11383
11384
11385 def Start(self, millis=None, *args, **kwargs):
11386 """
11387 (Re)start the timer
11388 """
11389 self.hasRun = False
11390 if millis is not None:
11391 self.millis = millis
11392 if args or kwargs:
11393 self.SetArgs(*args, **kwargs)
11394 self.Stop()
11395 self.timer = wx.PyTimer(self.Notify)
11396 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
11397 self.running = True
11398 Restart = Start
11399
11400
11401 def Stop(self):
11402 """
11403 Stop and destroy the timer.
11404 """
11405 if self.timer is not None:
11406 self.timer.Stop()
11407 self.timer = None
11408
11409
11410 def GetInterval(self):
11411 if self.timer is not None:
11412 return self.timer.GetInterval()
11413 else:
11414 return 0
11415
11416
11417 def IsRunning(self):
11418 return self.timer is not None and self.timer.IsRunning()
11419
11420
11421 def SetArgs(self, *args, **kwargs):
11422 """
11423 (Re)set the args passed to the callable object. This is
11424 useful in conjunction with Restart if you want to schedule a
11425 new call to the same callable object but with different
11426 parameters.
11427 """
11428 self.args = args
11429 self.kwargs = kwargs
11430
11431
11432 def HasRun(self):
11433 return self.hasRun
11434
11435 def GetResult(self):
11436 return self.result
11437
11438 def Notify(self):
11439 """
11440 The timer has expired so call the callable.
11441 """
11442 if self.callable and getattr(self.callable, 'im_self', True):
11443 self.runCount += 1
11444 self.running = False
11445 self.result = self.callable(*self.args, **self.kwargs)
11446 self.hasRun = True
11447 if not self.running:
11448 # if it wasn't restarted, then cleanup
11449 wx.CallAfter(self.Stop)
11450
11451
11452
11453 #----------------------------------------------------------------------------
11454 # Control which items in this module should be documented by epydoc.
11455 # We allow only classes and functions, which will help reduce the size
11456 # of the docs by filtering out the zillions of constants, EVT objects,
11457 # and etc that don't make much sense by themselves, but are instead
11458 # documented (or will be) as part of the classes/functions/methods
11459 # where they should be used.
11460
11461 class __DocFilter:
11462 """
11463 A filter for epydoc that only allows non-Ptr classes and
11464 fucntions, in order to reduce the clutter in the API docs.
11465 """
11466 def __init__(self, globals):
11467 self._globals = globals
11468
11469 def __call__(self, name):
11470 import types
11471 obj = self._globals.get(name, None)
11472 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
11473 return False
11474 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
11475 return False
11476 return True
11477
11478 #----------------------------------------------------------------------------
11479 #----------------------------------------------------------------------------
11480
11481 # Import other modules in this package that should show up in the
11482 # "core" wx namespace
11483 from _gdi import *
11484 from _windows import *
11485 from _controls import *
11486 from _misc import *
11487
11488
11489 # Fixup the stock objects since they can't be used yet. (They will be
11490 # restored in wx.PyApp.OnInit.)
11491 _core_._wxPyFixStockObjects()
11492
11493 #----------------------------------------------------------------------------
11494 #----------------------------------------------------------------------------
11495
11496