1 # This file was created automatically by SWIG.
2 # Don't modify this file, modify the SWIG interface instead.
6 def _swig_setattr_nondynamic(self
,class_type
,name
,value
,static
=1):
8 if isinstance(value
, class_type
):
9 self
.__dict
__[name
] = value
.this
10 if hasattr(value
,"thisown"): self
.__dict
__["thisown"] = value
.thisown
13 method
= class_type
.__swig
_setmethods
__.get(name
,None)
14 if method
: return method(self
,value
)
15 if (not static
) or hasattr(self
,name
) or (name
== "thisown"):
16 self
.__dict
__[name
] = value
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 method
= class_type
.__swig
_getmethods
__.get(name
,None)
25 if method
: return method(self
)
26 raise AttributeError,name
30 _object
= types
.ObjectType
32 except AttributeError:
38 def _swig_setattr_nondynamic_method(set):
39 def set_attr(self
,name
,value
):
40 if hasattr(self
,name
) or (name
in ("this", "thisown")):
43 raise AttributeError("You cannot add attributes to %s" % self
)
47 #// Give a reference to the dictionary of this module to the C++ extension
49 _core_
._wxPySetDictionary
(vars())
51 #// A little trick to make 'wx' be a reference to this module so wx.Names can
54 wx
= _sys
.modules
[__name__
]
57 #----------------------------------------------------------------------------
59 def _deprecated(callable, msg
=None):
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
65 msg
= "%s is deprecated" % callable
66 def deprecatedWrapper(*args
, **kwargs
):
68 warnings
.warn(msg
, DeprecationWarning, stacklevel
=2)
69 return callable(*args
, **kwargs
)
70 deprecatedWrapper
.__doc
__ = msg
71 return deprecatedWrapper
74 #----------------------------------------------------------------------------
76 NOT_FOUND
= _core_
.NOT_FOUND
77 VSCROLL
= _core_
.VSCROLL
78 HSCROLL
= _core_
.HSCROLL
79 CAPTION
= _core_
.CAPTION
80 DOUBLE_BORDER
= _core_
.DOUBLE_BORDER
81 SUNKEN_BORDER
= _core_
.SUNKEN_BORDER
82 RAISED_BORDER
= _core_
.RAISED_BORDER
83 BORDER
= _core_
.BORDER
84 SIMPLE_BORDER
= _core_
.SIMPLE_BORDER
85 STATIC_BORDER
= _core_
.STATIC_BORDER
86 TRANSPARENT_WINDOW
= _core_
.TRANSPARENT_WINDOW
87 NO_BORDER
= _core_
.NO_BORDER
88 DEFAULT_CONTROL_BORDER
= _core_
.DEFAULT_CONTROL_BORDER
89 DEFAULT_STATUSBAR_STYLE
= _core_
.DEFAULT_STATUSBAR_STYLE
90 TAB_TRAVERSAL
= _core_
.TAB_TRAVERSAL
91 WANTS_CHARS
= _core_
.WANTS_CHARS
92 POPUP_WINDOW
= _core_
.POPUP_WINDOW
93 CENTER_FRAME
= _core_
.CENTER_FRAME
94 CENTRE_ON_SCREEN
= _core_
.CENTRE_ON_SCREEN
95 CENTER_ON_SCREEN
= _core_
.CENTER_ON_SCREEN
96 CLIP_CHILDREN
= _core_
.CLIP_CHILDREN
97 CLIP_SIBLINGS
= _core_
.CLIP_SIBLINGS
98 ALWAYS_SHOW_SB
= _core_
.ALWAYS_SHOW_SB
99 RETAINED
= _core_
.RETAINED
100 BACKINGSTORE
= _core_
.BACKINGSTORE
101 COLOURED
= _core_
.COLOURED
102 FIXED_LENGTH
= _core_
.FIXED_LENGTH
103 LB_NEEDED_SB
= _core_
.LB_NEEDED_SB
104 LB_ALWAYS_SB
= _core_
.LB_ALWAYS_SB
105 LB_SORT
= _core_
.LB_SORT
106 LB_SINGLE
= _core_
.LB_SINGLE
107 LB_MULTIPLE
= _core_
.LB_MULTIPLE
108 LB_EXTENDED
= _core_
.LB_EXTENDED
109 LB_OWNERDRAW
= _core_
.LB_OWNERDRAW
110 LB_HSCROLL
= _core_
.LB_HSCROLL
111 PROCESS_ENTER
= _core_
.PROCESS_ENTER
112 PASSWORD
= _core_
.PASSWORD
113 CB_SIMPLE
= _core_
.CB_SIMPLE
114 CB_DROPDOWN
= _core_
.CB_DROPDOWN
115 CB_SORT
= _core_
.CB_SORT
116 CB_READONLY
= _core_
.CB_READONLY
117 RA_HORIZONTAL
= _core_
.RA_HORIZONTAL
118 RA_VERTICAL
= _core_
.RA_VERTICAL
119 RA_SPECIFY_ROWS
= _core_
.RA_SPECIFY_ROWS
120 RA_SPECIFY_COLS
= _core_
.RA_SPECIFY_COLS
121 RA_USE_CHECKBOX
= _core_
.RA_USE_CHECKBOX
122 RB_GROUP
= _core_
.RB_GROUP
123 RB_SINGLE
= _core_
.RB_SINGLE
124 SB_HORIZONTAL
= _core_
.SB_HORIZONTAL
125 SB_VERTICAL
= _core_
.SB_VERTICAL
126 RB_USE_CHECKBOX
= _core_
.RB_USE_CHECKBOX
127 ST_SIZEGRIP
= _core_
.ST_SIZEGRIP
128 ST_NO_AUTORESIZE
= _core_
.ST_NO_AUTORESIZE
129 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
130 FLOOD_BORDER
= _core_
.FLOOD_BORDER
131 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
132 WINDING_RULE
= _core_
.WINDING_RULE
133 TOOL_TOP
= _core_
.TOOL_TOP
134 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
135 TOOL_LEFT
= _core_
.TOOL_LEFT
136 TOOL_RIGHT
= _core_
.TOOL_RIGHT
138 YES_NO
= _core_
.YES_NO
139 CANCEL
= _core_
.CANCEL
142 NO_DEFAULT
= _core_
.NO_DEFAULT
143 YES_DEFAULT
= _core_
.YES_DEFAULT
144 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
145 ICON_HAND
= _core_
.ICON_HAND
146 ICON_QUESTION
= _core_
.ICON_QUESTION
147 ICON_INFORMATION
= _core_
.ICON_INFORMATION
148 ICON_STOP
= _core_
.ICON_STOP
149 ICON_ASTERISK
= _core_
.ICON_ASTERISK
150 ICON_MASK
= _core_
.ICON_MASK
151 ICON_WARNING
= _core_
.ICON_WARNING
152 ICON_ERROR
= _core_
.ICON_ERROR
153 FORWARD
= _core_
.FORWARD
154 BACKWARD
= _core_
.BACKWARD
159 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
160 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
161 SIZE_AUTO
= _core_
.SIZE_AUTO
162 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
163 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
164 PORTRAIT
= _core_
.PORTRAIT
165 LANDSCAPE
= _core_
.LANDSCAPE
166 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
167 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
168 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
169 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
170 ID_ANY
= _core_
.ID_ANY
171 ID_SEPARATOR
= _core_
.ID_SEPARATOR
172 ID_LOWEST
= _core_
.ID_LOWEST
173 ID_OPEN
= _core_
.ID_OPEN
174 ID_CLOSE
= _core_
.ID_CLOSE
175 ID_NEW
= _core_
.ID_NEW
176 ID_SAVE
= _core_
.ID_SAVE
177 ID_SAVEAS
= _core_
.ID_SAVEAS
178 ID_REVERT
= _core_
.ID_REVERT
179 ID_EXIT
= _core_
.ID_EXIT
180 ID_UNDO
= _core_
.ID_UNDO
181 ID_REDO
= _core_
.ID_REDO
182 ID_HELP
= _core_
.ID_HELP
183 ID_PRINT
= _core_
.ID_PRINT
184 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
185 ID_PREVIEW
= _core_
.ID_PREVIEW
186 ID_ABOUT
= _core_
.ID_ABOUT
187 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
188 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
189 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
190 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
191 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
192 ID_PREFERENCES
= _core_
.ID_PREFERENCES
193 ID_CUT
= _core_
.ID_CUT
194 ID_COPY
= _core_
.ID_COPY
195 ID_PASTE
= _core_
.ID_PASTE
196 ID_CLEAR
= _core_
.ID_CLEAR
197 ID_FIND
= _core_
.ID_FIND
198 ID_DUPLICATE
= _core_
.ID_DUPLICATE
199 ID_SELECTALL
= _core_
.ID_SELECTALL
200 ID_DELETE
= _core_
.ID_DELETE
201 ID_REPLACE
= _core_
.ID_REPLACE
202 ID_REPLACE_ALL
= _core_
.ID_REPLACE_ALL
203 ID_PROPERTIES
= _core_
.ID_PROPERTIES
204 ID_VIEW_DETAILS
= _core_
.ID_VIEW_DETAILS
205 ID_VIEW_LARGEICONS
= _core_
.ID_VIEW_LARGEICONS
206 ID_VIEW_SMALLICONS
= _core_
.ID_VIEW_SMALLICONS
207 ID_VIEW_LIST
= _core_
.ID_VIEW_LIST
208 ID_VIEW_SORTDATE
= _core_
.ID_VIEW_SORTDATE
209 ID_VIEW_SORTNAME
= _core_
.ID_VIEW_SORTNAME
210 ID_VIEW_SORTSIZE
= _core_
.ID_VIEW_SORTSIZE
211 ID_VIEW_SORTTYPE
= _core_
.ID_VIEW_SORTTYPE
212 ID_FILE1
= _core_
.ID_FILE1
213 ID_FILE2
= _core_
.ID_FILE2
214 ID_FILE3
= _core_
.ID_FILE3
215 ID_FILE4
= _core_
.ID_FILE4
216 ID_FILE5
= _core_
.ID_FILE5
217 ID_FILE6
= _core_
.ID_FILE6
218 ID_FILE7
= _core_
.ID_FILE7
219 ID_FILE8
= _core_
.ID_FILE8
220 ID_FILE9
= _core_
.ID_FILE9
222 ID_CANCEL
= _core_
.ID_CANCEL
223 ID_APPLY
= _core_
.ID_APPLY
224 ID_YES
= _core_
.ID_YES
226 ID_STATIC
= _core_
.ID_STATIC
227 ID_FORWARD
= _core_
.ID_FORWARD
228 ID_BACKWARD
= _core_
.ID_BACKWARD
229 ID_DEFAULT
= _core_
.ID_DEFAULT
230 ID_MORE
= _core_
.ID_MORE
231 ID_SETUP
= _core_
.ID_SETUP
232 ID_RESET
= _core_
.ID_RESET
233 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
234 ID_YESTOALL
= _core_
.ID_YESTOALL
235 ID_NOTOALL
= _core_
.ID_NOTOALL
236 ID_ABORT
= _core_
.ID_ABORT
237 ID_RETRY
= _core_
.ID_RETRY
238 ID_IGNORE
= _core_
.ID_IGNORE
239 ID_ADD
= _core_
.ID_ADD
240 ID_REMOVE
= _core_
.ID_REMOVE
242 ID_DOWN
= _core_
.ID_DOWN
243 ID_HOME
= _core_
.ID_HOME
244 ID_REFRESH
= _core_
.ID_REFRESH
245 ID_STOP
= _core_
.ID_STOP
246 ID_INDEX
= _core_
.ID_INDEX
247 ID_BOLD
= _core_
.ID_BOLD
248 ID_ITALIC
= _core_
.ID_ITALIC
249 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
250 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
251 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
252 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
253 ID_UNDERLINE
= _core_
.ID_UNDERLINE
254 ID_INDENT
= _core_
.ID_INDENT
255 ID_UNINDENT
= _core_
.ID_UNINDENT
256 ID_ZOOM_100
= _core_
.ID_ZOOM_100
257 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
258 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
259 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
260 ID_UNDELETE
= _core_
.ID_UNDELETE
261 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
262 ID_HIGHEST
= _core_
.ID_HIGHEST
265 HIDE_READONLY
= _core_
.HIDE_READONLY
266 OVERWRITE_PROMPT
= _core_
.OVERWRITE_PROMPT
267 FILE_MUST_EXIST
= _core_
.FILE_MUST_EXIST
268 MULTIPLE
= _core_
.MULTIPLE
269 CHANGE_DIR
= _core_
.CHANGE_DIR
270 ACCEL_ALT
= _core_
.ACCEL_ALT
271 ACCEL_CTRL
= _core_
.ACCEL_CTRL
272 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
273 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
274 PD_AUTO_HIDE
= _core_
.PD_AUTO_HIDE
275 PD_APP_MODAL
= _core_
.PD_APP_MODAL
276 PD_CAN_ABORT
= _core_
.PD_CAN_ABORT
277 PD_ELAPSED_TIME
= _core_
.PD_ELAPSED_TIME
278 PD_ESTIMATED_TIME
= _core_
.PD_ESTIMATED_TIME
279 PD_REMAINING_TIME
= _core_
.PD_REMAINING_TIME
280 PD_SMOOTH
= _core_
.PD_SMOOTH
281 PD_CAN_SKIP
= _core_
.PD_CAN_SKIP
282 DD_NEW_DIR_BUTTON
= _core_
.DD_NEW_DIR_BUTTON
283 DD_DEFAULT_STYLE
= _core_
.DD_DEFAULT_STYLE
284 MENU_TEAROFF
= _core_
.MENU_TEAROFF
285 MB_DOCKABLE
= _core_
.MB_DOCKABLE
286 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
287 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
288 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
289 LI_VERTICAL
= _core_
.LI_VERTICAL
290 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
291 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
292 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
293 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
294 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
295 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
296 MM_TEXT
= _core_
.MM_TEXT
297 MM_LOMETRIC
= _core_
.MM_LOMETRIC
298 MM_HIMETRIC
= _core_
.MM_HIMETRIC
299 MM_LOENGLISH
= _core_
.MM_LOENGLISH
300 MM_HIENGLISH
= _core_
.MM_HIENGLISH
301 MM_TWIPS
= _core_
.MM_TWIPS
302 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
303 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
304 MM_POINTS
= _core_
.MM_POINTS
305 MM_METRIC
= _core_
.MM_METRIC
306 CENTRE
= _core_
.CENTRE
307 CENTER
= _core_
.CENTER
308 HORIZONTAL
= _core_
.HORIZONTAL
309 VERTICAL
= _core_
.VERTICAL
316 BOTTOM
= _core_
.BOTTOM
322 ALIGN_NOT
= _core_
.ALIGN_NOT
323 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
324 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
325 ALIGN_LEFT
= _core_
.ALIGN_LEFT
326 ALIGN_TOP
= _core_
.ALIGN_TOP
327 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
328 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
329 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
330 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
331 ALIGN_CENTER
= _core_
.ALIGN_CENTER
332 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
333 ALIGN_MASK
= _core_
.ALIGN_MASK
334 STRETCH_NOT
= _core_
.STRETCH_NOT
335 SHRINK
= _core_
.SHRINK
337 EXPAND
= _core_
.EXPAND
338 SHAPED
= _core_
.SHAPED
339 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
341 ADJUST_MINSIZE
= _core_
.ADJUST_MINSIZE
342 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
343 BORDER_NONE
= _core_
.BORDER_NONE
344 BORDER_STATIC
= _core_
.BORDER_STATIC
345 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
346 BORDER_RAISED
= _core_
.BORDER_RAISED
347 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
348 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
349 BORDER_MASK
= _core_
.BORDER_MASK
350 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
351 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
352 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
353 DEFAULT
= _core_
.DEFAULT
354 DECORATIVE
= _core_
.DECORATIVE
356 SCRIPT
= _core_
.SCRIPT
358 MODERN
= _core_
.MODERN
359 TELETYPE
= _core_
.TELETYPE
360 VARIABLE
= _core_
.VARIABLE
362 NORMAL
= _core_
.NORMAL
365 ITALIC
= _core_
.ITALIC
369 LONG_DASH
= _core_
.LONG_DASH
370 SHORT_DASH
= _core_
.SHORT_DASH
371 DOT_DASH
= _core_
.DOT_DASH
372 USER_DASH
= _core_
.USER_DASH
373 TRANSPARENT
= _core_
.TRANSPARENT
374 STIPPLE
= _core_
.STIPPLE
375 STIPPLE_MASK
= _core_
.STIPPLE_MASK
376 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
377 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
378 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
379 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
380 CROSS_HATCH
= _core_
.CROSS_HATCH
381 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
382 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
383 JOIN_BEVEL
= _core_
.JOIN_BEVEL
384 JOIN_MITER
= _core_
.JOIN_MITER
385 JOIN_ROUND
= _core_
.JOIN_ROUND
386 CAP_ROUND
= _core_
.CAP_ROUND
387 CAP_PROJECTING
= _core_
.CAP_PROJECTING
388 CAP_BUTT
= _core_
.CAP_BUTT
391 INVERT
= _core_
.INVERT
392 OR_REVERSE
= _core_
.OR_REVERSE
393 AND_REVERSE
= _core_
.AND_REVERSE
396 AND_INVERT
= _core_
.AND_INVERT
400 SRC_INVERT
= _core_
.SRC_INVERT
401 OR_INVERT
= _core_
.OR_INVERT
405 WXK_BACK
= _core_
.WXK_BACK
406 WXK_TAB
= _core_
.WXK_TAB
407 WXK_RETURN
= _core_
.WXK_RETURN
408 WXK_ESCAPE
= _core_
.WXK_ESCAPE
409 WXK_SPACE
= _core_
.WXK_SPACE
410 WXK_DELETE
= _core_
.WXK_DELETE
411 WXK_START
= _core_
.WXK_START
412 WXK_LBUTTON
= _core_
.WXK_LBUTTON
413 WXK_RBUTTON
= _core_
.WXK_RBUTTON
414 WXK_CANCEL
= _core_
.WXK_CANCEL
415 WXK_MBUTTON
= _core_
.WXK_MBUTTON
416 WXK_CLEAR
= _core_
.WXK_CLEAR
417 WXK_SHIFT
= _core_
.WXK_SHIFT
418 WXK_ALT
= _core_
.WXK_ALT
419 WXK_CONTROL
= _core_
.WXK_CONTROL
420 WXK_MENU
= _core_
.WXK_MENU
421 WXK_PAUSE
= _core_
.WXK_PAUSE
422 WXK_CAPITAL
= _core_
.WXK_CAPITAL
423 WXK_PRIOR
= _core_
.WXK_PRIOR
424 WXK_NEXT
= _core_
.WXK_NEXT
425 WXK_END
= _core_
.WXK_END
426 WXK_HOME
= _core_
.WXK_HOME
427 WXK_LEFT
= _core_
.WXK_LEFT
428 WXK_UP
= _core_
.WXK_UP
429 WXK_RIGHT
= _core_
.WXK_RIGHT
430 WXK_DOWN
= _core_
.WXK_DOWN
431 WXK_SELECT
= _core_
.WXK_SELECT
432 WXK_PRINT
= _core_
.WXK_PRINT
433 WXK_EXECUTE
= _core_
.WXK_EXECUTE
434 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
435 WXK_INSERT
= _core_
.WXK_INSERT
436 WXK_HELP
= _core_
.WXK_HELP
437 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
438 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
439 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
440 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
441 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
442 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
443 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
444 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
445 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
446 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
447 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
448 WXK_ADD
= _core_
.WXK_ADD
449 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
450 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
451 WXK_DECIMAL
= _core_
.WXK_DECIMAL
452 WXK_DIVIDE
= _core_
.WXK_DIVIDE
453 WXK_F1
= _core_
.WXK_F1
454 WXK_F2
= _core_
.WXK_F2
455 WXK_F3
= _core_
.WXK_F3
456 WXK_F4
= _core_
.WXK_F4
457 WXK_F5
= _core_
.WXK_F5
458 WXK_F6
= _core_
.WXK_F6
459 WXK_F7
= _core_
.WXK_F7
460 WXK_F8
= _core_
.WXK_F8
461 WXK_F9
= _core_
.WXK_F9
462 WXK_F10
= _core_
.WXK_F10
463 WXK_F11
= _core_
.WXK_F11
464 WXK_F12
= _core_
.WXK_F12
465 WXK_F13
= _core_
.WXK_F13
466 WXK_F14
= _core_
.WXK_F14
467 WXK_F15
= _core_
.WXK_F15
468 WXK_F16
= _core_
.WXK_F16
469 WXK_F17
= _core_
.WXK_F17
470 WXK_F18
= _core_
.WXK_F18
471 WXK_F19
= _core_
.WXK_F19
472 WXK_F20
= _core_
.WXK_F20
473 WXK_F21
= _core_
.WXK_F21
474 WXK_F22
= _core_
.WXK_F22
475 WXK_F23
= _core_
.WXK_F23
476 WXK_F24
= _core_
.WXK_F24
477 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
478 WXK_SCROLL
= _core_
.WXK_SCROLL
479 WXK_PAGEUP
= _core_
.WXK_PAGEUP
480 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
481 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
482 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
483 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
484 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
485 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
486 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
487 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
488 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
489 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
490 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
491 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
492 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
493 WXK_NUMPAD_PRIOR
= _core_
.WXK_NUMPAD_PRIOR
494 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
495 WXK_NUMPAD_NEXT
= _core_
.WXK_NUMPAD_NEXT
496 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
497 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
498 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
499 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
500 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
501 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
502 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
503 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
504 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
505 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
506 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
507 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
508 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
509 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
510 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
511 WXK_COMMAND
= _core_
.WXK_COMMAND
512 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
513 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
514 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
515 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
516 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
517 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
518 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
519 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
520 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
521 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
522 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
523 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
524 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
525 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
526 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
527 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
528 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
529 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
530 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
531 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
532 PAPER_NONE
= _core_
.PAPER_NONE
533 PAPER_LETTER
= _core_
.PAPER_LETTER
534 PAPER_LEGAL
= _core_
.PAPER_LEGAL
535 PAPER_A4
= _core_
.PAPER_A4
536 PAPER_CSHEET
= _core_
.PAPER_CSHEET
537 PAPER_DSHEET
= _core_
.PAPER_DSHEET
538 PAPER_ESHEET
= _core_
.PAPER_ESHEET
539 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
540 PAPER_TABLOID
= _core_
.PAPER_TABLOID
541 PAPER_LEDGER
= _core_
.PAPER_LEDGER
542 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
543 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
544 PAPER_A3
= _core_
.PAPER_A3
545 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
546 PAPER_A5
= _core_
.PAPER_A5
547 PAPER_B4
= _core_
.PAPER_B4
548 PAPER_B5
= _core_
.PAPER_B5
549 PAPER_FOLIO
= _core_
.PAPER_FOLIO
550 PAPER_QUARTO
= _core_
.PAPER_QUARTO
551 PAPER_10X14
= _core_
.PAPER_10X14
552 PAPER_11X17
= _core_
.PAPER_11X17
553 PAPER_NOTE
= _core_
.PAPER_NOTE
554 PAPER_ENV_9
= _core_
.PAPER_ENV_9
555 PAPER_ENV_10
= _core_
.PAPER_ENV_10
556 PAPER_ENV_11
= _core_
.PAPER_ENV_11
557 PAPER_ENV_12
= _core_
.PAPER_ENV_12
558 PAPER_ENV_14
= _core_
.PAPER_ENV_14
559 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
560 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
561 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
562 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
563 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
564 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
565 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
566 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
567 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
568 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
569 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
570 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
571 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
572 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
573 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
574 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
575 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
576 PAPER_9X11
= _core_
.PAPER_9X11
577 PAPER_10X11
= _core_
.PAPER_10X11
578 PAPER_15X11
= _core_
.PAPER_15X11
579 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
580 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
581 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
582 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
583 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
584 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
585 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
586 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
587 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
588 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
589 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
590 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
591 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
592 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
593 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
594 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
595 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
596 PAPER_A2
= _core_
.PAPER_A2
597 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
598 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
599 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
600 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
601 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
602 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
603 ITEM_NORMAL
= _core_
.ITEM_NORMAL
604 ITEM_CHECK
= _core_
.ITEM_CHECK
605 ITEM_RADIO
= _core_
.ITEM_RADIO
606 ITEM_MAX
= _core_
.ITEM_MAX
607 HT_NOWHERE
= _core_
.HT_NOWHERE
608 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
609 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
610 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
611 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
612 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
613 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
614 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
615 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
616 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
617 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
618 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
619 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
620 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
621 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
622 HT_MAX
= _core_
.HT_MAX
623 MOD_NONE
= _core_
.MOD_NONE
624 MOD_ALT
= _core_
.MOD_ALT
625 MOD_CONTROL
= _core_
.MOD_CONTROL
626 MOD_SHIFT
= _core_
.MOD_SHIFT
627 MOD_WIN
= _core_
.MOD_WIN
628 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
629 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
630 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
631 #---------------------------------------------------------------------------
633 class Object(object):
635 The base class for most wx objects, although in wxPython not
636 much functionality is needed nor exposed.
638 def __init__(self
): raise RuntimeError, "No constructor defined"
640 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
641 def GetClassName(*args
, **kwargs
):
643 GetClassName(self) -> String
645 Returns the class name of the C++ class using wxRTTI.
647 return _core_
.Object_GetClassName(*args
, **kwargs
)
649 def Destroy(*args
, **kwargs
):
653 Deletes the C++ object this Python object is a proxy for.
655 return _core_
.Object_Destroy(*args
, **kwargs
)
658 class ObjectPtr(Object
):
659 def __init__(self
, this
):
661 if not hasattr(self
,"thisown"): self
.thisown
= 0
662 self
.__class
__ = Object
663 _core_
.Object_swigregister(ObjectPtr
)
664 _wxPySetDictionary
= _core_
._wxPySetDictionary
666 _wxPyFixStockObjects
= _core_
._wxPyFixStockObjects
669 EmptyString
= cvar
.EmptyString
671 #---------------------------------------------------------------------------
673 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
674 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
675 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
676 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
677 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
678 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
679 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
680 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
681 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
682 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
683 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
684 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
685 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
686 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
687 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
688 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
689 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
690 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
691 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
692 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
693 CURSOR_NONE
= _core_
.CURSOR_NONE
694 CURSOR_ARROW
= _core_
.CURSOR_ARROW
695 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
696 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
697 CURSOR_CHAR
= _core_
.CURSOR_CHAR
698 CURSOR_CROSS
= _core_
.CURSOR_CROSS
699 CURSOR_HAND
= _core_
.CURSOR_HAND
700 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
701 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
702 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
703 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
704 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
705 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
706 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
707 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
708 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
709 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
710 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
711 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
712 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
713 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
714 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
715 CURSOR_SIZING
= _core_
.CURSOR_SIZING
716 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
717 CURSOR_WAIT
= _core_
.CURSOR_WAIT
718 CURSOR_WATCH
= _core_
.CURSOR_WATCH
719 CURSOR_BLANK
= _core_
.CURSOR_BLANK
720 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
721 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
722 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
723 CURSOR_MAX
= _core_
.CURSOR_MAX
724 #---------------------------------------------------------------------------
728 wx.Size is a useful data structure used to represent the size of
729 something. It simply contians integer width and height
730 proprtites. In most places in wxPython where a wx.Size is
731 expected a (width, height) tuple can be used instead.
734 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
735 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
736 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
737 x
= width
; y
= height
738 def __init__(self
, *args
, **kwargs
):
740 __init__(self, int w=0, int h=0) -> Size
742 Creates a size object.
744 newobj
= _core_
.new_Size(*args
, **kwargs
)
745 self
.this
= newobj
.this
748 def __del__(self
, destroy
=_core_
.delete_Size
):
751 if self
.thisown
: destroy(self
)
754 def __eq__(*args
, **kwargs
):
756 __eq__(self, Size sz) -> bool
758 Test for equality of wx.Size objects.
760 return _core_
.Size___eq__(*args
, **kwargs
)
762 def __ne__(*args
, **kwargs
):
764 __ne__(self, Size sz) -> bool
768 return _core_
.Size___ne__(*args
, **kwargs
)
770 def __add__(*args
, **kwargs
):
772 __add__(self, Size sz) -> Size
774 Add sz's proprties to this and return the result.
776 return _core_
.Size___add__(*args
, **kwargs
)
778 def __sub__(*args
, **kwargs
):
780 __sub__(self, Size sz) -> Size
782 Subtract sz's properties from this and return the result.
784 return _core_
.Size___sub__(*args
, **kwargs
)
786 def IncTo(*args
, **kwargs
):
790 Increments this object so that both of its dimensions are not less
791 than the corresponding dimensions of the size.
793 return _core_
.Size_IncTo(*args
, **kwargs
)
795 def DecTo(*args
, **kwargs
):
799 Decrements this object so that both of its dimensions are not greater
800 than the corresponding dimensions of the size.
802 return _core_
.Size_DecTo(*args
, **kwargs
)
804 def Set(*args
, **kwargs
):
806 Set(self, int w, int h)
808 Set both width and height.
810 return _core_
.Size_Set(*args
, **kwargs
)
812 def SetWidth(*args
, **kwargs
):
813 """SetWidth(self, int w)"""
814 return _core_
.Size_SetWidth(*args
, **kwargs
)
816 def SetHeight(*args
, **kwargs
):
817 """SetHeight(self, int h)"""
818 return _core_
.Size_SetHeight(*args
, **kwargs
)
820 def GetWidth(*args
, **kwargs
):
821 """GetWidth(self) -> int"""
822 return _core_
.Size_GetWidth(*args
, **kwargs
)
824 def GetHeight(*args
, **kwargs
):
825 """GetHeight(self) -> int"""
826 return _core_
.Size_GetHeight(*args
, **kwargs
)
828 def IsFullySpecified(*args
, **kwargs
):
830 IsFullySpecified(self) -> bool
832 Returns True if both components of the size are non-default values.
834 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
836 def SetDefaults(*args
, **kwargs
):
838 SetDefaults(self, Size size)
840 Combine this size with the other one replacing the default components
841 of this object (i.e. equal to -1) with those of the other.
843 return _core_
.Size_SetDefaults(*args
, **kwargs
)
845 def Get(*args
, **kwargs
):
847 Get() -> (width,height)
849 Returns the width and height properties as a tuple.
851 return _core_
.Size_Get(*args
, **kwargs
)
853 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
854 def __str__(self
): return str(self
.Get())
855 def __repr__(self
): return 'wx.Size'+str(self
.Get())
856 def __len__(self
): return len(self
.Get())
857 def __getitem__(self
, index
): return self
.Get()[index
]
858 def __setitem__(self
, index
, val
):
859 if index
== 0: self
.width
= val
860 elif index
== 1: self
.height
= val
861 else: raise IndexError
862 def __nonzero__(self
): return self
.Get() != (0,0)
863 __safe_for_unpickling__
= True
864 def __reduce__(self
): return (wx
.Size
, self
.Get())
868 def __init__(self
, this
):
870 if not hasattr(self
,"thisown"): self
.thisown
= 0
871 self
.__class
__ = Size
872 _core_
.Size_swigregister(SizePtr
)
874 #---------------------------------------------------------------------------
876 class RealPoint(object):
878 A data structure for representing a point or position with floating
879 point x and y properties. In wxPython most places that expect a
880 wx.RealPoint can also accept a (x,y) tuple.
883 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
884 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
885 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
886 def __init__(self
, *args
, **kwargs
):
888 __init__(self, double x=0.0, double y=0.0) -> RealPoint
890 Create a wx.RealPoint object
892 newobj
= _core_
.new_RealPoint(*args
, **kwargs
)
893 self
.this
= newobj
.this
896 def __del__(self
, destroy
=_core_
.delete_RealPoint
):
899 if self
.thisown
: destroy(self
)
902 def __eq__(*args
, **kwargs
):
904 __eq__(self, RealPoint pt) -> bool
906 Test for equality of wx.RealPoint objects.
908 return _core_
.RealPoint___eq__(*args
, **kwargs
)
910 def __ne__(*args
, **kwargs
):
912 __ne__(self, RealPoint pt) -> bool
914 Test for inequality of wx.RealPoint objects.
916 return _core_
.RealPoint___ne__(*args
, **kwargs
)
918 def __add__(*args
, **kwargs
):
920 __add__(self, RealPoint pt) -> RealPoint
922 Add pt's proprties to this and return the result.
924 return _core_
.RealPoint___add__(*args
, **kwargs
)
926 def __sub__(*args
, **kwargs
):
928 __sub__(self, RealPoint pt) -> RealPoint
930 Subtract pt's proprties from this and return the result
932 return _core_
.RealPoint___sub__(*args
, **kwargs
)
934 def Set(*args
, **kwargs
):
936 Set(self, double x, double y)
938 Set both the x and y properties
940 return _core_
.RealPoint_Set(*args
, **kwargs
)
942 def Get(*args
, **kwargs
):
946 Return the x and y properties as a tuple.
948 return _core_
.RealPoint_Get(*args
, **kwargs
)
950 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
951 def __str__(self
): return str(self
.Get())
952 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
953 def __len__(self
): return len(self
.Get())
954 def __getitem__(self
, index
): return self
.Get()[index
]
955 def __setitem__(self
, index
, val
):
956 if index
== 0: self
.x
= val
957 elif index
== 1: self
.y
= val
958 else: raise IndexError
959 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
960 __safe_for_unpickling__
= True
961 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
964 class RealPointPtr(RealPoint
):
965 def __init__(self
, this
):
967 if not hasattr(self
,"thisown"): self
.thisown
= 0
968 self
.__class
__ = RealPoint
969 _core_
.RealPoint_swigregister(RealPointPtr
)
971 #---------------------------------------------------------------------------
975 A data structure for representing a point or position with integer x
976 and y properties. Most places in wxPython that expect a wx.Point can
977 also accept a (x,y) tuple.
980 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
981 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
982 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
983 def __init__(self
, *args
, **kwargs
):
985 __init__(self, int x=0, int y=0) -> Point
987 Create a wx.Point object
989 newobj
= _core_
.new_Point(*args
, **kwargs
)
990 self
.this
= newobj
.this
993 def __del__(self
, destroy
=_core_
.delete_Point
):
996 if self
.thisown
: destroy(self
)
999 def __eq__(*args
, **kwargs
):
1001 __eq__(self, Point pt) -> bool
1003 Test for equality of wx.Point objects.
1005 return _core_
.Point___eq__(*args
, **kwargs
)
1007 def __ne__(*args
, **kwargs
):
1009 __ne__(self, Point pt) -> bool
1011 Test for inequality of wx.Point objects.
1013 return _core_
.Point___ne__(*args
, **kwargs
)
1015 def __add__(*args
, **kwargs
):
1017 __add__(self, Point pt) -> Point
1019 Add pt's proprties to this and return the result.
1021 return _core_
.Point___add__(*args
, **kwargs
)
1023 def __sub__(*args
, **kwargs
):
1025 __sub__(self, Point pt) -> Point
1027 Subtract pt's proprties from this and return the result
1029 return _core_
.Point___sub__(*args
, **kwargs
)
1031 def __iadd__(*args
, **kwargs
):
1033 __iadd__(self, Point pt) -> Point
1035 Add pt to this object.
1037 return _core_
.Point___iadd__(*args
, **kwargs
)
1039 def __isub__(*args
, **kwargs
):
1041 __isub__(self, Point pt) -> Point
1043 Subtract pt from this object.
1045 return _core_
.Point___isub__(*args
, **kwargs
)
1047 def Set(*args
, **kwargs
):
1049 Set(self, long x, long y)
1051 Set both the x and y properties
1053 return _core_
.Point_Set(*args
, **kwargs
)
1055 def Get(*args
, **kwargs
):
1059 Return the x and y properties as a tuple.
1061 return _core_
.Point_Get(*args
, **kwargs
)
1063 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1064 def __str__(self
): return str(self
.Get())
1065 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1066 def __len__(self
): return len(self
.Get())
1067 def __getitem__(self
, index
): return self
.Get()[index
]
1068 def __setitem__(self
, index
, val
):
1069 if index
== 0: self
.x
= val
1070 elif index
== 1: self
.y
= val
1071 else: raise IndexError
1072 def __nonzero__(self
): return self
.Get() != (0,0)
1073 __safe_for_unpickling__
= True
1074 def __reduce__(self
): return (wx
.Point
, self
.Get())
1077 class PointPtr(Point
):
1078 def __init__(self
, this
):
1080 if not hasattr(self
,"thisown"): self
.thisown
= 0
1081 self
.__class
__ = Point
1082 _core_
.Point_swigregister(PointPtr
)
1084 #---------------------------------------------------------------------------
1088 A class for representing and manipulating rectangles. It has x, y,
1089 width and height properties. In wxPython most palces that expect a
1090 wx.Rect can also accept a (x,y,width,height) tuple.
1093 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1094 def __init__(self
, *args
, **kwargs
):
1096 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1098 Create a new Rect object.
1100 newobj
= _core_
.new_Rect(*args
, **kwargs
)
1101 self
.this
= newobj
.this
1104 def __del__(self
, destroy
=_core_
.delete_Rect
):
1107 if self
.thisown
: destroy(self
)
1110 def GetX(*args
, **kwargs
):
1111 """GetX(self) -> int"""
1112 return _core_
.Rect_GetX(*args
, **kwargs
)
1114 def SetX(*args
, **kwargs
):
1115 """SetX(self, int x)"""
1116 return _core_
.Rect_SetX(*args
, **kwargs
)
1118 def GetY(*args
, **kwargs
):
1119 """GetY(self) -> int"""
1120 return _core_
.Rect_GetY(*args
, **kwargs
)
1122 def SetY(*args
, **kwargs
):
1123 """SetY(self, int y)"""
1124 return _core_
.Rect_SetY(*args
, **kwargs
)
1126 def GetWidth(*args
, **kwargs
):
1127 """GetWidth(self) -> int"""
1128 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1130 def SetWidth(*args
, **kwargs
):
1131 """SetWidth(self, int w)"""
1132 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1134 def GetHeight(*args
, **kwargs
):
1135 """GetHeight(self) -> int"""
1136 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1138 def SetHeight(*args
, **kwargs
):
1139 """SetHeight(self, int h)"""
1140 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1142 def GetPosition(*args
, **kwargs
):
1143 """GetPosition(self) -> Point"""
1144 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1146 def SetPosition(*args
, **kwargs
):
1147 """SetPosition(self, Point p)"""
1148 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1150 def GetSize(*args
, **kwargs
):
1151 """GetSize(self) -> Size"""
1152 return _core_
.Rect_GetSize(*args
, **kwargs
)
1154 def SetSize(*args
, **kwargs
):
1155 """SetSize(self, Size s)"""
1156 return _core_
.Rect_SetSize(*args
, **kwargs
)
1158 def IsEmpty(*args
, **kwargs
):
1159 """IsEmpty(self) -> bool"""
1160 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1162 def GetTopLeft(*args
, **kwargs
):
1163 """GetTopLeft(self) -> Point"""
1164 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1166 def SetTopLeft(*args
, **kwargs
):
1167 """SetTopLeft(self, Point p)"""
1168 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1170 def GetBottomRight(*args
, **kwargs
):
1171 """GetBottomRight(self) -> Point"""
1172 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1174 def SetBottomRight(*args
, **kwargs
):
1175 """SetBottomRight(self, Point p)"""
1176 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1178 def GetLeft(*args
, **kwargs
):
1179 """GetLeft(self) -> int"""
1180 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1182 def GetTop(*args
, **kwargs
):
1183 """GetTop(self) -> int"""
1184 return _core_
.Rect_GetTop(*args
, **kwargs
)
1186 def GetBottom(*args
, **kwargs
):
1187 """GetBottom(self) -> int"""
1188 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1190 def GetRight(*args
, **kwargs
):
1191 """GetRight(self) -> int"""
1192 return _core_
.Rect_GetRight(*args
, **kwargs
)
1194 def SetLeft(*args
, **kwargs
):
1195 """SetLeft(self, int left)"""
1196 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1198 def SetRight(*args
, **kwargs
):
1199 """SetRight(self, int right)"""
1200 return _core_
.Rect_SetRight(*args
, **kwargs
)
1202 def SetTop(*args
, **kwargs
):
1203 """SetTop(self, int top)"""
1204 return _core_
.Rect_SetTop(*args
, **kwargs
)
1206 def SetBottom(*args
, **kwargs
):
1207 """SetBottom(self, int bottom)"""
1208 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1210 position
= property(GetPosition
, SetPosition
)
1211 size
= property(GetSize
, SetSize
)
1212 left
= property(GetLeft
, SetLeft
)
1213 right
= property(GetRight
, SetRight
)
1214 top
= property(GetTop
, SetTop
)
1215 bottom
= property(GetBottom
, SetBottom
)
1217 def Inflate(*args
, **kwargs
):
1219 Inflate(self, int dx, int dy) -> Rect
1221 Increases the size of the rectangle.
1223 The left border is moved farther left and the right border is moved
1224 farther right by ``dx``. The upper border is moved farther up and the
1225 bottom border is moved farther down by ``dy``. (Note the the width and
1226 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1227 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1228 opposite happens: the rectangle size decreases in the respective
1231 The change is made to the rectangle inplace, if instead you need a
1232 copy that is inflated, preserving the original then make the copy
1235 copy = wx.Rect(*original)
1240 return _core_
.Rect_Inflate(*args
, **kwargs
)
1242 def Deflate(*args
, **kwargs
):
1244 Deflate(self, int dx, int dy) -> Rect
1246 Decrease the rectangle size. This method is the opposite of `Inflate`
1247 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1248 `Inflate` for a full description.
1250 return _core_
.Rect_Deflate(*args
, **kwargs
)
1252 def OffsetXY(*args
, **kwargs
):
1254 OffsetXY(self, int dx, int dy)
1256 Moves the rectangle by the specified offset. If dx is positive, the
1257 rectangle is moved to the right, if dy is positive, it is moved to the
1258 bottom, otherwise it is moved to the left or top respectively.
1260 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1262 def Offset(*args
, **kwargs
):
1264 Offset(self, Point pt)
1266 Same as OffsetXY but uses dx,dy from Point
1268 return _core_
.Rect_Offset(*args
, **kwargs
)
1270 def Intersect(*args
, **kwargs
):
1272 Intersect(self, Rect rect) -> Rect
1274 Returns the intersectsion of this rectangle and rect.
1276 return _core_
.Rect_Intersect(*args
, **kwargs
)
1278 def Union(*args
, **kwargs
):
1280 Union(self, Rect rect) -> Rect
1282 Returns the union of this rectangle and rect.
1284 return _core_
.Rect_Union(*args
, **kwargs
)
1286 def __add__(*args
, **kwargs
):
1288 __add__(self, Rect rect) -> Rect
1290 Add the properties of rect to this rectangle and return the result.
1292 return _core_
.Rect___add__(*args
, **kwargs
)
1294 def __iadd__(*args
, **kwargs
):
1296 __iadd__(self, Rect rect) -> Rect
1298 Add the properties of rect to this rectangle, updating this rectangle.
1300 return _core_
.Rect___iadd__(*args
, **kwargs
)
1302 def __eq__(*args
, **kwargs
):
1304 __eq__(self, Rect rect) -> bool
1308 return _core_
.Rect___eq__(*args
, **kwargs
)
1310 def __ne__(*args
, **kwargs
):
1312 __ne__(self, Rect rect) -> bool
1314 Test for inequality.
1316 return _core_
.Rect___ne__(*args
, **kwargs
)
1318 def InsideXY(*args
, **kwargs
):
1320 InsideXY(self, int x, int y) -> bool
1322 Return True if the point is (not strcitly) inside the rect.
1324 return _core_
.Rect_InsideXY(*args
, **kwargs
)
1326 def Inside(*args
, **kwargs
):
1328 Inside(self, Point pt) -> bool
1330 Return True if the point is (not strcitly) inside the rect.
1332 return _core_
.Rect_Inside(*args
, **kwargs
)
1334 def Intersects(*args
, **kwargs
):
1336 Intersects(self, Rect rect) -> bool
1338 Returns True if the rectangles have a non empty intersection.
1340 return _core_
.Rect_Intersects(*args
, **kwargs
)
1342 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1343 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1344 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1345 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1346 def Set(*args
, **kwargs
):
1348 Set(self, int x=0, int y=0, int width=0, int height=0)
1350 Set all rectangle properties.
1352 return _core_
.Rect_Set(*args
, **kwargs
)
1354 def Get(*args
, **kwargs
):
1356 Get() -> (x,y,width,height)
1358 Return the rectangle properties as a tuple.
1360 return _core_
.Rect_Get(*args
, **kwargs
)
1362 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1363 def __str__(self
): return str(self
.Get())
1364 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1365 def __len__(self
): return len(self
.Get())
1366 def __getitem__(self
, index
): return self
.Get()[index
]
1367 def __setitem__(self
, index
, val
):
1368 if index
== 0: self
.x
= val
1369 elif index
== 1: self
.y
= val
1370 elif index
== 2: self
.width
= val
1371 elif index
== 3: self
.height
= val
1372 else: raise IndexError
1373 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1374 __safe_for_unpickling__
= True
1375 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1378 class RectPtr(Rect
):
1379 def __init__(self
, this
):
1381 if not hasattr(self
,"thisown"): self
.thisown
= 0
1382 self
.__class
__ = Rect
1383 _core_
.Rect_swigregister(RectPtr
)
1385 def RectPP(*args
, **kwargs
):
1387 RectPP(Point topLeft, Point bottomRight) -> Rect
1389 Create a new Rect object from Points representing two corners.
1391 val
= _core_
.new_RectPP(*args
, **kwargs
)
1395 def RectPS(*args
, **kwargs
):
1397 RectPS(Point pos, Size size) -> Rect
1399 Create a new Rect from a position and size.
1401 val
= _core_
.new_RectPS(*args
, **kwargs
)
1405 def RectS(*args
, **kwargs
):
1407 RectS(Size size) -> Rect
1409 Create a new Rect from a size only.
1411 val
= _core_
.new_RectS(*args
, **kwargs
)
1416 def IntersectRect(*args
, **kwargs
):
1418 IntersectRect(Rect r1, Rect r2) -> Rect
1420 Calculate and return the intersection of r1 and r2.
1422 return _core_
.IntersectRect(*args
, **kwargs
)
1423 #---------------------------------------------------------------------------
1425 class Point2D(object):
1427 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1428 with floating point values.
1431 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1432 def __init__(self
, *args
, **kwargs
):
1434 __init__(self, double x=0.0, double y=0.0) -> Point2D
1436 Create a w.Point2D object.
1438 newobj
= _core_
.new_Point2D(*args
, **kwargs
)
1439 self
.this
= newobj
.this
1442 def GetFloor(*args
, **kwargs
):
1448 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1450 def GetRounded(*args
, **kwargs
):
1452 GetRounded() -> (x,y)
1456 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1458 def GetVectorLength(*args
, **kwargs
):
1459 """GetVectorLength(self) -> double"""
1460 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1462 def GetVectorAngle(*args
, **kwargs
):
1463 """GetVectorAngle(self) -> double"""
1464 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1466 def SetVectorLength(*args
, **kwargs
):
1467 """SetVectorLength(self, double length)"""
1468 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1470 def SetVectorAngle(*args
, **kwargs
):
1471 """SetVectorAngle(self, double degrees)"""
1472 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1474 def SetPolarCoordinates(self
, angle
, length
):
1475 self
.SetVectorLength(length
)
1476 self
.SetVectorAngle(angle
)
1477 def Normalize(self
):
1478 self
.SetVectorLength(1.0)
1480 def GetDistance(*args
, **kwargs
):
1481 """GetDistance(self, Point2D pt) -> double"""
1482 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1484 def GetDistanceSquare(*args
, **kwargs
):
1485 """GetDistanceSquare(self, Point2D pt) -> double"""
1486 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1488 def GetDotProduct(*args
, **kwargs
):
1489 """GetDotProduct(self, Point2D vec) -> double"""
1490 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1492 def GetCrossProduct(*args
, **kwargs
):
1493 """GetCrossProduct(self, Point2D vec) -> double"""
1494 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1496 def __neg__(*args
, **kwargs
):
1498 __neg__(self) -> Point2D
1500 the reflection of this point
1502 return _core_
.Point2D___neg__(*args
, **kwargs
)
1504 def __iadd__(*args
, **kwargs
):
1505 """__iadd__(self, Point2D pt) -> Point2D"""
1506 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1508 def __isub__(*args
, **kwargs
):
1509 """__isub__(self, Point2D pt) -> Point2D"""
1510 return _core_
.Point2D___isub__(*args
, **kwargs
)
1512 def __imul__(*args
, **kwargs
):
1513 """__imul__(self, Point2D pt) -> Point2D"""
1514 return _core_
.Point2D___imul__(*args
, **kwargs
)
1516 def __idiv__(*args
, **kwargs
):
1517 """__idiv__(self, Point2D pt) -> Point2D"""
1518 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1520 def __eq__(*args
, **kwargs
):
1522 __eq__(self, Point2D pt) -> bool
1526 return _core_
.Point2D___eq__(*args
, **kwargs
)
1528 def __ne__(*args
, **kwargs
):
1530 __ne__(self, Point2D pt) -> bool
1534 return _core_
.Point2D___ne__(*args
, **kwargs
)
1536 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1537 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1538 def Set(*args
, **kwargs
):
1539 """Set(self, double x=0, double y=0)"""
1540 return _core_
.Point2D_Set(*args
, **kwargs
)
1542 def Get(*args
, **kwargs
):
1546 Return x and y properties as a tuple.
1548 return _core_
.Point2D_Get(*args
, **kwargs
)
1550 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1551 def __str__(self
): return str(self
.Get())
1552 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1553 def __len__(self
): return len(self
.Get())
1554 def __getitem__(self
, index
): return self
.Get()[index
]
1555 def __setitem__(self
, index
, val
):
1556 if index
== 0: self
.x
= val
1557 elif index
== 1: self
.y
= val
1558 else: raise IndexError
1559 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1560 __safe_for_unpickling__
= True
1561 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1564 class Point2DPtr(Point2D
):
1565 def __init__(self
, this
):
1567 if not hasattr(self
,"thisown"): self
.thisown
= 0
1568 self
.__class
__ = Point2D
1569 _core_
.Point2D_swigregister(Point2DPtr
)
1571 def Point2DCopy(*args
, **kwargs
):
1573 Point2DCopy(Point2D pt) -> Point2D
1575 Create a w.Point2D object.
1577 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1581 def Point2DFromPoint(*args
, **kwargs
):
1583 Point2DFromPoint(Point pt) -> Point2D
1585 Create a w.Point2D object.
1587 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1591 #---------------------------------------------------------------------------
1593 FromStart
= _core_
.FromStart
1594 FromCurrent
= _core_
.FromCurrent
1595 FromEnd
= _core_
.FromEnd
1596 class InputStream(object):
1597 """Proxy of C++ InputStream class"""
1599 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1600 def __init__(self
, *args
, **kwargs
):
1601 """__init__(self, PyObject p) -> InputStream"""
1602 newobj
= _core_
.new_InputStream(*args
, **kwargs
)
1603 self
.this
= newobj
.this
1606 def __del__(self
, destroy
=_core_
.delete_InputStream
):
1609 if self
.thisown
: destroy(self
)
1612 def close(*args
, **kwargs
):
1614 return _core_
.InputStream_close(*args
, **kwargs
)
1616 def flush(*args
, **kwargs
):
1618 return _core_
.InputStream_flush(*args
, **kwargs
)
1620 def eof(*args
, **kwargs
):
1621 """eof(self) -> bool"""
1622 return _core_
.InputStream_eof(*args
, **kwargs
)
1624 def read(*args
, **kwargs
):
1625 """read(self, int size=-1) -> PyObject"""
1626 return _core_
.InputStream_read(*args
, **kwargs
)
1628 def readline(*args
, **kwargs
):
1629 """readline(self, int size=-1) -> PyObject"""
1630 return _core_
.InputStream_readline(*args
, **kwargs
)
1632 def readlines(*args
, **kwargs
):
1633 """readlines(self, int sizehint=-1) -> PyObject"""
1634 return _core_
.InputStream_readlines(*args
, **kwargs
)
1636 def seek(*args
, **kwargs
):
1637 """seek(self, int offset, int whence=0)"""
1638 return _core_
.InputStream_seek(*args
, **kwargs
)
1640 def tell(*args
, **kwargs
):
1641 """tell(self) -> int"""
1642 return _core_
.InputStream_tell(*args
, **kwargs
)
1644 def Peek(*args
, **kwargs
):
1645 """Peek(self) -> char"""
1646 return _core_
.InputStream_Peek(*args
, **kwargs
)
1648 def GetC(*args
, **kwargs
):
1649 """GetC(self) -> char"""
1650 return _core_
.InputStream_GetC(*args
, **kwargs
)
1652 def LastRead(*args
, **kwargs
):
1653 """LastRead(self) -> size_t"""
1654 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1656 def CanRead(*args
, **kwargs
):
1657 """CanRead(self) -> bool"""
1658 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1660 def Eof(*args
, **kwargs
):
1661 """Eof(self) -> bool"""
1662 return _core_
.InputStream_Eof(*args
, **kwargs
)
1664 def Ungetch(*args
, **kwargs
):
1665 """Ungetch(self, char c) -> bool"""
1666 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1668 def SeekI(*args
, **kwargs
):
1669 """SeekI(self, long pos, int mode=FromStart) -> long"""
1670 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1672 def TellI(*args
, **kwargs
):
1673 """TellI(self) -> long"""
1674 return _core_
.InputStream_TellI(*args
, **kwargs
)
1677 class InputStreamPtr(InputStream
):
1678 def __init__(self
, this
):
1680 if not hasattr(self
,"thisown"): self
.thisown
= 0
1681 self
.__class
__ = InputStream
1682 _core_
.InputStream_swigregister(InputStreamPtr
)
1683 DefaultPosition
= cvar
.DefaultPosition
1684 DefaultSize
= cvar
.DefaultSize
1686 class OutputStream(object):
1687 """Proxy of C++ OutputStream class"""
1688 def __init__(self
): raise RuntimeError, "No constructor defined"
1690 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1691 def write(*args
, **kwargs
):
1692 """write(self, PyObject obj)"""
1693 return _core_
.OutputStream_write(*args
, **kwargs
)
1696 class OutputStreamPtr(OutputStream
):
1697 def __init__(self
, this
):
1699 if not hasattr(self
,"thisown"): self
.thisown
= 0
1700 self
.__class
__ = OutputStream
1701 _core_
.OutputStream_swigregister(OutputStreamPtr
)
1703 #---------------------------------------------------------------------------
1705 class FSFile(Object
):
1706 """Proxy of C++ FSFile class"""
1708 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1709 def __init__(self
, *args
, **kwargs
):
1711 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1712 DateTime modif) -> FSFile
1714 newobj
= _core_
.new_FSFile(*args
, **kwargs
)
1715 self
.this
= newobj
.this
1718 self
.thisown
= 0 # It will normally be deleted by the user of the wx.FileSystem
1720 def __del__(self
, destroy
=_core_
.delete_FSFile
):
1723 if self
.thisown
: destroy(self
)
1726 def GetStream(*args
, **kwargs
):
1727 """GetStream(self) -> InputStream"""
1728 return _core_
.FSFile_GetStream(*args
, **kwargs
)
1730 def GetMimeType(*args
, **kwargs
):
1731 """GetMimeType(self) -> String"""
1732 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
1734 def GetLocation(*args
, **kwargs
):
1735 """GetLocation(self) -> String"""
1736 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
1738 def GetAnchor(*args
, **kwargs
):
1739 """GetAnchor(self) -> String"""
1740 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
1742 def GetModificationTime(*args
, **kwargs
):
1743 """GetModificationTime(self) -> DateTime"""
1744 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
1747 class FSFilePtr(FSFile
):
1748 def __init__(self
, this
):
1750 if not hasattr(self
,"thisown"): self
.thisown
= 0
1751 self
.__class
__ = FSFile
1752 _core_
.FSFile_swigregister(FSFilePtr
)
1754 class CPPFileSystemHandler(object):
1755 """Proxy of C++ CPPFileSystemHandler class"""
1756 def __init__(self
): raise RuntimeError, "No constructor defined"
1758 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1760 class CPPFileSystemHandlerPtr(CPPFileSystemHandler
):
1761 def __init__(self
, this
):
1763 if not hasattr(self
,"thisown"): self
.thisown
= 0
1764 self
.__class
__ = CPPFileSystemHandler
1765 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr
)
1767 class FileSystemHandler(CPPFileSystemHandler
):
1768 """Proxy of C++ FileSystemHandler class"""
1770 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1771 def __init__(self
, *args
, **kwargs
):
1772 """__init__(self) -> FileSystemHandler"""
1773 newobj
= _core_
.new_FileSystemHandler(*args
, **kwargs
)
1774 self
.this
= newobj
.this
1777 self
._setCallbackInfo
(self
, FileSystemHandler
)
1779 def _setCallbackInfo(*args
, **kwargs
):
1780 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1781 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
1783 def CanOpen(*args
, **kwargs
):
1784 """CanOpen(self, String location) -> bool"""
1785 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
1787 def OpenFile(*args
, **kwargs
):
1788 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1789 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
1791 def FindFirst(*args
, **kwargs
):
1792 """FindFirst(self, String spec, int flags=0) -> String"""
1793 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
1795 def FindNext(*args
, **kwargs
):
1796 """FindNext(self) -> String"""
1797 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
1799 def GetProtocol(*args
, **kwargs
):
1800 """GetProtocol(self, String location) -> String"""
1801 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
1803 def GetLeftLocation(*args
, **kwargs
):
1804 """GetLeftLocation(self, String location) -> String"""
1805 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
1807 def GetAnchor(*args
, **kwargs
):
1808 """GetAnchor(self, String location) -> String"""
1809 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
1811 def GetRightLocation(*args
, **kwargs
):
1812 """GetRightLocation(self, String location) -> String"""
1813 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
1815 def GetMimeTypeFromExt(*args
, **kwargs
):
1816 """GetMimeTypeFromExt(self, String location) -> String"""
1817 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
1820 class FileSystemHandlerPtr(FileSystemHandler
):
1821 def __init__(self
, this
):
1823 if not hasattr(self
,"thisown"): self
.thisown
= 0
1824 self
.__class
__ = FileSystemHandler
1825 _core_
.FileSystemHandler_swigregister(FileSystemHandlerPtr
)
1827 class FileSystem(Object
):
1828 """Proxy of C++ FileSystem class"""
1830 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1831 def __init__(self
, *args
, **kwargs
):
1832 """__init__(self) -> FileSystem"""
1833 newobj
= _core_
.new_FileSystem(*args
, **kwargs
)
1834 self
.this
= newobj
.this
1837 def __del__(self
, destroy
=_core_
.delete_FileSystem
):
1840 if self
.thisown
: destroy(self
)
1843 def ChangePathTo(*args
, **kwargs
):
1844 """ChangePathTo(self, String location, bool is_dir=False)"""
1845 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
1847 def GetPath(*args
, **kwargs
):
1848 """GetPath(self) -> String"""
1849 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
1851 def OpenFile(*args
, **kwargs
):
1852 """OpenFile(self, String location) -> FSFile"""
1853 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
1855 def FindFirst(*args
, **kwargs
):
1856 """FindFirst(self, String spec, int flags=0) -> String"""
1857 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
1859 def FindNext(*args
, **kwargs
):
1860 """FindNext(self) -> String"""
1861 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
1863 def AddHandler(*args
, **kwargs
):
1864 """AddHandler(CPPFileSystemHandler handler)"""
1865 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1867 AddHandler
= staticmethod(AddHandler
)
1868 def CleanUpHandlers(*args
, **kwargs
):
1869 """CleanUpHandlers()"""
1870 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1872 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
1873 def FileNameToURL(*args
, **kwargs
):
1874 """FileNameToURL(String filename) -> String"""
1875 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1877 FileNameToURL
= staticmethod(FileNameToURL
)
1878 def URLToFileName(*args
, **kwargs
):
1879 """URLToFileName(String url) -> String"""
1880 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1882 URLToFileName
= staticmethod(URLToFileName
)
1884 class FileSystemPtr(FileSystem
):
1885 def __init__(self
, this
):
1887 if not hasattr(self
,"thisown"): self
.thisown
= 0
1888 self
.__class
__ = FileSystem
1889 _core_
.FileSystem_swigregister(FileSystemPtr
)
1891 def FileSystem_AddHandler(*args
, **kwargs
):
1892 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1893 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1895 def FileSystem_CleanUpHandlers(*args
, **kwargs
):
1896 """FileSystem_CleanUpHandlers()"""
1897 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1899 def FileSystem_FileNameToURL(*args
, **kwargs
):
1900 """FileSystem_FileNameToURL(String filename) -> String"""
1901 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1903 def FileSystem_URLToFileName(*args
, **kwargs
):
1904 """FileSystem_URLToFileName(String url) -> String"""
1905 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1907 class InternetFSHandler(CPPFileSystemHandler
):
1908 """Proxy of C++ InternetFSHandler class"""
1910 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1911 def __init__(self
, *args
, **kwargs
):
1912 """__init__(self) -> InternetFSHandler"""
1913 newobj
= _core_
.new_InternetFSHandler(*args
, **kwargs
)
1914 self
.this
= newobj
.this
1917 def CanOpen(*args
, **kwargs
):
1918 """CanOpen(self, String location) -> bool"""
1919 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
1921 def OpenFile(*args
, **kwargs
):
1922 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1923 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
1926 class InternetFSHandlerPtr(InternetFSHandler
):
1927 def __init__(self
, this
):
1929 if not hasattr(self
,"thisown"): self
.thisown
= 0
1930 self
.__class
__ = InternetFSHandler
1931 _core_
.InternetFSHandler_swigregister(InternetFSHandlerPtr
)
1933 class ZipFSHandler(CPPFileSystemHandler
):
1934 """Proxy of C++ ZipFSHandler class"""
1936 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1937 def __init__(self
, *args
, **kwargs
):
1938 """__init__(self) -> ZipFSHandler"""
1939 newobj
= _core_
.new_ZipFSHandler(*args
, **kwargs
)
1940 self
.this
= newobj
.this
1943 def CanOpen(*args
, **kwargs
):
1944 """CanOpen(self, String location) -> bool"""
1945 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
1947 def OpenFile(*args
, **kwargs
):
1948 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1949 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
1951 def FindFirst(*args
, **kwargs
):
1952 """FindFirst(self, String spec, int flags=0) -> String"""
1953 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
1955 def FindNext(*args
, **kwargs
):
1956 """FindNext(self) -> String"""
1957 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
1960 class ZipFSHandlerPtr(ZipFSHandler
):
1961 def __init__(self
, this
):
1963 if not hasattr(self
,"thisown"): self
.thisown
= 0
1964 self
.__class
__ = ZipFSHandler
1965 _core_
.ZipFSHandler_swigregister(ZipFSHandlerPtr
)
1968 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
1969 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1970 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
1972 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
1973 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1974 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
1976 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
1977 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1978 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
1979 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
1981 Add 'file' to the memory filesystem. The dataItem parameter can
1982 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1983 arbitrary data. If a bitmap or image is used then the imgType
1984 parameter should specify what kind of image file it should be
1985 written as, wx.BITMAP_TYPE_PNG, etc.
1987 if isinstance(dataItem
, wx
.Image
):
1988 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
1989 elif isinstance(dataItem
, wx
.Bitmap
):
1990 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
1991 elif type(dataItem
) == str:
1992 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
1994 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1996 class MemoryFSHandler(CPPFileSystemHandler
):
1997 """Proxy of C++ MemoryFSHandler class"""
1999 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2000 def __init__(self
, *args
, **kwargs
):
2001 """__init__(self) -> MemoryFSHandler"""
2002 newobj
= _core_
.new_MemoryFSHandler(*args
, **kwargs
)
2003 self
.this
= newobj
.this
2006 def RemoveFile(*args
, **kwargs
):
2007 """RemoveFile(String filename)"""
2008 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2010 RemoveFile
= staticmethod(RemoveFile
)
2011 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
2012 def CanOpen(*args
, **kwargs
):
2013 """CanOpen(self, String location) -> bool"""
2014 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
2016 def OpenFile(*args
, **kwargs
):
2017 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2018 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
2020 def FindFirst(*args
, **kwargs
):
2021 """FindFirst(self, String spec, int flags=0) -> String"""
2022 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
2024 def FindNext(*args
, **kwargs
):
2025 """FindNext(self) -> String"""
2026 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
2029 class MemoryFSHandlerPtr(MemoryFSHandler
):
2030 def __init__(self
, this
):
2032 if not hasattr(self
,"thisown"): self
.thisown
= 0
2033 self
.__class
__ = MemoryFSHandler
2034 _core_
.MemoryFSHandler_swigregister(MemoryFSHandlerPtr
)
2036 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
2037 """MemoryFSHandler_RemoveFile(String filename)"""
2038 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2040 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
2041 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
2042 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
2043 #---------------------------------------------------------------------------
2045 class ImageHandler(Object
):
2047 This is the base class for implementing image file loading/saving, and
2048 image creation from data. It is used within `wx.Image` and is not
2049 normally seen by the application.
2051 def __init__(self
): raise RuntimeError, "No constructor defined"
2053 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2054 def GetName(*args
, **kwargs
):
2055 """GetName(self) -> String"""
2056 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
2058 def GetExtension(*args
, **kwargs
):
2059 """GetExtension(self) -> String"""
2060 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
2062 def GetType(*args
, **kwargs
):
2063 """GetType(self) -> long"""
2064 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2066 def GetMimeType(*args
, **kwargs
):
2067 """GetMimeType(self) -> String"""
2068 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2070 def CanRead(*args
, **kwargs
):
2071 """CanRead(self, String name) -> bool"""
2072 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2074 def SetName(*args
, **kwargs
):
2075 """SetName(self, String name)"""
2076 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2078 def SetExtension(*args
, **kwargs
):
2079 """SetExtension(self, String extension)"""
2080 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2082 def SetType(*args
, **kwargs
):
2083 """SetType(self, long type)"""
2084 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2086 def SetMimeType(*args
, **kwargs
):
2087 """SetMimeType(self, String mimetype)"""
2088 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2091 class ImageHandlerPtr(ImageHandler
):
2092 def __init__(self
, this
):
2094 if not hasattr(self
,"thisown"): self
.thisown
= 0
2095 self
.__class
__ = ImageHandler
2096 _core_
.ImageHandler_swigregister(ImageHandlerPtr
)
2098 class ImageHistogram(object):
2099 """Proxy of C++ ImageHistogram class"""
2101 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2102 def __init__(self
, *args
, **kwargs
):
2103 """__init__(self) -> ImageHistogram"""
2104 newobj
= _core_
.new_ImageHistogram(*args
, **kwargs
)
2105 self
.this
= newobj
.this
2108 def MakeKey(*args
, **kwargs
):
2110 MakeKey(byte r, byte g, byte b) -> unsigned long
2112 Get the key in the histogram for the given RGB values
2114 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2116 MakeKey
= staticmethod(MakeKey
)
2117 def FindFirstUnusedColour(*args
, **kwargs
):
2119 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2121 Find first colour that is not used in the image and has higher RGB
2122 values than startR, startG, startB. Returns a tuple consisting of a
2123 success flag and rgb values.
2125 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2127 def GetCount(*args
, **kwargs
):
2129 GetCount(self, unsigned long key) -> unsigned long
2131 Returns the pixel count for the given key. Use `MakeKey` to create a
2132 key value from a RGB tripple.
2134 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2136 def GetCountRGB(*args
, **kwargs
):
2138 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2140 Returns the pixel count for the given RGB values.
2142 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2144 def GetCountColour(*args
, **kwargs
):
2146 GetCountColour(self, Colour colour) -> unsigned long
2148 Returns the pixel count for the given `wx.Colour` value.
2150 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2153 class ImageHistogramPtr(ImageHistogram
):
2154 def __init__(self
, this
):
2156 if not hasattr(self
,"thisown"): self
.thisown
= 0
2157 self
.__class
__ = ImageHistogram
2158 _core_
.ImageHistogram_swigregister(ImageHistogramPtr
)
2160 def ImageHistogram_MakeKey(*args
, **kwargs
):
2162 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2164 Get the key in the histogram for the given RGB values
2166 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2168 class Image(Object
):
2170 A platform-independent image class. An image can be created from
2171 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2172 variety of formats. Functions are available to set and get image
2173 bits, so it can be used for basic image manipulation.
2175 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2176 platform-specific `wx.Bitmap` object must be created from it using the
2177 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2178 device context, using `wx.DC.DrawBitmap`.
2180 One colour value of the image may be used as a mask colour which will
2181 lead to the automatic creation of a `wx.Mask` object associated to the
2184 wx.Image supports alpha channel data, that is in addition to a byte
2185 for the red, green and blue colour components for each pixel it also
2186 stores a byte representing the pixel opacity. An alpha value of 0
2187 corresponds to a transparent pixel (null opacity) while a value of 255
2188 means that the pixel is 100% opaque.
2190 Unlike RGB data, not all images have an alpha channel and before using
2191 `GetAlpha` you should check if this image contains an alpha channel
2192 with `HasAlpha`. Note that currently only images loaded from PNG files
2193 with transparency information will have an alpha channel.
2196 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2197 def __init__(self
, *args
, **kwargs
):
2199 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2201 Loads an image from a file.
2203 newobj
= _core_
.new_Image(*args
, **kwargs
)
2204 self
.this
= newobj
.this
2207 def __del__(self
, destroy
=_core_
.delete_Image
):
2210 if self
.thisown
: destroy(self
)
2213 def Create(*args
, **kwargs
):
2215 Create(self, int width, int height, bool clear=True)
2217 Creates a fresh image. If clear is ``True``, the new image will be
2218 initialized to black. Otherwise, the image data will be uninitialized.
2220 return _core_
.Image_Create(*args
, **kwargs
)
2222 def Destroy(*args
, **kwargs
):
2226 Destroys the image data.
2228 return _core_
.Image_Destroy(*args
, **kwargs
)
2230 def Scale(*args
, **kwargs
):
2232 Scale(self, int width, int height) -> Image
2234 Returns a scaled version of the image. This is also useful for scaling
2235 bitmaps in general as the only other way to scale bitmaps is to blit a
2236 `wx.MemoryDC` into another `wx.MemoryDC`.
2238 return _core_
.Image_Scale(*args
, **kwargs
)
2240 def ShrinkBy(*args
, **kwargs
):
2242 ShrinkBy(self, int xFactor, int yFactor) -> Image
2244 Return a version of the image scaled smaller by the given factors.
2246 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2248 def Rescale(*args
, **kwargs
):
2250 Rescale(self, int width, int height) -> Image
2252 Changes the size of the image in-place by scaling it: after a call to
2253 this function, the image will have the given width and height.
2255 Returns the (modified) image itself.
2257 return _core_
.Image_Rescale(*args
, **kwargs
)
2259 def Resize(*args
, **kwargs
):
2261 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2263 Changes the size of the image in-place without scaling it, by adding
2264 either a border with the given colour or cropping as necessary. The
2265 image is pasted into a new image with the given size and background
2266 colour at the position pos relative to the upper left of the new
2267 image. If red = green = blue = -1 then use either the current mask
2268 colour if set or find, use, and set a suitable mask colour for any
2269 newly exposed areas.
2271 Returns the (modified) image itself.
2273 return _core_
.Image_Resize(*args
, **kwargs
)
2275 def SetRGB(*args
, **kwargs
):
2277 SetRGB(self, int x, int y, byte r, byte g, byte b)
2279 Sets the pixel at the given coordinate. This routine performs
2280 bounds-checks for the coordinate so it can be considered a safe way to
2281 manipulate the data, but in some cases this might be too slow so that
2282 the data will have to be set directly. In that case you will have to
2283 get access to the image data using the `GetData` method.
2285 return _core_
.Image_SetRGB(*args
, **kwargs
)
2287 def SetRGBRect(*args
, **kwargs
):
2289 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2291 Sets the colour of the pixels within the given rectangle. This routine
2292 performs bounds-checks for the rectangle so it can be considered a
2293 safe way to manipulate the data.
2295 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2297 def GetRed(*args
, **kwargs
):
2299 GetRed(self, int x, int y) -> byte
2301 Returns the red intensity at the given coordinate.
2303 return _core_
.Image_GetRed(*args
, **kwargs
)
2305 def GetGreen(*args
, **kwargs
):
2307 GetGreen(self, int x, int y) -> byte
2309 Returns the green intensity at the given coordinate.
2311 return _core_
.Image_GetGreen(*args
, **kwargs
)
2313 def GetBlue(*args
, **kwargs
):
2315 GetBlue(self, int x, int y) -> byte
2317 Returns the blue intensity at the given coordinate.
2319 return _core_
.Image_GetBlue(*args
, **kwargs
)
2321 def SetAlpha(*args
, **kwargs
):
2323 SetAlpha(self, int x, int y, byte alpha)
2325 Sets the alpha value for the given pixel. This function should only be
2326 called if the image has alpha channel data, use `HasAlpha` to check
2329 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2331 def GetAlpha(*args
, **kwargs
):
2333 GetAlpha(self, int x, int y) -> byte
2335 Returns the alpha value for the given pixel. This function may only be
2336 called for the images with alpha channel, use `HasAlpha` to check for
2339 The returned value is the *opacity* of the image, i.e. the value of 0
2340 corresponds to the fully transparent pixels while the value of 255 to
2341 the fully opaque pixels.
2343 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2345 def HasAlpha(*args
, **kwargs
):
2347 HasAlpha(self) -> bool
2349 Returns true if this image has alpha channel, false otherwise.
2351 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2353 def InitAlpha(*args
, **kwargs
):
2357 Initializes the image alpha channel data. It is an error to call it if
2358 the image already has alpha data. If it doesn't, alpha data will be by
2359 default initialized to all pixels being fully opaque. But if the image
2360 has a a mask colour, all mask pixels will be completely transparent.
2362 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2364 def IsTransparent(*args
, **kwargs
):
2366 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2368 Returns ``True`` if this pixel is masked or has an alpha value less
2369 than the spcified threshold.
2371 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2373 def FindFirstUnusedColour(*args
, **kwargs
):
2375 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2377 Find first colour that is not used in the image and has higher RGB
2378 values than startR, startG, startB. Returns a tuple consisting of a
2379 success flag and rgb values.
2381 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2383 def ConvertAlphaToMask(*args
, **kwargs
):
2385 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2387 If the image has alpha channel, this method converts it to mask. All
2388 pixels with alpha value less than ``threshold`` are replaced with the
2389 mask colour and the alpha channel is removed. The mask colour is
2390 chosen automatically using `FindFirstUnusedColour`.
2392 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2395 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2397 def ConvertColourToAlpha(*args
, **kwargs
):
2399 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2401 This method converts an image where the original alpha information is
2402 only available as a shades of a colour (actually shades of grey)
2403 typically when you draw anti-aliased text into a bitmap. The DC
2404 drawing routines draw grey values on the black background although
2405 they actually mean to draw white with differnt alpha values. This
2406 method reverses it, assuming a black (!) background and white text.
2407 The method will then fill up the whole image with the colour given.
2409 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2411 def SetMaskFromImage(*args
, **kwargs
):
2413 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2415 Sets the image's mask so that the pixels that have RGB value of
2416 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2417 by first finding an unused colour in the image, setting this colour as
2418 the mask colour and then using this colour to draw all pixels in the
2419 image who corresponding pixel in mask has given RGB value.
2421 Returns ``False`` if ``mask`` does not have same dimensions as the
2422 image or if there is no unused colour left. Returns ``True`` if the
2423 mask was successfully applied.
2425 Note that this method involves computing the histogram, which is
2426 computationally intensive operation.
2428 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2430 def CanRead(*args
, **kwargs
):
2432 CanRead(String filename) -> bool
2434 Returns True if the image handlers can read this file.
2436 return _core_
.Image_CanRead(*args
, **kwargs
)
2438 CanRead
= staticmethod(CanRead
)
2439 def GetImageCount(*args
, **kwargs
):
2441 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2443 If the image file contains more than one image and the image handler
2444 is capable of retrieving these individually, this function will return
2445 the number of available images.
2447 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2449 GetImageCount
= staticmethod(GetImageCount
)
2450 def LoadFile(*args
, **kwargs
):
2452 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2454 Loads an image from a file. If no handler type is provided, the
2455 library will try to autodetect the format.
2457 return _core_
.Image_LoadFile(*args
, **kwargs
)
2459 def LoadMimeFile(*args
, **kwargs
):
2461 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2463 Loads an image from a file, specifying the image type with a MIME type
2466 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2468 def SaveFile(*args
, **kwargs
):
2470 SaveFile(self, String name, int type) -> bool
2472 Saves an image in the named file.
2474 return _core_
.Image_SaveFile(*args
, **kwargs
)
2476 def SaveMimeFile(*args
, **kwargs
):
2478 SaveMimeFile(self, String name, String mimetype) -> bool
2480 Saves an image in the named file.
2482 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2484 def CanReadStream(*args
, **kwargs
):
2486 CanReadStream(InputStream stream) -> bool
2488 Returns True if the image handlers can read an image file from the
2489 data currently on the input stream, or a readable Python file-like
2492 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2494 CanReadStream
= staticmethod(CanReadStream
)
2495 def LoadStream(*args
, **kwargs
):
2497 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2499 Loads an image from an input stream or a readable Python file-like
2500 object. If no handler type is provided, the library will try to
2501 autodetect the format.
2503 return _core_
.Image_LoadStream(*args
, **kwargs
)
2505 def LoadMimeStream(*args
, **kwargs
):
2507 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2509 Loads an image from an input stream or a readable Python file-like
2510 object, using a MIME type string to specify the image file format.
2512 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2514 def Ok(*args
, **kwargs
):
2518 Returns true if image data is present.
2520 return _core_
.Image_Ok(*args
, **kwargs
)
2522 def GetWidth(*args
, **kwargs
):
2524 GetWidth(self) -> int
2526 Gets the width of the image in pixels.
2528 return _core_
.Image_GetWidth(*args
, **kwargs
)
2530 def GetHeight(*args
, **kwargs
):
2532 GetHeight(self) -> int
2534 Gets the height of the image in pixels.
2536 return _core_
.Image_GetHeight(*args
, **kwargs
)
2538 def GetSize(*args
, **kwargs
):
2540 GetSize(self) -> Size
2542 Returns the size of the image in pixels.
2544 return _core_
.Image_GetSize(*args
, **kwargs
)
2546 def GetSubImage(*args
, **kwargs
):
2548 GetSubImage(self, Rect rect) -> Image
2550 Returns a sub image of the current one as long as the rect belongs
2551 entirely to the image.
2553 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2555 def Size(*args
, **kwargs
):
2557 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2559 Returns a resized version of this image without scaling it by adding
2560 either a border with the given colour or cropping as necessary. The
2561 image is pasted into a new image with the given size and background
2562 colour at the position ``pos`` relative to the upper left of the new
2563 image. If red = green = blue = -1 then use either the current mask
2564 colour if set or find, use, and set a suitable mask colour for any
2565 newly exposed areas.
2567 return _core_
.Image_Size(*args
, **kwargs
)
2569 def Copy(*args
, **kwargs
):
2573 Returns an identical copy of the image.
2575 return _core_
.Image_Copy(*args
, **kwargs
)
2577 def Paste(*args
, **kwargs
):
2579 Paste(self, Image image, int x, int y)
2581 Pastes ``image`` into this instance and takes care of the mask colour
2582 and any out of bounds problems.
2584 return _core_
.Image_Paste(*args
, **kwargs
)
2586 def GetData(*args
, **kwargs
):
2588 GetData(self) -> PyObject
2590 Returns a string containing a copy of the RGB bytes of the image.
2592 return _core_
.Image_GetData(*args
, **kwargs
)
2594 def SetData(*args
, **kwargs
):
2596 SetData(self, buffer data)
2598 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2599 either a string or a buffer object holding the data and the length of
2600 the data must be width*height*3.
2602 return _core_
.Image_SetData(*args
, **kwargs
)
2604 def GetDataBuffer(*args
, **kwargs
):
2606 GetDataBuffer(self) -> PyObject
2608 Returns a writable Python buffer object that is pointing at the RGB
2609 image data buffer inside the wx.Image. You need to ensure that you do
2610 not use this buffer object after the image has been destroyed.
2612 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
2614 def SetDataBuffer(*args
, **kwargs
):
2616 SetDataBuffer(self, buffer data)
2618 Sets the internal image data pointer to point at a Python buffer
2619 object. This can save making an extra copy of the data but you must
2620 ensure that the buffer object lives longer than the wx.Image does.
2622 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
2624 def GetAlphaData(*args
, **kwargs
):
2626 GetAlphaData(self) -> PyObject
2628 Returns a string containing a copy of the alpha bytes of the image.
2630 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
2632 def SetAlphaData(*args
, **kwargs
):
2634 SetAlphaData(self, buffer alpha)
2636 Resets the Image's alpha data from a buffer of bytes. Accepts either
2637 a string or a buffer object holding the data and the length of the
2638 data must be width*height.
2640 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
2642 def GetAlphaBuffer(*args
, **kwargs
):
2643 """GetAlphaBuffer(self) -> PyObject"""
2644 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
2646 def SetAlphaBuffer(*args
, **kwargs
):
2647 """SetAlphaBuffer(self, buffer alpha)"""
2648 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
2650 def SetMaskColour(*args
, **kwargs
):
2652 SetMaskColour(self, byte r, byte g, byte b)
2654 Sets the mask colour for this image (and tells the image to use the
2657 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
2659 def GetOrFindMaskColour(*args
, **kwargs
):
2661 GetOrFindMaskColour() -> (r,g,b)
2663 Get the current mask colour or find a suitable colour.
2665 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
2667 def GetMaskRed(*args
, **kwargs
):
2669 GetMaskRed(self) -> byte
2671 Gets the red component of the mask colour.
2673 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
2675 def GetMaskGreen(*args
, **kwargs
):
2677 GetMaskGreen(self) -> byte
2679 Gets the green component of the mask colour.
2681 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
2683 def GetMaskBlue(*args
, **kwargs
):
2685 GetMaskBlue(self) -> byte
2687 Gets the blue component of the mask colour.
2689 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
2691 def SetMask(*args
, **kwargs
):
2693 SetMask(self, bool mask=True)
2695 Specifies whether there is a mask or not. The area of the mask is
2696 determined by the current mask colour.
2698 return _core_
.Image_SetMask(*args
, **kwargs
)
2700 def HasMask(*args
, **kwargs
):
2702 HasMask(self) -> bool
2704 Returns ``True`` if there is a mask active, ``False`` otherwise.
2706 return _core_
.Image_HasMask(*args
, **kwargs
)
2708 def Rotate(*args
, **kwargs
):
2710 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2711 Point offset_after_rotation=None) -> Image
2713 Rotates the image about the given point, by ``angle`` radians. Passing
2714 ``True`` to ``interpolating`` results in better image quality, but is
2715 slower. If the image has a mask, then the mask colour is used for the
2716 uncovered pixels in the rotated image background. Otherwise, black
2717 will be used as the fill colour.
2719 Returns the rotated image, leaving this image intact.
2721 return _core_
.Image_Rotate(*args
, **kwargs
)
2723 def Rotate90(*args
, **kwargs
):
2725 Rotate90(self, bool clockwise=True) -> Image
2727 Returns a copy of the image rotated 90 degrees in the direction
2728 indicated by ``clockwise``.
2730 return _core_
.Image_Rotate90(*args
, **kwargs
)
2732 def Mirror(*args
, **kwargs
):
2734 Mirror(self, bool horizontally=True) -> Image
2736 Returns a mirrored copy of the image. The parameter ``horizontally``
2737 indicates the orientation.
2739 return _core_
.Image_Mirror(*args
, **kwargs
)
2741 def Replace(*args
, **kwargs
):
2743 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2745 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2748 return _core_
.Image_Replace(*args
, **kwargs
)
2750 def ConvertToMono(*args
, **kwargs
):
2752 ConvertToMono(self, byte r, byte g, byte b) -> Image
2754 Returns monochromatic version of the image. The returned image has
2755 white colour where the original has ``(r,g,b)`` colour and black
2756 colour everywhere else.
2758 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
2760 def SetOption(*args
, **kwargs
):
2762 SetOption(self, String name, String value)
2764 Sets an image handler defined option. For example, when saving as a
2765 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2766 number between 0 and 100 (0 is terrible, 100 is very good).
2768 return _core_
.Image_SetOption(*args
, **kwargs
)
2770 def SetOptionInt(*args
, **kwargs
):
2772 SetOptionInt(self, String name, int value)
2774 Sets an image option as an integer.
2776 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
2778 def GetOption(*args
, **kwargs
):
2780 GetOption(self, String name) -> String
2782 Gets the value of an image handler option.
2784 return _core_
.Image_GetOption(*args
, **kwargs
)
2786 def GetOptionInt(*args
, **kwargs
):
2788 GetOptionInt(self, String name) -> int
2790 Gets the value of an image handler option as an integer. If the given
2791 option is not present, the function returns 0.
2793 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
2795 def HasOption(*args
, **kwargs
):
2797 HasOption(self, String name) -> bool
2799 Returns true if the given option is present.
2801 return _core_
.Image_HasOption(*args
, **kwargs
)
2803 def CountColours(*args
, **kwargs
):
2804 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2805 return _core_
.Image_CountColours(*args
, **kwargs
)
2807 def ComputeHistogram(*args
, **kwargs
):
2808 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2809 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
2811 def AddHandler(*args
, **kwargs
):
2812 """AddHandler(ImageHandler handler)"""
2813 return _core_
.Image_AddHandler(*args
, **kwargs
)
2815 AddHandler
= staticmethod(AddHandler
)
2816 def InsertHandler(*args
, **kwargs
):
2817 """InsertHandler(ImageHandler handler)"""
2818 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2820 InsertHandler
= staticmethod(InsertHandler
)
2821 def RemoveHandler(*args
, **kwargs
):
2822 """RemoveHandler(String name) -> bool"""
2823 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2825 RemoveHandler
= staticmethod(RemoveHandler
)
2826 def GetImageExtWildcard(*args
, **kwargs
):
2828 GetImageExtWildcard() -> String
2830 Iterates all registered wxImageHandler objects, and returns a string
2831 containing file extension masks suitable for passing to file open/save
2834 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2836 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
2837 def ConvertToBitmap(*args
, **kwargs
):
2838 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2839 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
2841 def ConvertToMonoBitmap(*args
, **kwargs
):
2842 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2843 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
2845 def __nonzero__(self
): return self
.Ok()
2847 class ImagePtr(Image
):
2848 def __init__(self
, this
):
2850 if not hasattr(self
,"thisown"): self
.thisown
= 0
2851 self
.__class
__ = Image
2852 _core_
.Image_swigregister(ImagePtr
)
2854 def ImageFromMime(*args
, **kwargs
):
2856 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2858 Loads an image from a file, using a MIME type string (such as
2859 'image/jpeg') to specify image type.
2861 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
2865 def ImageFromStream(*args
, **kwargs
):
2867 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2869 Loads an image from an input stream, or any readable Python file-like
2872 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
2876 def ImageFromStreamMime(*args
, **kwargs
):
2878 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2880 Loads an image from an input stream, or any readable Python file-like
2881 object, specifying the image format with a MIME type string.
2883 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
2887 def EmptyImage(*args
, **kwargs
):
2889 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2891 Construct an empty image of a given size, optionally setting all
2894 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
2898 def ImageFromBitmap(*args
, **kwargs
):
2900 ImageFromBitmap(Bitmap bitmap) -> Image
2902 Construct an Image from a `wx.Bitmap`.
2904 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
2908 def ImageFromData(*args
, **kwargs
):
2910 ImageFromData(int width, int height, buffer data) -> Image
2912 Construct an Image from a buffer of RGB bytes. Accepts either a
2913 string or a buffer object holding the data and the length of the data
2914 must be width*height*3.
2916 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
2920 def ImageFromDataWithAlpha(*args
, **kwargs
):
2922 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2924 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2925 Accepts either a string or a buffer object holding the data and the
2926 length of the data must be width*height*3 bytes, and the length of the
2927 alpha data must be width*height bytes.
2929 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
2933 def Image_CanRead(*args
, **kwargs
):
2935 Image_CanRead(String filename) -> bool
2937 Returns True if the image handlers can read this file.
2939 return _core_
.Image_CanRead(*args
, **kwargs
)
2941 def Image_GetImageCount(*args
, **kwargs
):
2943 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2945 If the image file contains more than one image and the image handler
2946 is capable of retrieving these individually, this function will return
2947 the number of available images.
2949 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2951 def Image_CanReadStream(*args
, **kwargs
):
2953 Image_CanReadStream(InputStream stream) -> bool
2955 Returns True if the image handlers can read an image file from the
2956 data currently on the input stream, or a readable Python file-like
2959 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2961 def Image_AddHandler(*args
, **kwargs
):
2962 """Image_AddHandler(ImageHandler handler)"""
2963 return _core_
.Image_AddHandler(*args
, **kwargs
)
2965 def Image_InsertHandler(*args
, **kwargs
):
2966 """Image_InsertHandler(ImageHandler handler)"""
2967 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2969 def Image_RemoveHandler(*args
, **kwargs
):
2970 """Image_RemoveHandler(String name) -> bool"""
2971 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2973 def Image_GetImageExtWildcard(*args
, **kwargs
):
2975 Image_GetImageExtWildcard() -> String
2977 Iterates all registered wxImageHandler objects, and returns a string
2978 containing file extension masks suitable for passing to file open/save
2981 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2983 def InitAllImageHandlers():
2985 The former functionality of InitAllImageHanders is now done internal to
2986 the _core_ extension module and so this function has become a simple NOP.
2990 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
2991 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
2992 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
2993 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
2994 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
2995 BMP_24BPP
= _core_
.BMP_24BPP
2996 BMP_8BPP
= _core_
.BMP_8BPP
2997 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
2998 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
2999 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3000 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3001 BMP_4BPP
= _core_
.BMP_4BPP
3002 BMP_1BPP
= _core_
.BMP_1BPP
3003 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3004 class BMPHandler(ImageHandler
):
3005 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3007 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3008 def __init__(self
, *args
, **kwargs
):
3010 __init__(self) -> BMPHandler
3012 A `wx.ImageHandler` for \*.bmp bitmap files.
3014 newobj
= _core_
.new_BMPHandler(*args
, **kwargs
)
3015 self
.this
= newobj
.this
3019 class BMPHandlerPtr(BMPHandler
):
3020 def __init__(self
, this
):
3022 if not hasattr(self
,"thisown"): self
.thisown
= 0
3023 self
.__class
__ = BMPHandler
3024 _core_
.BMPHandler_swigregister(BMPHandlerPtr
)
3025 NullImage
= cvar
.NullImage
3026 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3027 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3028 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3029 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3030 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3031 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3032 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3033 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3034 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3035 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3036 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3037 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3038 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3039 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3040 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3042 class ICOHandler(BMPHandler
):
3043 """A `wx.ImageHandler` for \*.ico icon files."""
3045 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3046 def __init__(self
, *args
, **kwargs
):
3048 __init__(self) -> ICOHandler
3050 A `wx.ImageHandler` for \*.ico icon files.
3052 newobj
= _core_
.new_ICOHandler(*args
, **kwargs
)
3053 self
.this
= newobj
.this
3057 class ICOHandlerPtr(ICOHandler
):
3058 def __init__(self
, this
):
3060 if not hasattr(self
,"thisown"): self
.thisown
= 0
3061 self
.__class
__ = ICOHandler
3062 _core_
.ICOHandler_swigregister(ICOHandlerPtr
)
3064 class CURHandler(ICOHandler
):
3065 """A `wx.ImageHandler` for \*.cur cursor files."""
3067 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3068 def __init__(self
, *args
, **kwargs
):
3070 __init__(self) -> CURHandler
3072 A `wx.ImageHandler` for \*.cur cursor files.
3074 newobj
= _core_
.new_CURHandler(*args
, **kwargs
)
3075 self
.this
= newobj
.this
3079 class CURHandlerPtr(CURHandler
):
3080 def __init__(self
, this
):
3082 if not hasattr(self
,"thisown"): self
.thisown
= 0
3083 self
.__class
__ = CURHandler
3084 _core_
.CURHandler_swigregister(CURHandlerPtr
)
3086 class ANIHandler(CURHandler
):
3087 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3089 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3090 def __init__(self
, *args
, **kwargs
):
3092 __init__(self) -> ANIHandler
3094 A `wx.ImageHandler` for \*.ani animated cursor files.
3096 newobj
= _core_
.new_ANIHandler(*args
, **kwargs
)
3097 self
.this
= newobj
.this
3101 class ANIHandlerPtr(ANIHandler
):
3102 def __init__(self
, this
):
3104 if not hasattr(self
,"thisown"): self
.thisown
= 0
3105 self
.__class
__ = ANIHandler
3106 _core_
.ANIHandler_swigregister(ANIHandlerPtr
)
3108 class PNGHandler(ImageHandler
):
3109 """A `wx.ImageHandler` for PNG image files."""
3111 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3112 def __init__(self
, *args
, **kwargs
):
3114 __init__(self) -> PNGHandler
3116 A `wx.ImageHandler` for PNG image files.
3118 newobj
= _core_
.new_PNGHandler(*args
, **kwargs
)
3119 self
.this
= newobj
.this
3123 class PNGHandlerPtr(PNGHandler
):
3124 def __init__(self
, this
):
3126 if not hasattr(self
,"thisown"): self
.thisown
= 0
3127 self
.__class
__ = PNGHandler
3128 _core_
.PNGHandler_swigregister(PNGHandlerPtr
)
3130 class GIFHandler(ImageHandler
):
3131 """A `wx.ImageHandler` for GIF image files."""
3133 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3134 def __init__(self
, *args
, **kwargs
):
3136 __init__(self) -> GIFHandler
3138 A `wx.ImageHandler` for GIF image files.
3140 newobj
= _core_
.new_GIFHandler(*args
, **kwargs
)
3141 self
.this
= newobj
.this
3145 class GIFHandlerPtr(GIFHandler
):
3146 def __init__(self
, this
):
3148 if not hasattr(self
,"thisown"): self
.thisown
= 0
3149 self
.__class
__ = GIFHandler
3150 _core_
.GIFHandler_swigregister(GIFHandlerPtr
)
3152 class PCXHandler(ImageHandler
):
3153 """A `wx.ImageHandler` for PCX imager files."""
3155 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3156 def __init__(self
, *args
, **kwargs
):
3158 __init__(self) -> PCXHandler
3160 A `wx.ImageHandler` for PCX imager files.
3162 newobj
= _core_
.new_PCXHandler(*args
, **kwargs
)
3163 self
.this
= newobj
.this
3167 class PCXHandlerPtr(PCXHandler
):
3168 def __init__(self
, this
):
3170 if not hasattr(self
,"thisown"): self
.thisown
= 0
3171 self
.__class
__ = PCXHandler
3172 _core_
.PCXHandler_swigregister(PCXHandlerPtr
)
3174 class JPEGHandler(ImageHandler
):
3175 """A `wx.ImageHandler` for JPEG/JPG image files."""
3177 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3178 def __init__(self
, *args
, **kwargs
):
3180 __init__(self) -> JPEGHandler
3182 A `wx.ImageHandler` for JPEG/JPG image files.
3184 newobj
= _core_
.new_JPEGHandler(*args
, **kwargs
)
3185 self
.this
= newobj
.this
3189 class JPEGHandlerPtr(JPEGHandler
):
3190 def __init__(self
, this
):
3192 if not hasattr(self
,"thisown"): self
.thisown
= 0
3193 self
.__class
__ = JPEGHandler
3194 _core_
.JPEGHandler_swigregister(JPEGHandlerPtr
)
3196 class PNMHandler(ImageHandler
):
3197 """A `wx.ImageHandler` for PNM image files."""
3199 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3200 def __init__(self
, *args
, **kwargs
):
3202 __init__(self) -> PNMHandler
3204 A `wx.ImageHandler` for PNM image files.
3206 newobj
= _core_
.new_PNMHandler(*args
, **kwargs
)
3207 self
.this
= newobj
.this
3211 class PNMHandlerPtr(PNMHandler
):
3212 def __init__(self
, this
):
3214 if not hasattr(self
,"thisown"): self
.thisown
= 0
3215 self
.__class
__ = PNMHandler
3216 _core_
.PNMHandler_swigregister(PNMHandlerPtr
)
3218 class XPMHandler(ImageHandler
):
3219 """A `wx.ImageHandler` for XPM image."""
3221 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3222 def __init__(self
, *args
, **kwargs
):
3224 __init__(self) -> XPMHandler
3226 A `wx.ImageHandler` for XPM image.
3228 newobj
= _core_
.new_XPMHandler(*args
, **kwargs
)
3229 self
.this
= newobj
.this
3233 class XPMHandlerPtr(XPMHandler
):
3234 def __init__(self
, this
):
3236 if not hasattr(self
,"thisown"): self
.thisown
= 0
3237 self
.__class
__ = XPMHandler
3238 _core_
.XPMHandler_swigregister(XPMHandlerPtr
)
3240 class TIFFHandler(ImageHandler
):
3241 """A `wx.ImageHandler` for TIFF image files."""
3243 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3244 def __init__(self
, *args
, **kwargs
):
3246 __init__(self) -> TIFFHandler
3248 A `wx.ImageHandler` for TIFF image files.
3250 newobj
= _core_
.new_TIFFHandler(*args
, **kwargs
)
3251 self
.this
= newobj
.this
3255 class TIFFHandlerPtr(TIFFHandler
):
3256 def __init__(self
, this
):
3258 if not hasattr(self
,"thisown"): self
.thisown
= 0
3259 self
.__class
__ = TIFFHandler
3260 _core_
.TIFFHandler_swigregister(TIFFHandlerPtr
)
3262 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3263 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3264 class Quantize(object):
3265 """Performs quantization, or colour reduction, on a wxImage."""
3266 def __init__(self
): raise RuntimeError, "No constructor defined"
3268 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3269 def Quantize(*args
, **kwargs
):
3271 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3273 Reduce the colours in the source image and put the result into the
3274 destination image, setting the palette in the destination if
3275 needed. Both images may be the same, to overwrite the source image.
3277 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3279 Quantize
= staticmethod(Quantize
)
3281 class QuantizePtr(Quantize
):
3282 def __init__(self
, this
):
3284 if not hasattr(self
,"thisown"): self
.thisown
= 0
3285 self
.__class
__ = Quantize
3286 _core_
.Quantize_swigregister(QuantizePtr
)
3288 def Quantize_Quantize(*args
, **kwargs
):
3290 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3292 Reduce the colours in the source image and put the result into the
3293 destination image, setting the palette in the destination if
3294 needed. Both images may be the same, to overwrite the source image.
3296 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3298 #---------------------------------------------------------------------------
3300 class EvtHandler(Object
):
3301 """Proxy of C++ EvtHandler class"""
3303 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3304 def __init__(self
, *args
, **kwargs
):
3305 """__init__(self) -> EvtHandler"""
3306 newobj
= _core_
.new_EvtHandler(*args
, **kwargs
)
3307 self
.this
= newobj
.this
3310 def GetNextHandler(*args
, **kwargs
):
3311 """GetNextHandler(self) -> EvtHandler"""
3312 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3314 def GetPreviousHandler(*args
, **kwargs
):
3315 """GetPreviousHandler(self) -> EvtHandler"""
3316 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3318 def SetNextHandler(*args
, **kwargs
):
3319 """SetNextHandler(self, EvtHandler handler)"""
3320 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3322 def SetPreviousHandler(*args
, **kwargs
):
3323 """SetPreviousHandler(self, EvtHandler handler)"""
3324 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3326 def GetEvtHandlerEnabled(*args
, **kwargs
):
3327 """GetEvtHandlerEnabled(self) -> bool"""
3328 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3330 def SetEvtHandlerEnabled(*args
, **kwargs
):
3331 """SetEvtHandlerEnabled(self, bool enabled)"""
3332 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3334 def ProcessEvent(*args
, **kwargs
):
3335 """ProcessEvent(self, Event event) -> bool"""
3336 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3338 def AddPendingEvent(*args
, **kwargs
):
3339 """AddPendingEvent(self, Event event)"""
3340 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3342 def ProcessPendingEvents(*args
, **kwargs
):
3343 """ProcessPendingEvents(self)"""
3344 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3346 def Connect(*args
, **kwargs
):
3347 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3348 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3350 def Disconnect(*args
, **kwargs
):
3351 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
3352 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3354 def _setOORInfo(*args
, **kwargs
):
3355 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3356 return _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3358 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3360 Bind an event to an event handler.
3362 :param event: One of the EVT_* objects that specifies the
3363 type of event to bind,
3365 :param handler: A callable object to be invoked when the
3366 event is delivered to self. Pass None to
3367 disconnect an event handler.
3369 :param source: Sometimes the event originates from a
3370 different window than self, but you still
3371 want to catch it in self. (For example, a
3372 button event delivered to a frame.) By
3373 passing the source of the event, the event
3374 handling system is able to differentiate
3375 between the same event type from different
3378 :param id: Used to spcify the event source by ID instead
3381 :param id2: Used when it is desirable to bind a handler
3382 to a range of IDs, such as with EVT_MENU_RANGE.
3384 if source
is not None:
3386 event
.Bind(self
, id, id2
, handler
)
3388 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3390 Disconencts the event handler binding for event from self.
3391 Returns True if successful.
3393 if source
is not None:
3395 return event
.Unbind(self
, id, id2
)
3398 class EvtHandlerPtr(EvtHandler
):
3399 def __init__(self
, this
):
3401 if not hasattr(self
,"thisown"): self
.thisown
= 0
3402 self
.__class
__ = EvtHandler
3403 _core_
.EvtHandler_swigregister(EvtHandlerPtr
)
3405 #---------------------------------------------------------------------------
3407 class PyEventBinder(object):
3409 Instances of this class are used to bind specific events to event
3412 def __init__(self
, evtType
, expectedIDs
=0):
3413 if expectedIDs
not in [0, 1, 2]:
3414 raise ValueError, "Invalid number of expectedIDs"
3415 self
.expectedIDs
= expectedIDs
3417 if type(evtType
) == list or type(evtType
) == tuple:
3418 self
.evtType
= evtType
3420 self
.evtType
= [evtType
]
3423 def Bind(self
, target
, id1
, id2
, function
):
3424 """Bind this set of event types to target."""
3425 for et
in self
.evtType
:
3426 target
.Connect(id1
, id2
, et
, function
)
3429 def Unbind(self
, target
, id1
, id2
):
3430 """Remove an event binding."""
3432 for et
in self
.evtType
:
3433 success
+= target
.Disconnect(id1
, id2
, et
)
3437 def __call__(self
, *args
):
3439 For backwards compatibility with the old EVT_* functions.
3440 Should be called with either (window, func), (window, ID,
3441 func) or (window, ID1, ID2, func) parameters depending on the
3444 assert len(args
) == 2 + self
.expectedIDs
3448 if self
.expectedIDs
== 0:
3450 elif self
.expectedIDs
== 1:
3453 elif self
.expectedIDs
== 2:
3458 raise ValueError, "Unexpected number of IDs"
3460 self
.Bind(target
, id1
, id2
, func
)
3463 # These two are square pegs that don't fit the PyEventBinder hole...
3464 def EVT_COMMAND(win
, id, cmd
, func
):
3465 win
.Connect(id, -1, cmd
, func
)
3466 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3467 win
.Connect(id1
, id2
, cmd
, func
)
3470 #---------------------------------------------------------------------------
3472 #---------------------------------------------------------------------------
3474 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3475 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3477 def NewEventType(*args
, **kwargs
):
3478 """NewEventType() -> wxEventType"""
3479 return _core_
.NewEventType(*args
, **kwargs
)
3480 wxEVT_NULL
= _core_
.wxEVT_NULL
3481 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3482 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3483 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3484 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3485 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3486 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3487 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3488 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3489 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3490 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3491 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3492 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3493 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3494 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3495 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3496 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3497 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3498 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3499 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3500 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3501 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3502 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3503 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3504 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3505 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3506 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3507 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3508 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3509 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3510 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3511 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3512 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3513 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3514 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3515 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3516 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3517 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3518 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3519 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3520 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3521 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3522 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3523 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3524 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3525 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3526 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3527 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3528 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3529 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3530 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3531 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3532 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3533 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3534 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3535 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3536 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3537 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3538 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3539 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3540 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3541 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3542 wxEVT_SCROLL_ENDSCROLL
= _core_
.wxEVT_SCROLL_ENDSCROLL
3543 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3544 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3545 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3546 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3547 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3548 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3549 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3550 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3551 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3552 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3553 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3554 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3555 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3556 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3557 wxEVT_POWER
= _core_
.wxEVT_POWER
3558 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3559 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3560 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3561 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3562 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3563 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3564 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3565 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3566 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3567 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3568 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3569 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3570 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3571 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3572 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3573 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3574 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3575 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3576 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3577 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3578 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
3579 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
3580 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
3581 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
3582 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
3583 wxEVT_IDLE
= _core_
.wxEVT_IDLE
3584 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
3585 wxEVT_SIZING
= _core_
.wxEVT_SIZING
3586 wxEVT_MOVING
= _core_
.wxEVT_MOVING
3587 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
3588 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
3589 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
3590 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
3591 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
3592 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
3593 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
3594 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
3596 # Create some event binders
3597 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
3598 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
3599 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
3600 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
3601 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
3602 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3603 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3604 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
3605 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
3606 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
3607 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
3608 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
3609 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
3610 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
3611 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
3612 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
3613 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
3614 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
3615 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
3616 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
3617 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
3618 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
3619 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
3620 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
3621 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
3622 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3623 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3624 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
3625 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
3626 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
3627 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
3628 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
3629 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
3630 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
3631 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
3632 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
3633 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
3634 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
3635 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
3636 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
3637 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
3639 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
3640 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
3641 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
3642 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
3643 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
3644 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
3645 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
3646 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
3647 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
3648 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
3649 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
3650 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
3651 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
3653 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
3661 wxEVT_MIDDLE_DCLICK
,
3669 # Scrolling from wxWindow (sent to wxScrolledWindow)
3670 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
3671 wxEVT_SCROLLWIN_BOTTOM
,
3672 wxEVT_SCROLLWIN_LINEUP
,
3673 wxEVT_SCROLLWIN_LINEDOWN
,
3674 wxEVT_SCROLLWIN_PAGEUP
,
3675 wxEVT_SCROLLWIN_PAGEDOWN
,
3676 wxEVT_SCROLLWIN_THUMBTRACK
,
3677 wxEVT_SCROLLWIN_THUMBRELEASE
,
3680 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
3681 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
3682 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
3683 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
3684 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
3685 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
3686 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
3687 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
3689 # Scrolling from wx.Slider and wx.ScrollBar
3690 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3691 wxEVT_SCROLL_BOTTOM
,
3692 wxEVT_SCROLL_LINEUP
,
3693 wxEVT_SCROLL_LINEDOWN
,
3694 wxEVT_SCROLL_PAGEUP
,
3695 wxEVT_SCROLL_PAGEDOWN
,
3696 wxEVT_SCROLL_THUMBTRACK
,
3697 wxEVT_SCROLL_THUMBRELEASE
,
3698 wxEVT_SCROLL_ENDSCROLL
,
3701 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
3702 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
3703 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
3704 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
3705 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
3706 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
3707 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
3708 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
3709 EVT_SCROLL_ENDSCROLL
= wx
.PyEventBinder( wxEVT_SCROLL_ENDSCROLL
)
3711 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3712 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3713 wxEVT_SCROLL_BOTTOM
,
3714 wxEVT_SCROLL_LINEUP
,
3715 wxEVT_SCROLL_LINEDOWN
,
3716 wxEVT_SCROLL_PAGEUP
,
3717 wxEVT_SCROLL_PAGEDOWN
,
3718 wxEVT_SCROLL_THUMBTRACK
,
3719 wxEVT_SCROLL_THUMBRELEASE
,
3720 wxEVT_SCROLL_ENDSCROLL
,
3723 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
3724 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
3725 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
3726 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
3727 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
3728 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
3729 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
3730 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
3731 EVT_COMMAND_SCROLL_ENDSCROLL
= wx
.PyEventBinder( wxEVT_SCROLL_ENDSCROLL
, 1)
3733 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
3734 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
3735 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
3736 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
3737 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
3738 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
3739 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
3740 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
3741 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
3742 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
3744 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
3745 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
3746 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
3747 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
3748 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
3749 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
3750 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
3751 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
3752 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
3755 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
3756 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
3757 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
3758 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
3759 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
3760 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
3761 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
3763 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
3765 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
3766 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
3768 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
3772 #---------------------------------------------------------------------------
3774 class Event(Object
):
3776 An event is a structure holding information about an event passed to a
3777 callback or member function. wx.Event is an abstract base class for
3780 def __init__(self
): raise RuntimeError, "No constructor defined"
3782 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3783 def __del__(self
, destroy
=_core_
.delete_Event
):
3786 if self
.thisown
: destroy(self
)
3789 def SetEventType(*args
, **kwargs
):
3791 SetEventType(self, wxEventType typ)
3793 Sets the specific type of the event.
3795 return _core_
.Event_SetEventType(*args
, **kwargs
)
3797 def GetEventType(*args
, **kwargs
):
3799 GetEventType(self) -> wxEventType
3801 Returns the identifier of the given event type, such as
3802 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3804 return _core_
.Event_GetEventType(*args
, **kwargs
)
3806 def GetEventObject(*args
, **kwargs
):
3808 GetEventObject(self) -> Object
3810 Returns the object (usually a window) associated with the event, if
3813 return _core_
.Event_GetEventObject(*args
, **kwargs
)
3815 def SetEventObject(*args
, **kwargs
):
3817 SetEventObject(self, Object obj)
3819 Sets the originating object, or in other words, obj is normally the
3820 object that is sending the event.
3822 return _core_
.Event_SetEventObject(*args
, **kwargs
)
3824 def GetTimestamp(*args
, **kwargs
):
3825 """GetTimestamp(self) -> long"""
3826 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
3828 def SetTimestamp(*args
, **kwargs
):
3829 """SetTimestamp(self, long ts=0)"""
3830 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
3832 def GetId(*args
, **kwargs
):
3836 Returns the identifier associated with this event, such as a button
3839 return _core_
.Event_GetId(*args
, **kwargs
)
3841 def SetId(*args
, **kwargs
):
3845 Set's the ID for the event. This is usually the ID of the window that
3846 is sending the event, but it can also be a command id from a menu
3849 return _core_
.Event_SetId(*args
, **kwargs
)
3851 def IsCommandEvent(*args
, **kwargs
):
3853 IsCommandEvent(self) -> bool
3855 Returns true if the event is or is derived from `wx.CommandEvent` else
3856 it returns false. Note: Exists only for optimization purposes.
3858 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
3860 def Skip(*args
, **kwargs
):
3862 Skip(self, bool skip=True)
3864 Called by an event handler, it controls whether additional event
3865 handlers bound to this event will be called after the current event
3866 handler returns. Skip(false) (the default setting) will prevent
3867 additional event handlers from being called and control will be
3868 returned to the sender of the event immediately after the current
3869 handler has finished. Skip(True) will cause the event processing
3870 system to continue searching for a handler function for this event.
3873 return _core_
.Event_Skip(*args
, **kwargs
)
3875 def GetSkipped(*args
, **kwargs
):
3877 GetSkipped(self) -> bool
3879 Returns true if the event handler should be skipped, false otherwise.
3882 return _core_
.Event_GetSkipped(*args
, **kwargs
)
3884 def ShouldPropagate(*args
, **kwargs
):
3886 ShouldPropagate(self) -> bool
3888 Test if this event should be propagated to the parent window or not,
3889 i.e. if the propagation level is currently greater than 0.
3891 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
3893 def StopPropagation(*args
, **kwargs
):
3895 StopPropagation(self) -> int
3897 Stop the event from propagating to its parent window. Returns the old
3898 propagation level value which may be later passed to
3899 `ResumePropagation` to allow propagating the event again.
3901 return _core_
.Event_StopPropagation(*args
, **kwargs
)
3903 def ResumePropagation(*args
, **kwargs
):
3905 ResumePropagation(self, int propagationLevel)
3907 Resume the event propagation by restoring the propagation level. (For
3908 example, you can use the value returned by an earlier call to
3912 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
3914 def Clone(*args
, **kwargs
):
3915 """Clone(self) -> Event"""
3916 return _core_
.Event_Clone(*args
, **kwargs
)
3919 class EventPtr(Event
):
3920 def __init__(self
, this
):
3922 if not hasattr(self
,"thisown"): self
.thisown
= 0
3923 self
.__class
__ = Event
3924 _core_
.Event_swigregister(EventPtr
)
3926 #---------------------------------------------------------------------------
3928 class PropagationDisabler(object):
3930 Helper class to temporarily change an event not to propagate. Simply
3931 create an instance of this class and then whe it is destroyed the
3932 propogation of the event will be restored.
3935 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3936 def __init__(self
, *args
, **kwargs
):
3938 __init__(self, Event event) -> PropagationDisabler
3940 Helper class to temporarily change an event not to propagate. Simply
3941 create an instance of this class and then whe it is destroyed the
3942 propogation of the event will be restored.
3944 newobj
= _core_
.new_PropagationDisabler(*args
, **kwargs
)
3945 self
.this
= newobj
.this
3948 def __del__(self
, destroy
=_core_
.delete_PropagationDisabler
):
3951 if self
.thisown
: destroy(self
)
3955 class PropagationDisablerPtr(PropagationDisabler
):
3956 def __init__(self
, this
):
3958 if not hasattr(self
,"thisown"): self
.thisown
= 0
3959 self
.__class
__ = PropagationDisabler
3960 _core_
.PropagationDisabler_swigregister(PropagationDisablerPtr
)
3962 class PropagateOnce(object):
3964 A helper class that will temporarily lower propagation level of an
3965 event. Simply create an instance of this class and then whe it is
3966 destroyed the propogation of the event will be restored.
3969 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3970 def __init__(self
, *args
, **kwargs
):
3972 __init__(self, Event event) -> PropagateOnce
3974 A helper class that will temporarily lower propagation level of an
3975 event. Simply create an instance of this class and then whe it is
3976 destroyed the propogation of the event will be restored.
3978 newobj
= _core_
.new_PropagateOnce(*args
, **kwargs
)
3979 self
.this
= newobj
.this
3982 def __del__(self
, destroy
=_core_
.delete_PropagateOnce
):
3985 if self
.thisown
: destroy(self
)
3989 class PropagateOncePtr(PropagateOnce
):
3990 def __init__(self
, this
):
3992 if not hasattr(self
,"thisown"): self
.thisown
= 0
3993 self
.__class
__ = PropagateOnce
3994 _core_
.PropagateOnce_swigregister(PropagateOncePtr
)
3996 #---------------------------------------------------------------------------
3998 class CommandEvent(Event
):
4000 This event class contains information about command events, which
4001 originate from a variety of simple controls, as well as menus and
4005 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4006 def __init__(self
, *args
, **kwargs
):
4008 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4010 This event class contains information about command events, which
4011 originate from a variety of simple controls, as well as menus and
4014 newobj
= _core_
.new_CommandEvent(*args
, **kwargs
)
4015 self
.this
= newobj
.this
4018 def GetSelection(*args
, **kwargs
):
4020 GetSelection(self) -> int
4022 Returns item index for a listbox or choice selection event (not valid
4025 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
4027 def SetString(*args
, **kwargs
):
4028 """SetString(self, String s)"""
4029 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
4031 def GetString(*args
, **kwargs
):
4033 GetString(self) -> String
4035 Returns item string for a listbox or choice selection event (not valid
4038 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
4040 def IsChecked(*args
, **kwargs
):
4042 IsChecked(self) -> bool
4044 This method can be used with checkbox and menu events: for the
4045 checkboxes, the method returns true for a selection event and false
4046 for a deselection one. For the menu events, this method indicates if
4047 the menu item just has become checked or unchecked (and thus only
4048 makes sense for checkable menu items).
4050 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
4053 def IsSelection(*args
, **kwargs
):
4055 IsSelection(self) -> bool
4057 For a listbox or similar event, returns true if it is a selection,
4058 false if it is a deselection.
4060 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4062 def SetExtraLong(*args
, **kwargs
):
4063 """SetExtraLong(self, long extraLong)"""
4064 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4066 def GetExtraLong(*args
, **kwargs
):
4068 GetExtraLong(self) -> long
4070 Returns extra information dependant on the event objects type. If the
4071 event comes from a listbox selection, it is a boolean determining
4072 whether the event was a selection (true) or a deselection (false). A
4073 listbox deselection only occurs for multiple-selection boxes, and in
4074 this case the index and string values are indeterminate and the
4075 listbox must be examined by the application.
4077 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4079 def SetInt(*args
, **kwargs
):
4080 """SetInt(self, int i)"""
4081 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4083 def GetInt(*args
, **kwargs
):
4085 GetInt(self) -> long
4087 Returns the integer identifier corresponding to a listbox, choice or
4088 radiobox selection (only if the event was a selection, not a
4089 deselection), or a boolean value representing the value of a checkbox.
4091 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4093 def Clone(*args
, **kwargs
):
4094 """Clone(self) -> Event"""
4095 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4098 class CommandEventPtr(CommandEvent
):
4099 def __init__(self
, this
):
4101 if not hasattr(self
,"thisown"): self
.thisown
= 0
4102 self
.__class
__ = CommandEvent
4103 _core_
.CommandEvent_swigregister(CommandEventPtr
)
4105 #---------------------------------------------------------------------------
4107 class NotifyEvent(CommandEvent
):
4109 An instance of this class (or one of its derived classes) is sent from
4110 a control when the control's state is being changed and the control
4111 allows that change to be prevented from happening. The event handler
4112 can call `Veto` or `Allow` to tell the control what to do.
4115 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4116 def __init__(self
, *args
, **kwargs
):
4118 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4120 An instance of this class (or one of its derived classes) is sent from
4121 a control when the control's state is being changed and the control
4122 allows that change to be prevented from happening. The event handler
4123 can call `Veto` or `Allow` to tell the control what to do.
4125 newobj
= _core_
.new_NotifyEvent(*args
, **kwargs
)
4126 self
.this
= newobj
.this
4129 def Veto(*args
, **kwargs
):
4133 Prevents the change announced by this event from happening.
4135 It is in general a good idea to notify the user about the reasons for
4136 vetoing the change because otherwise the applications behaviour (which
4137 just refuses to do what the user wants) might be quite surprising.
4139 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4141 def Allow(*args
, **kwargs
):
4145 This is the opposite of `Veto`: it explicitly allows the event to be
4146 processed. For most events it is not necessary to call this method as
4147 the events are allowed anyhow but some are forbidden by default (this
4148 will be mentioned in the corresponding event description).
4150 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4152 def IsAllowed(*args
, **kwargs
):
4154 IsAllowed(self) -> bool
4156 Returns true if the change is allowed (`Veto` hasn't been called) or
4157 false otherwise (if it was).
4159 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4162 class NotifyEventPtr(NotifyEvent
):
4163 def __init__(self
, this
):
4165 if not hasattr(self
,"thisown"): self
.thisown
= 0
4166 self
.__class
__ = NotifyEvent
4167 _core_
.NotifyEvent_swigregister(NotifyEventPtr
)
4169 #---------------------------------------------------------------------------
4171 class ScrollEvent(CommandEvent
):
4173 A scroll event holds information about events sent from stand-alone
4174 scrollbars and sliders. Note that scrolled windows do not send
4175 instnaces of this event class, but send the `wx.ScrollWinEvent`
4179 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4180 def __init__(self
, *args
, **kwargs
):
4182 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4183 int orient=0) -> ScrollEvent
4185 newobj
= _core_
.new_ScrollEvent(*args
, **kwargs
)
4186 self
.this
= newobj
.this
4189 def GetOrientation(*args
, **kwargs
):
4191 GetOrientation(self) -> int
4193 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4196 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4198 def GetPosition(*args
, **kwargs
):
4200 GetPosition(self) -> int
4202 Returns the position of the scrollbar.
4204 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4206 def SetOrientation(*args
, **kwargs
):
4207 """SetOrientation(self, int orient)"""
4208 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4210 def SetPosition(*args
, **kwargs
):
4211 """SetPosition(self, int pos)"""
4212 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4215 class ScrollEventPtr(ScrollEvent
):
4216 def __init__(self
, this
):
4218 if not hasattr(self
,"thisown"): self
.thisown
= 0
4219 self
.__class
__ = ScrollEvent
4220 _core_
.ScrollEvent_swigregister(ScrollEventPtr
)
4222 #---------------------------------------------------------------------------
4224 class ScrollWinEvent(Event
):
4226 A wx.ScrollWinEvent holds information about scrolling and is sent from
4230 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4231 def __init__(self
, *args
, **kwargs
):
4233 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4235 A wx.ScrollWinEvent holds information about scrolling and is sent from
4238 newobj
= _core_
.new_ScrollWinEvent(*args
, **kwargs
)
4239 self
.this
= newobj
.this
4242 def GetOrientation(*args
, **kwargs
):
4244 GetOrientation(self) -> int
4246 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4249 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4251 def GetPosition(*args
, **kwargs
):
4253 GetPosition(self) -> int
4255 Returns the position of the scrollbar for the thumb track and release
4256 events. Note that this field can't be used for the other events, you
4257 need to query the window itself for the current position in that case.
4259 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4261 def SetOrientation(*args
, **kwargs
):
4262 """SetOrientation(self, int orient)"""
4263 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4265 def SetPosition(*args
, **kwargs
):
4266 """SetPosition(self, int pos)"""
4267 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4270 class ScrollWinEventPtr(ScrollWinEvent
):
4271 def __init__(self
, this
):
4273 if not hasattr(self
,"thisown"): self
.thisown
= 0
4274 self
.__class
__ = ScrollWinEvent
4275 _core_
.ScrollWinEvent_swigregister(ScrollWinEventPtr
)
4277 #---------------------------------------------------------------------------
4279 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4280 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4281 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4282 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4283 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4284 class MouseEvent(Event
):
4286 This event class contains information about the events generated by
4287 the mouse: they include mouse buttons press and release events and
4290 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4291 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4292 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4293 a middle button so a portable application should avoid relying on the
4296 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4297 the former returns true when the event corresponds to the left mouse
4298 button click while the latter returns true if the left mouse button is
4299 currently being pressed. For example, when the user is dragging the
4300 mouse you can use `LeftIsDown` to test whether the left mouse button
4301 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4302 `LeftIsDown` will also return true in wxWidgets whatever the
4303 underlying GUI behaviour is (which is platform-dependent). The same
4304 applies, of course, to other mouse buttons as well.
4307 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4308 def __init__(self
, *args
, **kwargs
):
4310 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4312 Constructs a wx.MouseEvent. Valid event types are:
4314 * wxEVT_ENTER_WINDOW
4315 * wxEVT_LEAVE_WINDOW
4321 * wxEVT_MIDDLE_DCLICK
4324 * wxEVT_RIGHT_DCLICK
4328 newobj
= _core_
.new_MouseEvent(*args
, **kwargs
)
4329 self
.this
= newobj
.this
4332 def IsButton(*args
, **kwargs
):
4334 IsButton(self) -> bool
4336 Returns true if the event was a mouse button event (not necessarily a
4337 button down event - that may be tested using `ButtonDown`).
4339 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4341 def ButtonDown(*args
, **kwargs
):
4343 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4345 If the argument is omitted, this returns true if the event was any
4346 mouse button down event. Otherwise the argument specifies which
4347 button-down event shold be checked for (see `Button` for the possible
4350 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4352 def ButtonDClick(*args
, **kwargs
):
4354 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4356 If the argument is omitted, this returns true if the event was any
4357 mouse double click event. Otherwise the argument specifies which
4358 double click event to check for (see `Button` for the possible
4361 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4363 def ButtonUp(*args
, **kwargs
):
4365 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4367 If the argument is omitted, this returns true if the event was any
4368 mouse button up event. Otherwise the argument specifies which button
4369 up event to check for (see `Button` for the possible values).
4371 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4373 def Button(*args
, **kwargs
):
4375 Button(self, int button) -> bool
4377 Returns true if the identified mouse button is changing state. Valid
4378 values of button are:
4380 ==================== =====================================
4381 wx.MOUSE_BTN_LEFT check if left button was pressed
4382 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4383 wx.MOUSE_BTN_RIGHT check if right button was pressed
4384 wx.MOUSE_BTN_ANY check if any button was pressed
4385 ==================== =====================================
4388 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4390 def ButtonIsDown(*args
, **kwargs
):
4391 """ButtonIsDown(self, int but) -> bool"""
4392 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4394 def GetButton(*args
, **kwargs
):
4396 GetButton(self) -> int
4398 Returns the mouse button which generated this event or
4399 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4400 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4401 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4402 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4403 right buttons respectively.
4405 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4407 def ControlDown(*args
, **kwargs
):
4409 ControlDown(self) -> bool
4411 Returns true if the control key was down at the time of the event.
4413 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4415 def MetaDown(*args
, **kwargs
):
4417 MetaDown(self) -> bool
4419 Returns true if the Meta key was down at the time of the event.
4421 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4423 def AltDown(*args
, **kwargs
):
4425 AltDown(self) -> bool
4427 Returns true if the Alt key was down at the time of the event.
4429 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4431 def ShiftDown(*args
, **kwargs
):
4433 ShiftDown(self) -> bool
4435 Returns true if the Shift key was down at the time of the event.
4437 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4439 def CmdDown(*args
, **kwargs
):
4441 CmdDown(self) -> bool
4443 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4444 platforms but the special "Apple" (a.k.a as "Command") key on
4445 Macs. It often makes sense to use it instead of, say, `ControlDown`
4446 because Cmd key is used for the same thing under Mac as Ctrl
4447 elsewhere. The Ctrl key still exists, it's just not used for this
4448 purpose. So for non-Mac platforms this is the same as `ControlDown`
4449 and Macs this is the same as `MetaDown`.
4451 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4453 def LeftDown(*args
, **kwargs
):
4455 LeftDown(self) -> bool
4457 Returns true if the left mouse button state changed to down.
4459 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4461 def MiddleDown(*args
, **kwargs
):
4463 MiddleDown(self) -> bool
4465 Returns true if the middle mouse button state changed to down.
4467 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4469 def RightDown(*args
, **kwargs
):
4471 RightDown(self) -> bool
4473 Returns true if the right mouse button state changed to down.
4475 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4477 def LeftUp(*args
, **kwargs
):
4479 LeftUp(self) -> bool
4481 Returns true if the left mouse button state changed to up.
4483 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4485 def MiddleUp(*args
, **kwargs
):
4487 MiddleUp(self) -> bool
4489 Returns true if the middle mouse button state changed to up.
4491 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4493 def RightUp(*args
, **kwargs
):
4495 RightUp(self) -> bool
4497 Returns true if the right mouse button state changed to up.
4499 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4501 def LeftDClick(*args
, **kwargs
):
4503 LeftDClick(self) -> bool
4505 Returns true if the event was a left button double click.
4507 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4509 def MiddleDClick(*args
, **kwargs
):
4511 MiddleDClick(self) -> bool
4513 Returns true if the event was a middle button double click.
4515 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4517 def RightDClick(*args
, **kwargs
):
4519 RightDClick(self) -> bool
4521 Returns true if the event was a right button double click.
4523 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4525 def LeftIsDown(*args
, **kwargs
):
4527 LeftIsDown(self) -> bool
4529 Returns true if the left mouse button is currently down, independent
4530 of the current event type.
4532 Please notice that it is not the same as LeftDown which returns true
4533 if the left mouse button was just pressed. Rather, it describes the
4534 state of the mouse button before the event happened.
4536 This event is usually used in the mouse event handlers which process
4537 "move mouse" messages to determine whether the user is (still)
4540 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4542 def MiddleIsDown(*args
, **kwargs
):
4544 MiddleIsDown(self) -> bool
4546 Returns true if the middle mouse button is currently down, independent
4547 of the current event type.
4549 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4551 def RightIsDown(*args
, **kwargs
):
4553 RightIsDown(self) -> bool
4555 Returns true if the right mouse button is currently down, independent
4556 of the current event type.
4558 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4560 def Dragging(*args
, **kwargs
):
4562 Dragging(self) -> bool
4564 Returns true if this was a dragging event (motion while a button is
4567 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4569 def Moving(*args
, **kwargs
):
4571 Moving(self) -> bool
4573 Returns true if this was a motion event and no mouse buttons were
4574 pressed. If any mouse button is held pressed, then this method returns
4575 false and Dragging returns true.
4577 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4579 def Entering(*args
, **kwargs
):
4581 Entering(self) -> bool
4583 Returns true if the mouse was entering the window.
4585 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4587 def Leaving(*args
, **kwargs
):
4589 Leaving(self) -> bool
4591 Returns true if the mouse was leaving the window.
4593 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4595 def GetPosition(*args
, **kwargs
):
4597 GetPosition(self) -> Point
4599 Returns the pixel position of the mouse in window coordinates when the
4602 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4604 def GetPositionTuple(*args
, **kwargs
):
4606 GetPositionTuple() -> (x,y)
4608 Returns the pixel position of the mouse in window coordinates when the
4611 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
4613 def GetLogicalPosition(*args
, **kwargs
):
4615 GetLogicalPosition(self, DC dc) -> Point
4617 Returns the logical mouse position in pixels (i.e. translated
4618 according to the translation set for the DC, which usually indicates
4619 that the window has been scrolled).
4621 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
4623 def GetX(*args
, **kwargs
):
4627 Returns X coordinate of the physical mouse event position.
4629 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
4631 def GetY(*args
, **kwargs
):
4635 Returns Y coordinate of the physical mouse event position.
4637 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
4639 def GetWheelRotation(*args
, **kwargs
):
4641 GetWheelRotation(self) -> int
4643 Get wheel rotation, positive or negative indicates direction of
4644 rotation. Current devices all send an event when rotation is equal to
4645 +/-WheelDelta, but this allows for finer resolution devices to be
4646 created in the future. Because of this you shouldn't assume that one
4647 event is equal to 1 line or whatever, but you should be able to either
4648 do partial line scrolling or wait until +/-WheelDelta rotation values
4649 have been accumulated before scrolling.
4651 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
4653 def GetWheelDelta(*args
, **kwargs
):
4655 GetWheelDelta(self) -> int
4657 Get wheel delta, normally 120. This is the threshold for action to be
4658 taken, and one such action (for example, scrolling one increment)
4659 should occur for each delta.
4661 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
4663 def GetLinesPerAction(*args
, **kwargs
):
4665 GetLinesPerAction(self) -> int
4667 Returns the configured number of lines (or whatever) to be scrolled
4668 per wheel action. Defaults to three.
4670 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
4672 def IsPageScroll(*args
, **kwargs
):
4674 IsPageScroll(self) -> bool
4676 Returns true if the system has been setup to do page scrolling with
4677 the mouse wheel instead of line scrolling.
4679 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
4681 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
4682 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
4683 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
4684 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
4685 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
4686 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
4687 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
4688 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
4689 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
4690 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
4691 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
4692 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
4694 class MouseEventPtr(MouseEvent
):
4695 def __init__(self
, this
):
4697 if not hasattr(self
,"thisown"): self
.thisown
= 0
4698 self
.__class
__ = MouseEvent
4699 _core_
.MouseEvent_swigregister(MouseEventPtr
)
4701 #---------------------------------------------------------------------------
4703 class SetCursorEvent(Event
):
4705 A SetCursorEvent is generated when the mouse cursor is about to be set
4706 as a result of mouse motion. This event gives the application the
4707 chance to perform specific mouse cursor processing based on the
4708 current position of the mouse within the window. Use the `SetCursor`
4709 method to specify the cursor you want to be displayed.
4712 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4713 def __init__(self
, *args
, **kwargs
):
4715 __init__(self, int x=0, int y=0) -> SetCursorEvent
4717 Construct a new `wx.SetCursorEvent`.
4719 newobj
= _core_
.new_SetCursorEvent(*args
, **kwargs
)
4720 self
.this
= newobj
.this
4723 def GetX(*args
, **kwargs
):
4727 Returns the X coordinate of the mouse in client coordinates.
4729 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
4731 def GetY(*args
, **kwargs
):
4735 Returns the Y coordinate of the mouse in client coordinates.
4737 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
4739 def SetCursor(*args
, **kwargs
):
4741 SetCursor(self, Cursor cursor)
4743 Sets the cursor associated with this event.
4745 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
4747 def GetCursor(*args
, **kwargs
):
4749 GetCursor(self) -> Cursor
4751 Returns a reference to the cursor specified by this event.
4753 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
4755 def HasCursor(*args
, **kwargs
):
4757 HasCursor(self) -> bool
4759 Returns true if the cursor specified by this event is a valid cursor.
4761 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
4764 class SetCursorEventPtr(SetCursorEvent
):
4765 def __init__(self
, this
):
4767 if not hasattr(self
,"thisown"): self
.thisown
= 0
4768 self
.__class
__ = SetCursorEvent
4769 _core_
.SetCursorEvent_swigregister(SetCursorEventPtr
)
4771 #---------------------------------------------------------------------------
4773 class KeyEvent(Event
):
4775 This event class contains information about keypress and character
4776 events. These events are only sent to the widget that currently has
4779 Notice that there are three different kinds of keyboard events in
4780 wxWidgets: key down and up events and char events. The difference
4781 between the first two is clear - the first corresponds to a key press
4782 and the second to a key release - otherwise they are identical. Just
4783 note that if the key is maintained in a pressed state you will
4784 typically get a lot of (automatically generated) down events but only
4785 one up so it is wrong to assume that there is one up event
4786 corresponding to each down one.
4788 Both key events provide untranslated key codes while the char event
4789 carries the translated one. The untranslated code for alphanumeric
4790 keys is always an upper case value. For the other keys it is one of
4791 WXK_XXX values from the keycodes table. The translated key is, in
4792 general, the character the user expects to appear as the result of the
4793 key combination when typing the text into a text entry zone, for
4796 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4797 and the standard US keyboard): when the 'A' key is pressed, the key
4798 down event key code is equal to ASCII A == 65. But the char event key
4799 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4800 'A' keys simultaneously , the key code in key down event will still be
4801 just 'A' while the char event key code parameter will now be 'A' as
4804 Although in this simple case it is clear that the correct key code
4805 could be found in the key down event handler by checking the value
4806 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4807 as for non alphanumeric keys or non-US keyboard layouts the
4808 translation is keyboard-layout dependent and can only be done properly
4809 by the system itself.
4811 Another kind of translation is done when the control key is pressed:
4812 for example, for CTRL-A key press the key down event still carries the
4813 same key code 'A' as usual but the char event will have key code of 1,
4814 the ASCII value of this key combination.
4816 You may discover how the other keys on your system behave
4817 interactively by running the KeyEvents sample in the wxPython demo and
4818 pressing some keys while the blue box at the top has the keyboard
4821 **Note**: If a key down event is caught and the event handler does not
4822 call event.Skip() then the coresponding char event will not
4823 happen. This is by design and enables the programs that handle both
4824 types of events to be a bit simpler.
4826 **Note for Windows programmers**: The key and char events in wxWidgets
4827 are similar to but slightly different from Windows WM_KEYDOWN and
4828 WM_CHAR events. In particular, Alt-x combination will generate a char
4829 event in wxWidgets (unless it is used as an accelerator).
4831 **Tip**: be sure to call event.Skip() for events that you don't
4832 process in key event function, otherwise menu shortcuts may cease to
4837 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4838 def __init__(self
, *args
, **kwargs
):
4840 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
4842 Construct a new `wx.KeyEvent`. Valid event types are:
4845 newobj
= _core_
.new_KeyEvent(*args
, **kwargs
)
4846 self
.this
= newobj
.this
4849 def ControlDown(*args
, **kwargs
):
4851 ControlDown(self) -> bool
4853 Returns ``True`` if the Control key was down at the time of the event.
4855 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
4857 def MetaDown(*args
, **kwargs
):
4859 MetaDown(self) -> bool
4861 Returns ``True`` if the Meta key was down at the time of the event.
4863 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
4865 def AltDown(*args
, **kwargs
):
4867 AltDown(self) -> bool
4869 Returns ``True`` if the Alt key was down at the time of the event.
4871 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
4873 def ShiftDown(*args
, **kwargs
):
4875 ShiftDown(self) -> bool
4877 Returns ``True`` if the Shift key was down at the time of the event.
4879 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
4881 def CmdDown(*args
, **kwargs
):
4883 CmdDown(self) -> bool
4885 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4886 platforms but the special "Apple" (a.k.a as "Command") key on
4887 Macs. It makes often sense to use it instead of, say, `ControlDown`
4888 because Cmd key is used for the same thing under Mac as Ctrl
4889 elsewhere. The Ctrl still exists, it's just not used for this
4890 purpose. So for non-Mac platforms this is the same as `ControlDown`
4891 and Macs this is the same as `MetaDown`.
4893 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
4895 def HasModifiers(*args
, **kwargs
):
4897 HasModifiers(self) -> bool
4899 Returns true if either CTRL or ALT keys was down at the time of the
4900 key event. Note that this function does not take into account neither
4901 SHIFT nor META key states (the reason for ignoring the latter is that
4902 it is common for NUMLOCK key to be configured as META under X but the
4903 key presses even while NUMLOCK is on should be still processed
4906 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
4908 def GetKeyCode(*args
, **kwargs
):
4910 GetKeyCode(self) -> int
4912 Returns the virtual key code. ASCII events return normal ASCII values,
4913 while non-ASCII events return values such as WXK_LEFT for the left
4914 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4917 Note that in Unicode build, the returned value is meaningful only if
4918 the user entered a character that can be represented in current
4919 locale's default charset. You can obtain the corresponding Unicode
4920 character using `GetUnicodeKey`.
4922 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
4924 KeyCode
= GetKeyCode
4925 def GetUnicodeKey(*args
, **kwargs
):
4927 GetUnicodeKey(self) -> int
4929 Returns the Unicode character corresponding to this key event. This
4930 function is only meaningfule in a Unicode build of wxPython.
4932 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
4934 GetUniChar
= GetUnicodeKey
4935 def GetRawKeyCode(*args
, **kwargs
):
4937 GetRawKeyCode(self) -> unsigned int
4939 Returns the raw key code for this event. This is a platform-dependent
4940 scan code which should only be used in advanced
4941 applications. Currently the raw key codes are not supported by all
4944 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
4946 def GetRawKeyFlags(*args
, **kwargs
):
4948 GetRawKeyFlags(self) -> unsigned int
4950 Returns the low level key flags for this event. The flags are
4951 platform-dependent and should only be used in advanced applications.
4952 Currently the raw key flags are not supported by all ports.
4954 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
4956 def GetPosition(*args
, **kwargs
):
4958 GetPosition(self) -> Point
4960 Find the position of the event, if applicable.
4962 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
4964 def GetPositionTuple(*args
, **kwargs
):
4966 GetPositionTuple() -> (x,y)
4968 Find the position of the event, if applicable.
4970 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
4972 def GetX(*args
, **kwargs
):
4976 Returns the X position (in client coordinates) of the event, if
4979 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
4981 def GetY(*args
, **kwargs
):
4985 Returns the Y position (in client coordinates) of the event, if
4988 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
4990 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
4991 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
4992 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
4993 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
4994 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
4995 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
4996 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
4997 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
4998 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
4999 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
5001 class KeyEventPtr(KeyEvent
):
5002 def __init__(self
, this
):
5004 if not hasattr(self
,"thisown"): self
.thisown
= 0
5005 self
.__class
__ = KeyEvent
5006 _core_
.KeyEvent_swigregister(KeyEventPtr
)
5008 #---------------------------------------------------------------------------
5010 class SizeEvent(Event
):
5012 A size event holds information about size change events. The EVT_SIZE
5013 handler function will be called when the window it is bound to has
5016 Note that the size passed is of the whole window: call
5017 `wx.Window.GetClientSize` for the area which may be used by the
5020 When a window is resized, usually only a small part of the window is
5021 damaged and and that area is all that is in the update region for the
5022 next paint event. However, if your drawing depends on the size of the
5023 window, you may need to clear the DC explicitly and repaint the whole
5024 window. In which case, you may need to call `wx.Window.Refresh` to
5025 invalidate the entire window.
5029 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5030 def __init__(self
, *args
, **kwargs
):
5032 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5034 Construct a new ``wx.SizeEvent``.
5036 newobj
= _core_
.new_SizeEvent(*args
, **kwargs
)
5037 self
.this
= newobj
.this
5040 def GetSize(*args
, **kwargs
):
5042 GetSize(self) -> Size
5044 Returns the entire size of the window generating the size change
5047 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
5049 def GetRect(*args
, **kwargs
):
5050 """GetRect(self) -> Rect"""
5051 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
5053 def SetRect(*args
, **kwargs
):
5054 """SetRect(self, Rect rect)"""
5055 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
5057 def SetSize(*args
, **kwargs
):
5058 """SetSize(self, Size size)"""
5059 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
5061 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
5062 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
5064 class SizeEventPtr(SizeEvent
):
5065 def __init__(self
, this
):
5067 if not hasattr(self
,"thisown"): self
.thisown
= 0
5068 self
.__class
__ = SizeEvent
5069 _core_
.SizeEvent_swigregister(SizeEventPtr
)
5071 #---------------------------------------------------------------------------
5073 class MoveEvent(Event
):
5075 This event object is sent for EVT_MOVE event bindings when a window is
5076 moved to a new position.
5079 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5080 def __init__(self
, *args
, **kwargs
):
5082 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5086 newobj
= _core_
.new_MoveEvent(*args
, **kwargs
)
5087 self
.this
= newobj
.this
5090 def GetPosition(*args
, **kwargs
):
5092 GetPosition(self) -> Point
5094 Returns the position of the window generating the move change event.
5096 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
5098 def GetRect(*args
, **kwargs
):
5099 """GetRect(self) -> Rect"""
5100 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
5102 def SetRect(*args
, **kwargs
):
5103 """SetRect(self, Rect rect)"""
5104 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
5106 def SetPosition(*args
, **kwargs
):
5107 """SetPosition(self, Point pos)"""
5108 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
5110 m_pos
= property(GetPosition
, SetPosition
)
5111 m_rect
= property(GetRect
, SetRect
)
5114 class MoveEventPtr(MoveEvent
):
5115 def __init__(self
, this
):
5117 if not hasattr(self
,"thisown"): self
.thisown
= 0
5118 self
.__class
__ = MoveEvent
5119 _core_
.MoveEvent_swigregister(MoveEventPtr
)
5121 #---------------------------------------------------------------------------
5123 class PaintEvent(Event
):
5125 A paint event is sent when a window's contents needs to be repainted.
5126 Note that in an EVT_PAINT handler the application must *always* create
5127 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5128 Windows assumes that the window has not been painted yet and will send
5129 the event again, causing endless refreshes.
5131 You can optimize painting by retrieving the rectangles that have been
5132 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5133 and only repainting these rectangles. The rectangles are in terms of
5134 the client area, and are unscrolled, so you will need to do some
5135 calculations using the current view position to obtain logical,
5140 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5141 def __init__(self
, *args
, **kwargs
):
5142 """__init__(self, int Id=0) -> PaintEvent"""
5143 newobj
= _core_
.new_PaintEvent(*args
, **kwargs
)
5144 self
.this
= newobj
.this
5148 class PaintEventPtr(PaintEvent
):
5149 def __init__(self
, this
):
5151 if not hasattr(self
,"thisown"): self
.thisown
= 0
5152 self
.__class
__ = PaintEvent
5153 _core_
.PaintEvent_swigregister(PaintEventPtr
)
5155 class NcPaintEvent(Event
):
5156 """Proxy of C++ NcPaintEvent class"""
5158 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5159 def __init__(self
, *args
, **kwargs
):
5160 """__init__(self, int winid=0) -> NcPaintEvent"""
5161 newobj
= _core_
.new_NcPaintEvent(*args
, **kwargs
)
5162 self
.this
= newobj
.this
5166 class NcPaintEventPtr(NcPaintEvent
):
5167 def __init__(self
, this
):
5169 if not hasattr(self
,"thisown"): self
.thisown
= 0
5170 self
.__class
__ = NcPaintEvent
5171 _core_
.NcPaintEvent_swigregister(NcPaintEventPtr
)
5173 #---------------------------------------------------------------------------
5175 class EraseEvent(Event
):
5177 An erase event is sent whenever the background of a window needs to be
5178 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5179 binder. On some platforms, such as GTK+, this event is simulated
5180 (simply generated just before the paint event) and may cause flicker.
5182 To paint a custom background use the `GetDC` method and use the returned
5183 device context if it is not ``None``, otherwise create a temporary
5184 `wx.ClientDC` and draw on that.
5188 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5189 def __init__(self
, *args
, **kwargs
):
5191 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5195 newobj
= _core_
.new_EraseEvent(*args
, **kwargs
)
5196 self
.this
= newobj
.this
5199 def GetDC(*args
, **kwargs
):
5203 Returns the device context the event handler should draw upon. If
5204 ``None`` is returned then create a temporary `wx.ClientDC` and use
5207 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5210 class EraseEventPtr(EraseEvent
):
5211 def __init__(self
, this
):
5213 if not hasattr(self
,"thisown"): self
.thisown
= 0
5214 self
.__class
__ = EraseEvent
5215 _core_
.EraseEvent_swigregister(EraseEventPtr
)
5217 #---------------------------------------------------------------------------
5219 class FocusEvent(Event
):
5221 A focus event is sent when a window's focus changes. The window losing
5222 focus receives an EVT_KILL_FOCUS event while the window gaining it
5223 gets an EVT_SET_FOCUS event.
5225 Notice that the set focus event happens both when the user gives focus
5226 to the window (whether using the mouse or keyboard) and when it is
5227 done from the program itself using `wx.Window.SetFocus`.
5231 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5232 def __init__(self
, *args
, **kwargs
):
5234 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5238 newobj
= _core_
.new_FocusEvent(*args
, **kwargs
)
5239 self
.this
= newobj
.this
5242 def GetWindow(*args
, **kwargs
):
5244 GetWindow(self) -> Window
5246 Returns the other window associated with this event, that is the
5247 window which had the focus before for the EVT_SET_FOCUS event and the
5248 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5250 Warning: the window returned may be None!
5252 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5254 def SetWindow(*args
, **kwargs
):
5255 """SetWindow(self, Window win)"""
5256 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5259 class FocusEventPtr(FocusEvent
):
5260 def __init__(self
, this
):
5262 if not hasattr(self
,"thisown"): self
.thisown
= 0
5263 self
.__class
__ = FocusEvent
5264 _core_
.FocusEvent_swigregister(FocusEventPtr
)
5266 #---------------------------------------------------------------------------
5268 class ChildFocusEvent(CommandEvent
):
5270 wx.ChildFocusEvent notifies the parent that a child has received the
5271 focus. Unlike `wx.FocusEvent` it is propagated up the window
5275 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5276 def __init__(self
, *args
, **kwargs
):
5278 __init__(self, Window win=None) -> ChildFocusEvent
5282 newobj
= _core_
.new_ChildFocusEvent(*args
, **kwargs
)
5283 self
.this
= newobj
.this
5286 def GetWindow(*args
, **kwargs
):
5288 GetWindow(self) -> Window
5290 The window which has just received the focus.
5292 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5295 class ChildFocusEventPtr(ChildFocusEvent
):
5296 def __init__(self
, this
):
5298 if not hasattr(self
,"thisown"): self
.thisown
= 0
5299 self
.__class
__ = ChildFocusEvent
5300 _core_
.ChildFocusEvent_swigregister(ChildFocusEventPtr
)
5302 #---------------------------------------------------------------------------
5304 class ActivateEvent(Event
):
5306 An activate event is sent when a top-level window or the entire
5307 application is being activated or deactivated.
5309 A top-level window (a dialog or frame) receives an activate event when
5310 is being activated or deactivated. This is indicated visually by the
5311 title bar changing colour, and a subwindow gaining the keyboard focus.
5312 An application is activated or deactivated when one of its frames
5313 becomes activated, or a frame becomes inactivate resulting in all
5314 application frames being inactive.
5316 Please note that usually you should call event.Skip() in your handlers
5317 for these events so the default handlers will still be called, as not
5318 doing so can result in strange effects.
5322 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5323 def __init__(self
, *args
, **kwargs
):
5325 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5329 newobj
= _core_
.new_ActivateEvent(*args
, **kwargs
)
5330 self
.this
= newobj
.this
5333 def GetActive(*args
, **kwargs
):
5335 GetActive(self) -> bool
5337 Returns true if the application or window is being activated, false
5340 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5343 class ActivateEventPtr(ActivateEvent
):
5344 def __init__(self
, this
):
5346 if not hasattr(self
,"thisown"): self
.thisown
= 0
5347 self
.__class
__ = ActivateEvent
5348 _core_
.ActivateEvent_swigregister(ActivateEventPtr
)
5350 #---------------------------------------------------------------------------
5352 class InitDialogEvent(Event
):
5354 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5355 any window when `wx.Window.InitDialog` is called. Handlers for this
5356 event can transfer data to the window, or anything else that should be
5357 done before the user begins editing the form. The default handler
5358 calls `wx.Window.TransferDataToWindow`.
5361 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5362 def __init__(self
, *args
, **kwargs
):
5364 __init__(self, int Id=0) -> InitDialogEvent
5368 newobj
= _core_
.new_InitDialogEvent(*args
, **kwargs
)
5369 self
.this
= newobj
.this
5373 class InitDialogEventPtr(InitDialogEvent
):
5374 def __init__(self
, this
):
5376 if not hasattr(self
,"thisown"): self
.thisown
= 0
5377 self
.__class
__ = InitDialogEvent
5378 _core_
.InitDialogEvent_swigregister(InitDialogEventPtr
)
5380 #---------------------------------------------------------------------------
5382 class MenuEvent(Event
):
5384 This class is used for a variety of menu-related events. Note that
5385 these do not include menu command events, which are handled by sending
5386 `wx.CommandEvent` objects.
5388 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5389 text in the first field of the status bar.
5392 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5393 def __init__(self
, *args
, **kwargs
):
5395 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5399 newobj
= _core_
.new_MenuEvent(*args
, **kwargs
)
5400 self
.this
= newobj
.this
5403 def GetMenuId(*args
, **kwargs
):
5405 GetMenuId(self) -> int
5407 Returns the menu identifier associated with the event. This method
5408 should be only used with the HIGHLIGHT events.
5410 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5412 def IsPopup(*args
, **kwargs
):
5414 IsPopup(self) -> bool
5416 Returns ``True`` if the menu which is being opened or closed is a
5417 popup menu, ``False`` if it is a normal one. This method should only
5418 be used with the OPEN and CLOSE events.
5420 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5422 def GetMenu(*args
, **kwargs
):
5424 GetMenu(self) -> Menu
5426 Returns the menu which is being opened or closed. This method should
5427 only be used with the OPEN and CLOSE events.
5429 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5432 class MenuEventPtr(MenuEvent
):
5433 def __init__(self
, this
):
5435 if not hasattr(self
,"thisown"): self
.thisown
= 0
5436 self
.__class
__ = MenuEvent
5437 _core_
.MenuEvent_swigregister(MenuEventPtr
)
5439 #---------------------------------------------------------------------------
5441 class CloseEvent(Event
):
5443 This event class contains information about window and session close
5446 The handler function for EVT_CLOSE is called when the user has tried
5447 to close a a frame or dialog box using the window manager controls or
5448 the system menu. It can also be invoked by the application itself
5449 programmatically, for example by calling the `wx.Window.Close`
5452 You should check whether the application is forcing the deletion of
5453 the window using `CanVeto`. If it returns ``False``, you must destroy
5454 the window using `wx.Window.Destroy`. If the return value is ``True``,
5455 it is up to you whether you respond by destroying the window or not.
5456 For example you may wish to display a message dialog prompting to save
5457 files or to cancel the close.
5459 If you don't destroy the window, you should call `Veto` to let the
5460 calling code know that you did not destroy the window. This allows the
5461 `wx.Window.Close` function to return ``True`` or ``False`` depending
5462 on whether the close instruction was honored or not.
5465 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5466 def __init__(self
, *args
, **kwargs
):
5468 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5472 newobj
= _core_
.new_CloseEvent(*args
, **kwargs
)
5473 self
.this
= newobj
.this
5476 def SetLoggingOff(*args
, **kwargs
):
5478 SetLoggingOff(self, bool logOff)
5480 Sets the 'logging off' flag.
5482 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5484 def GetLoggingOff(*args
, **kwargs
):
5486 GetLoggingOff(self) -> bool
5488 Returns true if the user is logging off.
5490 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5492 def Veto(*args
, **kwargs
):
5494 Veto(self, bool veto=True)
5496 Call this from your event handler to veto a system shutdown or to
5497 signal to the calling application that a window close did not happen.
5499 You can only veto a shutdown or close if `CanVeto` returns true.
5501 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5503 def GetVeto(*args
, **kwargs
):
5504 """GetVeto(self) -> bool"""
5505 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5507 def SetCanVeto(*args
, **kwargs
):
5509 SetCanVeto(self, bool canVeto)
5511 Sets the 'can veto' flag.
5513 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5515 def CanVeto(*args
, **kwargs
):
5517 CanVeto(self) -> bool
5519 Returns true if you can veto a system shutdown or a window close
5520 event. Vetoing a window close event is not possible if the calling
5521 code wishes to force the application to exit, and so this function
5522 must be called to check this.
5524 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5527 class CloseEventPtr(CloseEvent
):
5528 def __init__(self
, this
):
5530 if not hasattr(self
,"thisown"): self
.thisown
= 0
5531 self
.__class
__ = CloseEvent
5532 _core_
.CloseEvent_swigregister(CloseEventPtr
)
5534 #---------------------------------------------------------------------------
5536 class ShowEvent(Event
):
5537 """An EVT_SHOW event is sent when a window is shown or hidden."""
5539 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5540 def __init__(self
, *args
, **kwargs
):
5542 __init__(self, int winid=0, bool show=False) -> ShowEvent
5544 An EVT_SHOW event is sent when a window is shown or hidden.
5546 newobj
= _core_
.new_ShowEvent(*args
, **kwargs
)
5547 self
.this
= newobj
.this
5550 def SetShow(*args
, **kwargs
):
5551 """SetShow(self, bool show)"""
5552 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5554 def GetShow(*args
, **kwargs
):
5555 """GetShow(self) -> bool"""
5556 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5559 class ShowEventPtr(ShowEvent
):
5560 def __init__(self
, this
):
5562 if not hasattr(self
,"thisown"): self
.thisown
= 0
5563 self
.__class
__ = ShowEvent
5564 _core_
.ShowEvent_swigregister(ShowEventPtr
)
5566 #---------------------------------------------------------------------------
5568 class IconizeEvent(Event
):
5570 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5574 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5575 def __init__(self
, *args
, **kwargs
):
5577 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5579 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5582 newobj
= _core_
.new_IconizeEvent(*args
, **kwargs
)
5583 self
.this
= newobj
.this
5586 def Iconized(*args
, **kwargs
):
5588 Iconized(self) -> bool
5590 Returns ``True`` if the frame has been iconized, ``False`` if it has
5593 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5596 class IconizeEventPtr(IconizeEvent
):
5597 def __init__(self
, this
):
5599 if not hasattr(self
,"thisown"): self
.thisown
= 0
5600 self
.__class
__ = IconizeEvent
5601 _core_
.IconizeEvent_swigregister(IconizeEventPtr
)
5603 #---------------------------------------------------------------------------
5605 class MaximizeEvent(Event
):
5606 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5608 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5609 def __init__(self
, *args
, **kwargs
):
5611 __init__(self, int id=0) -> MaximizeEvent
5613 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5615 newobj
= _core_
.new_MaximizeEvent(*args
, **kwargs
)
5616 self
.this
= newobj
.this
5620 class MaximizeEventPtr(MaximizeEvent
):
5621 def __init__(self
, this
):
5623 if not hasattr(self
,"thisown"): self
.thisown
= 0
5624 self
.__class
__ = MaximizeEvent
5625 _core_
.MaximizeEvent_swigregister(MaximizeEventPtr
)
5627 #---------------------------------------------------------------------------
5629 class DropFilesEvent(Event
):
5631 This class is used for drop files events, that is, when files have
5632 been dropped onto the window. This functionality is only available
5633 under Windows. The window must have previously been enabled for
5634 dropping by calling `wx.Window.DragAcceptFiles`.
5636 Important note: this is a separate implementation to the more general
5637 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5638 implementation uses the older, Windows message-based approach of
5641 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5645 def __init__(self
): raise RuntimeError, "No constructor defined"
5647 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5648 def GetPosition(*args
, **kwargs
):
5650 GetPosition(self) -> Point
5652 Returns the position at which the files were dropped.
5654 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5656 def GetNumberOfFiles(*args
, **kwargs
):
5658 GetNumberOfFiles(self) -> int
5660 Returns the number of files dropped.
5662 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5664 def GetFiles(*args
, **kwargs
):
5666 GetFiles(self) -> PyObject
5668 Returns a list of the filenames that were dropped.
5670 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5673 class DropFilesEventPtr(DropFilesEvent
):
5674 def __init__(self
, this
):
5676 if not hasattr(self
,"thisown"): self
.thisown
= 0
5677 self
.__class
__ = DropFilesEvent
5678 _core_
.DropFilesEvent_swigregister(DropFilesEventPtr
)
5680 #---------------------------------------------------------------------------
5682 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5683 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5684 class UpdateUIEvent(CommandEvent
):
5686 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5687 wxWidgets to give an application the chance to update various user
5690 Without update UI events, an application has to work hard to
5691 check/uncheck, enable/disable, and set the text for elements such as
5692 menu items and toolbar buttons. The code for doing this has to be
5693 mixed up with the code that is invoked when an action is invoked for a
5694 menu item or button.
5696 With update UI events, you define an event handler to look at the
5697 state of the application and change UI elements accordingly. wxWidgets
5698 will call your handler functions in idle time, so you don't have to
5699 worry where to call this code. In addition to being a clearer and more
5700 declarative method, it also means you don't have to worry whether
5701 you're updating a toolbar or menubar identifier. The same handler can
5702 update a menu item and toolbar button, if the ID values are the same.
5704 Instead of directly manipulating the menu or button, you call
5705 functions in the event object, such as `Check`. wxWidgets will
5706 determine whether such a call has been made, and which UI element to
5709 These events will work for popup menus as well as menubars. Just
5710 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5711 any UI events for the window that owns the menu.
5713 If you find that the overhead of UI update processing is affecting
5714 your application, you can do one or both of the following:
5716 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5717 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5718 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5719 receive update events. No other windows will receive update
5722 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5723 value to set the delay between updates. You may need to call
5724 `wx.Window.UpdateWindowUI` at critical points, for example when
5725 a dialog is about to be shown, in case the user sees a slight
5726 delay before windows are updated.
5728 Note that although events are sent in idle time, defining a EVT_IDLE
5729 handler for a window does not affect this because the events are sent
5730 from an internal idle handler.
5732 wxWidgets tries to optimize update events on some platforms. On
5733 Windows and GTK+, events for menubar items are only sent when the menu
5734 is about to be shown, and not in idle time.
5738 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5739 def __init__(self
, *args
, **kwargs
):
5741 __init__(self, int commandId=0) -> UpdateUIEvent
5745 newobj
= _core_
.new_UpdateUIEvent(*args
, **kwargs
)
5746 self
.this
= newobj
.this
5749 def GetChecked(*args
, **kwargs
):
5751 GetChecked(self) -> bool
5753 Returns ``True`` if the UI element should be checked.
5755 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
5757 def GetEnabled(*args
, **kwargs
):
5759 GetEnabled(self) -> bool
5761 Returns ``True`` if the UI element should be enabled.
5763 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
5765 def GetText(*args
, **kwargs
):
5767 GetText(self) -> String
5769 Returns the text that should be set for the UI element.
5771 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
5773 def GetSetText(*args
, **kwargs
):
5775 GetSetText(self) -> bool
5777 Returns ``True`` if the application has called `SetText`. For
5778 wxWidgets internal use only.
5780 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
5782 def GetSetChecked(*args
, **kwargs
):
5784 GetSetChecked(self) -> bool
5786 Returns ``True`` if the application has called `Check`. For wxWidgets
5789 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
5791 def GetSetEnabled(*args
, **kwargs
):
5793 GetSetEnabled(self) -> bool
5795 Returns ``True`` if the application has called `Enable`. For wxWidgets
5798 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
5800 def Check(*args
, **kwargs
):
5802 Check(self, bool check)
5804 Check or uncheck the UI element.
5806 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
5808 def Enable(*args
, **kwargs
):
5810 Enable(self, bool enable)
5812 Enable or disable the UI element.
5814 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
5816 def SetText(*args
, **kwargs
):
5818 SetText(self, String text)
5820 Sets the text for this UI element.
5822 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
5824 def SetUpdateInterval(*args
, **kwargs
):
5826 SetUpdateInterval(long updateInterval)
5828 Sets the interval between updates in milliseconds. Set to -1 to
5829 disable updates, or to 0 to update as frequently as possible. The
5832 Use this to reduce the overhead of UI update events if your
5833 application has a lot of windows. If you set the value to -1 or
5834 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5835 at appropriate points in your application, such as when a dialog is
5838 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5840 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
5841 def GetUpdateInterval(*args
, **kwargs
):
5843 GetUpdateInterval() -> long
5845 Returns the current interval between updates in milliseconds. -1
5846 disables updates, 0 updates as frequently as possible.
5848 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5850 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
5851 def CanUpdate(*args
, **kwargs
):
5853 CanUpdate(Window win) -> bool
5855 Returns ``True`` if it is appropriate to update (send UI update events
5858 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5859 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5860 events were last sent in idle time, and the update interval, to
5861 determine whether events should be sent to this window now. By default
5862 this will always return true because the update mode is initially
5863 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5864 events will be sent as often as possible. You can reduce the frequency
5865 that events are sent by changing the mode and/or setting an update
5869 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5871 CanUpdate
= staticmethod(CanUpdate
)
5872 def ResetUpdateTime(*args
, **kwargs
):
5876 Used internally to reset the last-updated time to the current time. It
5877 is assumed that update events are normally sent in idle time, so this
5878 is called at the end of idle processing.
5880 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5882 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
5883 def SetMode(*args
, **kwargs
):
5887 Specify how wxWidgets will send update events: to all windows, or only
5888 to those which specify that they will process the events.
5890 The mode may be one of the following values:
5892 ============================= ==========================================
5893 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5894 is the default setting.
5895 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5896 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5898 ============================= ==========================================
5901 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5903 SetMode
= staticmethod(SetMode
)
5904 def GetMode(*args
, **kwargs
):
5908 Returns a value specifying how wxWidgets will send update events: to
5909 all windows, or only to those which specify that they will process the
5912 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5914 GetMode
= staticmethod(GetMode
)
5916 class UpdateUIEventPtr(UpdateUIEvent
):
5917 def __init__(self
, this
):
5919 if not hasattr(self
,"thisown"): self
.thisown
= 0
5920 self
.__class
__ = UpdateUIEvent
5921 _core_
.UpdateUIEvent_swigregister(UpdateUIEventPtr
)
5923 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
5925 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5927 Sets the interval between updates in milliseconds. Set to -1 to
5928 disable updates, or to 0 to update as frequently as possible. The
5931 Use this to reduce the overhead of UI update events if your
5932 application has a lot of windows. If you set the value to -1 or
5933 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5934 at appropriate points in your application, such as when a dialog is
5937 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5939 def UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
):
5941 UpdateUIEvent_GetUpdateInterval() -> long
5943 Returns the current interval between updates in milliseconds. -1
5944 disables updates, 0 updates as frequently as possible.
5946 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5948 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
5950 UpdateUIEvent_CanUpdate(Window win) -> bool
5952 Returns ``True`` if it is appropriate to update (send UI update events
5955 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5956 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5957 events were last sent in idle time, and the update interval, to
5958 determine whether events should be sent to this window now. By default
5959 this will always return true because the update mode is initially
5960 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5961 events will be sent as often as possible. You can reduce the frequency
5962 that events are sent by changing the mode and/or setting an update
5966 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5968 def UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
):
5970 UpdateUIEvent_ResetUpdateTime()
5972 Used internally to reset the last-updated time to the current time. It
5973 is assumed that update events are normally sent in idle time, so this
5974 is called at the end of idle processing.
5976 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5978 def UpdateUIEvent_SetMode(*args
, **kwargs
):
5980 UpdateUIEvent_SetMode(int mode)
5982 Specify how wxWidgets will send update events: to all windows, or only
5983 to those which specify that they will process the events.
5985 The mode may be one of the following values:
5987 ============================= ==========================================
5988 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5989 is the default setting.
5990 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5991 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5993 ============================= ==========================================
5996 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5998 def UpdateUIEvent_GetMode(*args
, **kwargs
):
6000 UpdateUIEvent_GetMode() -> int
6002 Returns a value specifying how wxWidgets will send update events: to
6003 all windows, or only to those which specify that they will process the
6006 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
6008 #---------------------------------------------------------------------------
6010 class SysColourChangedEvent(Event
):
6012 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6013 when the user changes the colour settings using the control
6014 panel. This is only applicable under Windows.
6016 The default event handler for this event propagates the event to child
6017 windows, since Windows only sends the events to top-level windows. If
6018 intercepting this event for a top-level window, remember to call
6019 `Skip` so the the base class handler will still be executed, or to
6020 pass the event on to the window's children explicitly.
6024 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6025 def __init__(self
, *args
, **kwargs
):
6027 __init__(self) -> SysColourChangedEvent
6031 newobj
= _core_
.new_SysColourChangedEvent(*args
, **kwargs
)
6032 self
.this
= newobj
.this
6036 class SysColourChangedEventPtr(SysColourChangedEvent
):
6037 def __init__(self
, this
):
6039 if not hasattr(self
,"thisown"): self
.thisown
= 0
6040 self
.__class
__ = SysColourChangedEvent
6041 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEventPtr
)
6043 #---------------------------------------------------------------------------
6045 class MouseCaptureChangedEvent(Event
):
6047 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6048 a window that loses its mouse capture. This is called even if
6049 `wx.Window.ReleaseMouse` was called by the application code. Handling
6050 this event allows an application to cater for unexpected capture
6051 releases which might otherwise confuse mouse handling code.
6053 This event is implemented under Windows only.
6056 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6057 def __init__(self
, *args
, **kwargs
):
6059 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6063 newobj
= _core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
)
6064 self
.this
= newobj
.this
6067 def GetCapturedWindow(*args
, **kwargs
):
6069 GetCapturedWindow(self) -> Window
6071 Returns the window that gained the capture, or ``None`` if it was a
6072 non-wxWidgets window.
6074 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
6077 class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent
):
6078 def __init__(self
, this
):
6080 if not hasattr(self
,"thisown"): self
.thisown
= 0
6081 self
.__class
__ = MouseCaptureChangedEvent
6082 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr
)
6084 #---------------------------------------------------------------------------
6086 class DisplayChangedEvent(Event
):
6088 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6089 resolution has changed.
6091 This event is implemented under Windows only.
6094 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6095 def __init__(self
, *args
, **kwargs
):
6096 """__init__(self) -> DisplayChangedEvent"""
6097 newobj
= _core_
.new_DisplayChangedEvent(*args
, **kwargs
)
6098 self
.this
= newobj
.this
6102 class DisplayChangedEventPtr(DisplayChangedEvent
):
6103 def __init__(self
, this
):
6105 if not hasattr(self
,"thisown"): self
.thisown
= 0
6106 self
.__class
__ = DisplayChangedEvent
6107 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEventPtr
)
6109 #---------------------------------------------------------------------------
6111 class PaletteChangedEvent(Event
):
6113 An EVT_PALETTE_CHANGED event is sent when the system palette has
6114 changed, thereby giving each window a chance to redo their own to
6117 This event is implemented under Windows only.
6120 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6121 def __init__(self
, *args
, **kwargs
):
6123 __init__(self, int id=0) -> PaletteChangedEvent
6125 An EVT_PALETTE_CHANGED event is sent when the system palette has
6126 changed, thereby giving each window a chance to redo their own to
6129 This event is implemented under Windows only.
6131 newobj
= _core_
.new_PaletteChangedEvent(*args
, **kwargs
)
6132 self
.this
= newobj
.this
6135 def SetChangedWindow(*args
, **kwargs
):
6136 """SetChangedWindow(self, Window win)"""
6137 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
6139 def GetChangedWindow(*args
, **kwargs
):
6140 """GetChangedWindow(self) -> Window"""
6141 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
6144 class PaletteChangedEventPtr(PaletteChangedEvent
):
6145 def __init__(self
, this
):
6147 if not hasattr(self
,"thisown"): self
.thisown
= 0
6148 self
.__class
__ = PaletteChangedEvent
6149 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEventPtr
)
6151 #---------------------------------------------------------------------------
6153 class QueryNewPaletteEvent(Event
):
6155 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6156 focus and should re-do its palette.
6158 This event is implemented under Windows only.
6161 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6162 def __init__(self
, *args
, **kwargs
):
6164 __init__(self, int winid=0) -> QueryNewPaletteEvent
6168 newobj
= _core_
.new_QueryNewPaletteEvent(*args
, **kwargs
)
6169 self
.this
= newobj
.this
6172 def SetPaletteRealized(*args
, **kwargs
):
6174 SetPaletteRealized(self, bool realized)
6176 App should set this if it changes the palette.
6178 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
6180 def GetPaletteRealized(*args
, **kwargs
):
6181 """GetPaletteRealized(self) -> bool"""
6182 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
6185 class QueryNewPaletteEventPtr(QueryNewPaletteEvent
):
6186 def __init__(self
, this
):
6188 if not hasattr(self
,"thisown"): self
.thisown
= 0
6189 self
.__class
__ = QueryNewPaletteEvent
6190 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr
)
6192 #---------------------------------------------------------------------------
6194 class NavigationKeyEvent(Event
):
6196 EVT_NAVIGATION_KEY events are used to control moving the focus between
6197 widgets, otherwise known as tab-traversal. You woudl normally not
6198 catch navigation events in applications as there are already
6199 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6200 it useful to send navigation events in certain situations to change
6201 the focus in certain ways, although it's probably easier to just call
6202 `wx.Window.Navigate`.
6205 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6206 def __init__(self
, *args
, **kwargs
):
6207 """__init__(self) -> NavigationKeyEvent"""
6208 newobj
= _core_
.new_NavigationKeyEvent(*args
, **kwargs
)
6209 self
.this
= newobj
.this
6212 def GetDirection(*args
, **kwargs
):
6214 GetDirection(self) -> bool
6216 Returns ``True`` if the direction is forward, ``False`` otherwise.
6218 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
6220 def SetDirection(*args
, **kwargs
):
6222 SetDirection(self, bool forward)
6224 Specify the direction that the navigation should take. Usually the
6225 difference between using Tab and Shift-Tab.
6227 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
6229 def IsWindowChange(*args
, **kwargs
):
6231 IsWindowChange(self) -> bool
6233 Returns ``True`` if window change is allowed.
6235 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
6237 def SetWindowChange(*args
, **kwargs
):
6239 SetWindowChange(self, bool ischange)
6241 Specify if the navigation should be able to change parent windows.
6242 For example, changing notebook pages, etc. This is usually implemented
6243 by using Control-Tab.
6245 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
6247 def IsFromTab(*args
, **kwargs
):
6249 IsFromTab(self) -> bool
6251 Returns ``True`` if the navigation event is originated from the Tab
6254 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
6256 def SetFromTab(*args
, **kwargs
):
6258 SetFromTab(self, bool bIs)
6260 Set to true under MSW if the event was generated using the tab key.
6261 This is required for proper navogation over radio buttons.
6263 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
6265 def SetFlags(*args
, **kwargs
):
6267 SetFlags(self, long flags)
6269 Set the navigation flags to a combination of the following:
6271 * wx.NavigationKeyEvent.IsBackward
6272 * wx.NavigationKeyEvent.IsForward
6273 * wx.NavigationKeyEvent.WinChange
6274 * wx.NavigationKeyEvent.FromTab
6277 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6279 def GetCurrentFocus(*args
, **kwargs
):
6281 GetCurrentFocus(self) -> Window
6283 Returns the child window which currenty has the focus. May be
6286 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6288 def SetCurrentFocus(*args
, **kwargs
):
6290 SetCurrentFocus(self, Window win)
6292 Set the window that has the focus.
6294 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6296 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6297 IsForward
= _core_
.NavigationKeyEvent_IsForward
6298 WinChange
= _core_
.NavigationKeyEvent_WinChange
6299 FromTab
= _core_
.NavigationKeyEvent_FromTab
6301 class NavigationKeyEventPtr(NavigationKeyEvent
):
6302 def __init__(self
, this
):
6304 if not hasattr(self
,"thisown"): self
.thisown
= 0
6305 self
.__class
__ = NavigationKeyEvent
6306 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEventPtr
)
6308 #---------------------------------------------------------------------------
6310 class WindowCreateEvent(CommandEvent
):
6312 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6313 underlying GUI object) exists.
6316 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6317 def __init__(self
, *args
, **kwargs
):
6319 __init__(self, Window win=None) -> WindowCreateEvent
6321 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6322 underlying GUI object) exists.
6324 newobj
= _core_
.new_WindowCreateEvent(*args
, **kwargs
)
6325 self
.this
= newobj
.this
6328 def GetWindow(*args
, **kwargs
):
6330 GetWindow(self) -> Window
6332 Returns the window that this event refers to.
6334 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6337 class WindowCreateEventPtr(WindowCreateEvent
):
6338 def __init__(self
, this
):
6340 if not hasattr(self
,"thisown"): self
.thisown
= 0
6341 self
.__class
__ = WindowCreateEvent
6342 _core_
.WindowCreateEvent_swigregister(WindowCreateEventPtr
)
6344 class WindowDestroyEvent(CommandEvent
):
6346 The EVT_WINDOW_DESTROY event is sent right before the window is
6350 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6351 def __init__(self
, *args
, **kwargs
):
6353 __init__(self, Window win=None) -> WindowDestroyEvent
6355 The EVT_WINDOW_DESTROY event is sent right before the window is
6358 newobj
= _core_
.new_WindowDestroyEvent(*args
, **kwargs
)
6359 self
.this
= newobj
.this
6362 def GetWindow(*args
, **kwargs
):
6364 GetWindow(self) -> Window
6366 Returns the window that this event refers to.
6368 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6371 class WindowDestroyEventPtr(WindowDestroyEvent
):
6372 def __init__(self
, this
):
6374 if not hasattr(self
,"thisown"): self
.thisown
= 0
6375 self
.__class
__ = WindowDestroyEvent
6376 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEventPtr
)
6378 #---------------------------------------------------------------------------
6380 class ContextMenuEvent(CommandEvent
):
6382 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6383 give the application a chance to show a context (popup) menu.
6386 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6387 def __init__(self
, *args
, **kwargs
):
6389 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6393 newobj
= _core_
.new_ContextMenuEvent(*args
, **kwargs
)
6394 self
.this
= newobj
.this
6397 def GetPosition(*args
, **kwargs
):
6399 GetPosition(self) -> Point
6401 Returns the position (in screen coordinants) at which the menu should
6404 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6406 def SetPosition(*args
, **kwargs
):
6408 SetPosition(self, Point pos)
6410 Sets the position at which the menu should be shown.
6412 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6415 class ContextMenuEventPtr(ContextMenuEvent
):
6416 def __init__(self
, this
):
6418 if not hasattr(self
,"thisown"): self
.thisown
= 0
6419 self
.__class
__ = ContextMenuEvent
6420 _core_
.ContextMenuEvent_swigregister(ContextMenuEventPtr
)
6422 #---------------------------------------------------------------------------
6424 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6425 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6426 class IdleEvent(Event
):
6428 This class is used for EVT_IDLE events, which are generated and sent
6429 when the application *becomes* idle. In other words, the when the
6430 event queue becomes empty then idle events are sent to all windows (by
6431 default) and as long as none of them call `RequestMore` then there are
6432 no more idle events until after the system event queue has some normal
6433 events and then becomes empty again.
6435 By default, idle events are sent to all windows. If this is causing a
6436 significant overhead in your application, you can call
6437 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6438 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6439 which should receive idle events. Then idle events will only be sent
6440 to those windows and not to any others.
6443 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6444 def __init__(self
, *args
, **kwargs
):
6446 __init__(self) -> IdleEvent
6450 newobj
= _core_
.new_IdleEvent(*args
, **kwargs
)
6451 self
.this
= newobj
.this
6454 def RequestMore(*args
, **kwargs
):
6456 RequestMore(self, bool needMore=True)
6458 Tells wxWidgets that more processing is required. This function can be
6459 called by an EVT_IDLE handler for a window to indicate that the
6460 application should forward the EVT_IDLE event once more to the
6461 application windows. If no window calls this function during its
6462 EVT_IDLE handler, then the application will remain in a passive event
6463 loop until a new event is posted to the application by the windowing
6466 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6468 def MoreRequested(*args
, **kwargs
):
6470 MoreRequested(self) -> bool
6472 Returns ``True`` if the OnIdle function processing this event
6473 requested more processing time.
6475 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6477 def SetMode(*args
, **kwargs
):
6481 Static method for specifying how wxWidgets will send idle events: to
6482 all windows, or only to those which specify that they will process the
6485 The mode can be one of the following values:
6487 ========================= ========================================
6488 wx.IDLE_PROCESS_ALL Send idle events to all windows
6489 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6490 the wx.WS_EX_PROCESS_IDLE extra style
6492 ========================= ========================================
6495 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6497 SetMode
= staticmethod(SetMode
)
6498 def GetMode(*args
, **kwargs
):
6502 Static method returning a value specifying how wxWidgets will send
6503 idle events: to all windows, or only to those which specify that they
6504 will process the events.
6506 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6508 GetMode
= staticmethod(GetMode
)
6509 def CanSend(*args
, **kwargs
):
6511 CanSend(Window win) -> bool
6513 Returns ``True`` if it is appropriate to send idle events to this
6516 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6517 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6518 events should be sent to this window now. By default this will always
6519 return ``True`` because the update mode is initially
6520 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6521 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6523 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6525 CanSend
= staticmethod(CanSend
)
6527 class IdleEventPtr(IdleEvent
):
6528 def __init__(self
, this
):
6530 if not hasattr(self
,"thisown"): self
.thisown
= 0
6531 self
.__class
__ = IdleEvent
6532 _core_
.IdleEvent_swigregister(IdleEventPtr
)
6534 def IdleEvent_SetMode(*args
, **kwargs
):
6536 IdleEvent_SetMode(int mode)
6538 Static method for specifying how wxWidgets will send idle events: to
6539 all windows, or only to those which specify that they will process the
6542 The mode can be one of the following values:
6544 ========================= ========================================
6545 wx.IDLE_PROCESS_ALL Send idle events to all windows
6546 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6547 the wx.WS_EX_PROCESS_IDLE extra style
6549 ========================= ========================================
6552 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6554 def IdleEvent_GetMode(*args
, **kwargs
):
6556 IdleEvent_GetMode() -> int
6558 Static method returning a value specifying how wxWidgets will send
6559 idle events: to all windows, or only to those which specify that they
6560 will process the events.
6562 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6564 def IdleEvent_CanSend(*args
, **kwargs
):
6566 IdleEvent_CanSend(Window win) -> bool
6568 Returns ``True`` if it is appropriate to send idle events to this
6571 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6572 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6573 events should be sent to this window now. By default this will always
6574 return ``True`` because the update mode is initially
6575 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6576 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6578 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6580 #---------------------------------------------------------------------------
6582 class PyEvent(Event
):
6584 wx.PyEvent can be used as a base class for implementing custom event
6585 types in Python. You should derived from this class instead of
6586 `wx.Event` because this class is Python-aware and is able to transport
6587 its Python bits safely through the wxWidgets event system and have
6588 them still be there when the event handler is invoked.
6590 :see: `wx.PyCommandEvent`
6594 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6595 def __init__(self
, *args
, **kwargs
):
6596 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
6597 newobj
= _core_
.new_PyEvent(*args
, **kwargs
)
6598 self
.this
= newobj
.this
6603 def __del__(self
, destroy
=_core_
.delete_PyEvent
):
6606 if self
.thisown
: destroy(self
)
6609 def _SetSelf(*args
, **kwargs
):
6610 """_SetSelf(self, PyObject self)"""
6611 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6613 def _GetSelf(*args
, **kwargs
):
6614 """_GetSelf(self) -> PyObject"""
6615 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6618 class PyEventPtr(PyEvent
):
6619 def __init__(self
, this
):
6621 if not hasattr(self
,"thisown"): self
.thisown
= 0
6622 self
.__class
__ = PyEvent
6623 _core_
.PyEvent_swigregister(PyEventPtr
)
6625 class PyCommandEvent(CommandEvent
):
6627 wx.PyCommandEvent can be used as a base class for implementing custom
6628 event types in Python, where the event shoudl travel up to parent
6629 windows looking for a handler. You should derived from this class
6630 instead of `wx.CommandEvent` because this class is Python-aware and is
6631 able to transport its Python bits safely through the wxWidgets event
6632 system and have them still be there when the event handler is invoked.
6638 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6639 def __init__(self
, *args
, **kwargs
):
6640 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6641 newobj
= _core_
.new_PyCommandEvent(*args
, **kwargs
)
6642 self
.this
= newobj
.this
6647 def __del__(self
, destroy
=_core_
.delete_PyCommandEvent
):
6650 if self
.thisown
: destroy(self
)
6653 def _SetSelf(*args
, **kwargs
):
6654 """_SetSelf(self, PyObject self)"""
6655 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6657 def _GetSelf(*args
, **kwargs
):
6658 """_GetSelf(self) -> PyObject"""
6659 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6662 class PyCommandEventPtr(PyCommandEvent
):
6663 def __init__(self
, this
):
6665 if not hasattr(self
,"thisown"): self
.thisown
= 0
6666 self
.__class
__ = PyCommandEvent
6667 _core_
.PyCommandEvent_swigregister(PyCommandEventPtr
)
6669 class DateEvent(CommandEvent
):
6671 This event class holds information about a date change event and is
6672 used together with `wx.DatePickerCtrl`. It also serves as a base class
6673 for `wx.calendar.CalendarEvent`. Bind these event types with
6677 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6678 def __init__(self
, *args
, **kwargs
):
6679 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6680 newobj
= _core_
.new_DateEvent(*args
, **kwargs
)
6681 self
.this
= newobj
.this
6684 def GetDate(*args
, **kwargs
):
6686 GetDate(self) -> DateTime
6690 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6692 def SetDate(*args
, **kwargs
):
6694 SetDate(self, DateTime date)
6696 Sets the date carried by the event, normally only used by the library
6699 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
6702 class DateEventPtr(DateEvent
):
6703 def __init__(self
, this
):
6705 if not hasattr(self
,"thisown"): self
.thisown
= 0
6706 self
.__class
__ = DateEvent
6707 _core_
.DateEvent_swigregister(DateEventPtr
)
6709 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
6710 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
6712 #---------------------------------------------------------------------------
6714 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
6715 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
6716 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
6717 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
6718 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
6719 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
6720 class PyApp(EvtHandler
):
6722 The ``wx.PyApp`` class is an *implementation detail*, please use the
6723 `wx.App` class (or some other derived class) instead.
6726 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6727 def __init__(self
, *args
, **kwargs
):
6729 __init__(self) -> PyApp
6731 Create a new application object, starting the bootstrap process.
6733 newobj
= _core_
.new_PyApp(*args
, **kwargs
)
6734 self
.this
= newobj
.this
6737 self
._setCallbackInfo
(self
, PyApp
, False)
6738 self
._setOORInfo
(self
, False)
6740 def __del__(self
, destroy
=_core_
.delete_PyApp
):
6743 if self
.thisown
: destroy(self
)
6746 def _setCallbackInfo(*args
, **kwargs
):
6747 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6748 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
6750 def GetAppName(*args
, **kwargs
):
6752 GetAppName(self) -> String
6754 Get the application name.
6756 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
6758 def SetAppName(*args
, **kwargs
):
6760 SetAppName(self, String name)
6762 Set the application name. This value may be used automatically by
6763 `wx.Config` and such.
6765 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
6767 def GetClassName(*args
, **kwargs
):
6769 GetClassName(self) -> String
6771 Get the application's class name.
6773 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
6775 def SetClassName(*args
, **kwargs
):
6777 SetClassName(self, String name)
6779 Set the application's class name. This value may be used for
6780 X-resources if applicable for the platform
6782 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
6784 def GetVendorName(*args
, **kwargs
):
6786 GetVendorName(self) -> String
6788 Get the application's vendor name.
6790 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
6792 def SetVendorName(*args
, **kwargs
):
6794 SetVendorName(self, String name)
6796 Set the application's vendor name. This value may be used
6797 automatically by `wx.Config` and such.
6799 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
6801 def GetTraits(*args
, **kwargs
):
6803 GetTraits(self) -> wxAppTraits
6805 Return (and create if necessary) the app traits object to which we
6806 delegate for everything which either should be configurable by the
6807 user (then he can change the default behaviour simply by overriding
6808 CreateTraits() and returning his own traits object) or which is
6809 GUI/console dependent as then wx.AppTraits allows us to abstract the
6810 differences behind the common facade.
6812 :todo: Add support for overriding CreateAppTraits in wxPython.
6814 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
6816 def ProcessPendingEvents(*args
, **kwargs
):
6818 ProcessPendingEvents(self)
6820 Process all events in the Pending Events list -- it is necessary to
6821 call this function to process posted events. This normally happens
6822 during each event loop iteration.
6824 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
6826 def Yield(*args
, **kwargs
):
6828 Yield(self, bool onlyIfNeeded=False) -> bool
6830 Process all currently pending events right now, instead of waiting
6831 until return to the event loop. It is an error to call ``Yield``
6832 recursively unless the value of ``onlyIfNeeded`` is True.
6834 :warning: This function is dangerous as it can lead to unexpected
6835 reentrancies (i.e. when called from an event handler it may
6836 result in calling the same event handler again), use with
6837 extreme care or, better, don't use at all!
6839 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6842 return _core_
.PyApp_Yield(*args
, **kwargs
)
6844 def WakeUpIdle(*args
, **kwargs
):
6848 Make sure that idle events are sent again.
6849 :see: `wx.WakeUpIdle`
6851 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
6853 def IsMainLoopRunning(*args
, **kwargs
):
6855 IsMainLoopRunning() -> bool
6857 Returns True if we're running the main loop, i.e. if the events can
6858 currently be dispatched.
6860 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
6862 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
6863 def MainLoop(*args
, **kwargs
):
6865 MainLoop(self) -> int
6867 Execute the main GUI loop, the function doesn't normally return until
6868 all top level windows have been closed and destroyed.
6870 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
6872 def Exit(*args
, **kwargs
):
6876 Exit the main loop thus terminating the application.
6879 return _core_
.PyApp_Exit(*args
, **kwargs
)
6881 def ExitMainLoop(*args
, **kwargs
):
6885 Exit the main GUI loop during the next iteration of the main
6886 loop, (i.e. it does not stop the program immediately!)
6888 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
6890 def Pending(*args
, **kwargs
):
6892 Pending(self) -> bool
6894 Returns True if there are unprocessed events in the event queue.
6896 return _core_
.PyApp_Pending(*args
, **kwargs
)
6898 def Dispatch(*args
, **kwargs
):
6900 Dispatch(self) -> bool
6902 Process the first event in the event queue (blocks until an event
6903 appears if there are none currently)
6905 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
6907 def ProcessIdle(*args
, **kwargs
):
6909 ProcessIdle(self) -> bool
6911 Called from the MainLoop when the application becomes idle (there are
6912 no pending events) and sends a `wx.IdleEvent` to all interested
6913 parties. Returns True if more idle events are needed, False if not.
6915 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
6917 def SendIdleEvents(*args
, **kwargs
):
6919 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6921 Send idle event to window and all subwindows. Returns True if more
6922 idle time is requested.
6924 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
6926 def IsActive(*args
, **kwargs
):
6928 IsActive(self) -> bool
6930 Return True if our app has focus.
6932 return _core_
.PyApp_IsActive(*args
, **kwargs
)
6934 def SetTopWindow(*args
, **kwargs
):
6936 SetTopWindow(self, Window win)
6938 Set the *main* top level window
6940 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
6942 def GetTopWindow(*args
, **kwargs
):
6944 GetTopWindow(self) -> Window
6946 Return the *main* top level window (if it hadn't been set previously
6947 with SetTopWindow(), will return just some top level window and, if
6948 there not any, will return None)
6950 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
6952 def SetExitOnFrameDelete(*args
, **kwargs
):
6954 SetExitOnFrameDelete(self, bool flag)
6956 Control the exit behaviour: by default, the program will exit the main
6957 loop (and so, usually, terminate) when the last top-level program
6958 window is deleted. Beware that if you disable this behaviour (with
6959 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6960 explicitly from somewhere.
6962 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
6964 def GetExitOnFrameDelete(*args
, **kwargs
):
6966 GetExitOnFrameDelete(self) -> bool
6968 Get the current exit behaviour setting.
6970 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
6972 def SetUseBestVisual(*args
, **kwargs
):
6974 SetUseBestVisual(self, bool flag)
6976 Set whether the app should try to use the best available visual on
6977 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6979 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
6981 def GetUseBestVisual(*args
, **kwargs
):
6983 GetUseBestVisual(self) -> bool
6985 Get current UseBestVisual setting.
6987 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
6989 def SetPrintMode(*args
, **kwargs
):
6990 """SetPrintMode(self, int mode)"""
6991 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
6993 def GetPrintMode(*args
, **kwargs
):
6994 """GetPrintMode(self) -> int"""
6995 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
6997 def SetAssertMode(*args
, **kwargs
):
6999 SetAssertMode(self, int mode)
7001 Set the OnAssert behaviour for debug and hybrid builds.
7003 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
7005 def GetAssertMode(*args
, **kwargs
):
7007 GetAssertMode(self) -> int
7009 Get the current OnAssert behaviour setting.
7011 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
7013 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7014 """GetMacSupportPCMenuShortcuts() -> bool"""
7015 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7017 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
7018 def GetMacAboutMenuItemId(*args
, **kwargs
):
7019 """GetMacAboutMenuItemId() -> long"""
7020 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
7022 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
7023 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
7024 """GetMacPreferencesMenuItemId() -> long"""
7025 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
7027 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
7028 def GetMacExitMenuItemId(*args
, **kwargs
):
7029 """GetMacExitMenuItemId() -> long"""
7030 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
7032 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
7033 def GetMacHelpMenuTitleName(*args
, **kwargs
):
7034 """GetMacHelpMenuTitleName() -> String"""
7035 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
7037 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
7038 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7039 """SetMacSupportPCMenuShortcuts(bool val)"""
7040 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7042 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
7043 def SetMacAboutMenuItemId(*args
, **kwargs
):
7044 """SetMacAboutMenuItemId(long val)"""
7045 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7047 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
7048 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
7049 """SetMacPreferencesMenuItemId(long val)"""
7050 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7052 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
7053 def SetMacExitMenuItemId(*args
, **kwargs
):
7054 """SetMacExitMenuItemId(long val)"""
7055 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7057 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
7058 def SetMacHelpMenuTitleName(*args
, **kwargs
):
7059 """SetMacHelpMenuTitleName(String val)"""
7060 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7062 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
7063 def _BootstrapApp(*args
, **kwargs
):
7067 For internal use only
7069 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
7071 def GetComCtl32Version(*args
, **kwargs
):
7073 GetComCtl32Version() -> int
7075 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7076 it wasn't found at all. Raises an exception on non-Windows platforms.
7078 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
7080 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
7082 class PyAppPtr(PyApp
):
7083 def __init__(self
, this
):
7085 if not hasattr(self
,"thisown"): self
.thisown
= 0
7086 self
.__class
__ = PyApp
7087 _core_
.PyApp_swigregister(PyAppPtr
)
7089 def PyApp_IsMainLoopRunning(*args
, **kwargs
):
7091 PyApp_IsMainLoopRunning() -> bool
7093 Returns True if we're running the main loop, i.e. if the events can
7094 currently be dispatched.
7096 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
7098 def PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7099 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7100 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7102 def PyApp_GetMacAboutMenuItemId(*args
, **kwargs
):
7103 """PyApp_GetMacAboutMenuItemId() -> long"""
7104 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
7106 def PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
):
7107 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7108 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
7110 def PyApp_GetMacExitMenuItemId(*args
, **kwargs
):
7111 """PyApp_GetMacExitMenuItemId() -> long"""
7112 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
7114 def PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
):
7115 """PyApp_GetMacHelpMenuTitleName() -> String"""
7116 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
7118 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7119 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7120 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7122 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
7123 """PyApp_SetMacAboutMenuItemId(long val)"""
7124 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7126 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
7127 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7128 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7130 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
7131 """PyApp_SetMacExitMenuItemId(long val)"""
7132 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7134 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
7135 """PyApp_SetMacHelpMenuTitleName(String val)"""
7136 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7138 def PyApp_GetComCtl32Version(*args
, **kwargs
):
7140 PyApp_GetComCtl32Version() -> int
7142 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7143 it wasn't found at all. Raises an exception on non-Windows platforms.
7145 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
7147 #---------------------------------------------------------------------------
7150 def Exit(*args
, **kwargs
):
7154 Force an exit of the application. Convenience for wx.GetApp().Exit()
7156 return _core_
.Exit(*args
, **kwargs
)
7158 def Yield(*args
, **kwargs
):
7162 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7164 return _core_
.Yield(*args
, **kwargs
)
7166 def YieldIfNeeded(*args
, **kwargs
):
7168 YieldIfNeeded() -> bool
7170 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7172 return _core_
.YieldIfNeeded(*args
, **kwargs
)
7174 def SafeYield(*args
, **kwargs
):
7176 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7178 This function is similar to `wx.Yield`, except that it disables the
7179 user input to all program windows before calling `wx.Yield` and
7180 re-enables it again afterwards. If ``win`` is not None, this window
7181 will remain enabled, allowing the implementation of some limited user
7184 :Returns: the result of the call to `wx.Yield`.
7186 return _core_
.SafeYield(*args
, **kwargs
)
7188 def WakeUpIdle(*args
, **kwargs
):
7192 Cause the message queue to become empty again, so idle events will be
7195 return _core_
.WakeUpIdle(*args
, **kwargs
)
7197 def PostEvent(*args
, **kwargs
):
7199 PostEvent(EvtHandler dest, Event event)
7201 Send an event to a window or other wx.EvtHandler to be processed
7204 return _core_
.PostEvent(*args
, **kwargs
)
7206 def App_CleanUp(*args
, **kwargs
):
7210 For internal use only, it is used to cleanup after wxWidgets when
7213 return _core_
.App_CleanUp(*args
, **kwargs
)
7215 def GetApp(*args
, **kwargs
):
7219 Return a reference to the current wx.App object.
7221 return _core_
.GetApp(*args
, **kwargs
)
7223 def SetDefaultPyEncoding(*args
, **kwargs
):
7225 SetDefaultPyEncoding(string encoding)
7227 Sets the encoding that wxPython will use when it needs to convert a
7228 Python string or unicode object to or from a wxString.
7230 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7231 but please be aware that the default encoding within the same locale
7232 may be slightly different on different platforms. For example, please
7233 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7234 between the common latin/roman encodings.
7236 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
7238 def GetDefaultPyEncoding(*args
, **kwargs
):
7240 GetDefaultPyEncoding() -> string
7242 Gets the current encoding that wxPython will use when it needs to
7243 convert a Python string or unicode object to or from a wxString.
7245 return _core_
.GetDefaultPyEncoding(*args
, **kwargs
)
7246 #----------------------------------------------------------------------
7248 class PyOnDemandOutputWindow
:
7250 A class that can be used for redirecting Python's stdout and
7251 stderr streams. It will do nothing until something is wrriten to
7252 the stream at which point it will create a Frame with a text area
7253 and write the text there.
7255 def __init__(self
, title
= "wxPython: stdout/stderr"):
7258 self
.pos
= wx
.DefaultPosition
7259 self
.size
= (450, 300)
7262 def SetParent(self
, parent
):
7263 """Set the window to be used as the popup Frame's parent."""
7264 self
.parent
= parent
7267 def CreateOutputWindow(self
, st
):
7268 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
7269 style
=wx
.DEFAULT_FRAME_STYLE
)
7270 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
7271 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
7272 self
.text
.AppendText(st
)
7273 self
.frame
.Show(True)
7274 EVT_CLOSE(self
.frame
, self
.OnCloseWindow
)
7277 def OnCloseWindow(self
, event
):
7278 if self
.frame
is not None:
7279 self
.frame
.Destroy()
7284 # These methods provide the file-like output behaviour.
7285 def write(self
, text
):
7287 Create the output window if needed and write the string to it.
7288 If not called in the context of the gui thread then uses
7289 CallAfter to do the work there.
7291 if self
.frame
is None:
7292 if not wx
.Thread_IsMain():
7293 wx
.CallAfter(self
.CreateOutputWindow
, text
)
7295 self
.CreateOutputWindow(text
)
7297 if not wx
.Thread_IsMain():
7298 wx
.CallAfter(self
.text
.AppendText
, text
)
7300 self
.text
.AppendText(text
)
7304 if self
.frame
is not None:
7305 wx
.CallAfter(self
.frame
.Close
)
7313 #----------------------------------------------------------------------
7315 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
7317 class App(wx
.PyApp
):
7319 The ``wx.App`` class represents the application and is used to:
7321 * bootstrap the wxPython system and initialize the underlying
7323 * set and get application-wide properties
7324 * implement the windowing system main message or event loop,
7325 and to dispatch events to window instances
7328 Every application must have a ``wx.App`` instance, and all
7329 creation of UI objects should be delayed until after the
7330 ``wx.App`` object has been created in order to ensure that the gui
7331 platform and wxWidgets have been fully initialized.
7333 Normally you would derive from this class and implement an
7334 ``OnInit`` method that creates a frame and then calls
7335 ``self.SetTopWindow(frame)``.
7337 :see: `wx.PySimpleApp` for a simpler app class that can be used
7341 outputWindowClass
= PyOnDemandOutputWindow
7343 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7344 useBestVisual
=False, clearSigInt
=True):
7346 Construct a ``wx.App`` object.
7348 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7349 redirected? Defaults to True on Windows and Mac, False
7350 otherwise. If `filename` is None then output will be
7351 redirected to a window that pops up as needed. (You can
7352 control what kind of window is created for the output by
7353 resetting the class variable ``outputWindowClass`` to a
7354 class of your choosing.)
7356 :param filename: The name of a file to redirect output to, if
7359 :param useBestVisual: Should the app try to use the best
7360 available visual provided by the system (only relevant on
7361 systems that have more than one visual.) This parameter
7362 must be used instead of calling `SetUseBestVisual` later
7363 on because it must be set before the underlying GUI
7364 toolkit is initialized.
7366 :param clearSigInt: Should SIGINT be cleared? This allows the
7367 app to terminate upon a Ctrl-C in the console like other
7370 :note: You should override OnInit to do applicaition
7371 initialization to ensure that the system, toolkit and
7372 wxWidgets are fully initialized.
7374 wx
.PyApp
.__init
__(self
)
7376 if wx
.Platform
== "__WXMAC__":
7379 if not MacOS
.WMAvailable():
7381 This program needs access to the screen. Please run with 'pythonw',
7382 not 'python', and only when you are logged in on the main display of
7390 # This has to be done before OnInit
7391 self
.SetUseBestVisual(useBestVisual
)
7393 # Set the default handler for SIGINT. This fixes a problem
7394 # where if Ctrl-C is pressed in the console that started this
7395 # app then it will not appear to do anything, (not even send
7396 # KeyboardInterrupt???) but will later segfault on exit. By
7397 # setting the default handler then the app will exit, as
7398 # expected (depending on platform.)
7402 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7406 # Save and redirect the stdio to a window?
7407 self
.stdioWin
= None
7408 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7410 self
.RedirectStdio(filename
)
7412 # Use Python's install prefix as the default
7413 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7415 # This finishes the initialization of wxWindows and then calls
7416 # the OnInit that should be present in the derived class
7417 self
._BootstrapApp
()
7420 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7421 self
.RestoreStdio() # Just in case the MainLoop was overridden
7425 wx
.PyApp
.Destroy(self
)
7428 def SetTopWindow(self
, frame
):
7429 """Set the \"main\" top level window"""
7431 self
.stdioWin
.SetParent(frame
)
7432 wx
.PyApp
.SetTopWindow(self
, frame
)
7436 """Execute the main GUI event loop"""
7437 wx
.PyApp
.MainLoop(self
)
7441 def RedirectStdio(self
, filename
=None):
7442 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7444 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7446 self
.stdioWin
= self
.outputWindowClass()
7447 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7450 def RestoreStdio(self
):
7452 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7457 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7459 Set the title, position and/or size of the output window if
7460 the stdio has been redirected. This should be called before
7461 any output would cause the output window to be created.
7464 if title
is not None:
7465 self
.stdioWin
.title
= title
7467 self
.stdioWin
.pos
= pos
7468 if size
is not None:
7469 self
.stdioWin
.size
= size
7474 # change from wx.PyApp_XX to wx.App_XX
7475 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7476 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7477 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7478 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7479 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7480 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7481 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7482 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7483 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7484 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7485 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7487 #----------------------------------------------------------------------------
7489 class PySimpleApp(wx
.App
):
7491 A simple application class. You can just create one of these and
7492 then then make your top level windows later, and not have to worry
7493 about OnInit. For example::
7495 app = wx.PySimpleApp()
7496 frame = wx.Frame(None, title='Hello World')
7503 def __init__(self
, redirect
=False, filename
=None,
7504 useBestVisual
=False, clearSigInt
=True):
7506 :see: `wx.App.__init__`
7508 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7515 # Is anybody using this one?
7516 class PyWidgetTester(wx
.App
):
7517 def __init__(self
, size
= (250, 100)):
7519 wx
.App
.__init
__(self
, 0)
7522 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7523 self
.SetTopWindow(self
.frame
)
7526 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7527 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7528 self
.frame
.Show(True)
7530 #----------------------------------------------------------------------------
7531 # DO NOT hold any other references to this object. This is how we
7532 # know when to cleanup system resources that wxWidgets is holding. When
7533 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7534 # goes to zero and it calls the wx.App_CleanUp function.
7536 class __wxPyCleanup
:
7538 self
.cleanup
= _core_
.App_CleanUp
7542 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7544 ## # another possible solution, but it gets called too early...
7546 ## atexit.register(_core_.wxApp_CleanUp)
7549 #----------------------------------------------------------------------------
7551 #---------------------------------------------------------------------------
7553 class EventLoop(object):
7554 """Proxy of C++ EventLoop class"""
7556 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7557 def __init__(self
, *args
, **kwargs
):
7558 """__init__(self) -> EventLoop"""
7559 newobj
= _core_
.new_EventLoop(*args
, **kwargs
)
7560 self
.this
= newobj
.this
7563 def __del__(self
, destroy
=_core_
.delete_EventLoop
):
7566 if self
.thisown
: destroy(self
)
7569 def Run(*args
, **kwargs
):
7570 """Run(self) -> int"""
7571 return _core_
.EventLoop_Run(*args
, **kwargs
)
7573 def Exit(*args
, **kwargs
):
7574 """Exit(self, int rc=0)"""
7575 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7577 def Pending(*args
, **kwargs
):
7578 """Pending(self) -> bool"""
7579 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7581 def Dispatch(*args
, **kwargs
):
7582 """Dispatch(self) -> bool"""
7583 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7585 def IsRunning(*args
, **kwargs
):
7586 """IsRunning(self) -> bool"""
7587 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7589 def GetActive(*args
, **kwargs
):
7590 """GetActive() -> EventLoop"""
7591 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7593 GetActive
= staticmethod(GetActive
)
7594 def SetActive(*args
, **kwargs
):
7595 """SetActive(EventLoop loop)"""
7596 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7598 SetActive
= staticmethod(SetActive
)
7600 class EventLoopPtr(EventLoop
):
7601 def __init__(self
, this
):
7603 if not hasattr(self
,"thisown"): self
.thisown
= 0
7604 self
.__class
__ = EventLoop
7605 _core_
.EventLoop_swigregister(EventLoopPtr
)
7607 def EventLoop_GetActive(*args
, **kwargs
):
7608 """EventLoop_GetActive() -> EventLoop"""
7609 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7611 def EventLoop_SetActive(*args
, **kwargs
):
7612 """EventLoop_SetActive(EventLoop loop)"""
7613 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7615 #---------------------------------------------------------------------------
7617 class AcceleratorEntry(object):
7619 A class used to define items in an `wx.AcceleratorTable`. wxPython
7620 programs can choose to use wx.AcceleratorEntry objects, but using a
7621 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7622 as well. See `__init__` for of the tuple values.
7624 :see: `wx.AcceleratorTable`
7627 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7628 def __init__(self
, *args
, **kwargs
):
7630 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7632 Construct a wx.AcceleratorEntry.
7634 newobj
= _core_
.new_AcceleratorEntry(*args
, **kwargs
)
7635 self
.this
= newobj
.this
7638 def __del__(self
, destroy
=_core_
.delete_AcceleratorEntry
):
7641 if self
.thisown
: destroy(self
)
7644 def Set(*args
, **kwargs
):
7646 Set(self, int flags, int keyCode, int cmd)
7648 (Re)set the attributes of a wx.AcceleratorEntry.
7651 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
7653 def GetFlags(*args
, **kwargs
):
7655 GetFlags(self) -> int
7657 Get the AcceleratorEntry's flags.
7659 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
7661 def GetKeyCode(*args
, **kwargs
):
7663 GetKeyCode(self) -> int
7665 Get the AcceleratorEntry's keycode.
7667 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
7669 def GetCommand(*args
, **kwargs
):
7671 GetCommand(self) -> int
7673 Get the AcceleratorEntry's command ID.
7675 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
7678 class AcceleratorEntryPtr(AcceleratorEntry
):
7679 def __init__(self
, this
):
7681 if not hasattr(self
,"thisown"): self
.thisown
= 0
7682 self
.__class
__ = AcceleratorEntry
7683 _core_
.AcceleratorEntry_swigregister(AcceleratorEntryPtr
)
7685 class AcceleratorTable(Object
):
7687 An accelerator table allows the application to specify a table of
7688 keyboard shortcuts for menus or other commands. On Windows, menu or
7689 button commands are supported; on GTK, only menu commands are
7693 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7694 def __init__(self
, *args
, **kwargs
):
7696 __init__(entries) -> AcceleratorTable
7698 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7699 items or or of 3-tuples (flags, keyCode, cmdID)
7701 :see: `wx.AcceleratorEntry`
7703 newobj
= _core_
.new_AcceleratorTable(*args
, **kwargs
)
7704 self
.this
= newobj
.this
7707 def __del__(self
, destroy
=_core_
.delete_AcceleratorTable
):
7710 if self
.thisown
: destroy(self
)
7713 def Ok(*args
, **kwargs
):
7714 """Ok(self) -> bool"""
7715 return _core_
.AcceleratorTable_Ok(*args
, **kwargs
)
7718 class AcceleratorTablePtr(AcceleratorTable
):
7719 def __init__(self
, this
):
7721 if not hasattr(self
,"thisown"): self
.thisown
= 0
7722 self
.__class
__ = AcceleratorTable
7723 _core_
.AcceleratorTable_swigregister(AcceleratorTablePtr
)
7726 def GetAccelFromString(*args
, **kwargs
):
7727 """GetAccelFromString(String label) -> AcceleratorEntry"""
7728 return _core_
.GetAccelFromString(*args
, **kwargs
)
7729 #---------------------------------------------------------------------------
7731 class VisualAttributes(object):
7732 """struct containing all the visual attributes of a control"""
7734 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7735 def __init__(self
, *args
, **kwargs
):
7737 __init__(self) -> VisualAttributes
7739 struct containing all the visual attributes of a control
7741 newobj
= _core_
.new_VisualAttributes(*args
, **kwargs
)
7742 self
.this
= newobj
.this
7745 def __del__(self
, destroy
=_core_
.delete_VisualAttributes
):
7748 if self
.thisown
: destroy(self
)
7751 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
7752 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
7753 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
7755 class VisualAttributesPtr(VisualAttributes
):
7756 def __init__(self
, this
):
7758 if not hasattr(self
,"thisown"): self
.thisown
= 0
7759 self
.__class
__ = VisualAttributes
7760 _core_
.VisualAttributes_swigregister(VisualAttributesPtr
)
7761 NullAcceleratorTable
= cvar
.NullAcceleratorTable
7762 PanelNameStr
= cvar
.PanelNameStr
7764 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
7765 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
7766 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
7767 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
7768 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
7769 class Window(EvtHandler
):
7771 wx.Window is the base class for all windows and represents any visible
7772 object on the screen. All controls, top level windows and so on are
7773 wx.Windows. Sizers and device contexts are not however, as they don't
7774 appear on screen themselves.
7778 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7779 def __init__(self
, *args
, **kwargs
):
7781 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7782 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7784 Construct and show a generic Window.
7786 newobj
= _core_
.new_Window(*args
, **kwargs
)
7787 self
.this
= newobj
.this
7790 self
._setOORInfo
(self
)
7792 def Create(*args
, **kwargs
):
7794 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7795 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7797 Create the GUI part of the Window for 2-phase creation mode.
7799 return _core_
.Window_Create(*args
, **kwargs
)
7801 def Close(*args
, **kwargs
):
7803 Close(self, bool force=False) -> bool
7805 This function simply generates a EVT_CLOSE event whose handler usually
7806 tries to close the window. It doesn't close the window itself,
7807 however. If force is False (the default) then the window's close
7808 handler will be allowed to veto the destruction of the window.
7810 return _core_
.Window_Close(*args
, **kwargs
)
7812 def Destroy(*args
, **kwargs
):
7814 Destroy(self) -> bool
7816 Destroys the window safely. Frames and dialogs are not destroyed
7817 immediately when this function is called -- they are added to a list
7818 of windows to be deleted on idle time, when all the window's events
7819 have been processed. This prevents problems with events being sent to
7820 non-existent windows.
7822 Returns True if the window has either been successfully deleted, or it
7823 has been added to the list of windows pending real deletion.
7825 return _core_
.Window_Destroy(*args
, **kwargs
)
7827 def DestroyChildren(*args
, **kwargs
):
7829 DestroyChildren(self) -> bool
7831 Destroys all children of a window. Called automatically by the
7834 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
7836 def IsBeingDeleted(*args
, **kwargs
):
7838 IsBeingDeleted(self) -> bool
7840 Is the window in the process of being deleted?
7842 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
7844 def SetTitle(*args
, **kwargs
):
7846 SetTitle(self, String title)
7848 Sets the window's title. Applicable only to frames and dialogs.
7850 return _core_
.Window_SetTitle(*args
, **kwargs
)
7852 def GetTitle(*args
, **kwargs
):
7854 GetTitle(self) -> String
7856 Gets the window's title. Applicable only to frames and dialogs.
7858 return _core_
.Window_GetTitle(*args
, **kwargs
)
7860 def SetLabel(*args
, **kwargs
):
7862 SetLabel(self, String label)
7864 Set the text which the window shows in its label if applicable.
7866 return _core_
.Window_SetLabel(*args
, **kwargs
)
7868 def GetLabel(*args
, **kwargs
):
7870 GetLabel(self) -> String
7872 Generic way of getting a label from any window, for identification
7873 purposes. The interpretation of this function differs from class to
7874 class. For frames and dialogs, the value returned is the title. For
7875 buttons or static text controls, it is the button text. This function
7876 can be useful for meta-programs such as testing tools or special-needs
7877 access programs)which need to identify windows by name.
7879 return _core_
.Window_GetLabel(*args
, **kwargs
)
7881 def SetName(*args
, **kwargs
):
7883 SetName(self, String name)
7885 Sets the window's name. The window name is used for ressource setting
7886 in X, it is not the same as the window title/label
7888 return _core_
.Window_SetName(*args
, **kwargs
)
7890 def GetName(*args
, **kwargs
):
7892 GetName(self) -> String
7894 Returns the windows name. This name is not guaranteed to be unique;
7895 it is up to the programmer to supply an appropriate name in the window
7896 constructor or via wx.Window.SetName.
7898 return _core_
.Window_GetName(*args
, **kwargs
)
7900 def SetWindowVariant(*args
, **kwargs
):
7902 SetWindowVariant(self, int variant)
7904 Sets the variant of the window/font size to use for this window, if
7905 the platform supports variants, for example, wxMac.
7907 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
7909 def GetWindowVariant(*args
, **kwargs
):
7910 """GetWindowVariant(self) -> int"""
7911 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
7913 def SetId(*args
, **kwargs
):
7915 SetId(self, int winid)
7917 Sets the identifier of the window. Each window has an integer
7918 identifier. If the application has not provided one, an identifier
7919 will be generated. Normally, the identifier should be provided on
7920 creation and should not be modified subsequently.
7922 return _core_
.Window_SetId(*args
, **kwargs
)
7924 def GetId(*args
, **kwargs
):
7928 Returns the identifier of the window. Each window has an integer
7929 identifier. If the application has not provided one (or the default Id
7930 -1 is used) then an unique identifier with a negative value will be
7933 return _core_
.Window_GetId(*args
, **kwargs
)
7935 def NewControlId(*args
, **kwargs
):
7937 NewControlId() -> int
7939 Generate a control id for the controls which were not given one.
7941 return _core_
.Window_NewControlId(*args
, **kwargs
)
7943 NewControlId
= staticmethod(NewControlId
)
7944 def NextControlId(*args
, **kwargs
):
7946 NextControlId(int winid) -> int
7948 Get the id of the control following the one with the given
7951 return _core_
.Window_NextControlId(*args
, **kwargs
)
7953 NextControlId
= staticmethod(NextControlId
)
7954 def PrevControlId(*args
, **kwargs
):
7956 PrevControlId(int winid) -> int
7958 Get the id of the control preceding the one with the given
7961 return _core_
.Window_PrevControlId(*args
, **kwargs
)
7963 PrevControlId
= staticmethod(PrevControlId
)
7964 def SetSize(*args
, **kwargs
):
7966 SetSize(self, Size size)
7968 Sets the size of the window in pixels.
7970 return _core_
.Window_SetSize(*args
, **kwargs
)
7972 def SetDimensions(*args
, **kwargs
):
7974 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7976 Sets the position and size of the window in pixels. The sizeFlags
7977 parameter indicates the interpretation of the other params if they are
7980 ======================== ======================================
7981 wx.SIZE_AUTO A -1 indicates that a class-specific
7982 default should be used.
7983 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7984 -1 values are supplied.
7985 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7986 interpreted as real dimensions, not
7988 ======================== ======================================
7991 return _core_
.Window_SetDimensions(*args
, **kwargs
)
7993 def SetRect(*args
, **kwargs
):
7995 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7997 Sets the position and size of the window in pixels using a wx.Rect.
7999 return _core_
.Window_SetRect(*args
, **kwargs
)
8001 def SetSizeWH(*args
, **kwargs
):
8003 SetSizeWH(self, int width, int height)
8005 Sets the size of the window in pixels.
8007 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
8009 def Move(*args
, **kwargs
):
8011 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8013 Moves the window to the given position.
8015 return _core_
.Window_Move(*args
, **kwargs
)
8018 def MoveXY(*args
, **kwargs
):
8020 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8022 Moves the window to the given position.
8024 return _core_
.Window_MoveXY(*args
, **kwargs
)
8026 def SetBestFittingSize(*args
, **kwargs
):
8028 SetBestFittingSize(self, Size size=DefaultSize)
8030 A 'Smart' SetSize that will fill in default size components with the
8031 window's *best size* values. Also set's the minsize for use with sizers.
8033 return _core_
.Window_SetBestFittingSize(*args
, **kwargs
)
8035 def Raise(*args
, **kwargs
):
8039 Raises the window to the top of the window hierarchy if it is a
8040 managed window (dialog or frame).
8042 return _core_
.Window_Raise(*args
, **kwargs
)
8044 def Lower(*args
, **kwargs
):
8048 Lowers the window to the bottom of the window hierarchy if it is a
8049 managed window (dialog or frame).
8051 return _core_
.Window_Lower(*args
, **kwargs
)
8053 def SetClientSize(*args
, **kwargs
):
8055 SetClientSize(self, Size size)
8057 This sets the size of the window client area in pixels. Using this
8058 function to size a window tends to be more device-independent than
8059 wx.Window.SetSize, since the application need not worry about what
8060 dimensions the border or title bar have when trying to fit the window
8061 around panel items, for example.
8063 return _core_
.Window_SetClientSize(*args
, **kwargs
)
8065 def SetClientSizeWH(*args
, **kwargs
):
8067 SetClientSizeWH(self, int width, int height)
8069 This sets the size of the window client area in pixels. Using this
8070 function to size a window tends to be more device-independent than
8071 wx.Window.SetSize, since the application need not worry about what
8072 dimensions the border or title bar have when trying to fit the window
8073 around panel items, for example.
8075 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
8077 def SetClientRect(*args
, **kwargs
):
8079 SetClientRect(self, Rect rect)
8081 This sets the size of the window client area in pixels. Using this
8082 function to size a window tends to be more device-independent than
8083 wx.Window.SetSize, since the application need not worry about what
8084 dimensions the border or title bar have when trying to fit the window
8085 around panel items, for example.
8087 return _core_
.Window_SetClientRect(*args
, **kwargs
)
8089 def GetPosition(*args
, **kwargs
):
8091 GetPosition(self) -> Point
8093 Get the window's position.
8095 return _core_
.Window_GetPosition(*args
, **kwargs
)
8097 def GetPositionTuple(*args
, **kwargs
):
8099 GetPositionTuple() -> (x,y)
8101 Get the window's position.
8103 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
8105 def GetSize(*args
, **kwargs
):
8107 GetSize(self) -> Size
8109 Get the window size.
8111 return _core_
.Window_GetSize(*args
, **kwargs
)
8113 def GetSizeTuple(*args
, **kwargs
):
8115 GetSizeTuple() -> (width, height)
8117 Get the window size.
8119 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
8121 def GetRect(*args
, **kwargs
):
8123 GetRect(self) -> Rect
8125 Returns the size and position of the window as a wx.Rect object.
8127 return _core_
.Window_GetRect(*args
, **kwargs
)
8129 def GetClientSize(*args
, **kwargs
):
8131 GetClientSize(self) -> Size
8133 This gets the size of the window's 'client area' in pixels. The client
8134 area is the area which may be drawn on by the programmer, excluding
8135 title bar, border, scrollbars, etc.
8137 return _core_
.Window_GetClientSize(*args
, **kwargs
)
8139 def GetClientSizeTuple(*args
, **kwargs
):
8141 GetClientSizeTuple() -> (width, height)
8143 This gets the size of the window's 'client area' in pixels. The client
8144 area is the area which may be drawn on by the programmer, excluding
8145 title bar, border, scrollbars, etc.
8147 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
8149 def GetClientAreaOrigin(*args
, **kwargs
):
8151 GetClientAreaOrigin(self) -> Point
8153 Get the origin of the client area of the window relative to the
8154 window's top left corner (the client area may be shifted because of
8155 the borders, scrollbars, other decorations...)
8157 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
8159 def GetClientRect(*args
, **kwargs
):
8161 GetClientRect(self) -> Rect
8163 Get the client area position and size as a `wx.Rect` object.
8165 return _core_
.Window_GetClientRect(*args
, **kwargs
)
8167 def GetBestSize(*args
, **kwargs
):
8169 GetBestSize(self) -> Size
8171 This function returns the best acceptable minimal size for the
8172 window, if applicable. For example, for a static text control, it will
8173 be the minimal size such that the control label is not truncated. For
8174 windows containing subwindows (suzh aswx.Panel), the size returned by
8175 this function will be the same as the size the window would have had
8178 return _core_
.Window_GetBestSize(*args
, **kwargs
)
8180 def GetBestSizeTuple(*args
, **kwargs
):
8182 GetBestSizeTuple() -> (width, height)
8184 This function returns the best acceptable minimal size for the
8185 window, if applicable. For example, for a static text control, it will
8186 be the minimal size such that the control label is not truncated. For
8187 windows containing subwindows (suzh aswx.Panel), the size returned by
8188 this function will be the same as the size the window would have had
8191 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
8193 def InvalidateBestSize(*args
, **kwargs
):
8195 InvalidateBestSize(self)
8197 Reset the cached best size value so it will be recalculated the next
8200 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
8202 def CacheBestSize(*args
, **kwargs
):
8204 CacheBestSize(self, Size size)
8206 Cache the best size so it doesn't need to be calculated again, (at least until
8207 some properties of the window change.)
8209 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
8211 def GetBestFittingSize(*args
, **kwargs
):
8213 GetBestFittingSize(self) -> Size
8215 This function will merge the window's best size into the window's
8216 minimum size, giving priority to the min size components, and returns
8220 return _core_
.Window_GetBestFittingSize(*args
, **kwargs
)
8222 def GetAdjustedBestSize(*args
, **kwargs
):
8224 GetAdjustedBestSize(self) -> Size
8226 This method is similar to GetBestSize, except in one
8227 thing. GetBestSize should return the minimum untruncated size of the
8228 window, while this method will return the largest of BestSize and any
8229 user specified minimum size. ie. it is the minimum size the window
8230 should currently be drawn at, not the minimal size it can possibly
8233 return _core_
.Window_GetAdjustedBestSize(*args
, **kwargs
)
8235 def Center(*args
, **kwargs
):
8237 Center(self, int direction=BOTH)
8239 Centers the window. The parameter specifies the direction for
8240 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8241 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8242 on the entire screen and not on its parent window. If it is a
8243 top-level window and has no parent then it will always be centered
8244 relative to the screen.
8246 return _core_
.Window_Center(*args
, **kwargs
)
8249 def CenterOnScreen(*args
, **kwargs
):
8251 CenterOnScreen(self, int dir=BOTH)
8253 Center on screen (only works for top level windows)
8255 return _core_
.Window_CenterOnScreen(*args
, **kwargs
)
8257 CentreOnScreen
= CenterOnScreen
8258 def CenterOnParent(*args
, **kwargs
):
8260 CenterOnParent(self, int dir=BOTH)
8262 Center with respect to the the parent window
8264 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
8266 CentreOnParent
= CenterOnParent
8267 def Fit(*args
, **kwargs
):
8271 Sizes the window so that it fits around its subwindows. This function
8272 won't do anything if there are no subwindows and will only really work
8273 correctly if sizers are used for the subwindows layout. Also, if the
8274 window has exactly one subwindow it is better (faster and the result
8275 is more precise as Fit adds some margin to account for fuzziness of
8276 its calculations) to call window.SetClientSize(child.GetSize())
8277 instead of calling Fit.
8279 return _core_
.Window_Fit(*args
, **kwargs
)
8281 def FitInside(*args
, **kwargs
):
8285 Similar to Fit, but sizes the interior (virtual) size of a
8286 window. Mainly useful with scrolled windows to reset scrollbars after
8287 sizing changes that do not trigger a size event, and/or scrolled
8288 windows without an interior sizer. This function similarly won't do
8289 anything if there are no subwindows.
8291 return _core_
.Window_FitInside(*args
, **kwargs
)
8293 def SetSizeHints(*args
, **kwargs
):
8295 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8298 Allows specification of minimum and maximum window sizes, and window
8299 size increments. If a pair of values is not set (or set to -1), the
8300 default values will be used. If this function is called, the user
8301 will not be able to size the window outside the given bounds (if it is
8302 a top-level window.) Sizers will also inspect the minimum window size
8303 and will use that value if set when calculating layout.
8305 The resizing increments are only significant under Motif or Xt.
8307 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
8309 def SetSizeHintsSz(*args
, **kwargs
):
8311 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8313 Allows specification of minimum and maximum window sizes, and window
8314 size increments. If a pair of values is not set (or set to -1), the
8315 default values will be used. If this function is called, the user
8316 will not be able to size the window outside the given bounds (if it is
8317 a top-level window.) Sizers will also inspect the minimum window size
8318 and will use that value if set when calculating layout.
8320 The resizing increments are only significant under Motif or Xt.
8322 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
8324 def SetVirtualSizeHints(*args
, **kwargs
):
8326 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8328 Allows specification of minimum and maximum virtual window sizes. If a
8329 pair of values is not set (or set to -1), the default values will be
8330 used. If this function is called, the user will not be able to size
8331 the virtual area of the window outside the given bounds.
8333 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
8335 def SetVirtualSizeHintsSz(*args
, **kwargs
):
8337 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8339 Allows specification of minimum and maximum virtual window sizes. If a
8340 pair of values is not set (or set to -1), the default values will be
8341 used. If this function is called, the user will not be able to size
8342 the virtual area of the window outside the given bounds.
8344 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
8346 def GetMaxSize(*args
, **kwargs
):
8347 """GetMaxSize(self) -> Size"""
8348 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8350 def GetMinSize(*args
, **kwargs
):
8351 """GetMinSize(self) -> Size"""
8352 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8354 def SetMinSize(*args
, **kwargs
):
8356 SetMinSize(self, Size minSize)
8358 A more convenient method than `SetSizeHints` for setting just the
8361 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8363 def SetMaxSize(*args
, **kwargs
):
8365 SetMaxSize(self, Size maxSize)
8367 A more convenient method than `SetSizeHints` for setting just the
8370 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8372 def GetMinWidth(*args
, **kwargs
):
8373 """GetMinWidth(self) -> int"""
8374 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8376 def GetMinHeight(*args
, **kwargs
):
8377 """GetMinHeight(self) -> int"""
8378 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8380 def GetMaxWidth(*args
, **kwargs
):
8381 """GetMaxWidth(self) -> int"""
8382 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8384 def GetMaxHeight(*args
, **kwargs
):
8385 """GetMaxHeight(self) -> int"""
8386 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8388 def SetVirtualSize(*args
, **kwargs
):
8390 SetVirtualSize(self, Size size)
8392 Set the the virtual size of a window in pixels. For most windows this
8393 is just the client area of the window, but for some like scrolled
8394 windows it is more or less independent of the screen window size.
8396 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8398 def SetVirtualSizeWH(*args
, **kwargs
):
8400 SetVirtualSizeWH(self, int w, int h)
8402 Set the the virtual size of a window in pixels. For most windows this
8403 is just the client area of the window, but for some like scrolled
8404 windows it is more or less independent of the screen window size.
8406 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8408 def GetVirtualSize(*args
, **kwargs
):
8410 GetVirtualSize(self) -> Size
8412 Get the the virtual size of the window in pixels. For most windows
8413 this is just the client area of the window, but for some like scrolled
8414 windows it is more or less independent of the screen window size.
8416 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8418 def GetVirtualSizeTuple(*args
, **kwargs
):
8420 GetVirtualSizeTuple() -> (width, height)
8422 Get the the virtual size of the window in pixels. For most windows
8423 this is just the client area of the window, but for some like scrolled
8424 windows it is more or less independent of the screen window size.
8426 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8428 def GetBestVirtualSize(*args
, **kwargs
):
8430 GetBestVirtualSize(self) -> Size
8432 Return the largest of ClientSize and BestSize (as determined by a
8433 sizer, interior children, or other means)
8435 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8437 def Show(*args
, **kwargs
):
8439 Show(self, bool show=True) -> bool
8441 Shows or hides the window. You may need to call Raise for a top level
8442 window if you want to bring it to top, although this is not needed if
8443 Show is called immediately after the frame creation. Returns True if
8444 the window has been shown or hidden or False if nothing was done
8445 because it already was in the requested state.
8447 return _core_
.Window_Show(*args
, **kwargs
)
8449 def Hide(*args
, **kwargs
):
8453 Equivalent to calling Show(False).
8455 return _core_
.Window_Hide(*args
, **kwargs
)
8457 def Enable(*args
, **kwargs
):
8459 Enable(self, bool enable=True) -> bool
8461 Enable or disable the window for user input. Note that when a parent
8462 window is disabled, all of its children are disabled as well and they
8463 are reenabled again when the parent is. Returns true if the window
8464 has been enabled or disabled, false if nothing was done, i.e. if the
8465 window had already been in the specified state.
8467 return _core_
.Window_Enable(*args
, **kwargs
)
8469 def Disable(*args
, **kwargs
):
8471 Disable(self) -> bool
8473 Disables the window, same as Enable(false).
8475 return _core_
.Window_Disable(*args
, **kwargs
)
8477 def IsShown(*args
, **kwargs
):
8479 IsShown(self) -> bool
8481 Returns true if the window is shown, false if it has been hidden.
8483 return _core_
.Window_IsShown(*args
, **kwargs
)
8485 def IsEnabled(*args
, **kwargs
):
8487 IsEnabled(self) -> bool
8489 Returns true if the window is enabled for input, false otherwise.
8491 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8493 def SetWindowStyleFlag(*args
, **kwargs
):
8495 SetWindowStyleFlag(self, long style)
8497 Sets the style of the window. Please note that some styles cannot be
8498 changed after the window creation and that Refresh() might need to be
8499 called after changing the others for the change to take place
8502 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8504 def GetWindowStyleFlag(*args
, **kwargs
):
8506 GetWindowStyleFlag(self) -> long
8508 Gets the window style that was passed to the constructor or Create
8511 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8513 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8514 def HasFlag(*args
, **kwargs
):
8516 HasFlag(self, int flag) -> bool
8518 Test if the given style is set for this window.
8520 return _core_
.Window_HasFlag(*args
, **kwargs
)
8522 def IsRetained(*args
, **kwargs
):
8524 IsRetained(self) -> bool
8526 Returns true if the window is retained, false otherwise. Retained
8527 windows are only available on X platforms.
8529 return _core_
.Window_IsRetained(*args
, **kwargs
)
8531 def SetExtraStyle(*args
, **kwargs
):
8533 SetExtraStyle(self, long exStyle)
8535 Sets the extra style bits for the window. Extra styles are the less
8536 often used style bits which can't be set with the constructor or with
8537 SetWindowStyleFlag()
8539 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8541 def GetExtraStyle(*args
, **kwargs
):
8543 GetExtraStyle(self) -> long
8545 Returns the extra style bits for the window.
8547 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
8549 def MakeModal(*args
, **kwargs
):
8551 MakeModal(self, bool modal=True)
8553 Disables all other windows in the application so that the user can
8554 only interact with this window. Passing False will reverse this
8557 return _core_
.Window_MakeModal(*args
, **kwargs
)
8559 def SetThemeEnabled(*args
, **kwargs
):
8561 SetThemeEnabled(self, bool enableTheme)
8563 This function tells a window if it should use the system's "theme"
8564 code to draw the windows' background instead if its own background
8565 drawing code. This will only have an effect on platforms that support
8566 the notion of themes in user defined windows. One such platform is
8567 GTK+ where windows can have (very colourful) backgrounds defined by a
8568 user's selected theme.
8570 Dialogs, notebook pages and the status bar have this flag set to true
8571 by default so that the default look and feel is simulated best.
8573 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
8575 def GetThemeEnabled(*args
, **kwargs
):
8577 GetThemeEnabled(self) -> bool
8579 Return the themeEnabled flag.
8581 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
8583 def SetFocus(*args
, **kwargs
):
8587 Set's the focus to this window, allowing it to receive keyboard input.
8589 return _core_
.Window_SetFocus(*args
, **kwargs
)
8591 def SetFocusFromKbd(*args
, **kwargs
):
8593 SetFocusFromKbd(self)
8595 Set focus to this window as the result of a keyboard action. Normally
8596 only called internally.
8598 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
8600 def FindFocus(*args
, **kwargs
):
8602 FindFocus() -> Window
8604 Returns the window or control that currently has the keyboard focus,
8607 return _core_
.Window_FindFocus(*args
, **kwargs
)
8609 FindFocus
= staticmethod(FindFocus
)
8610 def AcceptsFocus(*args
, **kwargs
):
8612 AcceptsFocus(self) -> bool
8614 Can this window have focus?
8616 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
8618 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
8620 AcceptsFocusFromKeyboard(self) -> bool
8622 Can this window be given focus by keyboard navigation? if not, the
8623 only way to give it focus (provided it accepts it at all) is to click
8626 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
8628 def GetDefaultItem(*args
, **kwargs
):
8630 GetDefaultItem(self) -> Window
8632 Get the default child of this parent, i.e. the one which is activated
8633 by pressing <Enter> such as the OK button on a wx.Dialog.
8635 return _core_
.Window_GetDefaultItem(*args
, **kwargs
)
8637 def SetDefaultItem(*args
, **kwargs
):
8639 SetDefaultItem(self, Window child) -> Window
8641 Set this child as default, return the old default.
8643 return _core_
.Window_SetDefaultItem(*args
, **kwargs
)
8645 def SetTmpDefaultItem(*args
, **kwargs
):
8647 SetTmpDefaultItem(self, Window win)
8649 Set this child as temporary default
8651 return _core_
.Window_SetTmpDefaultItem(*args
, **kwargs
)
8653 def Navigate(*args
, **kwargs
):
8655 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8657 Does keyboard navigation from this window to another, by sending a
8658 `wx.NavigationKeyEvent`.
8660 return _core_
.Window_Navigate(*args
, **kwargs
)
8662 def MoveAfterInTabOrder(*args
, **kwargs
):
8664 MoveAfterInTabOrder(self, Window win)
8666 Moves this window in the tab navigation order after the specified
8667 sibling window. This means that when the user presses the TAB key on
8668 that other window, the focus switches to this window.
8670 The default tab order is the same as creation order. This function
8671 and `MoveBeforeInTabOrder` allow to change it after creating all the
8675 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
8677 def MoveBeforeInTabOrder(*args
, **kwargs
):
8679 MoveBeforeInTabOrder(self, Window win)
8681 Same as `MoveAfterInTabOrder` except that it inserts this window just
8682 before win instead of putting it right after it.
8684 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
8686 def GetChildren(*args
, **kwargs
):
8688 GetChildren(self) -> PyObject
8690 Returns a list of the window's children. NOTE: Currently this is a
8691 copy of the child window list maintained by the window, so the return
8692 value of this function is only valid as long as the window's children
8695 return _core_
.Window_GetChildren(*args
, **kwargs
)
8697 def GetParent(*args
, **kwargs
):
8699 GetParent(self) -> Window
8701 Returns the parent window of this window, or None if there isn't one.
8703 return _core_
.Window_GetParent(*args
, **kwargs
)
8705 def GetGrandParent(*args
, **kwargs
):
8707 GetGrandParent(self) -> Window
8709 Returns the parent of the parent of this window, or None if there
8712 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
8714 def IsTopLevel(*args
, **kwargs
):
8716 IsTopLevel(self) -> bool
8718 Returns true if the given window is a top-level one. Currently all
8719 frames and dialogs are always considered to be top-level windows (even
8720 if they have a parent window).
8722 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
8724 def Reparent(*args
, **kwargs
):
8726 Reparent(self, Window newParent) -> bool
8728 Reparents the window, i.e the window will be removed from its current
8729 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8730 re-inserted into another. Available on Windows and GTK. Returns True
8731 if the parent was changed, False otherwise (error or newParent ==
8734 return _core_
.Window_Reparent(*args
, **kwargs
)
8736 def AddChild(*args
, **kwargs
):
8738 AddChild(self, Window child)
8740 Adds a child window. This is called automatically by window creation
8741 functions so should not be required by the application programmer.
8743 return _core_
.Window_AddChild(*args
, **kwargs
)
8745 def RemoveChild(*args
, **kwargs
):
8747 RemoveChild(self, Window child)
8749 Removes a child window. This is called automatically by window
8750 deletion functions so should not be required by the application
8753 return _core_
.Window_RemoveChild(*args
, **kwargs
)
8755 def FindWindowById(*args
, **kwargs
):
8757 FindWindowById(self, long winid) -> Window
8759 Find a chld of this window by window ID
8761 return _core_
.Window_FindWindowById(*args
, **kwargs
)
8763 def FindWindowByName(*args
, **kwargs
):
8765 FindWindowByName(self, String name) -> Window
8767 Find a child of this window by name
8769 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
8771 def GetEventHandler(*args
, **kwargs
):
8773 GetEventHandler(self) -> EvtHandler
8775 Returns the event handler for this window. By default, the window is
8776 its own event handler.
8778 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
8780 def SetEventHandler(*args
, **kwargs
):
8782 SetEventHandler(self, EvtHandler handler)
8784 Sets the event handler for this window. An event handler is an object
8785 that is capable of processing the events sent to a window. By default,
8786 the window is its own event handler, but an application may wish to
8787 substitute another, for example to allow central implementation of
8788 event-handling for a variety of different window classes.
8790 It is usually better to use `wx.Window.PushEventHandler` since this sets
8791 up a chain of event handlers, where an event not handled by one event
8792 handler is handed to the next one in the chain.
8794 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
8796 def PushEventHandler(*args
, **kwargs
):
8798 PushEventHandler(self, EvtHandler handler)
8800 Pushes this event handler onto the event handler stack for the window.
8801 An event handler is an object that is capable of processing the events
8802 sent to a window. By default, the window is its own event handler, but
8803 an application may wish to substitute another, for example to allow
8804 central implementation of event-handling for a variety of different
8807 wx.Window.PushEventHandler allows an application to set up a chain of
8808 event handlers, where an event not handled by one event handler is
8809 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8810 remove the event handler.
8812 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
8814 def PopEventHandler(*args
, **kwargs
):
8816 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8818 Removes and returns the top-most event handler on the event handler
8819 stack. If deleteHandler is True then the wx.EvtHandler object will be
8820 destroyed after it is popped.
8822 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
8824 def RemoveEventHandler(*args
, **kwargs
):
8826 RemoveEventHandler(self, EvtHandler handler) -> bool
8828 Find the given handler in the event handler chain and remove (but not
8829 delete) it from the event handler chain, return True if it was found
8830 and False otherwise (this also results in an assert failure so this
8831 function should only be called when the handler is supposed to be
8834 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
8836 def SetValidator(*args
, **kwargs
):
8838 SetValidator(self, Validator validator)
8840 Deletes the current validator (if any) and sets the window validator,
8841 having called wx.Validator.Clone to create a new validator of this
8844 return _core_
.Window_SetValidator(*args
, **kwargs
)
8846 def GetValidator(*args
, **kwargs
):
8848 GetValidator(self) -> Validator
8850 Returns a pointer to the current validator for the window, or None if
8853 return _core_
.Window_GetValidator(*args
, **kwargs
)
8855 def Validate(*args
, **kwargs
):
8857 Validate(self) -> bool
8859 Validates the current values of the child controls using their
8860 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8861 style flag set, the method will also call Validate() of all child
8862 windows. Returns false if any of the validations failed.
8864 return _core_
.Window_Validate(*args
, **kwargs
)
8866 def TransferDataToWindow(*args
, **kwargs
):
8868 TransferDataToWindow(self) -> bool
8870 Transfers values to child controls from data areas specified by their
8871 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8872 style flag set, the method will also call TransferDataToWindow() of
8875 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
8877 def TransferDataFromWindow(*args
, **kwargs
):
8879 TransferDataFromWindow(self) -> bool
8881 Transfers values from child controls to data areas specified by their
8882 validators. Returns false if a transfer failed. If the window has
8883 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8884 also call TransferDataFromWindow() of all child windows.
8886 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
8888 def InitDialog(*args
, **kwargs
):
8892 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8893 to the dialog via validators.
8895 return _core_
.Window_InitDialog(*args
, **kwargs
)
8897 def SetAcceleratorTable(*args
, **kwargs
):
8899 SetAcceleratorTable(self, AcceleratorTable accel)
8901 Sets the accelerator table for this window.
8903 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
8905 def GetAcceleratorTable(*args
, **kwargs
):
8907 GetAcceleratorTable(self) -> AcceleratorTable
8909 Gets the accelerator table for this window.
8911 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
8913 def RegisterHotKey(*args
, **kwargs
):
8915 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8917 Registers a system wide hotkey. Every time the user presses the hotkey
8918 registered here, this window will receive a hotkey event. It will
8919 receive the event even if the application is in the background and
8920 does not have the input focus because the user is working with some
8921 other application. To bind an event handler function to this hotkey
8922 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8923 hotkey was registered successfully.
8925 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
8927 def UnregisterHotKey(*args
, **kwargs
):
8929 UnregisterHotKey(self, int hotkeyId) -> bool
8931 Unregisters a system wide hotkey.
8933 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
8935 def ConvertDialogPointToPixels(*args
, **kwargs
):
8937 ConvertDialogPointToPixels(self, Point pt) -> Point
8939 Converts a point or size from dialog units to pixels. Dialog units
8940 are used for maintaining a dialog's proportions even if the font
8941 changes. For the x dimension, the dialog units are multiplied by the
8942 average character width and then divided by 4. For the y dimension,
8943 the dialog units are multiplied by the average character height and
8946 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
8948 def ConvertDialogSizeToPixels(*args
, **kwargs
):
8950 ConvertDialogSizeToPixels(self, Size sz) -> Size
8952 Converts a point or size from dialog units to pixels. Dialog units
8953 are used for maintaining a dialog's proportions even if the font
8954 changes. For the x dimension, the dialog units are multiplied by the
8955 average character width and then divided by 4. For the y dimension,
8956 the dialog units are multiplied by the average character height and
8959 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
8961 def DLG_PNT(*args
, **kwargs
):
8963 DLG_PNT(self, Point pt) -> Point
8965 Converts a point or size from dialog units to pixels. Dialog units
8966 are used for maintaining a dialog's proportions even if the font
8967 changes. For the x dimension, the dialog units are multiplied by the
8968 average character width and then divided by 4. For the y dimension,
8969 the dialog units are multiplied by the average character height and
8972 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
8974 def DLG_SZE(*args
, **kwargs
):
8976 DLG_SZE(self, Size sz) -> Size
8978 Converts a point or size from dialog units to pixels. Dialog units
8979 are used for maintaining a dialog's proportions even if the font
8980 changes. For the x dimension, the dialog units are multiplied by the
8981 average character width and then divided by 4. For the y dimension,
8982 the dialog units are multiplied by the average character height and
8985 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
8987 def ConvertPixelPointToDialog(*args
, **kwargs
):
8988 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8989 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
8991 def ConvertPixelSizeToDialog(*args
, **kwargs
):
8992 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8993 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
8995 def WarpPointer(*args
, **kwargs
):
8997 WarpPointer(self, int x, int y)
8999 Moves the pointer to the given position on the window.
9001 NOTE: This function is not supported under Mac because Apple Human
9002 Interface Guidelines forbid moving the mouse cursor programmatically.
9004 return _core_
.Window_WarpPointer(*args
, **kwargs
)
9006 def CaptureMouse(*args
, **kwargs
):
9010 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9011 release the capture.
9013 Note that wxWindows maintains the stack of windows having captured the
9014 mouse and when the mouse is released the capture returns to the window
9015 which had had captured it previously and it is only really released if
9016 there were no previous window. In particular, this means that you must
9017 release the mouse as many times as you capture it.
9019 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
9021 def ReleaseMouse(*args
, **kwargs
):
9025 Releases mouse input captured with wx.Window.CaptureMouse.
9027 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
9029 def GetCapture(*args
, **kwargs
):
9031 GetCapture() -> Window
9033 Returns the window which currently captures the mouse or None
9035 return _core_
.Window_GetCapture(*args
, **kwargs
)
9037 GetCapture
= staticmethod(GetCapture
)
9038 def HasCapture(*args
, **kwargs
):
9040 HasCapture(self) -> bool
9042 Returns true if this window has the current mouse capture.
9044 return _core_
.Window_HasCapture(*args
, **kwargs
)
9046 def Refresh(*args
, **kwargs
):
9048 Refresh(self, bool eraseBackground=True, Rect rect=None)
9050 Mark the specified rectangle (or the whole window) as "dirty" so it
9051 will be repainted. Causes an EVT_PAINT event to be generated and sent
9054 return _core_
.Window_Refresh(*args
, **kwargs
)
9056 def RefreshRect(*args
, **kwargs
):
9058 RefreshRect(self, Rect rect, bool eraseBackground=True)
9060 Redraws the contents of the given rectangle: the area inside it will
9061 be repainted. This is the same as Refresh but has a nicer syntax.
9063 return _core_
.Window_RefreshRect(*args
, **kwargs
)
9065 def Update(*args
, **kwargs
):
9069 Calling this method immediately repaints the invalidated area of the
9070 window instead of waiting for the EVT_PAINT event to happen, (normally
9071 this would usually only happen when the flow of control returns to the
9072 event loop.) Notice that this function doesn't refresh the window and
9073 does nothing if the window has been already repainted. Use Refresh
9074 first if you want to immediately redraw the window (or some portion of
9075 it) unconditionally.
9077 return _core_
.Window_Update(*args
, **kwargs
)
9079 def ClearBackground(*args
, **kwargs
):
9081 ClearBackground(self)
9083 Clears the window by filling it with the current background
9084 colour. Does not cause an erase background event to be generated.
9086 return _core_
.Window_ClearBackground(*args
, **kwargs
)
9088 def Freeze(*args
, **kwargs
):
9092 Freezes the window or, in other words, prevents any updates from
9093 taking place on screen, the window is not redrawn at all. Thaw must be
9094 called to reenable window redrawing. Calls to Freeze/Thaw may be
9095 nested, with the actual Thaw being delayed until all the nesting has
9098 This method is useful for visual appearance optimization (for example,
9099 it is a good idea to use it before inserting large amount of text into
9100 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9101 for all controls so it is mostly just a hint to wxWindows and not a
9102 mandatory directive.
9104 return _core_
.Window_Freeze(*args
, **kwargs
)
9106 def Thaw(*args
, **kwargs
):
9110 Reenables window updating after a previous call to Freeze. Calls to
9111 Freeze/Thaw may be nested, so Thaw must be called the same number of
9112 times that Freeze was before the window will be updated.
9114 return _core_
.Window_Thaw(*args
, **kwargs
)
9116 def PrepareDC(*args
, **kwargs
):
9118 PrepareDC(self, DC dc)
9120 Call this function to prepare the device context for drawing a
9121 scrolled image. It sets the device origin according to the current
9124 return _core_
.Window_PrepareDC(*args
, **kwargs
)
9126 def GetUpdateRegion(*args
, **kwargs
):
9128 GetUpdateRegion(self) -> Region
9130 Returns the region specifying which parts of the window have been
9131 damaged. Should only be called within an EVT_PAINT handler.
9133 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
9135 def GetUpdateClientRect(*args
, **kwargs
):
9137 GetUpdateClientRect(self) -> Rect
9139 Get the update rectangle region bounding box in client coords.
9141 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
9143 def IsExposed(*args
, **kwargs
):
9145 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9147 Returns true if the given point or rectangle area has been exposed
9148 since the last repaint. Call this in an paint event handler to
9149 optimize redrawing by only redrawing those areas, which have been
9152 return _core_
.Window_IsExposed(*args
, **kwargs
)
9154 def IsExposedPoint(*args
, **kwargs
):
9156 IsExposedPoint(self, Point pt) -> bool
9158 Returns true if the given point or rectangle area has been exposed
9159 since the last repaint. Call this in an paint event handler to
9160 optimize redrawing by only redrawing those areas, which have been
9163 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
9165 def IsExposedRect(*args
, **kwargs
):
9167 IsExposedRect(self, Rect rect) -> bool
9169 Returns true if the given point or rectangle area has been exposed
9170 since the last repaint. Call this in an paint event handler to
9171 optimize redrawing by only redrawing those areas, which have been
9174 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
9176 def GetDefaultAttributes(*args
, **kwargs
):
9178 GetDefaultAttributes(self) -> VisualAttributes
9180 Get the default attributes for an instance of this class. This is
9181 useful if you want to use the same font or colour in your own control
9182 as in a standard control -- which is a much better idea than hard
9183 coding specific colours or fonts which might look completely out of
9184 place on the user's system, especially if it uses themes.
9186 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
9188 def GetClassDefaultAttributes(*args
, **kwargs
):
9190 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9192 Get the default attributes for this class. This is useful if you want
9193 to use the same font or colour in your own control as in a standard
9194 control -- which is a much better idea than hard coding specific
9195 colours or fonts which might look completely out of place on the
9196 user's system, especially if it uses themes.
9198 The variant parameter is only relevant under Mac currently and is
9199 ignore under other platforms. Under Mac, it will change the size of
9200 the returned font. See `wx.Window.SetWindowVariant` for more about
9203 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9205 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
9206 def SetBackgroundColour(*args
, **kwargs
):
9208 SetBackgroundColour(self, Colour colour) -> bool
9210 Sets the background colour of the window. Returns True if the colour
9211 was changed. The background colour is usually painted by the default
9212 EVT_ERASE_BACKGROUND event handler function under Windows and
9213 automatically under GTK. Using `wx.NullColour` will reset the window
9214 to the default background colour.
9216 Note that setting the background colour may not cause an immediate
9217 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9218 calling this function.
9220 Using this function will disable attempts to use themes for this
9221 window, if the system supports them. Use with care since usually the
9222 themes represent the appearance chosen by the user to be used for all
9223 applications on the system.
9225 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
9227 def SetOwnBackgroundColour(*args
, **kwargs
):
9228 """SetOwnBackgroundColour(self, Colour colour)"""
9229 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
9231 def SetForegroundColour(*args
, **kwargs
):
9233 SetForegroundColour(self, Colour colour) -> bool
9235 Sets the foreground colour of the window. Returns True is the colour
9236 was changed. The interpretation of foreground colour is dependent on
9237 the window class; it may be the text colour or other colour, or it may
9240 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
9242 def SetOwnForegroundColour(*args
, **kwargs
):
9243 """SetOwnForegroundColour(self, Colour colour)"""
9244 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
9246 def GetBackgroundColour(*args
, **kwargs
):
9248 GetBackgroundColour(self) -> Colour
9250 Returns the background colour of the window.
9252 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
9254 def GetForegroundColour(*args
, **kwargs
):
9256 GetForegroundColour(self) -> Colour
9258 Returns the foreground colour of the window. The interpretation of
9259 foreground colour is dependent on the window class; it may be the text
9260 colour or other colour, or it may not be used at all.
9262 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
9264 def InheritsBackgroundColour(*args
, **kwargs
):
9265 """InheritsBackgroundColour(self) -> bool"""
9266 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
9268 def UseBgCol(*args
, **kwargs
):
9269 """UseBgCol(self) -> bool"""
9270 return _core_
.Window_UseBgCol(*args
, **kwargs
)
9272 def SetBackgroundStyle(*args
, **kwargs
):
9274 SetBackgroundStyle(self, int style) -> bool
9276 Returns the background style of the window. The background style
9277 indicates how the background of the window is drawn.
9279 ====================== ========================================
9280 wx.BG_STYLE_SYSTEM The background colour or pattern should
9281 be determined by the system
9282 wx.BG_STYLE_COLOUR The background should be a solid colour
9283 wx.BG_STYLE_CUSTOM The background will be implemented by the
9285 ====================== ========================================
9287 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9288 a custom background, such as a tiled bitmap. Currently the style has
9289 no effect on other platforms.
9291 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9293 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
9295 def GetBackgroundStyle(*args
, **kwargs
):
9297 GetBackgroundStyle(self) -> int
9299 Returns the background style of the window.
9301 :see: `SetBackgroundStyle`
9303 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
9305 def HasTransparentBackground(*args
, **kwargs
):
9307 HasTransparentBackground(self) -> bool
9309 Returns True if this window's background is transparent (as, for
9310 example, for `wx.StaticText`) and should show the parent window's
9313 This method is mostly used internally by the library itself and you
9314 normally shouldn't have to call it. You may, however, have to override
9315 it in your custom control classes to ensure that background is painted
9318 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
9320 def SetCursor(*args
, **kwargs
):
9322 SetCursor(self, Cursor cursor) -> bool
9324 Sets the window's cursor. Notice that the window cursor also sets it
9325 for the children of the window implicitly.
9327 The cursor may be wx.NullCursor in which case the window cursor will
9328 be reset back to default.
9330 return _core_
.Window_SetCursor(*args
, **kwargs
)
9332 def GetCursor(*args
, **kwargs
):
9334 GetCursor(self) -> Cursor
9336 Return the cursor associated with this window.
9338 return _core_
.Window_GetCursor(*args
, **kwargs
)
9340 def SetFont(*args
, **kwargs
):
9342 SetFont(self, Font font) -> bool
9344 Sets the font for this window.
9346 return _core_
.Window_SetFont(*args
, **kwargs
)
9348 def SetOwnFont(*args
, **kwargs
):
9349 """SetOwnFont(self, Font font)"""
9350 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9352 def GetFont(*args
, **kwargs
):
9354 GetFont(self) -> Font
9356 Returns the default font used for this window.
9358 return _core_
.Window_GetFont(*args
, **kwargs
)
9360 def SetCaret(*args
, **kwargs
):
9362 SetCaret(self, Caret caret)
9364 Sets the caret associated with the window.
9366 return _core_
.Window_SetCaret(*args
, **kwargs
)
9368 def GetCaret(*args
, **kwargs
):
9370 GetCaret(self) -> Caret
9372 Returns the caret associated with the window.
9374 return _core_
.Window_GetCaret(*args
, **kwargs
)
9376 def GetCharHeight(*args
, **kwargs
):
9378 GetCharHeight(self) -> int
9380 Get the (average) character size for the current font.
9382 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9384 def GetCharWidth(*args
, **kwargs
):
9386 GetCharWidth(self) -> int
9388 Get the (average) character size for the current font.
9390 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9392 def GetTextExtent(*args
, **kwargs
):
9394 GetTextExtent(String string) -> (width, height)
9396 Get the width and height of the text using the current font.
9398 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9400 def GetFullTextExtent(*args
, **kwargs
):
9402 GetFullTextExtent(String string, Font font=None) ->
9403 (width, height, descent, externalLeading)
9405 Get the width, height, decent and leading of the text using the
9406 current or specified font.
9408 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9410 def ClientToScreenXY(*args
, **kwargs
):
9412 ClientToScreenXY(int x, int y) -> (x,y)
9414 Converts to screen coordinates from coordinates relative to this window.
9416 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9418 def ScreenToClientXY(*args
, **kwargs
):
9420 ScreenToClientXY(int x, int y) -> (x,y)
9422 Converts from screen to client window coordinates.
9424 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9426 def ClientToScreen(*args
, **kwargs
):
9428 ClientToScreen(self, Point pt) -> Point
9430 Converts to screen coordinates from coordinates relative to this window.
9432 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9434 def ScreenToClient(*args
, **kwargs
):
9436 ScreenToClient(self, Point pt) -> Point
9438 Converts from screen to client window coordinates.
9440 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9442 def HitTestXY(*args
, **kwargs
):
9444 HitTestXY(self, int x, int y) -> int
9446 Test where the given (in client coords) point lies
9448 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9450 def HitTest(*args
, **kwargs
):
9452 HitTest(self, Point pt) -> int
9454 Test where the given (in client coords) point lies
9456 return _core_
.Window_HitTest(*args
, **kwargs
)
9458 def GetBorder(*args
):
9460 GetBorder(self, long flags) -> int
9461 GetBorder(self) -> int
9463 Get border for the flags of this window
9465 return _core_
.Window_GetBorder(*args
)
9467 def UpdateWindowUI(*args
, **kwargs
):
9469 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9471 This function sends EVT_UPDATE_UI events to the window. The particular
9472 implementation depends on the window; for example a wx.ToolBar will
9473 send an update UI event for each toolbar button, and a wx.Frame will
9474 send an update UI event for each menubar menu item. You can call this
9475 function from your application to ensure that your UI is up-to-date at
9476 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9477 concerned). This may be necessary if you have called
9478 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9479 limit the overhead that wxWindows incurs by sending update UI events
9482 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9484 def PopupMenuXY(*args
, **kwargs
):
9486 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9488 Pops up the given menu at the specified coordinates, relative to this window,
9489 and returns control when the user has dismissed the menu. If a menu item is
9490 selected, the corresponding menu event is generated and will be processed as
9491 usual. If the default position is given then the current position of the
9492 mouse cursor will be used.
9494 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9496 def PopupMenu(*args
, **kwargs
):
9498 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9500 Pops up the given menu at the specified coordinates, relative to this window,
9501 and returns control when the user has dismissed the menu. If a menu item is
9502 selected, the corresponding menu event is generated and will be processed as
9503 usual. If the default position is given then the current position of the
9504 mouse cursor will be used.
9506 return _core_
.Window_PopupMenu(*args
, **kwargs
)
9508 def GetHandle(*args
, **kwargs
):
9510 GetHandle(self) -> long
9512 Returns the platform-specific handle (as a long integer) of the
9513 physical window. Currently on wxMac it returns the handle of the
9514 toplevel parent of the window.
9516 return _core_
.Window_GetHandle(*args
, **kwargs
)
9518 def AssociateHandle(*args
, **kwargs
):
9520 AssociateHandle(self, long handle)
9522 Associate the window with a new native handle
9524 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
9526 def DissociateHandle(*args
, **kwargs
):
9528 DissociateHandle(self)
9530 Dissociate the current native handle from the window
9532 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
9534 def HasScrollbar(*args
, **kwargs
):
9536 HasScrollbar(self, int orient) -> bool
9538 Does the window have the scrollbar for this orientation?
9540 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
9542 def SetScrollbar(*args
, **kwargs
):
9544 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9547 Sets the scrollbar properties of a built-in scrollbar.
9549 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
9551 def SetScrollPos(*args
, **kwargs
):
9553 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9555 Sets the position of one of the built-in scrollbars.
9557 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
9559 def GetScrollPos(*args
, **kwargs
):
9561 GetScrollPos(self, int orientation) -> int
9563 Returns the built-in scrollbar position.
9565 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
9567 def GetScrollThumb(*args
, **kwargs
):
9569 GetScrollThumb(self, int orientation) -> int
9571 Returns the built-in scrollbar thumb size.
9573 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
9575 def GetScrollRange(*args
, **kwargs
):
9577 GetScrollRange(self, int orientation) -> int
9579 Returns the built-in scrollbar range.
9581 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
9583 def ScrollWindow(*args
, **kwargs
):
9585 ScrollWindow(self, int dx, int dy, Rect rect=None)
9587 Physically scrolls the pixels in the window and move child windows
9588 accordingly. Use this function to optimise your scrolling
9589 implementations, to minimise the area that must be redrawn. Note that
9590 it is rarely required to call this function from a user program.
9592 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
9594 def ScrollLines(*args
, **kwargs
):
9596 ScrollLines(self, int lines) -> bool
9598 If the platform and window class supports it, scrolls the window by
9599 the given number of lines down, if lines is positive, or up if lines
9600 is negative. Returns True if the window was scrolled, False if it was
9601 already on top/bottom and nothing was done.
9603 return _core_
.Window_ScrollLines(*args
, **kwargs
)
9605 def ScrollPages(*args
, **kwargs
):
9607 ScrollPages(self, int pages) -> bool
9609 If the platform and window class supports it, scrolls the window by
9610 the given number of pages down, if pages is positive, or up if pages
9611 is negative. Returns True if the window was scrolled, False if it was
9612 already on top/bottom and nothing was done.
9614 return _core_
.Window_ScrollPages(*args
, **kwargs
)
9616 def LineUp(*args
, **kwargs
):
9618 LineUp(self) -> bool
9620 This is just a wrapper for ScrollLines(-1).
9622 return _core_
.Window_LineUp(*args
, **kwargs
)
9624 def LineDown(*args
, **kwargs
):
9626 LineDown(self) -> bool
9628 This is just a wrapper for ScrollLines(1).
9630 return _core_
.Window_LineDown(*args
, **kwargs
)
9632 def PageUp(*args
, **kwargs
):
9634 PageUp(self) -> bool
9636 This is just a wrapper for ScrollPages(-1).
9638 return _core_
.Window_PageUp(*args
, **kwargs
)
9640 def PageDown(*args
, **kwargs
):
9642 PageDown(self) -> bool
9644 This is just a wrapper for ScrollPages(1).
9646 return _core_
.Window_PageDown(*args
, **kwargs
)
9648 def SetHelpText(*args
, **kwargs
):
9650 SetHelpText(self, String text)
9652 Sets the help text to be used as context-sensitive help for this
9653 window. Note that the text is actually stored by the current
9654 wxHelpProvider implementation, and not in the window object itself.
9656 return _core_
.Window_SetHelpText(*args
, **kwargs
)
9658 def SetHelpTextForId(*args
, **kwargs
):
9660 SetHelpTextForId(self, String text)
9662 Associate this help text with all windows with the same id as this
9665 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
9667 def GetHelpText(*args
, **kwargs
):
9669 GetHelpText(self) -> String
9671 Gets the help text to be used as context-sensitive help for this
9672 window. Note that the text is actually stored by the current
9673 wxHelpProvider implementation, and not in the window object itself.
9675 return _core_
.Window_GetHelpText(*args
, **kwargs
)
9677 def SetToolTipString(*args
, **kwargs
):
9679 SetToolTipString(self, String tip)
9681 Attach a tooltip to the window.
9683 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
9685 def SetToolTip(*args
, **kwargs
):
9687 SetToolTip(self, ToolTip tip)
9689 Attach a tooltip to the window.
9691 return _core_
.Window_SetToolTip(*args
, **kwargs
)
9693 def GetToolTip(*args
, **kwargs
):
9695 GetToolTip(self) -> ToolTip
9697 get the associated tooltip or None if none
9699 return _core_
.Window_GetToolTip(*args
, **kwargs
)
9701 def SetDropTarget(*args
, **kwargs
):
9703 SetDropTarget(self, DropTarget dropTarget)
9705 Associates a drop target with this window. If the window already has
9706 a drop target, it is deleted.
9708 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
9710 def GetDropTarget(*args
, **kwargs
):
9712 GetDropTarget(self) -> DropTarget
9714 Returns the associated drop target, which may be None.
9716 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
9718 def DragAcceptFiles(*args
, **kwargs
):
9720 DragAcceptFiles(self, bool accept)
9722 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9723 Only functional on Windows.
9725 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
9727 def SetConstraints(*args
, **kwargs
):
9729 SetConstraints(self, LayoutConstraints constraints)
9731 Sets the window to have the given layout constraints. If an existing
9732 layout constraints object is already owned by the window, it will be
9733 deleted. Pass None to disassociate and delete the window's current
9736 You must call SetAutoLayout to tell a window to use the constraints
9737 automatically in its default EVT_SIZE handler; otherwise, you must
9738 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9739 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9742 return _core_
.Window_SetConstraints(*args
, **kwargs
)
9744 def GetConstraints(*args
, **kwargs
):
9746 GetConstraints(self) -> LayoutConstraints
9748 Returns a pointer to the window's layout constraints, or None if there
9751 return _core_
.Window_GetConstraints(*args
, **kwargs
)
9753 def SetAutoLayout(*args
, **kwargs
):
9755 SetAutoLayout(self, bool autoLayout)
9757 Determines whether the Layout function will be called automatically
9758 when the window is resized. It is called implicitly by SetSizer but
9759 if you use SetConstraints you should call it manually or otherwise the
9760 window layout won't be correctly updated when its size changes.
9762 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
9764 def GetAutoLayout(*args
, **kwargs
):
9766 GetAutoLayout(self) -> bool
9768 Returns the current autoLayout setting
9770 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
9772 def Layout(*args
, **kwargs
):
9774 Layout(self) -> bool
9776 Invokes the constraint-based layout algorithm or the sizer-based
9777 algorithm for this window. See SetAutoLayout: when auto layout is on,
9778 this function gets called automatically by the default EVT_SIZE
9779 handler when the window is resized.
9781 return _core_
.Window_Layout(*args
, **kwargs
)
9783 def SetSizer(*args
, **kwargs
):
9785 SetSizer(self, Sizer sizer, bool deleteOld=True)
9787 Sets the window to have the given layout sizer. The window will then
9788 own the object, and will take care of its deletion. If an existing
9789 layout sizer object is already owned by the window, it will be deleted
9790 if the deleteOld parameter is true. Note that this function will also
9791 call SetAutoLayout implicitly with a True parameter if the sizer is
9792 non-None, and False otherwise.
9794 return _core_
.Window_SetSizer(*args
, **kwargs
)
9796 def SetSizerAndFit(*args
, **kwargs
):
9798 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9800 The same as SetSizer, except it also sets the size hints for the
9801 window based on the sizer's minimum size.
9803 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
9805 def GetSizer(*args
, **kwargs
):
9807 GetSizer(self) -> Sizer
9809 Return the sizer associated with the window by a previous call to
9810 SetSizer or None if there isn't one.
9812 return _core_
.Window_GetSizer(*args
, **kwargs
)
9814 def SetContainingSizer(*args
, **kwargs
):
9816 SetContainingSizer(self, Sizer sizer)
9818 This normally does not need to be called by application code. It is
9819 called internally when a window is added to a sizer, and is used so
9820 the window can remove itself from the sizer when it is destroyed.
9822 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
9824 def GetContainingSizer(*args
, **kwargs
):
9826 GetContainingSizer(self) -> Sizer
9828 Return the sizer that this window is a member of, if any, otherwise None.
9830 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
9832 def InheritAttributes(*args
, **kwargs
):
9834 InheritAttributes(self)
9836 This function is (or should be, in case of custom controls) called
9837 during window creation to intelligently set up the window visual
9838 attributes, that is the font and the foreground and background
9841 By 'intelligently' the following is meant: by default, all windows use
9842 their own default attributes. However if some of the parent's
9843 attributes are explicitly changed (that is, using SetFont and not
9844 SetOwnFont) and if the corresponding attribute hadn't been
9845 explicitly set for this window itself, then this window takes the same
9846 value as used by the parent. In addition, if the window overrides
9847 ShouldInheritColours to return false, the colours will not be changed
9848 no matter what and only the font might.
9850 This rather complicated logic is necessary in order to accommodate the
9851 different usage scenarios. The most common one is when all default
9852 attributes are used and in this case, nothing should be inherited as
9853 in modern GUIs different controls use different fonts (and colours)
9854 than their siblings so they can't inherit the same value from the
9855 parent. However it was also deemed desirable to allow to simply change
9856 the attributes of all children at once by just changing the font or
9857 colour of their common parent, hence in this case we do inherit the
9861 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
9863 def ShouldInheritColours(*args
, **kwargs
):
9865 ShouldInheritColours(self) -> bool
9867 Return true from here to allow the colours of this window to be
9868 changed by InheritAttributes, returning false forbids inheriting them
9869 from the parent window.
9871 The base class version returns false, but this method is overridden in
9872 wxControl where it returns true.
9874 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
9876 def PostCreate(self
, pre
):
9878 Phase 3 of the 2-phase create <wink!>
9879 Call this method after precreating the window with the 2-phase create method.
9881 self
.this
= pre
.this
9882 self
.thisown
= pre
.thisown
9884 if hasattr(self
, '_setOORInfo'):
9885 self
._setOORInfo
(self
)
9886 if hasattr(self
, '_setCallbackInfo'):
9887 self
._setCallbackInfo
(self
, self
.__class
__)
9890 class WindowPtr(Window
):
9891 def __init__(self
, this
):
9893 if not hasattr(self
,"thisown"): self
.thisown
= 0
9894 self
.__class
__ = Window
9895 _core_
.Window_swigregister(WindowPtr
)
9897 def PreWindow(*args
, **kwargs
):
9899 PreWindow() -> Window
9901 Precreate a Window for 2-phase creation.
9903 val
= _core_
.new_PreWindow(*args
, **kwargs
)
9907 def Window_NewControlId(*args
, **kwargs
):
9909 Window_NewControlId() -> int
9911 Generate a control id for the controls which were not given one.
9913 return _core_
.Window_NewControlId(*args
, **kwargs
)
9915 def Window_NextControlId(*args
, **kwargs
):
9917 Window_NextControlId(int winid) -> int
9919 Get the id of the control following the one with the given
9922 return _core_
.Window_NextControlId(*args
, **kwargs
)
9924 def Window_PrevControlId(*args
, **kwargs
):
9926 Window_PrevControlId(int winid) -> int
9928 Get the id of the control preceding the one with the given
9931 return _core_
.Window_PrevControlId(*args
, **kwargs
)
9933 def Window_FindFocus(*args
, **kwargs
):
9935 Window_FindFocus() -> Window
9937 Returns the window or control that currently has the keyboard focus,
9940 return _core_
.Window_FindFocus(*args
, **kwargs
)
9942 def Window_GetCapture(*args
, **kwargs
):
9944 Window_GetCapture() -> Window
9946 Returns the window which currently captures the mouse or None
9948 return _core_
.Window_GetCapture(*args
, **kwargs
)
9950 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
9952 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9954 Get the default attributes for this class. This is useful if you want
9955 to use the same font or colour in your own control as in a standard
9956 control -- which is a much better idea than hard coding specific
9957 colours or fonts which might look completely out of place on the
9958 user's system, especially if it uses themes.
9960 The variant parameter is only relevant under Mac currently and is
9961 ignore under other platforms. Under Mac, it will change the size of
9962 the returned font. See `wx.Window.SetWindowVariant` for more about
9965 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9967 def DLG_PNT(win
, point_or_x
, y
=None):
9969 Convenience function for converting a Point or (x,y) in
9970 dialog units to pixel units.
9973 return win
.ConvertDialogPointToPixels(point_or_x
)
9975 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
9977 def DLG_SZE(win
, size_width
, height
=None):
9979 Convenience function for converting a Size or (w,h) in
9980 dialog units to pixel units.
9983 return win
.ConvertDialogSizeToPixels(size_width
)
9985 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
9988 def FindWindowById(*args
, **kwargs
):
9990 FindWindowById(long id, Window parent=None) -> Window
9992 Find the first window in the application with the given id. If parent
9993 is None, the search will start from all top-level frames and dialog
9994 boxes; if non-None, the search will be limited to the given window
9995 hierarchy. The search is recursive in both cases.
9997 return _core_
.FindWindowById(*args
, **kwargs
)
9999 def FindWindowByName(*args
, **kwargs
):
10001 FindWindowByName(String name, Window parent=None) -> Window
10003 Find a window by its name (as given in a window constructor or Create
10004 function call). If parent is None, the search will start from all
10005 top-level frames and dialog boxes; if non-None, the search will be
10006 limited to the given window hierarchy. The search is recursive in both
10009 If no window with such name is found, wx.FindWindowByLabel is called.
10011 return _core_
.FindWindowByName(*args
, **kwargs
)
10013 def FindWindowByLabel(*args
, **kwargs
):
10015 FindWindowByLabel(String label, Window parent=None) -> Window
10017 Find a window by its label. Depending on the type of window, the label
10018 may be a window title or panel item label. If parent is None, the
10019 search will start from all top-level frames and dialog boxes; if
10020 non-None, the search will be limited to the given window
10021 hierarchy. The search is recursive in both cases.
10023 return _core_
.FindWindowByLabel(*args
, **kwargs
)
10025 def Window_FromHWND(*args
, **kwargs
):
10026 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10027 return _core_
.Window_FromHWND(*args
, **kwargs
)
10029 def GetTopLevelWindows(*args
, **kwargs
):
10031 GetTopLevelWindows() -> PyObject
10033 Returns a list of the the application's top-level windows, (frames,
10034 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10035 by wxWidgets, and so it is only valid as long as no top-level windows
10036 are closed or new top-level windows are created.
10039 return _core_
.GetTopLevelWindows(*args
, **kwargs
)
10040 #---------------------------------------------------------------------------
10042 class Validator(EvtHandler
):
10043 """Proxy of C++ Validator class"""
10044 def __repr__(self
):
10045 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10046 def __init__(self
, *args
, **kwargs
):
10047 """__init__(self) -> Validator"""
10048 newobj
= _core_
.new_Validator(*args
, **kwargs
)
10049 self
.this
= newobj
.this
10052 self
._setOORInfo
(self
)
10054 def Clone(*args
, **kwargs
):
10055 """Clone(self) -> Validator"""
10056 return _core_
.Validator_Clone(*args
, **kwargs
)
10058 def Validate(*args
, **kwargs
):
10059 """Validate(self, Window parent) -> bool"""
10060 return _core_
.Validator_Validate(*args
, **kwargs
)
10062 def TransferToWindow(*args
, **kwargs
):
10063 """TransferToWindow(self) -> bool"""
10064 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
10066 def TransferFromWindow(*args
, **kwargs
):
10067 """TransferFromWindow(self) -> bool"""
10068 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
10070 def GetWindow(*args
, **kwargs
):
10071 """GetWindow(self) -> Window"""
10072 return _core_
.Validator_GetWindow(*args
, **kwargs
)
10074 def SetWindow(*args
, **kwargs
):
10075 """SetWindow(self, Window window)"""
10076 return _core_
.Validator_SetWindow(*args
, **kwargs
)
10078 def IsSilent(*args
, **kwargs
):
10079 """IsSilent() -> bool"""
10080 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10082 IsSilent
= staticmethod(IsSilent
)
10083 def SetBellOnError(*args
, **kwargs
):
10084 """SetBellOnError(int doIt=True)"""
10085 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10087 SetBellOnError
= staticmethod(SetBellOnError
)
10089 class ValidatorPtr(Validator
):
10090 def __init__(self
, this
):
10092 if not hasattr(self
,"thisown"): self
.thisown
= 0
10093 self
.__class
__ = Validator
10094 _core_
.Validator_swigregister(ValidatorPtr
)
10096 def Validator_IsSilent(*args
, **kwargs
):
10097 """Validator_IsSilent() -> bool"""
10098 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10100 def Validator_SetBellOnError(*args
, **kwargs
):
10101 """Validator_SetBellOnError(int doIt=True)"""
10102 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10104 class PyValidator(Validator
):
10105 """Proxy of C++ PyValidator class"""
10106 def __repr__(self
):
10107 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10108 def __init__(self
, *args
, **kwargs
):
10109 """__init__(self) -> PyValidator"""
10110 newobj
= _core_
.new_PyValidator(*args
, **kwargs
)
10111 self
.this
= newobj
.this
10115 self
._setCallbackInfo
(self
, PyValidator
, 1)
10116 self
._setOORInfo
(self
)
10118 def _setCallbackInfo(*args
, **kwargs
):
10119 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10120 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
10123 class PyValidatorPtr(PyValidator
):
10124 def __init__(self
, this
):
10126 if not hasattr(self
,"thisown"): self
.thisown
= 0
10127 self
.__class
__ = PyValidator
10128 _core_
.PyValidator_swigregister(PyValidatorPtr
)
10130 #---------------------------------------------------------------------------
10132 class Menu(EvtHandler
):
10133 """Proxy of C++ Menu class"""
10134 def __repr__(self
):
10135 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10136 def __init__(self
, *args
, **kwargs
):
10137 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10138 newobj
= _core_
.new_Menu(*args
, **kwargs
)
10139 self
.this
= newobj
.this
10142 self
._setOORInfo
(self
)
10144 def Append(*args
, **kwargs
):
10145 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10146 return _core_
.Menu_Append(*args
, **kwargs
)
10148 def AppendSeparator(*args
, **kwargs
):
10149 """AppendSeparator(self) -> MenuItem"""
10150 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
10152 def AppendCheckItem(*args
, **kwargs
):
10153 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10154 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
10156 def AppendRadioItem(*args
, **kwargs
):
10157 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10158 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
10160 def AppendMenu(*args
, **kwargs
):
10161 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10162 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
10164 def AppendItem(*args
, **kwargs
):
10165 """AppendItem(self, MenuItem item) -> MenuItem"""
10166 return _core_
.Menu_AppendItem(*args
, **kwargs
)
10168 def Break(*args
, **kwargs
):
10170 return _core_
.Menu_Break(*args
, **kwargs
)
10172 def InsertItem(*args
, **kwargs
):
10173 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10174 return _core_
.Menu_InsertItem(*args
, **kwargs
)
10176 def Insert(*args
, **kwargs
):
10178 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10179 int kind=ITEM_NORMAL) -> MenuItem
10181 return _core_
.Menu_Insert(*args
, **kwargs
)
10183 def InsertSeparator(*args
, **kwargs
):
10184 """InsertSeparator(self, size_t pos) -> MenuItem"""
10185 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
10187 def InsertCheckItem(*args
, **kwargs
):
10188 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10189 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
10191 def InsertRadioItem(*args
, **kwargs
):
10192 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10193 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
10195 def InsertMenu(*args
, **kwargs
):
10196 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10197 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
10199 def PrependItem(*args
, **kwargs
):
10200 """PrependItem(self, MenuItem item) -> MenuItem"""
10201 return _core_
.Menu_PrependItem(*args
, **kwargs
)
10203 def Prepend(*args
, **kwargs
):
10204 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10205 return _core_
.Menu_Prepend(*args
, **kwargs
)
10207 def PrependSeparator(*args
, **kwargs
):
10208 """PrependSeparator(self) -> MenuItem"""
10209 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
10211 def PrependCheckItem(*args
, **kwargs
):
10212 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10213 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
10215 def PrependRadioItem(*args
, **kwargs
):
10216 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10217 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
10219 def PrependMenu(*args
, **kwargs
):
10220 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10221 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
10223 def Remove(*args
, **kwargs
):
10224 """Remove(self, int id) -> MenuItem"""
10225 return _core_
.Menu_Remove(*args
, **kwargs
)
10227 def RemoveItem(*args
, **kwargs
):
10228 """RemoveItem(self, MenuItem item) -> MenuItem"""
10229 return _core_
.Menu_RemoveItem(*args
, **kwargs
)
10231 def Delete(*args
, **kwargs
):
10232 """Delete(self, int id) -> bool"""
10233 return _core_
.Menu_Delete(*args
, **kwargs
)
10235 def DeleteItem(*args
, **kwargs
):
10236 """DeleteItem(self, MenuItem item) -> bool"""
10237 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
10239 def Destroy(*args
, **kwargs
):
10243 Deletes the C++ object this Python object is a proxy for.
10245 return _core_
.Menu_Destroy(*args
, **kwargs
)
10247 def DestroyId(*args
, **kwargs
):
10249 DestroyId(self, int id) -> bool
10251 Deletes the C++ object this Python object is a proxy for.
10253 return _core_
.Menu_DestroyId(*args
, **kwargs
)
10255 def DestroyItem(*args
, **kwargs
):
10257 DestroyItem(self, MenuItem item) -> bool
10259 Deletes the C++ object this Python object is a proxy for.
10261 return _core_
.Menu_DestroyItem(*args
, **kwargs
)
10263 def GetMenuItemCount(*args
, **kwargs
):
10264 """GetMenuItemCount(self) -> size_t"""
10265 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
10267 def GetMenuItems(*args
, **kwargs
):
10268 """GetMenuItems(self) -> PyObject"""
10269 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
10271 def FindItem(*args
, **kwargs
):
10272 """FindItem(self, String item) -> int"""
10273 return _core_
.Menu_FindItem(*args
, **kwargs
)
10275 def FindItemById(*args
, **kwargs
):
10276 """FindItemById(self, int id) -> MenuItem"""
10277 return _core_
.Menu_FindItemById(*args
, **kwargs
)
10279 def FindItemByPosition(*args
, **kwargs
):
10280 """FindItemByPosition(self, size_t position) -> MenuItem"""
10281 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
10283 def Enable(*args
, **kwargs
):
10284 """Enable(self, int id, bool enable)"""
10285 return _core_
.Menu_Enable(*args
, **kwargs
)
10287 def IsEnabled(*args
, **kwargs
):
10288 """IsEnabled(self, int id) -> bool"""
10289 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
10291 def Check(*args
, **kwargs
):
10292 """Check(self, int id, bool check)"""
10293 return _core_
.Menu_Check(*args
, **kwargs
)
10295 def IsChecked(*args
, **kwargs
):
10296 """IsChecked(self, int id) -> bool"""
10297 return _core_
.Menu_IsChecked(*args
, **kwargs
)
10299 def SetLabel(*args
, **kwargs
):
10300 """SetLabel(self, int id, String label)"""
10301 return _core_
.Menu_SetLabel(*args
, **kwargs
)
10303 def GetLabel(*args
, **kwargs
):
10304 """GetLabel(self, int id) -> String"""
10305 return _core_
.Menu_GetLabel(*args
, **kwargs
)
10307 def SetHelpString(*args
, **kwargs
):
10308 """SetHelpString(self, int id, String helpString)"""
10309 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
10311 def GetHelpString(*args
, **kwargs
):
10312 """GetHelpString(self, int id) -> String"""
10313 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
10315 def SetTitle(*args
, **kwargs
):
10316 """SetTitle(self, String title)"""
10317 return _core_
.Menu_SetTitle(*args
, **kwargs
)
10319 def GetTitle(*args
, **kwargs
):
10320 """GetTitle(self) -> String"""
10321 return _core_
.Menu_GetTitle(*args
, **kwargs
)
10323 def SetEventHandler(*args
, **kwargs
):
10324 """SetEventHandler(self, EvtHandler handler)"""
10325 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
10327 def GetEventHandler(*args
, **kwargs
):
10328 """GetEventHandler(self) -> EvtHandler"""
10329 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
10331 def SetInvokingWindow(*args
, **kwargs
):
10332 """SetInvokingWindow(self, Window win)"""
10333 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
10335 def GetInvokingWindow(*args
, **kwargs
):
10336 """GetInvokingWindow(self) -> Window"""
10337 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
10339 def GetStyle(*args
, **kwargs
):
10340 """GetStyle(self) -> long"""
10341 return _core_
.Menu_GetStyle(*args
, **kwargs
)
10343 def UpdateUI(*args
, **kwargs
):
10344 """UpdateUI(self, EvtHandler source=None)"""
10345 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
10347 def GetMenuBar(*args
, **kwargs
):
10348 """GetMenuBar(self) -> MenuBar"""
10349 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
10351 def Attach(*args
, **kwargs
):
10352 """Attach(self, wxMenuBarBase menubar)"""
10353 return _core_
.Menu_Attach(*args
, **kwargs
)
10355 def Detach(*args
, **kwargs
):
10357 return _core_
.Menu_Detach(*args
, **kwargs
)
10359 def IsAttached(*args
, **kwargs
):
10360 """IsAttached(self) -> bool"""
10361 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10363 def SetParent(*args
, **kwargs
):
10364 """SetParent(self, Menu parent)"""
10365 return _core_
.Menu_SetParent(*args
, **kwargs
)
10367 def GetParent(*args
, **kwargs
):
10368 """GetParent(self) -> Menu"""
10369 return _core_
.Menu_GetParent(*args
, **kwargs
)
10372 class MenuPtr(Menu
):
10373 def __init__(self
, this
):
10375 if not hasattr(self
,"thisown"): self
.thisown
= 0
10376 self
.__class
__ = Menu
10377 _core_
.Menu_swigregister(MenuPtr
)
10378 DefaultValidator
= cvar
.DefaultValidator
10380 #---------------------------------------------------------------------------
10382 class MenuBar(Window
):
10383 """Proxy of C++ MenuBar class"""
10384 def __repr__(self
):
10385 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10386 def __init__(self
, *args
, **kwargs
):
10387 """__init__(self, long style=0) -> MenuBar"""
10388 newobj
= _core_
.new_MenuBar(*args
, **kwargs
)
10389 self
.this
= newobj
.this
10392 self
._setOORInfo
(self
)
10394 def Append(*args
, **kwargs
):
10395 """Append(self, Menu menu, String title) -> bool"""
10396 return _core_
.MenuBar_Append(*args
, **kwargs
)
10398 def Insert(*args
, **kwargs
):
10399 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10400 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10402 def GetMenuCount(*args
, **kwargs
):
10403 """GetMenuCount(self) -> size_t"""
10404 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
10406 def GetMenu(*args
, **kwargs
):
10407 """GetMenu(self, size_t pos) -> Menu"""
10408 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
10410 def Replace(*args
, **kwargs
):
10411 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10412 return _core_
.MenuBar_Replace(*args
, **kwargs
)
10414 def Remove(*args
, **kwargs
):
10415 """Remove(self, size_t pos) -> Menu"""
10416 return _core_
.MenuBar_Remove(*args
, **kwargs
)
10418 def EnableTop(*args
, **kwargs
):
10419 """EnableTop(self, size_t pos, bool enable)"""
10420 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
10422 def IsEnabledTop(*args
, **kwargs
):
10423 """IsEnabledTop(self, size_t pos) -> bool"""
10424 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
10426 def SetLabelTop(*args
, **kwargs
):
10427 """SetLabelTop(self, size_t pos, String label)"""
10428 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
10430 def GetLabelTop(*args
, **kwargs
):
10431 """GetLabelTop(self, size_t pos) -> String"""
10432 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
10434 def FindMenuItem(*args
, **kwargs
):
10435 """FindMenuItem(self, String menu, String item) -> int"""
10436 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
10438 def FindItemById(*args
, **kwargs
):
10439 """FindItemById(self, int id) -> MenuItem"""
10440 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
10442 def FindMenu(*args
, **kwargs
):
10443 """FindMenu(self, String title) -> int"""
10444 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
10446 def Enable(*args
, **kwargs
):
10447 """Enable(self, int id, bool enable)"""
10448 return _core_
.MenuBar_Enable(*args
, **kwargs
)
10450 def Check(*args
, **kwargs
):
10451 """Check(self, int id, bool check)"""
10452 return _core_
.MenuBar_Check(*args
, **kwargs
)
10454 def IsChecked(*args
, **kwargs
):
10455 """IsChecked(self, int id) -> bool"""
10456 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
10458 def IsEnabled(*args
, **kwargs
):
10459 """IsEnabled(self, int id) -> bool"""
10460 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
10462 def SetLabel(*args
, **kwargs
):
10463 """SetLabel(self, int id, String label)"""
10464 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
10466 def GetLabel(*args
, **kwargs
):
10467 """GetLabel(self, int id) -> String"""
10468 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
10470 def SetHelpString(*args
, **kwargs
):
10471 """SetHelpString(self, int id, String helpString)"""
10472 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
10474 def GetHelpString(*args
, **kwargs
):
10475 """GetHelpString(self, int id) -> String"""
10476 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
10478 def GetFrame(*args
, **kwargs
):
10479 """GetFrame(self) -> wxFrame"""
10480 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
10482 def IsAttached(*args
, **kwargs
):
10483 """IsAttached(self) -> bool"""
10484 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
10486 def Attach(*args
, **kwargs
):
10487 """Attach(self, wxFrame frame)"""
10488 return _core_
.MenuBar_Attach(*args
, **kwargs
)
10490 def Detach(*args
, **kwargs
):
10492 return _core_
.MenuBar_Detach(*args
, **kwargs
)
10495 class MenuBarPtr(MenuBar
):
10496 def __init__(self
, this
):
10498 if not hasattr(self
,"thisown"): self
.thisown
= 0
10499 self
.__class
__ = MenuBar
10500 _core_
.MenuBar_swigregister(MenuBarPtr
)
10502 #---------------------------------------------------------------------------
10504 class MenuItem(Object
):
10505 """Proxy of C++ MenuItem class"""
10506 def __repr__(self
):
10507 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10508 def __init__(self
, *args
, **kwargs
):
10510 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10511 String help=EmptyString, int kind=ITEM_NORMAL,
10512 Menu subMenu=None) -> MenuItem
10514 newobj
= _core_
.new_MenuItem(*args
, **kwargs
)
10515 self
.this
= newobj
.this
10518 def GetMenu(*args
, **kwargs
):
10519 """GetMenu(self) -> Menu"""
10520 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
10522 def SetMenu(*args
, **kwargs
):
10523 """SetMenu(self, Menu menu)"""
10524 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
10526 def SetId(*args
, **kwargs
):
10527 """SetId(self, int id)"""
10528 return _core_
.MenuItem_SetId(*args
, **kwargs
)
10530 def GetId(*args
, **kwargs
):
10531 """GetId(self) -> int"""
10532 return _core_
.MenuItem_GetId(*args
, **kwargs
)
10534 def IsSeparator(*args
, **kwargs
):
10535 """IsSeparator(self) -> bool"""
10536 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
10538 def SetText(*args
, **kwargs
):
10539 """SetText(self, String str)"""
10540 return _core_
.MenuItem_SetText(*args
, **kwargs
)
10542 def GetLabel(*args
, **kwargs
):
10543 """GetLabel(self) -> String"""
10544 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
10546 def GetText(*args
, **kwargs
):
10547 """GetText(self) -> String"""
10548 return _core_
.MenuItem_GetText(*args
, **kwargs
)
10550 def GetLabelFromText(*args
, **kwargs
):
10551 """GetLabelFromText(String text) -> String"""
10552 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10554 GetLabelFromText
= staticmethod(GetLabelFromText
)
10555 def GetKind(*args
, **kwargs
):
10556 """GetKind(self) -> int"""
10557 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
10559 def SetKind(*args
, **kwargs
):
10560 """SetKind(self, int kind)"""
10561 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
10563 def SetCheckable(*args
, **kwargs
):
10564 """SetCheckable(self, bool checkable)"""
10565 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
10567 def IsCheckable(*args
, **kwargs
):
10568 """IsCheckable(self) -> bool"""
10569 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
10571 def IsSubMenu(*args
, **kwargs
):
10572 """IsSubMenu(self) -> bool"""
10573 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
10575 def SetSubMenu(*args
, **kwargs
):
10576 """SetSubMenu(self, Menu menu)"""
10577 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
10579 def GetSubMenu(*args
, **kwargs
):
10580 """GetSubMenu(self) -> Menu"""
10581 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
10583 def Enable(*args
, **kwargs
):
10584 """Enable(self, bool enable=True)"""
10585 return _core_
.MenuItem_Enable(*args
, **kwargs
)
10587 def IsEnabled(*args
, **kwargs
):
10588 """IsEnabled(self) -> bool"""
10589 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
10591 def Check(*args
, **kwargs
):
10592 """Check(self, bool check=True)"""
10593 return _core_
.MenuItem_Check(*args
, **kwargs
)
10595 def IsChecked(*args
, **kwargs
):
10596 """IsChecked(self) -> bool"""
10597 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
10599 def Toggle(*args
, **kwargs
):
10601 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
10603 def SetHelp(*args
, **kwargs
):
10604 """SetHelp(self, String str)"""
10605 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
10607 def GetHelp(*args
, **kwargs
):
10608 """GetHelp(self) -> String"""
10609 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
10611 def GetAccel(*args
, **kwargs
):
10612 """GetAccel(self) -> AcceleratorEntry"""
10613 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
10615 def SetAccel(*args
, **kwargs
):
10616 """SetAccel(self, AcceleratorEntry accel)"""
10617 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
10619 def SetFont(*args
, **kwargs
):
10620 """SetFont(self, Font font)"""
10621 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
10623 def GetFont(*args
, **kwargs
):
10624 """GetFont(self) -> Font"""
10625 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
10627 def SetTextColour(*args
, **kwargs
):
10628 """SetTextColour(self, Colour colText)"""
10629 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
10631 def GetTextColour(*args
, **kwargs
):
10632 """GetTextColour(self) -> Colour"""
10633 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
10635 def SetBackgroundColour(*args
, **kwargs
):
10636 """SetBackgroundColour(self, Colour colBack)"""
10637 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
10639 def GetBackgroundColour(*args
, **kwargs
):
10640 """GetBackgroundColour(self) -> Colour"""
10641 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
10643 def SetBitmaps(*args
, **kwargs
):
10644 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10645 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
10647 def SetDisabledBitmap(*args
, **kwargs
):
10648 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10649 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
10651 def GetDisabledBitmap(*args
, **kwargs
):
10652 """GetDisabledBitmap(self) -> Bitmap"""
10653 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
10655 def SetMarginWidth(*args
, **kwargs
):
10656 """SetMarginWidth(self, int nWidth)"""
10657 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
10659 def GetMarginWidth(*args
, **kwargs
):
10660 """GetMarginWidth(self) -> int"""
10661 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
10663 def GetDefaultMarginWidth(*args
, **kwargs
):
10664 """GetDefaultMarginWidth() -> int"""
10665 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10667 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
10668 def IsOwnerDrawn(*args
, **kwargs
):
10669 """IsOwnerDrawn(self) -> bool"""
10670 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
10672 def SetOwnerDrawn(*args
, **kwargs
):
10673 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10674 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
10676 def ResetOwnerDrawn(*args
, **kwargs
):
10677 """ResetOwnerDrawn(self)"""
10678 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
10680 def SetBitmap(*args
, **kwargs
):
10681 """SetBitmap(self, Bitmap bitmap)"""
10682 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
10684 def GetBitmap(*args
, **kwargs
):
10685 """GetBitmap(self) -> Bitmap"""
10686 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
10689 class MenuItemPtr(MenuItem
):
10690 def __init__(self
, this
):
10692 if not hasattr(self
,"thisown"): self
.thisown
= 0
10693 self
.__class
__ = MenuItem
10694 _core_
.MenuItem_swigregister(MenuItemPtr
)
10696 def MenuItem_GetLabelFromText(*args
, **kwargs
):
10697 """MenuItem_GetLabelFromText(String text) -> String"""
10698 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10700 def MenuItem_GetDefaultMarginWidth(*args
, **kwargs
):
10701 """MenuItem_GetDefaultMarginWidth() -> int"""
10702 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10704 #---------------------------------------------------------------------------
10706 class Control(Window
):
10708 This is the base class for a control or 'widget'.
10710 A control is generally a small window which processes user input
10711 and/or displays one or more item of data.
10713 def __repr__(self
):
10714 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10715 def __init__(self
, *args
, **kwargs
):
10717 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10718 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10719 String name=ControlNameStr) -> Control
10721 Create a Control. Normally you should only call this from a subclass'
10722 __init__ as a plain old wx.Control is not very useful.
10724 newobj
= _core_
.new_Control(*args
, **kwargs
)
10725 self
.this
= newobj
.this
10728 self
._setOORInfo
(self
)
10730 def Create(*args
, **kwargs
):
10732 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10733 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10734 String name=ControlNameStr) -> bool
10736 Do the 2nd phase and create the GUI control.
10738 return _core_
.Control_Create(*args
, **kwargs
)
10740 def Command(*args
, **kwargs
):
10742 Command(self, CommandEvent event)
10744 Simulates the effect of the user issuing a command to the item.
10746 :see: `wx.CommandEvent`
10749 return _core_
.Control_Command(*args
, **kwargs
)
10751 def GetLabel(*args
, **kwargs
):
10753 GetLabel(self) -> String
10755 Return a control's text.
10757 return _core_
.Control_GetLabel(*args
, **kwargs
)
10759 def SetLabel(*args
, **kwargs
):
10761 SetLabel(self, String label)
10763 Sets the item's text.
10765 return _core_
.Control_SetLabel(*args
, **kwargs
)
10767 def GetClassDefaultAttributes(*args
, **kwargs
):
10769 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10771 Get the default attributes for this class. This is useful if you want
10772 to use the same font or colour in your own control as in a standard
10773 control -- which is a much better idea than hard coding specific
10774 colours or fonts which might look completely out of place on the
10775 user's system, especially if it uses themes.
10777 The variant parameter is only relevant under Mac currently and is
10778 ignore under other platforms. Under Mac, it will change the size of
10779 the returned font. See `wx.Window.SetWindowVariant` for more about
10782 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10784 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
10786 class ControlPtr(Control
):
10787 def __init__(self
, this
):
10789 if not hasattr(self
,"thisown"): self
.thisown
= 0
10790 self
.__class
__ = Control
10791 _core_
.Control_swigregister(ControlPtr
)
10792 ControlNameStr
= cvar
.ControlNameStr
10794 def PreControl(*args
, **kwargs
):
10796 PreControl() -> Control
10798 Precreate a Control control for 2-phase creation
10800 val
= _core_
.new_PreControl(*args
, **kwargs
)
10804 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
10806 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10808 Get the default attributes for this class. This is useful if you want
10809 to use the same font or colour in your own control as in a standard
10810 control -- which is a much better idea than hard coding specific
10811 colours or fonts which might look completely out of place on the
10812 user's system, especially if it uses themes.
10814 The variant parameter is only relevant under Mac currently and is
10815 ignore under other platforms. Under Mac, it will change the size of
10816 the returned font. See `wx.Window.SetWindowVariant` for more about
10819 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10821 #---------------------------------------------------------------------------
10823 class ItemContainer(object):
10825 The wx.ItemContainer class defines an interface which is implemented
10826 by all controls which have string subitems, each of which may be
10827 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10828 as `wx.ComboBox` which implements an extended interface deriving from
10831 It defines the methods for accessing the control's items and although
10832 each of the derived classes implements them differently, they still
10833 all conform to the same interface.
10835 The items in a wx.ItemContainer have (non empty) string labels and,
10836 optionally, client data associated with them.
10839 def __init__(self
): raise RuntimeError, "No constructor defined"
10840 def __repr__(self
):
10841 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10842 def Append(*args
, **kwargs
):
10844 Append(self, String item, PyObject clientData=None) -> int
10846 Adds the item to the control, associating the given data with the item
10847 if not None. The return value is the index of the newly added item
10848 which may be different from the last one if the control is sorted (e.g.
10849 has wx.LB_SORT or wx.CB_SORT style).
10851 return _core_
.ItemContainer_Append(*args
, **kwargs
)
10853 def AppendItems(*args
, **kwargs
):
10855 AppendItems(self, List strings)
10857 Apend several items at once to the control. Notice that calling this
10858 method may be much faster than appending the items one by one if you
10859 need to add a lot of items.
10861 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
10863 def Insert(*args
, **kwargs
):
10865 Insert(self, String item, int pos, PyObject clientData=None) -> int
10867 Insert an item into the control before the item at the ``pos`` index,
10868 optionally associating some data object with the item.
10870 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
10872 def Clear(*args
, **kwargs
):
10876 Removes all items from the control.
10878 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
10880 def Delete(*args
, **kwargs
):
10882 Delete(self, int n)
10884 Deletes the item at the zero-based index 'n' from the control. Note
10885 that it is an error (signalled by a `wx.PyAssertionError` exception if
10886 enabled) to remove an item with the index negative or greater or equal
10887 than the number of items in the control.
10889 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
10891 def GetClientData(*args
, **kwargs
):
10893 GetClientData(self, int n) -> PyObject
10895 Returns the client data associated with the given item, (if any.)
10897 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
10899 def SetClientData(*args
, **kwargs
):
10901 SetClientData(self, int n, PyObject clientData)
10903 Associate the given client data with the item at position n.
10905 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
10907 def GetCount(*args
, **kwargs
):
10909 GetCount(self) -> int
10911 Returns the number of items in the control.
10913 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
10915 def IsEmpty(*args
, **kwargs
):
10917 IsEmpty(self) -> bool
10919 Returns True if the control is empty or False if it has some items.
10921 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
10923 def GetString(*args
, **kwargs
):
10925 GetString(self, int n) -> String
10927 Returns the label of the item with the given index.
10929 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
10931 def GetStrings(*args
, **kwargs
):
10932 """GetStrings(self) -> wxArrayString"""
10933 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
10935 def SetString(*args
, **kwargs
):
10937 SetString(self, int n, String s)
10939 Sets the label for the given item.
10941 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
10943 def FindString(*args
, **kwargs
):
10945 FindString(self, String s) -> int
10947 Finds an item whose label matches the given string. Returns the
10948 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10951 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
10953 def SetSelection(*args
, **kwargs
):
10955 SetSelection(self, int n)
10957 Sets the item at index 'n' to be the selected item.
10959 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
10961 def GetSelection(*args
, **kwargs
):
10963 GetSelection(self) -> int
10965 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10968 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
10970 def SetStringSelection(*args
, **kwargs
):
10971 """SetStringSelection(self, String s) -> bool"""
10972 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
10974 def GetStringSelection(*args
, **kwargs
):
10976 GetStringSelection(self) -> String
10978 Returns the label of the selected item or an empty string if no item
10981 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
10983 def Select(*args
, **kwargs
):
10985 Select(self, int n)
10987 This is the same as `SetSelection` and exists only because it is
10988 slightly more natural for controls which support multiple selection.
10990 return _core_
.ItemContainer_Select(*args
, **kwargs
)
10993 class ItemContainerPtr(ItemContainer
):
10994 def __init__(self
, this
):
10996 if not hasattr(self
,"thisown"): self
.thisown
= 0
10997 self
.__class
__ = ItemContainer
10998 _core_
.ItemContainer_swigregister(ItemContainerPtr
)
11000 #---------------------------------------------------------------------------
11002 class ControlWithItems(Control
,ItemContainer
):
11004 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11005 wx.Control class, and is used for the base class of various controls
11008 def __init__(self
): raise RuntimeError, "No constructor defined"
11009 def __repr__(self
):
11010 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11012 class ControlWithItemsPtr(ControlWithItems
):
11013 def __init__(self
, this
):
11015 if not hasattr(self
,"thisown"): self
.thisown
= 0
11016 self
.__class
__ = ControlWithItems
11017 _core_
.ControlWithItems_swigregister(ControlWithItemsPtr
)
11019 #---------------------------------------------------------------------------
11021 class SizerItem(Object
):
11023 The wx.SizerItem class is used to track the position, size and other
11024 attributes of each item managed by a `wx.Sizer`. In normal usage user
11025 code should never need to deal directly with a wx.SizerItem, but
11026 custom classes derived from `wx.PySizer` will probably need to use the
11027 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11029 :see: `wx.Sizer`, `wx.GBSizerItem`
11031 def __repr__(self
):
11032 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11033 def __init__(self
, *args
, **kwargs
):
11035 __init__(self) -> SizerItem
11037 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11038 size will need to be set before this item can be used in a Sizer.
11040 You will probably never need to create a wx.SizerItem directly as they
11041 are created automatically when the sizer's Add, Insert or Prepend
11042 methods are called.
11044 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11046 newobj
= _core_
.new_SizerItem(*args
, **kwargs
)
11047 self
.this
= newobj
.this
11050 def DeleteWindows(*args
, **kwargs
):
11052 DeleteWindows(self)
11054 Destroy the window or the windows in a subsizer, depending on the type
11057 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
11059 def DetachSizer(*args
, **kwargs
):
11063 Enable deleting the SizerItem without destroying the contained sizer.
11065 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
11067 def GetSize(*args
, **kwargs
):
11069 GetSize(self) -> Size
11071 Get the current size of the item, as set in the last Layout.
11073 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
11075 def CalcMin(*args
, **kwargs
):
11077 CalcMin(self) -> Size
11079 Calculates the minimum desired size for the item, including any space
11082 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
11084 def SetDimension(*args
, **kwargs
):
11086 SetDimension(self, Point pos, Size size)
11088 Set the position and size of the space allocated for this item by the
11089 sizer, and adjust the position and size of the item (window or
11090 subsizer) to be within that space taking alignment and borders into
11093 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
11095 def GetMinSize(*args
, **kwargs
):
11097 GetMinSize(self) -> Size
11099 Get the minimum size needed for the item.
11101 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
11103 def GetMinSizeWithBorder(*args
, **kwargs
):
11105 GetMinSizeWithBorder(self) -> Size
11107 Get the minimum size needed for the item with space for the borders
11110 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
11112 def SetInitSize(*args
, **kwargs
):
11113 """SetInitSize(self, int x, int y)"""
11114 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
11116 def SetRatioWH(*args
, **kwargs
):
11118 SetRatioWH(self, int width, int height)
11120 Set the ratio item attribute.
11122 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
11124 def SetRatioSize(*args
, **kwargs
):
11126 SetRatioSize(self, Size size)
11128 Set the ratio item attribute.
11130 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
11132 def SetRatio(*args
, **kwargs
):
11134 SetRatio(self, float ratio)
11136 Set the ratio item attribute.
11138 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
11140 def GetRatio(*args
, **kwargs
):
11142 GetRatio(self) -> float
11144 Set the ratio item attribute.
11146 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
11148 def GetRect(*args
, **kwargs
):
11150 GetRect(self) -> Rect
11152 Returns the rectangle that the sizer item should occupy
11154 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
11156 def IsWindow(*args
, **kwargs
):
11158 IsWindow(self) -> bool
11160 Is this sizer item a window?
11162 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
11164 def IsSizer(*args
, **kwargs
):
11166 IsSizer(self) -> bool
11168 Is this sizer item a subsizer?
11170 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
11172 def IsSpacer(*args
, **kwargs
):
11174 IsSpacer(self) -> bool
11176 Is this sizer item a spacer?
11178 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
11180 def SetProportion(*args
, **kwargs
):
11182 SetProportion(self, int proportion)
11184 Set the proportion value for this item.
11186 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
11188 def GetProportion(*args
, **kwargs
):
11190 GetProportion(self) -> int
11192 Get the proportion value for this item.
11194 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
11196 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
11197 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
11198 def SetFlag(*args
, **kwargs
):
11200 SetFlag(self, int flag)
11202 Set the flag value for this item.
11204 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
11206 def GetFlag(*args
, **kwargs
):
11208 GetFlag(self) -> int
11210 Get the flag value for this item.
11212 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
11214 def SetBorder(*args
, **kwargs
):
11216 SetBorder(self, int border)
11218 Set the border value for this item.
11220 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
11222 def GetBorder(*args
, **kwargs
):
11224 GetBorder(self) -> int
11226 Get the border value for this item.
11228 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
11230 def GetWindow(*args
, **kwargs
):
11232 GetWindow(self) -> Window
11234 Get the window (if any) that is managed by this sizer item.
11236 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
11238 def SetWindow(*args
, **kwargs
):
11240 SetWindow(self, Window window)
11242 Set the window to be managed by this sizer item.
11244 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
11246 def GetSizer(*args
, **kwargs
):
11248 GetSizer(self) -> Sizer
11250 Get the subsizer (if any) that is managed by this sizer item.
11252 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
11254 def SetSizer(*args
, **kwargs
):
11256 SetSizer(self, Sizer sizer)
11258 Set the subsizer to be managed by this sizer item.
11260 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
11262 def GetSpacer(*args
, **kwargs
):
11264 GetSpacer(self) -> Size
11266 Get the size of the spacer managed by this sizer item.
11268 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
11270 def SetSpacer(*args
, **kwargs
):
11272 SetSpacer(self, Size size)
11274 Set the size of the spacer to be managed by this sizer item.
11276 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
11278 def Show(*args
, **kwargs
):
11280 Show(self, bool show)
11282 Set the show item attribute, which sizers use to determine if the item
11283 is to be made part of the layout or not. If the item is tracking a
11284 window then it is shown or hidden as needed.
11286 return _core_
.SizerItem_Show(*args
, **kwargs
)
11288 def IsShown(*args
, **kwargs
):
11290 IsShown(self) -> bool
11292 Is the item to be shown in the layout?
11294 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
11296 def GetPosition(*args
, **kwargs
):
11298 GetPosition(self) -> Point
11300 Returns the current position of the item, as set in the last Layout.
11302 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
11304 def GetUserData(*args
, **kwargs
):
11306 GetUserData(self) -> PyObject
11308 Returns the userData associated with this sizer item, or None if there
11311 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
11314 class SizerItemPtr(SizerItem
):
11315 def __init__(self
, this
):
11317 if not hasattr(self
,"thisown"): self
.thisown
= 0
11318 self
.__class
__ = SizerItem
11319 _core_
.SizerItem_swigregister(SizerItemPtr
)
11321 def SizerItemWindow(*args
, **kwargs
):
11323 SizerItemWindow(Window window, int proportion, int flag, int border,
11324 PyObject userData=None) -> SizerItem
11326 Constructs a `wx.SizerItem` for tracking a window.
11328 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
11332 def SizerItemSpacer(*args
, **kwargs
):
11334 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11335 PyObject userData=None) -> SizerItem
11337 Constructs a `wx.SizerItem` for tracking a spacer.
11339 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
11343 def SizerItemSizer(*args
, **kwargs
):
11345 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11346 PyObject userData=None) -> SizerItem
11348 Constructs a `wx.SizerItem` for tracking a subsizer
11350 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
11354 class Sizer(Object
):
11356 wx.Sizer is the abstract base class used for laying out subwindows in
11357 a window. You cannot use wx.Sizer directly; instead, you will have to
11358 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11359 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11360 and `wx.GridBagSizer`.
11362 The concept implemented by sizers in wxWidgets is closely related to
11363 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11364 toolkit or the Qt toolkit. It is based upon the idea of the individual
11365 subwindows reporting their minimal required size and their ability to
11366 get stretched if the size of the parent window has changed. This will
11367 most often mean that the programmer does not set the original size of
11368 a dialog in the beginning, rather the dialog will assigned a sizer and
11369 this sizer will be queried about the recommended size. The sizer in
11370 turn will query its children, which can be normal windows or contorls,
11371 empty space or other sizers, so that a hierarchy of sizers can be
11372 constructed. Note that wxSizer does not derive from wxWindow and thus
11373 do not interfere with tab ordering and requires very little resources
11374 compared to a real window on screen.
11376 What makes sizers so well fitted for use in wxWidgets is the fact that
11377 every control reports its own minimal size and the algorithm can
11378 handle differences in font sizes or different window (dialog item)
11379 sizes on different platforms without problems. If for example the
11380 standard font as well as the overall design of Mac widgets requires
11381 more space than on Windows, then the initial size of a dialog using a
11382 sizer will automatically be bigger on Mac than on Windows.
11384 def __init__(self
): raise RuntimeError, "No constructor defined"
11385 def __repr__(self
):
11386 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11387 def _setOORInfo(*args
, **kwargs
):
11388 """_setOORInfo(self, PyObject _self)"""
11389 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
11391 def Add(*args
, **kwargs
):
11393 Add(self, item, int proportion=0, int flag=0, int border=0,
11394 PyObject userData=None) -> wx.SizerItem
11396 Appends a child item to the sizer.
11398 return _core_
.Sizer_Add(*args
, **kwargs
)
11400 def Insert(*args
, **kwargs
):
11402 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11403 PyObject userData=None) -> wx.SizerItem
11405 Inserts a new item into the list of items managed by this sizer before
11406 the item at index *before*. See `Add` for a description of the parameters.
11408 return _core_
.Sizer_Insert(*args
, **kwargs
)
11410 def Prepend(*args
, **kwargs
):
11412 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11413 PyObject userData=None) -> wx.SizerItem
11415 Adds a new item to the begining of the list of sizer items managed by
11416 this sizer. See `Add` for a description of the parameters.
11418 return _core_
.Sizer_Prepend(*args
, **kwargs
)
11420 def Remove(*args
, **kwargs
):
11422 Remove(self, item) -> bool
11424 Removes an item from the sizer and destroys it. This method does not
11425 cause any layout or resizing to take place, call `Layout` to update
11426 the layout on screen after removing a child from the sizer. The
11427 *item* parameter can be either a window, a sizer, or the zero-based
11428 index of an item to remove. Returns True if the child item was found
11431 return _core_
.Sizer_Remove(*args
, **kwargs
)
11433 def Detach(*args
, **kwargs
):
11435 Detach(self, item) -> bool
11437 Detaches an item from the sizer without destroying it. This method
11438 does not cause any layout or resizing to take place, call `Layout` to
11439 do so. The *item* parameter can be either a window, a sizer, or the
11440 zero-based index of the item to be detached. Returns True if the child item
11441 was found and detached.
11443 return _core_
.Sizer_Detach(*args
, **kwargs
)
11445 def GetItem(*args
, **kwargs
):
11447 GetItem(self, item) -> wx.SizerItem
11449 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11450 parameter can be either a window, a sizer, or the zero-based index of
11451 the item to be detached.
11453 return _core_
.Sizer_GetItem(*args
, **kwargs
)
11455 def _SetItemMinSize(*args
, **kwargs
):
11456 """_SetItemMinSize(self, PyObject item, Size size)"""
11457 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
11459 def SetItemMinSize(self
, item
, *args
):
11461 SetItemMinSize(self, item, Size size)
11463 Sets the minimum size that will be allocated for an item in the sizer.
11464 The *item* parameter can be either a window, a sizer, or the
11465 zero-based index of the item. If a window or sizer is given then it
11466 will be searched for recursivly in subsizers if neccessary.
11469 # for backward compatibility accept separate width,height args too
11470 return self
._SetItemMinSize
(item
, args
)
11472 return self
._SetItemMinSize
(item
, args
[0])
11474 def AddItem(*args
, **kwargs
):
11476 AddItem(self, SizerItem item)
11478 Adds a `wx.SizerItem` to the sizer.
11480 return _core_
.Sizer_AddItem(*args
, **kwargs
)
11482 def InsertItem(*args
, **kwargs
):
11484 InsertItem(self, int index, SizerItem item)
11486 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11488 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
11490 def PrependItem(*args
, **kwargs
):
11492 PrependItem(self, SizerItem item)
11494 Prepends a `wx.SizerItem` to the sizer.
11496 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
11498 def AddMany(self
, items
):
11500 AddMany is a convenience method for adding several items
11501 to a sizer at one time. Simply pass it a list of tuples,
11502 where each tuple consists of the parameters that you
11503 would normally pass to the `Add` method.
11506 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
11510 # for backwards compatibility only, please do not use in new code
11511 def AddWindow(self
, *args
, **kw
):
11512 """Compatibility alias for `Add`."""
11513 return self
.Add(*args
, **kw
)
11514 def AddSizer(self
, *args
, **kw
):
11515 """Compatibility alias for `Add`."""
11516 return self
.Add(*args
, **kw
)
11517 def AddSpacer(self
, *args
, **kw
):
11518 """Compatibility alias for `Add`."""
11519 return self
.Add(*args
, **kw
)
11521 def PrependWindow(self
, *args
, **kw
):
11522 """Compatibility alias for `Prepend`."""
11523 return self
.Prepend(*args
, **kw
)
11524 def PrependSizer(self
, *args
, **kw
):
11525 """Compatibility alias for `Prepend`."""
11526 return self
.Prepend(*args
, **kw
)
11527 def PrependSpacer(self
, *args
, **kw
):
11528 """Compatibility alias for `Prepend`."""
11529 return self
.Prepend(*args
, **kw
)
11531 def InsertWindow(self
, *args
, **kw
):
11532 """Compatibility alias for `Insert`."""
11533 return self
.Insert(*args
, **kw
)
11534 def InsertSizer(self
, *args
, **kw
):
11535 """Compatibility alias for `Insert`."""
11536 return self
.Insert(*args
, **kw
)
11537 def InsertSpacer(self
, *args
, **kw
):
11538 """Compatibility alias for `Insert`."""
11539 return self
.Insert(*args
, **kw
)
11541 def RemoveWindow(self
, *args
, **kw
):
11542 """Compatibility alias for `Remove`."""
11543 return self
.Remove(*args
, **kw
)
11544 def RemoveSizer(self
, *args
, **kw
):
11545 """Compatibility alias for `Remove`."""
11546 return self
.Remove(*args
, **kw
)
11547 def RemovePos(self
, *args
, **kw
):
11548 """Compatibility alias for `Remove`."""
11549 return self
.Remove(*args
, **kw
)
11552 def SetDimension(*args
, **kwargs
):
11554 SetDimension(self, int x, int y, int width, int height)
11556 Call this to force the sizer to take the given dimension and thus
11557 force the items owned by the sizer to resize themselves according to
11558 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11561 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
11563 def SetMinSize(*args
, **kwargs
):
11565 SetMinSize(self, Size size)
11567 Call this to give the sizer a minimal size. Normally, the sizer will
11568 calculate its minimal size based purely on how much space its children
11569 need. After calling this method `GetMinSize` will return either the
11570 minimal size as requested by its children or the minimal size set
11571 here, depending on which is bigger.
11573 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
11575 def GetSize(*args
, **kwargs
):
11577 GetSize(self) -> Size
11579 Returns the current size of the space managed by the sizer.
11581 return _core_
.Sizer_GetSize(*args
, **kwargs
)
11583 def GetPosition(*args
, **kwargs
):
11585 GetPosition(self) -> Point
11587 Returns the current position of the sizer's managed space.
11589 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
11591 def GetMinSize(*args
, **kwargs
):
11593 GetMinSize(self) -> Size
11595 Returns the minimal size of the sizer. This is either the combined
11596 minimal size of all the children and their borders or the minimal size
11597 set by SetMinSize, depending on which is bigger.
11599 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
11601 def GetSizeTuple(self
):
11602 return self
.GetSize().Get()
11603 def GetPositionTuple(self
):
11604 return self
.GetPosition().Get()
11605 def GetMinSizeTuple(self
):
11606 return self
.GetMinSize().Get()
11608 def RecalcSizes(*args
, **kwargs
):
11612 Using the sizes calculated by `CalcMin` reposition and resize all the
11613 items managed by this sizer. You should not need to call this directly as
11614 it is called by `Layout`.
11616 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
11618 def CalcMin(*args
, **kwargs
):
11620 CalcMin(self) -> Size
11622 This method is where the sizer will do the actual calculation of its
11623 children's minimal sizes. You should not need to call this directly as
11624 it is called by `Layout`.
11626 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
11628 def Layout(*args
, **kwargs
):
11632 This method will force the recalculation and layout of the items
11633 controlled by the sizer using the current space allocated to the
11634 sizer. Normally this is called automatically from the owning window's
11635 EVT_SIZE handler, but it is also useful to call it from user code when
11636 one of the items in a sizer change size, or items are added or
11639 return _core_
.Sizer_Layout(*args
, **kwargs
)
11641 def Fit(*args
, **kwargs
):
11643 Fit(self, Window window) -> Size
11645 Tell the sizer to resize the *window* to match the sizer's minimal
11646 size. This is commonly done in the constructor of the window itself in
11647 order to set its initial size to match the needs of the children as
11648 determined by the sizer. Returns the new size.
11650 For a top level window this is the total window size, not the client size.
11652 return _core_
.Sizer_Fit(*args
, **kwargs
)
11654 def FitInside(*args
, **kwargs
):
11656 FitInside(self, Window window)
11658 Tell the sizer to resize the *virtual size* of the *window* to match the
11659 sizer's minimal size. This will not alter the on screen size of the
11660 window, but may cause the addition/removal/alteration of scrollbars
11661 required to view the virtual area in windows which manage it.
11663 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11666 return _core_
.Sizer_FitInside(*args
, **kwargs
)
11668 def SetSizeHints(*args
, **kwargs
):
11670 SetSizeHints(self, Window window)
11672 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11673 match the sizer's minimal size. This is commonly done in the
11674 constructor of the window itself if the window is resizable (as are
11675 many dialogs under Unix and frames on probably all platforms) in order
11676 to prevent the window from being sized smaller than the minimal size
11677 required by the sizer.
11679 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
11681 def SetVirtualSizeHints(*args
, **kwargs
):
11683 SetVirtualSizeHints(self, Window window)
11685 Tell the sizer to set the minimal size of the window virtual area to
11686 match the sizer's minimal size. For windows with managed scrollbars
11687 this will set them appropriately.
11689 :see: `wx.ScrolledWindow.SetScrollbars`
11692 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
11694 def Clear(*args
, **kwargs
):
11696 Clear(self, bool deleteWindows=False)
11698 Clear all items from the sizer, optionally destroying the window items
11701 return _core_
.Sizer_Clear(*args
, **kwargs
)
11703 def DeleteWindows(*args
, **kwargs
):
11705 DeleteWindows(self)
11707 Destroy all windows managed by the sizer.
11709 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
11711 def GetChildren(*args
, **kwargs
):
11713 GetChildren(self) -> list
11715 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11717 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
11719 def Show(*args
, **kwargs
):
11721 Show(self, item, bool show=True, bool recursive=false) -> bool
11723 Shows or hides an item managed by the sizer. To make a sizer item
11724 disappear or reappear, use Show followed by `Layout`. The *item*
11725 parameter can be either a window, a sizer, or the zero-based index of
11726 the item. Use the recursive parameter to show or hide an item in a
11727 subsizer. Returns True if the item was found.
11729 return _core_
.Sizer_Show(*args
, **kwargs
)
11731 def IsShown(*args
, **kwargs
):
11733 IsShown(self, item)
11735 Determines if the item is currently shown. sizer. To make a sizer
11736 item disappear or reappear, use Show followed by `Layout`. The *item*
11737 parameter can be either a window, a sizer, or the zero-based index of
11740 return _core_
.Sizer_IsShown(*args
, **kwargs
)
11742 def Hide(self
, item
, recursive
=False):
11744 A convenience method for `Show` (item, False, recursive).
11746 return self
.Show(item
, False, recursive
)
11748 def ShowItems(*args
, **kwargs
):
11750 ShowItems(self, bool show)
11752 Recursively call `wx.SizerItem.Show` on all sizer items.
11754 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
11757 class SizerPtr(Sizer
):
11758 def __init__(self
, this
):
11760 if not hasattr(self
,"thisown"): self
.thisown
= 0
11761 self
.__class
__ = Sizer
11762 _core_
.Sizer_swigregister(SizerPtr
)
11764 class PySizer(Sizer
):
11766 wx.PySizer is a special version of `wx.Sizer` that has been
11767 instrumented to allow the C++ virtual methods to be overloaded in
11768 Python derived classes. You would derive from this class if you are
11769 wanting to implement a custom sizer in Python code. Simply implement
11770 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11773 class MySizer(wx.PySizer):
11774 def __init__(self):
11775 wx.PySizer.__init__(self)
11778 for item in self.GetChildren():
11779 # calculate the total minimum width and height needed
11780 # by all items in the sizer according to this sizer's
11781 # layout algorithm.
11783 return wx.Size(width, height)
11785 def RecalcSizes(self):
11786 # find the space allotted to this sizer
11787 pos = self.GetPosition()
11788 size = self.GetSize()
11789 for item in self.GetChildren():
11790 # Recalculate (if necessary) the position and size of
11791 # each item and then call item.SetDimension to do the
11792 # actual positioning and sizing of the items within the
11793 # space alloted to this sizer.
11795 item.SetDimension(itemPos, itemSize)
11798 When `Layout` is called it first calls `CalcMin` followed by
11799 `RecalcSizes` so you can optimize a bit by saving the results of
11800 `CalcMin` and reusing them in `RecalcSizes`.
11802 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11806 def __repr__(self
):
11807 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11808 def __init__(self
, *args
, **kwargs
):
11810 __init__(self) -> PySizer
11812 Creates a wx.PySizer. Must be called from the __init__ in the derived
11815 newobj
= _core_
.new_PySizer(*args
, **kwargs
)
11816 self
.this
= newobj
.this
11819 self
._setCallbackInfo
(self
, PySizer
);self
._setOORInfo
(self
)
11821 def _setCallbackInfo(*args
, **kwargs
):
11822 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11823 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
11826 class PySizerPtr(PySizer
):
11827 def __init__(self
, this
):
11829 if not hasattr(self
,"thisown"): self
.thisown
= 0
11830 self
.__class
__ = PySizer
11831 _core_
.PySizer_swigregister(PySizerPtr
)
11833 #---------------------------------------------------------------------------
11835 class BoxSizer(Sizer
):
11837 The basic idea behind a box sizer is that windows will most often be
11838 laid out in rather simple basic geometry, typically in a row or a
11839 column or nested hierarchies of either. A wx.BoxSizer will lay out
11840 its items in a simple row or column, depending on the orientation
11841 parameter passed to the constructor.
11843 def __repr__(self
):
11844 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11845 def __init__(self
, *args
, **kwargs
):
11847 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11849 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11850 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11853 newobj
= _core_
.new_BoxSizer(*args
, **kwargs
)
11854 self
.this
= newobj
.this
11857 self
._setOORInfo
(self
)
11859 def GetOrientation(*args
, **kwargs
):
11861 GetOrientation(self) -> int
11863 Returns the current orientation of the sizer.
11865 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
11867 def SetOrientation(*args
, **kwargs
):
11869 SetOrientation(self, int orient)
11871 Resets the orientation of the sizer.
11873 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
11876 class BoxSizerPtr(BoxSizer
):
11877 def __init__(self
, this
):
11879 if not hasattr(self
,"thisown"): self
.thisown
= 0
11880 self
.__class
__ = BoxSizer
11881 _core_
.BoxSizer_swigregister(BoxSizerPtr
)
11883 #---------------------------------------------------------------------------
11885 class StaticBoxSizer(BoxSizer
):
11887 wx.StaticBoxSizer derives from and functions identically to the
11888 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11889 manages. Note that this static box must be created separately and
11890 passed to the sizer constructor.
11892 def __repr__(self
):
11893 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11894 def __init__(self
, *args
, **kwargs
):
11896 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11898 Constructor. It takes an associated static box and the orientation
11899 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11902 newobj
= _core_
.new_StaticBoxSizer(*args
, **kwargs
)
11903 self
.this
= newobj
.this
11906 self
._setOORInfo
(self
)
11908 def GetStaticBox(*args
, **kwargs
):
11910 GetStaticBox(self) -> StaticBox
11912 Returns the static box associated with this sizer.
11914 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
11917 class StaticBoxSizerPtr(StaticBoxSizer
):
11918 def __init__(self
, this
):
11920 if not hasattr(self
,"thisown"): self
.thisown
= 0
11921 self
.__class
__ = StaticBoxSizer
11922 _core_
.StaticBoxSizer_swigregister(StaticBoxSizerPtr
)
11924 #---------------------------------------------------------------------------
11926 class GridSizer(Sizer
):
11928 A grid sizer is a sizer which lays out its children in a
11929 two-dimensional table with all cells having the same size. In other
11930 words, the width of each cell within the grid is the width of the
11931 widest item added to the sizer and the height of each grid cell is the
11932 height of the tallest item. An optional vertical and/or horizontal
11933 gap between items can also be specified (in pixels.)
11935 Items are placed in the cells of the grid in the order they are added,
11936 in row-major order. In other words, the first row is filled first,
11937 then the second, and so on until all items have been added. (If
11938 neccessary, additional rows will be added as items are added.) If you
11939 need to have greater control over the cells that items are placed in
11940 then use the `wx.GridBagSizer`.
11943 def __repr__(self
):
11944 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11945 def __init__(self
, *args
, **kwargs
):
11947 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11949 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11950 of columns and rows in the sizer - if either of the parameters is
11951 zero, it will be calculated to from the total number of children in
11952 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11953 define extra space between all children.
11955 newobj
= _core_
.new_GridSizer(*args
, **kwargs
)
11956 self
.this
= newobj
.this
11959 self
._setOORInfo
(self
)
11961 def SetCols(*args
, **kwargs
):
11963 SetCols(self, int cols)
11965 Sets the number of columns in the sizer.
11967 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
11969 def SetRows(*args
, **kwargs
):
11971 SetRows(self, int rows)
11973 Sets the number of rows in the sizer.
11975 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
11977 def SetVGap(*args
, **kwargs
):
11979 SetVGap(self, int gap)
11981 Sets the vertical gap (in pixels) between the cells in the sizer.
11983 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
11985 def SetHGap(*args
, **kwargs
):
11987 SetHGap(self, int gap)
11989 Sets the horizontal gap (in pixels) between cells in the sizer
11991 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
11993 def GetCols(*args
, **kwargs
):
11995 GetCols(self) -> int
11997 Returns the number of columns in the sizer.
11999 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
12001 def GetRows(*args
, **kwargs
):
12003 GetRows(self) -> int
12005 Returns the number of rows in the sizer.
12007 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
12009 def GetVGap(*args
, **kwargs
):
12011 GetVGap(self) -> int
12013 Returns the vertical gap (in pixels) between the cells in the sizer.
12015 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
12017 def GetHGap(*args
, **kwargs
):
12019 GetHGap(self) -> int
12021 Returns the horizontal gap (in pixels) between cells in the sizer.
12023 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
12026 class GridSizerPtr(GridSizer
):
12027 def __init__(self
, this
):
12029 if not hasattr(self
,"thisown"): self
.thisown
= 0
12030 self
.__class
__ = GridSizer
12031 _core_
.GridSizer_swigregister(GridSizerPtr
)
12033 #---------------------------------------------------------------------------
12035 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
12036 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
12037 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
12038 class FlexGridSizer(GridSizer
):
12040 A flex grid sizer is a sizer which lays out its children in a
12041 two-dimensional table with all table cells in one row having the same
12042 height and all cells in one column having the same width, but all
12043 rows or all columns are not necessarily the same height or width as in
12044 the `wx.GridSizer`.
12046 wx.FlexGridSizer can also size items equally in one direction but
12047 unequally ("flexibly") in the other. If the sizer is only flexible
12048 in one direction (this can be changed using `SetFlexibleDirection`), it
12049 needs to be decided how the sizer should grow in the other ("non
12050 flexible") direction in order to fill the available space. The
12051 `SetNonFlexibleGrowMode` method serves this purpose.
12055 def __repr__(self
):
12056 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12057 def __init__(self
, *args
, **kwargs
):
12059 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12061 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12062 number of columns and rows in the sizer - if either of the parameters
12063 is zero, it will be calculated to from the total number of children in
12064 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12065 define extra space between all children.
12067 newobj
= _core_
.new_FlexGridSizer(*args
, **kwargs
)
12068 self
.this
= newobj
.this
12071 self
._setOORInfo
(self
)
12073 def AddGrowableRow(*args
, **kwargs
):
12075 AddGrowableRow(self, size_t idx, int proportion=0)
12077 Specifies that row *idx* (starting from zero) should be grown if there
12078 is extra space available to the sizer.
12080 The *proportion* parameter has the same meaning as the stretch factor
12081 for the box sizers except that if all proportions are 0, then all
12082 columns are resized equally (instead of not being resized at all).
12084 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
12086 def RemoveGrowableRow(*args
, **kwargs
):
12088 RemoveGrowableRow(self, size_t idx)
12090 Specifies that row *idx* is no longer growable.
12092 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
12094 def AddGrowableCol(*args
, **kwargs
):
12096 AddGrowableCol(self, size_t idx, int proportion=0)
12098 Specifies that column *idx* (starting from zero) should be grown if
12099 there is extra space available to the sizer.
12101 The *proportion* parameter has the same meaning as the stretch factor
12102 for the box sizers except that if all proportions are 0, then all
12103 columns are resized equally (instead of not being resized at all).
12105 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
12107 def RemoveGrowableCol(*args
, **kwargs
):
12109 RemoveGrowableCol(self, size_t idx)
12111 Specifies that column *idx* is no longer growable.
12113 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
12115 def SetFlexibleDirection(*args
, **kwargs
):
12117 SetFlexibleDirection(self, int direction)
12119 Specifies whether the sizer should flexibly resize its columns, rows,
12120 or both. Argument *direction* can be one of the following values. Any
12121 other value is ignored.
12123 ============== =======================================
12124 wx.VERTICAL Rows are flexibly sized.
12125 wx.HORIZONTAL Columns are flexibly sized.
12126 wx.BOTH Both rows and columns are flexibly sized
12127 (this is the default value).
12128 ============== =======================================
12130 Note that this method does not trigger relayout.
12133 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
12135 def GetFlexibleDirection(*args
, **kwargs
):
12137 GetFlexibleDirection(self) -> int
12139 Returns a value that specifies whether the sizer
12140 flexibly resizes its columns, rows, or both (default).
12142 :see: `SetFlexibleDirection`
12144 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
12146 def SetNonFlexibleGrowMode(*args
, **kwargs
):
12148 SetNonFlexibleGrowMode(self, int mode)
12150 Specifies how the sizer should grow in the non-flexible direction if
12151 there is one (so `SetFlexibleDirection` must have been called
12152 previously). Argument *mode* can be one of the following values:
12154 ========================== =================================================
12155 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12156 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12157 `AddGrowableCol` and `AddGrowableRow`. In this
12158 case equal sizing applies to minimum sizes of
12159 columns or rows (this is the default value).
12160 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12161 the non flexible direction, whether they are
12162 growable or not in the flexbile direction.
12163 ========================== =================================================
12165 Note that this method does not trigger relayout.
12169 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
12171 def GetNonFlexibleGrowMode(*args
, **kwargs
):
12173 GetNonFlexibleGrowMode(self) -> int
12175 Returns the value that specifies how the sizer grows in the
12176 non-flexible direction if there is one.
12178 :see: `SetNonFlexibleGrowMode`
12180 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
12182 def GetRowHeights(*args
, **kwargs
):
12184 GetRowHeights(self) -> list
12186 Returns a list of integers representing the heights of each of the
12189 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
12191 def GetColWidths(*args
, **kwargs
):
12193 GetColWidths(self) -> list
12195 Returns a list of integers representing the widths of each of the
12196 columns in the sizer.
12198 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
12201 class FlexGridSizerPtr(FlexGridSizer
):
12202 def __init__(self
, this
):
12204 if not hasattr(self
,"thisown"): self
.thisown
= 0
12205 self
.__class
__ = FlexGridSizer
12206 _core_
.FlexGridSizer_swigregister(FlexGridSizerPtr
)
12208 class StdDialogButtonSizer(BoxSizer
):
12210 A special sizer that knows how to order and position standard buttons
12211 in order to conform to the current platform's standards. You simply
12212 need to add each `wx.Button` to the sizer, and be sure to create the
12213 buttons using the standard ID's. Then call `Realize` and the sizer
12214 will take care of the rest.
12217 def __repr__(self
):
12218 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12219 def __init__(self
, *args
, **kwargs
):
12220 """__init__(self) -> StdDialogButtonSizer"""
12221 newobj
= _core_
.new_StdDialogButtonSizer(*args
, **kwargs
)
12222 self
.this
= newobj
.this
12225 def AddButton(*args
, **kwargs
):
12227 AddButton(self, wxButton button)
12229 Use this to add the buttons to this sizer. Do not use the `Add`
12230 method in the base class.
12232 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
12234 def Realize(*args
, **kwargs
):
12238 This funciton needs to be called after all the buttons have been added
12239 to the sizer. It will reorder them and position them in a platform
12242 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
12244 def SetAffirmativeButton(*args
, **kwargs
):
12245 """SetAffirmativeButton(self, wxButton button)"""
12246 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
12248 def SetNegativeButton(*args
, **kwargs
):
12249 """SetNegativeButton(self, wxButton button)"""
12250 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
12252 def SetCancelButton(*args
, **kwargs
):
12253 """SetCancelButton(self, wxButton button)"""
12254 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
12256 def GetAffirmativeButton(*args
, **kwargs
):
12257 """GetAffirmativeButton(self) -> wxButton"""
12258 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
12260 def GetApplyButton(*args
, **kwargs
):
12261 """GetApplyButton(self) -> wxButton"""
12262 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
12264 def GetNegativeButton(*args
, **kwargs
):
12265 """GetNegativeButton(self) -> wxButton"""
12266 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
12268 def GetCancelButton(*args
, **kwargs
):
12269 """GetCancelButton(self) -> wxButton"""
12270 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
12272 def GetHelpButton(*args
, **kwargs
):
12273 """GetHelpButton(self) -> wxButton"""
12274 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
12277 class StdDialogButtonSizerPtr(StdDialogButtonSizer
):
12278 def __init__(self
, this
):
12280 if not hasattr(self
,"thisown"): self
.thisown
= 0
12281 self
.__class
__ = StdDialogButtonSizer
12282 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr
)
12284 #---------------------------------------------------------------------------
12286 class GBPosition(object):
12288 This class represents the position of an item in a virtual grid of
12289 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12290 typemaps that will automatically convert from a 2-element sequence of
12291 integers to a wx.GBPosition, so you can use the more pythonic
12292 representation of the position nearly transparently in Python code.
12294 def __repr__(self
):
12295 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12296 def __init__(self
, *args
, **kwargs
):
12298 __init__(self, int row=0, int col=0) -> GBPosition
12300 This class represents the position of an item in a virtual grid of
12301 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12302 typemaps that will automatically convert from a 2-element sequence of
12303 integers to a wx.GBPosition, so you can use the more pythonic
12304 representation of the position nearly transparently in Python code.
12306 newobj
= _core_
.new_GBPosition(*args
, **kwargs
)
12307 self
.this
= newobj
.this
12310 def GetRow(*args
, **kwargs
):
12311 """GetRow(self) -> int"""
12312 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
12314 def GetCol(*args
, **kwargs
):
12315 """GetCol(self) -> int"""
12316 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
12318 def SetRow(*args
, **kwargs
):
12319 """SetRow(self, int row)"""
12320 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
12322 def SetCol(*args
, **kwargs
):
12323 """SetCol(self, int col)"""
12324 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
12326 def __eq__(*args
, **kwargs
):
12327 """__eq__(self, GBPosition other) -> bool"""
12328 return _core_
.GBPosition___eq__(*args
, **kwargs
)
12330 def __ne__(*args
, **kwargs
):
12331 """__ne__(self, GBPosition other) -> bool"""
12332 return _core_
.GBPosition___ne__(*args
, **kwargs
)
12334 def Set(*args
, **kwargs
):
12335 """Set(self, int row=0, int col=0)"""
12336 return _core_
.GBPosition_Set(*args
, **kwargs
)
12338 def Get(*args
, **kwargs
):
12339 """Get(self) -> PyObject"""
12340 return _core_
.GBPosition_Get(*args
, **kwargs
)
12342 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12343 def __str__(self
): return str(self
.Get())
12344 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
12345 def __len__(self
): return len(self
.Get())
12346 def __getitem__(self
, index
): return self
.Get()[index
]
12347 def __setitem__(self
, index
, val
):
12348 if index
== 0: self
.SetRow(val
)
12349 elif index
== 1: self
.SetCol(val
)
12350 else: raise IndexError
12351 def __nonzero__(self
): return self
.Get() != (0,0)
12352 __safe_for_unpickling__
= True
12353 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
12355 row
= property(GetRow
, SetRow
)
12356 col
= property(GetCol
, SetCol
)
12359 class GBPositionPtr(GBPosition
):
12360 def __init__(self
, this
):
12362 if not hasattr(self
,"thisown"): self
.thisown
= 0
12363 self
.__class
__ = GBPosition
12364 _core_
.GBPosition_swigregister(GBPositionPtr
)
12366 class GBSpan(object):
12368 This class is used to hold the row and column spanning attributes of
12369 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12370 automatically convert from a 2-element sequence of integers to a
12371 wx.GBSpan, so you can use the more pythonic representation of the span
12372 nearly transparently in Python code.
12375 def __repr__(self
):
12376 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12377 def __init__(self
, *args
, **kwargs
):
12379 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12381 Construct a new wxGBSpan, optionally setting the rowspan and
12382 colspan. The default is (1,1). (Meaning that the item occupies one
12383 cell in each direction.
12385 newobj
= _core_
.new_GBSpan(*args
, **kwargs
)
12386 self
.this
= newobj
.this
12389 def GetRowspan(*args
, **kwargs
):
12390 """GetRowspan(self) -> int"""
12391 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
12393 def GetColspan(*args
, **kwargs
):
12394 """GetColspan(self) -> int"""
12395 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
12397 def SetRowspan(*args
, **kwargs
):
12398 """SetRowspan(self, int rowspan)"""
12399 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
12401 def SetColspan(*args
, **kwargs
):
12402 """SetColspan(self, int colspan)"""
12403 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
12405 def __eq__(*args
, **kwargs
):
12406 """__eq__(self, GBSpan other) -> bool"""
12407 return _core_
.GBSpan___eq__(*args
, **kwargs
)
12409 def __ne__(*args
, **kwargs
):
12410 """__ne__(self, GBSpan other) -> bool"""
12411 return _core_
.GBSpan___ne__(*args
, **kwargs
)
12413 def Set(*args
, **kwargs
):
12414 """Set(self, int rowspan=1, int colspan=1)"""
12415 return _core_
.GBSpan_Set(*args
, **kwargs
)
12417 def Get(*args
, **kwargs
):
12418 """Get(self) -> PyObject"""
12419 return _core_
.GBSpan_Get(*args
, **kwargs
)
12421 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12422 def __str__(self
): return str(self
.Get())
12423 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
12424 def __len__(self
): return len(self
.Get())
12425 def __getitem__(self
, index
): return self
.Get()[index
]
12426 def __setitem__(self
, index
, val
):
12427 if index
== 0: self
.SetRowspan(val
)
12428 elif index
== 1: self
.SetColspan(val
)
12429 else: raise IndexError
12430 def __nonzero__(self
): return self
.Get() != (0,0)
12431 __safe_for_unpickling__
= True
12432 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
12434 rowspan
= property(GetRowspan
, SetRowspan
)
12435 colspan
= property(GetColspan
, SetColspan
)
12438 class GBSpanPtr(GBSpan
):
12439 def __init__(self
, this
):
12441 if not hasattr(self
,"thisown"): self
.thisown
= 0
12442 self
.__class
__ = GBSpan
12443 _core_
.GBSpan_swigregister(GBSpanPtr
)
12445 class GBSizerItem(SizerItem
):
12447 The wx.GBSizerItem class is used to track the additional data about
12448 items in a `wx.GridBagSizer` such as the item's position in the grid
12449 and how many rows or columns it spans.
12452 def __repr__(self
):
12453 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12454 def __init__(self
, *args
, **kwargs
):
12456 __init__(self) -> GBSizerItem
12458 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12459 size will need to be set, as well as a position and span before this
12460 item can be used in a Sizer.
12462 You will probably never need to create a wx.GBSizerItem directly as they
12463 are created automatically when the sizer's Add method is called.
12465 newobj
= _core_
.new_GBSizerItem(*args
, **kwargs
)
12466 self
.this
= newobj
.this
12469 def GetPos(*args
, **kwargs
):
12471 GetPos(self) -> GBPosition
12473 Get the grid position of the item
12475 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
12477 def GetPosTuple(self
): return self
.GetPos().Get()
12478 def GetSpan(*args
, **kwargs
):
12480 GetSpan(self) -> GBSpan
12482 Get the row and column spanning of the item
12484 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
12486 def GetSpanTuple(self
): return self
.GetSpan().Get()
12487 def SetPos(*args
, **kwargs
):
12489 SetPos(self, GBPosition pos) -> bool
12491 If the item is already a member of a sizer then first ensure that
12492 there is no other item that would intersect with this one at the new
12493 position, then set the new position. Returns True if the change is
12494 successful and after the next Layout() the item will be moved.
12496 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
12498 def SetSpan(*args
, **kwargs
):
12500 SetSpan(self, GBSpan span) -> bool
12502 If the item is already a member of a sizer then first ensure that
12503 there is no other item that would intersect with this one with its new
12504 spanning size, then set the new spanning. Returns True if the change
12505 is successful and after the next Layout() the item will be resized.
12508 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
12510 def Intersects(*args
, **kwargs
):
12512 Intersects(self, GBSizerItem other) -> bool
12514 Returns True if this item and the other item instersect.
12516 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
12518 def IntersectsPos(*args
, **kwargs
):
12520 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12522 Returns True if the given pos/span would intersect with this item.
12524 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
12526 def GetEndPos(*args
, **kwargs
):
12528 GetEndPos(self) -> GBPosition
12530 Get the row and column of the endpoint of this item.
12532 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
12534 def GetGBSizer(*args
, **kwargs
):
12536 GetGBSizer(self) -> GridBagSizer
12538 Get the sizer this item is a member of.
12540 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
12542 def SetGBSizer(*args
, **kwargs
):
12544 SetGBSizer(self, GridBagSizer sizer)
12546 Set the sizer this item is a member of.
12548 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
12551 class GBSizerItemPtr(GBSizerItem
):
12552 def __init__(self
, this
):
12554 if not hasattr(self
,"thisown"): self
.thisown
= 0
12555 self
.__class
__ = GBSizerItem
12556 _core_
.GBSizerItem_swigregister(GBSizerItemPtr
)
12557 DefaultSpan
= cvar
.DefaultSpan
12559 def GBSizerItemWindow(*args
, **kwargs
):
12561 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12562 int border, PyObject userData=None) -> GBSizerItem
12564 Construct a `wx.GBSizerItem` for a window.
12566 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
12570 def GBSizerItemSizer(*args
, **kwargs
):
12572 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12573 int border, PyObject userData=None) -> GBSizerItem
12575 Construct a `wx.GBSizerItem` for a sizer
12577 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
12581 def GBSizerItemSpacer(*args
, **kwargs
):
12583 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12584 int flag, int border, PyObject userData=None) -> GBSizerItem
12586 Construct a `wx.GBSizerItem` for a spacer.
12588 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
12592 class GridBagSizer(FlexGridSizer
):
12594 A `wx.Sizer` that can lay out items in a virtual grid like a
12595 `wx.FlexGridSizer` but in this case explicit positioning of the items
12596 is allowed using `wx.GBPosition`, and items can optionally span more
12597 than one row and/or column using `wx.GBSpan`. The total size of the
12598 virtual grid is determined by the largest row and column that items are
12599 positioned at, adjusted for spanning.
12602 def __repr__(self
):
12603 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12604 def __init__(self
, *args
, **kwargs
):
12606 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12608 Constructor, with optional parameters to specify the gap between the
12611 newobj
= _core_
.new_GridBagSizer(*args
, **kwargs
)
12612 self
.this
= newobj
.this
12615 self
._setOORInfo
(self
)
12617 def Add(*args
, **kwargs
):
12619 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12620 int border=0, userData=None) -> wx.GBSizerItem
12622 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12623 more than one row or column as specified with *span*. The remaining
12624 args behave similarly to `wx.Sizer.Add`.
12626 Returns True if the item was successfully placed at the given cell
12627 position, False if something was already there.
12630 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
12632 def AddItem(*args
, **kwargs
):
12634 Add(self, GBSizerItem item) -> wx.GBSizerItem
12636 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12637 the item was successfully placed at its given cell position, False if
12638 something was already there.
12640 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
12642 def GetCellSize(*args
, **kwargs
):
12644 GetCellSize(self, int row, int col) -> Size
12646 Get the size of the specified cell, including hgap and
12647 vgap. Only valid after a Layout.
12649 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
12651 def GetEmptyCellSize(*args
, **kwargs
):
12653 GetEmptyCellSize(self) -> Size
12655 Get the size used for cells in the grid with no item.
12657 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
12659 def SetEmptyCellSize(*args
, **kwargs
):
12661 SetEmptyCellSize(self, Size sz)
12663 Set the size used for cells in the grid with no item.
12665 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
12667 def GetItemPosition(*args
):
12669 GetItemPosition(self, item) -> GBPosition
12671 Get the grid position of the specified *item* where *item* is either a
12672 window or subsizer that is a member of this sizer, or a zero-based
12675 return _core_
.GridBagSizer_GetItemPosition(*args
)
12677 def SetItemPosition(*args
):
12679 SetItemPosition(self, item, GBPosition pos) -> bool
12681 Set the grid position of the specified *item* where *item* is either a
12682 window or subsizer that is a member of this sizer, or a zero-based
12683 index of an item. Returns True on success. If the move is not
12684 allowed (because an item is already there) then False is returned.
12687 return _core_
.GridBagSizer_SetItemPosition(*args
)
12689 def GetItemSpan(*args
):
12691 GetItemSpan(self, item) -> GBSpan
12693 Get the row/col spanning of the specified *item* where *item* is
12694 either a window or subsizer that is a member of this sizer, or a
12695 zero-based index of an item.
12697 return _core_
.GridBagSizer_GetItemSpan(*args
)
12699 def SetItemSpan(*args
):
12701 SetItemSpan(self, item, GBSpan span) -> bool
12703 Set the row/col spanning of the specified *item* where *item* is
12704 either a window or subsizer that is a member of this sizer, or a
12705 zero-based index of an item. Returns True on success. If the move is
12706 not allowed (because an item is already there) then False is returned.
12708 return _core_
.GridBagSizer_SetItemSpan(*args
)
12710 def FindItem(*args
):
12712 FindItem(self, item) -> GBSizerItem
12714 Find the sizer item for the given window or subsizer, returns None if
12715 not found. (non-recursive)
12717 return _core_
.GridBagSizer_FindItem(*args
)
12719 def FindItemAtPosition(*args
, **kwargs
):
12721 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12723 Return the sizer item for the given grid cell, or None if there is no
12724 item at that position. (non-recursive)
12726 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
12728 def FindItemAtPoint(*args
, **kwargs
):
12730 FindItemAtPoint(self, Point pt) -> GBSizerItem
12732 Return the sizer item located at the point given in *pt*, or None if
12733 there is no item at that point. The (x,y) coordinates in pt correspond
12734 to the client coordinates of the window using the sizer for
12735 layout. (non-recursive)
12737 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
12739 def CheckForIntersection(*args
, **kwargs
):
12741 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12743 Look at all items and see if any intersect (or would overlap) the
12744 given *item*. Returns True if so, False if there would be no overlap.
12745 If an *excludeItem* is given then it will not be checked for
12746 intersection, for example it may be the item we are checking the
12750 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
12752 def CheckForIntersectionPos(*args
, **kwargs
):
12754 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12756 Look at all items and see if any intersect (or would overlap) the
12757 given position and span. Returns True if so, False if there would be
12758 no overlap. If an *excludeItem* is given then it will not be checked
12759 for intersection, for example it may be the item we are checking the
12762 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
12765 class GridBagSizerPtr(GridBagSizer
):
12766 def __init__(self
, this
):
12768 if not hasattr(self
,"thisown"): self
.thisown
= 0
12769 self
.__class
__ = GridBagSizer
12770 _core_
.GridBagSizer_swigregister(GridBagSizerPtr
)
12772 #---------------------------------------------------------------------------
12776 Right
= _core_
.Right
12777 Bottom
= _core_
.Bottom
12778 Width
= _core_
.Width
12779 Height
= _core_
.Height
12780 Centre
= _core_
.Centre
12781 Center
= _core_
.Center
12782 CentreX
= _core_
.CentreX
12783 CentreY
= _core_
.CentreY
12784 Unconstrained
= _core_
.Unconstrained
12786 PercentOf
= _core_
.PercentOf
12787 Above
= _core_
.Above
12788 Below
= _core_
.Below
12789 LeftOf
= _core_
.LeftOf
12790 RightOf
= _core_
.RightOf
12791 SameAs
= _core_
.SameAs
12792 Absolute
= _core_
.Absolute
12793 class IndividualLayoutConstraint(Object
):
12795 Objects of this class are stored in the `wx.LayoutConstraints` class as
12796 one of eight possible constraints that a window can be involved in.
12797 You will never need to create an instance of
12798 wx.IndividualLayoutConstraint, rather you should create a
12799 `wx.LayoutConstraints` instance and use the individual contstraints
12802 def __init__(self
): raise RuntimeError, "No constructor defined"
12803 def __repr__(self
):
12804 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12805 def Set(*args
, **kwargs
):
12807 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12809 Sets the properties of the constraint. Normally called by one of the
12810 convenience functions such as Above, RightOf, SameAs.
12812 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
12814 def LeftOf(*args
, **kwargs
):
12816 LeftOf(self, Window sibling, int marg=0)
12818 Constrains this edge to be to the left of the given window, with an
12819 optional margin. Implicitly, this is relative to the left edge of the
12822 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
12824 def RightOf(*args
, **kwargs
):
12826 RightOf(self, Window sibling, int marg=0)
12828 Constrains this edge to be to the right of the given window, with an
12829 optional margin. Implicitly, this is relative to the right edge of the
12832 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
12834 def Above(*args
, **kwargs
):
12836 Above(self, Window sibling, int marg=0)
12838 Constrains this edge to be above the given window, with an optional
12839 margin. Implicitly, this is relative to the top edge of the other
12842 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
12844 def Below(*args
, **kwargs
):
12846 Below(self, Window sibling, int marg=0)
12848 Constrains this edge to be below the given window, with an optional
12849 margin. Implicitly, this is relative to the bottom edge of the other
12852 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
12854 def SameAs(*args
, **kwargs
):
12856 SameAs(self, Window otherW, int edge, int marg=0)
12858 Constrains this edge or dimension to be to the same as the edge of the
12859 given window, with an optional margin.
12861 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
12863 def PercentOf(*args
, **kwargs
):
12865 PercentOf(self, Window otherW, int wh, int per)
12867 Constrains this edge or dimension to be to a percentage of the given
12868 window, with an optional margin.
12870 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
12872 def Absolute(*args
, **kwargs
):
12874 Absolute(self, int val)
12876 Constrains this edge or dimension to be the given absolute value.
12878 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
12880 def Unconstrained(*args
, **kwargs
):
12882 Unconstrained(self)
12884 Sets this edge or dimension to be unconstrained, that is, dependent on
12885 other edges and dimensions from which this value can be deduced.
12887 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
12889 def AsIs(*args
, **kwargs
):
12893 Sets this edge or constraint to be whatever the window's value is at
12894 the moment. If either of the width and height constraints are *as is*,
12895 the window will not be resized, but moved instead. This is important
12896 when considering panel items which are intended to have a default
12897 size, such as a button, which may take its size from the size of the
12900 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
12902 def GetOtherWindow(*args
, **kwargs
):
12903 """GetOtherWindow(self) -> Window"""
12904 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
12906 def GetMyEdge(*args
, **kwargs
):
12907 """GetMyEdge(self) -> int"""
12908 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
12910 def SetEdge(*args
, **kwargs
):
12911 """SetEdge(self, int which)"""
12912 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
12914 def SetValue(*args
, **kwargs
):
12915 """SetValue(self, int v)"""
12916 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
12918 def GetMargin(*args
, **kwargs
):
12919 """GetMargin(self) -> int"""
12920 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
12922 def SetMargin(*args
, **kwargs
):
12923 """SetMargin(self, int m)"""
12924 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
12926 def GetValue(*args
, **kwargs
):
12927 """GetValue(self) -> int"""
12928 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
12930 def GetPercent(*args
, **kwargs
):
12931 """GetPercent(self) -> int"""
12932 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
12934 def GetOtherEdge(*args
, **kwargs
):
12935 """GetOtherEdge(self) -> int"""
12936 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
12938 def GetDone(*args
, **kwargs
):
12939 """GetDone(self) -> bool"""
12940 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
12942 def SetDone(*args
, **kwargs
):
12943 """SetDone(self, bool d)"""
12944 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
12946 def GetRelationship(*args
, **kwargs
):
12947 """GetRelationship(self) -> int"""
12948 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
12950 def SetRelationship(*args
, **kwargs
):
12951 """SetRelationship(self, int r)"""
12952 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
12954 def ResetIfWin(*args
, **kwargs
):
12956 ResetIfWin(self, Window otherW) -> bool
12958 Reset constraint if it mentions otherWin
12960 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
12962 def SatisfyConstraint(*args
, **kwargs
):
12964 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12966 Try to satisfy constraint
12968 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
12970 def GetEdge(*args
, **kwargs
):
12972 GetEdge(self, int which, Window thisWin, Window other) -> int
12974 Get the value of this edge or dimension, or if this
12975 is not determinable, -1.
12977 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
12980 class IndividualLayoutConstraintPtr(IndividualLayoutConstraint
):
12981 def __init__(self
, this
):
12983 if not hasattr(self
,"thisown"): self
.thisown
= 0
12984 self
.__class
__ = IndividualLayoutConstraint
12985 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr
)
12987 class LayoutConstraints(Object
):
12989 **Note:** constraints are now deprecated and you should use sizers
12992 Objects of this class can be associated with a window to define its
12993 layout constraints, with respect to siblings or its parent.
12995 The class consists of the following eight constraints of class
12996 wx.IndividualLayoutConstraint, some or all of which should be accessed
12997 directly to set the appropriate constraints.
12999 * left: represents the left hand edge of the window
13000 * right: represents the right hand edge of the window
13001 * top: represents the top edge of the window
13002 * bottom: represents the bottom edge of the window
13003 * width: represents the width of the window
13004 * height: represents the height of the window
13005 * centreX: represents the horizontal centre point of the window
13006 * centreY: represents the vertical centre point of the window
13008 Most constraints are initially set to have the relationship
13009 wxUnconstrained, which means that their values should be calculated by
13010 looking at known constraints. The exceptions are width and height,
13011 which are set to wxAsIs to ensure that if the user does not specify a
13012 constraint, the existing width and height will be used, to be
13013 compatible with panel items which often have take a default size. If
13014 the constraint is ``wx.AsIs``, the dimension will not be changed.
13016 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13019 def __repr__(self
):
13020 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
13021 left
= property(_core_
.LayoutConstraints_left_get
)
13022 top
= property(_core_
.LayoutConstraints_top_get
)
13023 right
= property(_core_
.LayoutConstraints_right_get
)
13024 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
13025 width
= property(_core_
.LayoutConstraints_width_get
)
13026 height
= property(_core_
.LayoutConstraints_height_get
)
13027 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
13028 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
13029 def __init__(self
, *args
, **kwargs
):
13030 """__init__(self) -> LayoutConstraints"""
13031 newobj
= _core_
.new_LayoutConstraints(*args
, **kwargs
)
13032 self
.this
= newobj
.this
13035 def SatisfyConstraints(*args
, **kwargs
):
13036 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13037 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
13039 def AreSatisfied(*args
, **kwargs
):
13040 """AreSatisfied(self) -> bool"""
13041 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
13044 class LayoutConstraintsPtr(LayoutConstraints
):
13045 def __init__(self
, this
):
13047 if not hasattr(self
,"thisown"): self
.thisown
= 0
13048 self
.__class
__ = LayoutConstraints
13049 _core_
.LayoutConstraints_swigregister(LayoutConstraintsPtr
)
13051 #----------------------------------------------------------------------------
13053 # Use Python's bool constants if available, make some if not
13057 __builtins__
.True = 1==1
13058 __builtins__
.False = 1==0
13059 def bool(value
): return not not value
13060 __builtins__
.bool = bool
13064 # workarounds for bad wxRTTI names
13065 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
13066 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
13067 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
13070 #----------------------------------------------------------------------------
13071 # Load version numbers from __version__... Ensure that major and minor
13072 # versions are the same for both wxPython and wxWidgets.
13074 from __version__
import *
13075 __version__
= VERSION_STRING
13077 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
13078 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
13079 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
13081 warnings
.warn("wxPython/wxWidgets release number mismatch")
13083 #----------------------------------------------------------------------------
13085 # Set wxPython's default string<-->unicode conversion encoding from
13086 # the locale, but only if Python's default hasn't been changed. (We
13087 # assume that if the user has customized it already then that is the
13088 # encoding we need to use as well.)
13090 # The encoding selected here is used when string or unicode objects
13091 # need to be converted in order to pass them to wxWidgets. Please be
13092 # aware that the default encoding within the same locale may be
13093 # slightly different on different platforms. For example, please see
13094 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13095 # between the common latin/roman encodings.
13097 default
= _sys
.getdefaultencoding()
13098 if default
== 'ascii':
13102 default
= locale
.getdefaultlocale()[1]
13103 codecs
.lookup(default
)
13104 except (ValueError, LookupError, TypeError):
13105 default
= _sys
.getdefaultencoding()
13109 wx
.SetDefaultPyEncoding(default
)
13112 #----------------------------------------------------------------------------
13114 class PyDeadObjectError(AttributeError):
13117 class _wxPyDeadObject(object):
13119 Instances of wx objects that are OOR capable will have their __class__
13120 changed to this class when the C++ object is deleted. This should help
13121 prevent crashes due to referencing a bogus C++ pointer.
13123 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13124 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13126 def __repr__(self
):
13127 if not hasattr(self
, "_name"):
13128 self
._name
= "[unknown]"
13129 return self
.reprStr
% self
._name
13131 def __getattr__(self
, *args
):
13132 if not hasattr(self
, "_name"):
13133 self
._name
= "[unknown]"
13134 raise PyDeadObjectError(self
.attrStr
% self
._name
)
13136 def __nonzero__(self
):
13141 class PyUnbornObjectError(AttributeError):
13144 class _wxPyUnbornObject(object):
13146 Some stock objects are created when the wx._core module is
13147 imported, but their C++ instance is not created until the wx.App
13148 object is created and initialized. These object instances will
13149 temporarily have their __class__ changed to this class so an
13150 exception will be raised if they are used before the C++ instance
13154 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13155 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
13157 def __repr__(self
):
13158 #if not hasattr(self, "_name"):
13159 # self._name = "[unknown]"
13160 return self
.reprStr
#% self._name
13162 def __getattr__(self
, *args
):
13163 #if not hasattr(self, "_name"):
13164 # self._name = "[unknown]"
13165 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
13167 def __nonzero__(self
):
13171 #----------------------------------------------------------------------------
13173 def CallAfter(callable, *args
, **kw
):
13175 Call the specified function after the current and pending event
13176 handlers have been completed. This is also good for making GUI
13177 method calls from non-GUI threads. Any extra positional or
13178 keyword args are passed on to the callable when it is called.
13180 :see: `wx.FutureCall`
13183 assert app
is not None, 'No wx.App created yet'
13185 if not hasattr(app
, "_CallAfterId"):
13186 app
._CallAfterId
= wx
.NewEventType()
13187 app
.Connect(-1, -1, app
._CallAfterId
,
13188 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
13190 evt
.SetEventType(app
._CallAfterId
)
13191 evt
.callable = callable
13194 wx
.PostEvent(app
, evt
)
13196 #----------------------------------------------------------------------------
13201 A convenience class for `wx.Timer`, that calls the given callable
13202 object once after the given amount of milliseconds, passing any
13203 positional or keyword args. The return value of the callable is
13204 availbale after it has been run with the `GetResult` method.
13206 If you don't need to get the return value or restart the timer
13207 then there is no need to hold a reference to this object. It will
13208 hold a reference to itself while the timer is running (the timer
13209 has a reference to self.Notify) but the cycle will be broken when
13210 the timer completes, automatically cleaning up the wx.FutureCall
13213 :see: `wx.CallAfter`
13215 def __init__(self
, millis
, callable, *args
, **kwargs
):
13216 self
.millis
= millis
13217 self
.callable = callable
13218 self
.SetArgs(*args
, **kwargs
)
13220 self
.running
= False
13221 self
.hasRun
= False
13230 def Start(self
, millis
=None, *args
, **kwargs
):
13232 (Re)start the timer
13234 self
.hasRun
= False
13235 if millis
is not None:
13236 self
.millis
= millis
13238 self
.SetArgs(*args
, **kwargs
)
13240 self
.timer
= wx
.PyTimer(self
.Notify
)
13241 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
13242 self
.running
= True
13248 Stop and destroy the timer.
13250 if self
.timer
is not None:
13255 def GetInterval(self
):
13256 if self
.timer
is not None:
13257 return self
.timer
.GetInterval()
13262 def IsRunning(self
):
13263 return self
.timer
is not None and self
.timer
.IsRunning()
13266 def SetArgs(self
, *args
, **kwargs
):
13268 (Re)set the args passed to the callable object. This is
13269 useful in conjunction with Restart if you want to schedule a
13270 new call to the same callable object but with different
13274 self
.kwargs
= kwargs
13280 def GetResult(self
):
13285 The timer has expired so call the callable.
13287 if self
.callable and getattr(self
.callable, 'im_self', True):
13289 self
.running
= False
13290 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
13292 if not self
.running
:
13293 # if it wasn't restarted, then cleanup
13294 wx
.CallAfter(self
.Stop
)
13298 #----------------------------------------------------------------------------
13299 # Control which items in this module should be documented by epydoc.
13300 # We allow only classes and functions, which will help reduce the size
13301 # of the docs by filtering out the zillions of constants, EVT objects,
13302 # and etc that don't make much sense by themselves, but are instead
13303 # documented (or will be) as part of the classes/functions/methods
13304 # where they should be used.
13308 A filter for epydoc that only allows non-Ptr classes and
13309 fucntions, in order to reduce the clutter in the API docs.
13311 def __init__(self
, globals):
13312 self
._globals
= globals
13314 def __call__(self
, name
):
13316 obj
= self
._globals
.get(name
, None)
13317 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
13319 if name
.startswith('_') or name
.endswith('Ptr') or name
.startswith('EVT'):
13323 #----------------------------------------------------------------------------
13324 #----------------------------------------------------------------------------
13326 # Import other modules in this package that should show up in the
13327 # "core" wx namespace
13329 from _windows
import *
13330 from _controls
import *
13331 from _misc
import *
13334 # Fixup the stock objects since they can't be used yet. (They will be
13335 # restored in wx.PyApp.OnInit.)
13336 _core_
._wxPyFixStockObjects
()
13338 #----------------------------------------------------------------------------
13339 #----------------------------------------------------------------------------