1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
6 new_instancemethod
= new
.instancemethod
7 def _swig_setattr_nondynamic(self
,class_type
,name
,value
,static
=1):
8 if (name
== "thisown"): return self
.this
.own(value
)
10 if type(value
).__name
__ == 'PySwigObject':
11 self
.__dict
__[name
] = value
13 method
= class_type
.__swig
_setmethods
__.get(name
,None)
14 if method
: return method(self
,value
)
15 if (not static
) or hasattr(self
,name
):
16 self
.__dict
__[name
] = value
18 raise AttributeError("You cannot add attributes to %s" % self
)
20 def _swig_setattr(self
,class_type
,name
,value
):
21 return _swig_setattr_nondynamic(self
,class_type
,name
,value
,0)
23 def _swig_getattr(self
,class_type
,name
):
24 if (name
== "thisown"): return self
.this
.own()
25 method
= class_type
.__swig
_getmethods
__.get(name
,None)
26 if method
: return method(self
)
27 raise AttributeError,name
30 try: strthis
= "proxy of " + self
.this
.__repr
__()
32 return "<%s.%s; %s >" % (self
.__class
__.__module
__, self
.__class
__.__name
__, strthis
,)
36 _object
= types
.ObjectType
38 except AttributeError:
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self
,name
,value
):
46 if (name
== "thisown"): return self
.this
.own(value
)
47 if hasattr(self
,name
) or (name
== "this"):
50 raise AttributeError("You cannot add attributes to %s" % self
)
54 #// Give a reference to the dictionary of this module to the C++ extension
56 _core_
._wxPySetDictionary
(vars())
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
61 wx
= _sys
.modules
[__name__
]
64 #----------------------------------------------------------------------------
66 def _deprecated(callable, msg
=None):
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
72 msg
= "%s is deprecated" % callable
73 def deprecatedWrapper(*args
, **kwargs
):
75 warnings
.warn(msg
, DeprecationWarning, stacklevel
=2)
76 return callable(*args
, **kwargs
)
77 deprecatedWrapper
.__doc
__ = msg
78 return deprecatedWrapper
81 #----------------------------------------------------------------------------
83 NOT_FOUND
= _core_
.NOT_FOUND
84 VSCROLL
= _core_
.VSCROLL
85 HSCROLL
= _core_
.HSCROLL
86 CAPTION
= _core_
.CAPTION
87 DOUBLE_BORDER
= _core_
.DOUBLE_BORDER
88 SUNKEN_BORDER
= _core_
.SUNKEN_BORDER
89 RAISED_BORDER
= _core_
.RAISED_BORDER
90 BORDER
= _core_
.BORDER
91 SIMPLE_BORDER
= _core_
.SIMPLE_BORDER
92 STATIC_BORDER
= _core_
.STATIC_BORDER
93 TRANSPARENT_WINDOW
= _core_
.TRANSPARENT_WINDOW
94 NO_BORDER
= _core_
.NO_BORDER
95 DEFAULT_CONTROL_BORDER
= _core_
.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE
= _core_
.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL
= _core_
.TAB_TRAVERSAL
98 WANTS_CHARS
= _core_
.WANTS_CHARS
99 POPUP_WINDOW
= _core_
.POPUP_WINDOW
100 CENTER_FRAME
= _core_
.CENTER_FRAME
101 CENTRE_ON_SCREEN
= _core_
.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN
= _core_
.CENTER_ON_SCREEN
103 CLIP_CHILDREN
= _core_
.CLIP_CHILDREN
104 CLIP_SIBLINGS
= _core_
.CLIP_SIBLINGS
105 ALWAYS_SHOW_SB
= _core_
.ALWAYS_SHOW_SB
106 RETAINED
= _core_
.RETAINED
107 BACKINGSTORE
= _core_
.BACKINGSTORE
108 COLOURED
= _core_
.COLOURED
109 FIXED_LENGTH
= _core_
.FIXED_LENGTH
110 LB_NEEDED_SB
= _core_
.LB_NEEDED_SB
111 LB_ALWAYS_SB
= _core_
.LB_ALWAYS_SB
112 LB_SORT
= _core_
.LB_SORT
113 LB_SINGLE
= _core_
.LB_SINGLE
114 LB_MULTIPLE
= _core_
.LB_MULTIPLE
115 LB_EXTENDED
= _core_
.LB_EXTENDED
116 LB_OWNERDRAW
= _core_
.LB_OWNERDRAW
117 LB_HSCROLL
= _core_
.LB_HSCROLL
118 PROCESS_ENTER
= _core_
.PROCESS_ENTER
119 PASSWORD
= _core_
.PASSWORD
120 CB_SIMPLE
= _core_
.CB_SIMPLE
121 CB_DROPDOWN
= _core_
.CB_DROPDOWN
122 CB_SORT
= _core_
.CB_SORT
123 CB_READONLY
= _core_
.CB_READONLY
124 RA_HORIZONTAL
= _core_
.RA_HORIZONTAL
125 RA_VERTICAL
= _core_
.RA_VERTICAL
126 RA_SPECIFY_ROWS
= _core_
.RA_SPECIFY_ROWS
127 RA_SPECIFY_COLS
= _core_
.RA_SPECIFY_COLS
128 RA_USE_CHECKBOX
= _core_
.RA_USE_CHECKBOX
129 RB_GROUP
= _core_
.RB_GROUP
130 RB_SINGLE
= _core_
.RB_SINGLE
131 SB_HORIZONTAL
= _core_
.SB_HORIZONTAL
132 SB_VERTICAL
= _core_
.SB_VERTICAL
133 RB_USE_CHECKBOX
= _core_
.RB_USE_CHECKBOX
134 ST_SIZEGRIP
= _core_
.ST_SIZEGRIP
135 ST_NO_AUTORESIZE
= _core_
.ST_NO_AUTORESIZE
136 ST_DOTS_MIDDLE
= _core_
.ST_DOTS_MIDDLE
137 ST_DOTS_END
= _core_
.ST_DOTS_END
138 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
139 FLOOD_BORDER
= _core_
.FLOOD_BORDER
140 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
141 WINDING_RULE
= _core_
.WINDING_RULE
142 TOOL_TOP
= _core_
.TOOL_TOP
143 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
144 TOOL_LEFT
= _core_
.TOOL_LEFT
145 TOOL_RIGHT
= _core_
.TOOL_RIGHT
147 YES_NO
= _core_
.YES_NO
148 CANCEL
= _core_
.CANCEL
151 NO_DEFAULT
= _core_
.NO_DEFAULT
152 YES_DEFAULT
= _core_
.YES_DEFAULT
153 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
154 ICON_HAND
= _core_
.ICON_HAND
155 ICON_QUESTION
= _core_
.ICON_QUESTION
156 ICON_INFORMATION
= _core_
.ICON_INFORMATION
157 ICON_STOP
= _core_
.ICON_STOP
158 ICON_ASTERISK
= _core_
.ICON_ASTERISK
159 ICON_MASK
= _core_
.ICON_MASK
160 ICON_WARNING
= _core_
.ICON_WARNING
161 ICON_ERROR
= _core_
.ICON_ERROR
162 FORWARD
= _core_
.FORWARD
163 BACKWARD
= _core_
.BACKWARD
168 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
169 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
170 SIZE_AUTO
= _core_
.SIZE_AUTO
171 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
172 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
173 SIZE_FORCE
= _core_
.SIZE_FORCE
174 PORTRAIT
= _core_
.PORTRAIT
175 LANDSCAPE
= _core_
.LANDSCAPE
176 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
177 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
178 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
179 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
180 ID_ANY
= _core_
.ID_ANY
181 ID_SEPARATOR
= _core_
.ID_SEPARATOR
182 ID_NONE
= _core_
.ID_NONE
183 ID_LOWEST
= _core_
.ID_LOWEST
184 ID_OPEN
= _core_
.ID_OPEN
185 ID_CLOSE
= _core_
.ID_CLOSE
186 ID_NEW
= _core_
.ID_NEW
187 ID_SAVE
= _core_
.ID_SAVE
188 ID_SAVEAS
= _core_
.ID_SAVEAS
189 ID_REVERT
= _core_
.ID_REVERT
190 ID_EXIT
= _core_
.ID_EXIT
191 ID_UNDO
= _core_
.ID_UNDO
192 ID_REDO
= _core_
.ID_REDO
193 ID_HELP
= _core_
.ID_HELP
194 ID_PRINT
= _core_
.ID_PRINT
195 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
196 ID_PREVIEW
= _core_
.ID_PREVIEW
197 ID_ABOUT
= _core_
.ID_ABOUT
198 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
199 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
200 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
201 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
202 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
203 ID_PREFERENCES
= _core_
.ID_PREFERENCES
204 ID_CUT
= _core_
.ID_CUT
205 ID_COPY
= _core_
.ID_COPY
206 ID_PASTE
= _core_
.ID_PASTE
207 ID_CLEAR
= _core_
.ID_CLEAR
208 ID_FIND
= _core_
.ID_FIND
209 ID_DUPLICATE
= _core_
.ID_DUPLICATE
210 ID_SELECTALL
= _core_
.ID_SELECTALL
211 ID_DELETE
= _core_
.ID_DELETE
212 ID_REPLACE
= _core_
.ID_REPLACE
213 ID_REPLACE_ALL
= _core_
.ID_REPLACE_ALL
214 ID_PROPERTIES
= _core_
.ID_PROPERTIES
215 ID_VIEW_DETAILS
= _core_
.ID_VIEW_DETAILS
216 ID_VIEW_LARGEICONS
= _core_
.ID_VIEW_LARGEICONS
217 ID_VIEW_SMALLICONS
= _core_
.ID_VIEW_SMALLICONS
218 ID_VIEW_LIST
= _core_
.ID_VIEW_LIST
219 ID_VIEW_SORTDATE
= _core_
.ID_VIEW_SORTDATE
220 ID_VIEW_SORTNAME
= _core_
.ID_VIEW_SORTNAME
221 ID_VIEW_SORTSIZE
= _core_
.ID_VIEW_SORTSIZE
222 ID_VIEW_SORTTYPE
= _core_
.ID_VIEW_SORTTYPE
223 ID_FILE1
= _core_
.ID_FILE1
224 ID_FILE2
= _core_
.ID_FILE2
225 ID_FILE3
= _core_
.ID_FILE3
226 ID_FILE4
= _core_
.ID_FILE4
227 ID_FILE5
= _core_
.ID_FILE5
228 ID_FILE6
= _core_
.ID_FILE6
229 ID_FILE7
= _core_
.ID_FILE7
230 ID_FILE8
= _core_
.ID_FILE8
231 ID_FILE9
= _core_
.ID_FILE9
233 ID_CANCEL
= _core_
.ID_CANCEL
234 ID_APPLY
= _core_
.ID_APPLY
235 ID_YES
= _core_
.ID_YES
237 ID_STATIC
= _core_
.ID_STATIC
238 ID_FORWARD
= _core_
.ID_FORWARD
239 ID_BACKWARD
= _core_
.ID_BACKWARD
240 ID_DEFAULT
= _core_
.ID_DEFAULT
241 ID_MORE
= _core_
.ID_MORE
242 ID_SETUP
= _core_
.ID_SETUP
243 ID_RESET
= _core_
.ID_RESET
244 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
245 ID_YESTOALL
= _core_
.ID_YESTOALL
246 ID_NOTOALL
= _core_
.ID_NOTOALL
247 ID_ABORT
= _core_
.ID_ABORT
248 ID_RETRY
= _core_
.ID_RETRY
249 ID_IGNORE
= _core_
.ID_IGNORE
250 ID_ADD
= _core_
.ID_ADD
251 ID_REMOVE
= _core_
.ID_REMOVE
253 ID_DOWN
= _core_
.ID_DOWN
254 ID_HOME
= _core_
.ID_HOME
255 ID_REFRESH
= _core_
.ID_REFRESH
256 ID_STOP
= _core_
.ID_STOP
257 ID_INDEX
= _core_
.ID_INDEX
258 ID_BOLD
= _core_
.ID_BOLD
259 ID_ITALIC
= _core_
.ID_ITALIC
260 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
261 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
262 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
263 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
264 ID_UNDERLINE
= _core_
.ID_UNDERLINE
265 ID_INDENT
= _core_
.ID_INDENT
266 ID_UNINDENT
= _core_
.ID_UNINDENT
267 ID_ZOOM_100
= _core_
.ID_ZOOM_100
268 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
269 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
270 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
271 ID_UNDELETE
= _core_
.ID_UNDELETE
272 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
273 ID_HIGHEST
= _core_
.ID_HIGHEST
276 HIDE_READONLY
= _core_
.HIDE_READONLY
277 OVERWRITE_PROMPT
= _core_
.OVERWRITE_PROMPT
278 FILE_MUST_EXIST
= _core_
.FILE_MUST_EXIST
279 MULTIPLE
= _core_
.MULTIPLE
280 CHANGE_DIR
= _core_
.CHANGE_DIR
281 ACCEL_ALT
= _core_
.ACCEL_ALT
282 ACCEL_CTRL
= _core_
.ACCEL_CTRL
283 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
284 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
285 PD_AUTO_HIDE
= _core_
.PD_AUTO_HIDE
286 PD_APP_MODAL
= _core_
.PD_APP_MODAL
287 PD_CAN_ABORT
= _core_
.PD_CAN_ABORT
288 PD_ELAPSED_TIME
= _core_
.PD_ELAPSED_TIME
289 PD_ESTIMATED_TIME
= _core_
.PD_ESTIMATED_TIME
290 PD_REMAINING_TIME
= _core_
.PD_REMAINING_TIME
291 PD_SMOOTH
= _core_
.PD_SMOOTH
292 PD_CAN_SKIP
= _core_
.PD_CAN_SKIP
293 DD_NEW_DIR_BUTTON
= _core_
.DD_NEW_DIR_BUTTON
294 DD_DEFAULT_STYLE
= _core_
.DD_DEFAULT_STYLE
295 DD_CHANGE_DIR
= _core_
.DD_CHANGE_DIR
296 MENU_TEAROFF
= _core_
.MENU_TEAROFF
297 MB_DOCKABLE
= _core_
.MB_DOCKABLE
298 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
299 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
300 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
301 LI_VERTICAL
= _core_
.LI_VERTICAL
302 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
303 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
304 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
305 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
306 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
307 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
308 MM_TEXT
= _core_
.MM_TEXT
309 MM_LOMETRIC
= _core_
.MM_LOMETRIC
310 MM_HIMETRIC
= _core_
.MM_HIMETRIC
311 MM_LOENGLISH
= _core_
.MM_LOENGLISH
312 MM_HIENGLISH
= _core_
.MM_HIENGLISH
313 MM_TWIPS
= _core_
.MM_TWIPS
314 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
315 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
316 MM_POINTS
= _core_
.MM_POINTS
317 MM_METRIC
= _core_
.MM_METRIC
318 CENTRE
= _core_
.CENTRE
319 CENTER
= _core_
.CENTER
320 HORIZONTAL
= _core_
.HORIZONTAL
321 VERTICAL
= _core_
.VERTICAL
328 BOTTOM
= _core_
.BOTTOM
334 ALIGN_NOT
= _core_
.ALIGN_NOT
335 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
336 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
337 ALIGN_LEFT
= _core_
.ALIGN_LEFT
338 ALIGN_TOP
= _core_
.ALIGN_TOP
339 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
340 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
341 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
342 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
343 ALIGN_CENTER
= _core_
.ALIGN_CENTER
344 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
345 ALIGN_MASK
= _core_
.ALIGN_MASK
346 STRETCH_NOT
= _core_
.STRETCH_NOT
347 SHRINK
= _core_
.SHRINK
349 EXPAND
= _core_
.EXPAND
350 SHAPED
= _core_
.SHAPED
351 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
353 ADJUST_MINSIZE
= _core_
.ADJUST_MINSIZE
354 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
355 BORDER_NONE
= _core_
.BORDER_NONE
356 BORDER_STATIC
= _core_
.BORDER_STATIC
357 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
358 BORDER_RAISED
= _core_
.BORDER_RAISED
359 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
360 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
361 BORDER_MASK
= _core_
.BORDER_MASK
362 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
363 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
364 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
365 DEFAULT
= _core_
.DEFAULT
366 DECORATIVE
= _core_
.DECORATIVE
368 SCRIPT
= _core_
.SCRIPT
370 MODERN
= _core_
.MODERN
371 TELETYPE
= _core_
.TELETYPE
372 VARIABLE
= _core_
.VARIABLE
374 NORMAL
= _core_
.NORMAL
377 ITALIC
= _core_
.ITALIC
381 LONG_DASH
= _core_
.LONG_DASH
382 SHORT_DASH
= _core_
.SHORT_DASH
383 DOT_DASH
= _core_
.DOT_DASH
384 USER_DASH
= _core_
.USER_DASH
385 TRANSPARENT
= _core_
.TRANSPARENT
386 STIPPLE
= _core_
.STIPPLE
387 STIPPLE_MASK
= _core_
.STIPPLE_MASK
388 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
389 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
390 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
391 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
392 CROSS_HATCH
= _core_
.CROSS_HATCH
393 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
394 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
395 JOIN_BEVEL
= _core_
.JOIN_BEVEL
396 JOIN_MITER
= _core_
.JOIN_MITER
397 JOIN_ROUND
= _core_
.JOIN_ROUND
398 CAP_ROUND
= _core_
.CAP_ROUND
399 CAP_PROJECTING
= _core_
.CAP_PROJECTING
400 CAP_BUTT
= _core_
.CAP_BUTT
403 INVERT
= _core_
.INVERT
404 OR_REVERSE
= _core_
.OR_REVERSE
405 AND_REVERSE
= _core_
.AND_REVERSE
408 AND_INVERT
= _core_
.AND_INVERT
412 SRC_INVERT
= _core_
.SRC_INVERT
413 OR_INVERT
= _core_
.OR_INVERT
417 WXK_BACK
= _core_
.WXK_BACK
418 WXK_TAB
= _core_
.WXK_TAB
419 WXK_RETURN
= _core_
.WXK_RETURN
420 WXK_ESCAPE
= _core_
.WXK_ESCAPE
421 WXK_SPACE
= _core_
.WXK_SPACE
422 WXK_DELETE
= _core_
.WXK_DELETE
423 WXK_START
= _core_
.WXK_START
424 WXK_LBUTTON
= _core_
.WXK_LBUTTON
425 WXK_RBUTTON
= _core_
.WXK_RBUTTON
426 WXK_CANCEL
= _core_
.WXK_CANCEL
427 WXK_MBUTTON
= _core_
.WXK_MBUTTON
428 WXK_CLEAR
= _core_
.WXK_CLEAR
429 WXK_SHIFT
= _core_
.WXK_SHIFT
430 WXK_ALT
= _core_
.WXK_ALT
431 WXK_CONTROL
= _core_
.WXK_CONTROL
432 WXK_MENU
= _core_
.WXK_MENU
433 WXK_PAUSE
= _core_
.WXK_PAUSE
434 WXK_CAPITAL
= _core_
.WXK_CAPITAL
435 WXK_PRIOR
= _core_
.WXK_PRIOR
436 WXK_NEXT
= _core_
.WXK_NEXT
437 WXK_END
= _core_
.WXK_END
438 WXK_HOME
= _core_
.WXK_HOME
439 WXK_LEFT
= _core_
.WXK_LEFT
440 WXK_UP
= _core_
.WXK_UP
441 WXK_RIGHT
= _core_
.WXK_RIGHT
442 WXK_DOWN
= _core_
.WXK_DOWN
443 WXK_SELECT
= _core_
.WXK_SELECT
444 WXK_PRINT
= _core_
.WXK_PRINT
445 WXK_EXECUTE
= _core_
.WXK_EXECUTE
446 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
447 WXK_INSERT
= _core_
.WXK_INSERT
448 WXK_HELP
= _core_
.WXK_HELP
449 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
450 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
451 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
452 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
453 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
454 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
455 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
456 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
457 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
458 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
459 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
460 WXK_ADD
= _core_
.WXK_ADD
461 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
462 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
463 WXK_DECIMAL
= _core_
.WXK_DECIMAL
464 WXK_DIVIDE
= _core_
.WXK_DIVIDE
465 WXK_F1
= _core_
.WXK_F1
466 WXK_F2
= _core_
.WXK_F2
467 WXK_F3
= _core_
.WXK_F3
468 WXK_F4
= _core_
.WXK_F4
469 WXK_F5
= _core_
.WXK_F5
470 WXK_F6
= _core_
.WXK_F6
471 WXK_F7
= _core_
.WXK_F7
472 WXK_F8
= _core_
.WXK_F8
473 WXK_F9
= _core_
.WXK_F9
474 WXK_F10
= _core_
.WXK_F10
475 WXK_F11
= _core_
.WXK_F11
476 WXK_F12
= _core_
.WXK_F12
477 WXK_F13
= _core_
.WXK_F13
478 WXK_F14
= _core_
.WXK_F14
479 WXK_F15
= _core_
.WXK_F15
480 WXK_F16
= _core_
.WXK_F16
481 WXK_F17
= _core_
.WXK_F17
482 WXK_F18
= _core_
.WXK_F18
483 WXK_F19
= _core_
.WXK_F19
484 WXK_F20
= _core_
.WXK_F20
485 WXK_F21
= _core_
.WXK_F21
486 WXK_F22
= _core_
.WXK_F22
487 WXK_F23
= _core_
.WXK_F23
488 WXK_F24
= _core_
.WXK_F24
489 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
490 WXK_SCROLL
= _core_
.WXK_SCROLL
491 WXK_PAGEUP
= _core_
.WXK_PAGEUP
492 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
493 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
494 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
495 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
496 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
497 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
498 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
499 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
500 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
501 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
502 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
503 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
504 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
505 WXK_NUMPAD_PRIOR
= _core_
.WXK_NUMPAD_PRIOR
506 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
507 WXK_NUMPAD_NEXT
= _core_
.WXK_NUMPAD_NEXT
508 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
509 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
510 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
511 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
512 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
513 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
514 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
515 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
516 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
517 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
518 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
519 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
520 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
521 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
522 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
523 WXK_COMMAND
= _core_
.WXK_COMMAND
524 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
525 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
526 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
527 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
528 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
529 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
530 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
531 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
532 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
533 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
534 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
535 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
536 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
537 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
538 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
539 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
540 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
541 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
542 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
543 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
544 PAPER_NONE
= _core_
.PAPER_NONE
545 PAPER_LETTER
= _core_
.PAPER_LETTER
546 PAPER_LEGAL
= _core_
.PAPER_LEGAL
547 PAPER_A4
= _core_
.PAPER_A4
548 PAPER_CSHEET
= _core_
.PAPER_CSHEET
549 PAPER_DSHEET
= _core_
.PAPER_DSHEET
550 PAPER_ESHEET
= _core_
.PAPER_ESHEET
551 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
552 PAPER_TABLOID
= _core_
.PAPER_TABLOID
553 PAPER_LEDGER
= _core_
.PAPER_LEDGER
554 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
555 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
556 PAPER_A3
= _core_
.PAPER_A3
557 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
558 PAPER_A5
= _core_
.PAPER_A5
559 PAPER_B4
= _core_
.PAPER_B4
560 PAPER_B5
= _core_
.PAPER_B5
561 PAPER_FOLIO
= _core_
.PAPER_FOLIO
562 PAPER_QUARTO
= _core_
.PAPER_QUARTO
563 PAPER_10X14
= _core_
.PAPER_10X14
564 PAPER_11X17
= _core_
.PAPER_11X17
565 PAPER_NOTE
= _core_
.PAPER_NOTE
566 PAPER_ENV_9
= _core_
.PAPER_ENV_9
567 PAPER_ENV_10
= _core_
.PAPER_ENV_10
568 PAPER_ENV_11
= _core_
.PAPER_ENV_11
569 PAPER_ENV_12
= _core_
.PAPER_ENV_12
570 PAPER_ENV_14
= _core_
.PAPER_ENV_14
571 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
572 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
573 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
574 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
575 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
576 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
577 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
578 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
579 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
580 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
581 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
582 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
583 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
584 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
585 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
586 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
587 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
588 PAPER_9X11
= _core_
.PAPER_9X11
589 PAPER_10X11
= _core_
.PAPER_10X11
590 PAPER_15X11
= _core_
.PAPER_15X11
591 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
592 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
593 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
594 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
595 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
596 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
597 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
598 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
599 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
600 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
601 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
602 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
603 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
604 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
605 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
606 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
607 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
608 PAPER_A2
= _core_
.PAPER_A2
609 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
610 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
611 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
612 PAPER_A6
= _core_
.PAPER_A6
613 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
614 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
615 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
616 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
617 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
618 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
619 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
620 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
621 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
622 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
623 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
624 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
625 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
626 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
627 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
628 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
629 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
630 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
631 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
632 PAPER_12X11
= _core_
.PAPER_12X11
633 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
634 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
635 PAPER_P16K
= _core_
.PAPER_P16K
636 PAPER_P32K
= _core_
.PAPER_P32K
637 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
638 PAPER_PENV_1
= _core_
.PAPER_PENV_1
639 PAPER_PENV_2
= _core_
.PAPER_PENV_2
640 PAPER_PENV_3
= _core_
.PAPER_PENV_3
641 PAPER_PENV_4
= _core_
.PAPER_PENV_4
642 PAPER_PENV_5
= _core_
.PAPER_PENV_5
643 PAPER_PENV_6
= _core_
.PAPER_PENV_6
644 PAPER_PENV_7
= _core_
.PAPER_PENV_7
645 PAPER_PENV_8
= _core_
.PAPER_PENV_8
646 PAPER_PENV_9
= _core_
.PAPER_PENV_9
647 PAPER_PENV_10
= _core_
.PAPER_PENV_10
648 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
649 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
650 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
651 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
652 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
653 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
654 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
655 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
656 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
657 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
658 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
659 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
660 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
661 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
662 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
663 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
664 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
665 ITEM_NORMAL
= _core_
.ITEM_NORMAL
666 ITEM_CHECK
= _core_
.ITEM_CHECK
667 ITEM_RADIO
= _core_
.ITEM_RADIO
668 ITEM_MAX
= _core_
.ITEM_MAX
669 HT_NOWHERE
= _core_
.HT_NOWHERE
670 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
671 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
672 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
673 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
674 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
675 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
676 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
677 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
678 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
679 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
680 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
681 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
682 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
683 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
684 HT_MAX
= _core_
.HT_MAX
685 MOD_NONE
= _core_
.MOD_NONE
686 MOD_ALT
= _core_
.MOD_ALT
687 MOD_CONTROL
= _core_
.MOD_CONTROL
688 MOD_ALTGR
= _core_
.MOD_ALTGR
689 MOD_SHIFT
= _core_
.MOD_SHIFT
690 MOD_META
= _core_
.MOD_META
691 MOD_WIN
= _core_
.MOD_WIN
692 MOD_CMD
= _core_
.MOD_CMD
693 MOD_ALL
= _core_
.MOD_ALL
694 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
695 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
696 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
697 #---------------------------------------------------------------------------
699 class Object(object):
701 The base class for most wx objects, although in wxPython not
702 much functionality is needed nor exposed.
704 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
705 def __init__(self
): raise AttributeError, "No constructor defined"
706 __repr__
= _swig_repr
707 def GetClassName(*args
, **kwargs
):
709 GetClassName(self) -> String
711 Returns the class name of the C++ class using wxRTTI.
713 return _core_
.Object_GetClassName(*args
, **kwargs
)
715 def Destroy(*args
, **kwargs
):
719 Deletes the C++ object this Python object is a proxy for.
721 val
= _core_
.Object_Destroy(*args
, **kwargs
)
725 _core_
.Object_swigregister(Object
)
726 _wxPySetDictionary
= _core_
._wxPySetDictionary
728 EmptyString
= cvar
.EmptyString
730 #---------------------------------------------------------------------------
732 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
733 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
734 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
735 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
736 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
737 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
738 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
739 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
740 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
741 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
742 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
743 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
744 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
745 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
746 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
747 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
748 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
749 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
750 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
751 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
752 CURSOR_NONE
= _core_
.CURSOR_NONE
753 CURSOR_ARROW
= _core_
.CURSOR_ARROW
754 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
755 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
756 CURSOR_CHAR
= _core_
.CURSOR_CHAR
757 CURSOR_CROSS
= _core_
.CURSOR_CROSS
758 CURSOR_HAND
= _core_
.CURSOR_HAND
759 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
760 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
761 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
762 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
763 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
764 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
765 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
766 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
767 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
768 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
769 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
770 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
771 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
772 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
773 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
774 CURSOR_SIZING
= _core_
.CURSOR_SIZING
775 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
776 CURSOR_WAIT
= _core_
.CURSOR_WAIT
777 CURSOR_WATCH
= _core_
.CURSOR_WATCH
778 CURSOR_BLANK
= _core_
.CURSOR_BLANK
779 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
780 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
781 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
782 CURSOR_MAX
= _core_
.CURSOR_MAX
783 #---------------------------------------------------------------------------
787 wx.Size is a useful data structure used to represent the size of
788 something. It simply contains integer width and height
789 properties. In most places in wxPython where a wx.Size is
790 expected a (width, height) tuple can be used instead.
792 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
793 __repr__
= _swig_repr
794 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
795 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
796 x
= width
; y
= height
797 def __init__(self
, *args
, **kwargs
):
799 __init__(self, int w=0, int h=0) -> Size
801 Creates a size object.
803 _core_
.Size_swiginit(self
,_core_
.new_Size(*args
, **kwargs
))
804 __swig_destroy__
= _core_
.delete_Size
805 __del__
= lambda self
: None;
806 def __eq__(*args
, **kwargs
):
808 __eq__(self, PyObject other) -> bool
810 Test for equality of wx.Size objects.
812 return _core_
.Size___eq__(*args
, **kwargs
)
814 def __ne__(*args
, **kwargs
):
816 __ne__(self, PyObject other) -> bool
818 Test for inequality of wx.Size objects.
820 return _core_
.Size___ne__(*args
, **kwargs
)
822 def __add__(*args
, **kwargs
):
824 __add__(self, Size sz) -> Size
826 Add sz's proprties to this and return the result.
828 return _core_
.Size___add__(*args
, **kwargs
)
830 def __sub__(*args
, **kwargs
):
832 __sub__(self, Size sz) -> Size
834 Subtract sz's properties from this and return the result.
836 return _core_
.Size___sub__(*args
, **kwargs
)
838 def IncTo(*args
, **kwargs
):
842 Increments this object so that both of its dimensions are not less
843 than the corresponding dimensions of the size.
845 return _core_
.Size_IncTo(*args
, **kwargs
)
847 def DecTo(*args
, **kwargs
):
851 Decrements this object so that both of its dimensions are not greater
852 than the corresponding dimensions of the size.
854 return _core_
.Size_DecTo(*args
, **kwargs
)
856 def Set(*args
, **kwargs
):
858 Set(self, int w, int h)
860 Set both width and height.
862 return _core_
.Size_Set(*args
, **kwargs
)
864 def SetWidth(*args
, **kwargs
):
865 """SetWidth(self, int w)"""
866 return _core_
.Size_SetWidth(*args
, **kwargs
)
868 def SetHeight(*args
, **kwargs
):
869 """SetHeight(self, int h)"""
870 return _core_
.Size_SetHeight(*args
, **kwargs
)
872 def GetWidth(*args
, **kwargs
):
873 """GetWidth(self) -> int"""
874 return _core_
.Size_GetWidth(*args
, **kwargs
)
876 def GetHeight(*args
, **kwargs
):
877 """GetHeight(self) -> int"""
878 return _core_
.Size_GetHeight(*args
, **kwargs
)
880 def IsFullySpecified(*args
, **kwargs
):
882 IsFullySpecified(self) -> bool
884 Returns True if both components of the size are non-default values.
886 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
888 def SetDefaults(*args
, **kwargs
):
890 SetDefaults(self, Size size)
892 Combine this size with the other one replacing the default components
893 of this object (i.e. equal to -1) with those of the other.
895 return _core_
.Size_SetDefaults(*args
, **kwargs
)
897 def Get(*args
, **kwargs
):
899 Get() -> (width,height)
901 Returns the width and height properties as a tuple.
903 return _core_
.Size_Get(*args
, **kwargs
)
905 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
906 def __str__(self
): return str(self
.Get())
907 def __repr__(self
): return 'wx.Size'+str(self
.Get())
908 def __len__(self
): return len(self
.Get())
909 def __getitem__(self
, index
): return self
.Get()[index
]
910 def __setitem__(self
, index
, val
):
911 if index
== 0: self
.width
= val
912 elif index
== 1: self
.height
= val
913 else: raise IndexError
914 def __nonzero__(self
): return self
.Get() != (0,0)
915 __safe_for_unpickling__
= True
916 def __reduce__(self
): return (wx
.Size
, self
.Get())
918 _core_
.Size_swigregister(Size
)
920 #---------------------------------------------------------------------------
922 class RealPoint(object):
924 A data structure for representing a point or position with floating
925 point x and y properties. In wxPython most places that expect a
926 wx.RealPoint can also accept a (x,y) tuple.
928 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
929 __repr__
= _swig_repr
930 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
931 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
932 def __init__(self
, *args
, **kwargs
):
934 __init__(self, double x=0.0, double y=0.0) -> RealPoint
936 Create a wx.RealPoint object
938 _core_
.RealPoint_swiginit(self
,_core_
.new_RealPoint(*args
, **kwargs
))
939 __swig_destroy__
= _core_
.delete_RealPoint
940 __del__
= lambda self
: None;
941 def __eq__(*args
, **kwargs
):
943 __eq__(self, PyObject other) -> bool
945 Test for equality of wx.RealPoint objects.
947 return _core_
.RealPoint___eq__(*args
, **kwargs
)
949 def __ne__(*args
, **kwargs
):
951 __ne__(self, PyObject other) -> bool
953 Test for inequality of wx.RealPoint objects.
955 return _core_
.RealPoint___ne__(*args
, **kwargs
)
957 def __add__(*args
, **kwargs
):
959 __add__(self, RealPoint pt) -> RealPoint
961 Add pt's proprties to this and return the result.
963 return _core_
.RealPoint___add__(*args
, **kwargs
)
965 def __sub__(*args
, **kwargs
):
967 __sub__(self, RealPoint pt) -> RealPoint
969 Subtract pt's proprties from this and return the result
971 return _core_
.RealPoint___sub__(*args
, **kwargs
)
973 def Set(*args
, **kwargs
):
975 Set(self, double x, double y)
977 Set both the x and y properties
979 return _core_
.RealPoint_Set(*args
, **kwargs
)
981 def Get(*args
, **kwargs
):
985 Return the x and y properties as a tuple.
987 return _core_
.RealPoint_Get(*args
, **kwargs
)
989 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
990 def __str__(self
): return str(self
.Get())
991 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
992 def __len__(self
): return len(self
.Get())
993 def __getitem__(self
, index
): return self
.Get()[index
]
994 def __setitem__(self
, index
, val
):
995 if index
== 0: self
.x
= val
996 elif index
== 1: self
.y
= val
997 else: raise IndexError
998 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
999 __safe_for_unpickling__
= True
1000 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
1002 _core_
.RealPoint_swigregister(RealPoint
)
1004 #---------------------------------------------------------------------------
1006 class Point(object):
1008 A data structure for representing a point or position with integer x
1009 and y properties. Most places in wxPython that expect a wx.Point can
1010 also accept a (x,y) tuple.
1012 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1013 __repr__
= _swig_repr
1014 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1015 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1016 def __init__(self
, *args
, **kwargs
):
1018 __init__(self, int x=0, int y=0) -> Point
1020 Create a wx.Point object
1022 _core_
.Point_swiginit(self
,_core_
.new_Point(*args
, **kwargs
))
1023 __swig_destroy__
= _core_
.delete_Point
1024 __del__
= lambda self
: None;
1025 def __eq__(*args
, **kwargs
):
1027 __eq__(self, PyObject other) -> bool
1029 Test for equality of wx.Point objects.
1031 return _core_
.Point___eq__(*args
, **kwargs
)
1033 def __ne__(*args
, **kwargs
):
1035 __ne__(self, PyObject other) -> bool
1037 Test for inequality of wx.Point objects.
1039 return _core_
.Point___ne__(*args
, **kwargs
)
1041 def __add__(*args
, **kwargs
):
1043 __add__(self, Point pt) -> Point
1045 Add pt's proprties to this and return the result.
1047 return _core_
.Point___add__(*args
, **kwargs
)
1049 def __sub__(*args
, **kwargs
):
1051 __sub__(self, Point pt) -> Point
1053 Subtract pt's proprties from this and return the result
1055 return _core_
.Point___sub__(*args
, **kwargs
)
1057 def __iadd__(*args
, **kwargs
):
1059 __iadd__(self, Point pt) -> Point
1061 Add pt to this object.
1063 return _core_
.Point___iadd__(*args
, **kwargs
)
1065 def __isub__(*args
, **kwargs
):
1067 __isub__(self, Point pt) -> Point
1069 Subtract pt from this object.
1071 return _core_
.Point___isub__(*args
, **kwargs
)
1073 def Set(*args
, **kwargs
):
1075 Set(self, long x, long y)
1077 Set both the x and y properties
1079 return _core_
.Point_Set(*args
, **kwargs
)
1081 def Get(*args
, **kwargs
):
1085 Return the x and y properties as a tuple.
1087 return _core_
.Point_Get(*args
, **kwargs
)
1089 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1090 def __str__(self
): return str(self
.Get())
1091 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1092 def __len__(self
): return len(self
.Get())
1093 def __getitem__(self
, index
): return self
.Get()[index
]
1094 def __setitem__(self
, index
, val
):
1095 if index
== 0: self
.x
= val
1096 elif index
== 1: self
.y
= val
1097 else: raise IndexError
1098 def __nonzero__(self
): return self
.Get() != (0,0)
1099 __safe_for_unpickling__
= True
1100 def __reduce__(self
): return (wx
.Point
, self
.Get())
1102 _core_
.Point_swigregister(Point
)
1104 #---------------------------------------------------------------------------
1108 A class for representing and manipulating rectangles. It has x, y,
1109 width and height properties. In wxPython most palces that expect a
1110 wx.Rect can also accept a (x,y,width,height) tuple.
1112 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1113 __repr__
= _swig_repr
1114 def __init__(self
, *args
, **kwargs
):
1116 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1118 Create a new Rect object.
1120 _core_
.Rect_swiginit(self
,_core_
.new_Rect(*args
, **kwargs
))
1121 __swig_destroy__
= _core_
.delete_Rect
1122 __del__
= lambda self
: None;
1123 def GetX(*args
, **kwargs
):
1124 """GetX(self) -> int"""
1125 return _core_
.Rect_GetX(*args
, **kwargs
)
1127 def SetX(*args
, **kwargs
):
1128 """SetX(self, int x)"""
1129 return _core_
.Rect_SetX(*args
, **kwargs
)
1131 def GetY(*args
, **kwargs
):
1132 """GetY(self) -> int"""
1133 return _core_
.Rect_GetY(*args
, **kwargs
)
1135 def SetY(*args
, **kwargs
):
1136 """SetY(self, int y)"""
1137 return _core_
.Rect_SetY(*args
, **kwargs
)
1139 def GetWidth(*args
, **kwargs
):
1140 """GetWidth(self) -> int"""
1141 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1143 def SetWidth(*args
, **kwargs
):
1144 """SetWidth(self, int w)"""
1145 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1147 def GetHeight(*args
, **kwargs
):
1148 """GetHeight(self) -> int"""
1149 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1151 def SetHeight(*args
, **kwargs
):
1152 """SetHeight(self, int h)"""
1153 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1155 def GetPosition(*args
, **kwargs
):
1156 """GetPosition(self) -> Point"""
1157 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1159 def SetPosition(*args
, **kwargs
):
1160 """SetPosition(self, Point p)"""
1161 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1163 def GetSize(*args
, **kwargs
):
1164 """GetSize(self) -> Size"""
1165 return _core_
.Rect_GetSize(*args
, **kwargs
)
1167 def SetSize(*args
, **kwargs
):
1168 """SetSize(self, Size s)"""
1169 return _core_
.Rect_SetSize(*args
, **kwargs
)
1171 def IsEmpty(*args
, **kwargs
):
1172 """IsEmpty(self) -> bool"""
1173 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1175 def GetTopLeft(*args
, **kwargs
):
1176 """GetTopLeft(self) -> Point"""
1177 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1179 def SetTopLeft(*args
, **kwargs
):
1180 """SetTopLeft(self, Point p)"""
1181 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1183 def GetBottomRight(*args
, **kwargs
):
1184 """GetBottomRight(self) -> Point"""
1185 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1187 def SetBottomRight(*args
, **kwargs
):
1188 """SetBottomRight(self, Point p)"""
1189 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1191 def GetLeft(*args
, **kwargs
):
1192 """GetLeft(self) -> int"""
1193 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1195 def GetTop(*args
, **kwargs
):
1196 """GetTop(self) -> int"""
1197 return _core_
.Rect_GetTop(*args
, **kwargs
)
1199 def GetBottom(*args
, **kwargs
):
1200 """GetBottom(self) -> int"""
1201 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1203 def GetRight(*args
, **kwargs
):
1204 """GetRight(self) -> int"""
1205 return _core_
.Rect_GetRight(*args
, **kwargs
)
1207 def SetLeft(*args
, **kwargs
):
1208 """SetLeft(self, int left)"""
1209 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1211 def SetRight(*args
, **kwargs
):
1212 """SetRight(self, int right)"""
1213 return _core_
.Rect_SetRight(*args
, **kwargs
)
1215 def SetTop(*args
, **kwargs
):
1216 """SetTop(self, int top)"""
1217 return _core_
.Rect_SetTop(*args
, **kwargs
)
1219 def SetBottom(*args
, **kwargs
):
1220 """SetBottom(self, int bottom)"""
1221 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1223 position
= property(GetPosition
, SetPosition
)
1224 size
= property(GetSize
, SetSize
)
1225 left
= property(GetLeft
, SetLeft
)
1226 right
= property(GetRight
, SetRight
)
1227 top
= property(GetTop
, SetTop
)
1228 bottom
= property(GetBottom
, SetBottom
)
1230 def Inflate(*args
, **kwargs
):
1232 Inflate(self, int dx, int dy) -> Rect
1234 Increases the size of the rectangle.
1236 The left border is moved farther left and the right border is moved
1237 farther right by ``dx``. The upper border is moved farther up and the
1238 bottom border is moved farther down by ``dy``. (Note the the width and
1239 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1240 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1241 opposite happens: the rectangle size decreases in the respective
1244 The change is made to the rectangle inplace, if instead you need a
1245 copy that is inflated, preserving the original then make the copy
1248 copy = wx.Rect(*original)
1253 return _core_
.Rect_Inflate(*args
, **kwargs
)
1255 def Deflate(*args
, **kwargs
):
1257 Deflate(self, int dx, int dy) -> Rect
1259 Decrease the rectangle size. This method is the opposite of `Inflate`
1260 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1261 `Inflate` for a full description.
1263 return _core_
.Rect_Deflate(*args
, **kwargs
)
1265 def OffsetXY(*args
, **kwargs
):
1267 OffsetXY(self, int dx, int dy)
1269 Moves the rectangle by the specified offset. If dx is positive, the
1270 rectangle is moved to the right, if dy is positive, it is moved to the
1271 bottom, otherwise it is moved to the left or top respectively.
1273 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1275 def Offset(*args
, **kwargs
):
1277 Offset(self, Point pt)
1279 Same as `OffsetXY` but uses dx,dy from Point
1281 return _core_
.Rect_Offset(*args
, **kwargs
)
1283 def Intersect(*args
, **kwargs
):
1285 Intersect(self, Rect rect) -> Rect
1287 Returns the intersectsion of this rectangle and rect.
1289 return _core_
.Rect_Intersect(*args
, **kwargs
)
1291 def Union(*args
, **kwargs
):
1293 Union(self, Rect rect) -> Rect
1295 Returns the union of this rectangle and rect.
1297 return _core_
.Rect_Union(*args
, **kwargs
)
1299 def __add__(*args
, **kwargs
):
1301 __add__(self, Rect rect) -> Rect
1303 Add the properties of rect to this rectangle and return the result.
1305 return _core_
.Rect___add__(*args
, **kwargs
)
1307 def __iadd__(*args
, **kwargs
):
1309 __iadd__(self, Rect rect) -> Rect
1311 Add the properties of rect to this rectangle, updating this rectangle.
1313 return _core_
.Rect___iadd__(*args
, **kwargs
)
1315 def __eq__(*args
, **kwargs
):
1317 __eq__(self, PyObject other) -> bool
1319 Test for equality of wx.Rect objects.
1321 return _core_
.Rect___eq__(*args
, **kwargs
)
1323 def __ne__(*args
, **kwargs
):
1325 __ne__(self, PyObject other) -> bool
1327 Test for inequality of wx.Rect objects.
1329 return _core_
.Rect___ne__(*args
, **kwargs
)
1331 def InsideXY(*args
, **kwargs
):
1333 InsideXY(self, int x, int y) -> bool
1335 Return True if the point is (not strcitly) inside the rect.
1337 return _core_
.Rect_InsideXY(*args
, **kwargs
)
1339 def Inside(*args
, **kwargs
):
1341 Inside(self, Point pt) -> bool
1343 Return True if the point is (not strcitly) inside the rect.
1345 return _core_
.Rect_Inside(*args
, **kwargs
)
1347 def Intersects(*args
, **kwargs
):
1349 Intersects(self, Rect rect) -> bool
1351 Returns True if the rectangles have a non empty intersection.
1353 return _core_
.Rect_Intersects(*args
, **kwargs
)
1355 def CenterIn(*args
, **kwargs
):
1357 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1359 Center this rectangle within the one passed to the method, which is
1360 usually, but not necessarily, the larger one.
1362 return _core_
.Rect_CenterIn(*args
, **kwargs
)
1365 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1366 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1367 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1368 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1369 def Set(*args
, **kwargs
):
1371 Set(self, int x=0, int y=0, int width=0, int height=0)
1373 Set all rectangle properties.
1375 return _core_
.Rect_Set(*args
, **kwargs
)
1377 def Get(*args
, **kwargs
):
1379 Get() -> (x,y,width,height)
1381 Return the rectangle properties as a tuple.
1383 return _core_
.Rect_Get(*args
, **kwargs
)
1385 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1386 def __str__(self
): return str(self
.Get())
1387 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1388 def __len__(self
): return len(self
.Get())
1389 def __getitem__(self
, index
): return self
.Get()[index
]
1390 def __setitem__(self
, index
, val
):
1391 if index
== 0: self
.x
= val
1392 elif index
== 1: self
.y
= val
1393 elif index
== 2: self
.width
= val
1394 elif index
== 3: self
.height
= val
1395 else: raise IndexError
1396 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1397 __safe_for_unpickling__
= True
1398 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1400 _core_
.Rect_swigregister(Rect
)
1402 def RectPP(*args
, **kwargs
):
1404 RectPP(Point topLeft, Point bottomRight) -> Rect
1406 Create a new Rect object from Points representing two corners.
1408 val
= _core_
.new_RectPP(*args
, **kwargs
)
1411 def RectPS(*args
, **kwargs
):
1413 RectPS(Point pos, Size size) -> Rect
1415 Create a new Rect from a position and size.
1417 val
= _core_
.new_RectPS(*args
, **kwargs
)
1420 def RectS(*args
, **kwargs
):
1422 RectS(Size size) -> Rect
1424 Create a new Rect from a size only.
1426 val
= _core_
.new_RectS(*args
, **kwargs
)
1430 def IntersectRect(*args
, **kwargs
):
1432 IntersectRect(Rect r1, Rect r2) -> Rect
1434 Calculate and return the intersection of r1 and r2.
1436 return _core_
.IntersectRect(*args
, **kwargs
)
1437 #---------------------------------------------------------------------------
1439 class Point2D(object):
1441 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1442 with floating point values.
1444 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1445 __repr__
= _swig_repr
1446 def __init__(self
, *args
, **kwargs
):
1448 __init__(self, double x=0.0, double y=0.0) -> Point2D
1450 Create a w.Point2D object.
1452 _core_
.Point2D_swiginit(self
,_core_
.new_Point2D(*args
, **kwargs
))
1453 def GetFloor(*args
, **kwargs
):
1459 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1461 def GetRounded(*args
, **kwargs
):
1463 GetRounded() -> (x,y)
1467 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1469 def GetVectorLength(*args
, **kwargs
):
1470 """GetVectorLength(self) -> double"""
1471 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1473 def GetVectorAngle(*args
, **kwargs
):
1474 """GetVectorAngle(self) -> double"""
1475 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1477 def SetVectorLength(*args
, **kwargs
):
1478 """SetVectorLength(self, double length)"""
1479 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1481 def SetVectorAngle(*args
, **kwargs
):
1482 """SetVectorAngle(self, double degrees)"""
1483 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1485 def SetPolarCoordinates(self
, angle
, length
):
1486 self
.SetVectorLength(length
)
1487 self
.SetVectorAngle(angle
)
1488 def Normalize(self
):
1489 self
.SetVectorLength(1.0)
1491 def GetDistance(*args
, **kwargs
):
1492 """GetDistance(self, Point2D pt) -> double"""
1493 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1495 def GetDistanceSquare(*args
, **kwargs
):
1496 """GetDistanceSquare(self, Point2D pt) -> double"""
1497 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1499 def GetDotProduct(*args
, **kwargs
):
1500 """GetDotProduct(self, Point2D vec) -> double"""
1501 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1503 def GetCrossProduct(*args
, **kwargs
):
1504 """GetCrossProduct(self, Point2D vec) -> double"""
1505 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1507 def __neg__(*args
, **kwargs
):
1509 __neg__(self) -> Point2D
1511 the reflection of this point
1513 return _core_
.Point2D___neg__(*args
, **kwargs
)
1515 def __iadd__(*args
, **kwargs
):
1516 """__iadd__(self, Point2D pt) -> Point2D"""
1517 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1519 def __isub__(*args
, **kwargs
):
1520 """__isub__(self, Point2D pt) -> Point2D"""
1521 return _core_
.Point2D___isub__(*args
, **kwargs
)
1523 def __imul__(*args
, **kwargs
):
1524 """__imul__(self, Point2D pt) -> Point2D"""
1525 return _core_
.Point2D___imul__(*args
, **kwargs
)
1527 def __idiv__(*args
, **kwargs
):
1528 """__idiv__(self, Point2D pt) -> Point2D"""
1529 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1531 def __eq__(*args
, **kwargs
):
1533 __eq__(self, PyObject other) -> bool
1535 Test for equality of wx.Point2D objects.
1537 return _core_
.Point2D___eq__(*args
, **kwargs
)
1539 def __ne__(*args
, **kwargs
):
1541 __ne__(self, PyObject other) -> bool
1543 Test for inequality of wx.Point2D objects.
1545 return _core_
.Point2D___ne__(*args
, **kwargs
)
1547 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1548 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1549 def Set(*args
, **kwargs
):
1550 """Set(self, double x=0, double y=0)"""
1551 return _core_
.Point2D_Set(*args
, **kwargs
)
1553 def Get(*args
, **kwargs
):
1557 Return x and y properties as a tuple.
1559 return _core_
.Point2D_Get(*args
, **kwargs
)
1561 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1562 def __str__(self
): return str(self
.Get())
1563 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1564 def __len__(self
): return len(self
.Get())
1565 def __getitem__(self
, index
): return self
.Get()[index
]
1566 def __setitem__(self
, index
, val
):
1567 if index
== 0: self
.x
= val
1568 elif index
== 1: self
.y
= val
1569 else: raise IndexError
1570 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1571 __safe_for_unpickling__
= True
1572 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1574 _core_
.Point2D_swigregister(Point2D
)
1576 def Point2DCopy(*args
, **kwargs
):
1578 Point2DCopy(Point2D pt) -> Point2D
1580 Create a w.Point2D object.
1582 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1585 def Point2DFromPoint(*args
, **kwargs
):
1587 Point2DFromPoint(Point pt) -> Point2D
1589 Create a w.Point2D object.
1591 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1594 #---------------------------------------------------------------------------
1596 FromStart
= _core_
.FromStart
1597 FromCurrent
= _core_
.FromCurrent
1598 FromEnd
= _core_
.FromEnd
1599 class InputStream(object):
1600 """Proxy of C++ InputStream class"""
1601 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1602 __repr__
= _swig_repr
1603 def __init__(self
, *args
, **kwargs
):
1604 """__init__(self, PyObject p) -> InputStream"""
1605 _core_
.InputStream_swiginit(self
,_core_
.new_InputStream(*args
, **kwargs
))
1606 __swig_destroy__
= _core_
.delete_InputStream
1607 __del__
= lambda self
: None;
1608 def close(*args
, **kwargs
):
1610 return _core_
.InputStream_close(*args
, **kwargs
)
1612 def flush(*args
, **kwargs
):
1614 return _core_
.InputStream_flush(*args
, **kwargs
)
1616 def eof(*args
, **kwargs
):
1617 """eof(self) -> bool"""
1618 return _core_
.InputStream_eof(*args
, **kwargs
)
1620 def read(*args
, **kwargs
):
1621 """read(self, int size=-1) -> PyObject"""
1622 return _core_
.InputStream_read(*args
, **kwargs
)
1624 def readline(*args
, **kwargs
):
1625 """readline(self, int size=-1) -> PyObject"""
1626 return _core_
.InputStream_readline(*args
, **kwargs
)
1628 def readlines(*args
, **kwargs
):
1629 """readlines(self, int sizehint=-1) -> PyObject"""
1630 return _core_
.InputStream_readlines(*args
, **kwargs
)
1632 def seek(*args
, **kwargs
):
1633 """seek(self, int offset, int whence=0)"""
1634 return _core_
.InputStream_seek(*args
, **kwargs
)
1636 def tell(*args
, **kwargs
):
1637 """tell(self) -> int"""
1638 return _core_
.InputStream_tell(*args
, **kwargs
)
1640 def Peek(*args
, **kwargs
):
1641 """Peek(self) -> char"""
1642 return _core_
.InputStream_Peek(*args
, **kwargs
)
1644 def GetC(*args
, **kwargs
):
1645 """GetC(self) -> char"""
1646 return _core_
.InputStream_GetC(*args
, **kwargs
)
1648 def LastRead(*args
, **kwargs
):
1649 """LastRead(self) -> size_t"""
1650 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1652 def CanRead(*args
, **kwargs
):
1653 """CanRead(self) -> bool"""
1654 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1656 def Eof(*args
, **kwargs
):
1657 """Eof(self) -> bool"""
1658 return _core_
.InputStream_Eof(*args
, **kwargs
)
1660 def Ungetch(*args
, **kwargs
):
1661 """Ungetch(self, char c) -> bool"""
1662 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1664 def SeekI(*args
, **kwargs
):
1665 """SeekI(self, long pos, int mode=FromStart) -> long"""
1666 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1668 def TellI(*args
, **kwargs
):
1669 """TellI(self) -> long"""
1670 return _core_
.InputStream_TellI(*args
, **kwargs
)
1672 _core_
.InputStream_swigregister(InputStream
)
1673 DefaultPosition
= cvar
.DefaultPosition
1674 DefaultSize
= cvar
.DefaultSize
1676 class OutputStream(object):
1677 """Proxy of C++ OutputStream class"""
1678 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1679 def __init__(self
): raise AttributeError, "No constructor defined"
1680 __repr__
= _swig_repr
1681 def write(*args
, **kwargs
):
1682 """write(self, PyObject obj)"""
1683 return _core_
.OutputStream_write(*args
, **kwargs
)
1685 def LastWrite(*args
, **kwargs
):
1686 """LastWrite(self) -> size_t"""
1687 return _core_
.OutputStream_LastWrite(*args
, **kwargs
)
1689 _core_
.OutputStream_swigregister(OutputStream
)
1691 #---------------------------------------------------------------------------
1693 class FSFile(Object
):
1694 """Proxy of C++ FSFile class"""
1695 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1696 __repr__
= _swig_repr
1697 def __init__(self
, *args
, **kwargs
):
1699 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1700 DateTime modif) -> FSFile
1702 _core_
.FSFile_swiginit(self
,_core_
.new_FSFile(*args
, **kwargs
))
1703 self
.thisown
= 0 # It will normally be deleted by the user of the wx.FileSystem
1705 __swig_destroy__
= _core_
.delete_FSFile
1706 __del__
= lambda self
: None;
1707 def GetStream(*args
, **kwargs
):
1708 """GetStream(self) -> InputStream"""
1709 return _core_
.FSFile_GetStream(*args
, **kwargs
)
1711 def GetMimeType(*args
, **kwargs
):
1712 """GetMimeType(self) -> String"""
1713 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
1715 def GetLocation(*args
, **kwargs
):
1716 """GetLocation(self) -> String"""
1717 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
1719 def GetAnchor(*args
, **kwargs
):
1720 """GetAnchor(self) -> String"""
1721 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
1723 def GetModificationTime(*args
, **kwargs
):
1724 """GetModificationTime(self) -> DateTime"""
1725 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
1727 _core_
.FSFile_swigregister(FSFile
)
1729 class CPPFileSystemHandler(object):
1730 """Proxy of C++ CPPFileSystemHandler class"""
1731 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1732 def __init__(self
): raise AttributeError, "No constructor defined"
1733 __repr__
= _swig_repr
1734 __swig_destroy__
= _core_
.delete_CPPFileSystemHandler
1735 __del__
= lambda self
: None;
1736 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandler
)
1738 class FileSystemHandler(CPPFileSystemHandler
):
1739 """Proxy of C++ FileSystemHandler class"""
1740 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1741 __repr__
= _swig_repr
1742 def __init__(self
, *args
, **kwargs
):
1743 """__init__(self) -> FileSystemHandler"""
1744 _core_
.FileSystemHandler_swiginit(self
,_core_
.new_FileSystemHandler(*args
, **kwargs
))
1745 self
._setCallbackInfo
(self
, FileSystemHandler
)
1747 def _setCallbackInfo(*args
, **kwargs
):
1748 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1749 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
1751 def CanOpen(*args
, **kwargs
):
1752 """CanOpen(self, String location) -> bool"""
1753 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
1755 def OpenFile(*args
, **kwargs
):
1756 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1757 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
1759 def FindFirst(*args
, **kwargs
):
1760 """FindFirst(self, String spec, int flags=0) -> String"""
1761 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
1763 def FindNext(*args
, **kwargs
):
1764 """FindNext(self) -> String"""
1765 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
1767 def GetProtocol(*args
, **kwargs
):
1768 """GetProtocol(self, String location) -> String"""
1769 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
1771 def GetLeftLocation(*args
, **kwargs
):
1772 """GetLeftLocation(self, String location) -> String"""
1773 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
1775 def GetAnchor(*args
, **kwargs
):
1776 """GetAnchor(self, String location) -> String"""
1777 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
1779 def GetRightLocation(*args
, **kwargs
):
1780 """GetRightLocation(self, String location) -> String"""
1781 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
1783 def GetMimeTypeFromExt(*args
, **kwargs
):
1784 """GetMimeTypeFromExt(self, String location) -> String"""
1785 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
1787 _core_
.FileSystemHandler_swigregister(FileSystemHandler
)
1789 class FileSystem(Object
):
1790 """Proxy of C++ FileSystem class"""
1791 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1792 __repr__
= _swig_repr
1793 def __init__(self
, *args
, **kwargs
):
1794 """__init__(self) -> FileSystem"""
1795 _core_
.FileSystem_swiginit(self
,_core_
.new_FileSystem(*args
, **kwargs
))
1796 __swig_destroy__
= _core_
.delete_FileSystem
1797 __del__
= lambda self
: None;
1798 def ChangePathTo(*args
, **kwargs
):
1799 """ChangePathTo(self, String location, bool is_dir=False)"""
1800 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
1802 def GetPath(*args
, **kwargs
):
1803 """GetPath(self) -> String"""
1804 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
1806 def OpenFile(*args
, **kwargs
):
1807 """OpenFile(self, String location) -> FSFile"""
1808 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
1810 def FindFirst(*args
, **kwargs
):
1811 """FindFirst(self, String spec, int flags=0) -> String"""
1812 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
1814 def FindNext(*args
, **kwargs
):
1815 """FindNext(self) -> String"""
1816 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
1818 def AddHandler(*args
, **kwargs
):
1819 """AddHandler(CPPFileSystemHandler handler)"""
1820 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1822 AddHandler
= staticmethod(AddHandler
)
1823 def CleanUpHandlers(*args
, **kwargs
):
1824 """CleanUpHandlers()"""
1825 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1827 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
1828 def FileNameToURL(*args
, **kwargs
):
1829 """FileNameToURL(String filename) -> String"""
1830 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1832 FileNameToURL
= staticmethod(FileNameToURL
)
1833 def URLToFileName(*args
, **kwargs
):
1834 """URLToFileName(String url) -> String"""
1835 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1837 URLToFileName
= staticmethod(URLToFileName
)
1838 _core_
.FileSystem_swigregister(FileSystem
)
1840 def FileSystem_AddHandler(*args
, **kwargs
):
1841 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1842 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1844 def FileSystem_CleanUpHandlers(*args
):
1845 """FileSystem_CleanUpHandlers()"""
1846 return _core_
.FileSystem_CleanUpHandlers(*args
)
1848 def FileSystem_FileNameToURL(*args
, **kwargs
):
1849 """FileSystem_FileNameToURL(String filename) -> String"""
1850 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1852 def FileSystem_URLToFileName(*args
, **kwargs
):
1853 """FileSystem_URLToFileName(String url) -> String"""
1854 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1856 class InternetFSHandler(CPPFileSystemHandler
):
1857 """Proxy of C++ InternetFSHandler class"""
1858 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1859 __repr__
= _swig_repr
1860 def __init__(self
, *args
, **kwargs
):
1861 """__init__(self) -> InternetFSHandler"""
1862 _core_
.InternetFSHandler_swiginit(self
,_core_
.new_InternetFSHandler(*args
, **kwargs
))
1863 def CanOpen(*args
, **kwargs
):
1864 """CanOpen(self, String location) -> bool"""
1865 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
1867 def OpenFile(*args
, **kwargs
):
1868 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1869 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
1871 _core_
.InternetFSHandler_swigregister(InternetFSHandler
)
1873 class ZipFSHandler(CPPFileSystemHandler
):
1874 """Proxy of C++ ZipFSHandler class"""
1875 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1876 __repr__
= _swig_repr
1877 def __init__(self
, *args
, **kwargs
):
1878 """__init__(self) -> ZipFSHandler"""
1879 _core_
.ZipFSHandler_swiginit(self
,_core_
.new_ZipFSHandler(*args
, **kwargs
))
1880 def CanOpen(*args
, **kwargs
):
1881 """CanOpen(self, String location) -> bool"""
1882 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
1884 def OpenFile(*args
, **kwargs
):
1885 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1886 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
1888 def FindFirst(*args
, **kwargs
):
1889 """FindFirst(self, String spec, int flags=0) -> String"""
1890 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
1892 def FindNext(*args
, **kwargs
):
1893 """FindNext(self) -> String"""
1894 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
1896 _core_
.ZipFSHandler_swigregister(ZipFSHandler
)
1899 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
1900 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1901 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
1903 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
1904 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1905 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
1907 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
1908 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1909 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
1910 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
1912 Add 'file' to the memory filesystem. The dataItem parameter can
1913 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1914 arbitrary data. If a bitmap or image is used then the imgType
1915 parameter should specify what kind of image file it should be
1916 written as, wx.BITMAP_TYPE_PNG, etc.
1918 if isinstance(dataItem
, wx
.Image
):
1919 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
1920 elif isinstance(dataItem
, wx
.Bitmap
):
1921 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
1922 elif type(dataItem
) == str:
1923 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
1925 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1927 class MemoryFSHandler(CPPFileSystemHandler
):
1928 """Proxy of C++ MemoryFSHandler class"""
1929 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1930 __repr__
= _swig_repr
1931 def __init__(self
, *args
, **kwargs
):
1932 """__init__(self) -> MemoryFSHandler"""
1933 _core_
.MemoryFSHandler_swiginit(self
,_core_
.new_MemoryFSHandler(*args
, **kwargs
))
1934 def RemoveFile(*args
, **kwargs
):
1935 """RemoveFile(String filename)"""
1936 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1938 RemoveFile
= staticmethod(RemoveFile
)
1939 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
1940 def CanOpen(*args
, **kwargs
):
1941 """CanOpen(self, String location) -> bool"""
1942 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
1944 def OpenFile(*args
, **kwargs
):
1945 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1946 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
1948 def FindFirst(*args
, **kwargs
):
1949 """FindFirst(self, String spec, int flags=0) -> String"""
1950 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
1952 def FindNext(*args
, **kwargs
):
1953 """FindNext(self) -> String"""
1954 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
1956 _core_
.MemoryFSHandler_swigregister(MemoryFSHandler
)
1958 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
1959 """MemoryFSHandler_RemoveFile(String filename)"""
1960 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1962 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
1963 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
1964 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
1965 #---------------------------------------------------------------------------
1967 class ImageHandler(Object
):
1969 This is the base class for implementing image file loading/saving, and
1970 image creation from data. It is used within `wx.Image` and is not
1971 normally seen by the application.
1973 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1974 def __init__(self
): raise AttributeError, "No constructor defined"
1975 __repr__
= _swig_repr
1976 def GetName(*args
, **kwargs
):
1977 """GetName(self) -> String"""
1978 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
1980 def GetExtension(*args
, **kwargs
):
1981 """GetExtension(self) -> String"""
1982 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
1984 def GetType(*args
, **kwargs
):
1985 """GetType(self) -> long"""
1986 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
1988 def GetMimeType(*args
, **kwargs
):
1989 """GetMimeType(self) -> String"""
1990 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
1992 def CanRead(*args
, **kwargs
):
1993 """CanRead(self, String name) -> bool"""
1994 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
1996 def SetName(*args
, **kwargs
):
1997 """SetName(self, String name)"""
1998 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2000 def SetExtension(*args
, **kwargs
):
2001 """SetExtension(self, String extension)"""
2002 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2004 def SetType(*args
, **kwargs
):
2005 """SetType(self, long type)"""
2006 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2008 def SetMimeType(*args
, **kwargs
):
2009 """SetMimeType(self, String mimetype)"""
2010 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2012 _core_
.ImageHandler_swigregister(ImageHandler
)
2014 class PyImageHandler(ImageHandler
):
2016 This is the base class for implementing image file loading/saving, and
2017 image creation from data, all written in Python. To create a custom
2018 image handler derive a new class from wx.PyImageHandler and provide
2019 the following methods::
2021 def DoCanRead(self, stream) --> bool
2022 '''Check if this handler can read the image on the stream'''
2024 def LoadFile(self, image, stream, verbose, index) --> bool
2025 '''Load image data from the stream and load it into image.'''
2027 def SaveFile(self, image, stream, verbose) --> bool
2028 '''Save the iamge data in image to the stream using
2029 this handler's image file format.'''
2031 def GetImageCount(self, stream) --> int
2032 '''If this image format can hold more than one image,
2033 how many does the image on the stream have?'''
2035 To activate your handler create an instance of it and pass it to
2036 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2037 `SetExtension` from your constructor.
2040 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2041 __repr__
= _swig_repr
2042 def __init__(self
, *args
, **kwargs
):
2044 __init__(self) -> PyImageHandler
2046 This is the base class for implementing image file loading/saving, and
2047 image creation from data, all written in Python. To create a custom
2048 image handler derive a new class from wx.PyImageHandler and provide
2049 the following methods::
2051 def DoCanRead(self, stream) --> bool
2052 '''Check if this handler can read the image on the stream'''
2054 def LoadFile(self, image, stream, verbose, index) --> bool
2055 '''Load image data from the stream and load it into image.'''
2057 def SaveFile(self, image, stream, verbose) --> bool
2058 '''Save the iamge data in image to the stream using
2059 this handler's image file format.'''
2061 def GetImageCount(self, stream) --> int
2062 '''If this image format can hold more than one image,
2063 how many does the image on the stream have?'''
2065 To activate your handler create an instance of it and pass it to
2066 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2067 `SetExtension` from your constructor.
2070 _core_
.PyImageHandler_swiginit(self
,_core_
.new_PyImageHandler(*args
, **kwargs
))
2073 def _SetSelf(*args
, **kwargs
):
2074 """_SetSelf(self, PyObject self)"""
2075 return _core_
.PyImageHandler__SetSelf(*args
, **kwargs
)
2077 _core_
.PyImageHandler_swigregister(PyImageHandler
)
2079 class ImageHistogram(object):
2080 """Proxy of C++ ImageHistogram class"""
2081 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2082 __repr__
= _swig_repr
2083 def __init__(self
, *args
, **kwargs
):
2084 """__init__(self) -> ImageHistogram"""
2085 _core_
.ImageHistogram_swiginit(self
,_core_
.new_ImageHistogram(*args
, **kwargs
))
2086 def MakeKey(*args
, **kwargs
):
2088 MakeKey(byte r, byte g, byte b) -> unsigned long
2090 Get the key in the histogram for the given RGB values
2092 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2094 MakeKey
= staticmethod(MakeKey
)
2095 def FindFirstUnusedColour(*args
, **kwargs
):
2097 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2099 Find first colour that is not used in the image and has higher RGB
2100 values than startR, startG, startB. Returns a tuple consisting of a
2101 success flag and rgb values.
2103 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2105 def GetCount(*args
, **kwargs
):
2107 GetCount(self, unsigned long key) -> unsigned long
2109 Returns the pixel count for the given key. Use `MakeKey` to create a
2110 key value from a RGB tripple.
2112 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2114 def GetCountRGB(*args
, **kwargs
):
2116 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2118 Returns the pixel count for the given RGB values.
2120 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2122 def GetCountColour(*args
, **kwargs
):
2124 GetCountColour(self, Colour colour) -> unsigned long
2126 Returns the pixel count for the given `wx.Colour` value.
2128 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2130 _core_
.ImageHistogram_swigregister(ImageHistogram
)
2132 def ImageHistogram_MakeKey(*args
, **kwargs
):
2134 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2136 Get the key in the histogram for the given RGB values
2138 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2140 class Image_RGBValue(object):
2142 An object that contains values for red, green and blue which represent
2143 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2144 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2147 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2148 __repr__
= _swig_repr
2149 def __init__(self
, *args
, **kwargs
):
2151 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2155 _core_
.Image_RGBValue_swiginit(self
,_core_
.new_Image_RGBValue(*args
, **kwargs
))
2156 red
= property(_core_
.Image_RGBValue_red_get
, _core_
.Image_RGBValue_red_set
)
2157 green
= property(_core_
.Image_RGBValue_green_get
, _core_
.Image_RGBValue_green_set
)
2158 blue
= property(_core_
.Image_RGBValue_blue_get
, _core_
.Image_RGBValue_blue_set
)
2159 _core_
.Image_RGBValue_swigregister(Image_RGBValue
)
2161 class Image_HSVValue(object):
2163 An object that contains values for hue, saturation and value which
2164 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2165 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2168 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2169 __repr__
= _swig_repr
2170 def __init__(self
, *args
, **kwargs
):
2172 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2176 _core_
.Image_HSVValue_swiginit(self
,_core_
.new_Image_HSVValue(*args
, **kwargs
))
2177 hue
= property(_core_
.Image_HSVValue_hue_get
, _core_
.Image_HSVValue_hue_set
)
2178 saturation
= property(_core_
.Image_HSVValue_saturation_get
, _core_
.Image_HSVValue_saturation_set
)
2179 value
= property(_core_
.Image_HSVValue_value_get
, _core_
.Image_HSVValue_value_set
)
2180 _core_
.Image_HSVValue_swigregister(Image_HSVValue
)
2182 class Image(Object
):
2184 A platform-independent image class. An image can be created from
2185 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2186 variety of formats. Functions are available to set and get image
2187 bits, so it can be used for basic image manipulation.
2189 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2190 platform-specific `wx.Bitmap` object must be created from it using the
2191 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2192 device context, using `wx.DC.DrawBitmap`.
2194 One colour value of the image may be used as a mask colour which will
2195 lead to the automatic creation of a `wx.Mask` object associated to the
2198 wx.Image supports alpha channel data, that is in addition to a byte
2199 for the red, green and blue colour components for each pixel it also
2200 stores a byte representing the pixel opacity. An alpha value of 0
2201 corresponds to a transparent pixel (null opacity) while a value of 255
2202 means that the pixel is 100% opaque.
2204 Unlike RGB data, not all images have an alpha channel and before using
2205 `GetAlpha` you should check if this image contains an alpha channel
2206 with `HasAlpha`. Note that currently only images loaded from PNG files
2207 with transparency information will have an alpha channel.
2209 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2210 __repr__
= _swig_repr
2211 def __init__(self
, *args
, **kwargs
):
2213 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2215 Loads an image from a file.
2217 _core_
.Image_swiginit(self
,_core_
.new_Image(*args
, **kwargs
))
2218 __swig_destroy__
= _core_
.delete_Image
2219 __del__
= lambda self
: None;
2220 def Create(*args
, **kwargs
):
2222 Create(self, int width, int height, bool clear=True)
2224 Creates a fresh image. If clear is ``True``, the new image will be
2225 initialized to black. Otherwise, the image data will be uninitialized.
2227 return _core_
.Image_Create(*args
, **kwargs
)
2229 def Destroy(*args
, **kwargs
):
2233 Destroys the image data.
2235 val
= _core_
.Image_Destroy(*args
, **kwargs
)
2239 def Scale(*args
, **kwargs
):
2241 Scale(self, int width, int height) -> Image
2243 Returns a scaled version of the image. This is also useful for scaling
2244 bitmaps in general as the only other way to scale bitmaps is to blit a
2245 `wx.MemoryDC` into another `wx.MemoryDC`.
2247 return _core_
.Image_Scale(*args
, **kwargs
)
2249 def ShrinkBy(*args
, **kwargs
):
2251 ShrinkBy(self, int xFactor, int yFactor) -> Image
2253 Return a version of the image scaled smaller by the given factors.
2255 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2257 def Rescale(*args
, **kwargs
):
2259 Rescale(self, int width, int height) -> Image
2261 Changes the size of the image in-place by scaling it: after a call to
2262 this function, the image will have the given width and height.
2264 Returns the (modified) image itself.
2266 return _core_
.Image_Rescale(*args
, **kwargs
)
2268 def Resize(*args
, **kwargs
):
2270 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2272 Changes the size of the image in-place without scaling it, by adding
2273 either a border with the given colour or cropping as necessary. The
2274 image is pasted into a new image with the given size and background
2275 colour at the position pos relative to the upper left of the new
2276 image. If red = green = blue = -1 then use either the current mask
2277 colour if set or find, use, and set a suitable mask colour for any
2278 newly exposed areas.
2280 Returns the (modified) image itself.
2282 return _core_
.Image_Resize(*args
, **kwargs
)
2284 def SetRGB(*args
, **kwargs
):
2286 SetRGB(self, int x, int y, byte r, byte g, byte b)
2288 Sets the pixel at the given coordinate. This routine performs
2289 bounds-checks for the coordinate so it can be considered a safe way to
2290 manipulate the data, but in some cases this might be too slow so that
2291 the data will have to be set directly. In that case you will have to
2292 get access to the image data using the `GetData` method.
2294 return _core_
.Image_SetRGB(*args
, **kwargs
)
2296 def SetRGBRect(*args
, **kwargs
):
2298 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2300 Sets the colour of the pixels within the given rectangle. This routine
2301 performs bounds-checks for the rectangle so it can be considered a
2302 safe way to manipulate the data.
2304 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2306 def GetRed(*args
, **kwargs
):
2308 GetRed(self, int x, int y) -> byte
2310 Returns the red intensity at the given coordinate.
2312 return _core_
.Image_GetRed(*args
, **kwargs
)
2314 def GetGreen(*args
, **kwargs
):
2316 GetGreen(self, int x, int y) -> byte
2318 Returns the green intensity at the given coordinate.
2320 return _core_
.Image_GetGreen(*args
, **kwargs
)
2322 def GetBlue(*args
, **kwargs
):
2324 GetBlue(self, int x, int y) -> byte
2326 Returns the blue intensity at the given coordinate.
2328 return _core_
.Image_GetBlue(*args
, **kwargs
)
2330 def SetAlpha(*args
, **kwargs
):
2332 SetAlpha(self, int x, int y, byte alpha)
2334 Sets the alpha value for the given pixel. This function should only be
2335 called if the image has alpha channel data, use `HasAlpha` to check
2338 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2340 def GetAlpha(*args
, **kwargs
):
2342 GetAlpha(self, int x, int y) -> byte
2344 Returns the alpha value for the given pixel. This function may only be
2345 called for the images with alpha channel, use `HasAlpha` to check for
2348 The returned value is the *opacity* of the image, i.e. the value of 0
2349 corresponds to the fully transparent pixels while the value of 255 to
2350 the fully opaque pixels.
2352 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2354 def HasAlpha(*args
, **kwargs
):
2356 HasAlpha(self) -> bool
2358 Returns true if this image has alpha channel, false otherwise.
2360 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2362 def InitAlpha(*args
, **kwargs
):
2366 Initializes the image alpha channel data. It is an error to call it if
2367 the image already has alpha data. If it doesn't, alpha data will be by
2368 default initialized to all pixels being fully opaque. But if the image
2369 has a a mask colour, all mask pixels will be completely transparent.
2371 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2373 def IsTransparent(*args
, **kwargs
):
2375 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2377 Returns ``True`` if this pixel is masked or has an alpha value less
2378 than the spcified threshold.
2380 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2382 def FindFirstUnusedColour(*args
, **kwargs
):
2384 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2386 Find first colour that is not used in the image and has higher RGB
2387 values than startR, startG, startB. Returns a tuple consisting of a
2388 success flag and rgb values.
2390 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2392 def ConvertAlphaToMask(*args
, **kwargs
):
2394 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2396 If the image has alpha channel, this method converts it to mask. All
2397 pixels with alpha value less than ``threshold`` are replaced with the
2398 mask colour and the alpha channel is removed. The mask colour is
2399 chosen automatically using `FindFirstUnusedColour`.
2401 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2404 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2406 def ConvertColourToAlpha(*args
, **kwargs
):
2408 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2410 This method converts an image where the original alpha information is
2411 only available as a shades of a colour (actually shades of grey)
2412 typically when you draw anti-aliased text into a bitmap. The DC
2413 drawing routines draw grey values on the black background although
2414 they actually mean to draw white with differnt alpha values. This
2415 method reverses it, assuming a black (!) background and white text.
2416 The method will then fill up the whole image with the colour given.
2418 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2420 def SetMaskFromImage(*args
, **kwargs
):
2422 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2424 Sets the image's mask so that the pixels that have RGB value of
2425 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2426 by first finding an unused colour in the image, setting this colour as
2427 the mask colour and then using this colour to draw all pixels in the
2428 image who corresponding pixel in mask has given RGB value.
2430 Returns ``False`` if ``mask`` does not have same dimensions as the
2431 image or if there is no unused colour left. Returns ``True`` if the
2432 mask was successfully applied.
2434 Note that this method involves computing the histogram, which is
2435 computationally intensive operation.
2437 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2439 def CanRead(*args
, **kwargs
):
2441 CanRead(String filename) -> bool
2443 Returns True if the image handlers can read this file.
2445 return _core_
.Image_CanRead(*args
, **kwargs
)
2447 CanRead
= staticmethod(CanRead
)
2448 def GetImageCount(*args
, **kwargs
):
2450 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2452 If the image file contains more than one image and the image handler
2453 is capable of retrieving these individually, this function will return
2454 the number of available images.
2456 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2458 GetImageCount
= staticmethod(GetImageCount
)
2459 def LoadFile(*args
, **kwargs
):
2461 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2463 Loads an image from a file. If no handler type is provided, the
2464 library will try to autodetect the format.
2466 return _core_
.Image_LoadFile(*args
, **kwargs
)
2468 def LoadMimeFile(*args
, **kwargs
):
2470 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2472 Loads an image from a file, specifying the image type with a MIME type
2475 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2477 def SaveFile(*args
, **kwargs
):
2479 SaveFile(self, String name, int type) -> bool
2481 Saves an image in the named file.
2483 return _core_
.Image_SaveFile(*args
, **kwargs
)
2485 def SaveMimeFile(*args
, **kwargs
):
2487 SaveMimeFile(self, String name, String mimetype) -> bool
2489 Saves an image in the named file.
2491 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2493 def CanReadStream(*args
, **kwargs
):
2495 CanReadStream(InputStream stream) -> bool
2497 Returns True if the image handlers can read an image file from the
2498 data currently on the input stream, or a readable Python file-like
2501 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2503 CanReadStream
= staticmethod(CanReadStream
)
2504 def LoadStream(*args
, **kwargs
):
2506 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2508 Loads an image from an input stream or a readable Python file-like
2509 object. If no handler type is provided, the library will try to
2510 autodetect the format.
2512 return _core_
.Image_LoadStream(*args
, **kwargs
)
2514 def LoadMimeStream(*args
, **kwargs
):
2516 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2518 Loads an image from an input stream or a readable Python file-like
2519 object, using a MIME type string to specify the image file format.
2521 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2523 def Ok(*args
, **kwargs
):
2527 Returns true if image data is present.
2529 return _core_
.Image_Ok(*args
, **kwargs
)
2531 def GetWidth(*args
, **kwargs
):
2533 GetWidth(self) -> int
2535 Gets the width of the image in pixels.
2537 return _core_
.Image_GetWidth(*args
, **kwargs
)
2539 def GetHeight(*args
, **kwargs
):
2541 GetHeight(self) -> int
2543 Gets the height of the image in pixels.
2545 return _core_
.Image_GetHeight(*args
, **kwargs
)
2547 def GetSize(*args
, **kwargs
):
2549 GetSize(self) -> Size
2551 Returns the size of the image in pixels.
2553 return _core_
.Image_GetSize(*args
, **kwargs
)
2555 def GetSubImage(*args
, **kwargs
):
2557 GetSubImage(self, Rect rect) -> Image
2559 Returns a sub image of the current one as long as the rect belongs
2560 entirely to the image.
2562 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2564 def Size(*args
, **kwargs
):
2566 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2568 Returns a resized version of this image without scaling it by adding
2569 either a border with the given colour or cropping as necessary. The
2570 image is pasted into a new image with the given size and background
2571 colour at the position ``pos`` relative to the upper left of the new
2572 image. If red = green = blue = -1 then use either the current mask
2573 colour if set or find, use, and set a suitable mask colour for any
2574 newly exposed areas.
2576 return _core_
.Image_Size(*args
, **kwargs
)
2578 def Copy(*args
, **kwargs
):
2582 Returns an identical copy of the image.
2584 return _core_
.Image_Copy(*args
, **kwargs
)
2586 def Paste(*args
, **kwargs
):
2588 Paste(self, Image image, int x, int y)
2590 Pastes ``image`` into this instance and takes care of the mask colour
2591 and any out of bounds problems.
2593 return _core_
.Image_Paste(*args
, **kwargs
)
2595 def GetData(*args
, **kwargs
):
2597 GetData(self) -> PyObject
2599 Returns a string containing a copy of the RGB bytes of the image.
2601 return _core_
.Image_GetData(*args
, **kwargs
)
2603 def SetData(*args
, **kwargs
):
2605 SetData(self, buffer data)
2607 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2608 either a string or a buffer object holding the data and the length of
2609 the data must be width*height*3.
2611 return _core_
.Image_SetData(*args
, **kwargs
)
2613 def GetDataBuffer(*args
, **kwargs
):
2615 GetDataBuffer(self) -> PyObject
2617 Returns a writable Python buffer object that is pointing at the RGB
2618 image data buffer inside the wx.Image. You need to ensure that you do
2619 not use this buffer object after the image has been destroyed.
2621 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
2623 def SetDataBuffer(*args
, **kwargs
):
2625 SetDataBuffer(self, buffer data)
2627 Sets the internal image data pointer to point at a Python buffer
2628 object. This can save making an extra copy of the data but you must
2629 ensure that the buffer object lives longer than the wx.Image does.
2631 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
2633 def GetAlphaData(*args
, **kwargs
):
2635 GetAlphaData(self) -> PyObject
2637 Returns a string containing a copy of the alpha bytes of the image.
2639 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
2641 def SetAlphaData(*args
, **kwargs
):
2643 SetAlphaData(self, buffer alpha)
2645 Resets the Image's alpha data from a buffer of bytes. Accepts either
2646 a string or a buffer object holding the data and the length of the
2647 data must be width*height.
2649 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
2651 def GetAlphaBuffer(*args
, **kwargs
):
2652 """GetAlphaBuffer(self) -> PyObject"""
2653 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
2655 def SetAlphaBuffer(*args
, **kwargs
):
2656 """SetAlphaBuffer(self, buffer alpha)"""
2657 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
2659 def SetMaskColour(*args
, **kwargs
):
2661 SetMaskColour(self, byte r, byte g, byte b)
2663 Sets the mask colour for this image (and tells the image to use the
2666 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
2668 def GetOrFindMaskColour(*args
, **kwargs
):
2670 GetOrFindMaskColour() -> (r,g,b)
2672 Get the current mask colour or find a suitable colour.
2674 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
2676 def GetMaskRed(*args
, **kwargs
):
2678 GetMaskRed(self) -> byte
2680 Gets the red component of the mask colour.
2682 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
2684 def GetMaskGreen(*args
, **kwargs
):
2686 GetMaskGreen(self) -> byte
2688 Gets the green component of the mask colour.
2690 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
2692 def GetMaskBlue(*args
, **kwargs
):
2694 GetMaskBlue(self) -> byte
2696 Gets the blue component of the mask colour.
2698 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
2700 def SetMask(*args
, **kwargs
):
2702 SetMask(self, bool mask=True)
2704 Specifies whether there is a mask or not. The area of the mask is
2705 determined by the current mask colour.
2707 return _core_
.Image_SetMask(*args
, **kwargs
)
2709 def HasMask(*args
, **kwargs
):
2711 HasMask(self) -> bool
2713 Returns ``True`` if there is a mask active, ``False`` otherwise.
2715 return _core_
.Image_HasMask(*args
, **kwargs
)
2717 def Rotate(*args
, **kwargs
):
2719 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2720 Point offset_after_rotation=None) -> Image
2722 Rotates the image about the given point, by ``angle`` radians. Passing
2723 ``True`` to ``interpolating`` results in better image quality, but is
2724 slower. If the image has a mask, then the mask colour is used for the
2725 uncovered pixels in the rotated image background. Otherwise, black
2726 will be used as the fill colour.
2728 Returns the rotated image, leaving this image intact.
2730 return _core_
.Image_Rotate(*args
, **kwargs
)
2732 def Rotate90(*args
, **kwargs
):
2734 Rotate90(self, bool clockwise=True) -> Image
2736 Returns a copy of the image rotated 90 degrees in the direction
2737 indicated by ``clockwise``.
2739 return _core_
.Image_Rotate90(*args
, **kwargs
)
2741 def Mirror(*args
, **kwargs
):
2743 Mirror(self, bool horizontally=True) -> Image
2745 Returns a mirrored copy of the image. The parameter ``horizontally``
2746 indicates the orientation.
2748 return _core_
.Image_Mirror(*args
, **kwargs
)
2750 def Replace(*args
, **kwargs
):
2752 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2754 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2757 return _core_
.Image_Replace(*args
, **kwargs
)
2759 def ConvertToGreyscale(*args
, **kwargs
):
2761 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2763 Convert to greyscale image. Uses the luminance component (Y) of the
2764 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2765 defaults to ITU-T BT.601
2767 return _core_
.Image_ConvertToGreyscale(*args
, **kwargs
)
2769 def ConvertToMono(*args
, **kwargs
):
2771 ConvertToMono(self, byte r, byte g, byte b) -> Image
2773 Returns monochromatic version of the image. The returned image has
2774 white colour where the original has ``(r,g,b)`` colour and black
2775 colour everywhere else.
2777 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
2779 def SetOption(*args
, **kwargs
):
2781 SetOption(self, String name, String value)
2783 Sets an image handler defined option. For example, when saving as a
2784 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2785 number between 0 and 100 (0 is terrible, 100 is very good).
2787 return _core_
.Image_SetOption(*args
, **kwargs
)
2789 def SetOptionInt(*args
, **kwargs
):
2791 SetOptionInt(self, String name, int value)
2793 Sets an image option as an integer.
2795 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
2797 def GetOption(*args
, **kwargs
):
2799 GetOption(self, String name) -> String
2801 Gets the value of an image handler option.
2803 return _core_
.Image_GetOption(*args
, **kwargs
)
2805 def GetOptionInt(*args
, **kwargs
):
2807 GetOptionInt(self, String name) -> int
2809 Gets the value of an image handler option as an integer. If the given
2810 option is not present, the function returns 0.
2812 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
2814 def HasOption(*args
, **kwargs
):
2816 HasOption(self, String name) -> bool
2818 Returns true if the given option is present.
2820 return _core_
.Image_HasOption(*args
, **kwargs
)
2822 def CountColours(*args
, **kwargs
):
2823 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2824 return _core_
.Image_CountColours(*args
, **kwargs
)
2826 def ComputeHistogram(*args
, **kwargs
):
2827 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2828 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
2830 def AddHandler(*args
, **kwargs
):
2831 """AddHandler(ImageHandler handler)"""
2832 return _core_
.Image_AddHandler(*args
, **kwargs
)
2834 AddHandler
= staticmethod(AddHandler
)
2835 def InsertHandler(*args
, **kwargs
):
2836 """InsertHandler(ImageHandler handler)"""
2837 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2839 InsertHandler
= staticmethod(InsertHandler
)
2840 def RemoveHandler(*args
, **kwargs
):
2841 """RemoveHandler(String name) -> bool"""
2842 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2844 RemoveHandler
= staticmethod(RemoveHandler
)
2845 def GetHandlers(*args
, **kwargs
):
2846 """GetHandlers() -> PyObject"""
2847 return _core_
.Image_GetHandlers(*args
, **kwargs
)
2849 GetHandlers
= staticmethod(GetHandlers
)
2850 def GetImageExtWildcard(*args
, **kwargs
):
2852 GetImageExtWildcard() -> String
2854 Iterates all registered wxImageHandler objects, and returns a string
2855 containing file extension masks suitable for passing to file open/save
2858 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2860 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
2861 def ConvertToBitmap(*args
, **kwargs
):
2862 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2863 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
2865 def ConvertToMonoBitmap(*args
, **kwargs
):
2866 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2867 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
2869 def RotateHue(*args
, **kwargs
):
2871 RotateHue(self, double angle)
2873 Rotates the hue of each pixel of the image. Hue is a double in the
2874 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2876 return _core_
.Image_RotateHue(*args
, **kwargs
)
2878 def RGBtoHSV(*args
, **kwargs
):
2880 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2882 Converts a color in RGB color space to HSV color space.
2884 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
2886 RGBtoHSV
= staticmethod(RGBtoHSV
)
2887 def HSVtoRGB(*args
, **kwargs
):
2889 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2891 Converts a color in HSV color space to RGB color space.
2893 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
2895 HSVtoRGB
= staticmethod(HSVtoRGB
)
2896 def __nonzero__(self
): return self
.Ok()
2897 _core_
.Image_swigregister(Image
)
2899 def ImageFromMime(*args
, **kwargs
):
2901 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2903 Loads an image from a file, using a MIME type string (such as
2904 'image/jpeg') to specify image type.
2906 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
2909 def ImageFromStream(*args
, **kwargs
):
2911 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2913 Loads an image from an input stream, or any readable Python file-like
2916 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
2919 def ImageFromStreamMime(*args
, **kwargs
):
2921 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2923 Loads an image from an input stream, or any readable Python file-like
2924 object, specifying the image format with a MIME type string.
2926 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
2929 def EmptyImage(*args
, **kwargs
):
2931 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2933 Construct an empty image of a given size, optionally setting all
2936 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
2939 def ImageFromBitmap(*args
, **kwargs
):
2941 ImageFromBitmap(Bitmap bitmap) -> Image
2943 Construct an Image from a `wx.Bitmap`.
2945 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
2948 def ImageFromData(*args
, **kwargs
):
2950 ImageFromData(int width, int height, buffer data) -> Image
2952 Construct an Image from a buffer of RGB bytes. Accepts either a
2953 string or a buffer object holding the data and the length of the data
2954 must be width*height*3.
2956 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
2959 def ImageFromDataWithAlpha(*args
, **kwargs
):
2961 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2963 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2964 Accepts either a string or a buffer object holding the data and the
2965 length of the data must be width*height*3 bytes, and the length of the
2966 alpha data must be width*height bytes.
2968 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
2971 def Image_CanRead(*args
, **kwargs
):
2973 Image_CanRead(String filename) -> bool
2975 Returns True if the image handlers can read this file.
2977 return _core_
.Image_CanRead(*args
, **kwargs
)
2979 def Image_GetImageCount(*args
, **kwargs
):
2981 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2983 If the image file contains more than one image and the image handler
2984 is capable of retrieving these individually, this function will return
2985 the number of available images.
2987 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2989 def Image_CanReadStream(*args
, **kwargs
):
2991 Image_CanReadStream(InputStream stream) -> bool
2993 Returns True if the image handlers can read an image file from the
2994 data currently on the input stream, or a readable Python file-like
2997 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2999 def Image_AddHandler(*args
, **kwargs
):
3000 """Image_AddHandler(ImageHandler handler)"""
3001 return _core_
.Image_AddHandler(*args
, **kwargs
)
3003 def Image_InsertHandler(*args
, **kwargs
):
3004 """Image_InsertHandler(ImageHandler handler)"""
3005 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3007 def Image_RemoveHandler(*args
, **kwargs
):
3008 """Image_RemoveHandler(String name) -> bool"""
3009 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3011 def Image_GetHandlers(*args
):
3012 """Image_GetHandlers() -> PyObject"""
3013 return _core_
.Image_GetHandlers(*args
)
3015 def Image_GetImageExtWildcard(*args
):
3017 Image_GetImageExtWildcard() -> String
3019 Iterates all registered wxImageHandler objects, and returns a string
3020 containing file extension masks suitable for passing to file open/save
3023 return _core_
.Image_GetImageExtWildcard(*args
)
3025 def Image_RGBtoHSV(*args
, **kwargs
):
3027 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3029 Converts a color in RGB color space to HSV color space.
3031 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3033 def Image_HSVtoRGB(*args
, **kwargs
):
3035 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3037 Converts a color in HSV color space to RGB color space.
3039 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3041 def InitAllImageHandlers():
3043 The former functionality of InitAllImageHanders is now done internal to
3044 the _core_ extension module and so this function has become a simple NOP.
3048 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3049 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3050 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3051 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3052 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3053 BMP_24BPP
= _core_
.BMP_24BPP
3054 BMP_8BPP
= _core_
.BMP_8BPP
3055 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3056 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3057 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3058 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3059 BMP_4BPP
= _core_
.BMP_4BPP
3060 BMP_1BPP
= _core_
.BMP_1BPP
3061 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3062 class BMPHandler(ImageHandler
):
3063 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3064 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3065 __repr__
= _swig_repr
3066 def __init__(self
, *args
, **kwargs
):
3068 __init__(self) -> BMPHandler
3070 A `wx.ImageHandler` for \*.bmp bitmap files.
3072 _core_
.BMPHandler_swiginit(self
,_core_
.new_BMPHandler(*args
, **kwargs
))
3073 _core_
.BMPHandler_swigregister(BMPHandler
)
3074 NullImage
= cvar
.NullImage
3075 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3076 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3077 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3078 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3079 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3080 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3081 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3082 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3083 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3084 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3085 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3086 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3087 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3088 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3089 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3091 class ICOHandler(BMPHandler
):
3092 """A `wx.ImageHandler` for \*.ico icon files."""
3093 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3094 __repr__
= _swig_repr
3095 def __init__(self
, *args
, **kwargs
):
3097 __init__(self) -> ICOHandler
3099 A `wx.ImageHandler` for \*.ico icon files.
3101 _core_
.ICOHandler_swiginit(self
,_core_
.new_ICOHandler(*args
, **kwargs
))
3102 _core_
.ICOHandler_swigregister(ICOHandler
)
3104 class CURHandler(ICOHandler
):
3105 """A `wx.ImageHandler` for \*.cur cursor files."""
3106 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3107 __repr__
= _swig_repr
3108 def __init__(self
, *args
, **kwargs
):
3110 __init__(self) -> CURHandler
3112 A `wx.ImageHandler` for \*.cur cursor files.
3114 _core_
.CURHandler_swiginit(self
,_core_
.new_CURHandler(*args
, **kwargs
))
3115 _core_
.CURHandler_swigregister(CURHandler
)
3117 class ANIHandler(CURHandler
):
3118 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3119 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3120 __repr__
= _swig_repr
3121 def __init__(self
, *args
, **kwargs
):
3123 __init__(self) -> ANIHandler
3125 A `wx.ImageHandler` for \*.ani animated cursor files.
3127 _core_
.ANIHandler_swiginit(self
,_core_
.new_ANIHandler(*args
, **kwargs
))
3128 _core_
.ANIHandler_swigregister(ANIHandler
)
3130 class PNGHandler(ImageHandler
):
3131 """A `wx.ImageHandler` for PNG image files."""
3132 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3133 __repr__
= _swig_repr
3134 def __init__(self
, *args
, **kwargs
):
3136 __init__(self) -> PNGHandler
3138 A `wx.ImageHandler` for PNG image files.
3140 _core_
.PNGHandler_swiginit(self
,_core_
.new_PNGHandler(*args
, **kwargs
))
3141 _core_
.PNGHandler_swigregister(PNGHandler
)
3143 class GIFHandler(ImageHandler
):
3144 """A `wx.ImageHandler` for GIF image files."""
3145 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3146 __repr__
= _swig_repr
3147 def __init__(self
, *args
, **kwargs
):
3149 __init__(self) -> GIFHandler
3151 A `wx.ImageHandler` for GIF image files.
3153 _core_
.GIFHandler_swiginit(self
,_core_
.new_GIFHandler(*args
, **kwargs
))
3154 _core_
.GIFHandler_swigregister(GIFHandler
)
3156 class PCXHandler(ImageHandler
):
3157 """A `wx.ImageHandler` for PCX imager files."""
3158 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3159 __repr__
= _swig_repr
3160 def __init__(self
, *args
, **kwargs
):
3162 __init__(self) -> PCXHandler
3164 A `wx.ImageHandler` for PCX imager files.
3166 _core_
.PCXHandler_swiginit(self
,_core_
.new_PCXHandler(*args
, **kwargs
))
3167 _core_
.PCXHandler_swigregister(PCXHandler
)
3169 class JPEGHandler(ImageHandler
):
3170 """A `wx.ImageHandler` for JPEG/JPG image files."""
3171 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3172 __repr__
= _swig_repr
3173 def __init__(self
, *args
, **kwargs
):
3175 __init__(self) -> JPEGHandler
3177 A `wx.ImageHandler` for JPEG/JPG image files.
3179 _core_
.JPEGHandler_swiginit(self
,_core_
.new_JPEGHandler(*args
, **kwargs
))
3180 _core_
.JPEGHandler_swigregister(JPEGHandler
)
3182 class PNMHandler(ImageHandler
):
3183 """A `wx.ImageHandler` for PNM image files."""
3184 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3185 __repr__
= _swig_repr
3186 def __init__(self
, *args
, **kwargs
):
3188 __init__(self) -> PNMHandler
3190 A `wx.ImageHandler` for PNM image files.
3192 _core_
.PNMHandler_swiginit(self
,_core_
.new_PNMHandler(*args
, **kwargs
))
3193 _core_
.PNMHandler_swigregister(PNMHandler
)
3195 class XPMHandler(ImageHandler
):
3196 """A `wx.ImageHandler` for XPM image."""
3197 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3198 __repr__
= _swig_repr
3199 def __init__(self
, *args
, **kwargs
):
3201 __init__(self) -> XPMHandler
3203 A `wx.ImageHandler` for XPM image.
3205 _core_
.XPMHandler_swiginit(self
,_core_
.new_XPMHandler(*args
, **kwargs
))
3206 _core_
.XPMHandler_swigregister(XPMHandler
)
3208 class TIFFHandler(ImageHandler
):
3209 """A `wx.ImageHandler` for TIFF image files."""
3210 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3211 __repr__
= _swig_repr
3212 def __init__(self
, *args
, **kwargs
):
3214 __init__(self) -> TIFFHandler
3216 A `wx.ImageHandler` for TIFF image files.
3218 _core_
.TIFFHandler_swiginit(self
,_core_
.new_TIFFHandler(*args
, **kwargs
))
3219 _core_
.TIFFHandler_swigregister(TIFFHandler
)
3221 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3222 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3223 class Quantize(object):
3224 """Performs quantization, or colour reduction, on a wxImage."""
3225 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3226 def __init__(self
): raise AttributeError, "No constructor defined"
3227 __repr__
= _swig_repr
3228 def Quantize(*args
, **kwargs
):
3230 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3232 Reduce the colours in the source image and put the result into the
3233 destination image, setting the palette in the destination if
3234 needed. Both images may be the same, to overwrite the source image.
3236 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3238 Quantize
= staticmethod(Quantize
)
3239 _core_
.Quantize_swigregister(Quantize
)
3241 def Quantize_Quantize(*args
, **kwargs
):
3243 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3245 Reduce the colours in the source image and put the result into the
3246 destination image, setting the palette in the destination if
3247 needed. Both images may be the same, to overwrite the source image.
3249 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3251 #---------------------------------------------------------------------------
3253 class EvtHandler(Object
):
3254 """Proxy of C++ EvtHandler class"""
3255 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3256 __repr__
= _swig_repr
3257 def __init__(self
, *args
, **kwargs
):
3258 """__init__(self) -> EvtHandler"""
3259 _core_
.EvtHandler_swiginit(self
,_core_
.new_EvtHandler(*args
, **kwargs
))
3260 def GetNextHandler(*args
, **kwargs
):
3261 """GetNextHandler(self) -> EvtHandler"""
3262 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3264 def GetPreviousHandler(*args
, **kwargs
):
3265 """GetPreviousHandler(self) -> EvtHandler"""
3266 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3268 def SetNextHandler(*args
, **kwargs
):
3269 """SetNextHandler(self, EvtHandler handler)"""
3270 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3272 def SetPreviousHandler(*args
, **kwargs
):
3273 """SetPreviousHandler(self, EvtHandler handler)"""
3274 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3276 def GetEvtHandlerEnabled(*args
, **kwargs
):
3277 """GetEvtHandlerEnabled(self) -> bool"""
3278 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3280 def SetEvtHandlerEnabled(*args
, **kwargs
):
3281 """SetEvtHandlerEnabled(self, bool enabled)"""
3282 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3284 def ProcessEvent(*args
, **kwargs
):
3285 """ProcessEvent(self, Event event) -> bool"""
3286 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3288 def AddPendingEvent(*args
, **kwargs
):
3289 """AddPendingEvent(self, Event event)"""
3290 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3292 def ProcessPendingEvents(*args
, **kwargs
):
3293 """ProcessPendingEvents(self)"""
3294 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3296 def Connect(*args
, **kwargs
):
3297 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3298 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3300 def Disconnect(*args
, **kwargs
):
3301 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3302 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3304 def _setOORInfo(*args
, **kwargs
):
3305 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3306 val
= _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3310 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3312 Bind an event to an event handler.
3314 :param event: One of the EVT_* objects that specifies the
3315 type of event to bind,
3317 :param handler: A callable object to be invoked when the
3318 event is delivered to self. Pass None to
3319 disconnect an event handler.
3321 :param source: Sometimes the event originates from a
3322 different window than self, but you still
3323 want to catch it in self. (For example, a
3324 button event delivered to a frame.) By
3325 passing the source of the event, the event
3326 handling system is able to differentiate
3327 between the same event type from different
3330 :param id: Used to spcify the event source by ID instead
3333 :param id2: Used when it is desirable to bind a handler
3334 to a range of IDs, such as with EVT_MENU_RANGE.
3336 if source
is not None:
3338 event
.Bind(self
, id, id2
, handler
)
3340 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3342 Disconencts the event handler binding for event from self.
3343 Returns True if successful.
3345 if source
is not None:
3347 return event
.Unbind(self
, id, id2
)
3349 _core_
.EvtHandler_swigregister(EvtHandler
)
3351 #---------------------------------------------------------------------------
3353 class PyEventBinder(object):
3355 Instances of this class are used to bind specific events to event
3358 def __init__(self
, evtType
, expectedIDs
=0):
3359 if expectedIDs
not in [0, 1, 2]:
3360 raise ValueError, "Invalid number of expectedIDs"
3361 self
.expectedIDs
= expectedIDs
3363 if type(evtType
) == list or type(evtType
) == tuple:
3364 self
.evtType
= evtType
3366 self
.evtType
= [evtType
]
3369 def Bind(self
, target
, id1
, id2
, function
):
3370 """Bind this set of event types to target."""
3371 for et
in self
.evtType
:
3372 target
.Connect(id1
, id2
, et
, function
)
3375 def Unbind(self
, target
, id1
, id2
):
3376 """Remove an event binding."""
3378 for et
in self
.evtType
:
3379 success
+= target
.Disconnect(id1
, id2
, et
)
3383 def __call__(self
, *args
):
3385 For backwards compatibility with the old EVT_* functions.
3386 Should be called with either (window, func), (window, ID,
3387 func) or (window, ID1, ID2, func) parameters depending on the
3390 assert len(args
) == 2 + self
.expectedIDs
3394 if self
.expectedIDs
== 0:
3396 elif self
.expectedIDs
== 1:
3399 elif self
.expectedIDs
== 2:
3404 raise ValueError, "Unexpected number of IDs"
3406 self
.Bind(target
, id1
, id2
, func
)
3409 # These two are square pegs that don't fit the PyEventBinder hole...
3410 def EVT_COMMAND(win
, id, cmd
, func
):
3411 win
.Connect(id, -1, cmd
, func
)
3412 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3413 win
.Connect(id1
, id2
, cmd
, func
)
3416 #---------------------------------------------------------------------------
3418 #---------------------------------------------------------------------------
3420 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3421 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3423 def NewEventType(*args
):
3424 """NewEventType() -> EventType"""
3425 return _core_
.NewEventType(*args
)
3426 wxEVT_NULL
= _core_
.wxEVT_NULL
3427 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3428 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3429 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3430 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3431 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3432 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3433 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3434 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3435 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3436 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3437 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3438 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3439 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3440 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3441 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3442 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3443 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3444 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3445 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3446 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3447 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3448 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3449 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3450 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3451 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3452 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3453 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3454 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3455 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3456 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3457 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3458 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3459 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3460 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3461 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3462 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3463 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3464 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3465 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3466 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3467 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3468 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3469 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3470 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3471 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3472 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3473 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3474 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3475 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3476 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3477 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3478 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3479 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3480 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3481 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3482 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3483 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3484 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3485 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3486 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3487 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3488 wxEVT_SCROLL_CHANGED
= _core_
.wxEVT_SCROLL_CHANGED
3489 wxEVT_SCROLL_ENDSCROLL
= wxEVT_SCROLL_CHANGED
3490 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3491 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3492 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3493 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3494 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3495 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3496 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3497 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3498 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3499 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3500 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3501 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3502 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3503 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3504 wxEVT_POWER
= _core_
.wxEVT_POWER
3505 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3506 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3507 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3508 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3509 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3510 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3511 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3512 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3513 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3514 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3515 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3516 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3517 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3518 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3519 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3520 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3521 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3522 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3523 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3524 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3525 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
3526 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
3527 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
3528 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
3529 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
3530 wxEVT_IDLE
= _core_
.wxEVT_IDLE
3531 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
3532 wxEVT_SIZING
= _core_
.wxEVT_SIZING
3533 wxEVT_MOVING
= _core_
.wxEVT_MOVING
3534 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
3535 wxEVT_COMMAND_TEXT_COPY
= _core_
.wxEVT_COMMAND_TEXT_COPY
3536 wxEVT_COMMAND_TEXT_CUT
= _core_
.wxEVT_COMMAND_TEXT_CUT
3537 wxEVT_COMMAND_TEXT_PASTE
= _core_
.wxEVT_COMMAND_TEXT_PASTE
3538 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
3539 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
3540 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
3541 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
3542 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
3543 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
3544 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
3546 # Create some event binders
3547 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
3548 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
3549 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
3550 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
3551 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
3552 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3553 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3554 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
3555 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
3556 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
3557 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
3558 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
3559 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
3560 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
3561 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
3562 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
3563 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
3564 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
3565 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
3566 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
3567 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
3568 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
3569 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
3570 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
3571 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
3572 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3573 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3574 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
3575 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
3576 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
3577 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
3578 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
3579 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
3580 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
3581 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
3582 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
3583 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
3584 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
3585 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
3586 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
3587 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
3589 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
3590 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
3591 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
3592 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
3593 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
3594 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
3595 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
3596 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
3597 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
3598 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
3599 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
3600 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
3601 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
3603 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
3611 wxEVT_MIDDLE_DCLICK
,
3619 # Scrolling from wxWindow (sent to wxScrolledWindow)
3620 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
3621 wxEVT_SCROLLWIN_BOTTOM
,
3622 wxEVT_SCROLLWIN_LINEUP
,
3623 wxEVT_SCROLLWIN_LINEDOWN
,
3624 wxEVT_SCROLLWIN_PAGEUP
,
3625 wxEVT_SCROLLWIN_PAGEDOWN
,
3626 wxEVT_SCROLLWIN_THUMBTRACK
,
3627 wxEVT_SCROLLWIN_THUMBRELEASE
,
3630 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
3631 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
3632 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
3633 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
3634 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
3635 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
3636 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
3637 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
3639 # Scrolling from wx.Slider and wx.ScrollBar
3640 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3641 wxEVT_SCROLL_BOTTOM
,
3642 wxEVT_SCROLL_LINEUP
,
3643 wxEVT_SCROLL_LINEDOWN
,
3644 wxEVT_SCROLL_PAGEUP
,
3645 wxEVT_SCROLL_PAGEDOWN
,
3646 wxEVT_SCROLL_THUMBTRACK
,
3647 wxEVT_SCROLL_THUMBRELEASE
,
3648 wxEVT_SCROLL_CHANGED
,
3651 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
3652 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
3653 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
3654 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
3655 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
3656 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
3657 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
3658 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
3659 EVT_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
)
3660 EVT_SCROLL_ENDSCROLL
= EVT_SCROLL_CHANGED
3662 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3663 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3664 wxEVT_SCROLL_BOTTOM
,
3665 wxEVT_SCROLL_LINEUP
,
3666 wxEVT_SCROLL_LINEDOWN
,
3667 wxEVT_SCROLL_PAGEUP
,
3668 wxEVT_SCROLL_PAGEDOWN
,
3669 wxEVT_SCROLL_THUMBTRACK
,
3670 wxEVT_SCROLL_THUMBRELEASE
,
3671 wxEVT_SCROLL_CHANGED
,
3674 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
3675 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
3676 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
3677 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
3678 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
3679 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
3680 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
3681 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
3682 EVT_COMMAND_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
, 1)
3683 EVT_COMMAND_SCROLL_ENDSCROLL
= EVT_COMMAND_SCROLL_CHANGED
3685 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
3686 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
3687 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
3688 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
3689 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
3690 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
3691 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
3692 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
3693 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
3694 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
3696 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
3697 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
3698 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
3699 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
3700 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
3701 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
3702 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
3703 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
3704 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
3707 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
3708 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
3709 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
3710 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
3711 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
3712 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
3713 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
3715 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
3717 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
3718 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
3720 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
3722 EVT_TEXT_CUT
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_CUT
)
3723 EVT_TEXT_COPY
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_COPY
)
3724 EVT_TEXT_PASTE
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE
)
3727 #---------------------------------------------------------------------------
3729 class Event(Object
):
3731 An event is a structure holding information about an event passed to a
3732 callback or member function. wx.Event is an abstract base class for
3735 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3736 def __init__(self
): raise AttributeError, "No constructor defined"
3737 __repr__
= _swig_repr
3738 __swig_destroy__
= _core_
.delete_Event
3739 __del__
= lambda self
: None;
3740 def SetEventType(*args
, **kwargs
):
3742 SetEventType(self, EventType typ)
3744 Sets the specific type of the event.
3746 return _core_
.Event_SetEventType(*args
, **kwargs
)
3748 def GetEventType(*args
, **kwargs
):
3750 GetEventType(self) -> EventType
3752 Returns the identifier of the given event type, such as
3753 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3755 return _core_
.Event_GetEventType(*args
, **kwargs
)
3757 def GetEventObject(*args
, **kwargs
):
3759 GetEventObject(self) -> Object
3761 Returns the object (usually a window) associated with the event, if
3764 return _core_
.Event_GetEventObject(*args
, **kwargs
)
3766 def SetEventObject(*args
, **kwargs
):
3768 SetEventObject(self, Object obj)
3770 Sets the originating object, or in other words, obj is normally the
3771 object that is sending the event.
3773 return _core_
.Event_SetEventObject(*args
, **kwargs
)
3775 def GetTimestamp(*args
, **kwargs
):
3776 """GetTimestamp(self) -> long"""
3777 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
3779 def SetTimestamp(*args
, **kwargs
):
3780 """SetTimestamp(self, long ts=0)"""
3781 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
3783 def GetId(*args
, **kwargs
):
3787 Returns the identifier associated with this event, such as a button
3790 return _core_
.Event_GetId(*args
, **kwargs
)
3792 def SetId(*args
, **kwargs
):
3796 Set's the ID for the event. This is usually the ID of the window that
3797 is sending the event, but it can also be a command id from a menu
3800 return _core_
.Event_SetId(*args
, **kwargs
)
3802 def IsCommandEvent(*args
, **kwargs
):
3804 IsCommandEvent(self) -> bool
3806 Returns true if the event is or is derived from `wx.CommandEvent` else
3807 it returns false. Note: Exists only for optimization purposes.
3809 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
3811 def Skip(*args
, **kwargs
):
3813 Skip(self, bool skip=True)
3815 Called by an event handler, it controls whether additional event
3816 handlers bound to this event will be called after the current event
3817 handler returns. Skip(false) (the default setting) will prevent
3818 additional event handlers from being called and control will be
3819 returned to the sender of the event immediately after the current
3820 handler has finished. Skip(True) will cause the event processing
3821 system to continue searching for a handler function for this event.
3824 return _core_
.Event_Skip(*args
, **kwargs
)
3826 def GetSkipped(*args
, **kwargs
):
3828 GetSkipped(self) -> bool
3830 Returns true if the event handler should be skipped, false otherwise.
3833 return _core_
.Event_GetSkipped(*args
, **kwargs
)
3835 def ShouldPropagate(*args
, **kwargs
):
3837 ShouldPropagate(self) -> bool
3839 Test if this event should be propagated to the parent window or not,
3840 i.e. if the propagation level is currently greater than 0.
3842 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
3844 def StopPropagation(*args
, **kwargs
):
3846 StopPropagation(self) -> int
3848 Stop the event from propagating to its parent window. Returns the old
3849 propagation level value which may be later passed to
3850 `ResumePropagation` to allow propagating the event again.
3852 return _core_
.Event_StopPropagation(*args
, **kwargs
)
3854 def ResumePropagation(*args
, **kwargs
):
3856 ResumePropagation(self, int propagationLevel)
3858 Resume the event propagation by restoring the propagation level. (For
3859 example, you can use the value returned by an earlier call to
3863 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
3865 def Clone(*args
, **kwargs
):
3866 """Clone(self) -> Event"""
3867 return _core_
.Event_Clone(*args
, **kwargs
)
3869 _core_
.Event_swigregister(Event
)
3871 #---------------------------------------------------------------------------
3873 class PropagationDisabler(object):
3875 Helper class to temporarily change an event not to propagate. Simply
3876 create an instance of this class and then whe it is destroyed the
3877 propogation of the event will be restored.
3879 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3880 __repr__
= _swig_repr
3881 def __init__(self
, *args
, **kwargs
):
3883 __init__(self, Event event) -> PropagationDisabler
3885 Helper class to temporarily change an event not to propagate. Simply
3886 create an instance of this class and then whe it is destroyed the
3887 propogation of the event will be restored.
3889 _core_
.PropagationDisabler_swiginit(self
,_core_
.new_PropagationDisabler(*args
, **kwargs
))
3890 __swig_destroy__
= _core_
.delete_PropagationDisabler
3891 __del__
= lambda self
: None;
3892 _core_
.PropagationDisabler_swigregister(PropagationDisabler
)
3894 class PropagateOnce(object):
3896 A helper class that will temporarily lower propagation level of an
3897 event. Simply create an instance of this class and then whe it is
3898 destroyed the propogation of the event will be restored.
3900 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3901 __repr__
= _swig_repr
3902 def __init__(self
, *args
, **kwargs
):
3904 __init__(self, Event event) -> PropagateOnce
3906 A helper class that will temporarily lower propagation level of an
3907 event. Simply create an instance of this class and then whe it is
3908 destroyed the propogation of the event will be restored.
3910 _core_
.PropagateOnce_swiginit(self
,_core_
.new_PropagateOnce(*args
, **kwargs
))
3911 __swig_destroy__
= _core_
.delete_PropagateOnce
3912 __del__
= lambda self
: None;
3913 _core_
.PropagateOnce_swigregister(PropagateOnce
)
3915 #---------------------------------------------------------------------------
3917 class CommandEvent(Event
):
3919 This event class contains information about command events, which
3920 originate from a variety of simple controls, as well as menus and
3923 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3924 __repr__
= _swig_repr
3925 def __init__(self
, *args
, **kwargs
):
3927 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3929 This event class contains information about command events, which
3930 originate from a variety of simple controls, as well as menus and
3933 _core_
.CommandEvent_swiginit(self
,_core_
.new_CommandEvent(*args
, **kwargs
))
3934 def GetSelection(*args
, **kwargs
):
3936 GetSelection(self) -> int
3938 Returns item index for a listbox or choice selection event (not valid
3941 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
3943 def SetString(*args
, **kwargs
):
3944 """SetString(self, String s)"""
3945 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
3947 def GetString(*args
, **kwargs
):
3949 GetString(self) -> String
3951 Returns item string for a listbox or choice selection event (not valid
3954 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
3956 def IsChecked(*args
, **kwargs
):
3958 IsChecked(self) -> bool
3960 This method can be used with checkbox and menu events: for the
3961 checkboxes, the method returns true for a selection event and false
3962 for a deselection one. For the menu events, this method indicates if
3963 the menu item just has become checked or unchecked (and thus only
3964 makes sense for checkable menu items).
3966 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
3969 def IsSelection(*args
, **kwargs
):
3971 IsSelection(self) -> bool
3973 For a listbox or similar event, returns true if it is a selection,
3974 false if it is a deselection.
3976 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
3978 def SetExtraLong(*args
, **kwargs
):
3979 """SetExtraLong(self, long extraLong)"""
3980 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
3982 def GetExtraLong(*args
, **kwargs
):
3984 GetExtraLong(self) -> long
3986 Returns extra information dependant on the event objects type. If the
3987 event comes from a listbox selection, it is a boolean determining
3988 whether the event was a selection (true) or a deselection (false). A
3989 listbox deselection only occurs for multiple-selection boxes, and in
3990 this case the index and string values are indeterminate and the
3991 listbox must be examined by the application.
3993 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
3995 def SetInt(*args
, **kwargs
):
3996 """SetInt(self, int i)"""
3997 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
3999 def GetInt(*args
, **kwargs
):
4003 Returns the integer identifier corresponding to a listbox, choice or
4004 radiobox selection (only if the event was a selection, not a
4005 deselection), or a boolean value representing the value of a checkbox.
4007 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4009 def GetClientData(*args
, **kwargs
):
4011 GetClientData(self) -> PyObject
4013 Returns the client data object for a listbox or choice selection event, (if any.)
4015 return _core_
.CommandEvent_GetClientData(*args
, **kwargs
)
4017 def SetClientData(*args
, **kwargs
):
4019 SetClientData(self, PyObject clientData)
4021 Associate the given client data with the item at position n.
4023 return _core_
.CommandEvent_SetClientData(*args
, **kwargs
)
4025 GetClientObject
= GetClientData
4026 SetClientObject
= SetClientData
4028 def Clone(*args
, **kwargs
):
4029 """Clone(self) -> Event"""
4030 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4032 _core_
.CommandEvent_swigregister(CommandEvent
)
4034 #---------------------------------------------------------------------------
4036 class NotifyEvent(CommandEvent
):
4038 An instance of this class (or one of its derived classes) is sent from
4039 a control when the control's state is being changed and the control
4040 allows that change to be prevented from happening. The event handler
4041 can call `Veto` or `Allow` to tell the control what to do.
4043 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4044 __repr__
= _swig_repr
4045 def __init__(self
, *args
, **kwargs
):
4047 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4049 An instance of this class (or one of its derived classes) is sent from
4050 a control when the control's state is being changed and the control
4051 allows that change to be prevented from happening. The event handler
4052 can call `Veto` or `Allow` to tell the control what to do.
4054 _core_
.NotifyEvent_swiginit(self
,_core_
.new_NotifyEvent(*args
, **kwargs
))
4055 def Veto(*args
, **kwargs
):
4059 Prevents the change announced by this event from happening.
4061 It is in general a good idea to notify the user about the reasons for
4062 vetoing the change because otherwise the applications behaviour (which
4063 just refuses to do what the user wants) might be quite surprising.
4065 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4067 def Allow(*args
, **kwargs
):
4071 This is the opposite of `Veto`: it explicitly allows the event to be
4072 processed. For most events it is not necessary to call this method as
4073 the events are allowed anyhow but some are forbidden by default (this
4074 will be mentioned in the corresponding event description).
4076 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4078 def IsAllowed(*args
, **kwargs
):
4080 IsAllowed(self) -> bool
4082 Returns true if the change is allowed (`Veto` hasn't been called) or
4083 false otherwise (if it was).
4085 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4087 _core_
.NotifyEvent_swigregister(NotifyEvent
)
4089 #---------------------------------------------------------------------------
4091 class ScrollEvent(CommandEvent
):
4093 A scroll event holds information about events sent from stand-alone
4094 scrollbars and sliders. Note that scrolled windows do not send
4095 instnaces of this event class, but send the `wx.ScrollWinEvent`
4098 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4099 __repr__
= _swig_repr
4100 def __init__(self
, *args
, **kwargs
):
4102 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4103 int orient=0) -> ScrollEvent
4105 _core_
.ScrollEvent_swiginit(self
,_core_
.new_ScrollEvent(*args
, **kwargs
))
4106 def GetOrientation(*args
, **kwargs
):
4108 GetOrientation(self) -> int
4110 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4113 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4115 def GetPosition(*args
, **kwargs
):
4117 GetPosition(self) -> int
4119 Returns the position of the scrollbar.
4121 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4123 def SetOrientation(*args
, **kwargs
):
4124 """SetOrientation(self, int orient)"""
4125 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4127 def SetPosition(*args
, **kwargs
):
4128 """SetPosition(self, int pos)"""
4129 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4131 _core_
.ScrollEvent_swigregister(ScrollEvent
)
4133 #---------------------------------------------------------------------------
4135 class ScrollWinEvent(Event
):
4137 A wx.ScrollWinEvent holds information about scrolling and is sent from
4140 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4141 __repr__
= _swig_repr
4142 def __init__(self
, *args
, **kwargs
):
4144 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4146 A wx.ScrollWinEvent holds information about scrolling and is sent from
4149 _core_
.ScrollWinEvent_swiginit(self
,_core_
.new_ScrollWinEvent(*args
, **kwargs
))
4150 def GetOrientation(*args
, **kwargs
):
4152 GetOrientation(self) -> int
4154 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4157 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4159 def GetPosition(*args
, **kwargs
):
4161 GetPosition(self) -> int
4163 Returns the position of the scrollbar for the thumb track and release
4164 events. Note that this field can't be used for the other events, you
4165 need to query the window itself for the current position in that case.
4167 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4169 def SetOrientation(*args
, **kwargs
):
4170 """SetOrientation(self, int orient)"""
4171 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4173 def SetPosition(*args
, **kwargs
):
4174 """SetPosition(self, int pos)"""
4175 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4177 _core_
.ScrollWinEvent_swigregister(ScrollWinEvent
)
4179 #---------------------------------------------------------------------------
4181 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4182 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4183 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4184 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4185 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4186 class MouseEvent(Event
):
4188 This event class contains information about the events generated by
4189 the mouse: they include mouse buttons press and release events and
4192 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4193 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4194 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4195 a middle button so a portable application should avoid relying on the
4198 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4199 the former returns true when the event corresponds to the left mouse
4200 button click while the latter returns true if the left mouse button is
4201 currently being pressed. For example, when the user is dragging the
4202 mouse you can use `LeftIsDown` to test whether the left mouse button
4203 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4204 `LeftIsDown` will also return true in wxWidgets whatever the
4205 underlying GUI behaviour is (which is platform-dependent). The same
4206 applies, of course, to other mouse buttons as well.
4208 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4209 __repr__
= _swig_repr
4210 def __init__(self
, *args
, **kwargs
):
4212 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4214 Constructs a wx.MouseEvent. Valid event types are:
4216 * wxEVT_ENTER_WINDOW
4217 * wxEVT_LEAVE_WINDOW
4223 * wxEVT_MIDDLE_DCLICK
4226 * wxEVT_RIGHT_DCLICK
4230 _core_
.MouseEvent_swiginit(self
,_core_
.new_MouseEvent(*args
, **kwargs
))
4231 def IsButton(*args
, **kwargs
):
4233 IsButton(self) -> bool
4235 Returns true if the event was a mouse button event (not necessarily a
4236 button down event - that may be tested using `ButtonDown`).
4238 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4240 def ButtonDown(*args
, **kwargs
):
4242 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4244 If the argument is omitted, this returns true if the event was any
4245 mouse button down event. Otherwise the argument specifies which
4246 button-down event shold be checked for (see `Button` for the possible
4249 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4251 def ButtonDClick(*args
, **kwargs
):
4253 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4255 If the argument is omitted, this returns true if the event was any
4256 mouse double click event. Otherwise the argument specifies which
4257 double click event to check for (see `Button` for the possible
4260 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4262 def ButtonUp(*args
, **kwargs
):
4264 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4266 If the argument is omitted, this returns true if the event was any
4267 mouse button up event. Otherwise the argument specifies which button
4268 up event to check for (see `Button` for the possible values).
4270 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4272 def Button(*args
, **kwargs
):
4274 Button(self, int button) -> bool
4276 Returns true if the identified mouse button is changing state. Valid
4277 values of button are:
4279 ==================== =====================================
4280 wx.MOUSE_BTN_LEFT check if left button was pressed
4281 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4282 wx.MOUSE_BTN_RIGHT check if right button was pressed
4283 wx.MOUSE_BTN_ANY check if any button was pressed
4284 ==================== =====================================
4287 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4289 def ButtonIsDown(*args
, **kwargs
):
4290 """ButtonIsDown(self, int but) -> bool"""
4291 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4293 def GetButton(*args
, **kwargs
):
4295 GetButton(self) -> int
4297 Returns the mouse button which generated this event or
4298 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4299 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4300 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4301 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4302 right buttons respectively.
4304 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4306 def ControlDown(*args
, **kwargs
):
4308 ControlDown(self) -> bool
4310 Returns true if the control key was down at the time of the event.
4312 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4314 def MetaDown(*args
, **kwargs
):
4316 MetaDown(self) -> bool
4318 Returns true if the Meta key was down at the time of the event.
4320 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4322 def AltDown(*args
, **kwargs
):
4324 AltDown(self) -> bool
4326 Returns true if the Alt key was down at the time of the event.
4328 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4330 def ShiftDown(*args
, **kwargs
):
4332 ShiftDown(self) -> bool
4334 Returns true if the Shift key was down at the time of the event.
4336 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4338 def CmdDown(*args
, **kwargs
):
4340 CmdDown(self) -> bool
4342 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4343 platforms but the special "Apple" (a.k.a as "Command") key on
4344 Macs. It often makes sense to use it instead of, say, `ControlDown`
4345 because Cmd key is used for the same thing under Mac as Ctrl
4346 elsewhere. The Ctrl key still exists, it's just not used for this
4347 purpose. So for non-Mac platforms this is the same as `ControlDown`
4348 and Macs this is the same as `MetaDown`.
4350 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4352 def LeftDown(*args
, **kwargs
):
4354 LeftDown(self) -> bool
4356 Returns true if the left mouse button state changed to down.
4358 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4360 def MiddleDown(*args
, **kwargs
):
4362 MiddleDown(self) -> bool
4364 Returns true if the middle mouse button state changed to down.
4366 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4368 def RightDown(*args
, **kwargs
):
4370 RightDown(self) -> bool
4372 Returns true if the right mouse button state changed to down.
4374 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4376 def LeftUp(*args
, **kwargs
):
4378 LeftUp(self) -> bool
4380 Returns true if the left mouse button state changed to up.
4382 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4384 def MiddleUp(*args
, **kwargs
):
4386 MiddleUp(self) -> bool
4388 Returns true if the middle mouse button state changed to up.
4390 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4392 def RightUp(*args
, **kwargs
):
4394 RightUp(self) -> bool
4396 Returns true if the right mouse button state changed to up.
4398 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4400 def LeftDClick(*args
, **kwargs
):
4402 LeftDClick(self) -> bool
4404 Returns true if the event was a left button double click.
4406 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4408 def MiddleDClick(*args
, **kwargs
):
4410 MiddleDClick(self) -> bool
4412 Returns true if the event was a middle button double click.
4414 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4416 def RightDClick(*args
, **kwargs
):
4418 RightDClick(self) -> bool
4420 Returns true if the event was a right button double click.
4422 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4424 def LeftIsDown(*args
, **kwargs
):
4426 LeftIsDown(self) -> bool
4428 Returns true if the left mouse button is currently down, independent
4429 of the current event type.
4431 Please notice that it is not the same as LeftDown which returns true
4432 if the left mouse button was just pressed. Rather, it describes the
4433 state of the mouse button before the event happened.
4435 This event is usually used in the mouse event handlers which process
4436 "move mouse" messages to determine whether the user is (still)
4439 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4441 def MiddleIsDown(*args
, **kwargs
):
4443 MiddleIsDown(self) -> bool
4445 Returns true if the middle mouse button is currently down, independent
4446 of the current event type.
4448 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4450 def RightIsDown(*args
, **kwargs
):
4452 RightIsDown(self) -> bool
4454 Returns true if the right mouse button is currently down, independent
4455 of the current event type.
4457 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4459 def Dragging(*args
, **kwargs
):
4461 Dragging(self) -> bool
4463 Returns true if this was a dragging event (motion while a button is
4466 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4468 def Moving(*args
, **kwargs
):
4470 Moving(self) -> bool
4472 Returns true if this was a motion event and no mouse buttons were
4473 pressed. If any mouse button is held pressed, then this method returns
4474 false and Dragging returns true.
4476 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4478 def Entering(*args
, **kwargs
):
4480 Entering(self) -> bool
4482 Returns true if the mouse was entering the window.
4484 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4486 def Leaving(*args
, **kwargs
):
4488 Leaving(self) -> bool
4490 Returns true if the mouse was leaving the window.
4492 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4494 def GetPosition(*args
, **kwargs
):
4496 GetPosition(self) -> Point
4498 Returns the pixel position of the mouse in window coordinates when the
4501 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4503 def GetPositionTuple(*args
, **kwargs
):
4505 GetPositionTuple() -> (x,y)
4507 Returns the pixel position of the mouse in window coordinates when the
4510 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
4512 def GetLogicalPosition(*args
, **kwargs
):
4514 GetLogicalPosition(self, DC dc) -> Point
4516 Returns the logical mouse position in pixels (i.e. translated
4517 according to the translation set for the DC, which usually indicates
4518 that the window has been scrolled).
4520 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
4522 def GetX(*args
, **kwargs
):
4526 Returns X coordinate of the physical mouse event position.
4528 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
4530 def GetY(*args
, **kwargs
):
4534 Returns Y coordinate of the physical mouse event position.
4536 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
4538 def GetWheelRotation(*args
, **kwargs
):
4540 GetWheelRotation(self) -> int
4542 Get wheel rotation, positive or negative indicates direction of
4543 rotation. Current devices all send an event when rotation is equal to
4544 +/-WheelDelta, but this allows for finer resolution devices to be
4545 created in the future. Because of this you shouldn't assume that one
4546 event is equal to 1 line or whatever, but you should be able to either
4547 do partial line scrolling or wait until +/-WheelDelta rotation values
4548 have been accumulated before scrolling.
4550 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
4552 def GetWheelDelta(*args
, **kwargs
):
4554 GetWheelDelta(self) -> int
4556 Get wheel delta, normally 120. This is the threshold for action to be
4557 taken, and one such action (for example, scrolling one increment)
4558 should occur for each delta.
4560 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
4562 def GetLinesPerAction(*args
, **kwargs
):
4564 GetLinesPerAction(self) -> int
4566 Returns the configured number of lines (or whatever) to be scrolled
4567 per wheel action. Defaults to three.
4569 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
4571 def IsPageScroll(*args
, **kwargs
):
4573 IsPageScroll(self) -> bool
4575 Returns true if the system has been setup to do page scrolling with
4576 the mouse wheel instead of line scrolling.
4578 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
4580 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
4581 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
4582 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
4583 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
4584 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
4585 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
4586 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
4587 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
4588 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
4589 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
4590 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
4591 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
4592 _core_
.MouseEvent_swigregister(MouseEvent
)
4594 #---------------------------------------------------------------------------
4596 class SetCursorEvent(Event
):
4598 A SetCursorEvent is generated when the mouse cursor is about to be set
4599 as a result of mouse motion. This event gives the application the
4600 chance to perform specific mouse cursor processing based on the
4601 current position of the mouse within the window. Use the `SetCursor`
4602 method to specify the cursor you want to be displayed.
4604 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4605 __repr__
= _swig_repr
4606 def __init__(self
, *args
, **kwargs
):
4608 __init__(self, int x=0, int y=0) -> SetCursorEvent
4610 Construct a new `wx.SetCursorEvent`.
4612 _core_
.SetCursorEvent_swiginit(self
,_core_
.new_SetCursorEvent(*args
, **kwargs
))
4613 def GetX(*args
, **kwargs
):
4617 Returns the X coordinate of the mouse in client coordinates.
4619 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
4621 def GetY(*args
, **kwargs
):
4625 Returns the Y coordinate of the mouse in client coordinates.
4627 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
4629 def SetCursor(*args
, **kwargs
):
4631 SetCursor(self, Cursor cursor)
4633 Sets the cursor associated with this event.
4635 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
4637 def GetCursor(*args
, **kwargs
):
4639 GetCursor(self) -> Cursor
4641 Returns a reference to the cursor specified by this event.
4643 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
4645 def HasCursor(*args
, **kwargs
):
4647 HasCursor(self) -> bool
4649 Returns true if the cursor specified by this event is a valid cursor.
4651 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
4653 _core_
.SetCursorEvent_swigregister(SetCursorEvent
)
4655 #---------------------------------------------------------------------------
4657 class KeyEvent(Event
):
4659 This event class contains information about keypress and character
4660 events. These events are only sent to the widget that currently has
4663 Notice that there are three different kinds of keyboard events in
4664 wxWidgets: key down and up events and char events. The difference
4665 between the first two is clear - the first corresponds to a key press
4666 and the second to a key release - otherwise they are identical. Just
4667 note that if the key is maintained in a pressed state you will
4668 typically get a lot of (automatically generated) down events but only
4669 one up so it is wrong to assume that there is one up event
4670 corresponding to each down one.
4672 Both key events provide untranslated key codes while the char event
4673 carries the translated one. The untranslated code for alphanumeric
4674 keys is always an upper case value. For the other keys it is one of
4675 WXK_XXX values from the keycodes table. The translated key is, in
4676 general, the character the user expects to appear as the result of the
4677 key combination when typing the text into a text entry zone, for
4680 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4681 and the standard US keyboard): when the 'A' key is pressed, the key
4682 down event key code is equal to ASCII A == 65. But the char event key
4683 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4684 'A' keys simultaneously , the key code in key down event will still be
4685 just 'A' while the char event key code parameter will now be 'A' as
4688 Although in this simple case it is clear that the correct key code
4689 could be found in the key down event handler by checking the value
4690 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4691 as for non alphanumeric keys or non-US keyboard layouts the
4692 translation is keyboard-layout dependent and can only be done properly
4693 by the system itself.
4695 Another kind of translation is done when the control key is pressed:
4696 for example, for CTRL-A key press the key down event still carries the
4697 same key code 'A' as usual but the char event will have key code of 1,
4698 the ASCII value of this key combination.
4700 You may discover how the other keys on your system behave
4701 interactively by running the KeyEvents sample in the wxPython demo and
4702 pressing some keys while the blue box at the top has the keyboard
4705 **Note**: If a key down event is caught and the event handler does not
4706 call event.Skip() then the coresponding char event will not
4707 happen. This is by design and enables the programs that handle both
4708 types of events to be a bit simpler.
4710 **Note for Windows programmers**: The key and char events in wxWidgets
4711 are similar to but slightly different from Windows WM_KEYDOWN and
4712 WM_CHAR events. In particular, Alt-x combination will generate a char
4713 event in wxWidgets (unless it is used as an accelerator).
4715 **Tip**: be sure to call event.Skip() for events that you don't
4716 process in key event function, otherwise menu shortcuts may cease to
4720 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4721 __repr__
= _swig_repr
4722 def __init__(self
, *args
, **kwargs
):
4724 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4726 Construct a new `wx.KeyEvent`. Valid event types are:
4729 _core_
.KeyEvent_swiginit(self
,_core_
.new_KeyEvent(*args
, **kwargs
))
4730 def GetModifiers(*args
, **kwargs
):
4732 GetModifiers(self) -> int
4734 Returns a bitmask of the current modifier settings. Can be used to
4735 check if the key event has exactly the given modifiers without having
4736 to explicitly check that the other modifiers are not down. For
4739 if event.GetModifers() == wx.MOD_CONTROL:
4743 return _core_
.KeyEvent_GetModifiers(*args
, **kwargs
)
4745 def ControlDown(*args
, **kwargs
):
4747 ControlDown(self) -> bool
4749 Returns ``True`` if the Control key was down at the time of the event.
4751 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
4753 def MetaDown(*args
, **kwargs
):
4755 MetaDown(self) -> bool
4757 Returns ``True`` if the Meta key was down at the time of the event.
4759 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
4761 def AltDown(*args
, **kwargs
):
4763 AltDown(self) -> bool
4765 Returns ``True`` if the Alt key was down at the time of the event.
4767 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
4769 def ShiftDown(*args
, **kwargs
):
4771 ShiftDown(self) -> bool
4773 Returns ``True`` if the Shift key was down at the time of the event.
4775 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
4777 def CmdDown(*args
, **kwargs
):
4779 CmdDown(self) -> bool
4781 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4782 platforms but the special "Apple" (a.k.a as "Command") key on
4783 Macs. It makes often sense to use it instead of, say, `ControlDown`
4784 because Cmd key is used for the same thing under Mac as Ctrl
4785 elsewhere. The Ctrl still exists, it's just not used for this
4786 purpose. So for non-Mac platforms this is the same as `ControlDown`
4787 and Macs this is the same as `MetaDown`.
4789 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
4791 def HasModifiers(*args
, **kwargs
):
4793 HasModifiers(self) -> bool
4795 Returns true if either CTRL or ALT keys was down at the time of the
4796 key event. Note that this function does not take into account neither
4797 SHIFT nor META key states (the reason for ignoring the latter is that
4798 it is common for NUMLOCK key to be configured as META under X but the
4799 key presses even while NUMLOCK is on should be still processed
4802 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
4804 def GetKeyCode(*args
, **kwargs
):
4806 GetKeyCode(self) -> int
4808 Returns the virtual key code. ASCII events return normal ASCII values,
4809 while non-ASCII events return values such as WXK_LEFT for the left
4810 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4813 Note that in Unicode build, the returned value is meaningful only if
4814 the user entered a character that can be represented in current
4815 locale's default charset. You can obtain the corresponding Unicode
4816 character using `GetUnicodeKey`.
4818 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
4820 KeyCode
= GetKeyCode
4821 def GetUnicodeKey(*args
, **kwargs
):
4823 GetUnicodeKey(self) -> int
4825 Returns the Unicode character corresponding to this key event. This
4826 function is only meaningfule in a Unicode build of wxPython.
4828 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
4830 GetUniChar
= GetUnicodeKey
4831 def GetRawKeyCode(*args
, **kwargs
):
4833 GetRawKeyCode(self) -> unsigned int
4835 Returns the raw key code for this event. This is a platform-dependent
4836 scan code which should only be used in advanced
4837 applications. Currently the raw key codes are not supported by all
4840 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
4842 def GetRawKeyFlags(*args
, **kwargs
):
4844 GetRawKeyFlags(self) -> unsigned int
4846 Returns the low level key flags for this event. The flags are
4847 platform-dependent and should only be used in advanced applications.
4848 Currently the raw key flags are not supported by all ports.
4850 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
4852 def GetPosition(*args
, **kwargs
):
4854 GetPosition(self) -> Point
4856 Find the position of the event, if applicable.
4858 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
4860 def GetPositionTuple(*args
, **kwargs
):
4862 GetPositionTuple() -> (x,y)
4864 Find the position of the event, if applicable.
4866 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
4868 def GetX(*args
, **kwargs
):
4872 Returns the X position (in client coordinates) of the event, if
4875 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
4877 def GetY(*args
, **kwargs
):
4881 Returns the Y position (in client coordinates) of the event, if
4884 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
4886 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
4887 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
4888 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
4889 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
4890 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
4891 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
4892 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
4893 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
4894 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
4895 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
4896 _core_
.KeyEvent_swigregister(KeyEvent
)
4898 #---------------------------------------------------------------------------
4900 class SizeEvent(Event
):
4902 A size event holds information about size change events. The EVT_SIZE
4903 handler function will be called when the window it is bound to has
4906 Note that the size passed is of the whole window: call
4907 `wx.Window.GetClientSize` for the area which may be used by the
4910 When a window is resized, usually only a small part of the window is
4911 damaged and and that area is all that is in the update region for the
4912 next paint event. However, if your drawing depends on the size of the
4913 window, you may need to clear the DC explicitly and repaint the whole
4914 window. In which case, you may need to call `wx.Window.Refresh` to
4915 invalidate the entire window.
4918 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4919 __repr__
= _swig_repr
4920 def __init__(self
, *args
, **kwargs
):
4922 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4924 Construct a new ``wx.SizeEvent``.
4926 _core_
.SizeEvent_swiginit(self
,_core_
.new_SizeEvent(*args
, **kwargs
))
4927 def GetSize(*args
, **kwargs
):
4929 GetSize(self) -> Size
4931 Returns the entire size of the window generating the size change
4934 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
4936 def GetRect(*args
, **kwargs
):
4937 """GetRect(self) -> Rect"""
4938 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
4940 def SetRect(*args
, **kwargs
):
4941 """SetRect(self, Rect rect)"""
4942 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
4944 def SetSize(*args
, **kwargs
):
4945 """SetSize(self, Size size)"""
4946 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
4948 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
4949 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
4950 _core_
.SizeEvent_swigregister(SizeEvent
)
4952 #---------------------------------------------------------------------------
4954 class MoveEvent(Event
):
4956 This event object is sent for EVT_MOVE event bindings when a window is
4957 moved to a new position.
4959 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4960 __repr__
= _swig_repr
4961 def __init__(self
, *args
, **kwargs
):
4963 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4967 _core_
.MoveEvent_swiginit(self
,_core_
.new_MoveEvent(*args
, **kwargs
))
4968 def GetPosition(*args
, **kwargs
):
4970 GetPosition(self) -> Point
4972 Returns the position of the window generating the move change event.
4974 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
4976 def GetRect(*args
, **kwargs
):
4977 """GetRect(self) -> Rect"""
4978 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
4980 def SetRect(*args
, **kwargs
):
4981 """SetRect(self, Rect rect)"""
4982 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
4984 def SetPosition(*args
, **kwargs
):
4985 """SetPosition(self, Point pos)"""
4986 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
4988 m_pos
= property(GetPosition
, SetPosition
)
4989 m_rect
= property(GetRect
, SetRect
)
4991 _core_
.MoveEvent_swigregister(MoveEvent
)
4993 #---------------------------------------------------------------------------
4995 class PaintEvent(Event
):
4997 A paint event is sent when a window's contents needs to be repainted.
4998 Note that in an EVT_PAINT handler the application must *always* create
4999 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5000 Windows assumes that the window has not been painted yet and will send
5001 the event again, causing endless refreshes.
5003 You can optimize painting by retrieving the rectangles that have been
5004 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5005 and only repainting these rectangles. The rectangles are in terms of
5006 the client area, and are unscrolled, so you will need to do some
5007 calculations using the current view position to obtain logical,
5011 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5012 __repr__
= _swig_repr
5013 def __init__(self
, *args
, **kwargs
):
5014 """__init__(self, int Id=0) -> PaintEvent"""
5015 _core_
.PaintEvent_swiginit(self
,_core_
.new_PaintEvent(*args
, **kwargs
))
5016 _core_
.PaintEvent_swigregister(PaintEvent
)
5018 class NcPaintEvent(Event
):
5019 """Proxy of C++ NcPaintEvent class"""
5020 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5021 __repr__
= _swig_repr
5022 def __init__(self
, *args
, **kwargs
):
5023 """__init__(self, int winid=0) -> NcPaintEvent"""
5024 _core_
.NcPaintEvent_swiginit(self
,_core_
.new_NcPaintEvent(*args
, **kwargs
))
5025 _core_
.NcPaintEvent_swigregister(NcPaintEvent
)
5027 #---------------------------------------------------------------------------
5029 class EraseEvent(Event
):
5031 An erase event is sent whenever the background of a window needs to be
5032 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5033 binder. On some platforms, such as GTK+, this event is simulated
5034 (simply generated just before the paint event) and may cause flicker.
5036 To paint a custom background use the `GetDC` method and use the returned
5037 device context if it is not ``None``, otherwise create a temporary
5038 `wx.ClientDC` and draw on that.
5041 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5042 __repr__
= _swig_repr
5043 def __init__(self
, *args
, **kwargs
):
5045 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5049 _core_
.EraseEvent_swiginit(self
,_core_
.new_EraseEvent(*args
, **kwargs
))
5050 def GetDC(*args
, **kwargs
):
5054 Returns the device context the event handler should draw upon. If
5055 ``None`` is returned then create a temporary `wx.ClientDC` and use
5058 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5060 _core_
.EraseEvent_swigregister(EraseEvent
)
5062 #---------------------------------------------------------------------------
5064 class FocusEvent(Event
):
5066 A focus event is sent when a window's focus changes. The window losing
5067 focus receives an EVT_KILL_FOCUS event while the window gaining it
5068 gets an EVT_SET_FOCUS event.
5070 Notice that the set focus event happens both when the user gives focus
5071 to the window (whether using the mouse or keyboard) and when it is
5072 done from the program itself using `wx.Window.SetFocus`.
5075 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5076 __repr__
= _swig_repr
5077 def __init__(self
, *args
, **kwargs
):
5079 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5083 _core_
.FocusEvent_swiginit(self
,_core_
.new_FocusEvent(*args
, **kwargs
))
5084 def GetWindow(*args
, **kwargs
):
5086 GetWindow(self) -> Window
5088 Returns the other window associated with this event, that is the
5089 window which had the focus before for the EVT_SET_FOCUS event and the
5090 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5092 Warning: the window returned may be None!
5094 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5096 def SetWindow(*args
, **kwargs
):
5097 """SetWindow(self, Window win)"""
5098 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5100 _core_
.FocusEvent_swigregister(FocusEvent
)
5102 #---------------------------------------------------------------------------
5104 class ChildFocusEvent(CommandEvent
):
5106 wx.ChildFocusEvent notifies the parent that a child has received the
5107 focus. Unlike `wx.FocusEvent` it is propagated up the window
5110 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5111 __repr__
= _swig_repr
5112 def __init__(self
, *args
, **kwargs
):
5114 __init__(self, Window win=None) -> ChildFocusEvent
5118 _core_
.ChildFocusEvent_swiginit(self
,_core_
.new_ChildFocusEvent(*args
, **kwargs
))
5119 def GetWindow(*args
, **kwargs
):
5121 GetWindow(self) -> Window
5123 The window which has just received the focus.
5125 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5127 _core_
.ChildFocusEvent_swigregister(ChildFocusEvent
)
5129 #---------------------------------------------------------------------------
5131 class ActivateEvent(Event
):
5133 An activate event is sent when a top-level window or the entire
5134 application is being activated or deactivated.
5136 A top-level window (a dialog or frame) receives an activate event when
5137 is being activated or deactivated. This is indicated visually by the
5138 title bar changing colour, and a subwindow gaining the keyboard focus.
5139 An application is activated or deactivated when one of its frames
5140 becomes activated, or a frame becomes inactivate resulting in all
5141 application frames being inactive.
5143 Please note that usually you should call event.Skip() in your handlers
5144 for these events so the default handlers will still be called, as not
5145 doing so can result in strange effects.
5148 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5149 __repr__
= _swig_repr
5150 def __init__(self
, *args
, **kwargs
):
5152 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5156 _core_
.ActivateEvent_swiginit(self
,_core_
.new_ActivateEvent(*args
, **kwargs
))
5157 def GetActive(*args
, **kwargs
):
5159 GetActive(self) -> bool
5161 Returns true if the application or window is being activated, false
5164 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5166 _core_
.ActivateEvent_swigregister(ActivateEvent
)
5168 #---------------------------------------------------------------------------
5170 class InitDialogEvent(Event
):
5172 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5173 any window when `wx.Window.InitDialog` is called. Handlers for this
5174 event can transfer data to the window, or anything else that should be
5175 done before the user begins editing the form. The default handler
5176 calls `wx.Window.TransferDataToWindow`.
5178 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5179 __repr__
= _swig_repr
5180 def __init__(self
, *args
, **kwargs
):
5182 __init__(self, int Id=0) -> InitDialogEvent
5186 _core_
.InitDialogEvent_swiginit(self
,_core_
.new_InitDialogEvent(*args
, **kwargs
))
5187 _core_
.InitDialogEvent_swigregister(InitDialogEvent
)
5189 #---------------------------------------------------------------------------
5191 class MenuEvent(Event
):
5193 This class is used for a variety of menu-related events. Note that
5194 these do not include menu command events, which are handled by sending
5195 `wx.CommandEvent` objects.
5197 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5198 text in the first field of the status bar.
5200 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5201 __repr__
= _swig_repr
5202 def __init__(self
, *args
, **kwargs
):
5204 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5208 _core_
.MenuEvent_swiginit(self
,_core_
.new_MenuEvent(*args
, **kwargs
))
5209 def GetMenuId(*args
, **kwargs
):
5211 GetMenuId(self) -> int
5213 Returns the menu identifier associated with the event. This method
5214 should be only used with the HIGHLIGHT events.
5216 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5218 def IsPopup(*args
, **kwargs
):
5220 IsPopup(self) -> bool
5222 Returns ``True`` if the menu which is being opened or closed is a
5223 popup menu, ``False`` if it is a normal one. This method should only
5224 be used with the OPEN and CLOSE events.
5226 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5228 def GetMenu(*args
, **kwargs
):
5230 GetMenu(self) -> Menu
5232 Returns the menu which is being opened or closed. This method should
5233 only be used with the OPEN and CLOSE events.
5235 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5237 _core_
.MenuEvent_swigregister(MenuEvent
)
5239 #---------------------------------------------------------------------------
5241 class CloseEvent(Event
):
5243 This event class contains information about window and session close
5246 The handler function for EVT_CLOSE is called when the user has tried
5247 to close a a frame or dialog box using the window manager controls or
5248 the system menu. It can also be invoked by the application itself
5249 programmatically, for example by calling the `wx.Window.Close`
5252 You should check whether the application is forcing the deletion of
5253 the window using `CanVeto`. If it returns ``False``, you must destroy
5254 the window using `wx.Window.Destroy`. If the return value is ``True``,
5255 it is up to you whether you respond by destroying the window or not.
5256 For example you may wish to display a message dialog prompting to save
5257 files or to cancel the close.
5259 If you don't destroy the window, you should call `Veto` to let the
5260 calling code know that you did not destroy the window. This allows the
5261 `wx.Window.Close` function to return ``True`` or ``False`` depending
5262 on whether the close instruction was honored or not.
5264 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5265 __repr__
= _swig_repr
5266 def __init__(self
, *args
, **kwargs
):
5268 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5272 _core_
.CloseEvent_swiginit(self
,_core_
.new_CloseEvent(*args
, **kwargs
))
5273 def SetLoggingOff(*args
, **kwargs
):
5275 SetLoggingOff(self, bool logOff)
5277 Sets the 'logging off' flag.
5279 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5281 def GetLoggingOff(*args
, **kwargs
):
5283 GetLoggingOff(self) -> bool
5285 Returns ``True`` if the user is logging off or ``False`` if the
5286 system is shutting down. This method can only be called for end
5287 session and query end session events, it doesn't make sense for close
5290 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5292 def Veto(*args
, **kwargs
):
5294 Veto(self, bool veto=True)
5296 Call this from your event handler to veto a system shutdown or to
5297 signal to the calling application that a window close did not happen.
5299 You can only veto a shutdown or close if `CanVeto` returns true.
5301 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5303 def GetVeto(*args
, **kwargs
):
5304 """GetVeto(self) -> bool"""
5305 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5307 def SetCanVeto(*args
, **kwargs
):
5309 SetCanVeto(self, bool canVeto)
5311 Sets the 'can veto' flag.
5313 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5315 def CanVeto(*args
, **kwargs
):
5317 CanVeto(self) -> bool
5319 Returns true if you can veto a system shutdown or a window close
5320 event. Vetoing a window close event is not possible if the calling
5321 code wishes to force the application to exit, and so this function
5322 must be called to check this.
5324 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5326 _core_
.CloseEvent_swigregister(CloseEvent
)
5328 #---------------------------------------------------------------------------
5330 class ShowEvent(Event
):
5331 """An EVT_SHOW event is sent when a window is shown or hidden."""
5332 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5333 __repr__
= _swig_repr
5334 def __init__(self
, *args
, **kwargs
):
5336 __init__(self, int winid=0, bool show=False) -> ShowEvent
5338 An EVT_SHOW event is sent when a window is shown or hidden.
5340 _core_
.ShowEvent_swiginit(self
,_core_
.new_ShowEvent(*args
, **kwargs
))
5341 def SetShow(*args
, **kwargs
):
5342 """SetShow(self, bool show)"""
5343 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5345 def GetShow(*args
, **kwargs
):
5346 """GetShow(self) -> bool"""
5347 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5349 _core_
.ShowEvent_swigregister(ShowEvent
)
5351 #---------------------------------------------------------------------------
5353 class IconizeEvent(Event
):
5355 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5358 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5359 __repr__
= _swig_repr
5360 def __init__(self
, *args
, **kwargs
):
5362 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5364 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5367 _core_
.IconizeEvent_swiginit(self
,_core_
.new_IconizeEvent(*args
, **kwargs
))
5368 def Iconized(*args
, **kwargs
):
5370 Iconized(self) -> bool
5372 Returns ``True`` if the frame has been iconized, ``False`` if it has
5375 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5377 _core_
.IconizeEvent_swigregister(IconizeEvent
)
5379 #---------------------------------------------------------------------------
5381 class MaximizeEvent(Event
):
5382 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5383 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5384 __repr__
= _swig_repr
5385 def __init__(self
, *args
, **kwargs
):
5387 __init__(self, int id=0) -> MaximizeEvent
5389 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5391 _core_
.MaximizeEvent_swiginit(self
,_core_
.new_MaximizeEvent(*args
, **kwargs
))
5392 _core_
.MaximizeEvent_swigregister(MaximizeEvent
)
5394 #---------------------------------------------------------------------------
5396 class DropFilesEvent(Event
):
5398 This class is used for drop files events, that is, when files have
5399 been dropped onto the window. This functionality is only available
5400 under Windows. The window must have previously been enabled for
5401 dropping by calling `wx.Window.DragAcceptFiles`.
5403 Important note: this is a separate implementation to the more general
5404 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5405 implementation uses the older, Windows message-based approach of
5408 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5412 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5413 def __init__(self
): raise AttributeError, "No constructor defined"
5414 __repr__
= _swig_repr
5415 def GetPosition(*args
, **kwargs
):
5417 GetPosition(self) -> Point
5419 Returns the position at which the files were dropped.
5421 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5423 def GetNumberOfFiles(*args
, **kwargs
):
5425 GetNumberOfFiles(self) -> int
5427 Returns the number of files dropped.
5429 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5431 def GetFiles(*args
, **kwargs
):
5433 GetFiles(self) -> PyObject
5435 Returns a list of the filenames that were dropped.
5437 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5439 _core_
.DropFilesEvent_swigregister(DropFilesEvent
)
5441 #---------------------------------------------------------------------------
5443 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5444 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5445 class UpdateUIEvent(CommandEvent
):
5447 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5448 wxWidgets to give an application the chance to update various user
5451 Without update UI events, an application has to work hard to
5452 check/uncheck, enable/disable, and set the text for elements such as
5453 menu items and toolbar buttons. The code for doing this has to be
5454 mixed up with the code that is invoked when an action is invoked for a
5455 menu item or button.
5457 With update UI events, you define an event handler to look at the
5458 state of the application and change UI elements accordingly. wxWidgets
5459 will call your handler functions in idle time, so you don't have to
5460 worry where to call this code. In addition to being a clearer and more
5461 declarative method, it also means you don't have to worry whether
5462 you're updating a toolbar or menubar identifier. The same handler can
5463 update a menu item and toolbar button, if the ID values are the same.
5465 Instead of directly manipulating the menu or button, you call
5466 functions in the event object, such as `Check`. wxWidgets will
5467 determine whether such a call has been made, and which UI element to
5470 These events will work for popup menus as well as menubars. Just
5471 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5472 any UI events for the window that owns the menu.
5474 If you find that the overhead of UI update processing is affecting
5475 your application, you can do one or both of the following:
5477 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5478 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5479 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5480 receive update events. No other windows will receive update
5483 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5484 value to set the delay between updates. You may need to call
5485 `wx.Window.UpdateWindowUI` at critical points, for example when
5486 a dialog is about to be shown, in case the user sees a slight
5487 delay before windows are updated.
5489 Note that although events are sent in idle time, defining a EVT_IDLE
5490 handler for a window does not affect this because the events are sent
5491 from an internal idle handler.
5493 wxWidgets tries to optimize update events on some platforms. On
5494 Windows and GTK+, events for menubar items are only sent when the menu
5495 is about to be shown, and not in idle time.
5498 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5499 __repr__
= _swig_repr
5500 def __init__(self
, *args
, **kwargs
):
5502 __init__(self, int commandId=0) -> UpdateUIEvent
5506 _core_
.UpdateUIEvent_swiginit(self
,_core_
.new_UpdateUIEvent(*args
, **kwargs
))
5507 def GetChecked(*args
, **kwargs
):
5509 GetChecked(self) -> bool
5511 Returns ``True`` if the UI element should be checked.
5513 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
5515 def GetEnabled(*args
, **kwargs
):
5517 GetEnabled(self) -> bool
5519 Returns ``True`` if the UI element should be enabled.
5521 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
5523 def GetShown(*args
, **kwargs
):
5525 GetShown(self) -> bool
5527 Returns ``True`` if the UI element should be shown.
5529 return _core_
.UpdateUIEvent_GetShown(*args
, **kwargs
)
5531 def GetText(*args
, **kwargs
):
5533 GetText(self) -> String
5535 Returns the text that should be set for the UI element.
5537 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
5539 def GetSetText(*args
, **kwargs
):
5541 GetSetText(self) -> bool
5543 Returns ``True`` if the application has called `SetText`. For
5544 wxWidgets internal use only.
5546 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
5548 def GetSetChecked(*args
, **kwargs
):
5550 GetSetChecked(self) -> bool
5552 Returns ``True`` if the application has called `Check`. For wxWidgets
5555 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
5557 def GetSetEnabled(*args
, **kwargs
):
5559 GetSetEnabled(self) -> bool
5561 Returns ``True`` if the application has called `Enable`. For wxWidgets
5564 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
5566 def GetSetShown(*args
, **kwargs
):
5568 GetSetShown(self) -> bool
5570 Returns ``True`` if the application has called `Show`. For wxWidgets
5573 return _core_
.UpdateUIEvent_GetSetShown(*args
, **kwargs
)
5575 def Check(*args
, **kwargs
):
5577 Check(self, bool check)
5579 Check or uncheck the UI element.
5581 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
5583 def Enable(*args
, **kwargs
):
5585 Enable(self, bool enable)
5587 Enable or disable the UI element.
5589 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
5591 def Show(*args
, **kwargs
):
5593 Show(self, bool show)
5595 Show or hide the UI element.
5597 return _core_
.UpdateUIEvent_Show(*args
, **kwargs
)
5599 def SetText(*args
, **kwargs
):
5601 SetText(self, String text)
5603 Sets the text for this UI element.
5605 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
5607 def SetUpdateInterval(*args
, **kwargs
):
5609 SetUpdateInterval(long updateInterval)
5611 Sets the interval between updates in milliseconds. Set to -1 to
5612 disable updates, or to 0 to update as frequently as possible. The
5615 Use this to reduce the overhead of UI update events if your
5616 application has a lot of windows. If you set the value to -1 or
5617 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5618 at appropriate points in your application, such as when a dialog is
5621 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5623 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
5624 def GetUpdateInterval(*args
, **kwargs
):
5626 GetUpdateInterval() -> long
5628 Returns the current interval between updates in milliseconds. -1
5629 disables updates, 0 updates as frequently as possible.
5631 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5633 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
5634 def CanUpdate(*args
, **kwargs
):
5636 CanUpdate(Window win) -> bool
5638 Returns ``True`` if it is appropriate to update (send UI update events
5641 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5642 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5643 events were last sent in idle time, and the update interval, to
5644 determine whether events should be sent to this window now. By default
5645 this will always return true because the update mode is initially
5646 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5647 events will be sent as often as possible. You can reduce the frequency
5648 that events are sent by changing the mode and/or setting an update
5652 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5654 CanUpdate
= staticmethod(CanUpdate
)
5655 def ResetUpdateTime(*args
, **kwargs
):
5659 Used internally to reset the last-updated time to the current time. It
5660 is assumed that update events are normally sent in idle time, so this
5661 is called at the end of idle processing.
5663 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5665 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
5666 def SetMode(*args
, **kwargs
):
5670 Specify how wxWidgets will send update events: to all windows, or only
5671 to those which specify that they will process the events.
5673 The mode may be one of the following values:
5675 ============================= ==========================================
5676 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5677 is the default setting.
5678 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5679 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5681 ============================= ==========================================
5684 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5686 SetMode
= staticmethod(SetMode
)
5687 def GetMode(*args
, **kwargs
):
5691 Returns a value specifying how wxWidgets will send update events: to
5692 all windows, or only to those which specify that they will process the
5695 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5697 GetMode
= staticmethod(GetMode
)
5698 _core_
.UpdateUIEvent_swigregister(UpdateUIEvent
)
5700 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
5702 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5704 Sets the interval between updates in milliseconds. Set to -1 to
5705 disable updates, or to 0 to update as frequently as possible. The
5708 Use this to reduce the overhead of UI update events if your
5709 application has a lot of windows. If you set the value to -1 or
5710 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5711 at appropriate points in your application, such as when a dialog is
5714 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5716 def UpdateUIEvent_GetUpdateInterval(*args
):
5718 UpdateUIEvent_GetUpdateInterval() -> long
5720 Returns the current interval between updates in milliseconds. -1
5721 disables updates, 0 updates as frequently as possible.
5723 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
)
5725 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
5727 UpdateUIEvent_CanUpdate(Window win) -> bool
5729 Returns ``True`` if it is appropriate to update (send UI update events
5732 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5733 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5734 events were last sent in idle time, and the update interval, to
5735 determine whether events should be sent to this window now. By default
5736 this will always return true because the update mode is initially
5737 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5738 events will be sent as often as possible. You can reduce the frequency
5739 that events are sent by changing the mode and/or setting an update
5743 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5745 def UpdateUIEvent_ResetUpdateTime(*args
):
5747 UpdateUIEvent_ResetUpdateTime()
5749 Used internally to reset the last-updated time to the current time. It
5750 is assumed that update events are normally sent in idle time, so this
5751 is called at the end of idle processing.
5753 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
)
5755 def UpdateUIEvent_SetMode(*args
, **kwargs
):
5757 UpdateUIEvent_SetMode(int mode)
5759 Specify how wxWidgets will send update events: to all windows, or only
5760 to those which specify that they will process the events.
5762 The mode may be one of the following values:
5764 ============================= ==========================================
5765 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5766 is the default setting.
5767 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5768 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5770 ============================= ==========================================
5773 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5775 def UpdateUIEvent_GetMode(*args
):
5777 UpdateUIEvent_GetMode() -> int
5779 Returns a value specifying how wxWidgets will send update events: to
5780 all windows, or only to those which specify that they will process the
5783 return _core_
.UpdateUIEvent_GetMode(*args
)
5785 #---------------------------------------------------------------------------
5787 class SysColourChangedEvent(Event
):
5789 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5790 when the user changes the colour settings using the control
5791 panel. This is only applicable under Windows.
5793 The default event handler for this event propagates the event to child
5794 windows, since Windows only sends the events to top-level windows. If
5795 intercepting this event for a top-level window, remember to call
5796 `Skip` so the the base class handler will still be executed, or to
5797 pass the event on to the window's children explicitly.
5800 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5801 __repr__
= _swig_repr
5802 def __init__(self
, *args
, **kwargs
):
5804 __init__(self) -> SysColourChangedEvent
5808 _core_
.SysColourChangedEvent_swiginit(self
,_core_
.new_SysColourChangedEvent(*args
, **kwargs
))
5809 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEvent
)
5811 #---------------------------------------------------------------------------
5813 class MouseCaptureChangedEvent(Event
):
5815 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5816 a window that loses its mouse capture. This is called even if
5817 `wx.Window.ReleaseMouse` was called by the application code. Handling
5818 this event allows an application to cater for unexpected capture
5819 releases which might otherwise confuse mouse handling code.
5821 This event is implemented under Windows only.
5823 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5824 __repr__
= _swig_repr
5825 def __init__(self
, *args
, **kwargs
):
5827 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5831 _core_
.MouseCaptureChangedEvent_swiginit(self
,_core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
))
5832 def GetCapturedWindow(*args
, **kwargs
):
5834 GetCapturedWindow(self) -> Window
5836 Returns the window that gained the capture, or ``None`` if it was a
5837 non-wxWidgets window.
5839 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
5841 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent
)
5843 #---------------------------------------------------------------------------
5845 class DisplayChangedEvent(Event
):
5847 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5848 resolution has changed.
5850 This event is implemented under Windows only.
5852 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5853 __repr__
= _swig_repr
5854 def __init__(self
, *args
, **kwargs
):
5855 """__init__(self) -> DisplayChangedEvent"""
5856 _core_
.DisplayChangedEvent_swiginit(self
,_core_
.new_DisplayChangedEvent(*args
, **kwargs
))
5857 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEvent
)
5859 #---------------------------------------------------------------------------
5861 class PaletteChangedEvent(Event
):
5863 An EVT_PALETTE_CHANGED event is sent when the system palette has
5864 changed, thereby giving each window a chance to redo their own to
5867 This event is implemented under Windows only.
5869 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5870 __repr__
= _swig_repr
5871 def __init__(self
, *args
, **kwargs
):
5873 __init__(self, int id=0) -> PaletteChangedEvent
5875 An EVT_PALETTE_CHANGED event is sent when the system palette has
5876 changed, thereby giving each window a chance to redo their own to
5879 This event is implemented under Windows only.
5881 _core_
.PaletteChangedEvent_swiginit(self
,_core_
.new_PaletteChangedEvent(*args
, **kwargs
))
5882 def SetChangedWindow(*args
, **kwargs
):
5883 """SetChangedWindow(self, Window win)"""
5884 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
5886 def GetChangedWindow(*args
, **kwargs
):
5887 """GetChangedWindow(self) -> Window"""
5888 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
5890 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEvent
)
5892 #---------------------------------------------------------------------------
5894 class QueryNewPaletteEvent(Event
):
5896 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5897 focus and should re-do its palette.
5899 This event is implemented under Windows only.
5901 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5902 __repr__
= _swig_repr
5903 def __init__(self
, *args
, **kwargs
):
5905 __init__(self, int winid=0) -> QueryNewPaletteEvent
5909 _core_
.QueryNewPaletteEvent_swiginit(self
,_core_
.new_QueryNewPaletteEvent(*args
, **kwargs
))
5910 def SetPaletteRealized(*args
, **kwargs
):
5912 SetPaletteRealized(self, bool realized)
5914 App should set this if it changes the palette.
5916 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
5918 def GetPaletteRealized(*args
, **kwargs
):
5919 """GetPaletteRealized(self) -> bool"""
5920 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
5922 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent
)
5924 #---------------------------------------------------------------------------
5926 class NavigationKeyEvent(Event
):
5928 EVT_NAVIGATION_KEY events are used to control moving the focus between
5929 widgets, otherwise known as tab-traversal. You woudl normally not
5930 catch navigation events in applications as there are already
5931 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5932 it useful to send navigation events in certain situations to change
5933 the focus in certain ways, although it's probably easier to just call
5934 `wx.Window.Navigate`.
5936 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5937 __repr__
= _swig_repr
5938 def __init__(self
, *args
, **kwargs
):
5939 """__init__(self) -> NavigationKeyEvent"""
5940 _core_
.NavigationKeyEvent_swiginit(self
,_core_
.new_NavigationKeyEvent(*args
, **kwargs
))
5941 def GetDirection(*args
, **kwargs
):
5943 GetDirection(self) -> bool
5945 Returns ``True`` if the direction is forward, ``False`` otherwise.
5947 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
5949 def SetDirection(*args
, **kwargs
):
5951 SetDirection(self, bool forward)
5953 Specify the direction that the navigation should take. Usually the
5954 difference between using Tab and Shift-Tab.
5956 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
5958 def IsWindowChange(*args
, **kwargs
):
5960 IsWindowChange(self) -> bool
5962 Returns ``True`` if window change is allowed.
5964 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
5966 def SetWindowChange(*args
, **kwargs
):
5968 SetWindowChange(self, bool ischange)
5970 Specify if the navigation should be able to change parent windows.
5971 For example, changing notebook pages, etc. This is usually implemented
5972 by using Control-Tab.
5974 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
5976 def IsFromTab(*args
, **kwargs
):
5978 IsFromTab(self) -> bool
5980 Returns ``True`` if the navigation event is originated from the Tab
5983 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
5985 def SetFromTab(*args
, **kwargs
):
5987 SetFromTab(self, bool bIs)
5989 Set to true under MSW if the event was generated using the tab key.
5990 This is required for proper navogation over radio buttons.
5992 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
5994 def SetFlags(*args
, **kwargs
):
5996 SetFlags(self, long flags)
5998 Set the navigation flags to a combination of the following:
6000 * wx.NavigationKeyEvent.IsBackward
6001 * wx.NavigationKeyEvent.IsForward
6002 * wx.NavigationKeyEvent.WinChange
6003 * wx.NavigationKeyEvent.FromTab
6006 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6008 def GetCurrentFocus(*args
, **kwargs
):
6010 GetCurrentFocus(self) -> Window
6012 Returns the child window which currenty has the focus. May be
6015 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6017 def SetCurrentFocus(*args
, **kwargs
):
6019 SetCurrentFocus(self, Window win)
6021 Set the window that has the focus.
6023 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6025 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6026 IsForward
= _core_
.NavigationKeyEvent_IsForward
6027 WinChange
= _core_
.NavigationKeyEvent_WinChange
6028 FromTab
= _core_
.NavigationKeyEvent_FromTab
6029 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEvent
)
6031 #---------------------------------------------------------------------------
6033 class WindowCreateEvent(CommandEvent
):
6035 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6036 underlying GUI object) exists.
6038 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6039 __repr__
= _swig_repr
6040 def __init__(self
, *args
, **kwargs
):
6042 __init__(self, Window win=None) -> WindowCreateEvent
6044 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6045 underlying GUI object) exists.
6047 _core_
.WindowCreateEvent_swiginit(self
,_core_
.new_WindowCreateEvent(*args
, **kwargs
))
6048 def GetWindow(*args
, **kwargs
):
6050 GetWindow(self) -> Window
6052 Returns the window that this event refers to.
6054 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6056 _core_
.WindowCreateEvent_swigregister(WindowCreateEvent
)
6058 class WindowDestroyEvent(CommandEvent
):
6060 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6061 when the GUI window is destroyed.
6063 When a class derived from `wx.Window` is destroyed its destructor will
6064 have already run by the time this event is sent. Therefore this event
6065 will not usually be received at all by the window itself. Since it is
6066 received after the destructor has run, an object should not try to
6067 handle its own wx.WindowDestroyEvent, but it can be used to get
6068 notification of the destruction of another window.
6070 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6071 __repr__
= _swig_repr
6072 def __init__(self
, *args
, **kwargs
):
6074 __init__(self, Window win=None) -> WindowDestroyEvent
6076 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6077 when the GUI window is destroyed.
6079 When a class derived from `wx.Window` is destroyed its destructor will
6080 have already run by the time this event is sent. Therefore this event
6081 will not usually be received at all by the window itself. Since it is
6082 received after the destructor has run, an object should not try to
6083 handle its own wx.WindowDestroyEvent, but it can be used to get
6084 notification of the destruction of another window.
6086 _core_
.WindowDestroyEvent_swiginit(self
,_core_
.new_WindowDestroyEvent(*args
, **kwargs
))
6087 def GetWindow(*args
, **kwargs
):
6089 GetWindow(self) -> Window
6091 Returns the window that this event refers to.
6093 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6095 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEvent
)
6097 #---------------------------------------------------------------------------
6099 class ContextMenuEvent(CommandEvent
):
6101 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6102 give the application a chance to show a context (popup) menu.
6104 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6105 __repr__
= _swig_repr
6106 def __init__(self
, *args
, **kwargs
):
6108 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6112 _core_
.ContextMenuEvent_swiginit(self
,_core_
.new_ContextMenuEvent(*args
, **kwargs
))
6113 def GetPosition(*args
, **kwargs
):
6115 GetPosition(self) -> Point
6117 Returns the position (in screen coordinants) at which the menu should
6120 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6122 def SetPosition(*args
, **kwargs
):
6124 SetPosition(self, Point pos)
6126 Sets the position at which the menu should be shown.
6128 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6130 _core_
.ContextMenuEvent_swigregister(ContextMenuEvent
)
6132 #---------------------------------------------------------------------------
6134 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6135 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6136 class IdleEvent(Event
):
6138 This class is used for EVT_IDLE events, which are generated and sent
6139 when the application *becomes* idle. In other words, the when the
6140 event queue becomes empty then idle events are sent to all windows (by
6141 default) and as long as none of them call `RequestMore` then there are
6142 no more idle events until after the system event queue has some normal
6143 events and then becomes empty again.
6145 By default, idle events are sent to all windows. If this is causing a
6146 significant overhead in your application, you can call
6147 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6148 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6149 which should receive idle events. Then idle events will only be sent
6150 to those windows and not to any others.
6152 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6153 __repr__
= _swig_repr
6154 def __init__(self
, *args
, **kwargs
):
6156 __init__(self) -> IdleEvent
6160 _core_
.IdleEvent_swiginit(self
,_core_
.new_IdleEvent(*args
, **kwargs
))
6161 def RequestMore(*args
, **kwargs
):
6163 RequestMore(self, bool needMore=True)
6165 Tells wxWidgets that more processing is required. This function can be
6166 called by an EVT_IDLE handler for a window to indicate that the
6167 application should forward the EVT_IDLE event once more to the
6168 application windows. If no window calls this function during its
6169 EVT_IDLE handler, then the application will remain in a passive event
6170 loop until a new event is posted to the application by the windowing
6173 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6175 def MoreRequested(*args
, **kwargs
):
6177 MoreRequested(self) -> bool
6179 Returns ``True`` if the OnIdle function processing this event
6180 requested more processing time.
6182 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6184 def SetMode(*args
, **kwargs
):
6188 Static method for specifying how wxWidgets will send idle events: to
6189 all windows, or only to those which specify that they will process the
6192 The mode can be one of the following values:
6194 ========================= ========================================
6195 wx.IDLE_PROCESS_ALL Send idle events to all windows
6196 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6197 the wx.WS_EX_PROCESS_IDLE extra style
6199 ========================= ========================================
6202 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6204 SetMode
= staticmethod(SetMode
)
6205 def GetMode(*args
, **kwargs
):
6209 Static method returning a value specifying how wxWidgets will send
6210 idle events: to all windows, or only to those which specify that they
6211 will process the events.
6213 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6215 GetMode
= staticmethod(GetMode
)
6216 def CanSend(*args
, **kwargs
):
6218 CanSend(Window win) -> bool
6220 Returns ``True`` if it is appropriate to send idle events to this
6223 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6224 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6225 events should be sent to this window now. By default this will always
6226 return ``True`` because the update mode is initially
6227 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6228 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6230 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6232 CanSend
= staticmethod(CanSend
)
6233 _core_
.IdleEvent_swigregister(IdleEvent
)
6235 def IdleEvent_SetMode(*args
, **kwargs
):
6237 IdleEvent_SetMode(int mode)
6239 Static method for specifying how wxWidgets will send idle events: to
6240 all windows, or only to those which specify that they will process the
6243 The mode can be one of the following values:
6245 ========================= ========================================
6246 wx.IDLE_PROCESS_ALL Send idle events to all windows
6247 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6248 the wx.WS_EX_PROCESS_IDLE extra style
6250 ========================= ========================================
6253 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6255 def IdleEvent_GetMode(*args
):
6257 IdleEvent_GetMode() -> int
6259 Static method returning a value specifying how wxWidgets will send
6260 idle events: to all windows, or only to those which specify that they
6261 will process the events.
6263 return _core_
.IdleEvent_GetMode(*args
)
6265 def IdleEvent_CanSend(*args
, **kwargs
):
6267 IdleEvent_CanSend(Window win) -> bool
6269 Returns ``True`` if it is appropriate to send idle events to this
6272 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6273 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6274 events should be sent to this window now. By default this will always
6275 return ``True`` because the update mode is initially
6276 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6277 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6279 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6281 #---------------------------------------------------------------------------
6283 class ClipboardTextEvent(CommandEvent
):
6285 A Clipboard Text event is sent when a window intercepts a text
6286 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6287 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6288 popup menu command, etc. NOTE : under windows these events are *NOT*
6289 generated automatically for a Rich Edit text control.
6291 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6292 __repr__
= _swig_repr
6293 def __init__(self
, *args
, **kwargs
):
6295 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6297 A Clipboard Text event is sent when a window intercepts a text
6298 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6299 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6300 popup menu command, etc. NOTE : under windows these events are *NOT*
6301 generated automatically for a Rich Edit text control.
6303 _core_
.ClipboardTextEvent_swiginit(self
,_core_
.new_ClipboardTextEvent(*args
, **kwargs
))
6304 _core_
.ClipboardTextEvent_swigregister(ClipboardTextEvent
)
6306 #---------------------------------------------------------------------------
6308 class PyEvent(Event
):
6310 wx.PyEvent can be used as a base class for implementing custom event
6311 types in Python. You should derived from this class instead of
6312 `wx.Event` because this class is Python-aware and is able to transport
6313 its Python bits safely through the wxWidgets event system and have
6314 them still be there when the event handler is invoked.
6316 :see: `wx.PyCommandEvent`
6319 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6320 __repr__
= _swig_repr
6321 def __init__(self
, *args
, **kwargs
):
6322 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6323 _core_
.PyEvent_swiginit(self
,_core_
.new_PyEvent(*args
, **kwargs
))
6326 __swig_destroy__
= _core_
.delete_PyEvent
6327 __del__
= lambda self
: None;
6328 def _SetSelf(*args
, **kwargs
):
6329 """_SetSelf(self, PyObject self)"""
6330 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6332 def _GetSelf(*args
, **kwargs
):
6333 """_GetSelf(self) -> PyObject"""
6334 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6336 _core_
.PyEvent_swigregister(PyEvent
)
6338 class PyCommandEvent(CommandEvent
):
6340 wx.PyCommandEvent can be used as a base class for implementing custom
6341 event types in Python, where the event shoudl travel up to parent
6342 windows looking for a handler. You should derived from this class
6343 instead of `wx.CommandEvent` because this class is Python-aware and is
6344 able to transport its Python bits safely through the wxWidgets event
6345 system and have them still be there when the event handler is invoked.
6350 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6351 __repr__
= _swig_repr
6352 def __init__(self
, *args
, **kwargs
):
6353 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6354 _core_
.PyCommandEvent_swiginit(self
,_core_
.new_PyCommandEvent(*args
, **kwargs
))
6357 __swig_destroy__
= _core_
.delete_PyCommandEvent
6358 __del__
= lambda self
: None;
6359 def _SetSelf(*args
, **kwargs
):
6360 """_SetSelf(self, PyObject self)"""
6361 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6363 def _GetSelf(*args
, **kwargs
):
6364 """_GetSelf(self) -> PyObject"""
6365 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6367 _core_
.PyCommandEvent_swigregister(PyCommandEvent
)
6369 class DateEvent(CommandEvent
):
6371 This event class holds information about a date change event and is
6372 used together with `wx.DatePickerCtrl`. It also serves as a base class
6373 for `wx.calendar.CalendarEvent`. Bind these event types with
6376 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6377 __repr__
= _swig_repr
6378 def __init__(self
, *args
, **kwargs
):
6379 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6380 _core_
.DateEvent_swiginit(self
,_core_
.new_DateEvent(*args
, **kwargs
))
6381 def GetDate(*args
, **kwargs
):
6383 GetDate(self) -> DateTime
6387 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6389 def SetDate(*args
, **kwargs
):
6391 SetDate(self, DateTime date)
6393 Sets the date carried by the event, normally only used by the library
6396 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
6398 _core_
.DateEvent_swigregister(DateEvent
)
6400 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
6401 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
6403 #---------------------------------------------------------------------------
6405 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
6406 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
6407 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
6408 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
6409 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
6410 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
6411 class PyApp(EvtHandler
):
6413 The ``wx.PyApp`` class is an *implementation detail*, please use the
6414 `wx.App` class (or some other derived class) instead.
6416 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6417 __repr__
= _swig_repr
6418 def __init__(self
, *args
, **kwargs
):
6420 __init__(self) -> PyApp
6422 Create a new application object, starting the bootstrap process.
6424 _core_
.PyApp_swiginit(self
,_core_
.new_PyApp(*args
, **kwargs
))
6425 self
._setCallbackInfo
(self
, PyApp
, False)
6426 self
._setOORInfo
(self
, False)
6428 __swig_destroy__
= _core_
.delete_PyApp
6429 __del__
= lambda self
: None;
6430 def _setCallbackInfo(*args
, **kwargs
):
6431 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6432 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
6434 def GetAppName(*args
, **kwargs
):
6436 GetAppName(self) -> String
6438 Get the application name.
6440 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
6442 def SetAppName(*args
, **kwargs
):
6444 SetAppName(self, String name)
6446 Set the application name. This value may be used automatically by
6447 `wx.Config` and such.
6449 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
6451 def GetClassName(*args
, **kwargs
):
6453 GetClassName(self) -> String
6455 Get the application's class name.
6457 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
6459 def SetClassName(*args
, **kwargs
):
6461 SetClassName(self, String name)
6463 Set the application's class name. This value may be used for
6464 X-resources if applicable for the platform
6466 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
6468 def GetVendorName(*args
, **kwargs
):
6470 GetVendorName(self) -> String
6472 Get the application's vendor name.
6474 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
6476 def SetVendorName(*args
, **kwargs
):
6478 SetVendorName(self, String name)
6480 Set the application's vendor name. This value may be used
6481 automatically by `wx.Config` and such.
6483 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
6485 def GetTraits(*args
, **kwargs
):
6487 GetTraits(self) -> wxAppTraits
6489 Return (and create if necessary) the app traits object to which we
6490 delegate for everything which either should be configurable by the
6491 user (then he can change the default behaviour simply by overriding
6492 CreateTraits() and returning his own traits object) or which is
6493 GUI/console dependent as then wx.AppTraits allows us to abstract the
6494 differences behind the common facade.
6496 :todo: Add support for overriding CreateAppTraits in wxPython.
6498 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
6500 def ProcessPendingEvents(*args
, **kwargs
):
6502 ProcessPendingEvents(self)
6504 Process all events in the Pending Events list -- it is necessary to
6505 call this function to process posted events. This normally happens
6506 during each event loop iteration.
6508 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
6510 def Yield(*args
, **kwargs
):
6512 Yield(self, bool onlyIfNeeded=False) -> bool
6514 Process all currently pending events right now, instead of waiting
6515 until return to the event loop. It is an error to call ``Yield``
6516 recursively unless the value of ``onlyIfNeeded`` is True.
6518 :warning: This function is dangerous as it can lead to unexpected
6519 reentrancies (i.e. when called from an event handler it may
6520 result in calling the same event handler again), use with
6521 extreme care or, better, don't use at all!
6523 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6526 return _core_
.PyApp_Yield(*args
, **kwargs
)
6528 def WakeUpIdle(*args
, **kwargs
):
6532 Make sure that idle events are sent again.
6533 :see: `wx.WakeUpIdle`
6535 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
6537 def IsMainLoopRunning(*args
, **kwargs
):
6539 IsMainLoopRunning() -> bool
6541 Returns True if we're running the main loop, i.e. if the events can
6542 currently be dispatched.
6544 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
6546 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
6547 def MainLoop(*args
, **kwargs
):
6549 MainLoop(self) -> int
6551 Execute the main GUI loop, the function doesn't normally return until
6552 all top level windows have been closed and destroyed.
6554 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
6556 def Exit(*args
, **kwargs
):
6560 Exit the main loop thus terminating the application.
6563 return _core_
.PyApp_Exit(*args
, **kwargs
)
6565 def ExitMainLoop(*args
, **kwargs
):
6569 Exit the main GUI loop during the next iteration of the main
6570 loop, (i.e. it does not stop the program immediately!)
6572 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
6574 def Pending(*args
, **kwargs
):
6576 Pending(self) -> bool
6578 Returns True if there are unprocessed events in the event queue.
6580 return _core_
.PyApp_Pending(*args
, **kwargs
)
6582 def Dispatch(*args
, **kwargs
):
6584 Dispatch(self) -> bool
6586 Process the first event in the event queue (blocks until an event
6587 appears if there are none currently)
6589 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
6591 def ProcessIdle(*args
, **kwargs
):
6593 ProcessIdle(self) -> bool
6595 Called from the MainLoop when the application becomes idle (there are
6596 no pending events) and sends a `wx.IdleEvent` to all interested
6597 parties. Returns True if more idle events are needed, False if not.
6599 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
6601 def SendIdleEvents(*args
, **kwargs
):
6603 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6605 Send idle event to window and all subwindows. Returns True if more
6606 idle time is requested.
6608 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
6610 def IsActive(*args
, **kwargs
):
6612 IsActive(self) -> bool
6614 Return True if our app has focus.
6616 return _core_
.PyApp_IsActive(*args
, **kwargs
)
6618 def SetTopWindow(*args
, **kwargs
):
6620 SetTopWindow(self, Window win)
6622 Set the *main* top level window
6624 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
6626 def GetTopWindow(*args
, **kwargs
):
6628 GetTopWindow(self) -> Window
6630 Return the *main* top level window (if it hadn't been set previously
6631 with SetTopWindow(), will return just some top level window and, if
6632 there not any, will return None)
6634 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
6636 def SetExitOnFrameDelete(*args
, **kwargs
):
6638 SetExitOnFrameDelete(self, bool flag)
6640 Control the exit behaviour: by default, the program will exit the main
6641 loop (and so, usually, terminate) when the last top-level program
6642 window is deleted. Beware that if you disable this behaviour (with
6643 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6644 explicitly from somewhere.
6646 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
6648 def GetExitOnFrameDelete(*args
, **kwargs
):
6650 GetExitOnFrameDelete(self) -> bool
6652 Get the current exit behaviour setting.
6654 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
6656 def SetUseBestVisual(*args
, **kwargs
):
6658 SetUseBestVisual(self, bool flag)
6660 Set whether the app should try to use the best available visual on
6661 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6663 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
6665 def GetUseBestVisual(*args
, **kwargs
):
6667 GetUseBestVisual(self) -> bool
6669 Get current UseBestVisual setting.
6671 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
6673 def SetPrintMode(*args
, **kwargs
):
6674 """SetPrintMode(self, int mode)"""
6675 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
6677 def GetPrintMode(*args
, **kwargs
):
6678 """GetPrintMode(self) -> int"""
6679 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
6681 def SetAssertMode(*args
, **kwargs
):
6683 SetAssertMode(self, int mode)
6685 Set the OnAssert behaviour for debug and hybrid builds.
6687 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
6689 def GetAssertMode(*args
, **kwargs
):
6691 GetAssertMode(self) -> int
6693 Get the current OnAssert behaviour setting.
6695 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
6697 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6698 """GetMacSupportPCMenuShortcuts() -> bool"""
6699 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6701 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
6702 def GetMacAboutMenuItemId(*args
, **kwargs
):
6703 """GetMacAboutMenuItemId() -> long"""
6704 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
6706 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
6707 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
6708 """GetMacPreferencesMenuItemId() -> long"""
6709 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
6711 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
6712 def GetMacExitMenuItemId(*args
, **kwargs
):
6713 """GetMacExitMenuItemId() -> long"""
6714 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
6716 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
6717 def GetMacHelpMenuTitleName(*args
, **kwargs
):
6718 """GetMacHelpMenuTitleName() -> String"""
6719 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
6721 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
6722 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6723 """SetMacSupportPCMenuShortcuts(bool val)"""
6724 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6726 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
6727 def SetMacAboutMenuItemId(*args
, **kwargs
):
6728 """SetMacAboutMenuItemId(long val)"""
6729 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6731 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
6732 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
6733 """SetMacPreferencesMenuItemId(long val)"""
6734 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6736 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
6737 def SetMacExitMenuItemId(*args
, **kwargs
):
6738 """SetMacExitMenuItemId(long val)"""
6739 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6741 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
6742 def SetMacHelpMenuTitleName(*args
, **kwargs
):
6743 """SetMacHelpMenuTitleName(String val)"""
6744 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6746 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
6747 def _BootstrapApp(*args
, **kwargs
):
6751 For internal use only
6753 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
6755 def GetComCtl32Version(*args
, **kwargs
):
6757 GetComCtl32Version() -> int
6759 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6760 it wasn't found at all. Raises an exception on non-Windows platforms.
6762 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
6764 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
6765 _core_
.PyApp_swigregister(PyApp
)
6767 def PyApp_IsMainLoopRunning(*args
):
6769 PyApp_IsMainLoopRunning() -> bool
6771 Returns True if we're running the main loop, i.e. if the events can
6772 currently be dispatched.
6774 return _core_
.PyApp_IsMainLoopRunning(*args
)
6776 def PyApp_GetMacSupportPCMenuShortcuts(*args
):
6777 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6778 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
)
6780 def PyApp_GetMacAboutMenuItemId(*args
):
6781 """PyApp_GetMacAboutMenuItemId() -> long"""
6782 return _core_
.PyApp_GetMacAboutMenuItemId(*args
)
6784 def PyApp_GetMacPreferencesMenuItemId(*args
):
6785 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6786 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
)
6788 def PyApp_GetMacExitMenuItemId(*args
):
6789 """PyApp_GetMacExitMenuItemId() -> long"""
6790 return _core_
.PyApp_GetMacExitMenuItemId(*args
)
6792 def PyApp_GetMacHelpMenuTitleName(*args
):
6793 """PyApp_GetMacHelpMenuTitleName() -> String"""
6794 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
)
6796 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6797 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6798 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6800 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
6801 """PyApp_SetMacAboutMenuItemId(long val)"""
6802 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6804 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
6805 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6806 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6808 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
6809 """PyApp_SetMacExitMenuItemId(long val)"""
6810 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6812 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
6813 """PyApp_SetMacHelpMenuTitleName(String val)"""
6814 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6816 def PyApp_GetComCtl32Version(*args
):
6818 PyApp_GetComCtl32Version() -> int
6820 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6821 it wasn't found at all. Raises an exception on non-Windows platforms.
6823 return _core_
.PyApp_GetComCtl32Version(*args
)
6825 #---------------------------------------------------------------------------
6832 Force an exit of the application. Convenience for wx.GetApp().Exit()
6834 return _core_
.Exit(*args
)
6840 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6842 return _core_
.Yield(*args
)
6844 def YieldIfNeeded(*args
):
6846 YieldIfNeeded() -> bool
6848 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6850 return _core_
.YieldIfNeeded(*args
)
6852 def SafeYield(*args
, **kwargs
):
6854 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6856 This function is similar to `wx.Yield`, except that it disables the
6857 user input to all program windows before calling `wx.Yield` and
6858 re-enables it again afterwards. If ``win`` is not None, this window
6859 will remain enabled, allowing the implementation of some limited user
6862 :Returns: the result of the call to `wx.Yield`.
6864 return _core_
.SafeYield(*args
, **kwargs
)
6866 def WakeUpIdle(*args
):
6870 Cause the message queue to become empty again, so idle events will be
6873 return _core_
.WakeUpIdle(*args
)
6875 def PostEvent(*args
, **kwargs
):
6877 PostEvent(EvtHandler dest, Event event)
6879 Send an event to a window or other wx.EvtHandler to be processed
6882 return _core_
.PostEvent(*args
, **kwargs
)
6884 def App_CleanUp(*args
):
6888 For internal use only, it is used to cleanup after wxWidgets when
6891 return _core_
.App_CleanUp(*args
)
6897 Return a reference to the current wx.App object.
6899 return _core_
.GetApp(*args
)
6901 def SetDefaultPyEncoding(*args
, **kwargs
):
6903 SetDefaultPyEncoding(string encoding)
6905 Sets the encoding that wxPython will use when it needs to convert a
6906 Python string or unicode object to or from a wxString.
6908 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6909 but please be aware that the default encoding within the same locale
6910 may be slightly different on different platforms. For example, please
6911 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6912 between the common latin/roman encodings.
6914 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
6916 def GetDefaultPyEncoding(*args
):
6918 GetDefaultPyEncoding() -> string
6920 Gets the current encoding that wxPython will use when it needs to
6921 convert a Python string or unicode object to or from a wxString.
6923 return _core_
.GetDefaultPyEncoding(*args
)
6924 #----------------------------------------------------------------------
6926 class PyOnDemandOutputWindow
:
6928 A class that can be used for redirecting Python's stdout and
6929 stderr streams. It will do nothing until something is wrriten to
6930 the stream at which point it will create a Frame with a text area
6931 and write the text there.
6933 def __init__(self
, title
= "wxPython: stdout/stderr"):
6936 self
.pos
= wx
.DefaultPosition
6937 self
.size
= (450, 300)
6940 def SetParent(self
, parent
):
6941 """Set the window to be used as the popup Frame's parent."""
6942 self
.parent
= parent
6945 def CreateOutputWindow(self
, st
):
6946 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
6947 style
=wx
.DEFAULT_FRAME_STYLE
)
6948 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
6949 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
6950 self
.text
.AppendText(st
)
6951 self
.frame
.Show(True)
6952 self
.frame
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
6955 def OnCloseWindow(self
, event
):
6956 if self
.frame
is not None:
6957 self
.frame
.Destroy()
6962 # These methods provide the file-like output behaviour.
6963 def write(self
, text
):
6965 Create the output window if needed and write the string to it.
6966 If not called in the context of the gui thread then uses
6967 CallAfter to do the work there.
6969 if self
.frame
is None:
6970 if not wx
.Thread_IsMain():
6971 wx
.CallAfter(self
.CreateOutputWindow
, text
)
6973 self
.CreateOutputWindow(text
)
6975 if not wx
.Thread_IsMain():
6976 wx
.CallAfter(self
.text
.AppendText
, text
)
6978 self
.text
.AppendText(text
)
6982 if self
.frame
is not None:
6983 wx
.CallAfter(self
.frame
.Close
)
6991 #----------------------------------------------------------------------
6993 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
6995 class App(wx
.PyApp
):
6997 The ``wx.App`` class represents the application and is used to:
6999 * bootstrap the wxPython system and initialize the underlying
7001 * set and get application-wide properties
7002 * implement the windowing system main message or event loop,
7003 and to dispatch events to window instances
7006 Every application must have a ``wx.App`` instance, and all
7007 creation of UI objects should be delayed until after the
7008 ``wx.App`` object has been created in order to ensure that the gui
7009 platform and wxWidgets have been fully initialized.
7011 Normally you would derive from this class and implement an
7012 ``OnInit`` method that creates a frame and then calls
7013 ``self.SetTopWindow(frame)``.
7015 :see: `wx.PySimpleApp` for a simpler app class that can be used
7019 outputWindowClass
= PyOnDemandOutputWindow
7021 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7022 useBestVisual
=False, clearSigInt
=True):
7024 Construct a ``wx.App`` object.
7026 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7027 redirected? Defaults to True on Windows and Mac, False
7028 otherwise. If `filename` is None then output will be
7029 redirected to a window that pops up as needed. (You can
7030 control what kind of window is created for the output by
7031 resetting the class variable ``outputWindowClass`` to a
7032 class of your choosing.)
7034 :param filename: The name of a file to redirect output to, if
7037 :param useBestVisual: Should the app try to use the best
7038 available visual provided by the system (only relevant on
7039 systems that have more than one visual.) This parameter
7040 must be used instead of calling `SetUseBestVisual` later
7041 on because it must be set before the underlying GUI
7042 toolkit is initialized.
7044 :param clearSigInt: Should SIGINT be cleared? This allows the
7045 app to terminate upon a Ctrl-C in the console like other
7048 :note: You should override OnInit to do applicaition
7049 initialization to ensure that the system, toolkit and
7050 wxWidgets are fully initialized.
7052 wx
.PyApp
.__init
__(self
)
7054 if wx
.Platform
== "__WXMAC__":
7057 if not MacOS
.WMAvailable():
7059 This program needs access to the screen. Please run with 'pythonw',
7060 not 'python', and only when you are logged in on the main display of
7068 # This has to be done before OnInit
7069 self
.SetUseBestVisual(useBestVisual
)
7071 # Set the default handler for SIGINT. This fixes a problem
7072 # where if Ctrl-C is pressed in the console that started this
7073 # app then it will not appear to do anything, (not even send
7074 # KeyboardInterrupt???) but will later segfault on exit. By
7075 # setting the default handler then the app will exit, as
7076 # expected (depending on platform.)
7080 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7084 # Save and redirect the stdio to a window?
7085 self
.stdioWin
= None
7086 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7088 self
.RedirectStdio(filename
)
7090 # Use Python's install prefix as the default
7091 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7093 # This finishes the initialization of wxWindows and then calls
7094 # the OnInit that should be present in the derived class
7095 self
._BootstrapApp
()
7098 def OnPreInit(self
):
7100 Things that must be done after _BootstrapApp has done its
7101 thing, but would be nice if they were already done by the time
7102 that OnInit is called.
7104 wx
.StockGDI
._initStockObjects
()
7107 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7108 self
.RestoreStdio() # Just in case the MainLoop was overridden
7112 wx
.PyApp
.Destroy(self
)
7115 def SetTopWindow(self
, frame
):
7116 """Set the \"main\" top level window"""
7118 self
.stdioWin
.SetParent(frame
)
7119 wx
.PyApp
.SetTopWindow(self
, frame
)
7123 """Execute the main GUI event loop"""
7124 wx
.PyApp
.MainLoop(self
)
7128 def RedirectStdio(self
, filename
=None):
7129 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7131 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7133 self
.stdioWin
= self
.outputWindowClass()
7134 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7137 def RestoreStdio(self
):
7139 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7144 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7146 Set the title, position and/or size of the output window if
7147 the stdio has been redirected. This should be called before
7148 any output would cause the output window to be created.
7151 if title
is not None:
7152 self
.stdioWin
.title
= title
7154 self
.stdioWin
.pos
= pos
7155 if size
is not None:
7156 self
.stdioWin
.size
= size
7161 # change from wx.PyApp_XX to wx.App_XX
7162 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7163 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7164 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7165 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7166 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7167 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7168 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7169 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7170 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7171 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7172 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7174 #----------------------------------------------------------------------------
7176 class PySimpleApp(wx
.App
):
7178 A simple application class. You can just create one of these and
7179 then then make your top level windows later, and not have to worry
7180 about OnInit. For example::
7182 app = wx.PySimpleApp()
7183 frame = wx.Frame(None, title='Hello World')
7190 def __init__(self
, redirect
=False, filename
=None,
7191 useBestVisual
=False, clearSigInt
=True):
7193 :see: `wx.App.__init__`
7195 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7202 # Is anybody using this one?
7203 class PyWidgetTester(wx
.App
):
7204 def __init__(self
, size
= (250, 100)):
7206 wx
.App
.__init
__(self
, 0)
7209 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7210 self
.SetTopWindow(self
.frame
)
7213 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7214 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7215 self
.frame
.Show(True)
7217 #----------------------------------------------------------------------------
7218 # DO NOT hold any other references to this object. This is how we
7219 # know when to cleanup system resources that wxWidgets is holding. When
7220 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7221 # goes to zero and it calls the wx.App_CleanUp function.
7223 class __wxPyCleanup
:
7225 self
.cleanup
= _core_
.App_CleanUp
7229 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7231 ## # another possible solution, but it gets called too early...
7233 ## atexit.register(_core_.wxApp_CleanUp)
7236 #----------------------------------------------------------------------------
7238 #---------------------------------------------------------------------------
7240 class EventLoop(object):
7241 """Proxy of C++ EventLoop class"""
7242 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7243 __repr__
= _swig_repr
7244 def __init__(self
, *args
, **kwargs
):
7245 """__init__(self) -> EventLoop"""
7246 _core_
.EventLoop_swiginit(self
,_core_
.new_EventLoop(*args
, **kwargs
))
7247 __swig_destroy__
= _core_
.delete_EventLoop
7248 __del__
= lambda self
: None;
7249 def Run(*args
, **kwargs
):
7250 """Run(self) -> int"""
7251 return _core_
.EventLoop_Run(*args
, **kwargs
)
7253 def Exit(*args
, **kwargs
):
7254 """Exit(self, int rc=0)"""
7255 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7257 def Pending(*args
, **kwargs
):
7258 """Pending(self) -> bool"""
7259 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7261 def Dispatch(*args
, **kwargs
):
7262 """Dispatch(self) -> bool"""
7263 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7265 def IsRunning(*args
, **kwargs
):
7266 """IsRunning(self) -> bool"""
7267 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7269 def GetActive(*args
, **kwargs
):
7270 """GetActive() -> EventLoop"""
7271 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7273 GetActive
= staticmethod(GetActive
)
7274 def SetActive(*args
, **kwargs
):
7275 """SetActive(EventLoop loop)"""
7276 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7278 SetActive
= staticmethod(SetActive
)
7279 _core_
.EventLoop_swigregister(EventLoop
)
7281 def EventLoop_GetActive(*args
):
7282 """EventLoop_GetActive() -> EventLoop"""
7283 return _core_
.EventLoop_GetActive(*args
)
7285 def EventLoop_SetActive(*args
, **kwargs
):
7286 """EventLoop_SetActive(EventLoop loop)"""
7287 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7289 class EventLoopActivator(object):
7290 """Proxy of C++ EventLoopActivator class"""
7291 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7292 __repr__
= _swig_repr
7293 def __init__(self
, *args
, **kwargs
):
7294 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7295 _core_
.EventLoopActivator_swiginit(self
,_core_
.new_EventLoopActivator(*args
, **kwargs
))
7296 __swig_destroy__
= _core_
.delete_EventLoopActivator
7297 __del__
= lambda self
: None;
7298 _core_
.EventLoopActivator_swigregister(EventLoopActivator
)
7300 #---------------------------------------------------------------------------
7302 class AcceleratorEntry(object):
7304 A class used to define items in an `wx.AcceleratorTable`. wxPython
7305 programs can choose to use wx.AcceleratorEntry objects, but using a
7306 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7307 as well. See `__init__` for of the tuple values.
7309 :see: `wx.AcceleratorTable`
7311 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7312 __repr__
= _swig_repr
7313 def __init__(self
, *args
, **kwargs
):
7315 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7317 Construct a wx.AcceleratorEntry.
7319 _core_
.AcceleratorEntry_swiginit(self
,_core_
.new_AcceleratorEntry(*args
, **kwargs
))
7320 __swig_destroy__
= _core_
.delete_AcceleratorEntry
7321 __del__
= lambda self
: None;
7322 def Set(*args
, **kwargs
):
7324 Set(self, int flags, int keyCode, int cmd)
7326 (Re)set the attributes of a wx.AcceleratorEntry.
7329 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
7331 def GetFlags(*args
, **kwargs
):
7333 GetFlags(self) -> int
7335 Get the AcceleratorEntry's flags.
7337 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
7339 def GetKeyCode(*args
, **kwargs
):
7341 GetKeyCode(self) -> int
7343 Get the AcceleratorEntry's keycode.
7345 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
7347 def GetCommand(*args
, **kwargs
):
7349 GetCommand(self) -> int
7351 Get the AcceleratorEntry's command ID.
7353 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
7355 _core_
.AcceleratorEntry_swigregister(AcceleratorEntry
)
7357 class AcceleratorTable(Object
):
7359 An accelerator table allows the application to specify a table of
7360 keyboard shortcuts for menus or other commands. On Windows, menu or
7361 button commands are supported; on GTK, only menu commands are
7364 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7365 __repr__
= _swig_repr
7366 def __init__(self
, *args
, **kwargs
):
7368 __init__(entries) -> AcceleratorTable
7370 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7371 items or or of 3-tuples (flags, keyCode, cmdID)
7373 :see: `wx.AcceleratorEntry`
7375 _core_
.AcceleratorTable_swiginit(self
,_core_
.new_AcceleratorTable(*args
, **kwargs
))
7376 __swig_destroy__
= _core_
.delete_AcceleratorTable
7377 __del__
= lambda self
: None;
7378 def Ok(*args
, **kwargs
):
7379 """Ok(self) -> bool"""
7380 return _core_
.AcceleratorTable_Ok(*args
, **kwargs
)
7382 _core_
.AcceleratorTable_swigregister(AcceleratorTable
)
7385 def GetAccelFromString(*args
, **kwargs
):
7386 """GetAccelFromString(String label) -> AcceleratorEntry"""
7387 return _core_
.GetAccelFromString(*args
, **kwargs
)
7388 #---------------------------------------------------------------------------
7390 class VisualAttributes(object):
7391 """struct containing all the visual attributes of a control"""
7392 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7393 __repr__
= _swig_repr
7394 def __init__(self
, *args
, **kwargs
):
7396 __init__(self) -> VisualAttributes
7398 struct containing all the visual attributes of a control
7400 _core_
.VisualAttributes_swiginit(self
,_core_
.new_VisualAttributes(*args
, **kwargs
))
7401 __swig_destroy__
= _core_
.delete_VisualAttributes
7402 __del__
= lambda self
: None;
7403 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
7404 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
7405 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
7406 _core_
.VisualAttributes_swigregister(VisualAttributes
)
7407 NullAcceleratorTable
= cvar
.NullAcceleratorTable
7408 PanelNameStr
= cvar
.PanelNameStr
7410 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
7411 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
7412 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
7413 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
7414 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
7415 class Window(EvtHandler
):
7417 wx.Window is the base class for all windows and represents any visible
7418 object on the screen. All controls, top level windows and so on are
7419 wx.Windows. Sizers and device contexts are not however, as they don't
7420 appear on screen themselves.
7423 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7424 __repr__
= _swig_repr
7425 def __init__(self
, *args
, **kwargs
):
7427 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7428 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7430 Construct and show a generic Window.
7432 _core_
.Window_swiginit(self
,_core_
.new_Window(*args
, **kwargs
))
7433 self
._setOORInfo
(self
)
7435 def Create(*args
, **kwargs
):
7437 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7438 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7440 Create the GUI part of the Window for 2-phase creation mode.
7442 return _core_
.Window_Create(*args
, **kwargs
)
7444 def Close(*args
, **kwargs
):
7446 Close(self, bool force=False) -> bool
7448 This function simply generates a EVT_CLOSE event whose handler usually
7449 tries to close the window. It doesn't close the window itself,
7450 however. If force is False (the default) then the window's close
7451 handler will be allowed to veto the destruction of the window.
7453 return _core_
.Window_Close(*args
, **kwargs
)
7455 def Destroy(*args
, **kwargs
):
7457 Destroy(self) -> bool
7459 Destroys the window safely. Frames and dialogs are not destroyed
7460 immediately when this function is called -- they are added to a list
7461 of windows to be deleted on idle time, when all the window's events
7462 have been processed. This prevents problems with events being sent to
7463 non-existent windows.
7465 Returns True if the window has either been successfully deleted, or it
7466 has been added to the list of windows pending real deletion.
7468 val
= _core_
.Window_Destroy(*args
, **kwargs
)
7472 def DestroyChildren(*args
, **kwargs
):
7474 DestroyChildren(self) -> bool
7476 Destroys all children of a window. Called automatically by the
7479 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
7481 def IsBeingDeleted(*args
, **kwargs
):
7483 IsBeingDeleted(self) -> bool
7485 Is the window in the process of being deleted?
7487 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
7489 def SetLabel(*args
, **kwargs
):
7491 SetLabel(self, String label)
7493 Set the text which the window shows in its label if applicable.
7495 return _core_
.Window_SetLabel(*args
, **kwargs
)
7497 def GetLabel(*args
, **kwargs
):
7499 GetLabel(self) -> String
7501 Generic way of getting a label from any window, for identification
7502 purposes. The interpretation of this function differs from class to
7503 class. For frames and dialogs, the value returned is the title. For
7504 buttons or static text controls, it is the button text. This function
7505 can be useful for meta-programs such as testing tools or special-needs
7506 access programs)which need to identify windows by name.
7508 return _core_
.Window_GetLabel(*args
, **kwargs
)
7510 def SetName(*args
, **kwargs
):
7512 SetName(self, String name)
7514 Sets the window's name. The window name is used for ressource setting
7515 in X, it is not the same as the window title/label
7517 return _core_
.Window_SetName(*args
, **kwargs
)
7519 def GetName(*args
, **kwargs
):
7521 GetName(self) -> String
7523 Returns the windows name. This name is not guaranteed to be unique;
7524 it is up to the programmer to supply an appropriate name in the window
7525 constructor or via wx.Window.SetName.
7527 return _core_
.Window_GetName(*args
, **kwargs
)
7529 def SetWindowVariant(*args
, **kwargs
):
7531 SetWindowVariant(self, int variant)
7533 Sets the variant of the window/font size to use for this window, if
7534 the platform supports variants, for example, wxMac.
7536 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
7538 def GetWindowVariant(*args
, **kwargs
):
7539 """GetWindowVariant(self) -> int"""
7540 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
7542 def SetId(*args
, **kwargs
):
7544 SetId(self, int winid)
7546 Sets the identifier of the window. Each window has an integer
7547 identifier. If the application has not provided one, an identifier
7548 will be generated. Normally, the identifier should be provided on
7549 creation and should not be modified subsequently.
7551 return _core_
.Window_SetId(*args
, **kwargs
)
7553 def GetId(*args
, **kwargs
):
7557 Returns the identifier of the window. Each window has an integer
7558 identifier. If the application has not provided one (or the default Id
7559 -1 is used) then an unique identifier with a negative value will be
7562 return _core_
.Window_GetId(*args
, **kwargs
)
7564 def NewControlId(*args
, **kwargs
):
7566 NewControlId() -> int
7568 Generate a control id for the controls which were not given one.
7570 return _core_
.Window_NewControlId(*args
, **kwargs
)
7572 NewControlId
= staticmethod(NewControlId
)
7573 def NextControlId(*args
, **kwargs
):
7575 NextControlId(int winid) -> int
7577 Get the id of the control following the one with the given
7580 return _core_
.Window_NextControlId(*args
, **kwargs
)
7582 NextControlId
= staticmethod(NextControlId
)
7583 def PrevControlId(*args
, **kwargs
):
7585 PrevControlId(int winid) -> int
7587 Get the id of the control preceding the one with the given
7590 return _core_
.Window_PrevControlId(*args
, **kwargs
)
7592 PrevControlId
= staticmethod(PrevControlId
)
7593 def SetSize(*args
, **kwargs
):
7595 SetSize(self, Size size)
7597 Sets the size of the window in pixels.
7599 return _core_
.Window_SetSize(*args
, **kwargs
)
7601 def SetDimensions(*args
, **kwargs
):
7603 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7605 Sets the position and size of the window in pixels. The sizeFlags
7606 parameter indicates the interpretation of the other params if they are
7609 ======================== ======================================
7610 wx.SIZE_AUTO A -1 indicates that a class-specific
7611 default should be used.
7612 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7613 -1 values are supplied.
7614 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7615 interpreted as real dimensions, not
7617 ======================== ======================================
7620 return _core_
.Window_SetDimensions(*args
, **kwargs
)
7622 def SetRect(*args
, **kwargs
):
7624 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7626 Sets the position and size of the window in pixels using a wx.Rect.
7628 return _core_
.Window_SetRect(*args
, **kwargs
)
7630 def SetSizeWH(*args
, **kwargs
):
7632 SetSizeWH(self, int width, int height)
7634 Sets the size of the window in pixels.
7636 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
7638 def Move(*args
, **kwargs
):
7640 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7642 Moves the window to the given position.
7644 return _core_
.Window_Move(*args
, **kwargs
)
7647 def MoveXY(*args
, **kwargs
):
7649 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7651 Moves the window to the given position.
7653 return _core_
.Window_MoveXY(*args
, **kwargs
)
7655 def SetBestFittingSize(*args
, **kwargs
):
7657 SetBestFittingSize(self, Size size=DefaultSize)
7659 A 'Smart' SetSize that will fill in default size components with the
7660 window's *best size* values. Also set's the minsize for use with sizers.
7662 return _core_
.Window_SetBestFittingSize(*args
, **kwargs
)
7664 def Raise(*args
, **kwargs
):
7668 Raises the window to the top of the window hierarchy. In current
7669 version of wxWidgets this works both for manage and child windows.
7671 return _core_
.Window_Raise(*args
, **kwargs
)
7673 def Lower(*args
, **kwargs
):
7677 Lowers the window to the bottom of the window hierarchy. In current
7678 version of wxWidgets this works both for manage and child windows.
7680 return _core_
.Window_Lower(*args
, **kwargs
)
7682 def SetClientSize(*args
, **kwargs
):
7684 SetClientSize(self, Size size)
7686 This sets the size of the window client area in pixels. Using this
7687 function to size a window tends to be more device-independent than
7688 wx.Window.SetSize, since the application need not worry about what
7689 dimensions the border or title bar have when trying to fit the window
7690 around panel items, for example.
7692 return _core_
.Window_SetClientSize(*args
, **kwargs
)
7694 def SetClientSizeWH(*args
, **kwargs
):
7696 SetClientSizeWH(self, int width, int height)
7698 This sets the size of the window client area in pixels. Using this
7699 function to size a window tends to be more device-independent than
7700 wx.Window.SetSize, since the application need not worry about what
7701 dimensions the border or title bar have when trying to fit the window
7702 around panel items, for example.
7704 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
7706 def SetClientRect(*args
, **kwargs
):
7708 SetClientRect(self, Rect rect)
7710 This sets the size of the window client area in pixels. Using this
7711 function to size a window tends to be more device-independent than
7712 wx.Window.SetSize, since the application need not worry about what
7713 dimensions the border or title bar have when trying to fit the window
7714 around panel items, for example.
7716 return _core_
.Window_SetClientRect(*args
, **kwargs
)
7718 def GetPosition(*args
, **kwargs
):
7720 GetPosition(self) -> Point
7722 Get the window's position. Notice that the position is in client
7723 coordinates for child windows and screen coordinates for the top level
7724 ones, use `GetScreenPosition` if you need screen coordinates for all
7727 return _core_
.Window_GetPosition(*args
, **kwargs
)
7729 def GetPositionTuple(*args
, **kwargs
):
7731 GetPositionTuple() -> (x,y)
7733 Get the window's position. Notice that the position is in client
7734 coordinates for child windows and screen coordinates for the top level
7735 ones, use `GetScreenPosition` if you need screen coordinates for all
7738 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
7740 def GetScreenPosition(*args
, **kwargs
):
7742 GetScreenPosition(self) -> Point
7744 Get the position of the window in screen coordinantes.
7746 return _core_
.Window_GetScreenPosition(*args
, **kwargs
)
7748 def GetScreenPositionTuple(*args
, **kwargs
):
7750 GetScreenPositionTuple() -> (x,y)
7752 Get the position of the window in screen coordinantes.
7754 return _core_
.Window_GetScreenPositionTuple(*args
, **kwargs
)
7756 def GetScreenRect(*args
, **kwargs
):
7758 GetScreenRect(self) -> Rect
7760 Returns the size and position of the window in screen coordinantes as
7763 return _core_
.Window_GetScreenRect(*args
, **kwargs
)
7765 def GetSize(*args
, **kwargs
):
7767 GetSize(self) -> Size
7769 Get the window size.
7771 return _core_
.Window_GetSize(*args
, **kwargs
)
7773 def GetSizeTuple(*args
, **kwargs
):
7775 GetSizeTuple() -> (width, height)
7777 Get the window size.
7779 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
7781 def GetRect(*args
, **kwargs
):
7783 GetRect(self) -> Rect
7785 Returns the size and position of the window as a `wx.Rect` object.
7787 return _core_
.Window_GetRect(*args
, **kwargs
)
7789 def GetClientSize(*args
, **kwargs
):
7791 GetClientSize(self) -> Size
7793 This gets the size of the window's 'client area' in pixels. The client
7794 area is the area which may be drawn on by the programmer, excluding
7795 title bar, border, scrollbars, etc.
7797 return _core_
.Window_GetClientSize(*args
, **kwargs
)
7799 def GetClientSizeTuple(*args
, **kwargs
):
7801 GetClientSizeTuple() -> (width, height)
7803 This gets the size of the window's 'client area' in pixels. The client
7804 area is the area which may be drawn on by the programmer, excluding
7805 title bar, border, scrollbars, etc.
7807 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
7809 def GetClientAreaOrigin(*args
, **kwargs
):
7811 GetClientAreaOrigin(self) -> Point
7813 Get the origin of the client area of the window relative to the
7814 window's top left corner (the client area may be shifted because of
7815 the borders, scrollbars, other decorations...)
7817 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
7819 def GetClientRect(*args
, **kwargs
):
7821 GetClientRect(self) -> Rect
7823 Get the client area position and size as a `wx.Rect` object.
7825 return _core_
.Window_GetClientRect(*args
, **kwargs
)
7827 def GetBestSize(*args
, **kwargs
):
7829 GetBestSize(self) -> Size
7831 This function returns the best acceptable minimal size for the
7832 window, if applicable. For example, for a static text control, it will
7833 be the minimal size such that the control label is not truncated. For
7834 windows containing subwindows (suzh aswx.Panel), the size returned by
7835 this function will be the same as the size the window would have had
7838 return _core_
.Window_GetBestSize(*args
, **kwargs
)
7840 def GetBestSizeTuple(*args
, **kwargs
):
7842 GetBestSizeTuple() -> (width, height)
7844 This function returns the best acceptable minimal size for the
7845 window, if applicable. For example, for a static text control, it will
7846 be the minimal size such that the control label is not truncated. For
7847 windows containing subwindows (suzh aswx.Panel), the size returned by
7848 this function will be the same as the size the window would have had
7851 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
7853 def InvalidateBestSize(*args
, **kwargs
):
7855 InvalidateBestSize(self)
7857 Reset the cached best size value so it will be recalculated the next
7860 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
7862 def CacheBestSize(*args
, **kwargs
):
7864 CacheBestSize(self, Size size)
7866 Cache the best size so it doesn't need to be calculated again, (at least until
7867 some properties of the window change.)
7869 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
7871 def GetBestFittingSize(*args
, **kwargs
):
7873 GetBestFittingSize(self) -> Size
7875 This function will merge the window's best size into the window's
7876 minimum size, giving priority to the min size components, and returns
7880 return _core_
.Window_GetBestFittingSize(*args
, **kwargs
)
7882 def GetAdjustedBestSize(*args
, **kwargs
):
7884 GetAdjustedBestSize(self) -> Size
7886 This method is similar to GetBestSize, except in one
7887 thing. GetBestSize should return the minimum untruncated size of the
7888 window, while this method will return the largest of BestSize and any
7889 user specified minimum size. ie. it is the minimum size the window
7890 should currently be drawn at, not the minimal size it can possibly
7893 return _core_
.Window_GetAdjustedBestSize(*args
, **kwargs
)
7895 def Center(*args
, **kwargs
):
7897 Center(self, int direction=BOTH)
7899 Centers the window. The parameter specifies the direction for
7900 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7901 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7902 on the entire screen and not on its parent window. If it is a
7903 top-level window and has no parent then it will always be centered
7904 relative to the screen.
7906 return _core_
.Window_Center(*args
, **kwargs
)
7909 def CenterOnParent(*args
, **kwargs
):
7911 CenterOnParent(self, int dir=BOTH)
7913 Center with respect to the the parent window
7915 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
7917 CentreOnParent
= CenterOnParent
7918 def Fit(*args
, **kwargs
):
7922 Sizes the window so that it fits around its subwindows. This function
7923 won't do anything if there are no subwindows and will only really work
7924 correctly if sizers are used for the subwindows layout. Also, if the
7925 window has exactly one subwindow it is better (faster and the result
7926 is more precise as Fit adds some margin to account for fuzziness of
7927 its calculations) to call window.SetClientSize(child.GetSize())
7928 instead of calling Fit.
7930 return _core_
.Window_Fit(*args
, **kwargs
)
7932 def FitInside(*args
, **kwargs
):
7936 Similar to Fit, but sizes the interior (virtual) size of a
7937 window. Mainly useful with scrolled windows to reset scrollbars after
7938 sizing changes that do not trigger a size event, and/or scrolled
7939 windows without an interior sizer. This function similarly won't do
7940 anything if there are no subwindows.
7942 return _core_
.Window_FitInside(*args
, **kwargs
)
7944 def SetSizeHints(*args
, **kwargs
):
7946 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7949 Allows specification of minimum and maximum window sizes, and window
7950 size increments. If a pair of values is not set (or set to -1), the
7951 default values will be used. If this function is called, the user
7952 will not be able to size the window outside the given bounds (if it is
7953 a top-level window.) Sizers will also inspect the minimum window size
7954 and will use that value if set when calculating layout.
7956 The resizing increments are only significant under Motif or Xt.
7958 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
7960 def SetSizeHintsSz(*args
, **kwargs
):
7962 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7964 Allows specification of minimum and maximum window sizes, and window
7965 size increments. If a pair of values is not set (or set to -1), the
7966 default values will be used. If this function is called, the user
7967 will not be able to size the window outside the given bounds (if it is
7968 a top-level window.) Sizers will also inspect the minimum window size
7969 and will use that value if set when calculating layout.
7971 The resizing increments are only significant under Motif or Xt.
7973 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
7975 def SetVirtualSizeHints(*args
, **kwargs
):
7977 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
7979 Allows specification of minimum and maximum virtual window sizes. If a
7980 pair of values is not set (or set to -1), the default values will be
7981 used. If this function is called, the user will not be able to size
7982 the virtual area of the window outside the given bounds.
7984 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
7986 def SetVirtualSizeHintsSz(*args
, **kwargs
):
7988 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7990 Allows specification of minimum and maximum virtual window sizes. If a
7991 pair of values is not set (or set to -1), the default values will be
7992 used. If this function is called, the user will not be able to size
7993 the virtual area of the window outside the given bounds.
7995 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
7997 def GetMaxSize(*args
, **kwargs
):
7998 """GetMaxSize(self) -> Size"""
7999 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8001 def GetMinSize(*args
, **kwargs
):
8002 """GetMinSize(self) -> Size"""
8003 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8005 def SetMinSize(*args
, **kwargs
):
8007 SetMinSize(self, Size minSize)
8009 A more convenient method than `SetSizeHints` for setting just the
8012 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8014 def SetMaxSize(*args
, **kwargs
):
8016 SetMaxSize(self, Size maxSize)
8018 A more convenient method than `SetSizeHints` for setting just the
8021 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8023 def GetMinWidth(*args
, **kwargs
):
8024 """GetMinWidth(self) -> int"""
8025 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8027 def GetMinHeight(*args
, **kwargs
):
8028 """GetMinHeight(self) -> int"""
8029 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8031 def GetMaxWidth(*args
, **kwargs
):
8032 """GetMaxWidth(self) -> int"""
8033 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8035 def GetMaxHeight(*args
, **kwargs
):
8036 """GetMaxHeight(self) -> int"""
8037 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8039 def SetVirtualSize(*args
, **kwargs
):
8041 SetVirtualSize(self, Size size)
8043 Set the the virtual size of a window in pixels. For most windows this
8044 is just the client area of the window, but for some like scrolled
8045 windows it is more or less independent of the screen window size.
8047 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8049 def SetVirtualSizeWH(*args
, **kwargs
):
8051 SetVirtualSizeWH(self, int w, int h)
8053 Set the the virtual size of a window in pixels. For most windows this
8054 is just the client area of the window, but for some like scrolled
8055 windows it is more or less independent of the screen window size.
8057 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8059 def GetVirtualSize(*args
, **kwargs
):
8061 GetVirtualSize(self) -> Size
8063 Get the the virtual size of the window in pixels. For most windows
8064 this is just the client area of the window, but for some like scrolled
8065 windows it is more or less independent of the screen window size.
8067 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8069 def GetVirtualSizeTuple(*args
, **kwargs
):
8071 GetVirtualSizeTuple() -> (width, height)
8073 Get the the virtual size of the window in pixels. For most windows
8074 this is just the client area of the window, but for some like scrolled
8075 windows it is more or less independent of the screen window size.
8077 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8079 def GetBestVirtualSize(*args
, **kwargs
):
8081 GetBestVirtualSize(self) -> Size
8083 Return the largest of ClientSize and BestSize (as determined by a
8084 sizer, interior children, or other means)
8086 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8088 def Show(*args
, **kwargs
):
8090 Show(self, bool show=True) -> bool
8092 Shows or hides the window. You may need to call Raise for a top level
8093 window if you want to bring it to top, although this is not needed if
8094 Show is called immediately after the frame creation. Returns True if
8095 the window has been shown or hidden or False if nothing was done
8096 because it already was in the requested state.
8098 return _core_
.Window_Show(*args
, **kwargs
)
8100 def Hide(*args
, **kwargs
):
8104 Equivalent to calling Show(False).
8106 return _core_
.Window_Hide(*args
, **kwargs
)
8108 def Enable(*args
, **kwargs
):
8110 Enable(self, bool enable=True) -> bool
8112 Enable or disable the window for user input. Note that when a parent
8113 window is disabled, all of its children are disabled as well and they
8114 are reenabled again when the parent is. Returns true if the window
8115 has been enabled or disabled, false if nothing was done, i.e. if the
8116 window had already been in the specified state.
8118 return _core_
.Window_Enable(*args
, **kwargs
)
8120 def Disable(*args
, **kwargs
):
8122 Disable(self) -> bool
8124 Disables the window, same as Enable(false).
8126 return _core_
.Window_Disable(*args
, **kwargs
)
8128 def IsShown(*args
, **kwargs
):
8130 IsShown(self) -> bool
8132 Returns true if the window is shown, false if it has been hidden.
8134 return _core_
.Window_IsShown(*args
, **kwargs
)
8136 def IsEnabled(*args
, **kwargs
):
8138 IsEnabled(self) -> bool
8140 Returns true if the window is enabled for input, false otherwise.
8142 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8144 def SetWindowStyleFlag(*args
, **kwargs
):
8146 SetWindowStyleFlag(self, long style)
8148 Sets the style of the window. Please note that some styles cannot be
8149 changed after the window creation and that Refresh() might need to be
8150 called after changing the others for the change to take place
8153 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8155 def GetWindowStyleFlag(*args
, **kwargs
):
8157 GetWindowStyleFlag(self) -> long
8159 Gets the window style that was passed to the constructor or Create
8162 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8164 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8165 def HasFlag(*args
, **kwargs
):
8167 HasFlag(self, int flag) -> bool
8169 Test if the given style is set for this window.
8171 return _core_
.Window_HasFlag(*args
, **kwargs
)
8173 def IsRetained(*args
, **kwargs
):
8175 IsRetained(self) -> bool
8177 Returns true if the window is retained, false otherwise. Retained
8178 windows are only available on X platforms.
8180 return _core_
.Window_IsRetained(*args
, **kwargs
)
8182 def SetExtraStyle(*args
, **kwargs
):
8184 SetExtraStyle(self, long exStyle)
8186 Sets the extra style bits for the window. Extra styles are the less
8187 often used style bits which can't be set with the constructor or with
8188 SetWindowStyleFlag()
8190 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8192 def GetExtraStyle(*args
, **kwargs
):
8194 GetExtraStyle(self) -> long
8196 Returns the extra style bits for the window.
8198 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
8200 def MakeModal(*args
, **kwargs
):
8202 MakeModal(self, bool modal=True)
8204 Disables all other windows in the application so that the user can
8205 only interact with this window. Passing False will reverse this
8208 return _core_
.Window_MakeModal(*args
, **kwargs
)
8210 def SetThemeEnabled(*args
, **kwargs
):
8212 SetThemeEnabled(self, bool enableTheme)
8214 This function tells a window if it should use the system's "theme"
8215 code to draw the windows' background instead if its own background
8216 drawing code. This will only have an effect on platforms that support
8217 the notion of themes in user defined windows. One such platform is
8218 GTK+ where windows can have (very colourful) backgrounds defined by a
8219 user's selected theme.
8221 Dialogs, notebook pages and the status bar have this flag set to true
8222 by default so that the default look and feel is simulated best.
8224 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
8226 def GetThemeEnabled(*args
, **kwargs
):
8228 GetThemeEnabled(self) -> bool
8230 Return the themeEnabled flag.
8232 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
8234 def SetFocus(*args
, **kwargs
):
8238 Set's the focus to this window, allowing it to receive keyboard input.
8240 return _core_
.Window_SetFocus(*args
, **kwargs
)
8242 def SetFocusFromKbd(*args
, **kwargs
):
8244 SetFocusFromKbd(self)
8246 Set focus to this window as the result of a keyboard action. Normally
8247 only called internally.
8249 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
8251 def FindFocus(*args
, **kwargs
):
8253 FindFocus() -> Window
8255 Returns the window or control that currently has the keyboard focus,
8258 return _core_
.Window_FindFocus(*args
, **kwargs
)
8260 FindFocus
= staticmethod(FindFocus
)
8261 def AcceptsFocus(*args
, **kwargs
):
8263 AcceptsFocus(self) -> bool
8265 Can this window have focus?
8267 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
8269 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
8271 AcceptsFocusFromKeyboard(self) -> bool
8273 Can this window be given focus by keyboard navigation? if not, the
8274 only way to give it focus (provided it accepts it at all) is to click
8277 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
8279 def GetDefaultItem(*args
, **kwargs
):
8281 GetDefaultItem(self) -> Window
8283 Get the default child of this parent, i.e. the one which is activated
8284 by pressing <Enter> such as the OK button on a wx.Dialog.
8286 return _core_
.Window_GetDefaultItem(*args
, **kwargs
)
8288 def SetDefaultItem(*args
, **kwargs
):
8290 SetDefaultItem(self, Window child) -> Window
8292 Set this child as default, return the old default.
8294 return _core_
.Window_SetDefaultItem(*args
, **kwargs
)
8296 def SetTmpDefaultItem(*args
, **kwargs
):
8298 SetTmpDefaultItem(self, Window win)
8300 Set this child as temporary default
8302 return _core_
.Window_SetTmpDefaultItem(*args
, **kwargs
)
8304 def Navigate(*args
, **kwargs
):
8306 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8308 Does keyboard navigation from this window to another, by sending a
8309 `wx.NavigationKeyEvent`.
8311 return _core_
.Window_Navigate(*args
, **kwargs
)
8313 def MoveAfterInTabOrder(*args
, **kwargs
):
8315 MoveAfterInTabOrder(self, Window win)
8317 Moves this window in the tab navigation order after the specified
8318 sibling window. This means that when the user presses the TAB key on
8319 that other window, the focus switches to this window.
8321 The default tab order is the same as creation order. This function
8322 and `MoveBeforeInTabOrder` allow to change it after creating all the
8326 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
8328 def MoveBeforeInTabOrder(*args
, **kwargs
):
8330 MoveBeforeInTabOrder(self, Window win)
8332 Same as `MoveAfterInTabOrder` except that it inserts this window just
8333 before win instead of putting it right after it.
8335 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
8337 def GetChildren(*args
, **kwargs
):
8339 GetChildren(self) -> PyObject
8341 Returns a list of the window's children. NOTE: Currently this is a
8342 copy of the child window list maintained by the window, so the return
8343 value of this function is only valid as long as the window's children
8346 return _core_
.Window_GetChildren(*args
, **kwargs
)
8348 def GetParent(*args
, **kwargs
):
8350 GetParent(self) -> Window
8352 Returns the parent window of this window, or None if there isn't one.
8354 return _core_
.Window_GetParent(*args
, **kwargs
)
8356 def GetGrandParent(*args
, **kwargs
):
8358 GetGrandParent(self) -> Window
8360 Returns the parent of the parent of this window, or None if there
8363 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
8365 def IsTopLevel(*args
, **kwargs
):
8367 IsTopLevel(self) -> bool
8369 Returns true if the given window is a top-level one. Currently all
8370 frames and dialogs are always considered to be top-level windows (even
8371 if they have a parent window).
8373 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
8375 def Reparent(*args
, **kwargs
):
8377 Reparent(self, Window newParent) -> bool
8379 Reparents the window, i.e the window will be removed from its current
8380 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8381 re-inserted into another. Available on Windows and GTK. Returns True
8382 if the parent was changed, False otherwise (error or newParent ==
8385 return _core_
.Window_Reparent(*args
, **kwargs
)
8387 def AddChild(*args
, **kwargs
):
8389 AddChild(self, Window child)
8391 Adds a child window. This is called automatically by window creation
8392 functions so should not be required by the application programmer.
8394 return _core_
.Window_AddChild(*args
, **kwargs
)
8396 def RemoveChild(*args
, **kwargs
):
8398 RemoveChild(self, Window child)
8400 Removes a child window. This is called automatically by window
8401 deletion functions so should not be required by the application
8404 return _core_
.Window_RemoveChild(*args
, **kwargs
)
8406 def FindWindowById(*args
, **kwargs
):
8408 FindWindowById(self, long winid) -> Window
8410 Find a chld of this window by window ID
8412 return _core_
.Window_FindWindowById(*args
, **kwargs
)
8414 def FindWindowByName(*args
, **kwargs
):
8416 FindWindowByName(self, String name) -> Window
8418 Find a child of this window by name
8420 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
8422 def GetEventHandler(*args
, **kwargs
):
8424 GetEventHandler(self) -> EvtHandler
8426 Returns the event handler for this window. By default, the window is
8427 its own event handler.
8429 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
8431 def SetEventHandler(*args
, **kwargs
):
8433 SetEventHandler(self, EvtHandler handler)
8435 Sets the event handler for this window. An event handler is an object
8436 that is capable of processing the events sent to a window. By default,
8437 the window is its own event handler, but an application may wish to
8438 substitute another, for example to allow central implementation of
8439 event-handling for a variety of different window classes.
8441 It is usually better to use `wx.Window.PushEventHandler` since this sets
8442 up a chain of event handlers, where an event not handled by one event
8443 handler is handed to the next one in the chain.
8445 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
8447 def PushEventHandler(*args
, **kwargs
):
8449 PushEventHandler(self, EvtHandler handler)
8451 Pushes this event handler onto the event handler stack for the window.
8452 An event handler is an object that is capable of processing the events
8453 sent to a window. By default, the window is its own event handler, but
8454 an application may wish to substitute another, for example to allow
8455 central implementation of event-handling for a variety of different
8458 wx.Window.PushEventHandler allows an application to set up a chain of
8459 event handlers, where an event not handled by one event handler is
8460 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8461 remove the event handler.
8463 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
8465 def PopEventHandler(*args
, **kwargs
):
8467 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8469 Removes and returns the top-most event handler on the event handler
8470 stack. If deleteHandler is True then the wx.EvtHandler object will be
8471 destroyed after it is popped.
8473 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
8475 def RemoveEventHandler(*args
, **kwargs
):
8477 RemoveEventHandler(self, EvtHandler handler) -> bool
8479 Find the given handler in the event handler chain and remove (but not
8480 delete) it from the event handler chain, return True if it was found
8481 and False otherwise (this also results in an assert failure so this
8482 function should only be called when the handler is supposed to be
8485 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
8487 def SetValidator(*args
, **kwargs
):
8489 SetValidator(self, Validator validator)
8491 Deletes the current validator (if any) and sets the window validator,
8492 having called wx.Validator.Clone to create a new validator of this
8495 return _core_
.Window_SetValidator(*args
, **kwargs
)
8497 def GetValidator(*args
, **kwargs
):
8499 GetValidator(self) -> Validator
8501 Returns a pointer to the current validator for the window, or None if
8504 return _core_
.Window_GetValidator(*args
, **kwargs
)
8506 def Validate(*args
, **kwargs
):
8508 Validate(self) -> bool
8510 Validates the current values of the child controls using their
8511 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8512 style flag set, the method will also call Validate() of all child
8513 windows. Returns false if any of the validations failed.
8515 return _core_
.Window_Validate(*args
, **kwargs
)
8517 def TransferDataToWindow(*args
, **kwargs
):
8519 TransferDataToWindow(self) -> bool
8521 Transfers values to child controls from data areas specified by their
8522 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8523 style flag set, the method will also call TransferDataToWindow() of
8526 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
8528 def TransferDataFromWindow(*args
, **kwargs
):
8530 TransferDataFromWindow(self) -> bool
8532 Transfers values from child controls to data areas specified by their
8533 validators. Returns false if a transfer failed. If the window has
8534 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8535 also call TransferDataFromWindow() of all child windows.
8537 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
8539 def InitDialog(*args
, **kwargs
):
8543 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8544 to the dialog via validators.
8546 return _core_
.Window_InitDialog(*args
, **kwargs
)
8548 def SetAcceleratorTable(*args
, **kwargs
):
8550 SetAcceleratorTable(self, AcceleratorTable accel)
8552 Sets the accelerator table for this window.
8554 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
8556 def GetAcceleratorTable(*args
, **kwargs
):
8558 GetAcceleratorTable(self) -> AcceleratorTable
8560 Gets the accelerator table for this window.
8562 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
8564 def RegisterHotKey(*args
, **kwargs
):
8566 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8568 Registers a system wide hotkey. Every time the user presses the hotkey
8569 registered here, this window will receive a hotkey event. It will
8570 receive the event even if the application is in the background and
8571 does not have the input focus because the user is working with some
8572 other application. To bind an event handler function to this hotkey
8573 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8574 hotkey was registered successfully.
8576 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
8578 def UnregisterHotKey(*args
, **kwargs
):
8580 UnregisterHotKey(self, int hotkeyId) -> bool
8582 Unregisters a system wide hotkey.
8584 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
8586 def ConvertDialogPointToPixels(*args
, **kwargs
):
8588 ConvertDialogPointToPixels(self, Point pt) -> Point
8590 Converts a point or size from dialog units to pixels. Dialog units
8591 are used for maintaining a dialog's proportions even if the font
8592 changes. For the x dimension, the dialog units are multiplied by the
8593 average character width and then divided by 4. For the y dimension,
8594 the dialog units are multiplied by the average character height and
8597 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
8599 def ConvertDialogSizeToPixels(*args
, **kwargs
):
8601 ConvertDialogSizeToPixels(self, Size sz) -> Size
8603 Converts a point or size from dialog units to pixels. Dialog units
8604 are used for maintaining a dialog's proportions even if the font
8605 changes. For the x dimension, the dialog units are multiplied by the
8606 average character width and then divided by 4. For the y dimension,
8607 the dialog units are multiplied by the average character height and
8610 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
8612 def DLG_PNT(*args
, **kwargs
):
8614 DLG_PNT(self, Point pt) -> Point
8616 Converts a point or size from dialog units to pixels. Dialog units
8617 are used for maintaining a dialog's proportions even if the font
8618 changes. For the x dimension, the dialog units are multiplied by the
8619 average character width and then divided by 4. For the y dimension,
8620 the dialog units are multiplied by the average character height and
8623 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
8625 def DLG_SZE(*args
, **kwargs
):
8627 DLG_SZE(self, Size sz) -> Size
8629 Converts a point or size from dialog units to pixels. Dialog units
8630 are used for maintaining a dialog's proportions even if the font
8631 changes. For the x dimension, the dialog units are multiplied by the
8632 average character width and then divided by 4. For the y dimension,
8633 the dialog units are multiplied by the average character height and
8636 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
8638 def ConvertPixelPointToDialog(*args
, **kwargs
):
8639 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8640 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
8642 def ConvertPixelSizeToDialog(*args
, **kwargs
):
8643 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8644 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
8646 def WarpPointer(*args
, **kwargs
):
8648 WarpPointer(self, int x, int y)
8650 Moves the pointer to the given position on the window.
8652 NOTE: This function is not supported under Mac because Apple Human
8653 Interface Guidelines forbid moving the mouse cursor programmatically.
8655 return _core_
.Window_WarpPointer(*args
, **kwargs
)
8657 def CaptureMouse(*args
, **kwargs
):
8661 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8662 release the capture.
8664 Note that wxWindows maintains the stack of windows having captured the
8665 mouse and when the mouse is released the capture returns to the window
8666 which had had captured it previously and it is only really released if
8667 there were no previous window. In particular, this means that you must
8668 release the mouse as many times as you capture it.
8670 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
8672 def ReleaseMouse(*args
, **kwargs
):
8676 Releases mouse input captured with wx.Window.CaptureMouse.
8678 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
8680 def GetCapture(*args
, **kwargs
):
8682 GetCapture() -> Window
8684 Returns the window which currently captures the mouse or None
8686 return _core_
.Window_GetCapture(*args
, **kwargs
)
8688 GetCapture
= staticmethod(GetCapture
)
8689 def HasCapture(*args
, **kwargs
):
8691 HasCapture(self) -> bool
8693 Returns true if this window has the current mouse capture.
8695 return _core_
.Window_HasCapture(*args
, **kwargs
)
8697 def Refresh(*args
, **kwargs
):
8699 Refresh(self, bool eraseBackground=True, Rect rect=None)
8701 Mark the specified rectangle (or the whole window) as "dirty" so it
8702 will be repainted. Causes an EVT_PAINT event to be generated and sent
8705 return _core_
.Window_Refresh(*args
, **kwargs
)
8707 def RefreshRect(*args
, **kwargs
):
8709 RefreshRect(self, Rect rect, bool eraseBackground=True)
8711 Redraws the contents of the given rectangle: the area inside it will
8712 be repainted. This is the same as Refresh but has a nicer syntax.
8714 return _core_
.Window_RefreshRect(*args
, **kwargs
)
8716 def Update(*args
, **kwargs
):
8720 Calling this method immediately repaints the invalidated area of the
8721 window instead of waiting for the EVT_PAINT event to happen, (normally
8722 this would usually only happen when the flow of control returns to the
8723 event loop.) Notice that this function doesn't refresh the window and
8724 does nothing if the window has been already repainted. Use Refresh
8725 first if you want to immediately redraw the window (or some portion of
8726 it) unconditionally.
8728 return _core_
.Window_Update(*args
, **kwargs
)
8730 def ClearBackground(*args
, **kwargs
):
8732 ClearBackground(self)
8734 Clears the window by filling it with the current background
8735 colour. Does not cause an erase background event to be generated.
8737 return _core_
.Window_ClearBackground(*args
, **kwargs
)
8739 def Freeze(*args
, **kwargs
):
8743 Freezes the window or, in other words, prevents any updates from
8744 taking place on screen, the window is not redrawn at all. Thaw must be
8745 called to reenable window redrawing. Calls to Freeze/Thaw may be
8746 nested, with the actual Thaw being delayed until all the nesting has
8749 This method is useful for visual appearance optimization (for example,
8750 it is a good idea to use it before inserting large amount of text into
8751 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8752 for all controls so it is mostly just a hint to wxWindows and not a
8753 mandatory directive.
8755 return _core_
.Window_Freeze(*args
, **kwargs
)
8757 def Thaw(*args
, **kwargs
):
8761 Reenables window updating after a previous call to Freeze. Calls to
8762 Freeze/Thaw may be nested, so Thaw must be called the same number of
8763 times that Freeze was before the window will be updated.
8765 return _core_
.Window_Thaw(*args
, **kwargs
)
8767 def PrepareDC(*args
, **kwargs
):
8769 PrepareDC(self, DC dc)
8771 Call this function to prepare the device context for drawing a
8772 scrolled image. It sets the device origin according to the current
8775 return _core_
.Window_PrepareDC(*args
, **kwargs
)
8777 def GetUpdateRegion(*args
, **kwargs
):
8779 GetUpdateRegion(self) -> Region
8781 Returns the region specifying which parts of the window have been
8782 damaged. Should only be called within an EVT_PAINT handler.
8784 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
8786 def GetUpdateClientRect(*args
, **kwargs
):
8788 GetUpdateClientRect(self) -> Rect
8790 Get the update rectangle region bounding box in client coords.
8792 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
8794 def IsExposed(*args
, **kwargs
):
8796 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8798 Returns true if the given point or rectangle area has been exposed
8799 since the last repaint. Call this in an paint event handler to
8800 optimize redrawing by only redrawing those areas, which have been
8803 return _core_
.Window_IsExposed(*args
, **kwargs
)
8805 def IsExposedPoint(*args
, **kwargs
):
8807 IsExposedPoint(self, Point pt) -> bool
8809 Returns true if the given point or rectangle area has been exposed
8810 since the last repaint. Call this in an paint event handler to
8811 optimize redrawing by only redrawing those areas, which have been
8814 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
8816 def IsExposedRect(*args
, **kwargs
):
8818 IsExposedRect(self, Rect rect) -> bool
8820 Returns true if the given point or rectangle area has been exposed
8821 since the last repaint. Call this in an paint event handler to
8822 optimize redrawing by only redrawing those areas, which have been
8825 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
8827 def GetDefaultAttributes(*args
, **kwargs
):
8829 GetDefaultAttributes(self) -> VisualAttributes
8831 Get the default attributes for an instance of this class. This is
8832 useful if you want to use the same font or colour in your own control
8833 as in a standard control -- which is a much better idea than hard
8834 coding specific colours or fonts which might look completely out of
8835 place on the user's system, especially if it uses themes.
8837 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
8839 def GetClassDefaultAttributes(*args
, **kwargs
):
8841 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8843 Get the default attributes for this class. This is useful if you want
8844 to use the same font or colour in your own control as in a standard
8845 control -- which is a much better idea than hard coding specific
8846 colours or fonts which might look completely out of place on the
8847 user's system, especially if it uses themes.
8849 The variant parameter is only relevant under Mac currently and is
8850 ignore under other platforms. Under Mac, it will change the size of
8851 the returned font. See `wx.Window.SetWindowVariant` for more about
8854 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
8856 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
8857 def SetBackgroundColour(*args
, **kwargs
):
8859 SetBackgroundColour(self, Colour colour) -> bool
8861 Sets the background colour of the window. Returns True if the colour
8862 was changed. The background colour is usually painted by the default
8863 EVT_ERASE_BACKGROUND event handler function under Windows and
8864 automatically under GTK. Using `wx.NullColour` will reset the window
8865 to the default background colour.
8867 Note that setting the background colour may not cause an immediate
8868 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8869 calling this function.
8871 Using this function will disable attempts to use themes for this
8872 window, if the system supports them. Use with care since usually the
8873 themes represent the appearance chosen by the user to be used for all
8874 applications on the system.
8876 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
8878 def SetOwnBackgroundColour(*args
, **kwargs
):
8879 """SetOwnBackgroundColour(self, Colour colour)"""
8880 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
8882 def SetForegroundColour(*args
, **kwargs
):
8884 SetForegroundColour(self, Colour colour) -> bool
8886 Sets the foreground colour of the window. Returns True is the colour
8887 was changed. The interpretation of foreground colour is dependent on
8888 the window class; it may be the text colour or other colour, or it may
8891 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
8893 def SetOwnForegroundColour(*args
, **kwargs
):
8894 """SetOwnForegroundColour(self, Colour colour)"""
8895 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
8897 def GetBackgroundColour(*args
, **kwargs
):
8899 GetBackgroundColour(self) -> Colour
8901 Returns the background colour of the window.
8903 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
8905 def GetForegroundColour(*args
, **kwargs
):
8907 GetForegroundColour(self) -> Colour
8909 Returns the foreground colour of the window. The interpretation of
8910 foreground colour is dependent on the window class; it may be the text
8911 colour or other colour, or it may not be used at all.
8913 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
8915 def InheritsBackgroundColour(*args
, **kwargs
):
8916 """InheritsBackgroundColour(self) -> bool"""
8917 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
8919 def UseBgCol(*args
, **kwargs
):
8920 """UseBgCol(self) -> bool"""
8921 return _core_
.Window_UseBgCol(*args
, **kwargs
)
8923 def SetBackgroundStyle(*args
, **kwargs
):
8925 SetBackgroundStyle(self, int style) -> bool
8927 Returns the background style of the window. The background style
8928 indicates how the background of the window is drawn.
8930 ====================== ========================================
8931 wx.BG_STYLE_SYSTEM The background colour or pattern should
8932 be determined by the system
8933 wx.BG_STYLE_COLOUR The background should be a solid colour
8934 wx.BG_STYLE_CUSTOM The background will be implemented by the
8936 ====================== ========================================
8938 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8939 a custom background, such as a tiled bitmap. Currently the style has
8940 no effect on other platforms.
8942 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8944 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
8946 def GetBackgroundStyle(*args
, **kwargs
):
8948 GetBackgroundStyle(self) -> int
8950 Returns the background style of the window.
8952 :see: `SetBackgroundStyle`
8954 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
8956 def HasTransparentBackground(*args
, **kwargs
):
8958 HasTransparentBackground(self) -> bool
8960 Returns True if this window's background is transparent (as, for
8961 example, for `wx.StaticText`) and should show the parent window's
8964 This method is mostly used internally by the library itself and you
8965 normally shouldn't have to call it. You may, however, have to override
8966 it in your custom control classes to ensure that background is painted
8969 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
8971 def SetCursor(*args
, **kwargs
):
8973 SetCursor(self, Cursor cursor) -> bool
8975 Sets the window's cursor. Notice that the window cursor also sets it
8976 for the children of the window implicitly.
8978 The cursor may be wx.NullCursor in which case the window cursor will
8979 be reset back to default.
8981 return _core_
.Window_SetCursor(*args
, **kwargs
)
8983 def GetCursor(*args
, **kwargs
):
8985 GetCursor(self) -> Cursor
8987 Return the cursor associated with this window.
8989 return _core_
.Window_GetCursor(*args
, **kwargs
)
8991 def SetFont(*args
, **kwargs
):
8993 SetFont(self, Font font) -> bool
8995 Sets the font for this window.
8997 return _core_
.Window_SetFont(*args
, **kwargs
)
8999 def SetOwnFont(*args
, **kwargs
):
9000 """SetOwnFont(self, Font font)"""
9001 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9003 def GetFont(*args
, **kwargs
):
9005 GetFont(self) -> Font
9007 Returns the default font used for this window.
9009 return _core_
.Window_GetFont(*args
, **kwargs
)
9011 def SetCaret(*args
, **kwargs
):
9013 SetCaret(self, Caret caret)
9015 Sets the caret associated with the window.
9017 return _core_
.Window_SetCaret(*args
, **kwargs
)
9019 def GetCaret(*args
, **kwargs
):
9021 GetCaret(self) -> Caret
9023 Returns the caret associated with the window.
9025 return _core_
.Window_GetCaret(*args
, **kwargs
)
9027 def GetCharHeight(*args
, **kwargs
):
9029 GetCharHeight(self) -> int
9031 Get the (average) character size for the current font.
9033 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9035 def GetCharWidth(*args
, **kwargs
):
9037 GetCharWidth(self) -> int
9039 Get the (average) character size for the current font.
9041 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9043 def GetTextExtent(*args
, **kwargs
):
9045 GetTextExtent(String string) -> (width, height)
9047 Get the width and height of the text using the current font.
9049 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9051 def GetFullTextExtent(*args
, **kwargs
):
9053 GetFullTextExtent(String string, Font font=None) ->
9054 (width, height, descent, externalLeading)
9056 Get the width, height, decent and leading of the text using the
9057 current or specified font.
9059 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9061 def ClientToScreenXY(*args
, **kwargs
):
9063 ClientToScreenXY(int x, int y) -> (x,y)
9065 Converts to screen coordinates from coordinates relative to this window.
9067 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9069 def ScreenToClientXY(*args
, **kwargs
):
9071 ScreenToClientXY(int x, int y) -> (x,y)
9073 Converts from screen to client window coordinates.
9075 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9077 def ClientToScreen(*args
, **kwargs
):
9079 ClientToScreen(self, Point pt) -> Point
9081 Converts to screen coordinates from coordinates relative to this window.
9083 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9085 def ScreenToClient(*args
, **kwargs
):
9087 ScreenToClient(self, Point pt) -> Point
9089 Converts from screen to client window coordinates.
9091 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9093 def HitTestXY(*args
, **kwargs
):
9095 HitTestXY(self, int x, int y) -> int
9097 Test where the given (in client coords) point lies
9099 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9101 def HitTest(*args
, **kwargs
):
9103 HitTest(self, Point pt) -> int
9105 Test where the given (in client coords) point lies
9107 return _core_
.Window_HitTest(*args
, **kwargs
)
9109 def GetBorder(*args
):
9111 GetBorder(self, long flags) -> int
9112 GetBorder(self) -> int
9114 Get border for the flags of this window
9116 return _core_
.Window_GetBorder(*args
)
9118 def UpdateWindowUI(*args
, **kwargs
):
9120 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9122 This function sends EVT_UPDATE_UI events to the window. The particular
9123 implementation depends on the window; for example a wx.ToolBar will
9124 send an update UI event for each toolbar button, and a wx.Frame will
9125 send an update UI event for each menubar menu item. You can call this
9126 function from your application to ensure that your UI is up-to-date at
9127 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9128 concerned). This may be necessary if you have called
9129 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9130 limit the overhead that wxWindows incurs by sending update UI events
9133 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9135 def PopupMenuXY(*args
, **kwargs
):
9137 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9139 Pops up the given menu at the specified coordinates, relative to this window,
9140 and returns control when the user has dismissed the menu. If a menu item is
9141 selected, the corresponding menu event is generated and will be processed as
9142 usual. If the default position is given then the current position of the
9143 mouse cursor will be used.
9145 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9147 def PopupMenu(*args
, **kwargs
):
9149 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9151 Pops up the given menu at the specified coordinates, relative to this window,
9152 and returns control when the user has dismissed the menu. If a menu item is
9153 selected, the corresponding menu event is generated and will be processed as
9154 usual. If the default position is given then the current position of the
9155 mouse cursor will be used.
9157 return _core_
.Window_PopupMenu(*args
, **kwargs
)
9159 def GetHandle(*args
, **kwargs
):
9161 GetHandle(self) -> long
9163 Returns the platform-specific handle (as a long integer) of the
9164 physical window. Currently on wxMac it returns the handle of the
9165 toplevel parent of the window.
9167 return _core_
.Window_GetHandle(*args
, **kwargs
)
9169 def AssociateHandle(*args
, **kwargs
):
9171 AssociateHandle(self, long handle)
9173 Associate the window with a new native handle
9175 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
9177 def DissociateHandle(*args
, **kwargs
):
9179 DissociateHandle(self)
9181 Dissociate the current native handle from the window
9183 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
9185 def OnPaint(*args
, **kwargs
):
9186 """OnPaint(self, PaintEvent event)"""
9187 return _core_
.Window_OnPaint(*args
, **kwargs
)
9189 def HasScrollbar(*args
, **kwargs
):
9191 HasScrollbar(self, int orient) -> bool
9193 Does the window have the scrollbar for this orientation?
9195 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
9197 def SetScrollbar(*args
, **kwargs
):
9199 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9202 Sets the scrollbar properties of a built-in scrollbar.
9204 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
9206 def SetScrollPos(*args
, **kwargs
):
9208 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9210 Sets the position of one of the built-in scrollbars.
9212 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
9214 def GetScrollPos(*args
, **kwargs
):
9216 GetScrollPos(self, int orientation) -> int
9218 Returns the built-in scrollbar position.
9220 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
9222 def GetScrollThumb(*args
, **kwargs
):
9224 GetScrollThumb(self, int orientation) -> int
9226 Returns the built-in scrollbar thumb size.
9228 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
9230 def GetScrollRange(*args
, **kwargs
):
9232 GetScrollRange(self, int orientation) -> int
9234 Returns the built-in scrollbar range.
9236 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
9238 def ScrollWindow(*args
, **kwargs
):
9240 ScrollWindow(self, int dx, int dy, Rect rect=None)
9242 Physically scrolls the pixels in the window and move child windows
9243 accordingly. Use this function to optimise your scrolling
9244 implementations, to minimise the area that must be redrawn. Note that
9245 it is rarely required to call this function from a user program.
9247 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
9249 def ScrollLines(*args
, **kwargs
):
9251 ScrollLines(self, int lines) -> bool
9253 If the platform and window class supports it, scrolls the window by
9254 the given number of lines down, if lines is positive, or up if lines
9255 is negative. Returns True if the window was scrolled, False if it was
9256 already on top/bottom and nothing was done.
9258 return _core_
.Window_ScrollLines(*args
, **kwargs
)
9260 def ScrollPages(*args
, **kwargs
):
9262 ScrollPages(self, int pages) -> bool
9264 If the platform and window class supports it, scrolls the window by
9265 the given number of pages down, if pages is positive, or up if pages
9266 is negative. Returns True if the window was scrolled, False if it was
9267 already on top/bottom and nothing was done.
9269 return _core_
.Window_ScrollPages(*args
, **kwargs
)
9271 def LineUp(*args
, **kwargs
):
9273 LineUp(self) -> bool
9275 This is just a wrapper for ScrollLines(-1).
9277 return _core_
.Window_LineUp(*args
, **kwargs
)
9279 def LineDown(*args
, **kwargs
):
9281 LineDown(self) -> bool
9283 This is just a wrapper for ScrollLines(1).
9285 return _core_
.Window_LineDown(*args
, **kwargs
)
9287 def PageUp(*args
, **kwargs
):
9289 PageUp(self) -> bool
9291 This is just a wrapper for ScrollPages(-1).
9293 return _core_
.Window_PageUp(*args
, **kwargs
)
9295 def PageDown(*args
, **kwargs
):
9297 PageDown(self) -> bool
9299 This is just a wrapper for ScrollPages(1).
9301 return _core_
.Window_PageDown(*args
, **kwargs
)
9303 def SetHelpText(*args
, **kwargs
):
9305 SetHelpText(self, String text)
9307 Sets the help text to be used as context-sensitive help for this
9308 window. Note that the text is actually stored by the current
9309 `wx.HelpProvider` implementation, and not in the window object itself.
9311 return _core_
.Window_SetHelpText(*args
, **kwargs
)
9313 def SetHelpTextForId(*args
, **kwargs
):
9315 SetHelpTextForId(self, String text)
9317 Associate this help text with all windows with the same id as this
9320 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
9322 def GetHelpText(*args
, **kwargs
):
9324 GetHelpText(self) -> String
9326 Gets the help text to be used as context-sensitive help for this
9327 window. Note that the text is actually stored by the current
9328 `wx.HelpProvider` implementation, and not in the window object itself.
9330 return _core_
.Window_GetHelpText(*args
, **kwargs
)
9332 def SetToolTipString(*args
, **kwargs
):
9334 SetToolTipString(self, String tip)
9336 Attach a tooltip to the window.
9338 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
9340 def SetToolTip(*args
, **kwargs
):
9342 SetToolTip(self, ToolTip tip)
9344 Attach a tooltip to the window.
9346 return _core_
.Window_SetToolTip(*args
, **kwargs
)
9348 def GetToolTip(*args
, **kwargs
):
9350 GetToolTip(self) -> ToolTip
9352 get the associated tooltip or None if none
9354 return _core_
.Window_GetToolTip(*args
, **kwargs
)
9356 def SetDropTarget(*args
, **kwargs
):
9358 SetDropTarget(self, DropTarget dropTarget)
9360 Associates a drop target with this window. If the window already has
9361 a drop target, it is deleted.
9363 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
9365 def GetDropTarget(*args
, **kwargs
):
9367 GetDropTarget(self) -> DropTarget
9369 Returns the associated drop target, which may be None.
9371 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
9373 def DragAcceptFiles(*args
, **kwargs
):
9375 DragAcceptFiles(self, bool accept)
9377 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9378 Only functional on Windows.
9380 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
9382 def SetConstraints(*args
, **kwargs
):
9384 SetConstraints(self, LayoutConstraints constraints)
9386 Sets the window to have the given layout constraints. If an existing
9387 layout constraints object is already owned by the window, it will be
9388 deleted. Pass None to disassociate and delete the window's current
9391 You must call SetAutoLayout to tell a window to use the constraints
9392 automatically in its default EVT_SIZE handler; otherwise, you must
9393 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9394 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9397 return _core_
.Window_SetConstraints(*args
, **kwargs
)
9399 def GetConstraints(*args
, **kwargs
):
9401 GetConstraints(self) -> LayoutConstraints
9403 Returns a pointer to the window's layout constraints, or None if there
9406 return _core_
.Window_GetConstraints(*args
, **kwargs
)
9408 def SetAutoLayout(*args
, **kwargs
):
9410 SetAutoLayout(self, bool autoLayout)
9412 Determines whether the Layout function will be called automatically
9413 when the window is resized. lease note that this only happens for the
9414 windows usually used to contain children, namely `wx.Panel` and
9415 `wx.TopLevelWindow` (and the classes deriving from them).
9417 This method is called implicitly by `SetSizer` but if you use
9418 `SetConstraints` you should call it manually or otherwise the window
9419 layout won't be correctly updated when its size changes.
9421 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
9423 def GetAutoLayout(*args
, **kwargs
):
9425 GetAutoLayout(self) -> bool
9427 Returns the current autoLayout setting
9429 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
9431 def Layout(*args
, **kwargs
):
9433 Layout(self) -> bool
9435 Invokes the constraint-based layout algorithm or the sizer-based
9436 algorithm for this window. See SetAutoLayout: when auto layout is on,
9437 this function gets called automatically by the default EVT_SIZE
9438 handler when the window is resized.
9440 return _core_
.Window_Layout(*args
, **kwargs
)
9442 def SetSizer(*args
, **kwargs
):
9444 SetSizer(self, Sizer sizer, bool deleteOld=True)
9446 Sets the window to have the given layout sizer. The window will then
9447 own the object, and will take care of its deletion. If an existing
9448 layout sizer object is already owned by the window, it will be deleted
9449 if the deleteOld parameter is true. Note that this function will also
9450 call SetAutoLayout implicitly with a True parameter if the sizer is
9451 non-None, and False otherwise.
9453 return _core_
.Window_SetSizer(*args
, **kwargs
)
9455 def SetSizerAndFit(*args
, **kwargs
):
9457 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9459 The same as SetSizer, except it also sets the size hints for the
9460 window based on the sizer's minimum size.
9462 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
9464 def GetSizer(*args
, **kwargs
):
9466 GetSizer(self) -> Sizer
9468 Return the sizer associated with the window by a previous call to
9469 SetSizer or None if there isn't one.
9471 return _core_
.Window_GetSizer(*args
, **kwargs
)
9473 def SetContainingSizer(*args
, **kwargs
):
9475 SetContainingSizer(self, Sizer sizer)
9477 This normally does not need to be called by application code. It is
9478 called internally when a window is added to a sizer, and is used so
9479 the window can remove itself from the sizer when it is destroyed.
9481 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
9483 def GetContainingSizer(*args
, **kwargs
):
9485 GetContainingSizer(self) -> Sizer
9487 Return the sizer that this window is a member of, if any, otherwise None.
9489 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
9491 def InheritAttributes(*args
, **kwargs
):
9493 InheritAttributes(self)
9495 This function is (or should be, in case of custom controls) called
9496 during window creation to intelligently set up the window visual
9497 attributes, that is the font and the foreground and background
9500 By 'intelligently' the following is meant: by default, all windows use
9501 their own default attributes. However if some of the parent's
9502 attributes are explicitly changed (that is, using SetFont and not
9503 SetOwnFont) and if the corresponding attribute hadn't been
9504 explicitly set for this window itself, then this window takes the same
9505 value as used by the parent. In addition, if the window overrides
9506 ShouldInheritColours to return false, the colours will not be changed
9507 no matter what and only the font might.
9509 This rather complicated logic is necessary in order to accommodate the
9510 different usage scenarios. The most common one is when all default
9511 attributes are used and in this case, nothing should be inherited as
9512 in modern GUIs different controls use different fonts (and colours)
9513 than their siblings so they can't inherit the same value from the
9514 parent. However it was also deemed desirable to allow to simply change
9515 the attributes of all children at once by just changing the font or
9516 colour of their common parent, hence in this case we do inherit the
9520 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
9522 def ShouldInheritColours(*args
, **kwargs
):
9524 ShouldInheritColours(self) -> bool
9526 Return true from here to allow the colours of this window to be
9527 changed by InheritAttributes, returning false forbids inheriting them
9528 from the parent window.
9530 The base class version returns false, but this method is overridden in
9531 wxControl where it returns true.
9533 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
9535 def PostCreate(self
, pre
):
9537 Phase 3 of the 2-phase create <wink!>
9538 Call this method after precreating the window with the 2-phase create method.
9540 self
.this
= pre
.this
9541 self
.thisown
= pre
.thisown
9543 if hasattr(self
, '_setOORInfo'):
9544 self
._setOORInfo
(self
)
9545 if hasattr(self
, '_setCallbackInfo'):
9546 self
._setCallbackInfo
(self
, self
.__class
__)
9548 def SendSizeEvent(self
):
9549 self
.GetEventhandler().ProcessEvent(wx
.SizeEvent((-1,-1)))
9551 _core_
.Window_swigregister(Window
)
9553 def PreWindow(*args
, **kwargs
):
9555 PreWindow() -> Window
9557 Precreate a Window for 2-phase creation.
9559 val
= _core_
.new_PreWindow(*args
, **kwargs
)
9562 def Window_NewControlId(*args
):
9564 Window_NewControlId() -> int
9566 Generate a control id for the controls which were not given one.
9568 return _core_
.Window_NewControlId(*args
)
9570 def Window_NextControlId(*args
, **kwargs
):
9572 Window_NextControlId(int winid) -> int
9574 Get the id of the control following the one with the given
9577 return _core_
.Window_NextControlId(*args
, **kwargs
)
9579 def Window_PrevControlId(*args
, **kwargs
):
9581 Window_PrevControlId(int winid) -> int
9583 Get the id of the control preceding the one with the given
9586 return _core_
.Window_PrevControlId(*args
, **kwargs
)
9588 def Window_FindFocus(*args
):
9590 Window_FindFocus() -> Window
9592 Returns the window or control that currently has the keyboard focus,
9595 return _core_
.Window_FindFocus(*args
)
9597 def Window_GetCapture(*args
):
9599 Window_GetCapture() -> Window
9601 Returns the window which currently captures the mouse or None
9603 return _core_
.Window_GetCapture(*args
)
9605 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
9607 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9609 Get the default attributes for this class. This is useful if you want
9610 to use the same font or colour in your own control as in a standard
9611 control -- which is a much better idea than hard coding specific
9612 colours or fonts which might look completely out of place on the
9613 user's system, especially if it uses themes.
9615 The variant parameter is only relevant under Mac currently and is
9616 ignore under other platforms. Under Mac, it will change the size of
9617 the returned font. See `wx.Window.SetWindowVariant` for more about
9620 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9622 def DLG_PNT(win
, point_or_x
, y
=None):
9624 Convenience function for converting a Point or (x,y) in
9625 dialog units to pixel units.
9628 return win
.ConvertDialogPointToPixels(point_or_x
)
9630 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
9632 def DLG_SZE(win
, size_width
, height
=None):
9634 Convenience function for converting a Size or (w,h) in
9635 dialog units to pixel units.
9638 return win
.ConvertDialogSizeToPixels(size_width
)
9640 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
9643 def FindWindowById(*args
, **kwargs
):
9645 FindWindowById(long id, Window parent=None) -> Window
9647 Find the first window in the application with the given id. If parent
9648 is None, the search will start from all top-level frames and dialog
9649 boxes; if non-None, the search will be limited to the given window
9650 hierarchy. The search is recursive in both cases.
9652 return _core_
.FindWindowById(*args
, **kwargs
)
9654 def FindWindowByName(*args
, **kwargs
):
9656 FindWindowByName(String name, Window parent=None) -> Window
9658 Find a window by its name (as given in a window constructor or Create
9659 function call). If parent is None, the search will start from all
9660 top-level frames and dialog boxes; if non-None, the search will be
9661 limited to the given window hierarchy. The search is recursive in both
9664 If no window with such name is found, wx.FindWindowByLabel is called.
9666 return _core_
.FindWindowByName(*args
, **kwargs
)
9668 def FindWindowByLabel(*args
, **kwargs
):
9670 FindWindowByLabel(String label, Window parent=None) -> Window
9672 Find a window by its label. Depending on the type of window, the label
9673 may be a window title or panel item label. If parent is None, the
9674 search will start from all top-level frames and dialog boxes; if
9675 non-None, the search will be limited to the given window
9676 hierarchy. The search is recursive in both cases.
9678 return _core_
.FindWindowByLabel(*args
, **kwargs
)
9680 def Window_FromHWND(*args
, **kwargs
):
9681 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9682 return _core_
.Window_FromHWND(*args
, **kwargs
)
9684 def GetTopLevelWindows(*args
):
9686 GetTopLevelWindows() -> PyObject
9688 Returns a list of the the application's top-level windows, (frames,
9689 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9690 by wxWidgets, and so it is only valid as long as no top-level windows
9691 are closed or new top-level windows are created.
9694 return _core_
.GetTopLevelWindows(*args
)
9695 #---------------------------------------------------------------------------
9697 class Validator(EvtHandler
):
9698 """Proxy of C++ Validator class"""
9699 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9700 __repr__
= _swig_repr
9701 def __init__(self
, *args
, **kwargs
):
9702 """__init__(self) -> Validator"""
9703 _core_
.Validator_swiginit(self
,_core_
.new_Validator(*args
, **kwargs
))
9704 self
._setOORInfo
(self
)
9706 def Clone(*args
, **kwargs
):
9707 """Clone(self) -> Validator"""
9708 return _core_
.Validator_Clone(*args
, **kwargs
)
9710 def Validate(*args
, **kwargs
):
9711 """Validate(self, Window parent) -> bool"""
9712 return _core_
.Validator_Validate(*args
, **kwargs
)
9714 def TransferToWindow(*args
, **kwargs
):
9715 """TransferToWindow(self) -> bool"""
9716 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
9718 def TransferFromWindow(*args
, **kwargs
):
9719 """TransferFromWindow(self) -> bool"""
9720 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
9722 def GetWindow(*args
, **kwargs
):
9723 """GetWindow(self) -> Window"""
9724 return _core_
.Validator_GetWindow(*args
, **kwargs
)
9726 def SetWindow(*args
, **kwargs
):
9727 """SetWindow(self, Window window)"""
9728 return _core_
.Validator_SetWindow(*args
, **kwargs
)
9730 def IsSilent(*args
, **kwargs
):
9731 """IsSilent() -> bool"""
9732 return _core_
.Validator_IsSilent(*args
, **kwargs
)
9734 IsSilent
= staticmethod(IsSilent
)
9735 def SetBellOnError(*args
, **kwargs
):
9736 """SetBellOnError(int doIt=True)"""
9737 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
9739 SetBellOnError
= staticmethod(SetBellOnError
)
9740 _core_
.Validator_swigregister(Validator
)
9742 def Validator_IsSilent(*args
):
9743 """Validator_IsSilent() -> bool"""
9744 return _core_
.Validator_IsSilent(*args
)
9746 def Validator_SetBellOnError(*args
, **kwargs
):
9747 """Validator_SetBellOnError(int doIt=True)"""
9748 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
9750 class PyValidator(Validator
):
9751 """Proxy of C++ PyValidator class"""
9752 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9753 __repr__
= _swig_repr
9754 def __init__(self
, *args
, **kwargs
):
9755 """__init__(self) -> PyValidator"""
9756 _core_
.PyValidator_swiginit(self
,_core_
.new_PyValidator(*args
, **kwargs
))
9758 self
._setCallbackInfo
(self
, PyValidator
, 1)
9759 self
._setOORInfo
(self
)
9761 def _setCallbackInfo(*args
, **kwargs
):
9762 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9763 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
9765 _core_
.PyValidator_swigregister(PyValidator
)
9767 #---------------------------------------------------------------------------
9769 class Menu(EvtHandler
):
9770 """Proxy of C++ Menu class"""
9771 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9772 __repr__
= _swig_repr
9773 def __init__(self
, *args
, **kwargs
):
9774 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9775 _core_
.Menu_swiginit(self
,_core_
.new_Menu(*args
, **kwargs
))
9776 self
._setOORInfo
(self
)
9778 def Append(*args
, **kwargs
):
9779 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9780 return _core_
.Menu_Append(*args
, **kwargs
)
9782 def AppendSeparator(*args
, **kwargs
):
9783 """AppendSeparator(self) -> MenuItem"""
9784 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
9786 def AppendCheckItem(*args
, **kwargs
):
9787 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9788 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
9790 def AppendRadioItem(*args
, **kwargs
):
9791 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9792 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
9794 def AppendMenu(*args
, **kwargs
):
9795 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9796 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
9798 def AppendSubMenu(*args
, **kwargs
):
9799 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9800 return _core_
.Menu_AppendSubMenu(*args
, **kwargs
)
9802 def AppendItem(*args
, **kwargs
):
9803 """AppendItem(self, MenuItem item) -> MenuItem"""
9804 return _core_
.Menu_AppendItem(*args
, **kwargs
)
9806 def InsertItem(*args
, **kwargs
):
9807 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9808 return _core_
.Menu_InsertItem(*args
, **kwargs
)
9810 def PrependItem(*args
, **kwargs
):
9811 """PrependItem(self, MenuItem item) -> MenuItem"""
9812 return _core_
.Menu_PrependItem(*args
, **kwargs
)
9814 def Break(*args
, **kwargs
):
9816 return _core_
.Menu_Break(*args
, **kwargs
)
9818 def Insert(*args
, **kwargs
):
9820 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9821 int kind=ITEM_NORMAL) -> MenuItem
9823 return _core_
.Menu_Insert(*args
, **kwargs
)
9825 def InsertSeparator(*args
, **kwargs
):
9826 """InsertSeparator(self, size_t pos) -> MenuItem"""
9827 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
9829 def InsertCheckItem(*args
, **kwargs
):
9830 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9831 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
9833 def InsertRadioItem(*args
, **kwargs
):
9834 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9835 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
9837 def InsertMenu(*args
, **kwargs
):
9838 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9839 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
9841 def Prepend(*args
, **kwargs
):
9842 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9843 return _core_
.Menu_Prepend(*args
, **kwargs
)
9845 def PrependSeparator(*args
, **kwargs
):
9846 """PrependSeparator(self) -> MenuItem"""
9847 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
9849 def PrependCheckItem(*args
, **kwargs
):
9850 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9851 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
9853 def PrependRadioItem(*args
, **kwargs
):
9854 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9855 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
9857 def PrependMenu(*args
, **kwargs
):
9858 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9859 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
9861 def Remove(*args
, **kwargs
):
9862 """Remove(self, int id) -> MenuItem"""
9863 return _core_
.Menu_Remove(*args
, **kwargs
)
9865 def RemoveItem(*args
, **kwargs
):
9866 """RemoveItem(self, MenuItem item) -> MenuItem"""
9867 return _core_
.Menu_RemoveItem(*args
, **kwargs
)
9869 def Delete(*args
, **kwargs
):
9870 """Delete(self, int id) -> bool"""
9871 return _core_
.Menu_Delete(*args
, **kwargs
)
9873 def DeleteItem(*args
, **kwargs
):
9874 """DeleteItem(self, MenuItem item) -> bool"""
9875 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
9877 def Destroy(*args
, **kwargs
):
9881 Deletes the C++ object this Python object is a proxy for.
9883 val
= _core_
.Menu_Destroy(*args
, **kwargs
)
9887 def DestroyId(*args
, **kwargs
):
9889 DestroyId(self, int id) -> bool
9891 Deletes the C++ object this Python object is a proxy for.
9893 val
= _core_
.Menu_DestroyId(*args
, **kwargs
)
9897 def DestroyItem(*args
, **kwargs
):
9899 DestroyItem(self, MenuItem item) -> bool
9901 Deletes the C++ object this Python object is a proxy for.
9903 val
= _core_
.Menu_DestroyItem(*args
, **kwargs
)
9907 def GetMenuItemCount(*args
, **kwargs
):
9908 """GetMenuItemCount(self) -> size_t"""
9909 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
9911 def GetMenuItems(*args
, **kwargs
):
9912 """GetMenuItems(self) -> PyObject"""
9913 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
9915 def FindItem(*args
, **kwargs
):
9916 """FindItem(self, String item) -> int"""
9917 return _core_
.Menu_FindItem(*args
, **kwargs
)
9919 def FindItemById(*args
, **kwargs
):
9920 """FindItemById(self, int id) -> MenuItem"""
9921 return _core_
.Menu_FindItemById(*args
, **kwargs
)
9923 def FindItemByPosition(*args
, **kwargs
):
9924 """FindItemByPosition(self, size_t position) -> MenuItem"""
9925 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
9927 def Enable(*args
, **kwargs
):
9928 """Enable(self, int id, bool enable)"""
9929 return _core_
.Menu_Enable(*args
, **kwargs
)
9931 def IsEnabled(*args
, **kwargs
):
9932 """IsEnabled(self, int id) -> bool"""
9933 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
9935 def Check(*args
, **kwargs
):
9936 """Check(self, int id, bool check)"""
9937 return _core_
.Menu_Check(*args
, **kwargs
)
9939 def IsChecked(*args
, **kwargs
):
9940 """IsChecked(self, int id) -> bool"""
9941 return _core_
.Menu_IsChecked(*args
, **kwargs
)
9943 def SetLabel(*args
, **kwargs
):
9944 """SetLabel(self, int id, String label)"""
9945 return _core_
.Menu_SetLabel(*args
, **kwargs
)
9947 def GetLabel(*args
, **kwargs
):
9948 """GetLabel(self, int id) -> String"""
9949 return _core_
.Menu_GetLabel(*args
, **kwargs
)
9951 def SetHelpString(*args
, **kwargs
):
9952 """SetHelpString(self, int id, String helpString)"""
9953 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
9955 def GetHelpString(*args
, **kwargs
):
9956 """GetHelpString(self, int id) -> String"""
9957 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
9959 def SetTitle(*args
, **kwargs
):
9960 """SetTitle(self, String title)"""
9961 return _core_
.Menu_SetTitle(*args
, **kwargs
)
9963 def GetTitle(*args
, **kwargs
):
9964 """GetTitle(self) -> String"""
9965 return _core_
.Menu_GetTitle(*args
, **kwargs
)
9967 def SetEventHandler(*args
, **kwargs
):
9968 """SetEventHandler(self, EvtHandler handler)"""
9969 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
9971 def GetEventHandler(*args
, **kwargs
):
9972 """GetEventHandler(self) -> EvtHandler"""
9973 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
9975 def SetInvokingWindow(*args
, **kwargs
):
9976 """SetInvokingWindow(self, Window win)"""
9977 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
9979 def GetInvokingWindow(*args
, **kwargs
):
9980 """GetInvokingWindow(self) -> Window"""
9981 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
9983 def GetStyle(*args
, **kwargs
):
9984 """GetStyle(self) -> long"""
9985 return _core_
.Menu_GetStyle(*args
, **kwargs
)
9987 def UpdateUI(*args
, **kwargs
):
9988 """UpdateUI(self, EvtHandler source=None)"""
9989 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
9991 def GetMenuBar(*args
, **kwargs
):
9992 """GetMenuBar(self) -> MenuBar"""
9993 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
9995 def Attach(*args
, **kwargs
):
9996 """Attach(self, wxMenuBarBase menubar)"""
9997 return _core_
.Menu_Attach(*args
, **kwargs
)
9999 def Detach(*args
, **kwargs
):
10001 return _core_
.Menu_Detach(*args
, **kwargs
)
10003 def IsAttached(*args
, **kwargs
):
10004 """IsAttached(self) -> bool"""
10005 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10007 def SetParent(*args
, **kwargs
):
10008 """SetParent(self, Menu parent)"""
10009 return _core_
.Menu_SetParent(*args
, **kwargs
)
10011 def GetParent(*args
, **kwargs
):
10012 """GetParent(self) -> Menu"""
10013 return _core_
.Menu_GetParent(*args
, **kwargs
)
10015 _core_
.Menu_swigregister(Menu
)
10016 DefaultValidator
= cvar
.DefaultValidator
10018 #---------------------------------------------------------------------------
10020 class MenuBar(Window
):
10021 """Proxy of C++ MenuBar class"""
10022 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10023 __repr__
= _swig_repr
10024 def __init__(self
, *args
, **kwargs
):
10025 """__init__(self, long style=0) -> MenuBar"""
10026 _core_
.MenuBar_swiginit(self
,_core_
.new_MenuBar(*args
, **kwargs
))
10027 self
._setOORInfo
(self
)
10029 def Append(*args
, **kwargs
):
10030 """Append(self, Menu menu, String title) -> bool"""
10031 return _core_
.MenuBar_Append(*args
, **kwargs
)
10033 def Insert(*args
, **kwargs
):
10034 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10035 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10037 def GetMenuCount(*args
, **kwargs
):
10038 """GetMenuCount(self) -> size_t"""
10039 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
10041 def GetMenu(*args
, **kwargs
):
10042 """GetMenu(self, size_t pos) -> Menu"""
10043 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
10045 def Replace(*args
, **kwargs
):
10046 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10047 return _core_
.MenuBar_Replace(*args
, **kwargs
)
10049 def Remove(*args
, **kwargs
):
10050 """Remove(self, size_t pos) -> Menu"""
10051 return _core_
.MenuBar_Remove(*args
, **kwargs
)
10053 def EnableTop(*args
, **kwargs
):
10054 """EnableTop(self, size_t pos, bool enable)"""
10055 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
10057 def IsEnabledTop(*args
, **kwargs
):
10058 """IsEnabledTop(self, size_t pos) -> bool"""
10059 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
10061 def SetLabelTop(*args
, **kwargs
):
10062 """SetLabelTop(self, size_t pos, String label)"""
10063 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
10065 def GetLabelTop(*args
, **kwargs
):
10066 """GetLabelTop(self, size_t pos) -> String"""
10067 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
10069 def FindMenuItem(*args
, **kwargs
):
10070 """FindMenuItem(self, String menu, String item) -> int"""
10071 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
10073 def FindItemById(*args
, **kwargs
):
10074 """FindItemById(self, int id) -> MenuItem"""
10075 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
10077 def FindMenu(*args
, **kwargs
):
10078 """FindMenu(self, String title) -> int"""
10079 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
10081 def Enable(*args
, **kwargs
):
10082 """Enable(self, int id, bool enable)"""
10083 return _core_
.MenuBar_Enable(*args
, **kwargs
)
10085 def Check(*args
, **kwargs
):
10086 """Check(self, int id, bool check)"""
10087 return _core_
.MenuBar_Check(*args
, **kwargs
)
10089 def IsChecked(*args
, **kwargs
):
10090 """IsChecked(self, int id) -> bool"""
10091 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
10093 def IsEnabled(*args
, **kwargs
):
10094 """IsEnabled(self, int id) -> bool"""
10095 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
10097 def SetLabel(*args
, **kwargs
):
10098 """SetLabel(self, int id, String label)"""
10099 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
10101 def GetLabel(*args
, **kwargs
):
10102 """GetLabel(self, int id) -> String"""
10103 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
10105 def SetHelpString(*args
, **kwargs
):
10106 """SetHelpString(self, int id, String helpString)"""
10107 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
10109 def GetHelpString(*args
, **kwargs
):
10110 """GetHelpString(self, int id) -> String"""
10111 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
10113 def GetFrame(*args
, **kwargs
):
10114 """GetFrame(self) -> wxFrame"""
10115 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
10117 def IsAttached(*args
, **kwargs
):
10118 """IsAttached(self) -> bool"""
10119 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
10121 def Attach(*args
, **kwargs
):
10122 """Attach(self, wxFrame frame)"""
10123 return _core_
.MenuBar_Attach(*args
, **kwargs
)
10125 def Detach(*args
, **kwargs
):
10127 return _core_
.MenuBar_Detach(*args
, **kwargs
)
10129 def SetAutoWindowMenu(*args
, **kwargs
):
10130 """SetAutoWindowMenu(bool enable)"""
10131 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10133 SetAutoWindowMenu
= staticmethod(SetAutoWindowMenu
)
10134 def GetAutoWindowMenu(*args
, **kwargs
):
10135 """GetAutoWindowMenu() -> bool"""
10136 return _core_
.MenuBar_GetAutoWindowMenu(*args
, **kwargs
)
10138 GetAutoWindowMenu
= staticmethod(GetAutoWindowMenu
)
10139 _core_
.MenuBar_swigregister(MenuBar
)
10141 def MenuBar_SetAutoWindowMenu(*args
, **kwargs
):
10142 """MenuBar_SetAutoWindowMenu(bool enable)"""
10143 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10145 def MenuBar_GetAutoWindowMenu(*args
):
10146 """MenuBar_GetAutoWindowMenu() -> bool"""
10147 return _core_
.MenuBar_GetAutoWindowMenu(*args
)
10149 #---------------------------------------------------------------------------
10151 class MenuItem(Object
):
10152 """Proxy of C++ MenuItem class"""
10153 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10154 __repr__
= _swig_repr
10155 def __init__(self
, *args
, **kwargs
):
10157 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10158 String help=EmptyString, int kind=ITEM_NORMAL,
10159 Menu subMenu=None) -> MenuItem
10161 _core_
.MenuItem_swiginit(self
,_core_
.new_MenuItem(*args
, **kwargs
))
10162 __swig_destroy__
= _core_
.delete_MenuItem
10163 __del__
= lambda self
: None;
10164 def GetMenu(*args
, **kwargs
):
10165 """GetMenu(self) -> Menu"""
10166 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
10168 def SetMenu(*args
, **kwargs
):
10169 """SetMenu(self, Menu menu)"""
10170 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
10172 def SetId(*args
, **kwargs
):
10173 """SetId(self, int id)"""
10174 return _core_
.MenuItem_SetId(*args
, **kwargs
)
10176 def GetId(*args
, **kwargs
):
10177 """GetId(self) -> int"""
10178 return _core_
.MenuItem_GetId(*args
, **kwargs
)
10180 def IsSeparator(*args
, **kwargs
):
10181 """IsSeparator(self) -> bool"""
10182 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
10184 def SetText(*args
, **kwargs
):
10185 """SetText(self, String str)"""
10186 return _core_
.MenuItem_SetText(*args
, **kwargs
)
10188 def GetLabel(*args
, **kwargs
):
10189 """GetLabel(self) -> String"""
10190 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
10192 def GetText(*args
, **kwargs
):
10193 """GetText(self) -> String"""
10194 return _core_
.MenuItem_GetText(*args
, **kwargs
)
10196 def GetLabelFromText(*args
, **kwargs
):
10197 """GetLabelFromText(String text) -> String"""
10198 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10200 GetLabelFromText
= staticmethod(GetLabelFromText
)
10201 def GetKind(*args
, **kwargs
):
10202 """GetKind(self) -> int"""
10203 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
10205 def SetKind(*args
, **kwargs
):
10206 """SetKind(self, int kind)"""
10207 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
10209 def SetCheckable(*args
, **kwargs
):
10210 """SetCheckable(self, bool checkable)"""
10211 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
10213 def IsCheckable(*args
, **kwargs
):
10214 """IsCheckable(self) -> bool"""
10215 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
10217 def IsSubMenu(*args
, **kwargs
):
10218 """IsSubMenu(self) -> bool"""
10219 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
10221 def SetSubMenu(*args
, **kwargs
):
10222 """SetSubMenu(self, Menu menu)"""
10223 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
10225 def GetSubMenu(*args
, **kwargs
):
10226 """GetSubMenu(self) -> Menu"""
10227 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
10229 def Enable(*args
, **kwargs
):
10230 """Enable(self, bool enable=True)"""
10231 return _core_
.MenuItem_Enable(*args
, **kwargs
)
10233 def IsEnabled(*args
, **kwargs
):
10234 """IsEnabled(self) -> bool"""
10235 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
10237 def Check(*args
, **kwargs
):
10238 """Check(self, bool check=True)"""
10239 return _core_
.MenuItem_Check(*args
, **kwargs
)
10241 def IsChecked(*args
, **kwargs
):
10242 """IsChecked(self) -> bool"""
10243 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
10245 def Toggle(*args
, **kwargs
):
10247 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
10249 def SetHelp(*args
, **kwargs
):
10250 """SetHelp(self, String str)"""
10251 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
10253 def GetHelp(*args
, **kwargs
):
10254 """GetHelp(self) -> String"""
10255 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
10257 def GetAccel(*args
, **kwargs
):
10258 """GetAccel(self) -> AcceleratorEntry"""
10259 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
10261 def SetAccel(*args
, **kwargs
):
10262 """SetAccel(self, AcceleratorEntry accel)"""
10263 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
10265 def SetBitmap(*args
, **kwargs
):
10266 """SetBitmap(self, Bitmap bitmap)"""
10267 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
10269 def GetBitmap(*args
, **kwargs
):
10270 """GetBitmap(self) -> Bitmap"""
10271 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
10273 def SetFont(*args
, **kwargs
):
10274 """SetFont(self, Font font)"""
10275 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
10277 def GetFont(*args
, **kwargs
):
10278 """GetFont(self) -> Font"""
10279 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
10281 def SetTextColour(*args
, **kwargs
):
10282 """SetTextColour(self, Colour colText)"""
10283 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
10285 def GetTextColour(*args
, **kwargs
):
10286 """GetTextColour(self) -> Colour"""
10287 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
10289 def SetBackgroundColour(*args
, **kwargs
):
10290 """SetBackgroundColour(self, Colour colBack)"""
10291 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
10293 def GetBackgroundColour(*args
, **kwargs
):
10294 """GetBackgroundColour(self) -> Colour"""
10295 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
10297 def SetBitmaps(*args
, **kwargs
):
10298 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10299 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
10301 def SetDisabledBitmap(*args
, **kwargs
):
10302 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10303 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
10305 def GetDisabledBitmap(*args
, **kwargs
):
10306 """GetDisabledBitmap(self) -> Bitmap"""
10307 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
10309 def SetMarginWidth(*args
, **kwargs
):
10310 """SetMarginWidth(self, int nWidth)"""
10311 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
10313 def GetMarginWidth(*args
, **kwargs
):
10314 """GetMarginWidth(self) -> int"""
10315 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
10317 def GetDefaultMarginWidth(*args
, **kwargs
):
10318 """GetDefaultMarginWidth() -> int"""
10319 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10321 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
10322 def IsOwnerDrawn(*args
, **kwargs
):
10323 """IsOwnerDrawn(self) -> bool"""
10324 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
10326 def SetOwnerDrawn(*args
, **kwargs
):
10327 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10328 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
10330 def ResetOwnerDrawn(*args
, **kwargs
):
10331 """ResetOwnerDrawn(self)"""
10332 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
10334 _core_
.MenuItem_swigregister(MenuItem
)
10336 def MenuItem_GetLabelFromText(*args
, **kwargs
):
10337 """MenuItem_GetLabelFromText(String text) -> String"""
10338 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10340 def MenuItem_GetDefaultMarginWidth(*args
):
10341 """MenuItem_GetDefaultMarginWidth() -> int"""
10342 return _core_
.MenuItem_GetDefaultMarginWidth(*args
)
10344 #---------------------------------------------------------------------------
10346 class Control(Window
):
10348 This is the base class for a control or 'widget'.
10350 A control is generally a small window which processes user input
10351 and/or displays one or more item of data.
10353 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10354 __repr__
= _swig_repr
10355 def __init__(self
, *args
, **kwargs
):
10357 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10358 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10359 String name=ControlNameStr) -> Control
10361 Create a Control. Normally you should only call this from a subclass'
10362 __init__ as a plain old wx.Control is not very useful.
10364 _core_
.Control_swiginit(self
,_core_
.new_Control(*args
, **kwargs
))
10365 self
._setOORInfo
(self
)
10367 def Create(*args
, **kwargs
):
10369 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10370 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10371 String name=ControlNameStr) -> bool
10373 Do the 2nd phase and create the GUI control.
10375 return _core_
.Control_Create(*args
, **kwargs
)
10377 def Command(*args
, **kwargs
):
10379 Command(self, CommandEvent event)
10381 Simulates the effect of the user issuing a command to the item.
10383 :see: `wx.CommandEvent`
10386 return _core_
.Control_Command(*args
, **kwargs
)
10388 def GetLabel(*args
, **kwargs
):
10390 GetLabel(self) -> String
10392 Return a control's text.
10394 return _core_
.Control_GetLabel(*args
, **kwargs
)
10396 def GetClassDefaultAttributes(*args
, **kwargs
):
10398 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10400 Get the default attributes for this class. This is useful if you want
10401 to use the same font or colour in your own control as in a standard
10402 control -- which is a much better idea than hard coding specific
10403 colours or fonts which might look completely out of place on the
10404 user's system, especially if it uses themes.
10406 The variant parameter is only relevant under Mac currently and is
10407 ignore under other platforms. Under Mac, it will change the size of
10408 the returned font. See `wx.Window.SetWindowVariant` for more about
10411 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10413 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
10414 _core_
.Control_swigregister(Control
)
10415 ControlNameStr
= cvar
.ControlNameStr
10417 def PreControl(*args
, **kwargs
):
10419 PreControl() -> Control
10421 Precreate a Control control for 2-phase creation
10423 val
= _core_
.new_PreControl(*args
, **kwargs
)
10426 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
10428 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10430 Get the default attributes for this class. This is useful if you want
10431 to use the same font or colour in your own control as in a standard
10432 control -- which is a much better idea than hard coding specific
10433 colours or fonts which might look completely out of place on the
10434 user's system, especially if it uses themes.
10436 The variant parameter is only relevant under Mac currently and is
10437 ignore under other platforms. Under Mac, it will change the size of
10438 the returned font. See `wx.Window.SetWindowVariant` for more about
10441 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10443 #---------------------------------------------------------------------------
10445 class ItemContainer(object):
10447 The wx.ItemContainer class defines an interface which is implemented
10448 by all controls which have string subitems, each of which may be
10449 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10450 as `wx.ComboBox` which implements an extended interface deriving from
10453 It defines the methods for accessing the control's items and although
10454 each of the derived classes implements them differently, they still
10455 all conform to the same interface.
10457 The items in a wx.ItemContainer have (non empty) string labels and,
10458 optionally, client data associated with them.
10461 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10462 def __init__(self
): raise AttributeError, "No constructor defined"
10463 __repr__
= _swig_repr
10464 def Append(*args
, **kwargs
):
10466 Append(self, String item, PyObject clientData=None) -> int
10468 Adds the item to the control, associating the given data with the item
10469 if not None. The return value is the index of the newly added item
10470 which may be different from the last one if the control is sorted (e.g.
10471 has wx.LB_SORT or wx.CB_SORT style).
10473 return _core_
.ItemContainer_Append(*args
, **kwargs
)
10475 def AppendItems(*args
, **kwargs
):
10477 AppendItems(self, List strings)
10479 Apend several items at once to the control. Notice that calling this
10480 method may be much faster than appending the items one by one if you
10481 need to add a lot of items.
10483 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
10485 def Insert(*args
, **kwargs
):
10487 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10489 Insert an item into the control before the item at the ``pos`` index,
10490 optionally associating some data object with the item.
10492 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
10494 def Clear(*args
, **kwargs
):
10498 Removes all items from the control.
10500 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
10502 def Delete(*args
, **kwargs
):
10504 Delete(self, unsigned int n)
10506 Deletes the item at the zero-based index 'n' from the control. Note
10507 that it is an error (signalled by a `wx.PyAssertionError` exception if
10508 enabled) to remove an item with the index negative or greater or equal
10509 than the number of items in the control.
10511 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
10513 def GetClientData(*args
, **kwargs
):
10515 GetClientData(self, unsigned int n) -> PyObject
10517 Returns the client data associated with the given item, (if any.)
10519 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
10521 def SetClientData(*args
, **kwargs
):
10523 SetClientData(self, unsigned int n, PyObject clientData)
10525 Associate the given client data with the item at position n.
10527 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
10529 def GetCount(*args
, **kwargs
):
10531 GetCount(self) -> unsigned int
10533 Returns the number of items in the control.
10535 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
10537 def IsEmpty(*args
, **kwargs
):
10539 IsEmpty(self) -> bool
10541 Returns True if the control is empty or False if it has some items.
10543 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
10545 def GetString(*args
, **kwargs
):
10547 GetString(self, unsigned int n) -> String
10549 Returns the label of the item with the given index.
10551 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
10553 def GetStrings(*args
, **kwargs
):
10554 """GetStrings(self) -> wxArrayString"""
10555 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
10557 def SetString(*args
, **kwargs
):
10559 SetString(self, unsigned int n, String s)
10561 Sets the label for the given item.
10563 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
10565 def FindString(*args
, **kwargs
):
10567 FindString(self, String s) -> int
10569 Finds an item whose label matches the given string. Returns the
10570 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10573 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
10575 def SetSelection(*args
, **kwargs
):
10577 SetSelection(self, int n)
10579 Sets the item at index 'n' to be the selected item.
10581 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
10583 def GetSelection(*args
, **kwargs
):
10585 GetSelection(self) -> int
10587 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10590 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
10592 def SetStringSelection(*args
, **kwargs
):
10593 """SetStringSelection(self, String s) -> bool"""
10594 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
10596 def GetStringSelection(*args
, **kwargs
):
10598 GetStringSelection(self) -> String
10600 Returns the label of the selected item or an empty string if no item
10603 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
10605 def Select(*args
, **kwargs
):
10607 Select(self, int n)
10609 This is the same as `SetSelection` and exists only because it is
10610 slightly more natural for controls which support multiple selection.
10612 return _core_
.ItemContainer_Select(*args
, **kwargs
)
10614 _core_
.ItemContainer_swigregister(ItemContainer
)
10616 #---------------------------------------------------------------------------
10618 class ControlWithItems(Control
,ItemContainer
):
10620 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10621 wx.Control class, and is used for the base class of various controls
10624 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10625 def __init__(self
): raise AttributeError, "No constructor defined"
10626 __repr__
= _swig_repr
10627 _core_
.ControlWithItems_swigregister(ControlWithItems
)
10629 #---------------------------------------------------------------------------
10631 class SizerItem(Object
):
10633 The wx.SizerItem class is used to track the position, size and other
10634 attributes of each item managed by a `wx.Sizer`. It is not usually
10635 necessary to use this class because the sizer elements can also be
10636 identified by their positions or window or sizer references but
10637 sometimes it may be more convenient to use wx.SizerItem directly.
10638 Also, custom classes derived from `wx.PySizer` will probably need to
10639 use the collection of wx.SizerItems held by wx.Sizer when calculating
10642 :see: `wx.Sizer`, `wx.GBSizerItem`
10644 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10645 __repr__
= _swig_repr
10646 def __init__(self
, *args
, **kwargs
):
10648 __init__(self) -> SizerItem
10650 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10651 size will need to be set before this item can be used in a Sizer.
10653 You will probably never need to create a wx.SizerItem directly as they
10654 are created automatically when the sizer's Add, Insert or Prepend
10655 methods are called.
10657 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10659 _core_
.SizerItem_swiginit(self
,_core_
.new_SizerItem(*args
, **kwargs
))
10660 __swig_destroy__
= _core_
.delete_SizerItem
10661 __del__
= lambda self
: None;
10662 def DeleteWindows(*args
, **kwargs
):
10664 DeleteWindows(self)
10666 Destroy the window or the windows in a subsizer, depending on the type
10669 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
10671 def DetachSizer(*args
, **kwargs
):
10675 Enable deleting the SizerItem without destroying the contained sizer.
10677 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
10679 def GetSize(*args
, **kwargs
):
10681 GetSize(self) -> Size
10683 Get the current size of the item, as set in the last Layout.
10685 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
10687 def CalcMin(*args
, **kwargs
):
10689 CalcMin(self) -> Size
10691 Calculates the minimum desired size for the item, including any space
10694 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
10696 def SetDimension(*args
, **kwargs
):
10698 SetDimension(self, Point pos, Size size)
10700 Set the position and size of the space allocated for this item by the
10701 sizer, and adjust the position and size of the item (window or
10702 subsizer) to be within that space taking alignment and borders into
10705 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
10707 def GetMinSize(*args
, **kwargs
):
10709 GetMinSize(self) -> Size
10711 Get the minimum size needed for the item.
10713 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
10715 def GetMinSizeWithBorder(*args
, **kwargs
):
10717 GetMinSizeWithBorder(self) -> Size
10719 Get the minimum size needed for the item with space for the borders
10722 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
10724 def SetInitSize(*args
, **kwargs
):
10725 """SetInitSize(self, int x, int y)"""
10726 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
10728 def SetRatioWH(*args
, **kwargs
):
10730 SetRatioWH(self, int width, int height)
10732 Set the ratio item attribute.
10734 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
10736 def SetRatioSize(*args
, **kwargs
):
10738 SetRatioSize(self, Size size)
10740 Set the ratio item attribute.
10742 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
10744 def SetRatio(*args
, **kwargs
):
10746 SetRatio(self, float ratio)
10748 Set the ratio item attribute.
10750 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
10752 def GetRatio(*args
, **kwargs
):
10754 GetRatio(self) -> float
10756 Set the ratio item attribute.
10758 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
10760 def GetRect(*args
, **kwargs
):
10762 GetRect(self) -> Rect
10764 Returns the rectangle that the sizer item should occupy
10766 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
10768 def IsWindow(*args
, **kwargs
):
10770 IsWindow(self) -> bool
10772 Is this sizer item a window?
10774 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
10776 def IsSizer(*args
, **kwargs
):
10778 IsSizer(self) -> bool
10780 Is this sizer item a subsizer?
10782 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
10784 def IsSpacer(*args
, **kwargs
):
10786 IsSpacer(self) -> bool
10788 Is this sizer item a spacer?
10790 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
10792 def SetProportion(*args
, **kwargs
):
10794 SetProportion(self, int proportion)
10796 Set the proportion value for this item.
10798 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
10800 def GetProportion(*args
, **kwargs
):
10802 GetProportion(self) -> int
10804 Get the proportion value for this item.
10806 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
10808 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
10809 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
10810 def SetFlag(*args
, **kwargs
):
10812 SetFlag(self, int flag)
10814 Set the flag value for this item.
10816 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
10818 def GetFlag(*args
, **kwargs
):
10820 GetFlag(self) -> int
10822 Get the flag value for this item.
10824 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
10826 def SetBorder(*args
, **kwargs
):
10828 SetBorder(self, int border)
10830 Set the border value for this item.
10832 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
10834 def GetBorder(*args
, **kwargs
):
10836 GetBorder(self) -> int
10838 Get the border value for this item.
10840 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
10842 def GetWindow(*args
, **kwargs
):
10844 GetWindow(self) -> Window
10846 Get the window (if any) that is managed by this sizer item.
10848 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
10850 def SetWindow(*args
, **kwargs
):
10852 SetWindow(self, Window window)
10854 Set the window to be managed by this sizer item.
10856 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
10858 def GetSizer(*args
, **kwargs
):
10860 GetSizer(self) -> Sizer
10862 Get the subsizer (if any) that is managed by this sizer item.
10864 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
10866 def SetSizer(*args
, **kwargs
):
10868 SetSizer(self, Sizer sizer)
10870 Set the subsizer to be managed by this sizer item.
10872 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
10874 def GetSpacer(*args
, **kwargs
):
10876 GetSpacer(self) -> Size
10878 Get the size of the spacer managed by this sizer item.
10880 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
10882 def SetSpacer(*args
, **kwargs
):
10884 SetSpacer(self, Size size)
10886 Set the size of the spacer to be managed by this sizer item.
10888 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
10890 def Show(*args
, **kwargs
):
10892 Show(self, bool show)
10894 Set the show item attribute, which sizers use to determine if the item
10895 is to be made part of the layout or not. If the item is tracking a
10896 window then it is shown or hidden as needed.
10898 return _core_
.SizerItem_Show(*args
, **kwargs
)
10900 def IsShown(*args
, **kwargs
):
10902 IsShown(self) -> bool
10904 Is the item to be shown in the layout?
10906 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
10908 def GetPosition(*args
, **kwargs
):
10910 GetPosition(self) -> Point
10912 Returns the current position of the item, as set in the last Layout.
10914 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
10916 def GetUserData(*args
, **kwargs
):
10918 GetUserData(self) -> PyObject
10920 Returns the userData associated with this sizer item, or None if there
10923 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
10925 def SetUserData(*args
, **kwargs
):
10927 SetUserData(self, PyObject userData)
10929 Associate a Python object with this sizer item.
10931 return _core_
.SizerItem_SetUserData(*args
, **kwargs
)
10933 _core_
.SizerItem_swigregister(SizerItem
)
10935 def SizerItemWindow(*args
, **kwargs
):
10937 SizerItemWindow(Window window, int proportion, int flag, int border,
10938 PyObject userData=None) -> SizerItem
10940 Constructs a `wx.SizerItem` for tracking a window.
10942 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
10945 def SizerItemSpacer(*args
, **kwargs
):
10947 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10948 PyObject userData=None) -> SizerItem
10950 Constructs a `wx.SizerItem` for tracking a spacer.
10952 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
10955 def SizerItemSizer(*args
, **kwargs
):
10957 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10958 PyObject userData=None) -> SizerItem
10960 Constructs a `wx.SizerItem` for tracking a subsizer
10962 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
10965 class Sizer(Object
):
10967 wx.Sizer is the abstract base class used for laying out subwindows in
10968 a window. You cannot use wx.Sizer directly; instead, you will have to
10969 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10970 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10971 and `wx.GridBagSizer`.
10973 The concept implemented by sizers in wxWidgets is closely related to
10974 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10975 toolkit or the Qt toolkit. It is based upon the idea of the individual
10976 subwindows reporting their minimal required size and their ability to
10977 get stretched if the size of the parent window has changed. This will
10978 most often mean that the programmer does not set the original size of
10979 a dialog in the beginning, rather the dialog will assigned a sizer and
10980 this sizer will be queried about the recommended size. The sizer in
10981 turn will query its children, which can be normal windows or contorls,
10982 empty space or other sizers, so that a hierarchy of sizers can be
10983 constructed. Note that wxSizer does not derive from wxWindow and thus
10984 do not interfere with tab ordering and requires very little resources
10985 compared to a real window on screen.
10987 What makes sizers so well fitted for use in wxWidgets is the fact that
10988 every control reports its own minimal size and the algorithm can
10989 handle differences in font sizes or different window (dialog item)
10990 sizes on different platforms without problems. If for example the
10991 standard font as well as the overall design of Mac widgets requires
10992 more space than on Windows, then the initial size of a dialog using a
10993 sizer will automatically be bigger on Mac than on Windows.
10995 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10996 def __init__(self
): raise AttributeError, "No constructor defined"
10997 __repr__
= _swig_repr
10998 __swig_destroy__
= _core_
.delete_Sizer
10999 __del__
= lambda self
: None;
11000 def _setOORInfo(*args
, **kwargs
):
11001 """_setOORInfo(self, PyObject _self)"""
11002 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
11004 def Add(*args
, **kwargs
):
11006 Add(self, item, int proportion=0, int flag=0, int border=0,
11007 PyObject userData=None) -> wx.SizerItem
11009 Appends a child item to the sizer.
11011 return _core_
.Sizer_Add(*args
, **kwargs
)
11013 def Insert(*args
, **kwargs
):
11015 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11016 PyObject userData=None) -> wx.SizerItem
11018 Inserts a new item into the list of items managed by this sizer before
11019 the item at index *before*. See `Add` for a description of the parameters.
11021 return _core_
.Sizer_Insert(*args
, **kwargs
)
11023 def Prepend(*args
, **kwargs
):
11025 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11026 PyObject userData=None) -> wx.SizerItem
11028 Adds a new item to the begining of the list of sizer items managed by
11029 this sizer. See `Add` for a description of the parameters.
11031 return _core_
.Sizer_Prepend(*args
, **kwargs
)
11033 def Remove(*args
, **kwargs
):
11035 Remove(self, item) -> bool
11037 Removes an item from the sizer and destroys it. This method does not
11038 cause any layout or resizing to take place, call `Layout` to update
11039 the layout on screen after removing a child from the sizer. The
11040 *item* parameter can be either a window, a sizer, or the zero-based
11041 index of an item to remove. Returns True if the child item was found
11044 return _core_
.Sizer_Remove(*args
, **kwargs
)
11046 def Detach(*args
, **kwargs
):
11048 Detach(self, item) -> bool
11050 Detaches an item from the sizer without destroying it. This method
11051 does not cause any layout or resizing to take place, call `Layout` to
11052 do so. The *item* parameter can be either a window, a sizer, or the
11053 zero-based index of the item to be detached. Returns True if the child item
11054 was found and detached.
11056 return _core_
.Sizer_Detach(*args
, **kwargs
)
11058 def GetItem(*args
, **kwargs
):
11060 GetItem(self, item) -> wx.SizerItem
11062 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11063 parameter can be either a window, a sizer, or the zero-based index of
11064 the item to be found.
11066 return _core_
.Sizer_GetItem(*args
, **kwargs
)
11068 def _SetItemMinSize(*args
, **kwargs
):
11069 """_SetItemMinSize(self, PyObject item, Size size)"""
11070 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
11072 def SetItemMinSize(self
, item
, *args
):
11074 SetItemMinSize(self, item, Size size)
11076 Sets the minimum size that will be allocated for an item in the sizer.
11077 The *item* parameter can be either a window, a sizer, or the
11078 zero-based index of the item. If a window or sizer is given then it
11079 will be searched for recursivly in subsizers if neccessary.
11082 # for backward compatibility accept separate width,height args too
11083 return self
._SetItemMinSize
(item
, args
)
11085 return self
._SetItemMinSize
(item
, args
[0])
11087 def AddItem(*args
, **kwargs
):
11089 AddItem(self, SizerItem item)
11091 Adds a `wx.SizerItem` to the sizer.
11093 return _core_
.Sizer_AddItem(*args
, **kwargs
)
11095 def InsertItem(*args
, **kwargs
):
11097 InsertItem(self, int index, SizerItem item)
11099 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11101 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
11103 def PrependItem(*args
, **kwargs
):
11105 PrependItem(self, SizerItem item)
11107 Prepends a `wx.SizerItem` to the sizer.
11109 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
11111 def AddMany(self
, items
):
11113 AddMany is a convenience method for adding several items
11114 to a sizer at one time. Simply pass it a list of tuples,
11115 where each tuple consists of the parameters that you
11116 would normally pass to the `Add` method.
11119 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
11123 # for backwards compatibility only, please do not use in new code
11124 def AddWindow(self
, *args
, **kw
):
11125 """Compatibility alias for `Add`."""
11126 return self
.Add(*args
, **kw
)
11127 def AddSizer(self
, *args
, **kw
):
11128 """Compatibility alias for `Add`."""
11129 return self
.Add(*args
, **kw
)
11130 def AddSpacer(self
, *args
, **kw
):
11131 """Compatibility alias for `Add`."""
11132 return self
.Add(*args
, **kw
)
11134 def PrependWindow(self
, *args
, **kw
):
11135 """Compatibility alias for `Prepend`."""
11136 return self
.Prepend(*args
, **kw
)
11137 def PrependSizer(self
, *args
, **kw
):
11138 """Compatibility alias for `Prepend`."""
11139 return self
.Prepend(*args
, **kw
)
11140 def PrependSpacer(self
, *args
, **kw
):
11141 """Compatibility alias for `Prepend`."""
11142 return self
.Prepend(*args
, **kw
)
11144 def InsertWindow(self
, *args
, **kw
):
11145 """Compatibility alias for `Insert`."""
11146 return self
.Insert(*args
, **kw
)
11147 def InsertSizer(self
, *args
, **kw
):
11148 """Compatibility alias for `Insert`."""
11149 return self
.Insert(*args
, **kw
)
11150 def InsertSpacer(self
, *args
, **kw
):
11151 """Compatibility alias for `Insert`."""
11152 return self
.Insert(*args
, **kw
)
11154 def RemoveWindow(self
, *args
, **kw
):
11155 """Compatibility alias for `Remove`."""
11156 return self
.Remove(*args
, **kw
)
11157 def RemoveSizer(self
, *args
, **kw
):
11158 """Compatibility alias for `Remove`."""
11159 return self
.Remove(*args
, **kw
)
11160 def RemovePos(self
, *args
, **kw
):
11161 """Compatibility alias for `Remove`."""
11162 return self
.Remove(*args
, **kw
)
11165 def SetDimension(*args
, **kwargs
):
11167 SetDimension(self, int x, int y, int width, int height)
11169 Call this to force the sizer to take the given dimension and thus
11170 force the items owned by the sizer to resize themselves according to
11171 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11174 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
11176 def SetMinSize(*args
, **kwargs
):
11178 SetMinSize(self, Size size)
11180 Call this to give the sizer a minimal size. Normally, the sizer will
11181 calculate its minimal size based purely on how much space its children
11182 need. After calling this method `GetMinSize` will return either the
11183 minimal size as requested by its children or the minimal size set
11184 here, depending on which is bigger.
11186 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
11188 def GetSize(*args
, **kwargs
):
11190 GetSize(self) -> Size
11192 Returns the current size of the space managed by the sizer.
11194 return _core_
.Sizer_GetSize(*args
, **kwargs
)
11196 def GetPosition(*args
, **kwargs
):
11198 GetPosition(self) -> Point
11200 Returns the current position of the sizer's managed space.
11202 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
11204 def GetMinSize(*args
, **kwargs
):
11206 GetMinSize(self) -> Size
11208 Returns the minimal size of the sizer. This is either the combined
11209 minimal size of all the children and their borders or the minimal size
11210 set by SetMinSize, depending on which is bigger.
11212 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
11214 def GetSizeTuple(self
):
11215 return self
.GetSize().Get()
11216 def GetPositionTuple(self
):
11217 return self
.GetPosition().Get()
11218 def GetMinSizeTuple(self
):
11219 return self
.GetMinSize().Get()
11221 def RecalcSizes(*args
, **kwargs
):
11225 Using the sizes calculated by `CalcMin` reposition and resize all the
11226 items managed by this sizer. You should not need to call this directly as
11227 it is called by `Layout`.
11229 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
11231 def CalcMin(*args
, **kwargs
):
11233 CalcMin(self) -> Size
11235 This method is where the sizer will do the actual calculation of its
11236 children's minimal sizes. You should not need to call this directly as
11237 it is called by `Layout`.
11239 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
11241 def Layout(*args
, **kwargs
):
11245 This method will force the recalculation and layout of the items
11246 controlled by the sizer using the current space allocated to the
11247 sizer. Normally this is called automatically from the owning window's
11248 EVT_SIZE handler, but it is also useful to call it from user code when
11249 one of the items in a sizer change size, or items are added or
11252 return _core_
.Sizer_Layout(*args
, **kwargs
)
11254 def Fit(*args
, **kwargs
):
11256 Fit(self, Window window) -> Size
11258 Tell the sizer to resize the *window* to match the sizer's minimal
11259 size. This is commonly done in the constructor of the window itself in
11260 order to set its initial size to match the needs of the children as
11261 determined by the sizer. Returns the new size.
11263 For a top level window this is the total window size, not the client size.
11265 return _core_
.Sizer_Fit(*args
, **kwargs
)
11267 def FitInside(*args
, **kwargs
):
11269 FitInside(self, Window window)
11271 Tell the sizer to resize the *virtual size* of the *window* to match the
11272 sizer's minimal size. This will not alter the on screen size of the
11273 window, but may cause the addition/removal/alteration of scrollbars
11274 required to view the virtual area in windows which manage it.
11276 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11279 return _core_
.Sizer_FitInside(*args
, **kwargs
)
11281 def SetSizeHints(*args
, **kwargs
):
11283 SetSizeHints(self, Window window)
11285 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11286 match the sizer's minimal size. This is commonly done in the
11287 constructor of the window itself if the window is resizable (as are
11288 many dialogs under Unix and frames on probably all platforms) in order
11289 to prevent the window from being sized smaller than the minimal size
11290 required by the sizer.
11292 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
11294 def SetVirtualSizeHints(*args
, **kwargs
):
11296 SetVirtualSizeHints(self, Window window)
11298 Tell the sizer to set the minimal size of the window virtual area to
11299 match the sizer's minimal size. For windows with managed scrollbars
11300 this will set them appropriately.
11302 :see: `wx.ScrolledWindow.SetScrollbars`
11305 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
11307 def Clear(*args
, **kwargs
):
11309 Clear(self, bool deleteWindows=False)
11311 Clear all items from the sizer, optionally destroying the window items
11314 return _core_
.Sizer_Clear(*args
, **kwargs
)
11316 def DeleteWindows(*args
, **kwargs
):
11318 DeleteWindows(self)
11320 Destroy all windows managed by the sizer.
11322 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
11324 def GetChildren(*args
, **kwargs
):
11326 GetChildren(self) -> list
11328 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11330 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
11332 def Show(*args
, **kwargs
):
11334 Show(self, item, bool show=True, bool recursive=false) -> bool
11336 Shows or hides an item managed by the sizer. To make a sizer item
11337 disappear or reappear, use Show followed by `Layout`. The *item*
11338 parameter can be either a window, a sizer, or the zero-based index of
11339 the item. Use the recursive parameter to show or hide an item in a
11340 subsizer. Returns True if the item was found.
11342 return _core_
.Sizer_Show(*args
, **kwargs
)
11344 def IsShown(*args
, **kwargs
):
11346 IsShown(self, item)
11348 Determines if the item is currently shown. To make a sizer
11349 item disappear or reappear, use Show followed by `Layout`. The *item*
11350 parameter can be either a window, a sizer, or the zero-based index of
11353 return _core_
.Sizer_IsShown(*args
, **kwargs
)
11355 def Hide(self
, item
, recursive
=False):
11357 A convenience method for `Show` (item, False, recursive).
11359 return self
.Show(item
, False, recursive
)
11361 def ShowItems(*args
, **kwargs
):
11363 ShowItems(self, bool show)
11365 Recursively call `wx.SizerItem.Show` on all sizer items.
11367 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
11369 _core_
.Sizer_swigregister(Sizer
)
11371 class PySizer(Sizer
):
11373 wx.PySizer is a special version of `wx.Sizer` that has been
11374 instrumented to allow the C++ virtual methods to be overloaded in
11375 Python derived classes. You would derive from this class if you are
11376 wanting to implement a custom sizer in Python code. Simply implement
11377 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11380 class MySizer(wx.PySizer):
11381 def __init__(self):
11382 wx.PySizer.__init__(self)
11385 for item in self.GetChildren():
11386 # calculate the total minimum width and height needed
11387 # by all items in the sizer according to this sizer's
11388 # layout algorithm.
11390 return wx.Size(width, height)
11392 def RecalcSizes(self):
11393 # find the space allotted to this sizer
11394 pos = self.GetPosition()
11395 size = self.GetSize()
11396 for item in self.GetChildren():
11397 # Recalculate (if necessary) the position and size of
11398 # each item and then call item.SetDimension to do the
11399 # actual positioning and sizing of the items within the
11400 # space alloted to this sizer.
11402 item.SetDimension(itemPos, itemSize)
11405 When `Layout` is called it first calls `CalcMin` followed by
11406 `RecalcSizes` so you can optimize a bit by saving the results of
11407 `CalcMin` and reusing them in `RecalcSizes`.
11409 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11413 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11414 __repr__
= _swig_repr
11415 def __init__(self
, *args
, **kwargs
):
11417 __init__(self) -> PySizer
11419 Creates a wx.PySizer. Must be called from the __init__ in the derived
11422 _core_
.PySizer_swiginit(self
,_core_
.new_PySizer(*args
, **kwargs
))
11423 self
._setCallbackInfo
(self
, PySizer
);self
._setOORInfo
(self
)
11425 def _setCallbackInfo(*args
, **kwargs
):
11426 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11427 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
11429 _core_
.PySizer_swigregister(PySizer
)
11431 #---------------------------------------------------------------------------
11433 class BoxSizer(Sizer
):
11435 The basic idea behind a box sizer is that windows will most often be
11436 laid out in rather simple basic geometry, typically in a row or a
11437 column or nested hierarchies of either. A wx.BoxSizer will lay out
11438 its items in a simple row or column, depending on the orientation
11439 parameter passed to the constructor.
11441 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11442 __repr__
= _swig_repr
11443 def __init__(self
, *args
, **kwargs
):
11445 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11447 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11448 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11451 _core_
.BoxSizer_swiginit(self
,_core_
.new_BoxSizer(*args
, **kwargs
))
11452 self
._setOORInfo
(self
)
11454 def GetOrientation(*args
, **kwargs
):
11456 GetOrientation(self) -> int
11458 Returns the current orientation of the sizer.
11460 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
11462 def SetOrientation(*args
, **kwargs
):
11464 SetOrientation(self, int orient)
11466 Resets the orientation of the sizer.
11468 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
11470 _core_
.BoxSizer_swigregister(BoxSizer
)
11472 #---------------------------------------------------------------------------
11474 class StaticBoxSizer(BoxSizer
):
11476 wx.StaticBoxSizer derives from and functions identically to the
11477 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11478 manages. Note that this static box must be created separately and
11479 passed to the sizer constructor.
11481 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11482 __repr__
= _swig_repr
11483 def __init__(self
, *args
, **kwargs
):
11485 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11487 Constructor. It takes an associated static box and the orientation
11488 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11491 _core_
.StaticBoxSizer_swiginit(self
,_core_
.new_StaticBoxSizer(*args
, **kwargs
))
11492 self
._setOORInfo
(self
)
11494 def GetStaticBox(*args
, **kwargs
):
11496 GetStaticBox(self) -> StaticBox
11498 Returns the static box associated with this sizer.
11500 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
11502 _core_
.StaticBoxSizer_swigregister(StaticBoxSizer
)
11504 #---------------------------------------------------------------------------
11506 class GridSizer(Sizer
):
11508 A grid sizer is a sizer which lays out its children in a
11509 two-dimensional table with all cells having the same size. In other
11510 words, the width of each cell within the grid is the width of the
11511 widest item added to the sizer and the height of each grid cell is the
11512 height of the tallest item. An optional vertical and/or horizontal
11513 gap between items can also be specified (in pixels.)
11515 Items are placed in the cells of the grid in the order they are added,
11516 in row-major order. In other words, the first row is filled first,
11517 then the second, and so on until all items have been added. (If
11518 neccessary, additional rows will be added as items are added.) If you
11519 need to have greater control over the cells that items are placed in
11520 then use the `wx.GridBagSizer`.
11523 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11524 __repr__
= _swig_repr
11525 def __init__(self
, *args
, **kwargs
):
11527 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11529 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11530 of columns and rows in the sizer - if either of the parameters is
11531 zero, it will be calculated to from the total number of children in
11532 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11533 define extra space between all children.
11535 _core_
.GridSizer_swiginit(self
,_core_
.new_GridSizer(*args
, **kwargs
))
11536 self
._setOORInfo
(self
)
11538 def SetCols(*args
, **kwargs
):
11540 SetCols(self, int cols)
11542 Sets the number of columns in the sizer.
11544 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
11546 def SetRows(*args
, **kwargs
):
11548 SetRows(self, int rows)
11550 Sets the number of rows in the sizer.
11552 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
11554 def SetVGap(*args
, **kwargs
):
11556 SetVGap(self, int gap)
11558 Sets the vertical gap (in pixels) between the cells in the sizer.
11560 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
11562 def SetHGap(*args
, **kwargs
):
11564 SetHGap(self, int gap)
11566 Sets the horizontal gap (in pixels) between cells in the sizer
11568 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
11570 def GetCols(*args
, **kwargs
):
11572 GetCols(self) -> int
11574 Returns the number of columns in the sizer.
11576 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
11578 def GetRows(*args
, **kwargs
):
11580 GetRows(self) -> int
11582 Returns the number of rows in the sizer.
11584 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
11586 def GetVGap(*args
, **kwargs
):
11588 GetVGap(self) -> int
11590 Returns the vertical gap (in pixels) between the cells in the sizer.
11592 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
11594 def GetHGap(*args
, **kwargs
):
11596 GetHGap(self) -> int
11598 Returns the horizontal gap (in pixels) between cells in the sizer.
11600 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
11602 def CalcRowsCols(self
):
11604 CalcRowsCols() -> (rows, cols)
11606 Calculates how many rows and columns will be in the sizer based
11607 on the current number of items and also the rows, cols specified
11608 in the constructor.
11610 nitems
= len(self
.GetChildren())
11611 rows
= self
.GetRows()
11612 cols
= self
.GetCols()
11613 assert rows
!= 0 or cols
!= 0, "Grid sizer must have either rows or columns fixed"
11615 rows
= (nitems
+ cols
- 1) / cols
11617 cols
= (nitems
+ rows
- 1) / rows
11618 return (rows
, cols
)
11620 _core_
.GridSizer_swigregister(GridSizer
)
11622 #---------------------------------------------------------------------------
11624 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
11625 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
11626 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
11627 class FlexGridSizer(GridSizer
):
11629 A flex grid sizer is a sizer which lays out its children in a
11630 two-dimensional table with all table cells in one row having the same
11631 height and all cells in one column having the same width, but all
11632 rows or all columns are not necessarily the same height or width as in
11633 the `wx.GridSizer`.
11635 wx.FlexGridSizer can also size items equally in one direction but
11636 unequally ("flexibly") in the other. If the sizer is only flexible
11637 in one direction (this can be changed using `SetFlexibleDirection`), it
11638 needs to be decided how the sizer should grow in the other ("non
11639 flexible") direction in order to fill the available space. The
11640 `SetNonFlexibleGrowMode` method serves this purpose.
11644 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11645 __repr__
= _swig_repr
11646 def __init__(self
, *args
, **kwargs
):
11648 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11650 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11651 number of columns and rows in the sizer - if either of the parameters
11652 is zero, it will be calculated to from the total number of children in
11653 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11654 define extra space between all children.
11656 _core_
.FlexGridSizer_swiginit(self
,_core_
.new_FlexGridSizer(*args
, **kwargs
))
11657 self
._setOORInfo
(self
)
11659 def AddGrowableRow(*args
, **kwargs
):
11661 AddGrowableRow(self, size_t idx, int proportion=0)
11663 Specifies that row *idx* (starting from zero) should be grown if there
11664 is extra space available to the sizer.
11666 The *proportion* parameter has the same meaning as the stretch factor
11667 for the box sizers except that if all proportions are 0, then all
11668 columns are resized equally (instead of not being resized at all).
11670 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
11672 def RemoveGrowableRow(*args
, **kwargs
):
11674 RemoveGrowableRow(self, size_t idx)
11676 Specifies that row *idx* is no longer growable.
11678 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
11680 def AddGrowableCol(*args
, **kwargs
):
11682 AddGrowableCol(self, size_t idx, int proportion=0)
11684 Specifies that column *idx* (starting from zero) should be grown if
11685 there is extra space available to the sizer.
11687 The *proportion* parameter has the same meaning as the stretch factor
11688 for the box sizers except that if all proportions are 0, then all
11689 columns are resized equally (instead of not being resized at all).
11691 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
11693 def RemoveGrowableCol(*args
, **kwargs
):
11695 RemoveGrowableCol(self, size_t idx)
11697 Specifies that column *idx* is no longer growable.
11699 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
11701 def SetFlexibleDirection(*args
, **kwargs
):
11703 SetFlexibleDirection(self, int direction)
11705 Specifies whether the sizer should flexibly resize its columns, rows,
11706 or both. Argument *direction* can be one of the following values. Any
11707 other value is ignored.
11709 ============== =======================================
11710 wx.VERTICAL Rows are flexibly sized.
11711 wx.HORIZONTAL Columns are flexibly sized.
11712 wx.BOTH Both rows and columns are flexibly sized
11713 (this is the default value).
11714 ============== =======================================
11716 Note that this method does not trigger relayout.
11719 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
11721 def GetFlexibleDirection(*args
, **kwargs
):
11723 GetFlexibleDirection(self) -> int
11725 Returns a value that specifies whether the sizer
11726 flexibly resizes its columns, rows, or both (default).
11728 :see: `SetFlexibleDirection`
11730 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
11732 def SetNonFlexibleGrowMode(*args
, **kwargs
):
11734 SetNonFlexibleGrowMode(self, int mode)
11736 Specifies how the sizer should grow in the non-flexible direction if
11737 there is one (so `SetFlexibleDirection` must have been called
11738 previously). Argument *mode* can be one of the following values:
11740 ========================== =================================================
11741 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11742 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11743 `AddGrowableCol` and `AddGrowableRow`. In this
11744 case equal sizing applies to minimum sizes of
11745 columns or rows (this is the default value).
11746 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11747 the non flexible direction, whether they are
11748 growable or not in the flexbile direction.
11749 ========================== =================================================
11751 Note that this method does not trigger relayout.
11755 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
11757 def GetNonFlexibleGrowMode(*args
, **kwargs
):
11759 GetNonFlexibleGrowMode(self) -> int
11761 Returns the value that specifies how the sizer grows in the
11762 non-flexible direction if there is one.
11764 :see: `SetNonFlexibleGrowMode`
11766 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
11768 def GetRowHeights(*args
, **kwargs
):
11770 GetRowHeights(self) -> list
11772 Returns a list of integers representing the heights of each of the
11775 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
11777 def GetColWidths(*args
, **kwargs
):
11779 GetColWidths(self) -> list
11781 Returns a list of integers representing the widths of each of the
11782 columns in the sizer.
11784 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
11786 _core_
.FlexGridSizer_swigregister(FlexGridSizer
)
11788 class StdDialogButtonSizer(BoxSizer
):
11790 A special sizer that knows how to order and position standard buttons
11791 in order to conform to the current platform's standards. You simply
11792 need to add each `wx.Button` to the sizer, and be sure to create the
11793 buttons using the standard ID's. Then call `Realize` and the sizer
11794 will take care of the rest.
11797 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11798 __repr__
= _swig_repr
11799 def __init__(self
, *args
, **kwargs
):
11800 """__init__(self) -> StdDialogButtonSizer"""
11801 _core_
.StdDialogButtonSizer_swiginit(self
,_core_
.new_StdDialogButtonSizer(*args
, **kwargs
))
11802 def AddButton(*args
, **kwargs
):
11804 AddButton(self, wxButton button)
11806 Use this to add the buttons to this sizer. Do not use the `Add`
11807 method in the base class.
11809 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
11811 def Realize(*args
, **kwargs
):
11815 This funciton needs to be called after all the buttons have been added
11816 to the sizer. It will reorder them and position them in a platform
11819 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
11821 def SetAffirmativeButton(*args
, **kwargs
):
11822 """SetAffirmativeButton(self, wxButton button)"""
11823 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
11825 def SetNegativeButton(*args
, **kwargs
):
11826 """SetNegativeButton(self, wxButton button)"""
11827 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
11829 def SetCancelButton(*args
, **kwargs
):
11830 """SetCancelButton(self, wxButton button)"""
11831 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
11833 def GetAffirmativeButton(*args
, **kwargs
):
11834 """GetAffirmativeButton(self) -> wxButton"""
11835 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
11837 def GetApplyButton(*args
, **kwargs
):
11838 """GetApplyButton(self) -> wxButton"""
11839 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
11841 def GetNegativeButton(*args
, **kwargs
):
11842 """GetNegativeButton(self) -> wxButton"""
11843 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
11845 def GetCancelButton(*args
, **kwargs
):
11846 """GetCancelButton(self) -> wxButton"""
11847 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
11849 def GetHelpButton(*args
, **kwargs
):
11850 """GetHelpButton(self) -> wxButton"""
11851 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
11853 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizer
)
11855 #---------------------------------------------------------------------------
11857 class GBPosition(object):
11859 This class represents the position of an item in a virtual grid of
11860 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11861 typemaps that will automatically convert from a 2-element sequence of
11862 integers to a wx.GBPosition, so you can use the more pythonic
11863 representation of the position nearly transparently in Python code.
11865 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11866 __repr__
= _swig_repr
11867 def __init__(self
, *args
, **kwargs
):
11869 __init__(self, int row=0, int col=0) -> GBPosition
11871 This class represents the position of an item in a virtual grid of
11872 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11873 typemaps that will automatically convert from a 2-element sequence of
11874 integers to a wx.GBPosition, so you can use the more pythonic
11875 representation of the position nearly transparently in Python code.
11877 _core_
.GBPosition_swiginit(self
,_core_
.new_GBPosition(*args
, **kwargs
))
11878 __swig_destroy__
= _core_
.delete_GBPosition
11879 __del__
= lambda self
: None;
11880 def GetRow(*args
, **kwargs
):
11881 """GetRow(self) -> int"""
11882 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
11884 def GetCol(*args
, **kwargs
):
11885 """GetCol(self) -> int"""
11886 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
11888 def SetRow(*args
, **kwargs
):
11889 """SetRow(self, int row)"""
11890 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
11892 def SetCol(*args
, **kwargs
):
11893 """SetCol(self, int col)"""
11894 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
11896 def __eq__(*args
, **kwargs
):
11898 __eq__(self, PyObject other) -> bool
11900 Compare GBPosition for equality.
11902 return _core_
.GBPosition___eq__(*args
, **kwargs
)
11904 def __ne__(*args
, **kwargs
):
11906 __ne__(self, PyObject other) -> bool
11908 Compare GBPosition for inequality.
11910 return _core_
.GBPosition___ne__(*args
, **kwargs
)
11912 def Set(*args
, **kwargs
):
11913 """Set(self, int row=0, int col=0)"""
11914 return _core_
.GBPosition_Set(*args
, **kwargs
)
11916 def Get(*args
, **kwargs
):
11917 """Get(self) -> PyObject"""
11918 return _core_
.GBPosition_Get(*args
, **kwargs
)
11920 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
11921 def __str__(self
): return str(self
.Get())
11922 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
11923 def __len__(self
): return len(self
.Get())
11924 def __getitem__(self
, index
): return self
.Get()[index
]
11925 def __setitem__(self
, index
, val
):
11926 if index
== 0: self
.SetRow(val
)
11927 elif index
== 1: self
.SetCol(val
)
11928 else: raise IndexError
11929 def __nonzero__(self
): return self
.Get() != (0,0)
11930 __safe_for_unpickling__
= True
11931 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
11933 row
= property(GetRow
, SetRow
)
11934 col
= property(GetCol
, SetCol
)
11936 _core_
.GBPosition_swigregister(GBPosition
)
11938 class GBSpan(object):
11940 This class is used to hold the row and column spanning attributes of
11941 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11942 automatically convert from a 2-element sequence of integers to a
11943 wx.GBSpan, so you can use the more pythonic representation of the span
11944 nearly transparently in Python code.
11947 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11948 __repr__
= _swig_repr
11949 def __init__(self
, *args
, **kwargs
):
11951 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11953 Construct a new wxGBSpan, optionally setting the rowspan and
11954 colspan. The default is (1,1). (Meaning that the item occupies one
11955 cell in each direction.
11957 _core_
.GBSpan_swiginit(self
,_core_
.new_GBSpan(*args
, **kwargs
))
11958 __swig_destroy__
= _core_
.delete_GBSpan
11959 __del__
= lambda self
: None;
11960 def GetRowspan(*args
, **kwargs
):
11961 """GetRowspan(self) -> int"""
11962 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
11964 def GetColspan(*args
, **kwargs
):
11965 """GetColspan(self) -> int"""
11966 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
11968 def SetRowspan(*args
, **kwargs
):
11969 """SetRowspan(self, int rowspan)"""
11970 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
11972 def SetColspan(*args
, **kwargs
):
11973 """SetColspan(self, int colspan)"""
11974 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
11976 def __eq__(*args
, **kwargs
):
11978 __eq__(self, PyObject other) -> bool
11980 Compare wxGBSpan for equality.
11982 return _core_
.GBSpan___eq__(*args
, **kwargs
)
11984 def __ne__(*args
, **kwargs
):
11986 __ne__(self, PyObject other) -> bool
11988 Compare GBSpan for inequality.
11990 return _core_
.GBSpan___ne__(*args
, **kwargs
)
11992 def Set(*args
, **kwargs
):
11993 """Set(self, int rowspan=1, int colspan=1)"""
11994 return _core_
.GBSpan_Set(*args
, **kwargs
)
11996 def Get(*args
, **kwargs
):
11997 """Get(self) -> PyObject"""
11998 return _core_
.GBSpan_Get(*args
, **kwargs
)
12000 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12001 def __str__(self
): return str(self
.Get())
12002 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
12003 def __len__(self
): return len(self
.Get())
12004 def __getitem__(self
, index
): return self
.Get()[index
]
12005 def __setitem__(self
, index
, val
):
12006 if index
== 0: self
.SetRowspan(val
)
12007 elif index
== 1: self
.SetColspan(val
)
12008 else: raise IndexError
12009 def __nonzero__(self
): return self
.Get() != (0,0)
12010 __safe_for_unpickling__
= True
12011 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
12013 rowspan
= property(GetRowspan
, SetRowspan
)
12014 colspan
= property(GetColspan
, SetColspan
)
12016 _core_
.GBSpan_swigregister(GBSpan
)
12018 class GBSizerItem(SizerItem
):
12020 The wx.GBSizerItem class is used to track the additional data about
12021 items in a `wx.GridBagSizer` such as the item's position in the grid
12022 and how many rows or columns it spans.
12025 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12026 __repr__
= _swig_repr
12027 def __init__(self
, *args
, **kwargs
):
12029 __init__(self) -> GBSizerItem
12031 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12032 size will need to be set, as well as a position and span before this
12033 item can be used in a Sizer.
12035 You will probably never need to create a wx.GBSizerItem directly as they
12036 are created automatically when the sizer's Add method is called.
12038 _core_
.GBSizerItem_swiginit(self
,_core_
.new_GBSizerItem(*args
, **kwargs
))
12039 __swig_destroy__
= _core_
.delete_GBSizerItem
12040 __del__
= lambda self
: None;
12041 def GetPos(*args
, **kwargs
):
12043 GetPos(self) -> GBPosition
12045 Get the grid position of the item
12047 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
12049 def GetPosTuple(self
): return self
.GetPos().Get()
12050 def GetSpan(*args
, **kwargs
):
12052 GetSpan(self) -> GBSpan
12054 Get the row and column spanning of the item
12056 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
12058 def GetSpanTuple(self
): return self
.GetSpan().Get()
12059 def SetPos(*args
, **kwargs
):
12061 SetPos(self, GBPosition pos) -> bool
12063 If the item is already a member of a sizer then first ensure that
12064 there is no other item that would intersect with this one at the new
12065 position, then set the new position. Returns True if the change is
12066 successful and after the next Layout() the item will be moved.
12068 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
12070 def SetSpan(*args
, **kwargs
):
12072 SetSpan(self, GBSpan span) -> bool
12074 If the item is already a member of a sizer then first ensure that
12075 there is no other item that would intersect with this one with its new
12076 spanning size, then set the new spanning. Returns True if the change
12077 is successful and after the next Layout() the item will be resized.
12080 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
12082 def Intersects(*args
, **kwargs
):
12084 Intersects(self, GBSizerItem other) -> bool
12086 Returns True if this item and the other item instersect.
12088 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
12090 def IntersectsPos(*args
, **kwargs
):
12092 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12094 Returns True if the given pos/span would intersect with this item.
12096 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
12098 def GetEndPos(*args
, **kwargs
):
12100 GetEndPos(self) -> GBPosition
12102 Get the row and column of the endpoint of this item.
12104 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
12106 def GetGBSizer(*args
, **kwargs
):
12108 GetGBSizer(self) -> GridBagSizer
12110 Get the sizer this item is a member of.
12112 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
12114 def SetGBSizer(*args
, **kwargs
):
12116 SetGBSizer(self, GridBagSizer sizer)
12118 Set the sizer this item is a member of.
12120 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
12122 _core_
.GBSizerItem_swigregister(GBSizerItem
)
12123 DefaultSpan
= cvar
.DefaultSpan
12125 def GBSizerItemWindow(*args
, **kwargs
):
12127 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12128 int border, PyObject userData=None) -> GBSizerItem
12130 Construct a `wx.GBSizerItem` for a window.
12132 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
12135 def GBSizerItemSizer(*args
, **kwargs
):
12137 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12138 int border, PyObject userData=None) -> GBSizerItem
12140 Construct a `wx.GBSizerItem` for a sizer
12142 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
12145 def GBSizerItemSpacer(*args
, **kwargs
):
12147 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12148 int flag, int border, PyObject userData=None) -> GBSizerItem
12150 Construct a `wx.GBSizerItem` for a spacer.
12152 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
12155 class GridBagSizer(FlexGridSizer
):
12157 A `wx.Sizer` that can lay out items in a virtual grid like a
12158 `wx.FlexGridSizer` but in this case explicit positioning of the items
12159 is allowed using `wx.GBPosition`, and items can optionally span more
12160 than one row and/or column using `wx.GBSpan`. The total size of the
12161 virtual grid is determined by the largest row and column that items are
12162 positioned at, adjusted for spanning.
12165 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12166 __repr__
= _swig_repr
12167 def __init__(self
, *args
, **kwargs
):
12169 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12171 Constructor, with optional parameters to specify the gap between the
12174 _core_
.GridBagSizer_swiginit(self
,_core_
.new_GridBagSizer(*args
, **kwargs
))
12175 self
._setOORInfo
(self
)
12177 def Add(*args
, **kwargs
):
12179 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12180 int border=0, userData=None) -> wx.GBSizerItem
12182 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12183 more than one row or column as specified with *span*. The remaining
12184 args behave similarly to `wx.Sizer.Add`.
12186 Returns True if the item was successfully placed at the given cell
12187 position, False if something was already there.
12190 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
12192 def AddItem(*args
, **kwargs
):
12194 Add(self, GBSizerItem item) -> wx.GBSizerItem
12196 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12197 the item was successfully placed at its given cell position, False if
12198 something was already there.
12200 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
12202 def GetCellSize(*args
, **kwargs
):
12204 GetCellSize(self, int row, int col) -> Size
12206 Get the size of the specified cell, including hgap and
12207 vgap. Only valid after a Layout.
12209 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
12211 def GetEmptyCellSize(*args
, **kwargs
):
12213 GetEmptyCellSize(self) -> Size
12215 Get the size used for cells in the grid with no item.
12217 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
12219 def SetEmptyCellSize(*args
, **kwargs
):
12221 SetEmptyCellSize(self, Size sz)
12223 Set the size used for cells in the grid with no item.
12225 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
12227 def GetItemPosition(*args
):
12229 GetItemPosition(self, item) -> GBPosition
12231 Get the grid position of the specified *item* where *item* is either a
12232 window or subsizer that is a member of this sizer, or a zero-based
12235 return _core_
.GridBagSizer_GetItemPosition(*args
)
12237 def SetItemPosition(*args
):
12239 SetItemPosition(self, item, GBPosition pos) -> bool
12241 Set the grid position of the specified *item* where *item* is either a
12242 window or subsizer that is a member of this sizer, or a zero-based
12243 index of an item. Returns True on success. If the move is not
12244 allowed (because an item is already there) then False is returned.
12247 return _core_
.GridBagSizer_SetItemPosition(*args
)
12249 def GetItemSpan(*args
):
12251 GetItemSpan(self, item) -> GBSpan
12253 Get the row/col spanning of the specified *item* where *item* is
12254 either a window or subsizer that is a member of this sizer, or a
12255 zero-based index of an item.
12257 return _core_
.GridBagSizer_GetItemSpan(*args
)
12259 def SetItemSpan(*args
):
12261 SetItemSpan(self, item, GBSpan span) -> bool
12263 Set the row/col spanning of the specified *item* where *item* is
12264 either a window or subsizer that is a member of this sizer, or a
12265 zero-based index of an item. Returns True on success. If the move is
12266 not allowed (because an item is already there) then False is returned.
12268 return _core_
.GridBagSizer_SetItemSpan(*args
)
12270 def FindItem(*args
):
12272 FindItem(self, item) -> GBSizerItem
12274 Find the sizer item for the given window or subsizer, returns None if
12275 not found. (non-recursive)
12277 return _core_
.GridBagSizer_FindItem(*args
)
12279 def FindItemAtPosition(*args
, **kwargs
):
12281 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12283 Return the sizer item for the given grid cell, or None if there is no
12284 item at that position. (non-recursive)
12286 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
12288 def FindItemAtPoint(*args
, **kwargs
):
12290 FindItemAtPoint(self, Point pt) -> GBSizerItem
12292 Return the sizer item located at the point given in *pt*, or None if
12293 there is no item at that point. The (x,y) coordinates in pt correspond
12294 to the client coordinates of the window using the sizer for
12295 layout. (non-recursive)
12297 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
12299 def CheckForIntersection(*args
, **kwargs
):
12301 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12303 Look at all items and see if any intersect (or would overlap) the
12304 given *item*. Returns True if so, False if there would be no overlap.
12305 If an *excludeItem* is given then it will not be checked for
12306 intersection, for example it may be the item we are checking the
12310 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
12312 def CheckForIntersectionPos(*args
, **kwargs
):
12314 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12316 Look at all items and see if any intersect (or would overlap) the
12317 given position and span. Returns True if so, False if there would be
12318 no overlap. If an *excludeItem* is given then it will not be checked
12319 for intersection, for example it may be the item we are checking the
12322 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
12324 _core_
.GridBagSizer_swigregister(GridBagSizer
)
12326 #---------------------------------------------------------------------------
12330 Right
= _core_
.Right
12331 Bottom
= _core_
.Bottom
12332 Width
= _core_
.Width
12333 Height
= _core_
.Height
12334 Centre
= _core_
.Centre
12335 Center
= _core_
.Center
12336 CentreX
= _core_
.CentreX
12337 CentreY
= _core_
.CentreY
12338 Unconstrained
= _core_
.Unconstrained
12340 PercentOf
= _core_
.PercentOf
12341 Above
= _core_
.Above
12342 Below
= _core_
.Below
12343 LeftOf
= _core_
.LeftOf
12344 RightOf
= _core_
.RightOf
12345 SameAs
= _core_
.SameAs
12346 Absolute
= _core_
.Absolute
12347 class IndividualLayoutConstraint(Object
):
12349 Objects of this class are stored in the `wx.LayoutConstraints` class as
12350 one of eight possible constraints that a window can be involved in.
12351 You will never need to create an instance of
12352 wx.IndividualLayoutConstraint, rather you should create a
12353 `wx.LayoutConstraints` instance and use the individual contstraints
12356 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12357 def __init__(self
): raise AttributeError, "No constructor defined"
12358 __repr__
= _swig_repr
12359 def Set(*args
, **kwargs
):
12361 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12363 Sets the properties of the constraint. Normally called by one of the
12364 convenience functions such as Above, RightOf, SameAs.
12366 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
12368 def LeftOf(*args
, **kwargs
):
12370 LeftOf(self, Window sibling, int marg=0)
12372 Constrains this edge to be to the left of the given window, with an
12373 optional margin. Implicitly, this is relative to the left edge of the
12376 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
12378 def RightOf(*args
, **kwargs
):
12380 RightOf(self, Window sibling, int marg=0)
12382 Constrains this edge to be to the right of the given window, with an
12383 optional margin. Implicitly, this is relative to the right edge of the
12386 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
12388 def Above(*args
, **kwargs
):
12390 Above(self, Window sibling, int marg=0)
12392 Constrains this edge to be above the given window, with an optional
12393 margin. Implicitly, this is relative to the top edge of the other
12396 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
12398 def Below(*args
, **kwargs
):
12400 Below(self, Window sibling, int marg=0)
12402 Constrains this edge to be below the given window, with an optional
12403 margin. Implicitly, this is relative to the bottom edge of the other
12406 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
12408 def SameAs(*args
, **kwargs
):
12410 SameAs(self, Window otherW, int edge, int marg=0)
12412 Constrains this edge or dimension to be to the same as the edge of the
12413 given window, with an optional margin.
12415 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
12417 def PercentOf(*args
, **kwargs
):
12419 PercentOf(self, Window otherW, int wh, int per)
12421 Constrains this edge or dimension to be to a percentage of the given
12422 window, with an optional margin.
12424 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
12426 def Absolute(*args
, **kwargs
):
12428 Absolute(self, int val)
12430 Constrains this edge or dimension to be the given absolute value.
12432 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
12434 def Unconstrained(*args
, **kwargs
):
12436 Unconstrained(self)
12438 Sets this edge or dimension to be unconstrained, that is, dependent on
12439 other edges and dimensions from which this value can be deduced.
12441 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
12443 def AsIs(*args
, **kwargs
):
12447 Sets this edge or constraint to be whatever the window's value is at
12448 the moment. If either of the width and height constraints are *as is*,
12449 the window will not be resized, but moved instead. This is important
12450 when considering panel items which are intended to have a default
12451 size, such as a button, which may take its size from the size of the
12454 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
12456 def GetOtherWindow(*args
, **kwargs
):
12457 """GetOtherWindow(self) -> Window"""
12458 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
12460 def GetMyEdge(*args
, **kwargs
):
12461 """GetMyEdge(self) -> int"""
12462 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
12464 def SetEdge(*args
, **kwargs
):
12465 """SetEdge(self, int which)"""
12466 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
12468 def SetValue(*args
, **kwargs
):
12469 """SetValue(self, int v)"""
12470 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
12472 def GetMargin(*args
, **kwargs
):
12473 """GetMargin(self) -> int"""
12474 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
12476 def SetMargin(*args
, **kwargs
):
12477 """SetMargin(self, int m)"""
12478 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
12480 def GetValue(*args
, **kwargs
):
12481 """GetValue(self) -> int"""
12482 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
12484 def GetPercent(*args
, **kwargs
):
12485 """GetPercent(self) -> int"""
12486 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
12488 def GetOtherEdge(*args
, **kwargs
):
12489 """GetOtherEdge(self) -> int"""
12490 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
12492 def GetDone(*args
, **kwargs
):
12493 """GetDone(self) -> bool"""
12494 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
12496 def SetDone(*args
, **kwargs
):
12497 """SetDone(self, bool d)"""
12498 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
12500 def GetRelationship(*args
, **kwargs
):
12501 """GetRelationship(self) -> int"""
12502 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
12504 def SetRelationship(*args
, **kwargs
):
12505 """SetRelationship(self, int r)"""
12506 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
12508 def ResetIfWin(*args
, **kwargs
):
12510 ResetIfWin(self, Window otherW) -> bool
12512 Reset constraint if it mentions otherWin
12514 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
12516 def SatisfyConstraint(*args
, **kwargs
):
12518 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12520 Try to satisfy constraint
12522 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
12524 def GetEdge(*args
, **kwargs
):
12526 GetEdge(self, int which, Window thisWin, Window other) -> int
12528 Get the value of this edge or dimension, or if this
12529 is not determinable, -1.
12531 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
12533 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint
)
12535 class LayoutConstraints(Object
):
12537 **Note:** constraints are now deprecated and you should use sizers
12540 Objects of this class can be associated with a window to define its
12541 layout constraints, with respect to siblings or its parent.
12543 The class consists of the following eight constraints of class
12544 wx.IndividualLayoutConstraint, some or all of which should be accessed
12545 directly to set the appropriate constraints.
12547 * left: represents the left hand edge of the window
12548 * right: represents the right hand edge of the window
12549 * top: represents the top edge of the window
12550 * bottom: represents the bottom edge of the window
12551 * width: represents the width of the window
12552 * height: represents the height of the window
12553 * centreX: represents the horizontal centre point of the window
12554 * centreY: represents the vertical centre point of the window
12556 Most constraints are initially set to have the relationship
12557 wxUnconstrained, which means that their values should be calculated by
12558 looking at known constraints. The exceptions are width and height,
12559 which are set to wxAsIs to ensure that if the user does not specify a
12560 constraint, the existing width and height will be used, to be
12561 compatible with panel items which often have take a default size. If
12562 the constraint is ``wx.AsIs``, the dimension will not be changed.
12564 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12567 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12568 __repr__
= _swig_repr
12569 left
= property(_core_
.LayoutConstraints_left_get
)
12570 top
= property(_core_
.LayoutConstraints_top_get
)
12571 right
= property(_core_
.LayoutConstraints_right_get
)
12572 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
12573 width
= property(_core_
.LayoutConstraints_width_get
)
12574 height
= property(_core_
.LayoutConstraints_height_get
)
12575 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
12576 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
12577 def __init__(self
, *args
, **kwargs
):
12578 """__init__(self) -> LayoutConstraints"""
12579 _core_
.LayoutConstraints_swiginit(self
,_core_
.new_LayoutConstraints(*args
, **kwargs
))
12580 __swig_destroy__
= _core_
.delete_LayoutConstraints
12581 __del__
= lambda self
: None;
12582 def SatisfyConstraints(*args
, **kwargs
):
12583 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12584 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
12586 def AreSatisfied(*args
, **kwargs
):
12587 """AreSatisfied(self) -> bool"""
12588 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
12590 _core_
.LayoutConstraints_swigregister(LayoutConstraints
)
12592 #----------------------------------------------------------------------------
12594 # Use Python's bool constants if available, make some if not
12598 __builtins__
.True = 1==1
12599 __builtins__
.False = 1==0
12600 def bool(value
): return not not value
12601 __builtins__
.bool = bool
12605 # workarounds for bad wxRTTI names
12606 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
12607 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
12608 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
12611 #----------------------------------------------------------------------------
12612 # Load version numbers from __version__... Ensure that major and minor
12613 # versions are the same for both wxPython and wxWidgets.
12615 from __version__
import *
12616 __version__
= VERSION_STRING
12618 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
12619 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
12620 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
12622 warnings
.warn("wxPython/wxWidgets release number mismatch")
12624 #----------------------------------------------------------------------------
12626 # Set wxPython's default string<-->unicode conversion encoding from
12627 # the locale, but only if Python's default hasn't been changed. (We
12628 # assume that if the user has customized it already then that is the
12629 # encoding we need to use as well.)
12631 # The encoding selected here is used when string or unicode objects
12632 # need to be converted in order to pass them to wxWidgets. Please be
12633 # aware that the default encoding within the same locale may be
12634 # slightly different on different platforms. For example, please see
12635 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12636 # between the common latin/roman encodings.
12638 default
= _sys
.getdefaultencoding()
12639 if default
== 'ascii':
12643 default
= locale
.getdefaultlocale()[1]
12644 codecs
.lookup(default
)
12645 except (ValueError, LookupError, TypeError):
12646 default
= _sys
.getdefaultencoding()
12650 wx
.SetDefaultPyEncoding(default
)
12653 #----------------------------------------------------------------------------
12655 class PyDeadObjectError(AttributeError):
12658 class _wxPyDeadObject(object):
12660 Instances of wx objects that are OOR capable will have their __class__
12661 changed to this class when the C++ object is deleted. This should help
12662 prevent crashes due to referencing a bogus C++ pointer.
12664 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12665 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12667 def __repr__(self
):
12668 if not hasattr(self
, "_name"):
12669 self
._name
= "[unknown]"
12670 return self
.reprStr
% self
._name
12672 def __getattr__(self
, *args
):
12673 if not hasattr(self
, "_name"):
12674 self
._name
= "[unknown]"
12675 raise PyDeadObjectError(self
.attrStr
% self
._name
)
12677 def __nonzero__(self
):
12682 class PyUnbornObjectError(AttributeError):
12685 class _wxPyUnbornObject(object):
12687 Some stock objects are created when the wx._core module is
12688 imported, but their C++ instance is not created until the wx.App
12689 object is created and initialized. These object instances will
12690 temporarily have their __class__ changed to this class so an
12691 exception will be raised if they are used before the C++ instance
12695 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12696 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
12698 def __repr__(self
):
12699 #if not hasattr(self, "_name"):
12700 # self._name = "[unknown]"
12701 return self
.reprStr
#% self._name
12703 def __getattr__(self
, *args
):
12704 #if not hasattr(self, "_name"):
12705 # self._name = "[unknown]"
12706 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
12708 def __nonzero__(self
):
12712 #----------------------------------------------------------------------------
12714 def CallAfter(callable, *args
, **kw
):
12716 Call the specified function after the current and pending event
12717 handlers have been completed. This is also good for making GUI
12718 method calls from non-GUI threads. Any extra positional or
12719 keyword args are passed on to the callable when it is called.
12721 :see: `wx.FutureCall`
12724 assert app
is not None, 'No wx.App created yet'
12726 if not hasattr(app
, "_CallAfterId"):
12727 app
._CallAfterId
= wx
.NewEventType()
12728 app
.Connect(-1, -1, app
._CallAfterId
,
12729 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
12731 evt
.SetEventType(app
._CallAfterId
)
12732 evt
.callable = callable
12735 wx
.PostEvent(app
, evt
)
12737 #----------------------------------------------------------------------------
12742 A convenience class for `wx.Timer`, that calls the given callable
12743 object once after the given amount of milliseconds, passing any
12744 positional or keyword args. The return value of the callable is
12745 availbale after it has been run with the `GetResult` method.
12747 If you don't need to get the return value or restart the timer
12748 then there is no need to hold a reference to this object. It will
12749 hold a reference to itself while the timer is running (the timer
12750 has a reference to self.Notify) but the cycle will be broken when
12751 the timer completes, automatically cleaning up the wx.FutureCall
12754 :see: `wx.CallAfter`
12756 def __init__(self
, millis
, callable, *args
, **kwargs
):
12757 self
.millis
= millis
12758 self
.callable = callable
12759 self
.SetArgs(*args
, **kwargs
)
12761 self
.running
= False
12762 self
.hasRun
= False
12771 def Start(self
, millis
=None, *args
, **kwargs
):
12773 (Re)start the timer
12775 self
.hasRun
= False
12776 if millis
is not None:
12777 self
.millis
= millis
12779 self
.SetArgs(*args
, **kwargs
)
12781 self
.timer
= wx
.PyTimer(self
.Notify
)
12782 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
12783 self
.running
= True
12789 Stop and destroy the timer.
12791 if self
.timer
is not None:
12796 def GetInterval(self
):
12797 if self
.timer
is not None:
12798 return self
.timer
.GetInterval()
12803 def IsRunning(self
):
12804 return self
.timer
is not None and self
.timer
.IsRunning()
12807 def SetArgs(self
, *args
, **kwargs
):
12809 (Re)set the args passed to the callable object. This is
12810 useful in conjunction with Restart if you want to schedule a
12811 new call to the same callable object but with different
12815 self
.kwargs
= kwargs
12821 def GetResult(self
):
12826 The timer has expired so call the callable.
12828 if self
.callable and getattr(self
.callable, 'im_self', True):
12830 self
.running
= False
12831 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
12833 if not self
.running
:
12834 # if it wasn't restarted, then cleanup
12835 wx
.CallAfter(self
.Stop
)
12839 #----------------------------------------------------------------------------
12840 # Control which items in this module should be documented by epydoc.
12841 # We allow only classes and functions, which will help reduce the size
12842 # of the docs by filtering out the zillions of constants, EVT objects,
12843 # and etc that don't make much sense by themselves, but are instead
12844 # documented (or will be) as part of the classes/functions/methods
12845 # where they should be used.
12849 A filter for epydoc that only allows non-Ptr classes and
12850 fucntions, in order to reduce the clutter in the API docs.
12852 def __init__(self
, globals):
12853 self
._globals
= globals
12855 def __call__(self
, name
):
12857 obj
= self
._globals
.get(name
, None)
12858 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
12860 if name
.startswith('_') or name
.startswith('EVT') or name
.endswith('_swigregister') or name
.endswith('Ptr') :
12864 #----------------------------------------------------------------------------
12865 #----------------------------------------------------------------------------
12867 # Import other modules in this package that should show up in the
12868 # "core" wx namespace
12870 from _windows
import *
12871 from _controls
import *
12872 from _misc
import *
12874 #----------------------------------------------------------------------------
12875 #----------------------------------------------------------------------------