1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
6 new_instancemethod
= new
.instancemethod
7 def _swig_setattr_nondynamic(self
,class_type
,name
,value
,static
=1):
8 if (name
== "thisown"): return self
.this
.own(value
)
10 if type(value
).__name
__ == 'PySwigObject':
11 self
.__dict
__[name
] = value
13 method
= class_type
.__swig
_setmethods
__.get(name
,None)
14 if method
: return method(self
,value
)
15 if (not static
) or hasattr(self
,name
):
16 self
.__dict
__[name
] = value
18 raise AttributeError("You cannot add attributes to %s" % self
)
20 def _swig_setattr(self
,class_type
,name
,value
):
21 return _swig_setattr_nondynamic(self
,class_type
,name
,value
,0)
23 def _swig_getattr(self
,class_type
,name
):
24 if (name
== "thisown"): return self
.this
.own()
25 method
= class_type
.__swig
_getmethods
__.get(name
,None)
26 if method
: return method(self
)
27 raise AttributeError,name
30 try: strthis
= "proxy of " + self
.this
.__repr
__()
32 return "<%s.%s; %s >" % (self
.__class
__.__module
__, self
.__class
__.__name
__, strthis
,)
36 _object
= types
.ObjectType
38 except AttributeError:
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self
,name
,value
):
46 if (name
== "thisown"): return self
.this
.own(value
)
47 if hasattr(self
,name
) or (name
== "this"):
50 raise AttributeError("You cannot add attributes to %s" % self
)
54 #// Give a reference to the dictionary of this module to the C++ extension
56 _core_
._wxPySetDictionary
(vars())
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
61 wx
= _sys
.modules
[__name__
]
64 #----------------------------------------------------------------------------
66 def _deprecated(callable, msg
=None):
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
72 msg
= "%s is deprecated" % callable
73 def deprecatedWrapper(*args
, **kwargs
):
75 warnings
.warn(msg
, DeprecationWarning, stacklevel
=2)
76 return callable(*args
, **kwargs
)
77 deprecatedWrapper
.__doc
__ = msg
78 return deprecatedWrapper
81 #----------------------------------------------------------------------------
83 NOT_FOUND
= _core_
.NOT_FOUND
84 VSCROLL
= _core_
.VSCROLL
85 HSCROLL
= _core_
.HSCROLL
86 CAPTION
= _core_
.CAPTION
87 DOUBLE_BORDER
= _core_
.DOUBLE_BORDER
88 SUNKEN_BORDER
= _core_
.SUNKEN_BORDER
89 RAISED_BORDER
= _core_
.RAISED_BORDER
90 BORDER
= _core_
.BORDER
91 SIMPLE_BORDER
= _core_
.SIMPLE_BORDER
92 STATIC_BORDER
= _core_
.STATIC_BORDER
93 TRANSPARENT_WINDOW
= _core_
.TRANSPARENT_WINDOW
94 NO_BORDER
= _core_
.NO_BORDER
95 DEFAULT_CONTROL_BORDER
= _core_
.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE
= _core_
.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL
= _core_
.TAB_TRAVERSAL
98 WANTS_CHARS
= _core_
.WANTS_CHARS
99 POPUP_WINDOW
= _core_
.POPUP_WINDOW
100 CENTER_FRAME
= _core_
.CENTER_FRAME
101 CENTRE_ON_SCREEN
= _core_
.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN
= _core_
.CENTER_ON_SCREEN
103 CLIP_CHILDREN
= _core_
.CLIP_CHILDREN
104 CLIP_SIBLINGS
= _core_
.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK
= _core_
.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB
= _core_
.ALWAYS_SHOW_SB
107 RETAINED
= _core_
.RETAINED
108 BACKINGSTORE
= _core_
.BACKINGSTORE
109 COLOURED
= _core_
.COLOURED
110 FIXED_LENGTH
= _core_
.FIXED_LENGTH
111 LB_NEEDED_SB
= _core_
.LB_NEEDED_SB
112 LB_ALWAYS_SB
= _core_
.LB_ALWAYS_SB
113 LB_SORT
= _core_
.LB_SORT
114 LB_SINGLE
= _core_
.LB_SINGLE
115 LB_MULTIPLE
= _core_
.LB_MULTIPLE
116 LB_EXTENDED
= _core_
.LB_EXTENDED
117 LB_OWNERDRAW
= _core_
.LB_OWNERDRAW
118 LB_HSCROLL
= _core_
.LB_HSCROLL
119 PROCESS_ENTER
= _core_
.PROCESS_ENTER
120 PASSWORD
= _core_
.PASSWORD
121 CB_SIMPLE
= _core_
.CB_SIMPLE
122 CB_DROPDOWN
= _core_
.CB_DROPDOWN
123 CB_SORT
= _core_
.CB_SORT
124 CB_READONLY
= _core_
.CB_READONLY
125 RA_HORIZONTAL
= _core_
.RA_HORIZONTAL
126 RA_VERTICAL
= _core_
.RA_VERTICAL
127 RA_SPECIFY_ROWS
= _core_
.RA_SPECIFY_ROWS
128 RA_SPECIFY_COLS
= _core_
.RA_SPECIFY_COLS
129 RA_USE_CHECKBOX
= _core_
.RA_USE_CHECKBOX
130 RB_GROUP
= _core_
.RB_GROUP
131 RB_SINGLE
= _core_
.RB_SINGLE
132 SB_HORIZONTAL
= _core_
.SB_HORIZONTAL
133 SB_VERTICAL
= _core_
.SB_VERTICAL
134 RB_USE_CHECKBOX
= _core_
.RB_USE_CHECKBOX
135 ST_SIZEGRIP
= _core_
.ST_SIZEGRIP
136 ST_NO_AUTORESIZE
= _core_
.ST_NO_AUTORESIZE
137 ST_DOTS_MIDDLE
= _core_
.ST_DOTS_MIDDLE
138 ST_DOTS_END
= _core_
.ST_DOTS_END
139 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
140 FLOOD_BORDER
= _core_
.FLOOD_BORDER
141 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
142 WINDING_RULE
= _core_
.WINDING_RULE
143 TOOL_TOP
= _core_
.TOOL_TOP
144 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
145 TOOL_LEFT
= _core_
.TOOL_LEFT
146 TOOL_RIGHT
= _core_
.TOOL_RIGHT
148 YES_NO
= _core_
.YES_NO
149 CANCEL
= _core_
.CANCEL
152 NO_DEFAULT
= _core_
.NO_DEFAULT
153 YES_DEFAULT
= _core_
.YES_DEFAULT
154 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
155 ICON_HAND
= _core_
.ICON_HAND
156 ICON_QUESTION
= _core_
.ICON_QUESTION
157 ICON_INFORMATION
= _core_
.ICON_INFORMATION
158 ICON_STOP
= _core_
.ICON_STOP
159 ICON_ASTERISK
= _core_
.ICON_ASTERISK
160 ICON_MASK
= _core_
.ICON_MASK
161 ICON_WARNING
= _core_
.ICON_WARNING
162 ICON_ERROR
= _core_
.ICON_ERROR
163 FORWARD
= _core_
.FORWARD
164 BACKWARD
= _core_
.BACKWARD
169 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
170 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
171 SIZE_AUTO
= _core_
.SIZE_AUTO
172 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
173 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
174 SIZE_FORCE
= _core_
.SIZE_FORCE
175 PORTRAIT
= _core_
.PORTRAIT
176 LANDSCAPE
= _core_
.LANDSCAPE
177 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
178 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
179 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
180 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
181 ID_ANY
= _core_
.ID_ANY
182 ID_SEPARATOR
= _core_
.ID_SEPARATOR
183 ID_NONE
= _core_
.ID_NONE
184 ID_LOWEST
= _core_
.ID_LOWEST
185 ID_OPEN
= _core_
.ID_OPEN
186 ID_CLOSE
= _core_
.ID_CLOSE
187 ID_NEW
= _core_
.ID_NEW
188 ID_SAVE
= _core_
.ID_SAVE
189 ID_SAVEAS
= _core_
.ID_SAVEAS
190 ID_REVERT
= _core_
.ID_REVERT
191 ID_EXIT
= _core_
.ID_EXIT
192 ID_UNDO
= _core_
.ID_UNDO
193 ID_REDO
= _core_
.ID_REDO
194 ID_HELP
= _core_
.ID_HELP
195 ID_PRINT
= _core_
.ID_PRINT
196 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
197 ID_PAGE_SETUP
= _core_
.ID_PAGE_SETUP
198 ID_PREVIEW
= _core_
.ID_PREVIEW
199 ID_ABOUT
= _core_
.ID_ABOUT
200 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
201 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
202 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
203 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
204 ID_HELP_INDEX
= _core_
.ID_HELP_INDEX
205 ID_HELP_SEARCH
= _core_
.ID_HELP_SEARCH
206 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
207 ID_PREFERENCES
= _core_
.ID_PREFERENCES
208 ID_EDIT
= _core_
.ID_EDIT
209 ID_CUT
= _core_
.ID_CUT
210 ID_COPY
= _core_
.ID_COPY
211 ID_PASTE
= _core_
.ID_PASTE
212 ID_CLEAR
= _core_
.ID_CLEAR
213 ID_FIND
= _core_
.ID_FIND
214 ID_DUPLICATE
= _core_
.ID_DUPLICATE
215 ID_SELECTALL
= _core_
.ID_SELECTALL
216 ID_DELETE
= _core_
.ID_DELETE
217 ID_REPLACE
= _core_
.ID_REPLACE
218 ID_REPLACE_ALL
= _core_
.ID_REPLACE_ALL
219 ID_PROPERTIES
= _core_
.ID_PROPERTIES
220 ID_VIEW_DETAILS
= _core_
.ID_VIEW_DETAILS
221 ID_VIEW_LARGEICONS
= _core_
.ID_VIEW_LARGEICONS
222 ID_VIEW_SMALLICONS
= _core_
.ID_VIEW_SMALLICONS
223 ID_VIEW_LIST
= _core_
.ID_VIEW_LIST
224 ID_VIEW_SORTDATE
= _core_
.ID_VIEW_SORTDATE
225 ID_VIEW_SORTNAME
= _core_
.ID_VIEW_SORTNAME
226 ID_VIEW_SORTSIZE
= _core_
.ID_VIEW_SORTSIZE
227 ID_VIEW_SORTTYPE
= _core_
.ID_VIEW_SORTTYPE
228 ID_FILE
= _core_
.ID_FILE
229 ID_FILE1
= _core_
.ID_FILE1
230 ID_FILE2
= _core_
.ID_FILE2
231 ID_FILE3
= _core_
.ID_FILE3
232 ID_FILE4
= _core_
.ID_FILE4
233 ID_FILE5
= _core_
.ID_FILE5
234 ID_FILE6
= _core_
.ID_FILE6
235 ID_FILE7
= _core_
.ID_FILE7
236 ID_FILE8
= _core_
.ID_FILE8
237 ID_FILE9
= _core_
.ID_FILE9
239 ID_CANCEL
= _core_
.ID_CANCEL
240 ID_APPLY
= _core_
.ID_APPLY
241 ID_YES
= _core_
.ID_YES
243 ID_STATIC
= _core_
.ID_STATIC
244 ID_FORWARD
= _core_
.ID_FORWARD
245 ID_BACKWARD
= _core_
.ID_BACKWARD
246 ID_DEFAULT
= _core_
.ID_DEFAULT
247 ID_MORE
= _core_
.ID_MORE
248 ID_SETUP
= _core_
.ID_SETUP
249 ID_RESET
= _core_
.ID_RESET
250 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
251 ID_YESTOALL
= _core_
.ID_YESTOALL
252 ID_NOTOALL
= _core_
.ID_NOTOALL
253 ID_ABORT
= _core_
.ID_ABORT
254 ID_RETRY
= _core_
.ID_RETRY
255 ID_IGNORE
= _core_
.ID_IGNORE
256 ID_ADD
= _core_
.ID_ADD
257 ID_REMOVE
= _core_
.ID_REMOVE
259 ID_DOWN
= _core_
.ID_DOWN
260 ID_HOME
= _core_
.ID_HOME
261 ID_REFRESH
= _core_
.ID_REFRESH
262 ID_STOP
= _core_
.ID_STOP
263 ID_INDEX
= _core_
.ID_INDEX
264 ID_BOLD
= _core_
.ID_BOLD
265 ID_ITALIC
= _core_
.ID_ITALIC
266 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
267 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
268 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
269 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
270 ID_UNDERLINE
= _core_
.ID_UNDERLINE
271 ID_INDENT
= _core_
.ID_INDENT
272 ID_UNINDENT
= _core_
.ID_UNINDENT
273 ID_ZOOM_100
= _core_
.ID_ZOOM_100
274 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
275 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
276 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
277 ID_UNDELETE
= _core_
.ID_UNDELETE
278 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
279 ID_HIGHEST
= _core_
.ID_HIGHEST
280 PD_AUTO_HIDE
= _core_
.PD_AUTO_HIDE
281 PD_APP_MODAL
= _core_
.PD_APP_MODAL
282 PD_CAN_ABORT
= _core_
.PD_CAN_ABORT
283 PD_ELAPSED_TIME
= _core_
.PD_ELAPSED_TIME
284 PD_ESTIMATED_TIME
= _core_
.PD_ESTIMATED_TIME
285 PD_REMAINING_TIME
= _core_
.PD_REMAINING_TIME
286 PD_SMOOTH
= _core_
.PD_SMOOTH
287 PD_CAN_SKIP
= _core_
.PD_CAN_SKIP
288 MENU_TEAROFF
= _core_
.MENU_TEAROFF
289 MB_DOCKABLE
= _core_
.MB_DOCKABLE
290 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
291 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
292 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
293 LI_VERTICAL
= _core_
.LI_VERTICAL
294 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
295 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
296 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
297 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
298 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
299 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
300 MM_TEXT
= _core_
.MM_TEXT
301 MM_LOMETRIC
= _core_
.MM_LOMETRIC
302 MM_HIMETRIC
= _core_
.MM_HIMETRIC
303 MM_LOENGLISH
= _core_
.MM_LOENGLISH
304 MM_HIENGLISH
= _core_
.MM_HIENGLISH
305 MM_TWIPS
= _core_
.MM_TWIPS
306 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
307 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
308 MM_POINTS
= _core_
.MM_POINTS
309 MM_METRIC
= _core_
.MM_METRIC
310 CENTRE
= _core_
.CENTRE
311 CENTER
= _core_
.CENTER
312 HORIZONTAL
= _core_
.HORIZONTAL
313 VERTICAL
= _core_
.VERTICAL
320 BOTTOM
= _core_
.BOTTOM
326 ALIGN_NOT
= _core_
.ALIGN_NOT
327 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
328 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
329 ALIGN_LEFT
= _core_
.ALIGN_LEFT
330 ALIGN_TOP
= _core_
.ALIGN_TOP
331 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
332 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
333 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
334 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
335 ALIGN_CENTER
= _core_
.ALIGN_CENTER
336 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
337 ALIGN_MASK
= _core_
.ALIGN_MASK
338 STRETCH_NOT
= _core_
.STRETCH_NOT
339 SHRINK
= _core_
.SHRINK
341 EXPAND
= _core_
.EXPAND
342 SHAPED
= _core_
.SHAPED
343 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
345 ADJUST_MINSIZE
= _core_
.ADJUST_MINSIZE
346 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
347 BORDER_NONE
= _core_
.BORDER_NONE
348 BORDER_STATIC
= _core_
.BORDER_STATIC
349 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
350 BORDER_RAISED
= _core_
.BORDER_RAISED
351 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
352 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
353 BORDER_MASK
= _core_
.BORDER_MASK
354 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
355 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
356 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
357 DEFAULT
= _core_
.DEFAULT
358 DECORATIVE
= _core_
.DECORATIVE
360 SCRIPT
= _core_
.SCRIPT
362 MODERN
= _core_
.MODERN
363 TELETYPE
= _core_
.TELETYPE
364 VARIABLE
= _core_
.VARIABLE
366 NORMAL
= _core_
.NORMAL
369 ITALIC
= _core_
.ITALIC
373 LONG_DASH
= _core_
.LONG_DASH
374 SHORT_DASH
= _core_
.SHORT_DASH
375 DOT_DASH
= _core_
.DOT_DASH
376 USER_DASH
= _core_
.USER_DASH
377 TRANSPARENT
= _core_
.TRANSPARENT
378 STIPPLE
= _core_
.STIPPLE
379 STIPPLE_MASK
= _core_
.STIPPLE_MASK
380 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
381 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
382 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
383 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
384 CROSS_HATCH
= _core_
.CROSS_HATCH
385 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
386 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
387 JOIN_BEVEL
= _core_
.JOIN_BEVEL
388 JOIN_MITER
= _core_
.JOIN_MITER
389 JOIN_ROUND
= _core_
.JOIN_ROUND
390 CAP_ROUND
= _core_
.CAP_ROUND
391 CAP_PROJECTING
= _core_
.CAP_PROJECTING
392 CAP_BUTT
= _core_
.CAP_BUTT
395 INVERT
= _core_
.INVERT
396 OR_REVERSE
= _core_
.OR_REVERSE
397 AND_REVERSE
= _core_
.AND_REVERSE
400 AND_INVERT
= _core_
.AND_INVERT
404 SRC_INVERT
= _core_
.SRC_INVERT
405 OR_INVERT
= _core_
.OR_INVERT
409 WXK_BACK
= _core_
.WXK_BACK
410 WXK_TAB
= _core_
.WXK_TAB
411 WXK_RETURN
= _core_
.WXK_RETURN
412 WXK_ESCAPE
= _core_
.WXK_ESCAPE
413 WXK_SPACE
= _core_
.WXK_SPACE
414 WXK_DELETE
= _core_
.WXK_DELETE
415 WXK_START
= _core_
.WXK_START
416 WXK_LBUTTON
= _core_
.WXK_LBUTTON
417 WXK_RBUTTON
= _core_
.WXK_RBUTTON
418 WXK_CANCEL
= _core_
.WXK_CANCEL
419 WXK_MBUTTON
= _core_
.WXK_MBUTTON
420 WXK_CLEAR
= _core_
.WXK_CLEAR
421 WXK_SHIFT
= _core_
.WXK_SHIFT
422 WXK_ALT
= _core_
.WXK_ALT
423 WXK_CONTROL
= _core_
.WXK_CONTROL
424 WXK_MENU
= _core_
.WXK_MENU
425 WXK_PAUSE
= _core_
.WXK_PAUSE
426 WXK_CAPITAL
= _core_
.WXK_CAPITAL
427 WXK_PRIOR
= _core_
.WXK_PRIOR
428 WXK_NEXT
= _core_
.WXK_NEXT
429 WXK_END
= _core_
.WXK_END
430 WXK_HOME
= _core_
.WXK_HOME
431 WXK_LEFT
= _core_
.WXK_LEFT
432 WXK_UP
= _core_
.WXK_UP
433 WXK_RIGHT
= _core_
.WXK_RIGHT
434 WXK_DOWN
= _core_
.WXK_DOWN
435 WXK_SELECT
= _core_
.WXK_SELECT
436 WXK_PRINT
= _core_
.WXK_PRINT
437 WXK_EXECUTE
= _core_
.WXK_EXECUTE
438 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
439 WXK_INSERT
= _core_
.WXK_INSERT
440 WXK_HELP
= _core_
.WXK_HELP
441 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
442 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
443 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
444 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
445 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
446 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
447 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
448 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
449 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
450 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
451 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
452 WXK_ADD
= _core_
.WXK_ADD
453 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
454 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
455 WXK_DECIMAL
= _core_
.WXK_DECIMAL
456 WXK_DIVIDE
= _core_
.WXK_DIVIDE
457 WXK_F1
= _core_
.WXK_F1
458 WXK_F2
= _core_
.WXK_F2
459 WXK_F3
= _core_
.WXK_F3
460 WXK_F4
= _core_
.WXK_F4
461 WXK_F5
= _core_
.WXK_F5
462 WXK_F6
= _core_
.WXK_F6
463 WXK_F7
= _core_
.WXK_F7
464 WXK_F8
= _core_
.WXK_F8
465 WXK_F9
= _core_
.WXK_F9
466 WXK_F10
= _core_
.WXK_F10
467 WXK_F11
= _core_
.WXK_F11
468 WXK_F12
= _core_
.WXK_F12
469 WXK_F13
= _core_
.WXK_F13
470 WXK_F14
= _core_
.WXK_F14
471 WXK_F15
= _core_
.WXK_F15
472 WXK_F16
= _core_
.WXK_F16
473 WXK_F17
= _core_
.WXK_F17
474 WXK_F18
= _core_
.WXK_F18
475 WXK_F19
= _core_
.WXK_F19
476 WXK_F20
= _core_
.WXK_F20
477 WXK_F21
= _core_
.WXK_F21
478 WXK_F22
= _core_
.WXK_F22
479 WXK_F23
= _core_
.WXK_F23
480 WXK_F24
= _core_
.WXK_F24
481 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
482 WXK_SCROLL
= _core_
.WXK_SCROLL
483 WXK_PAGEUP
= _core_
.WXK_PAGEUP
484 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
485 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
486 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
487 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
488 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
489 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
490 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
491 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
492 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
493 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
494 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
495 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
496 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
497 WXK_NUMPAD_PRIOR
= _core_
.WXK_NUMPAD_PRIOR
498 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
499 WXK_NUMPAD_NEXT
= _core_
.WXK_NUMPAD_NEXT
500 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
501 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
502 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
503 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
504 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
505 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
506 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
507 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
508 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
509 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
510 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
511 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
512 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
513 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
514 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
515 WXK_COMMAND
= _core_
.WXK_COMMAND
516 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
517 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
518 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
519 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
520 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
521 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
522 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
523 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
524 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
525 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
526 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
527 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
528 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
529 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
530 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
531 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
532 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
533 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
534 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
535 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
536 PAPER_NONE
= _core_
.PAPER_NONE
537 PAPER_LETTER
= _core_
.PAPER_LETTER
538 PAPER_LEGAL
= _core_
.PAPER_LEGAL
539 PAPER_A4
= _core_
.PAPER_A4
540 PAPER_CSHEET
= _core_
.PAPER_CSHEET
541 PAPER_DSHEET
= _core_
.PAPER_DSHEET
542 PAPER_ESHEET
= _core_
.PAPER_ESHEET
543 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
544 PAPER_TABLOID
= _core_
.PAPER_TABLOID
545 PAPER_LEDGER
= _core_
.PAPER_LEDGER
546 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
547 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
548 PAPER_A3
= _core_
.PAPER_A3
549 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
550 PAPER_A5
= _core_
.PAPER_A5
551 PAPER_B4
= _core_
.PAPER_B4
552 PAPER_B5
= _core_
.PAPER_B5
553 PAPER_FOLIO
= _core_
.PAPER_FOLIO
554 PAPER_QUARTO
= _core_
.PAPER_QUARTO
555 PAPER_10X14
= _core_
.PAPER_10X14
556 PAPER_11X17
= _core_
.PAPER_11X17
557 PAPER_NOTE
= _core_
.PAPER_NOTE
558 PAPER_ENV_9
= _core_
.PAPER_ENV_9
559 PAPER_ENV_10
= _core_
.PAPER_ENV_10
560 PAPER_ENV_11
= _core_
.PAPER_ENV_11
561 PAPER_ENV_12
= _core_
.PAPER_ENV_12
562 PAPER_ENV_14
= _core_
.PAPER_ENV_14
563 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
564 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
565 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
566 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
567 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
568 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
569 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
570 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
571 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
572 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
573 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
574 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
575 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
576 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
577 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
578 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
579 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
580 PAPER_9X11
= _core_
.PAPER_9X11
581 PAPER_10X11
= _core_
.PAPER_10X11
582 PAPER_15X11
= _core_
.PAPER_15X11
583 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
584 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
585 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
586 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
587 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
588 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
589 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
590 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
591 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
592 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
593 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
594 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
595 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
596 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
597 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
598 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
599 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
600 PAPER_A2
= _core_
.PAPER_A2
601 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
602 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
603 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
604 PAPER_A6
= _core_
.PAPER_A6
605 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
606 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
607 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
608 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
609 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
610 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
611 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
612 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
613 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
614 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
615 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
616 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
617 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
618 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
619 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
620 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
621 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
622 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
623 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
624 PAPER_12X11
= _core_
.PAPER_12X11
625 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
626 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
627 PAPER_P16K
= _core_
.PAPER_P16K
628 PAPER_P32K
= _core_
.PAPER_P32K
629 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
630 PAPER_PENV_1
= _core_
.PAPER_PENV_1
631 PAPER_PENV_2
= _core_
.PAPER_PENV_2
632 PAPER_PENV_3
= _core_
.PAPER_PENV_3
633 PAPER_PENV_4
= _core_
.PAPER_PENV_4
634 PAPER_PENV_5
= _core_
.PAPER_PENV_5
635 PAPER_PENV_6
= _core_
.PAPER_PENV_6
636 PAPER_PENV_7
= _core_
.PAPER_PENV_7
637 PAPER_PENV_8
= _core_
.PAPER_PENV_8
638 PAPER_PENV_9
= _core_
.PAPER_PENV_9
639 PAPER_PENV_10
= _core_
.PAPER_PENV_10
640 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
641 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
642 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
643 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
644 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
645 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
646 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
647 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
648 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
649 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
650 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
651 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
652 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
653 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
654 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
655 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
656 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
657 ITEM_NORMAL
= _core_
.ITEM_NORMAL
658 ITEM_CHECK
= _core_
.ITEM_CHECK
659 ITEM_RADIO
= _core_
.ITEM_RADIO
660 ITEM_MAX
= _core_
.ITEM_MAX
661 HT_NOWHERE
= _core_
.HT_NOWHERE
662 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
663 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
664 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
665 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
666 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
667 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
668 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
669 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
670 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
671 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
672 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
673 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
674 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
675 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
676 HT_MAX
= _core_
.HT_MAX
677 MOD_NONE
= _core_
.MOD_NONE
678 MOD_ALT
= _core_
.MOD_ALT
679 MOD_CONTROL
= _core_
.MOD_CONTROL
680 MOD_ALTGR
= _core_
.MOD_ALTGR
681 MOD_SHIFT
= _core_
.MOD_SHIFT
682 MOD_META
= _core_
.MOD_META
683 MOD_WIN
= _core_
.MOD_WIN
684 MOD_CMD
= _core_
.MOD_CMD
685 MOD_ALL
= _core_
.MOD_ALL
686 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
687 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
688 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
689 #---------------------------------------------------------------------------
691 class Object(object):
693 The base class for most wx objects, although in wxPython not
694 much functionality is needed nor exposed.
696 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
697 def __init__(self
): raise AttributeError, "No constructor defined"
698 __repr__
= _swig_repr
699 def GetClassName(*args
, **kwargs
):
701 GetClassName(self) -> String
703 Returns the class name of the C++ class using wxRTTI.
705 return _core_
.Object_GetClassName(*args
, **kwargs
)
707 def Destroy(*args
, **kwargs
):
711 Deletes the C++ object this Python object is a proxy for.
713 val
= _core_
.Object_Destroy(*args
, **kwargs
)
717 _core_
.Object_swigregister(Object
)
718 _wxPySetDictionary
= _core_
._wxPySetDictionary
720 EmptyString
= cvar
.EmptyString
722 #---------------------------------------------------------------------------
724 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
725 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
726 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
727 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
728 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
729 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
730 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
731 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
732 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
733 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
734 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
735 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
736 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
737 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
738 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
739 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
740 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
741 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
742 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
743 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
744 CURSOR_NONE
= _core_
.CURSOR_NONE
745 CURSOR_ARROW
= _core_
.CURSOR_ARROW
746 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
747 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
748 CURSOR_CHAR
= _core_
.CURSOR_CHAR
749 CURSOR_CROSS
= _core_
.CURSOR_CROSS
750 CURSOR_HAND
= _core_
.CURSOR_HAND
751 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
752 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
753 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
754 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
755 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
756 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
757 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
758 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
759 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
760 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
761 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
762 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
763 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
764 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
765 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
766 CURSOR_SIZING
= _core_
.CURSOR_SIZING
767 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
768 CURSOR_WAIT
= _core_
.CURSOR_WAIT
769 CURSOR_WATCH
= _core_
.CURSOR_WATCH
770 CURSOR_BLANK
= _core_
.CURSOR_BLANK
771 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
772 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
773 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
774 CURSOR_MAX
= _core_
.CURSOR_MAX
775 #---------------------------------------------------------------------------
779 wx.Size is a useful data structure used to represent the size of
780 something. It simply contains integer width and height
781 properties. In most places in wxPython where a wx.Size is
782 expected a (width, height) tuple can be used instead.
784 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
785 __repr__
= _swig_repr
786 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
787 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
788 x
= width
; y
= height
789 def __init__(self
, *args
, **kwargs
):
791 __init__(self, int w=0, int h=0) -> Size
793 Creates a size object.
795 _core_
.Size_swiginit(self
,_core_
.new_Size(*args
, **kwargs
))
796 __swig_destroy__
= _core_
.delete_Size
797 __del__
= lambda self
: None;
798 def __eq__(*args
, **kwargs
):
800 __eq__(self, PyObject other) -> bool
802 Test for equality of wx.Size objects.
804 return _core_
.Size___eq__(*args
, **kwargs
)
806 def __ne__(*args
, **kwargs
):
808 __ne__(self, PyObject other) -> bool
810 Test for inequality of wx.Size objects.
812 return _core_
.Size___ne__(*args
, **kwargs
)
814 def __add__(*args
, **kwargs
):
816 __add__(self, Size sz) -> Size
818 Add sz's proprties to this and return the result.
820 return _core_
.Size___add__(*args
, **kwargs
)
822 def __sub__(*args
, **kwargs
):
824 __sub__(self, Size sz) -> Size
826 Subtract sz's properties from this and return the result.
828 return _core_
.Size___sub__(*args
, **kwargs
)
830 def IncTo(*args
, **kwargs
):
834 Increments this object so that both of its dimensions are not less
835 than the corresponding dimensions of the size.
837 return _core_
.Size_IncTo(*args
, **kwargs
)
839 def DecTo(*args
, **kwargs
):
843 Decrements this object so that both of its dimensions are not greater
844 than the corresponding dimensions of the size.
846 return _core_
.Size_DecTo(*args
, **kwargs
)
848 def Scale(*args
, **kwargs
):
850 Scale(self, float xscale, float yscale)
852 Scales the dimensions of this object by the given factors.
854 return _core_
.Size_Scale(*args
, **kwargs
)
856 def Set(*args
, **kwargs
):
858 Set(self, int w, int h)
860 Set both width and height.
862 return _core_
.Size_Set(*args
, **kwargs
)
864 def SetWidth(*args
, **kwargs
):
865 """SetWidth(self, int w)"""
866 return _core_
.Size_SetWidth(*args
, **kwargs
)
868 def SetHeight(*args
, **kwargs
):
869 """SetHeight(self, int h)"""
870 return _core_
.Size_SetHeight(*args
, **kwargs
)
872 def GetWidth(*args
, **kwargs
):
873 """GetWidth(self) -> int"""
874 return _core_
.Size_GetWidth(*args
, **kwargs
)
876 def GetHeight(*args
, **kwargs
):
877 """GetHeight(self) -> int"""
878 return _core_
.Size_GetHeight(*args
, **kwargs
)
880 def IsFullySpecified(*args
, **kwargs
):
882 IsFullySpecified(self) -> bool
884 Returns True if both components of the size are non-default values.
886 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
888 def SetDefaults(*args
, **kwargs
):
890 SetDefaults(self, Size size)
892 Combine this size with the other one replacing the default components
893 of this object (i.e. equal to -1) with those of the other.
895 return _core_
.Size_SetDefaults(*args
, **kwargs
)
897 def Get(*args
, **kwargs
):
899 Get() -> (width,height)
901 Returns the width and height properties as a tuple.
903 return _core_
.Size_Get(*args
, **kwargs
)
905 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
906 def __str__(self
): return str(self
.Get())
907 def __repr__(self
): return 'wx.Size'+str(self
.Get())
908 def __len__(self
): return len(self
.Get())
909 def __getitem__(self
, index
): return self
.Get()[index
]
910 def __setitem__(self
, index
, val
):
911 if index
== 0: self
.width
= val
912 elif index
== 1: self
.height
= val
913 else: raise IndexError
914 def __nonzero__(self
): return self
.Get() != (0,0)
915 __safe_for_unpickling__
= True
916 def __reduce__(self
): return (wx
.Size
, self
.Get())
918 _core_
.Size_swigregister(Size
)
920 #---------------------------------------------------------------------------
922 class RealPoint(object):
924 A data structure for representing a point or position with floating
925 point x and y properties. In wxPython most places that expect a
926 wx.RealPoint can also accept a (x,y) tuple.
928 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
929 __repr__
= _swig_repr
930 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
931 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
932 def __init__(self
, *args
, **kwargs
):
934 __init__(self, double x=0.0, double y=0.0) -> RealPoint
936 Create a wx.RealPoint object
938 _core_
.RealPoint_swiginit(self
,_core_
.new_RealPoint(*args
, **kwargs
))
939 __swig_destroy__
= _core_
.delete_RealPoint
940 __del__
= lambda self
: None;
941 def __eq__(*args
, **kwargs
):
943 __eq__(self, PyObject other) -> bool
945 Test for equality of wx.RealPoint objects.
947 return _core_
.RealPoint___eq__(*args
, **kwargs
)
949 def __ne__(*args
, **kwargs
):
951 __ne__(self, PyObject other) -> bool
953 Test for inequality of wx.RealPoint objects.
955 return _core_
.RealPoint___ne__(*args
, **kwargs
)
957 def __add__(*args
, **kwargs
):
959 __add__(self, RealPoint pt) -> RealPoint
961 Add pt's proprties to this and return the result.
963 return _core_
.RealPoint___add__(*args
, **kwargs
)
965 def __sub__(*args
, **kwargs
):
967 __sub__(self, RealPoint pt) -> RealPoint
969 Subtract pt's proprties from this and return the result
971 return _core_
.RealPoint___sub__(*args
, **kwargs
)
973 def Set(*args
, **kwargs
):
975 Set(self, double x, double y)
977 Set both the x and y properties
979 return _core_
.RealPoint_Set(*args
, **kwargs
)
981 def Get(*args
, **kwargs
):
985 Return the x and y properties as a tuple.
987 return _core_
.RealPoint_Get(*args
, **kwargs
)
989 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
990 def __str__(self
): return str(self
.Get())
991 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
992 def __len__(self
): return len(self
.Get())
993 def __getitem__(self
, index
): return self
.Get()[index
]
994 def __setitem__(self
, index
, val
):
995 if index
== 0: self
.x
= val
996 elif index
== 1: self
.y
= val
997 else: raise IndexError
998 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
999 __safe_for_unpickling__
= True
1000 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
1002 _core_
.RealPoint_swigregister(RealPoint
)
1004 #---------------------------------------------------------------------------
1006 class Point(object):
1008 A data structure for representing a point or position with integer x
1009 and y properties. Most places in wxPython that expect a wx.Point can
1010 also accept a (x,y) tuple.
1012 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1013 __repr__
= _swig_repr
1014 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1015 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1016 def __init__(self
, *args
, **kwargs
):
1018 __init__(self, int x=0, int y=0) -> Point
1020 Create a wx.Point object
1022 _core_
.Point_swiginit(self
,_core_
.new_Point(*args
, **kwargs
))
1023 __swig_destroy__
= _core_
.delete_Point
1024 __del__
= lambda self
: None;
1025 def __eq__(*args
, **kwargs
):
1027 __eq__(self, PyObject other) -> bool
1029 Test for equality of wx.Point objects.
1031 return _core_
.Point___eq__(*args
, **kwargs
)
1033 def __ne__(*args
, **kwargs
):
1035 __ne__(self, PyObject other) -> bool
1037 Test for inequality of wx.Point objects.
1039 return _core_
.Point___ne__(*args
, **kwargs
)
1041 def __add__(*args
, **kwargs
):
1043 __add__(self, Point pt) -> Point
1045 Add pt's proprties to this and return the result.
1047 return _core_
.Point___add__(*args
, **kwargs
)
1049 def __sub__(*args
, **kwargs
):
1051 __sub__(self, Point pt) -> Point
1053 Subtract pt's proprties from this and return the result
1055 return _core_
.Point___sub__(*args
, **kwargs
)
1057 def __iadd__(*args
, **kwargs
):
1059 __iadd__(self, Point pt) -> Point
1061 Add pt to this object.
1063 return _core_
.Point___iadd__(*args
, **kwargs
)
1065 def __isub__(*args
, **kwargs
):
1067 __isub__(self, Point pt) -> Point
1069 Subtract pt from this object.
1071 return _core_
.Point___isub__(*args
, **kwargs
)
1073 def Set(*args
, **kwargs
):
1075 Set(self, long x, long y)
1077 Set both the x and y properties
1079 return _core_
.Point_Set(*args
, **kwargs
)
1081 def Get(*args
, **kwargs
):
1085 Return the x and y properties as a tuple.
1087 return _core_
.Point_Get(*args
, **kwargs
)
1089 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1090 def __str__(self
): return str(self
.Get())
1091 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1092 def __len__(self
): return len(self
.Get())
1093 def __getitem__(self
, index
): return self
.Get()[index
]
1094 def __setitem__(self
, index
, val
):
1095 if index
== 0: self
.x
= val
1096 elif index
== 1: self
.y
= val
1097 else: raise IndexError
1098 def __nonzero__(self
): return self
.Get() != (0,0)
1099 __safe_for_unpickling__
= True
1100 def __reduce__(self
): return (wx
.Point
, self
.Get())
1102 _core_
.Point_swigregister(Point
)
1104 #---------------------------------------------------------------------------
1108 A class for representing and manipulating rectangles. It has x, y,
1109 width and height properties. In wxPython most palces that expect a
1110 wx.Rect can also accept a (x,y,width,height) tuple.
1112 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1113 __repr__
= _swig_repr
1114 def __init__(self
, *args
, **kwargs
):
1116 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1118 Create a new Rect object.
1120 _core_
.Rect_swiginit(self
,_core_
.new_Rect(*args
, **kwargs
))
1121 __swig_destroy__
= _core_
.delete_Rect
1122 __del__
= lambda self
: None;
1123 def GetX(*args
, **kwargs
):
1124 """GetX(self) -> int"""
1125 return _core_
.Rect_GetX(*args
, **kwargs
)
1127 def SetX(*args
, **kwargs
):
1128 """SetX(self, int x)"""
1129 return _core_
.Rect_SetX(*args
, **kwargs
)
1131 def GetY(*args
, **kwargs
):
1132 """GetY(self) -> int"""
1133 return _core_
.Rect_GetY(*args
, **kwargs
)
1135 def SetY(*args
, **kwargs
):
1136 """SetY(self, int y)"""
1137 return _core_
.Rect_SetY(*args
, **kwargs
)
1139 def GetWidth(*args
, **kwargs
):
1140 """GetWidth(self) -> int"""
1141 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1143 def SetWidth(*args
, **kwargs
):
1144 """SetWidth(self, int w)"""
1145 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1147 def GetHeight(*args
, **kwargs
):
1148 """GetHeight(self) -> int"""
1149 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1151 def SetHeight(*args
, **kwargs
):
1152 """SetHeight(self, int h)"""
1153 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1155 def GetPosition(*args
, **kwargs
):
1156 """GetPosition(self) -> Point"""
1157 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1159 def SetPosition(*args
, **kwargs
):
1160 """SetPosition(self, Point p)"""
1161 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1163 def GetSize(*args
, **kwargs
):
1164 """GetSize(self) -> Size"""
1165 return _core_
.Rect_GetSize(*args
, **kwargs
)
1167 def SetSize(*args
, **kwargs
):
1168 """SetSize(self, Size s)"""
1169 return _core_
.Rect_SetSize(*args
, **kwargs
)
1171 def IsEmpty(*args
, **kwargs
):
1172 """IsEmpty(self) -> bool"""
1173 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1175 def GetTopLeft(*args
, **kwargs
):
1176 """GetTopLeft(self) -> Point"""
1177 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1179 def SetTopLeft(*args
, **kwargs
):
1180 """SetTopLeft(self, Point p)"""
1181 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1183 def GetBottomRight(*args
, **kwargs
):
1184 """GetBottomRight(self) -> Point"""
1185 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1187 def SetBottomRight(*args
, **kwargs
):
1188 """SetBottomRight(self, Point p)"""
1189 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1191 def GetLeft(*args
, **kwargs
):
1192 """GetLeft(self) -> int"""
1193 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1195 def GetTop(*args
, **kwargs
):
1196 """GetTop(self) -> int"""
1197 return _core_
.Rect_GetTop(*args
, **kwargs
)
1199 def GetBottom(*args
, **kwargs
):
1200 """GetBottom(self) -> int"""
1201 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1203 def GetRight(*args
, **kwargs
):
1204 """GetRight(self) -> int"""
1205 return _core_
.Rect_GetRight(*args
, **kwargs
)
1207 def SetLeft(*args
, **kwargs
):
1208 """SetLeft(self, int left)"""
1209 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1211 def SetRight(*args
, **kwargs
):
1212 """SetRight(self, int right)"""
1213 return _core_
.Rect_SetRight(*args
, **kwargs
)
1215 def SetTop(*args
, **kwargs
):
1216 """SetTop(self, int top)"""
1217 return _core_
.Rect_SetTop(*args
, **kwargs
)
1219 def SetBottom(*args
, **kwargs
):
1220 """SetBottom(self, int bottom)"""
1221 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1223 position
= property(GetPosition
, SetPosition
)
1224 size
= property(GetSize
, SetSize
)
1225 left
= property(GetLeft
, SetLeft
)
1226 right
= property(GetRight
, SetRight
)
1227 top
= property(GetTop
, SetTop
)
1228 bottom
= property(GetBottom
, SetBottom
)
1230 def Inflate(*args
, **kwargs
):
1232 Inflate(self, int dx, int dy) -> Rect
1234 Increases the size of the rectangle.
1236 The left border is moved farther left and the right border is moved
1237 farther right by ``dx``. The upper border is moved farther up and the
1238 bottom border is moved farther down by ``dy``. (Note the the width and
1239 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1240 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1241 opposite happens: the rectangle size decreases in the respective
1244 The change is made to the rectangle inplace, if instead you need a
1245 copy that is inflated, preserving the original then make the copy
1248 copy = wx.Rect(*original)
1253 return _core_
.Rect_Inflate(*args
, **kwargs
)
1255 def Deflate(*args
, **kwargs
):
1257 Deflate(self, int dx, int dy) -> Rect
1259 Decrease the rectangle size. This method is the opposite of `Inflate`
1260 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1261 `Inflate` for a full description.
1263 return _core_
.Rect_Deflate(*args
, **kwargs
)
1265 def OffsetXY(*args
, **kwargs
):
1267 OffsetXY(self, int dx, int dy)
1269 Moves the rectangle by the specified offset. If dx is positive, the
1270 rectangle is moved to the right, if dy is positive, it is moved to the
1271 bottom, otherwise it is moved to the left or top respectively.
1273 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1275 def Offset(*args
, **kwargs
):
1277 Offset(self, Point pt)
1279 Same as `OffsetXY` but uses dx,dy from Point
1281 return _core_
.Rect_Offset(*args
, **kwargs
)
1283 def Intersect(*args
, **kwargs
):
1285 Intersect(self, Rect rect) -> Rect
1287 Returns the intersectsion of this rectangle and rect.
1289 return _core_
.Rect_Intersect(*args
, **kwargs
)
1291 def Union(*args
, **kwargs
):
1293 Union(self, Rect rect) -> Rect
1295 Returns the union of this rectangle and rect.
1297 return _core_
.Rect_Union(*args
, **kwargs
)
1299 def __add__(*args
, **kwargs
):
1301 __add__(self, Rect rect) -> Rect
1303 Add the properties of rect to this rectangle and return the result.
1305 return _core_
.Rect___add__(*args
, **kwargs
)
1307 def __iadd__(*args
, **kwargs
):
1309 __iadd__(self, Rect rect) -> Rect
1311 Add the properties of rect to this rectangle, updating this rectangle.
1313 return _core_
.Rect___iadd__(*args
, **kwargs
)
1315 def __eq__(*args
, **kwargs
):
1317 __eq__(self, PyObject other) -> bool
1319 Test for equality of wx.Rect objects.
1321 return _core_
.Rect___eq__(*args
, **kwargs
)
1323 def __ne__(*args
, **kwargs
):
1325 __ne__(self, PyObject other) -> bool
1327 Test for inequality of wx.Rect objects.
1329 return _core_
.Rect___ne__(*args
, **kwargs
)
1331 def InsideXY(*args
, **kwargs
):
1333 InsideXY(self, int x, int y) -> bool
1335 Return True if the point is (not strcitly) inside the rect.
1337 return _core_
.Rect_InsideXY(*args
, **kwargs
)
1339 def Inside(*args
, **kwargs
):
1341 Inside(self, Point pt) -> bool
1343 Return True if the point is (not strcitly) inside the rect.
1345 return _core_
.Rect_Inside(*args
, **kwargs
)
1347 def InsideRect(*args
, **kwargs
):
1349 InsideRect(self, Rect rect) -> bool
1351 Returns ``True`` if the given rectangle is completely inside this
1352 rectangle or touches its boundary.
1354 return _core_
.Rect_InsideRect(*args
, **kwargs
)
1356 def Intersects(*args
, **kwargs
):
1358 Intersects(self, Rect rect) -> bool
1360 Returns True if the rectangles have a non empty intersection.
1362 return _core_
.Rect_Intersects(*args
, **kwargs
)
1364 def CenterIn(*args
, **kwargs
):
1366 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1368 Center this rectangle within the one passed to the method, which is
1369 usually, but not necessarily, the larger one.
1371 return _core_
.Rect_CenterIn(*args
, **kwargs
)
1374 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1375 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1376 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1377 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1378 def Set(*args
, **kwargs
):
1380 Set(self, int x=0, int y=0, int width=0, int height=0)
1382 Set all rectangle properties.
1384 return _core_
.Rect_Set(*args
, **kwargs
)
1386 def Get(*args
, **kwargs
):
1388 Get() -> (x,y,width,height)
1390 Return the rectangle properties as a tuple.
1392 return _core_
.Rect_Get(*args
, **kwargs
)
1394 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1395 def __str__(self
): return str(self
.Get())
1396 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1397 def __len__(self
): return len(self
.Get())
1398 def __getitem__(self
, index
): return self
.Get()[index
]
1399 def __setitem__(self
, index
, val
):
1400 if index
== 0: self
.x
= val
1401 elif index
== 1: self
.y
= val
1402 elif index
== 2: self
.width
= val
1403 elif index
== 3: self
.height
= val
1404 else: raise IndexError
1405 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1406 __safe_for_unpickling__
= True
1407 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1409 _core_
.Rect_swigregister(Rect
)
1411 def RectPP(*args
, **kwargs
):
1413 RectPP(Point topLeft, Point bottomRight) -> Rect
1415 Create a new Rect object from Points representing two corners.
1417 val
= _core_
.new_RectPP(*args
, **kwargs
)
1420 def RectPS(*args
, **kwargs
):
1422 RectPS(Point pos, Size size) -> Rect
1424 Create a new Rect from a position and size.
1426 val
= _core_
.new_RectPS(*args
, **kwargs
)
1429 def RectS(*args
, **kwargs
):
1431 RectS(Size size) -> Rect
1433 Create a new Rect from a size only.
1435 val
= _core_
.new_RectS(*args
, **kwargs
)
1439 def IntersectRect(*args
, **kwargs
):
1441 IntersectRect(Rect r1, Rect r2) -> Rect
1443 Calculate and return the intersection of r1 and r2.
1445 return _core_
.IntersectRect(*args
, **kwargs
)
1446 #---------------------------------------------------------------------------
1448 class Point2D(object):
1450 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1451 with floating point values.
1453 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1454 __repr__
= _swig_repr
1455 def __init__(self
, *args
, **kwargs
):
1457 __init__(self, double x=0.0, double y=0.0) -> Point2D
1459 Create a w.Point2D object.
1461 _core_
.Point2D_swiginit(self
,_core_
.new_Point2D(*args
, **kwargs
))
1462 def GetFloor(*args
, **kwargs
):
1468 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1470 def GetRounded(*args
, **kwargs
):
1472 GetRounded() -> (x,y)
1476 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1478 def GetVectorLength(*args
, **kwargs
):
1479 """GetVectorLength(self) -> double"""
1480 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1482 def GetVectorAngle(*args
, **kwargs
):
1483 """GetVectorAngle(self) -> double"""
1484 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1486 def SetVectorLength(*args
, **kwargs
):
1487 """SetVectorLength(self, double length)"""
1488 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1490 def SetVectorAngle(*args
, **kwargs
):
1491 """SetVectorAngle(self, double degrees)"""
1492 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1494 def SetPolarCoordinates(self
, angle
, length
):
1495 self
.SetVectorLength(length
)
1496 self
.SetVectorAngle(angle
)
1497 def Normalize(self
):
1498 self
.SetVectorLength(1.0)
1500 def GetDistance(*args
, **kwargs
):
1501 """GetDistance(self, Point2D pt) -> double"""
1502 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1504 def GetDistanceSquare(*args
, **kwargs
):
1505 """GetDistanceSquare(self, Point2D pt) -> double"""
1506 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1508 def GetDotProduct(*args
, **kwargs
):
1509 """GetDotProduct(self, Point2D vec) -> double"""
1510 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1512 def GetCrossProduct(*args
, **kwargs
):
1513 """GetCrossProduct(self, Point2D vec) -> double"""
1514 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1516 def __neg__(*args
, **kwargs
):
1518 __neg__(self) -> Point2D
1520 the reflection of this point
1522 return _core_
.Point2D___neg__(*args
, **kwargs
)
1524 def __iadd__(*args
, **kwargs
):
1525 """__iadd__(self, Point2D pt) -> Point2D"""
1526 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1528 def __isub__(*args
, **kwargs
):
1529 """__isub__(self, Point2D pt) -> Point2D"""
1530 return _core_
.Point2D___isub__(*args
, **kwargs
)
1532 def __imul__(*args
, **kwargs
):
1533 """__imul__(self, Point2D pt) -> Point2D"""
1534 return _core_
.Point2D___imul__(*args
, **kwargs
)
1536 def __idiv__(*args
, **kwargs
):
1537 """__idiv__(self, Point2D pt) -> Point2D"""
1538 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1540 def __eq__(*args
, **kwargs
):
1542 __eq__(self, PyObject other) -> bool
1544 Test for equality of wx.Point2D objects.
1546 return _core_
.Point2D___eq__(*args
, **kwargs
)
1548 def __ne__(*args
, **kwargs
):
1550 __ne__(self, PyObject other) -> bool
1552 Test for inequality of wx.Point2D objects.
1554 return _core_
.Point2D___ne__(*args
, **kwargs
)
1556 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1557 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1558 def Set(*args
, **kwargs
):
1559 """Set(self, double x=0, double y=0)"""
1560 return _core_
.Point2D_Set(*args
, **kwargs
)
1562 def Get(*args
, **kwargs
):
1566 Return x and y properties as a tuple.
1568 return _core_
.Point2D_Get(*args
, **kwargs
)
1570 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1571 def __str__(self
): return str(self
.Get())
1572 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1573 def __len__(self
): return len(self
.Get())
1574 def __getitem__(self
, index
): return self
.Get()[index
]
1575 def __setitem__(self
, index
, val
):
1576 if index
== 0: self
.x
= val
1577 elif index
== 1: self
.y
= val
1578 else: raise IndexError
1579 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1580 __safe_for_unpickling__
= True
1581 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1583 _core_
.Point2D_swigregister(Point2D
)
1585 def Point2DCopy(*args
, **kwargs
):
1587 Point2DCopy(Point2D pt) -> Point2D
1589 Create a w.Point2D object.
1591 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1594 def Point2DFromPoint(*args
, **kwargs
):
1596 Point2DFromPoint(Point pt) -> Point2D
1598 Create a w.Point2D object.
1600 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1603 #---------------------------------------------------------------------------
1605 FromStart
= _core_
.FromStart
1606 FromCurrent
= _core_
.FromCurrent
1607 FromEnd
= _core_
.FromEnd
1608 class InputStream(object):
1609 """Proxy of C++ InputStream class"""
1610 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1611 __repr__
= _swig_repr
1612 def __init__(self
, *args
, **kwargs
):
1613 """__init__(self, PyObject p) -> InputStream"""
1614 _core_
.InputStream_swiginit(self
,_core_
.new_InputStream(*args
, **kwargs
))
1615 __swig_destroy__
= _core_
.delete_InputStream
1616 __del__
= lambda self
: None;
1617 def close(*args
, **kwargs
):
1619 return _core_
.InputStream_close(*args
, **kwargs
)
1621 def flush(*args
, **kwargs
):
1623 return _core_
.InputStream_flush(*args
, **kwargs
)
1625 def eof(*args
, **kwargs
):
1626 """eof(self) -> bool"""
1627 return _core_
.InputStream_eof(*args
, **kwargs
)
1629 def read(*args
, **kwargs
):
1630 """read(self, int size=-1) -> PyObject"""
1631 return _core_
.InputStream_read(*args
, **kwargs
)
1633 def readline(*args
, **kwargs
):
1634 """readline(self, int size=-1) -> PyObject"""
1635 return _core_
.InputStream_readline(*args
, **kwargs
)
1637 def readlines(*args
, **kwargs
):
1638 """readlines(self, int sizehint=-1) -> PyObject"""
1639 return _core_
.InputStream_readlines(*args
, **kwargs
)
1641 def seek(*args
, **kwargs
):
1642 """seek(self, int offset, int whence=0)"""
1643 return _core_
.InputStream_seek(*args
, **kwargs
)
1645 def tell(*args
, **kwargs
):
1646 """tell(self) -> int"""
1647 return _core_
.InputStream_tell(*args
, **kwargs
)
1649 def Peek(*args
, **kwargs
):
1650 """Peek(self) -> char"""
1651 return _core_
.InputStream_Peek(*args
, **kwargs
)
1653 def GetC(*args
, **kwargs
):
1654 """GetC(self) -> char"""
1655 return _core_
.InputStream_GetC(*args
, **kwargs
)
1657 def LastRead(*args
, **kwargs
):
1658 """LastRead(self) -> size_t"""
1659 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1661 def CanRead(*args
, **kwargs
):
1662 """CanRead(self) -> bool"""
1663 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1665 def Eof(*args
, **kwargs
):
1666 """Eof(self) -> bool"""
1667 return _core_
.InputStream_Eof(*args
, **kwargs
)
1669 def Ungetch(*args
, **kwargs
):
1670 """Ungetch(self, char c) -> bool"""
1671 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1673 def SeekI(*args
, **kwargs
):
1674 """SeekI(self, long pos, int mode=FromStart) -> long"""
1675 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1677 def TellI(*args
, **kwargs
):
1678 """TellI(self) -> long"""
1679 return _core_
.InputStream_TellI(*args
, **kwargs
)
1681 _core_
.InputStream_swigregister(InputStream
)
1682 DefaultPosition
= cvar
.DefaultPosition
1683 DefaultSize
= cvar
.DefaultSize
1685 class OutputStream(object):
1686 """Proxy of C++ OutputStream class"""
1687 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1688 def __init__(self
): raise AttributeError, "No constructor defined"
1689 __repr__
= _swig_repr
1690 def write(*args
, **kwargs
):
1691 """write(self, PyObject obj)"""
1692 return _core_
.OutputStream_write(*args
, **kwargs
)
1694 def LastWrite(*args
, **kwargs
):
1695 """LastWrite(self) -> size_t"""
1696 return _core_
.OutputStream_LastWrite(*args
, **kwargs
)
1698 _core_
.OutputStream_swigregister(OutputStream
)
1700 #---------------------------------------------------------------------------
1702 class FSFile(Object
):
1703 """Proxy of C++ FSFile class"""
1704 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1705 __repr__
= _swig_repr
1706 def __init__(self
, *args
, **kwargs
):
1708 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1709 DateTime modif) -> FSFile
1711 _core_
.FSFile_swiginit(self
,_core_
.new_FSFile(*args
, **kwargs
))
1712 __swig_destroy__
= _core_
.delete_FSFile
1713 __del__
= lambda self
: None;
1714 def GetStream(*args
, **kwargs
):
1715 """GetStream(self) -> InputStream"""
1716 return _core_
.FSFile_GetStream(*args
, **kwargs
)
1718 def DetachStream(*args
, **kwargs
):
1719 """DetachStream(self)"""
1720 return _core_
.FSFile_DetachStream(*args
, **kwargs
)
1722 def GetMimeType(*args
, **kwargs
):
1723 """GetMimeType(self) -> String"""
1724 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
1726 def GetLocation(*args
, **kwargs
):
1727 """GetLocation(self) -> String"""
1728 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
1730 def GetAnchor(*args
, **kwargs
):
1731 """GetAnchor(self) -> String"""
1732 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
1734 def GetModificationTime(*args
, **kwargs
):
1735 """GetModificationTime(self) -> DateTime"""
1736 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
1738 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
1739 Location
= property(GetLocation
,doc
="See `GetLocation`")
1740 MimeType
= property(GetMimeType
,doc
="See `GetMimeType`")
1741 ModificationTime
= property(GetModificationTime
,doc
="See `GetModificationTime`")
1742 Stream
= property(GetStream
,doc
="See `GetStream`")
1743 _core_
.FSFile_swigregister(FSFile
)
1745 class CPPFileSystemHandler(object):
1746 """Proxy of C++ CPPFileSystemHandler class"""
1747 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1748 def __init__(self
): raise AttributeError, "No constructor defined"
1749 __repr__
= _swig_repr
1750 __swig_destroy__
= _core_
.delete_CPPFileSystemHandler
1751 __del__
= lambda self
: None;
1752 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandler
)
1754 class FileSystemHandler(CPPFileSystemHandler
):
1755 """Proxy of C++ FileSystemHandler class"""
1756 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1757 __repr__
= _swig_repr
1758 def __init__(self
, *args
, **kwargs
):
1759 """__init__(self) -> FileSystemHandler"""
1760 _core_
.FileSystemHandler_swiginit(self
,_core_
.new_FileSystemHandler(*args
, **kwargs
))
1761 self
._setCallbackInfo
(self
, FileSystemHandler
)
1763 def _setCallbackInfo(*args
, **kwargs
):
1764 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1765 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
1767 def CanOpen(*args
, **kwargs
):
1768 """CanOpen(self, String location) -> bool"""
1769 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
1771 def OpenFile(*args
, **kwargs
):
1772 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1773 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
1775 def FindFirst(*args
, **kwargs
):
1776 """FindFirst(self, String spec, int flags=0) -> String"""
1777 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
1779 def FindNext(*args
, **kwargs
):
1780 """FindNext(self) -> String"""
1781 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
1783 def GetProtocol(*args
, **kwargs
):
1784 """GetProtocol(self, String location) -> String"""
1785 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
1787 def GetLeftLocation(*args
, **kwargs
):
1788 """GetLeftLocation(self, String location) -> String"""
1789 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
1791 def GetAnchor(*args
, **kwargs
):
1792 """GetAnchor(self, String location) -> String"""
1793 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
1795 def GetRightLocation(*args
, **kwargs
):
1796 """GetRightLocation(self, String location) -> String"""
1797 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
1799 def GetMimeTypeFromExt(*args
, **kwargs
):
1800 """GetMimeTypeFromExt(self, String location) -> String"""
1801 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
1803 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
1804 LeftLocation
= property(GetLeftLocation
,doc
="See `GetLeftLocation`")
1805 MimeTypeFromExt
= property(GetMimeTypeFromExt
,doc
="See `GetMimeTypeFromExt`")
1806 Protocol
= property(GetProtocol
,doc
="See `GetProtocol`")
1807 RightLocation
= property(GetRightLocation
,doc
="See `GetRightLocation`")
1808 _core_
.FileSystemHandler_swigregister(FileSystemHandler
)
1810 class FileSystem(Object
):
1811 """Proxy of C++ FileSystem class"""
1812 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1813 __repr__
= _swig_repr
1814 def __init__(self
, *args
, **kwargs
):
1815 """__init__(self) -> FileSystem"""
1816 _core_
.FileSystem_swiginit(self
,_core_
.new_FileSystem(*args
, **kwargs
))
1817 __swig_destroy__
= _core_
.delete_FileSystem
1818 __del__
= lambda self
: None;
1819 def ChangePathTo(*args
, **kwargs
):
1820 """ChangePathTo(self, String location, bool is_dir=False)"""
1821 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
1823 def GetPath(*args
, **kwargs
):
1824 """GetPath(self) -> String"""
1825 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
1827 def OpenFile(*args
, **kwargs
):
1828 """OpenFile(self, String location) -> FSFile"""
1829 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
1831 def FindFirst(*args
, **kwargs
):
1832 """FindFirst(self, String spec, int flags=0) -> String"""
1833 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
1835 def FindNext(*args
, **kwargs
):
1836 """FindNext(self) -> String"""
1837 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
1839 def AddHandler(*args
, **kwargs
):
1840 """AddHandler(CPPFileSystemHandler handler)"""
1841 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1843 AddHandler
= staticmethod(AddHandler
)
1844 def RemoveHandler(*args
, **kwargs
):
1845 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1846 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
1848 RemoveHandler
= staticmethod(RemoveHandler
)
1849 def CleanUpHandlers(*args
, **kwargs
):
1850 """CleanUpHandlers()"""
1851 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1853 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
1854 def FileNameToURL(*args
, **kwargs
):
1855 """FileNameToURL(String filename) -> String"""
1856 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1858 FileNameToURL
= staticmethod(FileNameToURL
)
1859 def URLToFileName(*args
, **kwargs
):
1860 """URLToFileName(String url) -> String"""
1861 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1863 URLToFileName
= staticmethod(URLToFileName
)
1864 Path
= property(GetPath
,doc
="See `GetPath`")
1865 _core_
.FileSystem_swigregister(FileSystem
)
1867 def FileSystem_AddHandler(*args
, **kwargs
):
1868 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1869 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1871 def FileSystem_RemoveHandler(*args
, **kwargs
):
1872 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1873 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
1875 def FileSystem_CleanUpHandlers(*args
):
1876 """FileSystem_CleanUpHandlers()"""
1877 return _core_
.FileSystem_CleanUpHandlers(*args
)
1879 def FileSystem_FileNameToURL(*args
, **kwargs
):
1880 """FileSystem_FileNameToURL(String filename) -> String"""
1881 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1883 def FileSystem_URLToFileName(*args
, **kwargs
):
1884 """FileSystem_URLToFileName(String url) -> String"""
1885 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1887 class InternetFSHandler(CPPFileSystemHandler
):
1888 """Proxy of C++ InternetFSHandler class"""
1889 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1890 __repr__
= _swig_repr
1891 def __init__(self
, *args
, **kwargs
):
1892 """__init__(self) -> InternetFSHandler"""
1893 _core_
.InternetFSHandler_swiginit(self
,_core_
.new_InternetFSHandler(*args
, **kwargs
))
1894 def CanOpen(*args
, **kwargs
):
1895 """CanOpen(self, String location) -> bool"""
1896 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
1898 def OpenFile(*args
, **kwargs
):
1899 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1900 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
1902 _core_
.InternetFSHandler_swigregister(InternetFSHandler
)
1904 class ZipFSHandler(CPPFileSystemHandler
):
1905 """Proxy of C++ ZipFSHandler class"""
1906 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1907 __repr__
= _swig_repr
1908 def __init__(self
, *args
, **kwargs
):
1909 """__init__(self) -> ZipFSHandler"""
1910 _core_
.ZipFSHandler_swiginit(self
,_core_
.new_ZipFSHandler(*args
, **kwargs
))
1911 def CanOpen(*args
, **kwargs
):
1912 """CanOpen(self, String location) -> bool"""
1913 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
1915 def OpenFile(*args
, **kwargs
):
1916 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1917 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
1919 def FindFirst(*args
, **kwargs
):
1920 """FindFirst(self, String spec, int flags=0) -> String"""
1921 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
1923 def FindNext(*args
, **kwargs
):
1924 """FindNext(self) -> String"""
1925 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
1927 _core_
.ZipFSHandler_swigregister(ZipFSHandler
)
1930 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
1931 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1932 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
1934 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
1935 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1936 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
1938 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
1939 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1940 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
1941 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
1943 Add 'file' to the memory filesystem. The dataItem parameter can
1944 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1945 arbitrary data. If a bitmap or image is used then the imgType
1946 parameter should specify what kind of image file it should be
1947 written as, wx.BITMAP_TYPE_PNG, etc.
1949 if isinstance(dataItem
, wx
.Image
):
1950 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
1951 elif isinstance(dataItem
, wx
.Bitmap
):
1952 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
1953 elif type(dataItem
) == str:
1954 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
1956 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1958 class MemoryFSHandler(CPPFileSystemHandler
):
1959 """Proxy of C++ MemoryFSHandler class"""
1960 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1961 __repr__
= _swig_repr
1962 def __init__(self
, *args
, **kwargs
):
1963 """__init__(self) -> MemoryFSHandler"""
1964 _core_
.MemoryFSHandler_swiginit(self
,_core_
.new_MemoryFSHandler(*args
, **kwargs
))
1965 def RemoveFile(*args
, **kwargs
):
1966 """RemoveFile(String filename)"""
1967 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1969 RemoveFile
= staticmethod(RemoveFile
)
1970 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
1971 def CanOpen(*args
, **kwargs
):
1972 """CanOpen(self, String location) -> bool"""
1973 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
1975 def OpenFile(*args
, **kwargs
):
1976 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1977 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
1979 def FindFirst(*args
, **kwargs
):
1980 """FindFirst(self, String spec, int flags=0) -> String"""
1981 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
1983 def FindNext(*args
, **kwargs
):
1984 """FindNext(self) -> String"""
1985 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
1987 _core_
.MemoryFSHandler_swigregister(MemoryFSHandler
)
1989 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
1990 """MemoryFSHandler_RemoveFile(String filename)"""
1991 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1993 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
1994 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
1995 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
1996 #---------------------------------------------------------------------------
1998 class ImageHandler(Object
):
2000 This is the base class for implementing image file loading/saving, and
2001 image creation from data. It is used within `wx.Image` and is not
2002 normally seen by the application.
2004 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2005 def __init__(self
): raise AttributeError, "No constructor defined"
2006 __repr__
= _swig_repr
2007 def GetName(*args
, **kwargs
):
2008 """GetName(self) -> String"""
2009 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
2011 def GetExtension(*args
, **kwargs
):
2012 """GetExtension(self) -> String"""
2013 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
2015 def GetType(*args
, **kwargs
):
2016 """GetType(self) -> long"""
2017 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2019 def GetMimeType(*args
, **kwargs
):
2020 """GetMimeType(self) -> String"""
2021 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2023 def CanRead(*args
, **kwargs
):
2024 """CanRead(self, String name) -> bool"""
2025 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2027 def CanReadStream(*args
, **kwargs
):
2028 """CanReadStream(self, InputStream stream) -> bool"""
2029 return _core_
.ImageHandler_CanReadStream(*args
, **kwargs
)
2031 def SetName(*args
, **kwargs
):
2032 """SetName(self, String name)"""
2033 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2035 def SetExtension(*args
, **kwargs
):
2036 """SetExtension(self, String extension)"""
2037 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2039 def SetType(*args
, **kwargs
):
2040 """SetType(self, long type)"""
2041 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2043 def SetMimeType(*args
, **kwargs
):
2044 """SetMimeType(self, String mimetype)"""
2045 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2047 Extension
= property(GetExtension
,SetExtension
,doc
="See `GetExtension` and `SetExtension`")
2048 MimeType
= property(GetMimeType
,SetMimeType
,doc
="See `GetMimeType` and `SetMimeType`")
2049 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
2050 Type
= property(GetType
,SetType
,doc
="See `GetType` and `SetType`")
2051 _core_
.ImageHandler_swigregister(ImageHandler
)
2053 class PyImageHandler(ImageHandler
):
2055 This is the base class for implementing image file loading/saving, and
2056 image creation from data, all written in Python. To create a custom
2057 image handler derive a new class from wx.PyImageHandler and provide
2058 the following methods::
2060 def DoCanRead(self, stream) --> bool
2061 '''Check if this handler can read the image on the stream'''
2063 def LoadFile(self, image, stream, verbose, index) --> bool
2064 '''Load image data from the stream and load it into image.'''
2066 def SaveFile(self, image, stream, verbose) --> bool
2067 '''Save the iamge data in image to the stream using
2068 this handler's image file format.'''
2070 def GetImageCount(self, stream) --> int
2071 '''If this image format can hold more than one image,
2072 how many does the image on the stream have?'''
2074 To activate your handler create an instance of it and pass it to
2075 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2076 `SetExtension` from your constructor.
2079 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2080 __repr__
= _swig_repr
2081 def __init__(self
, *args
, **kwargs
):
2083 __init__(self) -> PyImageHandler
2085 This is the base class for implementing image file loading/saving, and
2086 image creation from data, all written in Python. To create a custom
2087 image handler derive a new class from wx.PyImageHandler and provide
2088 the following methods::
2090 def DoCanRead(self, stream) --> bool
2091 '''Check if this handler can read the image on the stream'''
2093 def LoadFile(self, image, stream, verbose, index) --> bool
2094 '''Load image data from the stream and load it into image.'''
2096 def SaveFile(self, image, stream, verbose) --> bool
2097 '''Save the iamge data in image to the stream using
2098 this handler's image file format.'''
2100 def GetImageCount(self, stream) --> int
2101 '''If this image format can hold more than one image,
2102 how many does the image on the stream have?'''
2104 To activate your handler create an instance of it and pass it to
2105 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2106 `SetExtension` from your constructor.
2109 _core_
.PyImageHandler_swiginit(self
,_core_
.new_PyImageHandler(*args
, **kwargs
))
2112 def _SetSelf(*args
, **kwargs
):
2113 """_SetSelf(self, PyObject self)"""
2114 return _core_
.PyImageHandler__SetSelf(*args
, **kwargs
)
2116 _core_
.PyImageHandler_swigregister(PyImageHandler
)
2118 class ImageHistogram(object):
2119 """Proxy of C++ ImageHistogram class"""
2120 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2121 __repr__
= _swig_repr
2122 def __init__(self
, *args
, **kwargs
):
2123 """__init__(self) -> ImageHistogram"""
2124 _core_
.ImageHistogram_swiginit(self
,_core_
.new_ImageHistogram(*args
, **kwargs
))
2125 def MakeKey(*args
, **kwargs
):
2127 MakeKey(byte r, byte g, byte b) -> unsigned long
2129 Get the key in the histogram for the given RGB values
2131 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2133 MakeKey
= staticmethod(MakeKey
)
2134 def FindFirstUnusedColour(*args
, **kwargs
):
2136 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2138 Find first colour that is not used in the image and has higher RGB
2139 values than startR, startG, startB. Returns a tuple consisting of a
2140 success flag and rgb values.
2142 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2144 def GetCount(*args
, **kwargs
):
2146 GetCount(self, unsigned long key) -> unsigned long
2148 Returns the pixel count for the given key. Use `MakeKey` to create a
2149 key value from a RGB tripple.
2151 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2153 def GetCountRGB(*args
, **kwargs
):
2155 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2157 Returns the pixel count for the given RGB values.
2159 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2161 def GetCountColour(*args
, **kwargs
):
2163 GetCountColour(self, Colour colour) -> unsigned long
2165 Returns the pixel count for the given `wx.Colour` value.
2167 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2169 _core_
.ImageHistogram_swigregister(ImageHistogram
)
2171 def ImageHistogram_MakeKey(*args
, **kwargs
):
2173 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2175 Get the key in the histogram for the given RGB values
2177 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2179 class Image_RGBValue(object):
2181 An object that contains values for red, green and blue which represent
2182 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2183 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2186 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2187 __repr__
= _swig_repr
2188 def __init__(self
, *args
, **kwargs
):
2190 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2194 _core_
.Image_RGBValue_swiginit(self
,_core_
.new_Image_RGBValue(*args
, **kwargs
))
2195 red
= property(_core_
.Image_RGBValue_red_get
, _core_
.Image_RGBValue_red_set
)
2196 green
= property(_core_
.Image_RGBValue_green_get
, _core_
.Image_RGBValue_green_set
)
2197 blue
= property(_core_
.Image_RGBValue_blue_get
, _core_
.Image_RGBValue_blue_set
)
2198 _core_
.Image_RGBValue_swigregister(Image_RGBValue
)
2200 class Image_HSVValue(object):
2202 An object that contains values for hue, saturation and value which
2203 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2204 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2207 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2208 __repr__
= _swig_repr
2209 def __init__(self
, *args
, **kwargs
):
2211 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2215 _core_
.Image_HSVValue_swiginit(self
,_core_
.new_Image_HSVValue(*args
, **kwargs
))
2216 hue
= property(_core_
.Image_HSVValue_hue_get
, _core_
.Image_HSVValue_hue_set
)
2217 saturation
= property(_core_
.Image_HSVValue_saturation_get
, _core_
.Image_HSVValue_saturation_set
)
2218 value
= property(_core_
.Image_HSVValue_value_get
, _core_
.Image_HSVValue_value_set
)
2219 _core_
.Image_HSVValue_swigregister(Image_HSVValue
)
2221 class Image(Object
):
2223 A platform-independent image class. An image can be created from
2224 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2225 variety of formats. Functions are available to set and get image
2226 bits, so it can be used for basic image manipulation.
2228 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2229 platform-specific `wx.Bitmap` object must be created from it using the
2230 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2231 device context, using `wx.DC.DrawBitmap`.
2233 One colour value of the image may be used as a mask colour which will
2234 lead to the automatic creation of a `wx.Mask` object associated to the
2237 wx.Image supports alpha channel data, that is in addition to a byte
2238 for the red, green and blue colour components for each pixel it also
2239 stores a byte representing the pixel opacity. An alpha value of 0
2240 corresponds to a transparent pixel (null opacity) while a value of 255
2241 means that the pixel is 100% opaque.
2243 Unlike RGB data, not all images have an alpha channel and before using
2244 `GetAlpha` you should check if this image contains an alpha channel
2245 with `HasAlpha`. Note that currently only images loaded from PNG files
2246 with transparency information will have an alpha channel.
2248 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2249 __repr__
= _swig_repr
2250 def __init__(self
, *args
, **kwargs
):
2252 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2254 Loads an image from a file.
2256 _core_
.Image_swiginit(self
,_core_
.new_Image(*args
, **kwargs
))
2257 __swig_destroy__
= _core_
.delete_Image
2258 __del__
= lambda self
: None;
2259 def Create(*args
, **kwargs
):
2261 Create(self, int width, int height, bool clear=True)
2263 Creates a fresh image. If clear is ``True``, the new image will be
2264 initialized to black. Otherwise, the image data will be uninitialized.
2266 return _core_
.Image_Create(*args
, **kwargs
)
2268 def Destroy(*args
, **kwargs
):
2272 Destroys the image data.
2274 val
= _core_
.Image_Destroy(*args
, **kwargs
)
2278 def Scale(*args
, **kwargs
):
2280 Scale(self, int width, int height) -> Image
2282 Returns a scaled version of the image. This is also useful for scaling
2283 bitmaps in general as the only other way to scale bitmaps is to blit a
2284 `wx.MemoryDC` into another `wx.MemoryDC`.
2286 return _core_
.Image_Scale(*args
, **kwargs
)
2288 def ShrinkBy(*args
, **kwargs
):
2290 ShrinkBy(self, int xFactor, int yFactor) -> Image
2292 Return a version of the image scaled smaller by the given factors.
2294 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2296 def Rescale(*args
, **kwargs
):
2298 Rescale(self, int width, int height) -> Image
2300 Changes the size of the image in-place by scaling it: after a call to
2301 this function, the image will have the given width and height.
2303 Returns the (modified) image itself.
2305 return _core_
.Image_Rescale(*args
, **kwargs
)
2307 def Resize(*args
, **kwargs
):
2309 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2311 Changes the size of the image in-place without scaling it, by adding
2312 either a border with the given colour or cropping as necessary. The
2313 image is pasted into a new image with the given size and background
2314 colour at the position pos relative to the upper left of the new
2315 image. If red = green = blue = -1 then use either the current mask
2316 colour if set or find, use, and set a suitable mask colour for any
2317 newly exposed areas.
2319 Returns the (modified) image itself.
2321 return _core_
.Image_Resize(*args
, **kwargs
)
2323 def SetRGB(*args
, **kwargs
):
2325 SetRGB(self, int x, int y, byte r, byte g, byte b)
2327 Sets the pixel at the given coordinate. This routine performs
2328 bounds-checks for the coordinate so it can be considered a safe way to
2329 manipulate the data, but in some cases this might be too slow so that
2330 the data will have to be set directly. In that case you will have to
2331 get access to the image data using the `GetData` method.
2333 return _core_
.Image_SetRGB(*args
, **kwargs
)
2335 def SetRGBRect(*args
, **kwargs
):
2337 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2339 Sets the colour of the pixels within the given rectangle. This routine
2340 performs bounds-checks for the rectangle so it can be considered a
2341 safe way to manipulate the data.
2343 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2345 def GetRed(*args
, **kwargs
):
2347 GetRed(self, int x, int y) -> byte
2349 Returns the red intensity at the given coordinate.
2351 return _core_
.Image_GetRed(*args
, **kwargs
)
2353 def GetGreen(*args
, **kwargs
):
2355 GetGreen(self, int x, int y) -> byte
2357 Returns the green intensity at the given coordinate.
2359 return _core_
.Image_GetGreen(*args
, **kwargs
)
2361 def GetBlue(*args
, **kwargs
):
2363 GetBlue(self, int x, int y) -> byte
2365 Returns the blue intensity at the given coordinate.
2367 return _core_
.Image_GetBlue(*args
, **kwargs
)
2369 def SetAlpha(*args
, **kwargs
):
2371 SetAlpha(self, int x, int y, byte alpha)
2373 Sets the alpha value for the given pixel. This function should only be
2374 called if the image has alpha channel data, use `HasAlpha` to check
2377 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2379 def GetAlpha(*args
, **kwargs
):
2381 GetAlpha(self, int x, int y) -> byte
2383 Returns the alpha value for the given pixel. This function may only be
2384 called for the images with alpha channel, use `HasAlpha` to check for
2387 The returned value is the *opacity* of the image, i.e. the value of 0
2388 corresponds to the fully transparent pixels while the value of 255 to
2389 the fully opaque pixels.
2391 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2393 def HasAlpha(*args
, **kwargs
):
2395 HasAlpha(self) -> bool
2397 Returns true if this image has alpha channel, false otherwise.
2399 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2401 def InitAlpha(*args
, **kwargs
):
2405 Initializes the image alpha channel data. It is an error to call it if
2406 the image already has alpha data. If it doesn't, alpha data will be by
2407 default initialized to all pixels being fully opaque. But if the image
2408 has a a mask colour, all mask pixels will be completely transparent.
2410 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2412 def IsTransparent(*args
, **kwargs
):
2414 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2416 Returns ``True`` if this pixel is masked or has an alpha value less
2417 than the spcified threshold.
2419 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2421 def FindFirstUnusedColour(*args
, **kwargs
):
2423 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2425 Find first colour that is not used in the image and has higher RGB
2426 values than startR, startG, startB. Returns a tuple consisting of a
2427 success flag and rgb values.
2429 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2431 def ConvertAlphaToMask(*args
, **kwargs
):
2433 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2435 If the image has alpha channel, this method converts it to mask. All
2436 pixels with alpha value less than ``threshold`` are replaced with the
2437 mask colour and the alpha channel is removed. The mask colour is
2438 chosen automatically using `FindFirstUnusedColour`.
2440 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2443 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2445 def ConvertColourToAlpha(*args
, **kwargs
):
2447 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2449 This method converts an image where the original alpha information is
2450 only available as a shades of a colour (actually shades of grey)
2451 typically when you draw anti-aliased text into a bitmap. The DC
2452 drawing routines draw grey values on the black background although
2453 they actually mean to draw white with differnt alpha values. This
2454 method reverses it, assuming a black (!) background and white text.
2455 The method will then fill up the whole image with the colour given.
2457 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2459 def SetMaskFromImage(*args
, **kwargs
):
2461 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2463 Sets the image's mask so that the pixels that have RGB value of
2464 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2465 by first finding an unused colour in the image, setting this colour as
2466 the mask colour and then using this colour to draw all pixels in the
2467 image who corresponding pixel in mask has given RGB value.
2469 Returns ``False`` if ``mask`` does not have same dimensions as the
2470 image or if there is no unused colour left. Returns ``True`` if the
2471 mask was successfully applied.
2473 Note that this method involves computing the histogram, which is
2474 computationally intensive operation.
2476 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2478 def CanRead(*args
, **kwargs
):
2480 CanRead(String filename) -> bool
2482 Returns True if the image handlers can read this file.
2484 return _core_
.Image_CanRead(*args
, **kwargs
)
2486 CanRead
= staticmethod(CanRead
)
2487 def GetImageCount(*args
, **kwargs
):
2489 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2491 If the image file contains more than one image and the image handler
2492 is capable of retrieving these individually, this function will return
2493 the number of available images.
2495 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2497 GetImageCount
= staticmethod(GetImageCount
)
2498 def LoadFile(*args
, **kwargs
):
2500 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2502 Loads an image from a file. If no handler type is provided, the
2503 library will try to autodetect the format.
2505 return _core_
.Image_LoadFile(*args
, **kwargs
)
2507 def LoadMimeFile(*args
, **kwargs
):
2509 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2511 Loads an image from a file, specifying the image type with a MIME type
2514 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2516 def SaveFile(*args
, **kwargs
):
2518 SaveFile(self, String name, int type) -> bool
2520 Saves an image in the named file.
2522 return _core_
.Image_SaveFile(*args
, **kwargs
)
2524 def SaveMimeFile(*args
, **kwargs
):
2526 SaveMimeFile(self, String name, String mimetype) -> bool
2528 Saves an image in the named file.
2530 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2532 def CanReadStream(*args
, **kwargs
):
2534 CanReadStream(InputStream stream) -> bool
2536 Returns True if the image handlers can read an image file from the
2537 data currently on the input stream, or a readable Python file-like
2540 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2542 CanReadStream
= staticmethod(CanReadStream
)
2543 def LoadStream(*args
, **kwargs
):
2545 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2547 Loads an image from an input stream or a readable Python file-like
2548 object. If no handler type is provided, the library will try to
2549 autodetect the format.
2551 return _core_
.Image_LoadStream(*args
, **kwargs
)
2553 def LoadMimeStream(*args
, **kwargs
):
2555 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2557 Loads an image from an input stream or a readable Python file-like
2558 object, using a MIME type string to specify the image file format.
2560 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2562 def Ok(*args
, **kwargs
):
2566 Returns true if image data is present.
2568 return _core_
.Image_Ok(*args
, **kwargs
)
2570 def GetWidth(*args
, **kwargs
):
2572 GetWidth(self) -> int
2574 Gets the width of the image in pixels.
2576 return _core_
.Image_GetWidth(*args
, **kwargs
)
2578 def GetHeight(*args
, **kwargs
):
2580 GetHeight(self) -> int
2582 Gets the height of the image in pixels.
2584 return _core_
.Image_GetHeight(*args
, **kwargs
)
2586 def GetSize(*args
, **kwargs
):
2588 GetSize(self) -> Size
2590 Returns the size of the image in pixels.
2592 return _core_
.Image_GetSize(*args
, **kwargs
)
2594 def GetSubImage(*args
, **kwargs
):
2596 GetSubImage(self, Rect rect) -> Image
2598 Returns a sub image of the current one as long as the rect belongs
2599 entirely to the image.
2601 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2603 def Size(*args
, **kwargs
):
2605 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2607 Returns a resized version of this image without scaling it by adding
2608 either a border with the given colour or cropping as necessary. The
2609 image is pasted into a new image with the given size and background
2610 colour at the position ``pos`` relative to the upper left of the new
2611 image. If red = green = blue = -1 then use either the current mask
2612 colour if set or find, use, and set a suitable mask colour for any
2613 newly exposed areas.
2615 return _core_
.Image_Size(*args
, **kwargs
)
2617 def Copy(*args
, **kwargs
):
2621 Returns an identical copy of the image.
2623 return _core_
.Image_Copy(*args
, **kwargs
)
2625 def Paste(*args
, **kwargs
):
2627 Paste(self, Image image, int x, int y)
2629 Pastes ``image`` into this instance and takes care of the mask colour
2630 and any out of bounds problems.
2632 return _core_
.Image_Paste(*args
, **kwargs
)
2634 def GetData(*args
, **kwargs
):
2636 GetData(self) -> PyObject
2638 Returns a string containing a copy of the RGB bytes of the image.
2640 return _core_
.Image_GetData(*args
, **kwargs
)
2642 def SetData(*args
, **kwargs
):
2644 SetData(self, buffer data)
2646 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2647 either a string or a buffer object holding the data and the length of
2648 the data must be width*height*3.
2650 return _core_
.Image_SetData(*args
, **kwargs
)
2652 def GetDataBuffer(*args
, **kwargs
):
2654 GetDataBuffer(self) -> PyObject
2656 Returns a writable Python buffer object that is pointing at the RGB
2657 image data buffer inside the wx.Image. You need to ensure that you do
2658 not use this buffer object after the image has been destroyed.
2660 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
2662 def SetDataBuffer(*args
, **kwargs
):
2664 SetDataBuffer(self, buffer data)
2666 Sets the internal image data pointer to point at a Python buffer
2667 object. This can save making an extra copy of the data but you must
2668 ensure that the buffer object lives longer than the wx.Image does.
2670 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
2672 def GetAlphaData(*args
, **kwargs
):
2674 GetAlphaData(self) -> PyObject
2676 Returns a string containing a copy of the alpha bytes of the image.
2678 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
2680 def SetAlphaData(*args
, **kwargs
):
2682 SetAlphaData(self, buffer alpha)
2684 Resets the Image's alpha data from a buffer of bytes. Accepts either
2685 a string or a buffer object holding the data and the length of the
2686 data must be width*height.
2688 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
2690 def GetAlphaBuffer(*args
, **kwargs
):
2692 GetAlphaBuffer(self) -> PyObject
2694 Returns a writable Python buffer object that is pointing at the Alpha
2695 data buffer inside the wx.Image. You need to ensure that you do not
2696 use this buffer object after the image has been destroyed.
2698 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
2700 def SetAlphaBuffer(*args
, **kwargs
):
2702 SetAlphaBuffer(self, buffer alpha)
2704 Sets the internal image alpha pointer to point at a Python buffer
2705 object. This can save making an extra copy of the data but you must
2706 ensure that the buffer object lives as long as the wx.Image does.
2708 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
2710 def SetMaskColour(*args
, **kwargs
):
2712 SetMaskColour(self, byte r, byte g, byte b)
2714 Sets the mask colour for this image (and tells the image to use the
2717 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
2719 def GetOrFindMaskColour(*args
, **kwargs
):
2721 GetOrFindMaskColour() -> (r,g,b)
2723 Get the current mask colour or find a suitable colour.
2725 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
2727 def GetMaskRed(*args
, **kwargs
):
2729 GetMaskRed(self) -> byte
2731 Gets the red component of the mask colour.
2733 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
2735 def GetMaskGreen(*args
, **kwargs
):
2737 GetMaskGreen(self) -> byte
2739 Gets the green component of the mask colour.
2741 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
2743 def GetMaskBlue(*args
, **kwargs
):
2745 GetMaskBlue(self) -> byte
2747 Gets the blue component of the mask colour.
2749 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
2751 def SetMask(*args
, **kwargs
):
2753 SetMask(self, bool mask=True)
2755 Specifies whether there is a mask or not. The area of the mask is
2756 determined by the current mask colour.
2758 return _core_
.Image_SetMask(*args
, **kwargs
)
2760 def HasMask(*args
, **kwargs
):
2762 HasMask(self) -> bool
2764 Returns ``True`` if there is a mask active, ``False`` otherwise.
2766 return _core_
.Image_HasMask(*args
, **kwargs
)
2768 def Rotate(*args
, **kwargs
):
2770 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2771 Point offset_after_rotation=None) -> Image
2773 Rotates the image about the given point, by ``angle`` radians. Passing
2774 ``True`` to ``interpolating`` results in better image quality, but is
2775 slower. If the image has a mask, then the mask colour is used for the
2776 uncovered pixels in the rotated image background. Otherwise, black
2777 will be used as the fill colour.
2779 Returns the rotated image, leaving this image intact.
2781 return _core_
.Image_Rotate(*args
, **kwargs
)
2783 def Rotate90(*args
, **kwargs
):
2785 Rotate90(self, bool clockwise=True) -> Image
2787 Returns a copy of the image rotated 90 degrees in the direction
2788 indicated by ``clockwise``.
2790 return _core_
.Image_Rotate90(*args
, **kwargs
)
2792 def Mirror(*args
, **kwargs
):
2794 Mirror(self, bool horizontally=True) -> Image
2796 Returns a mirrored copy of the image. The parameter ``horizontally``
2797 indicates the orientation.
2799 return _core_
.Image_Mirror(*args
, **kwargs
)
2801 def Replace(*args
, **kwargs
):
2803 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2805 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2808 return _core_
.Image_Replace(*args
, **kwargs
)
2810 def ConvertToGreyscale(*args
, **kwargs
):
2812 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2814 Convert to greyscale image. Uses the luminance component (Y) of the
2815 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2816 defaults to ITU-T BT.601
2818 return _core_
.Image_ConvertToGreyscale(*args
, **kwargs
)
2820 def ConvertToMono(*args
, **kwargs
):
2822 ConvertToMono(self, byte r, byte g, byte b) -> Image
2824 Returns monochromatic version of the image. The returned image has
2825 white colour where the original has ``(r,g,b)`` colour and black
2826 colour everywhere else.
2828 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
2830 def SetOption(*args
, **kwargs
):
2832 SetOption(self, String name, String value)
2834 Sets an image handler defined option. For example, when saving as a
2835 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2836 number between 0 and 100 (0 is terrible, 100 is very good).
2838 return _core_
.Image_SetOption(*args
, **kwargs
)
2840 def SetOptionInt(*args
, **kwargs
):
2842 SetOptionInt(self, String name, int value)
2844 Sets an image option as an integer.
2846 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
2848 def GetOption(*args
, **kwargs
):
2850 GetOption(self, String name) -> String
2852 Gets the value of an image handler option.
2854 return _core_
.Image_GetOption(*args
, **kwargs
)
2856 def GetOptionInt(*args
, **kwargs
):
2858 GetOptionInt(self, String name) -> int
2860 Gets the value of an image handler option as an integer. If the given
2861 option is not present, the function returns 0.
2863 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
2865 def HasOption(*args
, **kwargs
):
2867 HasOption(self, String name) -> bool
2869 Returns true if the given option is present.
2871 return _core_
.Image_HasOption(*args
, **kwargs
)
2873 def CountColours(*args
, **kwargs
):
2874 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2875 return _core_
.Image_CountColours(*args
, **kwargs
)
2877 def ComputeHistogram(*args
, **kwargs
):
2878 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2879 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
2881 def AddHandler(*args
, **kwargs
):
2882 """AddHandler(ImageHandler handler)"""
2883 return _core_
.Image_AddHandler(*args
, **kwargs
)
2885 AddHandler
= staticmethod(AddHandler
)
2886 def InsertHandler(*args
, **kwargs
):
2887 """InsertHandler(ImageHandler handler)"""
2888 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2890 InsertHandler
= staticmethod(InsertHandler
)
2891 def RemoveHandler(*args
, **kwargs
):
2892 """RemoveHandler(String name) -> bool"""
2893 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2895 RemoveHandler
= staticmethod(RemoveHandler
)
2896 def GetHandlers(*args
, **kwargs
):
2897 """GetHandlers() -> PyObject"""
2898 return _core_
.Image_GetHandlers(*args
, **kwargs
)
2900 GetHandlers
= staticmethod(GetHandlers
)
2901 def GetImageExtWildcard(*args
, **kwargs
):
2903 GetImageExtWildcard() -> String
2905 Iterates all registered wxImageHandler objects, and returns a string
2906 containing file extension masks suitable for passing to file open/save
2909 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2911 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
2912 def ConvertToBitmap(*args
, **kwargs
):
2913 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2914 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
2916 def ConvertToMonoBitmap(*args
, **kwargs
):
2917 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2918 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
2920 def RotateHue(*args
, **kwargs
):
2922 RotateHue(self, double angle)
2924 Rotates the hue of each pixel of the image. Hue is a double in the
2925 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2927 return _core_
.Image_RotateHue(*args
, **kwargs
)
2929 def RGBtoHSV(*args
, **kwargs
):
2931 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2933 Converts a color in RGB color space to HSV color space.
2935 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
2937 RGBtoHSV
= staticmethod(RGBtoHSV
)
2938 def HSVtoRGB(*args
, **kwargs
):
2940 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2942 Converts a color in HSV color space to RGB color space.
2944 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
2946 HSVtoRGB
= staticmethod(HSVtoRGB
)
2947 def __nonzero__(self
): return self
.Ok()
2948 AlphaBuffer
= property(GetAlphaBuffer
,SetAlphaBuffer
,doc
="See `GetAlphaBuffer` and `SetAlphaBuffer`")
2949 AlphaData
= property(GetAlphaData
,SetAlphaData
,doc
="See `GetAlphaData` and `SetAlphaData`")
2950 Data
= property(GetData
,SetData
,doc
="See `GetData` and `SetData`")
2951 DataBuffer
= property(GetDataBuffer
,SetDataBuffer
,doc
="See `GetDataBuffer` and `SetDataBuffer`")
2952 Height
= property(GetHeight
,doc
="See `GetHeight`")
2953 MaskBlue
= property(GetMaskBlue
,doc
="See `GetMaskBlue`")
2954 MaskGreen
= property(GetMaskGreen
,doc
="See `GetMaskGreen`")
2955 MaskRed
= property(GetMaskRed
,doc
="See `GetMaskRed`")
2956 Size
= property(GetSize
,doc
="See `GetSize`")
2957 Width
= property(GetWidth
,doc
="See `GetWidth`")
2958 _core_
.Image_swigregister(Image
)
2960 def ImageFromMime(*args
, **kwargs
):
2962 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2964 Loads an image from a file, using a MIME type string (such as
2965 'image/jpeg') to specify image type.
2967 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
2970 def ImageFromStream(*args
, **kwargs
):
2972 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2974 Loads an image from an input stream, or any readable Python file-like
2977 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
2980 def ImageFromStreamMime(*args
, **kwargs
):
2982 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2984 Loads an image from an input stream, or any readable Python file-like
2985 object, specifying the image format with a MIME type string.
2987 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
2990 def EmptyImage(*args
, **kwargs
):
2992 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2994 Construct an empty image of a given size, optionally setting all
2997 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
3000 def ImageFromBitmap(*args
, **kwargs
):
3002 ImageFromBitmap(Bitmap bitmap) -> Image
3004 Construct an Image from a `wx.Bitmap`.
3006 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
3009 def ImageFromData(*args
, **kwargs
):
3011 ImageFromData(int width, int height, buffer data) -> Image
3013 Construct an Image from a buffer of RGB bytes. Accepts either a
3014 string or a buffer object holding the data and the length of the data
3015 must be width*height*3.
3017 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
3020 def ImageFromDataWithAlpha(*args
, **kwargs
):
3022 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3024 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3025 Accepts either a string or a buffer object holding the data and the
3026 length of the data must be width*height*3 bytes, and the length of the
3027 alpha data must be width*height bytes.
3029 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
3032 def Image_CanRead(*args
, **kwargs
):
3034 Image_CanRead(String filename) -> bool
3036 Returns True if the image handlers can read this file.
3038 return _core_
.Image_CanRead(*args
, **kwargs
)
3040 def Image_GetImageCount(*args
, **kwargs
):
3042 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3044 If the image file contains more than one image and the image handler
3045 is capable of retrieving these individually, this function will return
3046 the number of available images.
3048 return _core_
.Image_GetImageCount(*args
, **kwargs
)
3050 def Image_CanReadStream(*args
, **kwargs
):
3052 Image_CanReadStream(InputStream stream) -> bool
3054 Returns True if the image handlers can read an image file from the
3055 data currently on the input stream, or a readable Python file-like
3058 return _core_
.Image_CanReadStream(*args
, **kwargs
)
3060 def Image_AddHandler(*args
, **kwargs
):
3061 """Image_AddHandler(ImageHandler handler)"""
3062 return _core_
.Image_AddHandler(*args
, **kwargs
)
3064 def Image_InsertHandler(*args
, **kwargs
):
3065 """Image_InsertHandler(ImageHandler handler)"""
3066 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3068 def Image_RemoveHandler(*args
, **kwargs
):
3069 """Image_RemoveHandler(String name) -> bool"""
3070 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3072 def Image_GetHandlers(*args
):
3073 """Image_GetHandlers() -> PyObject"""
3074 return _core_
.Image_GetHandlers(*args
)
3076 def Image_GetImageExtWildcard(*args
):
3078 Image_GetImageExtWildcard() -> String
3080 Iterates all registered wxImageHandler objects, and returns a string
3081 containing file extension masks suitable for passing to file open/save
3084 return _core_
.Image_GetImageExtWildcard(*args
)
3086 def Image_RGBtoHSV(*args
, **kwargs
):
3088 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3090 Converts a color in RGB color space to HSV color space.
3092 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3094 def Image_HSVtoRGB(*args
, **kwargs
):
3096 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3098 Converts a color in HSV color space to RGB color space.
3100 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3103 def _ImageFromBuffer(*args
, **kwargs
):
3104 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3105 return _core_
._ImageFromBuffer
(*args
, **kwargs
)
3106 def ImageFromBuffer(width
, height
, dataBuffer
, alphaBuffer
=None):
3108 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3109 parameter must be a Python object that implements the buffer interface,
3110 such as a string, array, etc. The dataBuffer object is expected to
3111 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3112 object can optionally be supplied for the image's alpha channel data, and
3113 it is expected to be width*height bytes long.
3115 The wx.Image will be created with its data and alpha pointers initialized
3116 to the memory address pointed to by the buffer objects, thus saving the
3117 time needed to copy the image data from the buffer object to the wx.Image.
3118 While this has advantages, it also has the shoot-yourself-in-the-foot
3119 risks associated with sharing a C pointer between two objects.
3121 To help alleviate the risk a reference to the data and alpha buffer
3122 objects are kept with the wx.Image, so that they won't get deleted until
3123 after the wx.Image is deleted. However please be aware that it is not
3124 guaranteed that an object won't move its memory buffer to a new location
3125 when it needs to resize its contents. If that happens then the wx.Image
3126 will end up referring to an invalid memory location and could cause the
3127 application to crash. Therefore care should be taken to not manipulate
3128 the objects used for the data and alpha buffers in a way that would cause
3129 them to change size.
3131 image
= _core_
._ImageFromBuffer
(width
, height
, dataBuffer
, alphaBuffer
)
3132 image
._buffer
= dataBuffer
3133 image
._alpha
= alphaBuffer
3136 def InitAllImageHandlers():
3138 The former functionality of InitAllImageHanders is now done internal to
3139 the _core_ extension module and so this function has become a simple NOP.
3143 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3144 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3145 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3146 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3147 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3148 BMP_24BPP
= _core_
.BMP_24BPP
3149 BMP_8BPP
= _core_
.BMP_8BPP
3150 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3151 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3152 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3153 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3154 BMP_4BPP
= _core_
.BMP_4BPP
3155 BMP_1BPP
= _core_
.BMP_1BPP
3156 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3157 class BMPHandler(ImageHandler
):
3158 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3159 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3160 __repr__
= _swig_repr
3161 def __init__(self
, *args
, **kwargs
):
3163 __init__(self) -> BMPHandler
3165 A `wx.ImageHandler` for \*.bmp bitmap files.
3167 _core_
.BMPHandler_swiginit(self
,_core_
.new_BMPHandler(*args
, **kwargs
))
3168 _core_
.BMPHandler_swigregister(BMPHandler
)
3169 NullImage
= cvar
.NullImage
3170 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3171 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3172 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3173 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3174 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3175 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3176 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3177 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3178 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3179 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3180 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3181 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3182 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3183 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3184 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3186 class ICOHandler(BMPHandler
):
3187 """A `wx.ImageHandler` for \*.ico icon files."""
3188 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3189 __repr__
= _swig_repr
3190 def __init__(self
, *args
, **kwargs
):
3192 __init__(self) -> ICOHandler
3194 A `wx.ImageHandler` for \*.ico icon files.
3196 _core_
.ICOHandler_swiginit(self
,_core_
.new_ICOHandler(*args
, **kwargs
))
3197 _core_
.ICOHandler_swigregister(ICOHandler
)
3199 class CURHandler(ICOHandler
):
3200 """A `wx.ImageHandler` for \*.cur cursor files."""
3201 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3202 __repr__
= _swig_repr
3203 def __init__(self
, *args
, **kwargs
):
3205 __init__(self) -> CURHandler
3207 A `wx.ImageHandler` for \*.cur cursor files.
3209 _core_
.CURHandler_swiginit(self
,_core_
.new_CURHandler(*args
, **kwargs
))
3210 _core_
.CURHandler_swigregister(CURHandler
)
3212 class ANIHandler(CURHandler
):
3213 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3214 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3215 __repr__
= _swig_repr
3216 def __init__(self
, *args
, **kwargs
):
3218 __init__(self) -> ANIHandler
3220 A `wx.ImageHandler` for \*.ani animated cursor files.
3222 _core_
.ANIHandler_swiginit(self
,_core_
.new_ANIHandler(*args
, **kwargs
))
3223 _core_
.ANIHandler_swigregister(ANIHandler
)
3225 class PNGHandler(ImageHandler
):
3226 """A `wx.ImageHandler` for PNG image files."""
3227 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3228 __repr__
= _swig_repr
3229 def __init__(self
, *args
, **kwargs
):
3231 __init__(self) -> PNGHandler
3233 A `wx.ImageHandler` for PNG image files.
3235 _core_
.PNGHandler_swiginit(self
,_core_
.new_PNGHandler(*args
, **kwargs
))
3236 _core_
.PNGHandler_swigregister(PNGHandler
)
3238 class GIFHandler(ImageHandler
):
3239 """A `wx.ImageHandler` for GIF image files."""
3240 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3241 __repr__
= _swig_repr
3242 def __init__(self
, *args
, **kwargs
):
3244 __init__(self) -> GIFHandler
3246 A `wx.ImageHandler` for GIF image files.
3248 _core_
.GIFHandler_swiginit(self
,_core_
.new_GIFHandler(*args
, **kwargs
))
3249 _core_
.GIFHandler_swigregister(GIFHandler
)
3251 class PCXHandler(ImageHandler
):
3252 """A `wx.ImageHandler` for PCX imager files."""
3253 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3254 __repr__
= _swig_repr
3255 def __init__(self
, *args
, **kwargs
):
3257 __init__(self) -> PCXHandler
3259 A `wx.ImageHandler` for PCX imager files.
3261 _core_
.PCXHandler_swiginit(self
,_core_
.new_PCXHandler(*args
, **kwargs
))
3262 _core_
.PCXHandler_swigregister(PCXHandler
)
3264 class JPEGHandler(ImageHandler
):
3265 """A `wx.ImageHandler` for JPEG/JPG image files."""
3266 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3267 __repr__
= _swig_repr
3268 def __init__(self
, *args
, **kwargs
):
3270 __init__(self) -> JPEGHandler
3272 A `wx.ImageHandler` for JPEG/JPG image files.
3274 _core_
.JPEGHandler_swiginit(self
,_core_
.new_JPEGHandler(*args
, **kwargs
))
3275 _core_
.JPEGHandler_swigregister(JPEGHandler
)
3277 class PNMHandler(ImageHandler
):
3278 """A `wx.ImageHandler` for PNM image files."""
3279 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3280 __repr__
= _swig_repr
3281 def __init__(self
, *args
, **kwargs
):
3283 __init__(self) -> PNMHandler
3285 A `wx.ImageHandler` for PNM image files.
3287 _core_
.PNMHandler_swiginit(self
,_core_
.new_PNMHandler(*args
, **kwargs
))
3288 _core_
.PNMHandler_swigregister(PNMHandler
)
3290 class XPMHandler(ImageHandler
):
3291 """A `wx.ImageHandler` for XPM image."""
3292 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3293 __repr__
= _swig_repr
3294 def __init__(self
, *args
, **kwargs
):
3296 __init__(self) -> XPMHandler
3298 A `wx.ImageHandler` for XPM image.
3300 _core_
.XPMHandler_swiginit(self
,_core_
.new_XPMHandler(*args
, **kwargs
))
3301 _core_
.XPMHandler_swigregister(XPMHandler
)
3303 class TIFFHandler(ImageHandler
):
3304 """A `wx.ImageHandler` for TIFF image files."""
3305 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3306 __repr__
= _swig_repr
3307 def __init__(self
, *args
, **kwargs
):
3309 __init__(self) -> TIFFHandler
3311 A `wx.ImageHandler` for TIFF image files.
3313 _core_
.TIFFHandler_swiginit(self
,_core_
.new_TIFFHandler(*args
, **kwargs
))
3314 _core_
.TIFFHandler_swigregister(TIFFHandler
)
3316 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3317 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3318 class Quantize(object):
3319 """Performs quantization, or colour reduction, on a wxImage."""
3320 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3321 def __init__(self
): raise AttributeError, "No constructor defined"
3322 __repr__
= _swig_repr
3323 def Quantize(*args
, **kwargs
):
3325 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3327 Reduce the colours in the source image and put the result into the
3328 destination image, setting the palette in the destination if
3329 needed. Both images may be the same, to overwrite the source image.
3331 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3333 Quantize
= staticmethod(Quantize
)
3334 _core_
.Quantize_swigregister(Quantize
)
3336 def Quantize_Quantize(*args
, **kwargs
):
3338 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3340 Reduce the colours in the source image and put the result into the
3341 destination image, setting the palette in the destination if
3342 needed. Both images may be the same, to overwrite the source image.
3344 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3346 #---------------------------------------------------------------------------
3348 class EvtHandler(Object
):
3349 """Proxy of C++ EvtHandler class"""
3350 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3351 __repr__
= _swig_repr
3352 def __init__(self
, *args
, **kwargs
):
3353 """__init__(self) -> EvtHandler"""
3354 _core_
.EvtHandler_swiginit(self
,_core_
.new_EvtHandler(*args
, **kwargs
))
3355 def GetNextHandler(*args
, **kwargs
):
3356 """GetNextHandler(self) -> EvtHandler"""
3357 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3359 def GetPreviousHandler(*args
, **kwargs
):
3360 """GetPreviousHandler(self) -> EvtHandler"""
3361 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3363 def SetNextHandler(*args
, **kwargs
):
3364 """SetNextHandler(self, EvtHandler handler)"""
3365 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3367 def SetPreviousHandler(*args
, **kwargs
):
3368 """SetPreviousHandler(self, EvtHandler handler)"""
3369 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3371 def GetEvtHandlerEnabled(*args
, **kwargs
):
3372 """GetEvtHandlerEnabled(self) -> bool"""
3373 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3375 def SetEvtHandlerEnabled(*args
, **kwargs
):
3376 """SetEvtHandlerEnabled(self, bool enabled)"""
3377 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3379 def ProcessEvent(*args
, **kwargs
):
3380 """ProcessEvent(self, Event event) -> bool"""
3381 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3383 def AddPendingEvent(*args
, **kwargs
):
3384 """AddPendingEvent(self, Event event)"""
3385 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3387 def ProcessPendingEvents(*args
, **kwargs
):
3388 """ProcessPendingEvents(self)"""
3389 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3391 def Connect(*args
, **kwargs
):
3392 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3393 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3395 def Disconnect(*args
, **kwargs
):
3396 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3397 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3399 def _setOORInfo(*args
, **kwargs
):
3400 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3401 val
= _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3405 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3407 Bind an event to an event handler.
3409 :param event: One of the EVT_* objects that specifies the
3410 type of event to bind,
3412 :param handler: A callable object to be invoked when the
3413 event is delivered to self. Pass None to
3414 disconnect an event handler.
3416 :param source: Sometimes the event originates from a
3417 different window than self, but you still
3418 want to catch it in self. (For example, a
3419 button event delivered to a frame.) By
3420 passing the source of the event, the event
3421 handling system is able to differentiate
3422 between the same event type from different
3425 :param id: Used to spcify the event source by ID instead
3428 :param id2: Used when it is desirable to bind a handler
3429 to a range of IDs, such as with EVT_MENU_RANGE.
3431 if source
is not None:
3433 event
.Bind(self
, id, id2
, handler
)
3435 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3437 Disconencts the event handler binding for event from self.
3438 Returns True if successful.
3440 if source
is not None:
3442 return event
.Unbind(self
, id, id2
)
3444 EvtHandlerEnabled
= property(GetEvtHandlerEnabled
,SetEvtHandlerEnabled
,doc
="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3445 NextHandler
= property(GetNextHandler
,SetNextHandler
,doc
="See `GetNextHandler` and `SetNextHandler`")
3446 PreviousHandler
= property(GetPreviousHandler
,SetPreviousHandler
,doc
="See `GetPreviousHandler` and `SetPreviousHandler`")
3447 _core_
.EvtHandler_swigregister(EvtHandler
)
3449 #---------------------------------------------------------------------------
3451 class PyEventBinder(object):
3453 Instances of this class are used to bind specific events to event
3456 def __init__(self
, evtType
, expectedIDs
=0):
3457 if expectedIDs
not in [0, 1, 2]:
3458 raise ValueError, "Invalid number of expectedIDs"
3459 self
.expectedIDs
= expectedIDs
3461 if type(evtType
) == list or type(evtType
) == tuple:
3462 self
.evtType
= evtType
3464 self
.evtType
= [evtType
]
3467 def Bind(self
, target
, id1
, id2
, function
):
3468 """Bind this set of event types to target."""
3469 for et
in self
.evtType
:
3470 target
.Connect(id1
, id2
, et
, function
)
3473 def Unbind(self
, target
, id1
, id2
):
3474 """Remove an event binding."""
3476 for et
in self
.evtType
:
3477 success
+= target
.Disconnect(id1
, id2
, et
)
3481 def __call__(self
, *args
):
3483 For backwards compatibility with the old EVT_* functions.
3484 Should be called with either (window, func), (window, ID,
3485 func) or (window, ID1, ID2, func) parameters depending on the
3488 assert len(args
) == 2 + self
.expectedIDs
3492 if self
.expectedIDs
== 0:
3494 elif self
.expectedIDs
== 1:
3497 elif self
.expectedIDs
== 2:
3502 raise ValueError, "Unexpected number of IDs"
3504 self
.Bind(target
, id1
, id2
, func
)
3507 # These two are square pegs that don't fit the PyEventBinder hole...
3508 def EVT_COMMAND(win
, id, cmd
, func
):
3509 win
.Connect(id, -1, cmd
, func
)
3510 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3511 win
.Connect(id1
, id2
, cmd
, func
)
3514 #---------------------------------------------------------------------------
3516 #---------------------------------------------------------------------------
3518 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3519 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3521 def NewEventType(*args
):
3522 """NewEventType() -> EventType"""
3523 return _core_
.NewEventType(*args
)
3524 wxEVT_NULL
= _core_
.wxEVT_NULL
3525 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3526 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3527 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3528 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3529 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3530 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3531 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3532 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3533 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3534 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3535 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3536 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3537 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3538 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3539 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3540 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3541 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3542 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3543 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3544 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3545 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3546 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3547 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3548 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3549 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3550 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3551 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3552 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3553 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3554 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3555 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3556 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3557 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3558 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3559 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3560 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3561 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3562 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3563 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3564 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3565 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3566 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3567 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3568 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3569 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3570 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3571 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3572 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3573 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3574 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3575 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3576 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3577 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3578 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3579 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3580 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3581 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3582 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3583 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3584 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3585 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3586 wxEVT_SCROLL_CHANGED
= _core_
.wxEVT_SCROLL_CHANGED
3587 wxEVT_SCROLL_ENDSCROLL
= wxEVT_SCROLL_CHANGED
3588 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3589 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3590 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3591 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3592 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3593 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3594 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3595 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3596 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3597 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3598 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3599 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3600 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3601 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3602 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3603 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3604 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3605 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3606 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3607 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3608 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3609 wxEVT_MOUSE_CAPTURE_LOST
= _core_
.wxEVT_MOUSE_CAPTURE_LOST
3610 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3611 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3612 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3613 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3614 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3615 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3616 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3617 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3618 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3619 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3620 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3621 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3622 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3623 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
3624 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
3625 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
3626 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
3627 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
3628 wxEVT_IDLE
= _core_
.wxEVT_IDLE
3629 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
3630 wxEVT_SIZING
= _core_
.wxEVT_SIZING
3631 wxEVT_MOVING
= _core_
.wxEVT_MOVING
3632 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
3633 wxEVT_COMMAND_TEXT_COPY
= _core_
.wxEVT_COMMAND_TEXT_COPY
3634 wxEVT_COMMAND_TEXT_CUT
= _core_
.wxEVT_COMMAND_TEXT_CUT
3635 wxEVT_COMMAND_TEXT_PASTE
= _core_
.wxEVT_COMMAND_TEXT_PASTE
3636 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
3637 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
3638 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
3639 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
3640 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
3641 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
3642 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
3644 # Create some event binders
3645 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
3646 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
3647 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
3648 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
3649 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
3650 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3651 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3652 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
3653 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
3654 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
3655 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
3656 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
3657 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
3658 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
3659 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
3660 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
3661 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
3662 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
3663 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
3664 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
3665 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
3666 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
3667 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
3668 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
3669 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
3670 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3671 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3672 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
3673 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
3674 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
3675 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
3676 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
3677 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
3678 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
3679 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
3680 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
3681 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
3682 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
3683 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
3684 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
3685 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
3686 EVT_MOUSE_CAPTURE_LOST
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST
)
3688 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
3689 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
3690 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
3691 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
3692 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
3693 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
3694 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
3695 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
3696 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
3697 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
3698 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
3699 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
3700 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
3702 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
3710 wxEVT_MIDDLE_DCLICK
,
3718 # Scrolling from wxWindow (sent to wxScrolledWindow)
3719 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
3720 wxEVT_SCROLLWIN_BOTTOM
,
3721 wxEVT_SCROLLWIN_LINEUP
,
3722 wxEVT_SCROLLWIN_LINEDOWN
,
3723 wxEVT_SCROLLWIN_PAGEUP
,
3724 wxEVT_SCROLLWIN_PAGEDOWN
,
3725 wxEVT_SCROLLWIN_THUMBTRACK
,
3726 wxEVT_SCROLLWIN_THUMBRELEASE
,
3729 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
3730 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
3731 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
3732 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
3733 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
3734 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
3735 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
3736 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
3738 # Scrolling from wx.Slider and wx.ScrollBar
3739 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3740 wxEVT_SCROLL_BOTTOM
,
3741 wxEVT_SCROLL_LINEUP
,
3742 wxEVT_SCROLL_LINEDOWN
,
3743 wxEVT_SCROLL_PAGEUP
,
3744 wxEVT_SCROLL_PAGEDOWN
,
3745 wxEVT_SCROLL_THUMBTRACK
,
3746 wxEVT_SCROLL_THUMBRELEASE
,
3747 wxEVT_SCROLL_CHANGED
,
3750 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
3751 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
3752 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
3753 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
3754 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
3755 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
3756 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
3757 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
3758 EVT_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
)
3759 EVT_SCROLL_ENDSCROLL
= EVT_SCROLL_CHANGED
3761 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3762 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3763 wxEVT_SCROLL_BOTTOM
,
3764 wxEVT_SCROLL_LINEUP
,
3765 wxEVT_SCROLL_LINEDOWN
,
3766 wxEVT_SCROLL_PAGEUP
,
3767 wxEVT_SCROLL_PAGEDOWN
,
3768 wxEVT_SCROLL_THUMBTRACK
,
3769 wxEVT_SCROLL_THUMBRELEASE
,
3770 wxEVT_SCROLL_CHANGED
,
3773 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
3774 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
3775 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
3776 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
3777 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
3778 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
3779 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
3780 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
3781 EVT_COMMAND_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
, 1)
3782 EVT_COMMAND_SCROLL_ENDSCROLL
= EVT_COMMAND_SCROLL_CHANGED
3784 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
3785 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
3786 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
3787 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
3788 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
3789 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
3790 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
3791 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
3792 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
3793 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
3795 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
3796 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
3797 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
3798 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
3799 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
3800 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
3801 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
3802 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
3803 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
3806 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
3807 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
3808 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
3809 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
3810 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
3811 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
3812 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
3814 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
3816 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
3817 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
3819 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
3821 EVT_TEXT_CUT
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_CUT
)
3822 EVT_TEXT_COPY
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_COPY
)
3823 EVT_TEXT_PASTE
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE
)
3826 #---------------------------------------------------------------------------
3828 class Event(Object
):
3830 An event is a structure holding information about an event passed to a
3831 callback or member function. wx.Event is an abstract base class for
3834 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3835 def __init__(self
): raise AttributeError, "No constructor defined"
3836 __repr__
= _swig_repr
3837 __swig_destroy__
= _core_
.delete_Event
3838 __del__
= lambda self
: None;
3839 def SetEventType(*args
, **kwargs
):
3841 SetEventType(self, EventType typ)
3843 Sets the specific type of the event.
3845 return _core_
.Event_SetEventType(*args
, **kwargs
)
3847 def GetEventType(*args
, **kwargs
):
3849 GetEventType(self) -> EventType
3851 Returns the identifier of the given event type, such as
3852 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3854 return _core_
.Event_GetEventType(*args
, **kwargs
)
3856 def GetEventObject(*args
, **kwargs
):
3858 GetEventObject(self) -> Object
3860 Returns the object (usually a window) associated with the event, if
3863 return _core_
.Event_GetEventObject(*args
, **kwargs
)
3865 def SetEventObject(*args
, **kwargs
):
3867 SetEventObject(self, Object obj)
3869 Sets the originating object, or in other words, obj is normally the
3870 object that is sending the event.
3872 return _core_
.Event_SetEventObject(*args
, **kwargs
)
3874 def GetTimestamp(*args
, **kwargs
):
3875 """GetTimestamp(self) -> long"""
3876 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
3878 def SetTimestamp(*args
, **kwargs
):
3879 """SetTimestamp(self, long ts=0)"""
3880 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
3882 def GetId(*args
, **kwargs
):
3886 Returns the identifier associated with this event, such as a button
3889 return _core_
.Event_GetId(*args
, **kwargs
)
3891 def SetId(*args
, **kwargs
):
3895 Set's the ID for the event. This is usually the ID of the window that
3896 is sending the event, but it can also be a command id from a menu
3899 return _core_
.Event_SetId(*args
, **kwargs
)
3901 def IsCommandEvent(*args
, **kwargs
):
3903 IsCommandEvent(self) -> bool
3905 Returns true if the event is or is derived from `wx.CommandEvent` else
3906 it returns false. Note: Exists only for optimization purposes.
3908 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
3910 def Skip(*args
, **kwargs
):
3912 Skip(self, bool skip=True)
3914 Called by an event handler, it controls whether additional event
3915 handlers bound to this event will be called after the current event
3916 handler returns. Skip(false) (the default setting) will prevent
3917 additional event handlers from being called and control will be
3918 returned to the sender of the event immediately after the current
3919 handler has finished. Skip(True) will cause the event processing
3920 system to continue searching for a handler function for this event.
3923 return _core_
.Event_Skip(*args
, **kwargs
)
3925 def GetSkipped(*args
, **kwargs
):
3927 GetSkipped(self) -> bool
3929 Returns true if the event handler should be skipped, false otherwise.
3932 return _core_
.Event_GetSkipped(*args
, **kwargs
)
3934 def ShouldPropagate(*args
, **kwargs
):
3936 ShouldPropagate(self) -> bool
3938 Test if this event should be propagated to the parent window or not,
3939 i.e. if the propagation level is currently greater than 0.
3941 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
3943 def StopPropagation(*args
, **kwargs
):
3945 StopPropagation(self) -> int
3947 Stop the event from propagating to its parent window. Returns the old
3948 propagation level value which may be later passed to
3949 `ResumePropagation` to allow propagating the event again.
3951 return _core_
.Event_StopPropagation(*args
, **kwargs
)
3953 def ResumePropagation(*args
, **kwargs
):
3955 ResumePropagation(self, int propagationLevel)
3957 Resume the event propagation by restoring the propagation level. (For
3958 example, you can use the value returned by an earlier call to
3962 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
3964 def Clone(*args
, **kwargs
):
3965 """Clone(self) -> Event"""
3966 return _core_
.Event_Clone(*args
, **kwargs
)
3968 EventObject
= property(GetEventObject
,SetEventObject
,doc
="See `GetEventObject` and `SetEventObject`")
3969 EventType
= property(GetEventType
,SetEventType
,doc
="See `GetEventType` and `SetEventType`")
3970 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
3971 Skipped
= property(GetSkipped
,doc
="See `GetSkipped`")
3972 Timestamp
= property(GetTimestamp
,SetTimestamp
,doc
="See `GetTimestamp` and `SetTimestamp`")
3973 _core_
.Event_swigregister(Event
)
3975 #---------------------------------------------------------------------------
3977 class PropagationDisabler(object):
3979 Helper class to temporarily change an event not to propagate. Simply
3980 create an instance of this class and then whe it is destroyed the
3981 propogation of the event will be restored.
3983 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3984 __repr__
= _swig_repr
3985 def __init__(self
, *args
, **kwargs
):
3987 __init__(self, Event event) -> PropagationDisabler
3989 Helper class to temporarily change an event not to propagate. Simply
3990 create an instance of this class and then whe it is destroyed the
3991 propogation of the event will be restored.
3993 _core_
.PropagationDisabler_swiginit(self
,_core_
.new_PropagationDisabler(*args
, **kwargs
))
3994 __swig_destroy__
= _core_
.delete_PropagationDisabler
3995 __del__
= lambda self
: None;
3996 _core_
.PropagationDisabler_swigregister(PropagationDisabler
)
3998 class PropagateOnce(object):
4000 A helper class that will temporarily lower propagation level of an
4001 event. Simply create an instance of this class and then whe it is
4002 destroyed the propogation of the event will be restored.
4004 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4005 __repr__
= _swig_repr
4006 def __init__(self
, *args
, **kwargs
):
4008 __init__(self, Event event) -> PropagateOnce
4010 A helper class that will temporarily lower propagation level of an
4011 event. Simply create an instance of this class and then whe it is
4012 destroyed the propogation of the event will be restored.
4014 _core_
.PropagateOnce_swiginit(self
,_core_
.new_PropagateOnce(*args
, **kwargs
))
4015 __swig_destroy__
= _core_
.delete_PropagateOnce
4016 __del__
= lambda self
: None;
4017 _core_
.PropagateOnce_swigregister(PropagateOnce
)
4019 #---------------------------------------------------------------------------
4021 class CommandEvent(Event
):
4023 This event class contains information about command events, which
4024 originate from a variety of simple controls, as well as menus and
4027 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4028 __repr__
= _swig_repr
4029 def __init__(self
, *args
, **kwargs
):
4031 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4033 This event class contains information about command events, which
4034 originate from a variety of simple controls, as well as menus and
4037 _core_
.CommandEvent_swiginit(self
,_core_
.new_CommandEvent(*args
, **kwargs
))
4038 def GetSelection(*args
, **kwargs
):
4040 GetSelection(self) -> int
4042 Returns item index for a listbox or choice selection event (not valid
4045 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
4047 def SetString(*args
, **kwargs
):
4048 """SetString(self, String s)"""
4049 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
4051 def GetString(*args
, **kwargs
):
4053 GetString(self) -> String
4055 Returns item string for a listbox or choice selection event (not valid
4058 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
4060 def IsChecked(*args
, **kwargs
):
4062 IsChecked(self) -> bool
4064 This method can be used with checkbox and menu events: for the
4065 checkboxes, the method returns true for a selection event and false
4066 for a deselection one. For the menu events, this method indicates if
4067 the menu item just has become checked or unchecked (and thus only
4068 makes sense for checkable menu items).
4070 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
4073 def IsSelection(*args
, **kwargs
):
4075 IsSelection(self) -> bool
4077 For a listbox or similar event, returns true if it is a selection,
4078 false if it is a deselection.
4080 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4082 def SetExtraLong(*args
, **kwargs
):
4083 """SetExtraLong(self, long extraLong)"""
4084 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4086 def GetExtraLong(*args
, **kwargs
):
4088 GetExtraLong(self) -> long
4090 Returns extra information dependant on the event objects type. If the
4091 event comes from a listbox selection, it is a boolean determining
4092 whether the event was a selection (true) or a deselection (false). A
4093 listbox deselection only occurs for multiple-selection boxes, and in
4094 this case the index and string values are indeterminate and the
4095 listbox must be examined by the application.
4097 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4099 def SetInt(*args
, **kwargs
):
4100 """SetInt(self, int i)"""
4101 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4103 def GetInt(*args
, **kwargs
):
4107 Returns the integer identifier corresponding to a listbox, choice or
4108 radiobox selection (only if the event was a selection, not a
4109 deselection), or a boolean value representing the value of a checkbox.
4111 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4113 def GetClientData(*args
, **kwargs
):
4115 GetClientData(self) -> PyObject
4117 Returns the client data object for a listbox or choice selection event, (if any.)
4119 return _core_
.CommandEvent_GetClientData(*args
, **kwargs
)
4121 def SetClientData(*args
, **kwargs
):
4123 SetClientData(self, PyObject clientData)
4125 Associate the given client data with the item at position n.
4127 return _core_
.CommandEvent_SetClientData(*args
, **kwargs
)
4129 GetClientObject
= GetClientData
4130 SetClientObject
= SetClientData
4132 def Clone(*args
, **kwargs
):
4133 """Clone(self) -> Event"""
4134 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4136 ClientData
= property(GetClientData
,SetClientData
,doc
="See `GetClientData` and `SetClientData`")
4137 ClientObject
= property(GetClientObject
,SetClientObject
,doc
="See `GetClientObject` and `SetClientObject`")
4138 ExtraLong
= property(GetExtraLong
,SetExtraLong
,doc
="See `GetExtraLong` and `SetExtraLong`")
4139 Int
= property(GetInt
,SetInt
,doc
="See `GetInt` and `SetInt`")
4140 Selection
= property(GetSelection
,doc
="See `GetSelection`")
4141 String
= property(GetString
,SetString
,doc
="See `GetString` and `SetString`")
4142 _core_
.CommandEvent_swigregister(CommandEvent
)
4144 #---------------------------------------------------------------------------
4146 class NotifyEvent(CommandEvent
):
4148 An instance of this class (or one of its derived classes) is sent from
4149 a control when the control's state is being changed and the control
4150 allows that change to be prevented from happening. The event handler
4151 can call `Veto` or `Allow` to tell the control what to do.
4153 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4154 __repr__
= _swig_repr
4155 def __init__(self
, *args
, **kwargs
):
4157 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4159 An instance of this class (or one of its derived classes) is sent from
4160 a control when the control's state is being changed and the control
4161 allows that change to be prevented from happening. The event handler
4162 can call `Veto` or `Allow` to tell the control what to do.
4164 _core_
.NotifyEvent_swiginit(self
,_core_
.new_NotifyEvent(*args
, **kwargs
))
4165 def Veto(*args
, **kwargs
):
4169 Prevents the change announced by this event from happening.
4171 It is in general a good idea to notify the user about the reasons for
4172 vetoing the change because otherwise the applications behaviour (which
4173 just refuses to do what the user wants) might be quite surprising.
4175 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4177 def Allow(*args
, **kwargs
):
4181 This is the opposite of `Veto`: it explicitly allows the event to be
4182 processed. For most events it is not necessary to call this method as
4183 the events are allowed anyhow but some are forbidden by default (this
4184 will be mentioned in the corresponding event description).
4186 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4188 def IsAllowed(*args
, **kwargs
):
4190 IsAllowed(self) -> bool
4192 Returns true if the change is allowed (`Veto` hasn't been called) or
4193 false otherwise (if it was).
4195 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4197 _core_
.NotifyEvent_swigregister(NotifyEvent
)
4199 #---------------------------------------------------------------------------
4201 class ScrollEvent(CommandEvent
):
4203 A scroll event holds information about events sent from stand-alone
4204 scrollbars and sliders. Note that scrolled windows do not send
4205 instnaces of this event class, but send the `wx.ScrollWinEvent`
4208 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4209 __repr__
= _swig_repr
4210 def __init__(self
, *args
, **kwargs
):
4212 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4213 int orient=0) -> ScrollEvent
4215 _core_
.ScrollEvent_swiginit(self
,_core_
.new_ScrollEvent(*args
, **kwargs
))
4216 def GetOrientation(*args
, **kwargs
):
4218 GetOrientation(self) -> int
4220 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4223 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4225 def GetPosition(*args
, **kwargs
):
4227 GetPosition(self) -> int
4229 Returns the position of the scrollbar.
4231 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4233 def SetOrientation(*args
, **kwargs
):
4234 """SetOrientation(self, int orient)"""
4235 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4237 def SetPosition(*args
, **kwargs
):
4238 """SetPosition(self, int pos)"""
4239 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4241 _core_
.ScrollEvent_swigregister(ScrollEvent
)
4243 #---------------------------------------------------------------------------
4245 class ScrollWinEvent(Event
):
4247 A wx.ScrollWinEvent holds information about scrolling and is sent from
4250 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4251 __repr__
= _swig_repr
4252 def __init__(self
, *args
, **kwargs
):
4254 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4256 A wx.ScrollWinEvent holds information about scrolling and is sent from
4259 _core_
.ScrollWinEvent_swiginit(self
,_core_
.new_ScrollWinEvent(*args
, **kwargs
))
4260 def GetOrientation(*args
, **kwargs
):
4262 GetOrientation(self) -> int
4264 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4267 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4269 def GetPosition(*args
, **kwargs
):
4271 GetPosition(self) -> int
4273 Returns the position of the scrollbar for the thumb track and release
4274 events. Note that this field can't be used for the other events, you
4275 need to query the window itself for the current position in that case.
4277 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4279 def SetOrientation(*args
, **kwargs
):
4280 """SetOrientation(self, int orient)"""
4281 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4283 def SetPosition(*args
, **kwargs
):
4284 """SetPosition(self, int pos)"""
4285 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4287 _core_
.ScrollWinEvent_swigregister(ScrollWinEvent
)
4289 #---------------------------------------------------------------------------
4291 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4292 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4293 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4294 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4295 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4296 class MouseEvent(Event
):
4298 This event class contains information about the events generated by
4299 the mouse: they include mouse buttons press and release events and
4302 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4303 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4304 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4305 a middle button so a portable application should avoid relying on the
4308 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4309 the former returns true when the event corresponds to the left mouse
4310 button click while the latter returns true if the left mouse button is
4311 currently being pressed. For example, when the user is dragging the
4312 mouse you can use `LeftIsDown` to test whether the left mouse button
4313 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4314 `LeftIsDown` will also return true in wxWidgets whatever the
4315 underlying GUI behaviour is (which is platform-dependent). The same
4316 applies, of course, to other mouse buttons as well.
4318 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4319 __repr__
= _swig_repr
4320 def __init__(self
, *args
, **kwargs
):
4322 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4324 Constructs a wx.MouseEvent. Valid event types are:
4326 * wxEVT_ENTER_WINDOW
4327 * wxEVT_LEAVE_WINDOW
4333 * wxEVT_MIDDLE_DCLICK
4336 * wxEVT_RIGHT_DCLICK
4340 _core_
.MouseEvent_swiginit(self
,_core_
.new_MouseEvent(*args
, **kwargs
))
4341 def IsButton(*args
, **kwargs
):
4343 IsButton(self) -> bool
4345 Returns true if the event was a mouse button event (not necessarily a
4346 button down event - that may be tested using `ButtonDown`).
4348 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4350 def ButtonDown(*args
, **kwargs
):
4352 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4354 If the argument is omitted, this returns true if the event was any
4355 mouse button down event. Otherwise the argument specifies which
4356 button-down event shold be checked for (see `Button` for the possible
4359 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4361 def ButtonDClick(*args
, **kwargs
):
4363 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4365 If the argument is omitted, this returns true if the event was any
4366 mouse double click event. Otherwise the argument specifies which
4367 double click event to check for (see `Button` for the possible
4370 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4372 def ButtonUp(*args
, **kwargs
):
4374 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4376 If the argument is omitted, this returns true if the event was any
4377 mouse button up event. Otherwise the argument specifies which button
4378 up event to check for (see `Button` for the possible values).
4380 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4382 def Button(*args
, **kwargs
):
4384 Button(self, int button) -> bool
4386 Returns true if the identified mouse button is changing state. Valid
4387 values of button are:
4389 ==================== =====================================
4390 wx.MOUSE_BTN_LEFT check if left button was pressed
4391 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4392 wx.MOUSE_BTN_RIGHT check if right button was pressed
4393 wx.MOUSE_BTN_ANY check if any button was pressed
4394 ==================== =====================================
4397 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4399 def ButtonIsDown(*args
, **kwargs
):
4400 """ButtonIsDown(self, int but) -> bool"""
4401 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4403 def GetButton(*args
, **kwargs
):
4405 GetButton(self) -> int
4407 Returns the mouse button which generated this event or
4408 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4409 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4410 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4411 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4412 right buttons respectively.
4414 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4416 def ControlDown(*args
, **kwargs
):
4418 ControlDown(self) -> bool
4420 Returns true if the control key was down at the time of the event.
4422 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4424 def MetaDown(*args
, **kwargs
):
4426 MetaDown(self) -> bool
4428 Returns true if the Meta key was down at the time of the event.
4430 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4432 def AltDown(*args
, **kwargs
):
4434 AltDown(self) -> bool
4436 Returns true if the Alt key was down at the time of the event.
4438 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4440 def ShiftDown(*args
, **kwargs
):
4442 ShiftDown(self) -> bool
4444 Returns true if the Shift key was down at the time of the event.
4446 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4448 def CmdDown(*args
, **kwargs
):
4450 CmdDown(self) -> bool
4452 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4453 platforms but the special "Apple" (a.k.a as "Command") key on
4454 Macs. It often makes sense to use it instead of, say, `ControlDown`
4455 because Cmd key is used for the same thing under Mac as Ctrl
4456 elsewhere. The Ctrl key still exists, it's just not used for this
4457 purpose. So for non-Mac platforms this is the same as `ControlDown`
4458 and Macs this is the same as `MetaDown`.
4460 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4462 def LeftDown(*args
, **kwargs
):
4464 LeftDown(self) -> bool
4466 Returns true if the left mouse button state changed to down.
4468 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4470 def MiddleDown(*args
, **kwargs
):
4472 MiddleDown(self) -> bool
4474 Returns true if the middle mouse button state changed to down.
4476 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4478 def RightDown(*args
, **kwargs
):
4480 RightDown(self) -> bool
4482 Returns true if the right mouse button state changed to down.
4484 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4486 def LeftUp(*args
, **kwargs
):
4488 LeftUp(self) -> bool
4490 Returns true if the left mouse button state changed to up.
4492 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4494 def MiddleUp(*args
, **kwargs
):
4496 MiddleUp(self) -> bool
4498 Returns true if the middle mouse button state changed to up.
4500 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4502 def RightUp(*args
, **kwargs
):
4504 RightUp(self) -> bool
4506 Returns true if the right mouse button state changed to up.
4508 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4510 def LeftDClick(*args
, **kwargs
):
4512 LeftDClick(self) -> bool
4514 Returns true if the event was a left button double click.
4516 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4518 def MiddleDClick(*args
, **kwargs
):
4520 MiddleDClick(self) -> bool
4522 Returns true if the event was a middle button double click.
4524 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4526 def RightDClick(*args
, **kwargs
):
4528 RightDClick(self) -> bool
4530 Returns true if the event was a right button double click.
4532 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4534 def LeftIsDown(*args
, **kwargs
):
4536 LeftIsDown(self) -> bool
4538 Returns true if the left mouse button is currently down, independent
4539 of the current event type.
4541 Please notice that it is not the same as LeftDown which returns true
4542 if the left mouse button was just pressed. Rather, it describes the
4543 state of the mouse button before the event happened.
4545 This event is usually used in the mouse event handlers which process
4546 "move mouse" messages to determine whether the user is (still)
4549 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4551 def MiddleIsDown(*args
, **kwargs
):
4553 MiddleIsDown(self) -> bool
4555 Returns true if the middle mouse button is currently down, independent
4556 of the current event type.
4558 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4560 def RightIsDown(*args
, **kwargs
):
4562 RightIsDown(self) -> bool
4564 Returns true if the right mouse button is currently down, independent
4565 of the current event type.
4567 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4569 def Dragging(*args
, **kwargs
):
4571 Dragging(self) -> bool
4573 Returns true if this was a dragging event (motion while a button is
4576 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4578 def Moving(*args
, **kwargs
):
4580 Moving(self) -> bool
4582 Returns true if this was a motion event and no mouse buttons were
4583 pressed. If any mouse button is held pressed, then this method returns
4584 false and Dragging returns true.
4586 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4588 def Entering(*args
, **kwargs
):
4590 Entering(self) -> bool
4592 Returns true if the mouse was entering the window.
4594 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4596 def Leaving(*args
, **kwargs
):
4598 Leaving(self) -> bool
4600 Returns true if the mouse was leaving the window.
4602 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4604 def GetPosition(*args
, **kwargs
):
4606 GetPosition(self) -> Point
4608 Returns the pixel position of the mouse in window coordinates when the
4611 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4613 def GetPositionTuple(*args
, **kwargs
):
4615 GetPositionTuple() -> (x,y)
4617 Returns the pixel position of the mouse in window coordinates when the
4620 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
4622 def GetLogicalPosition(*args
, **kwargs
):
4624 GetLogicalPosition(self, DC dc) -> Point
4626 Returns the logical mouse position in pixels (i.e. translated
4627 according to the translation set for the DC, which usually indicates
4628 that the window has been scrolled).
4630 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
4632 def GetX(*args
, **kwargs
):
4636 Returns X coordinate of the physical mouse event position.
4638 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
4640 def GetY(*args
, **kwargs
):
4644 Returns Y coordinate of the physical mouse event position.
4646 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
4648 def GetWheelRotation(*args
, **kwargs
):
4650 GetWheelRotation(self) -> int
4652 Get wheel rotation, positive or negative indicates direction of
4653 rotation. Current devices all send an event when rotation is equal to
4654 +/-WheelDelta, but this allows for finer resolution devices to be
4655 created in the future. Because of this you shouldn't assume that one
4656 event is equal to 1 line or whatever, but you should be able to either
4657 do partial line scrolling or wait until +/-WheelDelta rotation values
4658 have been accumulated before scrolling.
4660 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
4662 def GetWheelDelta(*args
, **kwargs
):
4664 GetWheelDelta(self) -> int
4666 Get wheel delta, normally 120. This is the threshold for action to be
4667 taken, and one such action (for example, scrolling one increment)
4668 should occur for each delta.
4670 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
4672 def GetLinesPerAction(*args
, **kwargs
):
4674 GetLinesPerAction(self) -> int
4676 Returns the configured number of lines (or whatever) to be scrolled
4677 per wheel action. Defaults to three.
4679 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
4681 def IsPageScroll(*args
, **kwargs
):
4683 IsPageScroll(self) -> bool
4685 Returns true if the system has been setup to do page scrolling with
4686 the mouse wheel instead of line scrolling.
4688 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
4690 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
4691 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
4692 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
4693 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
4694 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
4695 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
4696 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
4697 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
4698 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
4699 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
4700 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
4701 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
4702 _core_
.MouseEvent_swigregister(MouseEvent
)
4704 #---------------------------------------------------------------------------
4706 class SetCursorEvent(Event
):
4708 A SetCursorEvent is generated when the mouse cursor is about to be set
4709 as a result of mouse motion. This event gives the application the
4710 chance to perform specific mouse cursor processing based on the
4711 current position of the mouse within the window. Use the `SetCursor`
4712 method to specify the cursor you want to be displayed.
4714 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4715 __repr__
= _swig_repr
4716 def __init__(self
, *args
, **kwargs
):
4718 __init__(self, int x=0, int y=0) -> SetCursorEvent
4720 Construct a new `wx.SetCursorEvent`.
4722 _core_
.SetCursorEvent_swiginit(self
,_core_
.new_SetCursorEvent(*args
, **kwargs
))
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
)
4763 _core_
.SetCursorEvent_swigregister(SetCursorEvent
)
4765 #---------------------------------------------------------------------------
4767 class KeyEvent(Event
):
4769 This event class contains information about keypress and character
4770 events. These events are only sent to the widget that currently has
4773 Notice that there are three different kinds of keyboard events in
4774 wxWidgets: key down and up events and char events. The difference
4775 between the first two is clear - the first corresponds to a key press
4776 and the second to a key release - otherwise they are identical. Just
4777 note that if the key is maintained in a pressed state you will
4778 typically get a lot of (automatically generated) down events but only
4779 one up so it is wrong to assume that there is one up event
4780 corresponding to each down one.
4782 Both key events provide untranslated key codes while the char event
4783 carries the translated one. The untranslated code for alphanumeric
4784 keys is always an upper case value. For the other keys it is one of
4785 WXK_XXX values from the keycodes table. The translated key is, in
4786 general, the character the user expects to appear as the result of the
4787 key combination when typing the text into a text entry zone, for
4790 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4791 and the standard US keyboard): when the 'A' key is pressed, the key
4792 down event key code is equal to ASCII A == 65. But the char event key
4793 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4794 'A' keys simultaneously , the key code in key down event will still be
4795 just 'A' while the char event key code parameter will now be 'A' as
4798 Although in this simple case it is clear that the correct key code
4799 could be found in the key down event handler by checking the value
4800 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4801 as for non alphanumeric keys or non-US keyboard layouts the
4802 translation is keyboard-layout dependent and can only be done properly
4803 by the system itself.
4805 Another kind of translation is done when the control key is pressed:
4806 for example, for CTRL-A key press the key down event still carries the
4807 same key code 'A' as usual but the char event will have key code of 1,
4808 the ASCII value of this key combination.
4810 You may discover how the other keys on your system behave
4811 interactively by running the KeyEvents sample in the wxPython demo and
4812 pressing some keys while the blue box at the top has the keyboard
4815 **Note**: If a key down event is caught and the event handler does not
4816 call event.Skip() then the coresponding char event will not
4817 happen. This is by design and enables the programs that handle both
4818 types of events to be a bit simpler.
4820 **Note for Windows programmers**: The key and char events in wxWidgets
4821 are similar to but slightly different from Windows WM_KEYDOWN and
4822 WM_CHAR events. In particular, Alt-x combination will generate a char
4823 event in wxWidgets (unless it is used as an accelerator).
4825 **Tip**: be sure to call event.Skip() for events that you don't
4826 process in key event function, otherwise menu shortcuts may cease to
4830 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4831 __repr__
= _swig_repr
4832 def __init__(self
, *args
, **kwargs
):
4834 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4836 Construct a new `wx.KeyEvent`. Valid event types are:
4839 _core_
.KeyEvent_swiginit(self
,_core_
.new_KeyEvent(*args
, **kwargs
))
4840 def GetModifiers(*args
, **kwargs
):
4842 GetModifiers(self) -> int
4844 Returns a bitmask of the current modifier settings. Can be used to
4845 check if the key event has exactly the given modifiers without having
4846 to explicitly check that the other modifiers are not down. For
4849 if event.GetModifers() == wx.MOD_CONTROL:
4853 return _core_
.KeyEvent_GetModifiers(*args
, **kwargs
)
4855 def ControlDown(*args
, **kwargs
):
4857 ControlDown(self) -> bool
4859 Returns ``True`` if the Control key was down at the time of the event.
4861 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
4863 def MetaDown(*args
, **kwargs
):
4865 MetaDown(self) -> bool
4867 Returns ``True`` if the Meta key was down at the time of the event.
4869 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
4871 def AltDown(*args
, **kwargs
):
4873 AltDown(self) -> bool
4875 Returns ``True`` if the Alt key was down at the time of the event.
4877 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
4879 def ShiftDown(*args
, **kwargs
):
4881 ShiftDown(self) -> bool
4883 Returns ``True`` if the Shift key was down at the time of the event.
4885 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
4887 def CmdDown(*args
, **kwargs
):
4889 CmdDown(self) -> bool
4891 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4892 platforms but the special "Apple" (a.k.a as "Command") key on
4893 Macs. It makes often sense to use it instead of, say, `ControlDown`
4894 because Cmd key is used for the same thing under Mac as Ctrl
4895 elsewhere. The Ctrl still exists, it's just not used for this
4896 purpose. So for non-Mac platforms this is the same as `ControlDown`
4897 and Macs this is the same as `MetaDown`.
4899 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
4901 def HasModifiers(*args
, **kwargs
):
4903 HasModifiers(self) -> bool
4905 Returns true if either CTRL or ALT keys was down at the time of the
4906 key event. Note that this function does not take into account neither
4907 SHIFT nor META key states (the reason for ignoring the latter is that
4908 it is common for NUMLOCK key to be configured as META under X but the
4909 key presses even while NUMLOCK is on should be still processed
4912 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
4914 def GetKeyCode(*args
, **kwargs
):
4916 GetKeyCode(self) -> int
4918 Returns the virtual key code. ASCII events return normal ASCII values,
4919 while non-ASCII events return values such as WXK_LEFT for the left
4920 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4923 Note that in Unicode build, the returned value is meaningful only if
4924 the user entered a character that can be represented in current
4925 locale's default charset. You can obtain the corresponding Unicode
4926 character using `GetUnicodeKey`.
4928 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
4930 def GetUnicodeKey(*args
, **kwargs
):
4932 GetUnicodeKey(self) -> int
4934 Returns the Unicode character corresponding to this key event. This
4935 function is only meaningfule in a Unicode build of wxPython.
4937 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
4939 GetUniChar
= GetUnicodeKey
4940 def SetUnicodeKey(*args
, **kwargs
):
4942 SetUnicodeKey(self, int uniChar)
4944 Set the Unicode value of the key event, but only if this is a Unicode
4947 return _core_
.KeyEvent_SetUnicodeKey(*args
, **kwargs
)
4949 def GetRawKeyCode(*args
, **kwargs
):
4951 GetRawKeyCode(self) -> unsigned int
4953 Returns the raw key code for this event. This is a platform-dependent
4954 scan code which should only be used in advanced
4955 applications. Currently the raw key codes are not supported by all
4958 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
4960 def GetRawKeyFlags(*args
, **kwargs
):
4962 GetRawKeyFlags(self) -> unsigned int
4964 Returns the low level key flags for this event. The flags are
4965 platform-dependent and should only be used in advanced applications.
4966 Currently the raw key flags are not supported by all ports.
4968 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
4970 def GetPosition(*args
, **kwargs
):
4972 GetPosition(self) -> Point
4974 Find the position of the event, if applicable.
4976 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
4978 def GetPositionTuple(*args
, **kwargs
):
4980 GetPositionTuple() -> (x,y)
4982 Find the position of the event, if applicable.
4984 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
4986 def GetX(*args
, **kwargs
):
4990 Returns the X position (in client coordinates) of the event, if
4993 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
4995 def GetY(*args
, **kwargs
):
4999 Returns the Y position (in client coordinates) of the event, if
5002 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
5004 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
5005 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
5006 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
5007 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
5008 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
5009 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
5010 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
5011 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
5012 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
5013 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
5014 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
5015 Modifiers
= property(GetModifiers
,doc
="See `GetModifiers`")
5016 Position
= property(GetPosition
,doc
="See `GetPosition`")
5017 RawKeyCode
= property(GetRawKeyCode
,doc
="See `GetRawKeyCode`")
5018 RawKeyFlags
= property(GetRawKeyFlags
,doc
="See `GetRawKeyFlags`")
5019 UnicodeKey
= property(GetUnicodeKey
,SetUnicodeKey
,doc
="See `GetUnicodeKey` and `SetUnicodeKey`")
5020 X
= property(GetX
,doc
="See `GetX`")
5021 Y
= property(GetY
,doc
="See `GetY`")
5022 _core_
.KeyEvent_swigregister(KeyEvent
)
5024 #---------------------------------------------------------------------------
5026 class SizeEvent(Event
):
5028 A size event holds information about size change events. The EVT_SIZE
5029 handler function will be called when the window it is bound to has
5032 Note that the size passed is of the whole window: call
5033 `wx.Window.GetClientSize` for the area which may be used by the
5036 When a window is resized, usually only a small part of the window is
5037 damaged and and that area is all that is in the update region for the
5038 next paint event. However, if your drawing depends on the size of the
5039 window, you may need to clear the DC explicitly and repaint the whole
5040 window. In which case, you may need to call `wx.Window.Refresh` to
5041 invalidate the entire window.
5044 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5045 __repr__
= _swig_repr
5046 def __init__(self
, *args
, **kwargs
):
5048 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5050 Construct a new ``wx.SizeEvent``.
5052 _core_
.SizeEvent_swiginit(self
,_core_
.new_SizeEvent(*args
, **kwargs
))
5053 def GetSize(*args
, **kwargs
):
5055 GetSize(self) -> Size
5057 Returns the entire size of the window generating the size change
5060 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
5062 def GetRect(*args
, **kwargs
):
5063 """GetRect(self) -> Rect"""
5064 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
5066 def SetRect(*args
, **kwargs
):
5067 """SetRect(self, Rect rect)"""
5068 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
5070 def SetSize(*args
, **kwargs
):
5071 """SetSize(self, Size size)"""
5072 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
5074 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
5075 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
5076 _core_
.SizeEvent_swigregister(SizeEvent
)
5078 #---------------------------------------------------------------------------
5080 class MoveEvent(Event
):
5082 This event object is sent for EVT_MOVE event bindings when a window is
5083 moved to a new position.
5085 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5086 __repr__
= _swig_repr
5087 def __init__(self
, *args
, **kwargs
):
5089 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5093 _core_
.MoveEvent_swiginit(self
,_core_
.new_MoveEvent(*args
, **kwargs
))
5094 def GetPosition(*args
, **kwargs
):
5096 GetPosition(self) -> Point
5098 Returns the position of the window generating the move change event.
5100 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
5102 def GetRect(*args
, **kwargs
):
5103 """GetRect(self) -> Rect"""
5104 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
5106 def SetRect(*args
, **kwargs
):
5107 """SetRect(self, Rect rect)"""
5108 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
5110 def SetPosition(*args
, **kwargs
):
5111 """SetPosition(self, Point pos)"""
5112 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
5114 m_pos
= property(GetPosition
, SetPosition
)
5115 m_rect
= property(GetRect
, SetRect
)
5117 _core_
.MoveEvent_swigregister(MoveEvent
)
5119 #---------------------------------------------------------------------------
5121 class PaintEvent(Event
):
5123 A paint event is sent when a window's contents needs to be repainted.
5124 Note that in an EVT_PAINT handler the application must *always* create
5125 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5126 Windows assumes that the window has not been painted yet and will send
5127 the event again, causing endless refreshes.
5129 You can optimize painting by retrieving the rectangles that have been
5130 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5131 and only repainting these rectangles. The rectangles are in terms of
5132 the client area, and are unscrolled, so you will need to do some
5133 calculations using the current view position to obtain logical,
5137 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5138 __repr__
= _swig_repr
5139 def __init__(self
, *args
, **kwargs
):
5140 """__init__(self, int Id=0) -> PaintEvent"""
5141 _core_
.PaintEvent_swiginit(self
,_core_
.new_PaintEvent(*args
, **kwargs
))
5142 _core_
.PaintEvent_swigregister(PaintEvent
)
5144 class NcPaintEvent(Event
):
5145 """Proxy of C++ NcPaintEvent class"""
5146 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5147 __repr__
= _swig_repr
5148 def __init__(self
, *args
, **kwargs
):
5149 """__init__(self, int winid=0) -> NcPaintEvent"""
5150 _core_
.NcPaintEvent_swiginit(self
,_core_
.new_NcPaintEvent(*args
, **kwargs
))
5151 _core_
.NcPaintEvent_swigregister(NcPaintEvent
)
5153 #---------------------------------------------------------------------------
5155 class EraseEvent(Event
):
5157 An erase event is sent whenever the background of a window needs to be
5158 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5159 binder. On some platforms, such as GTK+, this event is simulated
5160 (simply generated just before the paint event) and may cause flicker.
5162 To paint a custom background use the `GetDC` method and use the returned
5163 device context if it is not ``None``, otherwise create a temporary
5164 `wx.ClientDC` and draw on that.
5167 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5168 __repr__
= _swig_repr
5169 def __init__(self
, *args
, **kwargs
):
5171 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5175 _core_
.EraseEvent_swiginit(self
,_core_
.new_EraseEvent(*args
, **kwargs
))
5176 def GetDC(*args
, **kwargs
):
5180 Returns the device context the event handler should draw upon. If
5181 ``None`` is returned then create a temporary `wx.ClientDC` and use
5184 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5186 DC
= property(GetDC
,doc
="See `GetDC`")
5187 _core_
.EraseEvent_swigregister(EraseEvent
)
5189 #---------------------------------------------------------------------------
5191 class FocusEvent(Event
):
5193 A focus event is sent when a window's focus changes. The window losing
5194 focus receives an EVT_KILL_FOCUS event while the window gaining it
5195 gets an EVT_SET_FOCUS event.
5197 Notice that the set focus event happens both when the user gives focus
5198 to the window (whether using the mouse or keyboard) and when it is
5199 done from the program itself using `wx.Window.SetFocus`.
5202 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5203 __repr__
= _swig_repr
5204 def __init__(self
, *args
, **kwargs
):
5206 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5210 _core_
.FocusEvent_swiginit(self
,_core_
.new_FocusEvent(*args
, **kwargs
))
5211 def GetWindow(*args
, **kwargs
):
5213 GetWindow(self) -> Window
5215 Returns the other window associated with this event, that is the
5216 window which had the focus before for the EVT_SET_FOCUS event and the
5217 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5219 Warning: the window returned may be None!
5221 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5223 def SetWindow(*args
, **kwargs
):
5224 """SetWindow(self, Window win)"""
5225 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5227 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
5228 _core_
.FocusEvent_swigregister(FocusEvent
)
5230 #---------------------------------------------------------------------------
5232 class ChildFocusEvent(CommandEvent
):
5234 wx.ChildFocusEvent notifies the parent that a child has received the
5235 focus. Unlike `wx.FocusEvent` it is propagated up the window
5238 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5239 __repr__
= _swig_repr
5240 def __init__(self
, *args
, **kwargs
):
5242 __init__(self, Window win=None) -> ChildFocusEvent
5246 _core_
.ChildFocusEvent_swiginit(self
,_core_
.new_ChildFocusEvent(*args
, **kwargs
))
5247 def GetWindow(*args
, **kwargs
):
5249 GetWindow(self) -> Window
5251 The window which has just received the focus.
5253 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5255 Window
= property(GetWindow
,doc
="See `GetWindow`")
5256 _core_
.ChildFocusEvent_swigregister(ChildFocusEvent
)
5258 #---------------------------------------------------------------------------
5260 class ActivateEvent(Event
):
5262 An activate event is sent when a top-level window or the entire
5263 application is being activated or deactivated.
5265 A top-level window (a dialog or frame) receives an activate event when
5266 is being activated or deactivated. This is indicated visually by the
5267 title bar changing colour, and a subwindow gaining the keyboard focus.
5268 An application is activated or deactivated when one of its frames
5269 becomes activated, or a frame becomes inactivate resulting in all
5270 application frames being inactive.
5272 Please note that usually you should call event.Skip() in your handlers
5273 for these events so the default handlers will still be called, as not
5274 doing so can result in strange effects.
5277 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5278 __repr__
= _swig_repr
5279 def __init__(self
, *args
, **kwargs
):
5281 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5285 _core_
.ActivateEvent_swiginit(self
,_core_
.new_ActivateEvent(*args
, **kwargs
))
5286 def GetActive(*args
, **kwargs
):
5288 GetActive(self) -> bool
5290 Returns true if the application or window is being activated, false
5293 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5295 Active
= property(GetActive
,doc
="See `GetActive`")
5296 _core_
.ActivateEvent_swigregister(ActivateEvent
)
5298 #---------------------------------------------------------------------------
5300 class InitDialogEvent(Event
):
5302 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5303 any window when `wx.Window.InitDialog` is called. Handlers for this
5304 event can transfer data to the window, or anything else that should be
5305 done before the user begins editing the form. The default handler
5306 calls `wx.Window.TransferDataToWindow`.
5308 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5309 __repr__
= _swig_repr
5310 def __init__(self
, *args
, **kwargs
):
5312 __init__(self, int Id=0) -> InitDialogEvent
5316 _core_
.InitDialogEvent_swiginit(self
,_core_
.new_InitDialogEvent(*args
, **kwargs
))
5317 _core_
.InitDialogEvent_swigregister(InitDialogEvent
)
5319 #---------------------------------------------------------------------------
5321 class MenuEvent(Event
):
5323 This class is used for a variety of menu-related events. Note that
5324 these do not include menu command events, which are handled by sending
5325 `wx.CommandEvent` objects.
5327 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5328 text in the first field of the status bar.
5330 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5331 __repr__
= _swig_repr
5332 def __init__(self
, *args
, **kwargs
):
5334 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5338 _core_
.MenuEvent_swiginit(self
,_core_
.new_MenuEvent(*args
, **kwargs
))
5339 def GetMenuId(*args
, **kwargs
):
5341 GetMenuId(self) -> int
5343 Returns the menu identifier associated with the event. This method
5344 should be only used with the HIGHLIGHT events.
5346 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5348 def IsPopup(*args
, **kwargs
):
5350 IsPopup(self) -> bool
5352 Returns ``True`` if the menu which is being opened or closed is a
5353 popup menu, ``False`` if it is a normal one. This method should only
5354 be used with the OPEN and CLOSE events.
5356 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5358 def GetMenu(*args
, **kwargs
):
5360 GetMenu(self) -> Menu
5362 Returns the menu which is being opened or closed. This method should
5363 only be used with the OPEN and CLOSE events.
5365 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5367 _core_
.MenuEvent_swigregister(MenuEvent
)
5369 #---------------------------------------------------------------------------
5371 class CloseEvent(Event
):
5373 This event class contains information about window and session close
5376 The handler function for EVT_CLOSE is called when the user has tried
5377 to close a a frame or dialog box using the window manager controls or
5378 the system menu. It can also be invoked by the application itself
5379 programmatically, for example by calling the `wx.Window.Close`
5382 You should check whether the application is forcing the deletion of
5383 the window using `CanVeto`. If it returns ``False``, you must destroy
5384 the window using `wx.Window.Destroy`. If the return value is ``True``,
5385 it is up to you whether you respond by destroying the window or not.
5386 For example you may wish to display a message dialog prompting to save
5387 files or to cancel the close.
5389 If you don't destroy the window, you should call `Veto` to let the
5390 calling code know that you did not destroy the window. This allows the
5391 `wx.Window.Close` function to return ``True`` or ``False`` depending
5392 on whether the close instruction was honored or not.
5394 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5395 __repr__
= _swig_repr
5396 def __init__(self
, *args
, **kwargs
):
5398 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5402 _core_
.CloseEvent_swiginit(self
,_core_
.new_CloseEvent(*args
, **kwargs
))
5403 def SetLoggingOff(*args
, **kwargs
):
5405 SetLoggingOff(self, bool logOff)
5407 Sets the 'logging off' flag.
5409 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5411 def GetLoggingOff(*args
, **kwargs
):
5413 GetLoggingOff(self) -> bool
5415 Returns ``True`` if the user is logging off or ``False`` if the
5416 system is shutting down. This method can only be called for end
5417 session and query end session events, it doesn't make sense for close
5420 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5422 def Veto(*args
, **kwargs
):
5424 Veto(self, bool veto=True)
5426 Call this from your event handler to veto a system shutdown or to
5427 signal to the calling application that a window close did not happen.
5429 You can only veto a shutdown or close if `CanVeto` returns true.
5431 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5433 def GetVeto(*args
, **kwargs
):
5434 """GetVeto(self) -> bool"""
5435 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5437 def SetCanVeto(*args
, **kwargs
):
5439 SetCanVeto(self, bool canVeto)
5441 Sets the 'can veto' flag.
5443 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5445 def CanVeto(*args
, **kwargs
):
5447 CanVeto(self) -> bool
5449 Returns true if you can veto a system shutdown or a window close
5450 event. Vetoing a window close event is not possible if the calling
5451 code wishes to force the application to exit, and so this function
5452 must be called to check this.
5454 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5456 LoggingOff
= property(GetLoggingOff
,SetLoggingOff
,doc
="See `GetLoggingOff` and `SetLoggingOff`")
5457 _core_
.CloseEvent_swigregister(CloseEvent
)
5459 #---------------------------------------------------------------------------
5461 class ShowEvent(Event
):
5462 """An EVT_SHOW event is sent when a window is shown or hidden."""
5463 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5464 __repr__
= _swig_repr
5465 def __init__(self
, *args
, **kwargs
):
5467 __init__(self, int winid=0, bool show=False) -> ShowEvent
5469 An EVT_SHOW event is sent when a window is shown or hidden.
5471 _core_
.ShowEvent_swiginit(self
,_core_
.new_ShowEvent(*args
, **kwargs
))
5472 def SetShow(*args
, **kwargs
):
5473 """SetShow(self, bool show)"""
5474 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5476 def GetShow(*args
, **kwargs
):
5477 """GetShow(self) -> bool"""
5478 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5480 _core_
.ShowEvent_swigregister(ShowEvent
)
5482 #---------------------------------------------------------------------------
5484 class IconizeEvent(Event
):
5486 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5489 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5490 __repr__
= _swig_repr
5491 def __init__(self
, *args
, **kwargs
):
5493 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5495 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5498 _core_
.IconizeEvent_swiginit(self
,_core_
.new_IconizeEvent(*args
, **kwargs
))
5499 def Iconized(*args
, **kwargs
):
5501 Iconized(self) -> bool
5503 Returns ``True`` if the frame has been iconized, ``False`` if it has
5506 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5508 _core_
.IconizeEvent_swigregister(IconizeEvent
)
5510 #---------------------------------------------------------------------------
5512 class MaximizeEvent(Event
):
5513 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5514 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5515 __repr__
= _swig_repr
5516 def __init__(self
, *args
, **kwargs
):
5518 __init__(self, int id=0) -> MaximizeEvent
5520 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5522 _core_
.MaximizeEvent_swiginit(self
,_core_
.new_MaximizeEvent(*args
, **kwargs
))
5523 _core_
.MaximizeEvent_swigregister(MaximizeEvent
)
5525 #---------------------------------------------------------------------------
5527 class DropFilesEvent(Event
):
5529 This class is used for drop files events, that is, when files have
5530 been dropped onto the window. This functionality is only available
5531 under Windows. The window must have previously been enabled for
5532 dropping by calling `wx.Window.DragAcceptFiles`.
5534 Important note: this is a separate implementation to the more general
5535 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5536 implementation uses the older, Windows message-based approach of
5539 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5543 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5544 def __init__(self
): raise AttributeError, "No constructor defined"
5545 __repr__
= _swig_repr
5546 def GetPosition(*args
, **kwargs
):
5548 GetPosition(self) -> Point
5550 Returns the position at which the files were dropped.
5552 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5554 def GetNumberOfFiles(*args
, **kwargs
):
5556 GetNumberOfFiles(self) -> int
5558 Returns the number of files dropped.
5560 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5562 def GetFiles(*args
, **kwargs
):
5564 GetFiles(self) -> PyObject
5566 Returns a list of the filenames that were dropped.
5568 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5570 Files
= property(GetFiles
,doc
="See `GetFiles`")
5571 NumberOfFiles
= property(GetNumberOfFiles
,doc
="See `GetNumberOfFiles`")
5572 Position
= property(GetPosition
,doc
="See `GetPosition`")
5573 _core_
.DropFilesEvent_swigregister(DropFilesEvent
)
5575 #---------------------------------------------------------------------------
5577 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5578 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5579 class UpdateUIEvent(CommandEvent
):
5581 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5582 wxWidgets to give an application the chance to update various user
5585 Without update UI events, an application has to work hard to
5586 check/uncheck, enable/disable, and set the text for elements such as
5587 menu items and toolbar buttons. The code for doing this has to be
5588 mixed up with the code that is invoked when an action is invoked for a
5589 menu item or button.
5591 With update UI events, you define an event handler to look at the
5592 state of the application and change UI elements accordingly. wxWidgets
5593 will call your handler functions in idle time, so you don't have to
5594 worry where to call this code. In addition to being a clearer and more
5595 declarative method, it also means you don't have to worry whether
5596 you're updating a toolbar or menubar identifier. The same handler can
5597 update a menu item and toolbar button, if the ID values are the same.
5599 Instead of directly manipulating the menu or button, you call
5600 functions in the event object, such as `Check`. wxWidgets will
5601 determine whether such a call has been made, and which UI element to
5604 These events will work for popup menus as well as menubars. Just
5605 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5606 any UI events for the window that owns the menu.
5608 If you find that the overhead of UI update processing is affecting
5609 your application, you can do one or both of the following:
5611 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5612 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5613 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5614 receive update events. No other windows will receive update
5617 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5618 value to set the delay between updates. You may need to call
5619 `wx.Window.UpdateWindowUI` at critical points, for example when
5620 a dialog is about to be shown, in case the user sees a slight
5621 delay before windows are updated.
5623 Note that although events are sent in idle time, defining a EVT_IDLE
5624 handler for a window does not affect this because the events are sent
5625 from an internal idle handler.
5627 wxWidgets tries to optimize update events on some platforms. On
5628 Windows and GTK+, events for menubar items are only sent when the menu
5629 is about to be shown, and not in idle time.
5632 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5633 __repr__
= _swig_repr
5634 def __init__(self
, *args
, **kwargs
):
5636 __init__(self, int commandId=0) -> UpdateUIEvent
5640 _core_
.UpdateUIEvent_swiginit(self
,_core_
.new_UpdateUIEvent(*args
, **kwargs
))
5641 def GetChecked(*args
, **kwargs
):
5643 GetChecked(self) -> bool
5645 Returns ``True`` if the UI element should be checked.
5647 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
5649 def GetEnabled(*args
, **kwargs
):
5651 GetEnabled(self) -> bool
5653 Returns ``True`` if the UI element should be enabled.
5655 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
5657 def GetShown(*args
, **kwargs
):
5659 GetShown(self) -> bool
5661 Returns ``True`` if the UI element should be shown.
5663 return _core_
.UpdateUIEvent_GetShown(*args
, **kwargs
)
5665 def GetText(*args
, **kwargs
):
5667 GetText(self) -> String
5669 Returns the text that should be set for the UI element.
5671 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
5673 def GetSetText(*args
, **kwargs
):
5675 GetSetText(self) -> bool
5677 Returns ``True`` if the application has called `SetText`. For
5678 wxWidgets internal use only.
5680 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
5682 def GetSetChecked(*args
, **kwargs
):
5684 GetSetChecked(self) -> bool
5686 Returns ``True`` if the application has called `Check`. For wxWidgets
5689 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
5691 def GetSetEnabled(*args
, **kwargs
):
5693 GetSetEnabled(self) -> bool
5695 Returns ``True`` if the application has called `Enable`. For wxWidgets
5698 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
5700 def GetSetShown(*args
, **kwargs
):
5702 GetSetShown(self) -> bool
5704 Returns ``True`` if the application has called `Show`. For wxWidgets
5707 return _core_
.UpdateUIEvent_GetSetShown(*args
, **kwargs
)
5709 def Check(*args
, **kwargs
):
5711 Check(self, bool check)
5713 Check or uncheck the UI element.
5715 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
5717 def Enable(*args
, **kwargs
):
5719 Enable(self, bool enable)
5721 Enable or disable the UI element.
5723 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
5725 def Show(*args
, **kwargs
):
5727 Show(self, bool show)
5729 Show or hide the UI element.
5731 return _core_
.UpdateUIEvent_Show(*args
, **kwargs
)
5733 def SetText(*args
, **kwargs
):
5735 SetText(self, String text)
5737 Sets the text for this UI element.
5739 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
5741 def SetUpdateInterval(*args
, **kwargs
):
5743 SetUpdateInterval(long updateInterval)
5745 Sets the interval between updates in milliseconds. Set to -1 to
5746 disable updates, or to 0 to update as frequently as possible. The
5749 Use this to reduce the overhead of UI update events if your
5750 application has a lot of windows. If you set the value to -1 or
5751 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5752 at appropriate points in your application, such as when a dialog is
5755 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5757 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
5758 def GetUpdateInterval(*args
, **kwargs
):
5760 GetUpdateInterval() -> long
5762 Returns the current interval between updates in milliseconds. -1
5763 disables updates, 0 updates as frequently as possible.
5765 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5767 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
5768 def CanUpdate(*args
, **kwargs
):
5770 CanUpdate(Window win) -> bool
5772 Returns ``True`` if it is appropriate to update (send UI update events
5775 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5776 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5777 events were last sent in idle time, and the update interval, to
5778 determine whether events should be sent to this window now. By default
5779 this will always return true because the update mode is initially
5780 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5781 events will be sent as often as possible. You can reduce the frequency
5782 that events are sent by changing the mode and/or setting an update
5786 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5788 CanUpdate
= staticmethod(CanUpdate
)
5789 def ResetUpdateTime(*args
, **kwargs
):
5793 Used internally to reset the last-updated time to the current time. It
5794 is assumed that update events are normally sent in idle time, so this
5795 is called at the end of idle processing.
5797 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5799 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
5800 def SetMode(*args
, **kwargs
):
5804 Specify how wxWidgets will send update events: to all windows, or only
5805 to those which specify that they will process the events.
5807 The mode may be one of the following values:
5809 ============================= ==========================================
5810 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5811 is the default setting.
5812 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5813 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5815 ============================= ==========================================
5818 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5820 SetMode
= staticmethod(SetMode
)
5821 def GetMode(*args
, **kwargs
):
5825 Returns a value specifying how wxWidgets will send update events: to
5826 all windows, or only to those which specify that they will process the
5829 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5831 GetMode
= staticmethod(GetMode
)
5832 _core_
.UpdateUIEvent_swigregister(UpdateUIEvent
)
5834 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
5836 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5838 Sets the interval between updates in milliseconds. Set to -1 to
5839 disable updates, or to 0 to update as frequently as possible. The
5842 Use this to reduce the overhead of UI update events if your
5843 application has a lot of windows. If you set the value to -1 or
5844 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5845 at appropriate points in your application, such as when a dialog is
5848 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5850 def UpdateUIEvent_GetUpdateInterval(*args
):
5852 UpdateUIEvent_GetUpdateInterval() -> long
5854 Returns the current interval between updates in milliseconds. -1
5855 disables updates, 0 updates as frequently as possible.
5857 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
)
5859 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
5861 UpdateUIEvent_CanUpdate(Window win) -> bool
5863 Returns ``True`` if it is appropriate to update (send UI update events
5866 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5867 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5868 events were last sent in idle time, and the update interval, to
5869 determine whether events should be sent to this window now. By default
5870 this will always return true because the update mode is initially
5871 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5872 events will be sent as often as possible. You can reduce the frequency
5873 that events are sent by changing the mode and/or setting an update
5877 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5879 def UpdateUIEvent_ResetUpdateTime(*args
):
5881 UpdateUIEvent_ResetUpdateTime()
5883 Used internally to reset the last-updated time to the current time. It
5884 is assumed that update events are normally sent in idle time, so this
5885 is called at the end of idle processing.
5887 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
)
5889 def UpdateUIEvent_SetMode(*args
, **kwargs
):
5891 UpdateUIEvent_SetMode(int mode)
5893 Specify how wxWidgets will send update events: to all windows, or only
5894 to those which specify that they will process the events.
5896 The mode may be one of the following values:
5898 ============================= ==========================================
5899 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5900 is the default setting.
5901 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5902 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5904 ============================= ==========================================
5907 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5909 def UpdateUIEvent_GetMode(*args
):
5911 UpdateUIEvent_GetMode() -> int
5913 Returns a value specifying how wxWidgets will send update events: to
5914 all windows, or only to those which specify that they will process the
5917 return _core_
.UpdateUIEvent_GetMode(*args
)
5919 #---------------------------------------------------------------------------
5921 class SysColourChangedEvent(Event
):
5923 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5924 when the user changes the colour settings using the control
5925 panel. This is only applicable under Windows.
5927 The default event handler for this event propagates the event to child
5928 windows, since Windows only sends the events to top-level windows. If
5929 intercepting this event for a top-level window, remember to call
5930 `Skip` so the the base class handler will still be executed, or to
5931 pass the event on to the window's children explicitly.
5934 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5935 __repr__
= _swig_repr
5936 def __init__(self
, *args
, **kwargs
):
5938 __init__(self) -> SysColourChangedEvent
5942 _core_
.SysColourChangedEvent_swiginit(self
,_core_
.new_SysColourChangedEvent(*args
, **kwargs
))
5943 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEvent
)
5945 #---------------------------------------------------------------------------
5947 class MouseCaptureChangedEvent(Event
):
5949 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5950 a window that loses its mouse capture. This is called even if
5951 `wx.Window.ReleaseMouse` was called by the application code. Handling
5952 this event allows an application to cater for unexpected capture
5953 releases which might otherwise confuse mouse handling code.
5955 This event is implemented under Windows only.
5957 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5958 __repr__
= _swig_repr
5959 def __init__(self
, *args
, **kwargs
):
5961 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5965 _core_
.MouseCaptureChangedEvent_swiginit(self
,_core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
))
5966 def GetCapturedWindow(*args
, **kwargs
):
5968 GetCapturedWindow(self) -> Window
5970 Returns the window that gained the capture, or ``None`` if it was a
5971 non-wxWidgets window.
5973 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
5975 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent
)
5977 #---------------------------------------------------------------------------
5979 class MouseCaptureLostEvent(Event
):
5981 A mouse capture lost event is sent to a window that obtained mouse
5982 capture, which was subsequently loss due to "external" event, for
5983 example when a dialog box is shown or if another application captures
5986 If this happens, this event is sent to all windows that are on the
5987 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5988 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5989 if the capture changes because of a call to CaptureMouse or
5992 This event is currently emitted under Windows only.
5995 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5996 __repr__
= _swig_repr
5997 def __init__(self
, *args
, **kwargs
):
5999 __init__(self, int winid=0) -> MouseCaptureLostEvent
6001 A mouse capture lost event is sent to a window that obtained mouse
6002 capture, which was subsequently loss due to "external" event, for
6003 example when a dialog box is shown or if another application captures
6006 If this happens, this event is sent to all windows that are on the
6007 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6008 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6009 if the capture changes because of a call to CaptureMouse or
6012 This event is currently emitted under Windows only.
6015 _core_
.MouseCaptureLostEvent_swiginit(self
,_core_
.new_MouseCaptureLostEvent(*args
, **kwargs
))
6016 _core_
.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent
)
6018 #---------------------------------------------------------------------------
6020 class DisplayChangedEvent(Event
):
6022 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6023 resolution has changed.
6025 This event is implemented under Windows only.
6027 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6028 __repr__
= _swig_repr
6029 def __init__(self
, *args
, **kwargs
):
6030 """__init__(self) -> DisplayChangedEvent"""
6031 _core_
.DisplayChangedEvent_swiginit(self
,_core_
.new_DisplayChangedEvent(*args
, **kwargs
))
6032 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEvent
)
6034 #---------------------------------------------------------------------------
6036 class PaletteChangedEvent(Event
):
6038 An EVT_PALETTE_CHANGED event is sent when the system palette has
6039 changed, thereby giving each window a chance to redo their own to
6042 This event is implemented under Windows only.
6044 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6045 __repr__
= _swig_repr
6046 def __init__(self
, *args
, **kwargs
):
6048 __init__(self, int id=0) -> PaletteChangedEvent
6050 An EVT_PALETTE_CHANGED event is sent when the system palette has
6051 changed, thereby giving each window a chance to redo their own to
6054 This event is implemented under Windows only.
6056 _core_
.PaletteChangedEvent_swiginit(self
,_core_
.new_PaletteChangedEvent(*args
, **kwargs
))
6057 def SetChangedWindow(*args
, **kwargs
):
6058 """SetChangedWindow(self, Window win)"""
6059 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
6061 def GetChangedWindow(*args
, **kwargs
):
6062 """GetChangedWindow(self) -> Window"""
6063 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
6065 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEvent
)
6067 #---------------------------------------------------------------------------
6069 class QueryNewPaletteEvent(Event
):
6071 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6072 focus and should re-do its palette.
6074 This event is implemented under Windows only.
6076 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6077 __repr__
= _swig_repr
6078 def __init__(self
, *args
, **kwargs
):
6080 __init__(self, int winid=0) -> QueryNewPaletteEvent
6084 _core_
.QueryNewPaletteEvent_swiginit(self
,_core_
.new_QueryNewPaletteEvent(*args
, **kwargs
))
6085 def SetPaletteRealized(*args
, **kwargs
):
6087 SetPaletteRealized(self, bool realized)
6089 App should set this if it changes the palette.
6091 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
6093 def GetPaletteRealized(*args
, **kwargs
):
6094 """GetPaletteRealized(self) -> bool"""
6095 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
6097 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent
)
6099 #---------------------------------------------------------------------------
6101 class NavigationKeyEvent(Event
):
6103 EVT_NAVIGATION_KEY events are used to control moving the focus between
6104 widgets, otherwise known as tab-traversal. You woudl normally not
6105 catch navigation events in applications as there are already
6106 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6107 it useful to send navigation events in certain situations to change
6108 the focus in certain ways, although it's probably easier to just call
6109 `wx.Window.Navigate`.
6111 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6112 __repr__
= _swig_repr
6113 def __init__(self
, *args
, **kwargs
):
6114 """__init__(self) -> NavigationKeyEvent"""
6115 _core_
.NavigationKeyEvent_swiginit(self
,_core_
.new_NavigationKeyEvent(*args
, **kwargs
))
6116 def GetDirection(*args
, **kwargs
):
6118 GetDirection(self) -> bool
6120 Returns ``True`` if the direction is forward, ``False`` otherwise.
6122 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
6124 def SetDirection(*args
, **kwargs
):
6126 SetDirection(self, bool forward)
6128 Specify the direction that the navigation should take. Usually the
6129 difference between using Tab and Shift-Tab.
6131 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
6133 def IsWindowChange(*args
, **kwargs
):
6135 IsWindowChange(self) -> bool
6137 Returns ``True`` if window change is allowed.
6139 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
6141 def SetWindowChange(*args
, **kwargs
):
6143 SetWindowChange(self, bool ischange)
6145 Specify if the navigation should be able to change parent windows.
6146 For example, changing notebook pages, etc. This is usually implemented
6147 by using Control-Tab.
6149 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
6151 def IsFromTab(*args
, **kwargs
):
6153 IsFromTab(self) -> bool
6155 Returns ``True`` if the navigation event is originated from the Tab
6158 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
6160 def SetFromTab(*args
, **kwargs
):
6162 SetFromTab(self, bool bIs)
6164 Set to true under MSW if the event was generated using the tab key.
6165 This is required for proper navogation over radio buttons.
6167 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
6169 def SetFlags(*args
, **kwargs
):
6171 SetFlags(self, long flags)
6173 Set the navigation flags to a combination of the following:
6175 * wx.NavigationKeyEvent.IsBackward
6176 * wx.NavigationKeyEvent.IsForward
6177 * wx.NavigationKeyEvent.WinChange
6178 * wx.NavigationKeyEvent.FromTab
6181 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6183 def GetCurrentFocus(*args
, **kwargs
):
6185 GetCurrentFocus(self) -> Window
6187 Returns the child window which currenty has the focus. May be
6190 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6192 def SetCurrentFocus(*args
, **kwargs
):
6194 SetCurrentFocus(self, Window win)
6196 Set the window that has the focus.
6198 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6200 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6201 IsForward
= _core_
.NavigationKeyEvent_IsForward
6202 WinChange
= _core_
.NavigationKeyEvent_WinChange
6203 FromTab
= _core_
.NavigationKeyEvent_FromTab
6204 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEvent
)
6206 #---------------------------------------------------------------------------
6208 class WindowCreateEvent(CommandEvent
):
6210 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6211 underlying GUI object) exists.
6213 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6214 __repr__
= _swig_repr
6215 def __init__(self
, *args
, **kwargs
):
6217 __init__(self, Window win=None) -> WindowCreateEvent
6219 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6220 underlying GUI object) exists.
6222 _core_
.WindowCreateEvent_swiginit(self
,_core_
.new_WindowCreateEvent(*args
, **kwargs
))
6223 def GetWindow(*args
, **kwargs
):
6225 GetWindow(self) -> Window
6227 Returns the window that this event refers to.
6229 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6231 _core_
.WindowCreateEvent_swigregister(WindowCreateEvent
)
6233 class WindowDestroyEvent(CommandEvent
):
6235 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6236 when the GUI window is destroyed.
6238 When a class derived from `wx.Window` is destroyed its destructor will
6239 have already run by the time this event is sent. Therefore this event
6240 will not usually be received at all by the window itself. Since it is
6241 received after the destructor has run, an object should not try to
6242 handle its own wx.WindowDestroyEvent, but it can be used to get
6243 notification of the destruction of another window.
6245 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6246 __repr__
= _swig_repr
6247 def __init__(self
, *args
, **kwargs
):
6249 __init__(self, Window win=None) -> WindowDestroyEvent
6251 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6252 when the GUI window is destroyed.
6254 When a class derived from `wx.Window` is destroyed its destructor will
6255 have already run by the time this event is sent. Therefore this event
6256 will not usually be received at all by the window itself. Since it is
6257 received after the destructor has run, an object should not try to
6258 handle its own wx.WindowDestroyEvent, but it can be used to get
6259 notification of the destruction of another window.
6261 _core_
.WindowDestroyEvent_swiginit(self
,_core_
.new_WindowDestroyEvent(*args
, **kwargs
))
6262 def GetWindow(*args
, **kwargs
):
6264 GetWindow(self) -> Window
6266 Returns the window that this event refers to.
6268 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6270 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEvent
)
6272 #---------------------------------------------------------------------------
6274 class ContextMenuEvent(CommandEvent
):
6276 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6277 give the application a chance to show a context (popup) menu.
6279 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6280 __repr__
= _swig_repr
6281 def __init__(self
, *args
, **kwargs
):
6283 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6287 _core_
.ContextMenuEvent_swiginit(self
,_core_
.new_ContextMenuEvent(*args
, **kwargs
))
6288 def GetPosition(*args
, **kwargs
):
6290 GetPosition(self) -> Point
6292 Returns the position (in screen coordinants) at which the menu should
6295 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6297 def SetPosition(*args
, **kwargs
):
6299 SetPosition(self, Point pos)
6301 Sets the position at which the menu should be shown.
6303 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6305 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
6306 _core_
.ContextMenuEvent_swigregister(ContextMenuEvent
)
6308 #---------------------------------------------------------------------------
6310 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6311 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6312 class IdleEvent(Event
):
6314 This class is used for EVT_IDLE events, which are generated and sent
6315 when the application *becomes* idle. In other words, the when the
6316 event queue becomes empty then idle events are sent to all windows (by
6317 default) and as long as none of them call `RequestMore` then there are
6318 no more idle events until after the system event queue has some normal
6319 events and then becomes empty again.
6321 By default, idle events are sent to all windows. If this is causing a
6322 significant overhead in your application, you can call
6323 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6324 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6325 which should receive idle events. Then idle events will only be sent
6326 to those windows and not to any others.
6328 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6329 __repr__
= _swig_repr
6330 def __init__(self
, *args
, **kwargs
):
6332 __init__(self) -> IdleEvent
6336 _core_
.IdleEvent_swiginit(self
,_core_
.new_IdleEvent(*args
, **kwargs
))
6337 def RequestMore(*args
, **kwargs
):
6339 RequestMore(self, bool needMore=True)
6341 Tells wxWidgets that more processing is required. This function can be
6342 called by an EVT_IDLE handler for a window to indicate that the
6343 application should forward the EVT_IDLE event once more to the
6344 application windows. If no window calls this function during its
6345 EVT_IDLE handler, then the application will remain in a passive event
6346 loop until a new event is posted to the application by the windowing
6349 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6351 def MoreRequested(*args
, **kwargs
):
6353 MoreRequested(self) -> bool
6355 Returns ``True`` if the OnIdle function processing this event
6356 requested more processing time.
6358 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6360 def SetMode(*args
, **kwargs
):
6364 Static method for specifying how wxWidgets will send idle events: to
6365 all windows, or only to those which specify that they will process the
6368 The mode can be one of the following values:
6370 ========================= ========================================
6371 wx.IDLE_PROCESS_ALL Send idle events to all windows
6372 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6373 the wx.WS_EX_PROCESS_IDLE extra style
6375 ========================= ========================================
6378 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6380 SetMode
= staticmethod(SetMode
)
6381 def GetMode(*args
, **kwargs
):
6385 Static method returning a value specifying how wxWidgets will send
6386 idle events: to all windows, or only to those which specify that they
6387 will process the events.
6389 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6391 GetMode
= staticmethod(GetMode
)
6392 def CanSend(*args
, **kwargs
):
6394 CanSend(Window win) -> bool
6396 Returns ``True`` if it is appropriate to send idle events to this
6399 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6400 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6401 events should be sent to this window now. By default this will always
6402 return ``True`` because the update mode is initially
6403 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6404 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6406 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6408 CanSend
= staticmethod(CanSend
)
6409 _core_
.IdleEvent_swigregister(IdleEvent
)
6411 def IdleEvent_SetMode(*args
, **kwargs
):
6413 IdleEvent_SetMode(int mode)
6415 Static method for specifying how wxWidgets will send idle events: to
6416 all windows, or only to those which specify that they will process the
6419 The mode can be one of the following values:
6421 ========================= ========================================
6422 wx.IDLE_PROCESS_ALL Send idle events to all windows
6423 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6424 the wx.WS_EX_PROCESS_IDLE extra style
6426 ========================= ========================================
6429 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6431 def IdleEvent_GetMode(*args
):
6433 IdleEvent_GetMode() -> int
6435 Static method returning a value specifying how wxWidgets will send
6436 idle events: to all windows, or only to those which specify that they
6437 will process the events.
6439 return _core_
.IdleEvent_GetMode(*args
)
6441 def IdleEvent_CanSend(*args
, **kwargs
):
6443 IdleEvent_CanSend(Window win) -> bool
6445 Returns ``True`` if it is appropriate to send idle events to this
6448 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6449 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6450 events should be sent to this window now. By default this will always
6451 return ``True`` because the update mode is initially
6452 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6453 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6455 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6457 #---------------------------------------------------------------------------
6459 class ClipboardTextEvent(CommandEvent
):
6461 A Clipboard Text event is sent when a window intercepts a text
6462 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6463 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6464 popup menu command, etc. NOTE : under windows these events are *NOT*
6465 generated automatically for a Rich Edit text control.
6467 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6468 __repr__
= _swig_repr
6469 def __init__(self
, *args
, **kwargs
):
6471 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6473 A Clipboard Text event is sent when a window intercepts a text
6474 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6475 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6476 popup menu command, etc. NOTE : under windows these events are *NOT*
6477 generated automatically for a Rich Edit text control.
6479 _core_
.ClipboardTextEvent_swiginit(self
,_core_
.new_ClipboardTextEvent(*args
, **kwargs
))
6480 _core_
.ClipboardTextEvent_swigregister(ClipboardTextEvent
)
6482 #---------------------------------------------------------------------------
6484 class PyEvent(Event
):
6486 wx.PyEvent can be used as a base class for implementing custom event
6487 types in Python. You should derived from this class instead of
6488 `wx.Event` because this class is Python-aware and is able to transport
6489 its Python bits safely through the wxWidgets event system and have
6490 them still be there when the event handler is invoked.
6492 :see: `wx.PyCommandEvent`
6495 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6496 __repr__
= _swig_repr
6497 def __init__(self
, *args
, **kwargs
):
6498 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6499 _core_
.PyEvent_swiginit(self
,_core_
.new_PyEvent(*args
, **kwargs
))
6502 __swig_destroy__
= _core_
.delete_PyEvent
6503 __del__
= lambda self
: None;
6504 def _SetSelf(*args
, **kwargs
):
6505 """_SetSelf(self, PyObject self)"""
6506 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6508 def _GetSelf(*args
, **kwargs
):
6509 """_GetSelf(self) -> PyObject"""
6510 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6512 _core_
.PyEvent_swigregister(PyEvent
)
6514 class PyCommandEvent(CommandEvent
):
6516 wx.PyCommandEvent can be used as a base class for implementing custom
6517 event types in Python, where the event shoudl travel up to parent
6518 windows looking for a handler. You should derived from this class
6519 instead of `wx.CommandEvent` because this class is Python-aware and is
6520 able to transport its Python bits safely through the wxWidgets event
6521 system and have them still be there when the event handler is invoked.
6526 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6527 __repr__
= _swig_repr
6528 def __init__(self
, *args
, **kwargs
):
6529 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6530 _core_
.PyCommandEvent_swiginit(self
,_core_
.new_PyCommandEvent(*args
, **kwargs
))
6533 __swig_destroy__
= _core_
.delete_PyCommandEvent
6534 __del__
= lambda self
: None;
6535 def _SetSelf(*args
, **kwargs
):
6536 """_SetSelf(self, PyObject self)"""
6537 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6539 def _GetSelf(*args
, **kwargs
):
6540 """_GetSelf(self) -> PyObject"""
6541 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6543 _core_
.PyCommandEvent_swigregister(PyCommandEvent
)
6545 class DateEvent(CommandEvent
):
6547 This event class holds information about a date change event and is
6548 used together with `wx.DatePickerCtrl`. It also serves as a base class
6549 for `wx.calendar.CalendarEvent`. Bind these event types with
6552 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6553 __repr__
= _swig_repr
6554 def __init__(self
, *args
, **kwargs
):
6555 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6556 _core_
.DateEvent_swiginit(self
,_core_
.new_DateEvent(*args
, **kwargs
))
6557 def GetDate(*args
, **kwargs
):
6559 GetDate(self) -> DateTime
6563 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6565 def SetDate(*args
, **kwargs
):
6567 SetDate(self, DateTime date)
6569 Sets the date carried by the event, normally only used by the library
6572 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
6574 Date
= property(GetDate
,SetDate
,doc
="See `GetDate` and `SetDate`")
6575 _core_
.DateEvent_swigregister(DateEvent
)
6577 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
6578 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
6580 #---------------------------------------------------------------------------
6582 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
6583 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
6584 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
6585 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
6586 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
6587 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
6588 class PyApp(EvtHandler
):
6590 The ``wx.PyApp`` class is an *implementation detail*, please use the
6591 `wx.App` class (or some other derived class) instead.
6593 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6594 __repr__
= _swig_repr
6595 def __init__(self
, *args
, **kwargs
):
6597 __init__(self) -> PyApp
6599 Create a new application object, starting the bootstrap process.
6601 _core_
.PyApp_swiginit(self
,_core_
.new_PyApp(*args
, **kwargs
))
6602 self
._setCallbackInfo
(self
, PyApp
, False)
6603 self
._setOORInfo
(self
, False)
6605 __swig_destroy__
= _core_
.delete_PyApp
6606 __del__
= lambda self
: None;
6607 def _setCallbackInfo(*args
, **kwargs
):
6608 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6609 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
6611 def GetAppName(*args
, **kwargs
):
6613 GetAppName(self) -> String
6615 Get the application name.
6617 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
6619 def SetAppName(*args
, **kwargs
):
6621 SetAppName(self, String name)
6623 Set the application name. This value may be used automatically by
6624 `wx.Config` and such.
6626 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
6628 def GetClassName(*args
, **kwargs
):
6630 GetClassName(self) -> String
6632 Get the application's class name.
6634 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
6636 def SetClassName(*args
, **kwargs
):
6638 SetClassName(self, String name)
6640 Set the application's class name. This value may be used for
6641 X-resources if applicable for the platform
6643 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
6645 def GetVendorName(*args
, **kwargs
):
6647 GetVendorName(self) -> String
6649 Get the application's vendor name.
6651 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
6653 def SetVendorName(*args
, **kwargs
):
6655 SetVendorName(self, String name)
6657 Set the application's vendor name. This value may be used
6658 automatically by `wx.Config` and such.
6660 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
6662 def GetTraits(*args
, **kwargs
):
6664 GetTraits(self) -> wxAppTraits
6666 Return (and create if necessary) the app traits object to which we
6667 delegate for everything which either should be configurable by the
6668 user (then he can change the default behaviour simply by overriding
6669 CreateTraits() and returning his own traits object) or which is
6670 GUI/console dependent as then wx.AppTraits allows us to abstract the
6671 differences behind the common facade.
6673 :todo: Add support for overriding CreateAppTraits in wxPython.
6675 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
6677 def ProcessPendingEvents(*args
, **kwargs
):
6679 ProcessPendingEvents(self)
6681 Process all events in the Pending Events list -- it is necessary to
6682 call this function to process posted events. This normally happens
6683 during each event loop iteration.
6685 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
6687 def Yield(*args
, **kwargs
):
6689 Yield(self, bool onlyIfNeeded=False) -> bool
6691 Process all currently pending events right now, instead of waiting
6692 until return to the event loop. It is an error to call ``Yield``
6693 recursively unless the value of ``onlyIfNeeded`` is True.
6695 :warning: This function is dangerous as it can lead to unexpected
6696 reentrancies (i.e. when called from an event handler it may
6697 result in calling the same event handler again), use with
6698 extreme care or, better, don't use at all!
6700 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6703 return _core_
.PyApp_Yield(*args
, **kwargs
)
6705 def WakeUpIdle(*args
, **kwargs
):
6709 Make sure that idle events are sent again.
6710 :see: `wx.WakeUpIdle`
6712 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
6714 def IsMainLoopRunning(*args
, **kwargs
):
6716 IsMainLoopRunning() -> bool
6718 Returns True if we're running the main loop, i.e. if the events can
6719 currently be dispatched.
6721 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
6723 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
6724 def MainLoop(*args
, **kwargs
):
6726 MainLoop(self) -> int
6728 Execute the main GUI loop, the function doesn't normally return until
6729 all top level windows have been closed and destroyed.
6731 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
6733 def Exit(*args
, **kwargs
):
6737 Exit the main loop thus terminating the application.
6740 return _core_
.PyApp_Exit(*args
, **kwargs
)
6742 def GetLayoutDirection(*args
, **kwargs
):
6744 GetLayoutDirection(self) -> wxLayoutDirection
6746 Return the layout direction for the current locale.
6748 return _core_
.PyApp_GetLayoutDirection(*args
, **kwargs
)
6750 def ExitMainLoop(*args
, **kwargs
):
6754 Exit the main GUI loop during the next iteration of the main
6755 loop, (i.e. it does not stop the program immediately!)
6757 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
6759 def Pending(*args
, **kwargs
):
6761 Pending(self) -> bool
6763 Returns True if there are unprocessed events in the event queue.
6765 return _core_
.PyApp_Pending(*args
, **kwargs
)
6767 def Dispatch(*args
, **kwargs
):
6769 Dispatch(self) -> bool
6771 Process the first event in the event queue (blocks until an event
6772 appears if there are none currently)
6774 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
6776 def ProcessIdle(*args
, **kwargs
):
6778 ProcessIdle(self) -> bool
6780 Called from the MainLoop when the application becomes idle (there are
6781 no pending events) and sends a `wx.IdleEvent` to all interested
6782 parties. Returns True if more idle events are needed, False if not.
6784 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
6786 def SendIdleEvents(*args
, **kwargs
):
6788 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6790 Send idle event to window and all subwindows. Returns True if more
6791 idle time is requested.
6793 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
6795 def IsActive(*args
, **kwargs
):
6797 IsActive(self) -> bool
6799 Return True if our app has focus.
6801 return _core_
.PyApp_IsActive(*args
, **kwargs
)
6803 def SetTopWindow(*args
, **kwargs
):
6805 SetTopWindow(self, Window win)
6807 Set the *main* top level window
6809 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
6811 def GetTopWindow(*args
, **kwargs
):
6813 GetTopWindow(self) -> Window
6815 Return the *main* top level window (if it hadn't been set previously
6816 with SetTopWindow(), will return just some top level window and, if
6817 there not any, will return None)
6819 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
6821 def SetExitOnFrameDelete(*args
, **kwargs
):
6823 SetExitOnFrameDelete(self, bool flag)
6825 Control the exit behaviour: by default, the program will exit the main
6826 loop (and so, usually, terminate) when the last top-level program
6827 window is deleted. Beware that if you disable this behaviour (with
6828 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6829 explicitly from somewhere.
6831 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
6833 def GetExitOnFrameDelete(*args
, **kwargs
):
6835 GetExitOnFrameDelete(self) -> bool
6837 Get the current exit behaviour setting.
6839 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
6841 def SetUseBestVisual(*args
, **kwargs
):
6843 SetUseBestVisual(self, bool flag)
6845 Set whether the app should try to use the best available visual on
6846 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6848 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
6850 def GetUseBestVisual(*args
, **kwargs
):
6852 GetUseBestVisual(self) -> bool
6854 Get current UseBestVisual setting.
6856 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
6858 def SetPrintMode(*args
, **kwargs
):
6859 """SetPrintMode(self, int mode)"""
6860 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
6862 def GetPrintMode(*args
, **kwargs
):
6863 """GetPrintMode(self) -> int"""
6864 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
6866 def SetAssertMode(*args
, **kwargs
):
6868 SetAssertMode(self, int mode)
6870 Set the OnAssert behaviour for debug and hybrid builds.
6872 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
6874 def GetAssertMode(*args
, **kwargs
):
6876 GetAssertMode(self) -> int
6878 Get the current OnAssert behaviour setting.
6880 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
6882 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6883 """GetMacSupportPCMenuShortcuts() -> bool"""
6884 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6886 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
6887 def GetMacAboutMenuItemId(*args
, **kwargs
):
6888 """GetMacAboutMenuItemId() -> long"""
6889 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
6891 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
6892 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
6893 """GetMacPreferencesMenuItemId() -> long"""
6894 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
6896 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
6897 def GetMacExitMenuItemId(*args
, **kwargs
):
6898 """GetMacExitMenuItemId() -> long"""
6899 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
6901 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
6902 def GetMacHelpMenuTitleName(*args
, **kwargs
):
6903 """GetMacHelpMenuTitleName() -> String"""
6904 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
6906 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
6907 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6908 """SetMacSupportPCMenuShortcuts(bool val)"""
6909 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6911 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
6912 def SetMacAboutMenuItemId(*args
, **kwargs
):
6913 """SetMacAboutMenuItemId(long val)"""
6914 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6916 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
6917 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
6918 """SetMacPreferencesMenuItemId(long val)"""
6919 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6921 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
6922 def SetMacExitMenuItemId(*args
, **kwargs
):
6923 """SetMacExitMenuItemId(long val)"""
6924 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6926 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
6927 def SetMacHelpMenuTitleName(*args
, **kwargs
):
6928 """SetMacHelpMenuTitleName(String val)"""
6929 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6931 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
6932 def _BootstrapApp(*args
, **kwargs
):
6936 For internal use only
6938 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
6940 def GetComCtl32Version(*args
, **kwargs
):
6942 GetComCtl32Version() -> int
6944 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6945 it wasn't found at all. Raises an exception on non-Windows platforms.
6947 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
6949 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
6950 def DisplayAvailable(*args
, **kwargs
):
6952 DisplayAvailable() -> bool
6954 Tests if it is possible to create a GUI in the current environment.
6955 This will mean different things on the different platforms.
6957 * On X Windows systems this function will return ``False`` if it is
6958 not able to open a connection to the X display, which can happen
6959 if $DISPLAY is not set, or is not set correctly.
6961 * On Mac OS X a ``False`` return value will mean that wx is not
6962 able to access the window manager, which can happen if logged in
6963 remotely or if running from the normal version of python instead
6964 of the framework version, (i.e., pythonw.)
6969 return _core_
.PyApp_DisplayAvailable(*args
, **kwargs
)
6971 DisplayAvailable
= staticmethod(DisplayAvailable
)
6972 _core_
.PyApp_swigregister(PyApp
)
6974 def PyApp_IsMainLoopRunning(*args
):
6976 PyApp_IsMainLoopRunning() -> bool
6978 Returns True if we're running the main loop, i.e. if the events can
6979 currently be dispatched.
6981 return _core_
.PyApp_IsMainLoopRunning(*args
)
6983 def PyApp_GetMacSupportPCMenuShortcuts(*args
):
6984 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6985 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
)
6987 def PyApp_GetMacAboutMenuItemId(*args
):
6988 """PyApp_GetMacAboutMenuItemId() -> long"""
6989 return _core_
.PyApp_GetMacAboutMenuItemId(*args
)
6991 def PyApp_GetMacPreferencesMenuItemId(*args
):
6992 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6993 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
)
6995 def PyApp_GetMacExitMenuItemId(*args
):
6996 """PyApp_GetMacExitMenuItemId() -> long"""
6997 return _core_
.PyApp_GetMacExitMenuItemId(*args
)
6999 def PyApp_GetMacHelpMenuTitleName(*args
):
7000 """PyApp_GetMacHelpMenuTitleName() -> String"""
7001 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
)
7003 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7004 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7005 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7007 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
7008 """PyApp_SetMacAboutMenuItemId(long val)"""
7009 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7011 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
7012 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7013 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7015 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
7016 """PyApp_SetMacExitMenuItemId(long val)"""
7017 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7019 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
7020 """PyApp_SetMacHelpMenuTitleName(String val)"""
7021 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7023 def PyApp_GetComCtl32Version(*args
):
7025 PyApp_GetComCtl32Version() -> int
7027 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7028 it wasn't found at all. Raises an exception on non-Windows platforms.
7030 return _core_
.PyApp_GetComCtl32Version(*args
)
7032 def PyApp_DisplayAvailable(*args
):
7034 PyApp_DisplayAvailable() -> bool
7036 Tests if it is possible to create a GUI in the current environment.
7037 This will mean different things on the different platforms.
7039 * On X Windows systems this function will return ``False`` if it is
7040 not able to open a connection to the X display, which can happen
7041 if $DISPLAY is not set, or is not set correctly.
7043 * On Mac OS X a ``False`` return value will mean that wx is not
7044 able to access the window manager, which can happen if logged in
7045 remotely or if running from the normal version of python instead
7046 of the framework version, (i.e., pythonw.)
7051 return _core_
.PyApp_DisplayAvailable(*args
)
7053 #---------------------------------------------------------------------------
7060 Force an exit of the application. Convenience for wx.GetApp().Exit()
7062 return _core_
.Exit(*args
)
7068 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7070 return _core_
.Yield(*args
)
7072 def YieldIfNeeded(*args
):
7074 YieldIfNeeded() -> bool
7076 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7078 return _core_
.YieldIfNeeded(*args
)
7080 def SafeYield(*args
, **kwargs
):
7082 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7084 This function is similar to `wx.Yield`, except that it disables the
7085 user input to all program windows before calling `wx.Yield` and
7086 re-enables it again afterwards. If ``win`` is not None, this window
7087 will remain enabled, allowing the implementation of some limited user
7090 :Returns: the result of the call to `wx.Yield`.
7092 return _core_
.SafeYield(*args
, **kwargs
)
7094 def WakeUpIdle(*args
):
7098 Cause the message queue to become empty again, so idle events will be
7101 return _core_
.WakeUpIdle(*args
)
7103 def PostEvent(*args
, **kwargs
):
7105 PostEvent(EvtHandler dest, Event event)
7107 Send an event to a window or other wx.EvtHandler to be processed
7110 return _core_
.PostEvent(*args
, **kwargs
)
7112 def App_CleanUp(*args
):
7116 For internal use only, it is used to cleanup after wxWidgets when
7119 return _core_
.App_CleanUp(*args
)
7125 Return a reference to the current wx.App object.
7127 return _core_
.GetApp(*args
)
7129 def SetDefaultPyEncoding(*args
, **kwargs
):
7131 SetDefaultPyEncoding(string encoding)
7133 Sets the encoding that wxPython will use when it needs to convert a
7134 Python string or unicode object to or from a wxString.
7136 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7137 but please be aware that the default encoding within the same locale
7138 may be slightly different on different platforms. For example, please
7139 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7140 between the common latin/roman encodings.
7142 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
7144 def GetDefaultPyEncoding(*args
):
7146 GetDefaultPyEncoding() -> string
7148 Gets the current encoding that wxPython will use when it needs to
7149 convert a Python string or unicode object to or from a wxString.
7151 return _core_
.GetDefaultPyEncoding(*args
)
7152 #----------------------------------------------------------------------
7154 class PyOnDemandOutputWindow
:
7156 A class that can be used for redirecting Python's stdout and
7157 stderr streams. It will do nothing until something is wrriten to
7158 the stream at which point it will create a Frame with a text area
7159 and write the text there.
7161 def __init__(self
, title
= "wxPython: stdout/stderr"):
7164 self
.pos
= wx
.DefaultPosition
7165 self
.size
= (450, 300)
7168 def SetParent(self
, parent
):
7169 """Set the window to be used as the popup Frame's parent."""
7170 self
.parent
= parent
7173 def CreateOutputWindow(self
, st
):
7174 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
7175 style
=wx
.DEFAULT_FRAME_STYLE
)
7176 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
7177 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
7178 self
.text
.AppendText(st
)
7179 self
.frame
.Show(True)
7180 self
.frame
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
7183 def OnCloseWindow(self
, event
):
7184 if self
.frame
is not None:
7185 self
.frame
.Destroy()
7190 # These methods provide the file-like output behaviour.
7191 def write(self
, text
):
7193 Create the output window if needed and write the string to it.
7194 If not called in the context of the gui thread then uses
7195 CallAfter to do the work there.
7197 if self
.frame
is None:
7198 if not wx
.Thread_IsMain():
7199 wx
.CallAfter(self
.CreateOutputWindow
, text
)
7201 self
.CreateOutputWindow(text
)
7203 if not wx
.Thread_IsMain():
7204 wx
.CallAfter(self
.text
.AppendText
, text
)
7206 self
.text
.AppendText(text
)
7210 if self
.frame
is not None:
7211 wx
.CallAfter(self
.frame
.Close
)
7219 #----------------------------------------------------------------------
7221 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
7223 class App(wx
.PyApp
):
7225 The ``wx.App`` class represents the application and is used to:
7227 * bootstrap the wxPython system and initialize the underlying
7229 * set and get application-wide properties
7230 * implement the windowing system main message or event loop,
7231 and to dispatch events to window instances
7234 Every application must have a ``wx.App`` instance, and all
7235 creation of UI objects should be delayed until after the
7236 ``wx.App`` object has been created in order to ensure that the gui
7237 platform and wxWidgets have been fully initialized.
7239 Normally you would derive from this class and implement an
7240 ``OnInit`` method that creates a frame and then calls
7241 ``self.SetTopWindow(frame)``.
7243 :see: `wx.PySimpleApp` for a simpler app class that can be used
7247 outputWindowClass
= PyOnDemandOutputWindow
7249 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7250 useBestVisual
=False, clearSigInt
=True):
7252 Construct a ``wx.App`` object.
7254 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7255 redirected? Defaults to True on Windows and Mac, False
7256 otherwise. If `filename` is None then output will be
7257 redirected to a window that pops up as needed. (You can
7258 control what kind of window is created for the output by
7259 resetting the class variable ``outputWindowClass`` to a
7260 class of your choosing.)
7262 :param filename: The name of a file to redirect output to, if
7265 :param useBestVisual: Should the app try to use the best
7266 available visual provided by the system (only relevant on
7267 systems that have more than one visual.) This parameter
7268 must be used instead of calling `SetUseBestVisual` later
7269 on because it must be set before the underlying GUI
7270 toolkit is initialized.
7272 :param clearSigInt: Should SIGINT be cleared? This allows the
7273 app to terminate upon a Ctrl-C in the console like other
7276 :note: You should override OnInit to do applicaition
7277 initialization to ensure that the system, toolkit and
7278 wxWidgets are fully initialized.
7281 wx
.PyApp
.__init
__(self
)
7283 # make sure we can create a GUI
7284 if not self
.DisplayAvailable():
7286 if wx
.Platform
== "__WXMAC__":
7287 msg
= """This program needs access to the screen.
7288 Please run with 'pythonw', not 'python', and only when you are logged
7289 in on the main display of your Mac."""
7291 elif wx
.Platform
== "__WXGTK__":
7292 msg
="Unable to access the X Display, is $DISPLAY set properly?"
7295 msg
= "Unable to create GUI"
7296 # TODO: more description is needed for wxMSW...
7298 raise SystemExit(msg
)
7300 # This has to be done before OnInit
7301 self
.SetUseBestVisual(useBestVisual
)
7303 # Set the default handler for SIGINT. This fixes a problem
7304 # where if Ctrl-C is pressed in the console that started this
7305 # app then it will not appear to do anything, (not even send
7306 # KeyboardInterrupt???) but will later segfault on exit. By
7307 # setting the default handler then the app will exit, as
7308 # expected (depending on platform.)
7312 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7316 # Save and redirect the stdio to a window?
7317 self
.stdioWin
= None
7318 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7320 self
.RedirectStdio(filename
)
7322 # Use Python's install prefix as the default
7323 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7325 # This finishes the initialization of wxWindows and then calls
7326 # the OnInit that should be present in the derived class
7327 self
._BootstrapApp
()
7330 def OnPreInit(self
):
7332 Things that must be done after _BootstrapApp has done its
7333 thing, but would be nice if they were already done by the time
7334 that OnInit is called.
7336 wx
.StockGDI
._initStockObjects
()
7339 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7340 self
.RestoreStdio() # Just in case the MainLoop was overridden
7344 wx
.PyApp
.Destroy(self
)
7347 def SetTopWindow(self
, frame
):
7348 """Set the \"main\" top level window"""
7350 self
.stdioWin
.SetParent(frame
)
7351 wx
.PyApp
.SetTopWindow(self
, frame
)
7355 """Execute the main GUI event loop"""
7356 wx
.PyApp
.MainLoop(self
)
7360 def RedirectStdio(self
, filename
=None):
7361 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7363 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7365 self
.stdioWin
= self
.outputWindowClass()
7366 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7369 def RestoreStdio(self
):
7371 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7376 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7378 Set the title, position and/or size of the output window if
7379 the stdio has been redirected. This should be called before
7380 any output would cause the output window to be created.
7383 if title
is not None:
7384 self
.stdioWin
.title
= title
7386 self
.stdioWin
.pos
= pos
7387 if size
is not None:
7388 self
.stdioWin
.size
= size
7393 # change from wx.PyApp_XX to wx.App_XX
7394 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7395 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7396 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7397 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7398 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7399 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7400 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7401 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7402 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7403 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7404 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7406 #----------------------------------------------------------------------------
7408 class PySimpleApp(wx
.App
):
7410 A simple application class. You can just create one of these and
7411 then then make your top level windows later, and not have to worry
7412 about OnInit. For example::
7414 app = wx.PySimpleApp()
7415 frame = wx.Frame(None, title='Hello World')
7422 def __init__(self
, redirect
=False, filename
=None,
7423 useBestVisual
=False, clearSigInt
=True):
7425 :see: `wx.App.__init__`
7427 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7434 # Is anybody using this one?
7435 class PyWidgetTester(wx
.App
):
7436 def __init__(self
, size
= (250, 100)):
7438 wx
.App
.__init
__(self
, 0)
7441 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7442 self
.SetTopWindow(self
.frame
)
7445 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7446 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7447 self
.frame
.Show(True)
7449 #----------------------------------------------------------------------------
7450 # DO NOT hold any other references to this object. This is how we
7451 # know when to cleanup system resources that wxWidgets is holding. When
7452 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7453 # goes to zero and it calls the wx.App_CleanUp function.
7455 class __wxPyCleanup
:
7457 self
.cleanup
= _core_
.App_CleanUp
7461 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7463 ## # another possible solution, but it gets called too early...
7465 ## atexit.register(_core_.wxApp_CleanUp)
7468 #----------------------------------------------------------------------------
7470 #---------------------------------------------------------------------------
7472 class EventLoop(object):
7473 """Proxy of C++ EventLoop class"""
7474 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7475 __repr__
= _swig_repr
7476 def __init__(self
, *args
, **kwargs
):
7477 """__init__(self) -> EventLoop"""
7478 _core_
.EventLoop_swiginit(self
,_core_
.new_EventLoop(*args
, **kwargs
))
7479 __swig_destroy__
= _core_
.delete_EventLoop
7480 __del__
= lambda self
: None;
7481 def Run(*args
, **kwargs
):
7482 """Run(self) -> int"""
7483 return _core_
.EventLoop_Run(*args
, **kwargs
)
7485 def Exit(*args
, **kwargs
):
7486 """Exit(self, int rc=0)"""
7487 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7489 def Pending(*args
, **kwargs
):
7490 """Pending(self) -> bool"""
7491 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7493 def Dispatch(*args
, **kwargs
):
7494 """Dispatch(self) -> bool"""
7495 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7497 def IsRunning(*args
, **kwargs
):
7498 """IsRunning(self) -> bool"""
7499 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7501 def GetActive(*args
, **kwargs
):
7502 """GetActive() -> EventLoop"""
7503 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7505 GetActive
= staticmethod(GetActive
)
7506 def SetActive(*args
, **kwargs
):
7507 """SetActive(EventLoop loop)"""
7508 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7510 SetActive
= staticmethod(SetActive
)
7511 _core_
.EventLoop_swigregister(EventLoop
)
7513 def EventLoop_GetActive(*args
):
7514 """EventLoop_GetActive() -> EventLoop"""
7515 return _core_
.EventLoop_GetActive(*args
)
7517 def EventLoop_SetActive(*args
, **kwargs
):
7518 """EventLoop_SetActive(EventLoop loop)"""
7519 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7521 class EventLoopActivator(object):
7522 """Proxy of C++ EventLoopActivator class"""
7523 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7524 __repr__
= _swig_repr
7525 def __init__(self
, *args
, **kwargs
):
7526 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7527 _core_
.EventLoopActivator_swiginit(self
,_core_
.new_EventLoopActivator(*args
, **kwargs
))
7528 __swig_destroy__
= _core_
.delete_EventLoopActivator
7529 __del__
= lambda self
: None;
7530 _core_
.EventLoopActivator_swigregister(EventLoopActivator
)
7532 #---------------------------------------------------------------------------
7534 ACCEL_ALT
= _core_
.ACCEL_ALT
7535 ACCEL_CTRL
= _core_
.ACCEL_CTRL
7536 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
7537 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
7538 ACCEL_CMD
= _core_
.ACCEL_CMD
7539 class AcceleratorEntry(object):
7541 A class used to define items in an `wx.AcceleratorTable`. wxPython
7542 programs can choose to use wx.AcceleratorEntry objects, but using a
7543 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7544 as well. See `__init__` for of the tuple values.
7546 :see: `wx.AcceleratorTable`
7548 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7549 __repr__
= _swig_repr
7550 def __init__(self
, *args
, **kwargs
):
7552 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7554 Construct a wx.AcceleratorEntry.
7556 _core_
.AcceleratorEntry_swiginit(self
,_core_
.new_AcceleratorEntry(*args
, **kwargs
))
7557 __swig_destroy__
= _core_
.delete_AcceleratorEntry
7558 __del__
= lambda self
: None;
7559 def Set(*args
, **kwargs
):
7561 Set(self, int flags, int keyCode, int cmd)
7563 (Re)set the attributes of a wx.AcceleratorEntry.
7566 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
7568 def Create(*args
, **kwargs
):
7570 Create(String str) -> AcceleratorEntry
7572 Create accelerator corresponding to the specified string, or None if
7573 it coulnd't be parsed.
7575 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
7577 Create
= staticmethod(Create
)
7578 def GetFlags(*args
, **kwargs
):
7580 GetFlags(self) -> int
7582 Get the AcceleratorEntry's flags.
7584 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
7586 def GetKeyCode(*args
, **kwargs
):
7588 GetKeyCode(self) -> int
7590 Get the AcceleratorEntry's keycode.
7592 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
7594 def GetCommand(*args
, **kwargs
):
7596 GetCommand(self) -> int
7598 Get the AcceleratorEntry's command ID.
7600 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
7602 def IsOk(*args
, **kwargs
):
7603 """IsOk(self) -> bool"""
7604 return _core_
.AcceleratorEntry_IsOk(*args
, **kwargs
)
7606 def ToString(*args
, **kwargs
):
7608 ToString(self) -> String
7610 Returns a string representation for the this accelerator. The string
7611 is formatted using the <flags>-<keycode> format where <flags> maybe a
7612 hyphen-separed list of "shift|alt|ctrl"
7615 return _core_
.AcceleratorEntry_ToString(*args
, **kwargs
)
7617 def FromString(*args
, **kwargs
):
7619 FromString(self, String str) -> bool
7621 Returns true if the given string correctly initialized this object.
7623 return _core_
.AcceleratorEntry_FromString(*args
, **kwargs
)
7625 Command
= property(GetCommand
,doc
="See `GetCommand`")
7626 Flags
= property(GetFlags
,doc
="See `GetFlags`")
7627 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
7628 _core_
.AcceleratorEntry_swigregister(AcceleratorEntry
)
7630 def AcceleratorEntry_Create(*args
, **kwargs
):
7632 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7634 Create accelerator corresponding to the specified string, or None if
7635 it coulnd't be parsed.
7637 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
7639 class AcceleratorTable(Object
):
7641 An accelerator table allows the application to specify a table of
7642 keyboard shortcuts for menus or other commands. On Windows, menu or
7643 button commands are supported; on GTK, only menu commands are
7646 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7647 __repr__
= _swig_repr
7648 def __init__(self
, *args
, **kwargs
):
7650 __init__(entries) -> AcceleratorTable
7652 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7653 items or or of 3-tuples (flags, keyCode, cmdID)
7655 :see: `wx.AcceleratorEntry`
7657 _core_
.AcceleratorTable_swiginit(self
,_core_
.new_AcceleratorTable(*args
, **kwargs
))
7658 __swig_destroy__
= _core_
.delete_AcceleratorTable
7659 __del__
= lambda self
: None;
7660 def Ok(*args
, **kwargs
):
7661 """Ok(self) -> bool"""
7662 return _core_
.AcceleratorTable_Ok(*args
, **kwargs
)
7664 _core_
.AcceleratorTable_swigregister(AcceleratorTable
)
7667 def GetAccelFromString(*args
, **kwargs
):
7668 """GetAccelFromString(String label) -> AcceleratorEntry"""
7669 return _core_
.GetAccelFromString(*args
, **kwargs
)
7670 #---------------------------------------------------------------------------
7672 class VisualAttributes(object):
7673 """struct containing all the visual attributes of a control"""
7674 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7675 __repr__
= _swig_repr
7676 def __init__(self
, *args
, **kwargs
):
7678 __init__(self) -> VisualAttributes
7680 struct containing all the visual attributes of a control
7682 _core_
.VisualAttributes_swiginit(self
,_core_
.new_VisualAttributes(*args
, **kwargs
))
7683 __swig_destroy__
= _core_
.delete_VisualAttributes
7684 __del__
= lambda self
: None;
7685 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
7686 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
7687 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
7688 _core_
.VisualAttributes_swigregister(VisualAttributes
)
7689 NullAcceleratorTable
= cvar
.NullAcceleratorTable
7690 PanelNameStr
= cvar
.PanelNameStr
7692 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
7693 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
7694 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
7695 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
7696 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
7697 class Window(EvtHandler
):
7699 wx.Window is the base class for all windows and represents any visible
7700 object on the screen. All controls, top level windows and so on are
7701 wx.Windows. Sizers and device contexts are not however, as they don't
7702 appear on screen themselves.
7705 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7706 __repr__
= _swig_repr
7707 def __init__(self
, *args
, **kwargs
):
7709 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7710 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7712 Construct and show a generic Window.
7714 _core_
.Window_swiginit(self
,_core_
.new_Window(*args
, **kwargs
))
7715 self
._setOORInfo
(self
)
7717 def Create(*args
, **kwargs
):
7719 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7720 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7722 Create the GUI part of the Window for 2-phase creation mode.
7724 return _core_
.Window_Create(*args
, **kwargs
)
7726 def Close(*args
, **kwargs
):
7728 Close(self, bool force=False) -> bool
7730 This function simply generates a EVT_CLOSE event whose handler usually
7731 tries to close the window. It doesn't close the window itself,
7732 however. If force is False (the default) then the window's close
7733 handler will be allowed to veto the destruction of the window.
7735 return _core_
.Window_Close(*args
, **kwargs
)
7737 def Destroy(*args
, **kwargs
):
7739 Destroy(self) -> bool
7741 Destroys the window safely. Frames and dialogs are not destroyed
7742 immediately when this function is called -- they are added to a list
7743 of windows to be deleted on idle time, when all the window's events
7744 have been processed. This prevents problems with events being sent to
7745 non-existent windows.
7747 Returns True if the window has either been successfully deleted, or it
7748 has been added to the list of windows pending real deletion.
7750 val
= _core_
.Window_Destroy(*args
, **kwargs
)
7754 def DestroyChildren(*args
, **kwargs
):
7756 DestroyChildren(self) -> bool
7758 Destroys all children of a window. Called automatically by the
7761 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
7763 def IsBeingDeleted(*args
, **kwargs
):
7765 IsBeingDeleted(self) -> bool
7767 Is the window in the process of being deleted?
7769 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
7771 def SetLabel(*args
, **kwargs
):
7773 SetLabel(self, String label)
7775 Set the text which the window shows in its label if applicable.
7777 return _core_
.Window_SetLabel(*args
, **kwargs
)
7779 def GetLabel(*args
, **kwargs
):
7781 GetLabel(self) -> String
7783 Generic way of getting a label from any window, for identification
7784 purposes. The interpretation of this function differs from class to
7785 class. For frames and dialogs, the value returned is the title. For
7786 buttons or static text controls, it is the button text. This function
7787 can be useful for meta-programs such as testing tools or special-needs
7788 access programs)which need to identify windows by name.
7790 return _core_
.Window_GetLabel(*args
, **kwargs
)
7792 def SetName(*args
, **kwargs
):
7794 SetName(self, String name)
7796 Sets the window's name. The window name is used for ressource setting
7797 in X, it is not the same as the window title/label
7799 return _core_
.Window_SetName(*args
, **kwargs
)
7801 def GetName(*args
, **kwargs
):
7803 GetName(self) -> String
7805 Returns the windows name. This name is not guaranteed to be unique;
7806 it is up to the programmer to supply an appropriate name in the window
7807 constructor or via wx.Window.SetName.
7809 return _core_
.Window_GetName(*args
, **kwargs
)
7811 def SetWindowVariant(*args
, **kwargs
):
7813 SetWindowVariant(self, int variant)
7815 Sets the variant of the window/font size to use for this window, if
7816 the platform supports variants, for example, wxMac.
7818 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
7820 def GetWindowVariant(*args
, **kwargs
):
7821 """GetWindowVariant(self) -> int"""
7822 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
7824 def SetId(*args
, **kwargs
):
7826 SetId(self, int winid)
7828 Sets the identifier of the window. Each window has an integer
7829 identifier. If the application has not provided one, an identifier
7830 will be generated. Normally, the identifier should be provided on
7831 creation and should not be modified subsequently.
7833 return _core_
.Window_SetId(*args
, **kwargs
)
7835 def GetId(*args
, **kwargs
):
7839 Returns the identifier of the window. Each window has an integer
7840 identifier. If the application has not provided one (or the default Id
7841 -1 is used) then an unique identifier with a negative value will be
7844 return _core_
.Window_GetId(*args
, **kwargs
)
7846 def NewControlId(*args
, **kwargs
):
7848 NewControlId() -> int
7850 Generate a control id for the controls which were not given one.
7852 return _core_
.Window_NewControlId(*args
, **kwargs
)
7854 NewControlId
= staticmethod(NewControlId
)
7855 def NextControlId(*args
, **kwargs
):
7857 NextControlId(int winid) -> int
7859 Get the id of the control following the one with the given
7862 return _core_
.Window_NextControlId(*args
, **kwargs
)
7864 NextControlId
= staticmethod(NextControlId
)
7865 def PrevControlId(*args
, **kwargs
):
7867 PrevControlId(int winid) -> int
7869 Get the id of the control preceding the one with the given
7872 return _core_
.Window_PrevControlId(*args
, **kwargs
)
7874 PrevControlId
= staticmethod(PrevControlId
)
7875 def GetLayoutDirection(*args
, **kwargs
):
7877 GetLayoutDirection(self) -> wxLayoutDirection
7879 Get the layout direction (LTR or RTL) for this window. Returns
7880 ``wx.Layout_Default`` if layout direction is not supported.
7882 return _core_
.Window_GetLayoutDirection(*args
, **kwargs
)
7884 def SetLayoutDirection(*args
, **kwargs
):
7886 SetLayoutDirection(self, wxLayoutDirection dir)
7888 Set the layout direction (LTR or RTL) for this window.
7890 return _core_
.Window_SetLayoutDirection(*args
, **kwargs
)
7892 def AdjustForLayoutDirection(*args
, **kwargs
):
7894 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
7896 Mirror coordinates for RTL layout if this window uses it and if the
7897 mirroring is not done automatically like Win32.
7899 return _core_
.Window_AdjustForLayoutDirection(*args
, **kwargs
)
7901 def SetSize(*args
, **kwargs
):
7903 SetSize(self, Size size)
7905 Sets the size of the window in pixels.
7907 return _core_
.Window_SetSize(*args
, **kwargs
)
7909 def SetDimensions(*args
, **kwargs
):
7911 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7913 Sets the position and size of the window in pixels. The sizeFlags
7914 parameter indicates the interpretation of the other params if they are
7917 ======================== ======================================
7918 wx.SIZE_AUTO A -1 indicates that a class-specific
7919 default should be used.
7920 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7921 -1 values are supplied.
7922 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7923 interpreted as real dimensions, not
7925 ======================== ======================================
7928 return _core_
.Window_SetDimensions(*args
, **kwargs
)
7930 def SetRect(*args
, **kwargs
):
7932 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7934 Sets the position and size of the window in pixels using a wx.Rect.
7936 return _core_
.Window_SetRect(*args
, **kwargs
)
7938 def SetSizeWH(*args
, **kwargs
):
7940 SetSizeWH(self, int width, int height)
7942 Sets the size of the window in pixels.
7944 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
7946 def Move(*args
, **kwargs
):
7948 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7950 Moves the window to the given position.
7952 return _core_
.Window_Move(*args
, **kwargs
)
7955 def MoveXY(*args
, **kwargs
):
7957 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7959 Moves the window to the given position.
7961 return _core_
.Window_MoveXY(*args
, **kwargs
)
7963 def SetBestFittingSize(*args
, **kwargs
):
7965 SetBestFittingSize(self, Size size=DefaultSize)
7967 A 'Smart' SetSize that will fill in default size components with the
7968 window's *best size* values. Also set's the minsize for use with sizers.
7970 return _core_
.Window_SetBestFittingSize(*args
, **kwargs
)
7972 def Raise(*args
, **kwargs
):
7976 Raises the window to the top of the window hierarchy. In current
7977 version of wxWidgets this works both for manage and child windows.
7979 return _core_
.Window_Raise(*args
, **kwargs
)
7981 def Lower(*args
, **kwargs
):
7985 Lowers the window to the bottom of the window hierarchy. In current
7986 version of wxWidgets this works both for manage and child windows.
7988 return _core_
.Window_Lower(*args
, **kwargs
)
7990 def SetClientSize(*args
, **kwargs
):
7992 SetClientSize(self, Size size)
7994 This sets the size of the window client area in pixels. Using this
7995 function to size a window tends to be more device-independent than
7996 wx.Window.SetSize, since the application need not worry about what
7997 dimensions the border or title bar have when trying to fit the window
7998 around panel items, for example.
8000 return _core_
.Window_SetClientSize(*args
, **kwargs
)
8002 def SetClientSizeWH(*args
, **kwargs
):
8004 SetClientSizeWH(self, int width, int height)
8006 This sets the size of the window client area in pixels. Using this
8007 function to size a window tends to be more device-independent than
8008 wx.Window.SetSize, since the application need not worry about what
8009 dimensions the border or title bar have when trying to fit the window
8010 around panel items, for example.
8012 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
8014 def SetClientRect(*args
, **kwargs
):
8016 SetClientRect(self, Rect rect)
8018 This sets the size of the window client area in pixels. Using this
8019 function to size a window tends to be more device-independent than
8020 wx.Window.SetSize, since the application need not worry about what
8021 dimensions the border or title bar have when trying to fit the window
8022 around panel items, for example.
8024 return _core_
.Window_SetClientRect(*args
, **kwargs
)
8026 def GetPosition(*args
, **kwargs
):
8028 GetPosition(self) -> Point
8030 Get the window's position. Notice that the position is in client
8031 coordinates for child windows and screen coordinates for the top level
8032 ones, use `GetScreenPosition` if you need screen coordinates for all
8035 return _core_
.Window_GetPosition(*args
, **kwargs
)
8037 def GetPositionTuple(*args
, **kwargs
):
8039 GetPositionTuple() -> (x,y)
8041 Get the window's position. Notice that the position is in client
8042 coordinates for child windows and screen coordinates for the top level
8043 ones, use `GetScreenPosition` if you need screen coordinates for all
8046 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
8048 def GetScreenPosition(*args
, **kwargs
):
8050 GetScreenPosition(self) -> Point
8052 Get the position of the window in screen coordinantes.
8054 return _core_
.Window_GetScreenPosition(*args
, **kwargs
)
8056 def GetScreenPositionTuple(*args
, **kwargs
):
8058 GetScreenPositionTuple() -> (x,y)
8060 Get the position of the window in screen coordinantes.
8062 return _core_
.Window_GetScreenPositionTuple(*args
, **kwargs
)
8064 def GetScreenRect(*args
, **kwargs
):
8066 GetScreenRect(self) -> Rect
8068 Returns the size and position of the window in screen coordinantes as
8071 return _core_
.Window_GetScreenRect(*args
, **kwargs
)
8073 def GetSize(*args
, **kwargs
):
8075 GetSize(self) -> Size
8077 Get the window size.
8079 return _core_
.Window_GetSize(*args
, **kwargs
)
8081 def GetSizeTuple(*args
, **kwargs
):
8083 GetSizeTuple() -> (width, height)
8085 Get the window size.
8087 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
8089 def GetRect(*args
, **kwargs
):
8091 GetRect(self) -> Rect
8093 Returns the size and position of the window as a `wx.Rect` object.
8095 return _core_
.Window_GetRect(*args
, **kwargs
)
8097 def GetClientSize(*args
, **kwargs
):
8099 GetClientSize(self) -> Size
8101 This gets the size of the window's 'client area' in pixels. The client
8102 area is the area which may be drawn on by the programmer, excluding
8103 title bar, border, scrollbars, etc.
8105 return _core_
.Window_GetClientSize(*args
, **kwargs
)
8107 def GetClientSizeTuple(*args
, **kwargs
):
8109 GetClientSizeTuple() -> (width, height)
8111 This gets the size of the window's 'client area' in pixels. The client
8112 area is the area which may be drawn on by the programmer, excluding
8113 title bar, border, scrollbars, etc.
8115 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
8117 def GetClientAreaOrigin(*args
, **kwargs
):
8119 GetClientAreaOrigin(self) -> Point
8121 Get the origin of the client area of the window relative to the
8122 window's top left corner (the client area may be shifted because of
8123 the borders, scrollbars, other decorations...)
8125 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
8127 def GetClientRect(*args
, **kwargs
):
8129 GetClientRect(self) -> Rect
8131 Get the client area position and size as a `wx.Rect` object.
8133 return _core_
.Window_GetClientRect(*args
, **kwargs
)
8135 def GetBestSize(*args
, **kwargs
):
8137 GetBestSize(self) -> Size
8139 This function returns the best acceptable minimal size for the
8140 window, if applicable. For example, for a static text control, it will
8141 be the minimal size such that the control label is not truncated. For
8142 windows containing subwindows (suzh aswx.Panel), the size returned by
8143 this function will be the same as the size the window would have had
8146 return _core_
.Window_GetBestSize(*args
, **kwargs
)
8148 def GetBestSizeTuple(*args
, **kwargs
):
8150 GetBestSizeTuple() -> (width, height)
8152 This function returns the best acceptable minimal size for the
8153 window, if applicable. For example, for a static text control, it will
8154 be the minimal size such that the control label is not truncated. For
8155 windows containing subwindows (suzh aswx.Panel), the size returned by
8156 this function will be the same as the size the window would have had
8159 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
8161 def InvalidateBestSize(*args
, **kwargs
):
8163 InvalidateBestSize(self)
8165 Reset the cached best size value so it will be recalculated the next
8168 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
8170 def CacheBestSize(*args
, **kwargs
):
8172 CacheBestSize(self, Size size)
8174 Cache the best size so it doesn't need to be calculated again, (at least until
8175 some properties of the window change.)
8177 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
8179 def GetBestFittingSize(*args
, **kwargs
):
8181 GetBestFittingSize(self) -> Size
8183 This function will merge the window's best size into the window's
8184 minimum size, giving priority to the min size components, and returns
8188 return _core_
.Window_GetBestFittingSize(*args
, **kwargs
)
8190 def GetAdjustedBestSize(*args
, **kwargs
):
8192 GetAdjustedBestSize(self) -> Size
8194 This method is similar to GetBestSize, except in one
8195 thing. GetBestSize should return the minimum untruncated size of the
8196 window, while this method will return the largest of BestSize and any
8197 user specified minimum size. ie. it is the minimum size the window
8198 should currently be drawn at, not the minimal size it can possibly
8201 return _core_
.Window_GetAdjustedBestSize(*args
, **kwargs
)
8203 def Center(*args
, **kwargs
):
8205 Center(self, int direction=BOTH)
8207 Centers the window. The parameter specifies the direction for
8208 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8209 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8210 on the entire screen and not on its parent window. If it is a
8211 top-level window and has no parent then it will always be centered
8212 relative to the screen.
8214 return _core_
.Window_Center(*args
, **kwargs
)
8217 def CenterOnParent(*args
, **kwargs
):
8219 CenterOnParent(self, int dir=BOTH)
8221 Center with respect to the the parent window
8223 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
8225 CentreOnParent
= CenterOnParent
8226 def Fit(*args
, **kwargs
):
8230 Sizes the window so that it fits around its subwindows. This function
8231 won't do anything if there are no subwindows and will only really work
8232 correctly if sizers are used for the subwindows layout. Also, if the
8233 window has exactly one subwindow it is better (faster and the result
8234 is more precise as Fit adds some margin to account for fuzziness of
8235 its calculations) to call window.SetClientSize(child.GetSize())
8236 instead of calling Fit.
8238 return _core_
.Window_Fit(*args
, **kwargs
)
8240 def FitInside(*args
, **kwargs
):
8244 Similar to Fit, but sizes the interior (virtual) size of a
8245 window. Mainly useful with scrolled windows to reset scrollbars after
8246 sizing changes that do not trigger a size event, and/or scrolled
8247 windows without an interior sizer. This function similarly won't do
8248 anything if there are no subwindows.
8250 return _core_
.Window_FitInside(*args
, **kwargs
)
8252 def SetSizeHints(*args
, **kwargs
):
8254 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8257 Allows specification of minimum and maximum window sizes, and window
8258 size increments. If a pair of values is not set (or set to -1), the
8259 default values will be used. If this function is called, the user
8260 will not be able to size the window outside the given bounds (if it is
8261 a top-level window.) Sizers will also inspect the minimum window size
8262 and will use that value if set when calculating layout.
8264 The resizing increments are only significant under Motif or Xt.
8266 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
8268 def SetSizeHintsSz(*args
, **kwargs
):
8270 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8272 Allows specification of minimum and maximum window sizes, and window
8273 size increments. If a pair of values is not set (or set to -1), the
8274 default values will be used. If this function is called, the user
8275 will not be able to size the window outside the given bounds (if it is
8276 a top-level window.) Sizers will also inspect the minimum window size
8277 and will use that value if set when calculating layout.
8279 The resizing increments are only significant under Motif or Xt.
8281 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
8283 def SetVirtualSizeHints(*args
, **kwargs
):
8285 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8287 Allows specification of minimum and maximum virtual window sizes. If a
8288 pair of values is not set (or set to -1), the default values will be
8289 used. If this function is called, the user will not be able to size
8290 the virtual area of the window outside the given bounds.
8292 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
8294 def SetVirtualSizeHintsSz(*args
, **kwargs
):
8296 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8298 Allows specification of minimum and maximum virtual window sizes. If a
8299 pair of values is not set (or set to -1), the default values will be
8300 used. If this function is called, the user will not be able to size
8301 the virtual area of the window outside the given bounds.
8303 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
8305 def GetMaxSize(*args
, **kwargs
):
8306 """GetMaxSize(self) -> Size"""
8307 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8309 def GetMinSize(*args
, **kwargs
):
8310 """GetMinSize(self) -> Size"""
8311 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8313 def SetMinSize(*args
, **kwargs
):
8315 SetMinSize(self, Size minSize)
8317 A more convenient method than `SetSizeHints` for setting just the
8320 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8322 def SetMaxSize(*args
, **kwargs
):
8324 SetMaxSize(self, Size maxSize)
8326 A more convenient method than `SetSizeHints` for setting just the
8329 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8331 def GetMinWidth(*args
, **kwargs
):
8332 """GetMinWidth(self) -> int"""
8333 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8335 def GetMinHeight(*args
, **kwargs
):
8336 """GetMinHeight(self) -> int"""
8337 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8339 def GetMaxWidth(*args
, **kwargs
):
8340 """GetMaxWidth(self) -> int"""
8341 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8343 def GetMaxHeight(*args
, **kwargs
):
8344 """GetMaxHeight(self) -> int"""
8345 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8347 def SetVirtualSize(*args
, **kwargs
):
8349 SetVirtualSize(self, Size size)
8351 Set the the virtual size of a window in pixels. For most windows this
8352 is just the client area of the window, but for some like scrolled
8353 windows it is more or less independent of the screen window size.
8355 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8357 def SetVirtualSizeWH(*args
, **kwargs
):
8359 SetVirtualSizeWH(self, int w, int h)
8361 Set the the virtual size of a window in pixels. For most windows this
8362 is just the client area of the window, but for some like scrolled
8363 windows it is more or less independent of the screen window size.
8365 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8367 def GetVirtualSize(*args
, **kwargs
):
8369 GetVirtualSize(self) -> Size
8371 Get the the virtual size of the window in pixels. For most windows
8372 this is just the client area of the window, but for some like scrolled
8373 windows it is more or less independent of the screen window size.
8375 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8377 def GetVirtualSizeTuple(*args
, **kwargs
):
8379 GetVirtualSizeTuple() -> (width, height)
8381 Get the the virtual size of the window in pixels. For most windows
8382 this is just the client area of the window, but for some like scrolled
8383 windows it is more or less independent of the screen window size.
8385 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8387 def GetBestVirtualSize(*args
, **kwargs
):
8389 GetBestVirtualSize(self) -> Size
8391 Return the largest of ClientSize and BestSize (as determined by a
8392 sizer, interior children, or other means)
8394 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8396 def Show(*args
, **kwargs
):
8398 Show(self, bool show=True) -> bool
8400 Shows or hides the window. You may need to call Raise for a top level
8401 window if you want to bring it to top, although this is not needed if
8402 Show is called immediately after the frame creation. Returns True if
8403 the window has been shown or hidden or False if nothing was done
8404 because it already was in the requested state.
8406 return _core_
.Window_Show(*args
, **kwargs
)
8408 def Hide(*args
, **kwargs
):
8412 Equivalent to calling Show(False).
8414 return _core_
.Window_Hide(*args
, **kwargs
)
8416 def Enable(*args
, **kwargs
):
8418 Enable(self, bool enable=True) -> bool
8420 Enable or disable the window for user input. Note that when a parent
8421 window is disabled, all of its children are disabled as well and they
8422 are reenabled again when the parent is. Returns true if the window
8423 has been enabled or disabled, false if nothing was done, i.e. if the
8424 window had already been in the specified state.
8426 return _core_
.Window_Enable(*args
, **kwargs
)
8428 def Disable(*args
, **kwargs
):
8430 Disable(self) -> bool
8432 Disables the window, same as Enable(false).
8434 return _core_
.Window_Disable(*args
, **kwargs
)
8436 def IsShown(*args
, **kwargs
):
8438 IsShown(self) -> bool
8440 Returns true if the window is shown, false if it has been hidden.
8442 return _core_
.Window_IsShown(*args
, **kwargs
)
8444 def IsEnabled(*args
, **kwargs
):
8446 IsEnabled(self) -> bool
8448 Returns true if the window is enabled for input, false otherwise.
8450 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8452 def SetWindowStyleFlag(*args
, **kwargs
):
8454 SetWindowStyleFlag(self, long style)
8456 Sets the style of the window. Please note that some styles cannot be
8457 changed after the window creation and that Refresh() might need to be
8458 called after changing the others for the change to take place
8461 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8463 def GetWindowStyleFlag(*args
, **kwargs
):
8465 GetWindowStyleFlag(self) -> long
8467 Gets the window style that was passed to the constructor or Create
8470 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8472 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8473 def HasFlag(*args
, **kwargs
):
8475 HasFlag(self, int flag) -> bool
8477 Test if the given style is set for this window.
8479 return _core_
.Window_HasFlag(*args
, **kwargs
)
8481 def IsRetained(*args
, **kwargs
):
8483 IsRetained(self) -> bool
8485 Returns true if the window is retained, false otherwise. Retained
8486 windows are only available on X platforms.
8488 return _core_
.Window_IsRetained(*args
, **kwargs
)
8490 def SetExtraStyle(*args
, **kwargs
):
8492 SetExtraStyle(self, long exStyle)
8494 Sets the extra style bits for the window. Extra styles are the less
8495 often used style bits which can't be set with the constructor or with
8496 SetWindowStyleFlag()
8498 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8500 def GetExtraStyle(*args
, **kwargs
):
8502 GetExtraStyle(self) -> long
8504 Returns the extra style bits for the window.
8506 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
8508 def MakeModal(*args
, **kwargs
):
8510 MakeModal(self, bool modal=True)
8512 Disables all other windows in the application so that the user can
8513 only interact with this window. Passing False will reverse this
8516 return _core_
.Window_MakeModal(*args
, **kwargs
)
8518 def SetThemeEnabled(*args
, **kwargs
):
8520 SetThemeEnabled(self, bool enableTheme)
8522 This function tells a window if it should use the system's "theme"
8523 code to draw the windows' background instead if its own background
8524 drawing code. This will only have an effect on platforms that support
8525 the notion of themes in user defined windows. One such platform is
8526 GTK+ where windows can have (very colourful) backgrounds defined by a
8527 user's selected theme.
8529 Dialogs, notebook pages and the status bar have this flag set to true
8530 by default so that the default look and feel is simulated best.
8532 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
8534 def GetThemeEnabled(*args
, **kwargs
):
8536 GetThemeEnabled(self) -> bool
8538 Return the themeEnabled flag.
8540 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
8542 def SetFocus(*args
, **kwargs
):
8546 Set's the focus to this window, allowing it to receive keyboard input.
8548 return _core_
.Window_SetFocus(*args
, **kwargs
)
8550 def SetFocusFromKbd(*args
, **kwargs
):
8552 SetFocusFromKbd(self)
8554 Set focus to this window as the result of a keyboard action. Normally
8555 only called internally.
8557 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
8559 def FindFocus(*args
, **kwargs
):
8561 FindFocus() -> Window
8563 Returns the window or control that currently has the keyboard focus,
8566 return _core_
.Window_FindFocus(*args
, **kwargs
)
8568 FindFocus
= staticmethod(FindFocus
)
8569 def AcceptsFocus(*args
, **kwargs
):
8571 AcceptsFocus(self) -> bool
8573 Can this window have focus?
8575 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
8577 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
8579 AcceptsFocusFromKeyboard(self) -> bool
8581 Can this window be given focus by keyboard navigation? if not, the
8582 only way to give it focus (provided it accepts it at all) is to click
8585 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
8587 def Navigate(*args
, **kwargs
):
8589 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8591 Does keyboard navigation from this window to another, by sending a
8592 `wx.NavigationKeyEvent`.
8594 return _core_
.Window_Navigate(*args
, **kwargs
)
8596 def MoveAfterInTabOrder(*args
, **kwargs
):
8598 MoveAfterInTabOrder(self, Window win)
8600 Moves this window in the tab navigation order after the specified
8601 sibling window. This means that when the user presses the TAB key on
8602 that other window, the focus switches to this window.
8604 The default tab order is the same as creation order. This function
8605 and `MoveBeforeInTabOrder` allow to change it after creating all the
8609 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
8611 def MoveBeforeInTabOrder(*args
, **kwargs
):
8613 MoveBeforeInTabOrder(self, Window win)
8615 Same as `MoveAfterInTabOrder` except that it inserts this window just
8616 before win instead of putting it right after it.
8618 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
8620 def GetChildren(*args
, **kwargs
):
8622 GetChildren(self) -> PyObject
8624 Returns a list of the window's children. NOTE: Currently this is a
8625 copy of the child window list maintained by the window, so the return
8626 value of this function is only valid as long as the window's children
8629 return _core_
.Window_GetChildren(*args
, **kwargs
)
8631 def GetParent(*args
, **kwargs
):
8633 GetParent(self) -> Window
8635 Returns the parent window of this window, or None if there isn't one.
8637 return _core_
.Window_GetParent(*args
, **kwargs
)
8639 def GetGrandParent(*args
, **kwargs
):
8641 GetGrandParent(self) -> Window
8643 Returns the parent of the parent of this window, or None if there
8646 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
8648 def IsTopLevel(*args
, **kwargs
):
8650 IsTopLevel(self) -> bool
8652 Returns true if the given window is a top-level one. Currently all
8653 frames and dialogs are always considered to be top-level windows (even
8654 if they have a parent window).
8656 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
8658 def Reparent(*args
, **kwargs
):
8660 Reparent(self, Window newParent) -> bool
8662 Reparents the window, i.e the window will be removed from its current
8663 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8664 re-inserted into another. Available on Windows and GTK. Returns True
8665 if the parent was changed, False otherwise (error or newParent ==
8668 return _core_
.Window_Reparent(*args
, **kwargs
)
8670 def AddChild(*args
, **kwargs
):
8672 AddChild(self, Window child)
8674 Adds a child window. This is called automatically by window creation
8675 functions so should not be required by the application programmer.
8677 return _core_
.Window_AddChild(*args
, **kwargs
)
8679 def RemoveChild(*args
, **kwargs
):
8681 RemoveChild(self, Window child)
8683 Removes a child window. This is called automatically by window
8684 deletion functions so should not be required by the application
8687 return _core_
.Window_RemoveChild(*args
, **kwargs
)
8689 def SetDoubleBuffered(*args
, **kwargs
):
8691 SetDoubleBuffered(self, bool on)
8693 Currently wxGTK2 only.
8695 return _core_
.Window_SetDoubleBuffered(*args
, **kwargs
)
8697 def FindWindowById(*args
, **kwargs
):
8699 FindWindowById(self, long winid) -> Window
8701 Find a chld of this window by window ID
8703 return _core_
.Window_FindWindowById(*args
, **kwargs
)
8705 def FindWindowByName(*args
, **kwargs
):
8707 FindWindowByName(self, String name) -> Window
8709 Find a child of this window by name
8711 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
8713 def GetEventHandler(*args
, **kwargs
):
8715 GetEventHandler(self) -> EvtHandler
8717 Returns the event handler for this window. By default, the window is
8718 its own event handler.
8720 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
8722 def SetEventHandler(*args
, **kwargs
):
8724 SetEventHandler(self, EvtHandler handler)
8726 Sets the event handler for this window. An event handler is an object
8727 that is capable of processing the events sent to a window. By default,
8728 the window is its own event handler, but an application may wish to
8729 substitute another, for example to allow central implementation of
8730 event-handling for a variety of different window classes.
8732 It is usually better to use `wx.Window.PushEventHandler` since this sets
8733 up a chain of event handlers, where an event not handled by one event
8734 handler is handed to the next one in the chain.
8736 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
8738 def PushEventHandler(*args
, **kwargs
):
8740 PushEventHandler(self, EvtHandler handler)
8742 Pushes this event handler onto the event handler stack for the window.
8743 An event handler is an object that is capable of processing the events
8744 sent to a window. By default, the window is its own event handler, but
8745 an application may wish to substitute another, for example to allow
8746 central implementation of event-handling for a variety of different
8749 wx.Window.PushEventHandler allows an application to set up a chain of
8750 event handlers, where an event not handled by one event handler is
8751 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8752 remove the event handler.
8754 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
8756 def PopEventHandler(*args
, **kwargs
):
8758 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8760 Removes and returns the top-most event handler on the event handler
8761 stack. If deleteHandler is True then the wx.EvtHandler object will be
8762 destroyed after it is popped.
8764 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
8766 def RemoveEventHandler(*args
, **kwargs
):
8768 RemoveEventHandler(self, EvtHandler handler) -> bool
8770 Find the given handler in the event handler chain and remove (but not
8771 delete) it from the event handler chain, return True if it was found
8772 and False otherwise (this also results in an assert failure so this
8773 function should only be called when the handler is supposed to be
8776 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
8778 def SetValidator(*args
, **kwargs
):
8780 SetValidator(self, Validator validator)
8782 Deletes the current validator (if any) and sets the window validator,
8783 having called wx.Validator.Clone to create a new validator of this
8786 return _core_
.Window_SetValidator(*args
, **kwargs
)
8788 def GetValidator(*args
, **kwargs
):
8790 GetValidator(self) -> Validator
8792 Returns a pointer to the current validator for the window, or None if
8795 return _core_
.Window_GetValidator(*args
, **kwargs
)
8797 def Validate(*args
, **kwargs
):
8799 Validate(self) -> bool
8801 Validates the current values of the child controls using their
8802 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8803 style flag set, the method will also call Validate() of all child
8804 windows. Returns false if any of the validations failed.
8806 return _core_
.Window_Validate(*args
, **kwargs
)
8808 def TransferDataToWindow(*args
, **kwargs
):
8810 TransferDataToWindow(self) -> bool
8812 Transfers values to child controls from data areas specified by their
8813 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8814 style flag set, the method will also call TransferDataToWindow() of
8817 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
8819 def TransferDataFromWindow(*args
, **kwargs
):
8821 TransferDataFromWindow(self) -> bool
8823 Transfers values from child controls to data areas specified by their
8824 validators. Returns false if a transfer failed. If the window has
8825 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8826 also call TransferDataFromWindow() of all child windows.
8828 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
8830 def InitDialog(*args
, **kwargs
):
8834 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8835 to the dialog via validators.
8837 return _core_
.Window_InitDialog(*args
, **kwargs
)
8839 def SetAcceleratorTable(*args
, **kwargs
):
8841 SetAcceleratorTable(self, AcceleratorTable accel)
8843 Sets the accelerator table for this window.
8845 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
8847 def GetAcceleratorTable(*args
, **kwargs
):
8849 GetAcceleratorTable(self) -> AcceleratorTable
8851 Gets the accelerator table for this window.
8853 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
8855 def RegisterHotKey(*args
, **kwargs
):
8857 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8859 Registers a system wide hotkey. Every time the user presses the hotkey
8860 registered here, this window will receive a hotkey event. It will
8861 receive the event even if the application is in the background and
8862 does not have the input focus because the user is working with some
8863 other application. To bind an event handler function to this hotkey
8864 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8865 hotkey was registered successfully.
8867 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
8869 def UnregisterHotKey(*args
, **kwargs
):
8871 UnregisterHotKey(self, int hotkeyId) -> bool
8873 Unregisters a system wide hotkey.
8875 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
8877 def ConvertDialogPointToPixels(*args
, **kwargs
):
8879 ConvertDialogPointToPixels(self, Point pt) -> Point
8881 Converts a point or size from dialog units to pixels. Dialog units
8882 are used for maintaining a dialog's proportions even if the font
8883 changes. For the x dimension, the dialog units are multiplied by the
8884 average character width and then divided by 4. For the y dimension,
8885 the dialog units are multiplied by the average character height and
8888 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
8890 def ConvertDialogSizeToPixels(*args
, **kwargs
):
8892 ConvertDialogSizeToPixels(self, Size sz) -> Size
8894 Converts a point or size from dialog units to pixels. Dialog units
8895 are used for maintaining a dialog's proportions even if the font
8896 changes. For the x dimension, the dialog units are multiplied by the
8897 average character width and then divided by 4. For the y dimension,
8898 the dialog units are multiplied by the average character height and
8901 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
8903 def DLG_PNT(*args
, **kwargs
):
8905 DLG_PNT(self, Point pt) -> Point
8907 Converts a point or size from dialog units to pixels. Dialog units
8908 are used for maintaining a dialog's proportions even if the font
8909 changes. For the x dimension, the dialog units are multiplied by the
8910 average character width and then divided by 4. For the y dimension,
8911 the dialog units are multiplied by the average character height and
8914 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
8916 def DLG_SZE(*args
, **kwargs
):
8918 DLG_SZE(self, Size sz) -> Size
8920 Converts a point or size from dialog units to pixels. Dialog units
8921 are used for maintaining a dialog's proportions even if the font
8922 changes. For the x dimension, the dialog units are multiplied by the
8923 average character width and then divided by 4. For the y dimension,
8924 the dialog units are multiplied by the average character height and
8927 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
8929 def ConvertPixelPointToDialog(*args
, **kwargs
):
8930 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8931 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
8933 def ConvertPixelSizeToDialog(*args
, **kwargs
):
8934 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8935 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
8937 def WarpPointer(*args
, **kwargs
):
8939 WarpPointer(self, int x, int y)
8941 Moves the pointer to the given position on the window.
8943 NOTE: This function is not supported under Mac because Apple Human
8944 Interface Guidelines forbid moving the mouse cursor programmatically.
8946 return _core_
.Window_WarpPointer(*args
, **kwargs
)
8948 def CaptureMouse(*args
, **kwargs
):
8952 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8953 release the capture.
8955 Note that wxWindows maintains the stack of windows having captured the
8956 mouse and when the mouse is released the capture returns to the window
8957 which had had captured it previously and it is only really released if
8958 there were no previous window. In particular, this means that you must
8959 release the mouse as many times as you capture it, unless the window
8960 receives the `wx.MouseCaptureLostEvent` event.
8962 Any application which captures the mouse in the beginning of some
8963 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8964 operation when it receives the event. The event handler must not
8967 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
8969 def ReleaseMouse(*args
, **kwargs
):
8973 Releases mouse input captured with wx.Window.CaptureMouse.
8975 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
8977 def GetCapture(*args
, **kwargs
):
8979 GetCapture() -> Window
8981 Returns the window which currently captures the mouse or None
8983 return _core_
.Window_GetCapture(*args
, **kwargs
)
8985 GetCapture
= staticmethod(GetCapture
)
8986 def HasCapture(*args
, **kwargs
):
8988 HasCapture(self) -> bool
8990 Returns true if this window has the current mouse capture.
8992 return _core_
.Window_HasCapture(*args
, **kwargs
)
8994 def Refresh(*args
, **kwargs
):
8996 Refresh(self, bool eraseBackground=True, Rect rect=None)
8998 Mark the specified rectangle (or the whole window) as "dirty" so it
8999 will be repainted. Causes an EVT_PAINT event to be generated and sent
9002 return _core_
.Window_Refresh(*args
, **kwargs
)
9004 def RefreshRect(*args
, **kwargs
):
9006 RefreshRect(self, Rect rect, bool eraseBackground=True)
9008 Redraws the contents of the given rectangle: the area inside it will
9009 be repainted. This is the same as Refresh but has a nicer syntax.
9011 return _core_
.Window_RefreshRect(*args
, **kwargs
)
9013 def Update(*args
, **kwargs
):
9017 Calling this method immediately repaints the invalidated area of the
9018 window instead of waiting for the EVT_PAINT event to happen, (normally
9019 this would usually only happen when the flow of control returns to the
9020 event loop.) Notice that this function doesn't refresh the window and
9021 does nothing if the window has been already repainted. Use Refresh
9022 first if you want to immediately redraw the window (or some portion of
9023 it) unconditionally.
9025 return _core_
.Window_Update(*args
, **kwargs
)
9027 def ClearBackground(*args
, **kwargs
):
9029 ClearBackground(self)
9031 Clears the window by filling it with the current background
9032 colour. Does not cause an erase background event to be generated.
9034 return _core_
.Window_ClearBackground(*args
, **kwargs
)
9036 def Freeze(*args
, **kwargs
):
9040 Freezes the window or, in other words, prevents any updates from
9041 taking place on screen, the window is not redrawn at all. Thaw must be
9042 called to reenable window redrawing. Calls to Freeze/Thaw may be
9043 nested, with the actual Thaw being delayed until all the nesting has
9046 This method is useful for visual appearance optimization (for example,
9047 it is a good idea to use it before inserting large amount of text into
9048 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9049 for all controls so it is mostly just a hint to wxWindows and not a
9050 mandatory directive.
9052 return _core_
.Window_Freeze(*args
, **kwargs
)
9054 def Thaw(*args
, **kwargs
):
9058 Reenables window updating after a previous call to Freeze. Calls to
9059 Freeze/Thaw may be nested, so Thaw must be called the same number of
9060 times that Freeze was before the window will be updated.
9062 return _core_
.Window_Thaw(*args
, **kwargs
)
9064 def PrepareDC(*args
, **kwargs
):
9066 PrepareDC(self, DC dc)
9068 Call this function to prepare the device context for drawing a
9069 scrolled image. It sets the device origin according to the current
9072 return _core_
.Window_PrepareDC(*args
, **kwargs
)
9074 def GetUpdateRegion(*args
, **kwargs
):
9076 GetUpdateRegion(self) -> Region
9078 Returns the region specifying which parts of the window have been
9079 damaged. Should only be called within an EVT_PAINT handler.
9081 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
9083 def GetUpdateClientRect(*args
, **kwargs
):
9085 GetUpdateClientRect(self) -> Rect
9087 Get the update rectangle region bounding box in client coords.
9089 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
9091 def IsExposed(*args
, **kwargs
):
9093 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9095 Returns true if the given point or rectangle area has been exposed
9096 since the last repaint. Call this in an paint event handler to
9097 optimize redrawing by only redrawing those areas, which have been
9100 return _core_
.Window_IsExposed(*args
, **kwargs
)
9102 def IsExposedPoint(*args
, **kwargs
):
9104 IsExposedPoint(self, Point pt) -> bool
9106 Returns true if the given point or rectangle area has been exposed
9107 since the last repaint. Call this in an paint event handler to
9108 optimize redrawing by only redrawing those areas, which have been
9111 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
9113 def IsExposedRect(*args
, **kwargs
):
9115 IsExposedRect(self, Rect rect) -> bool
9117 Returns true if the given point or rectangle area has been exposed
9118 since the last repaint. Call this in an paint event handler to
9119 optimize redrawing by only redrawing those areas, which have been
9122 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
9124 def GetDefaultAttributes(*args
, **kwargs
):
9126 GetDefaultAttributes(self) -> VisualAttributes
9128 Get the default attributes for an instance of this class. This is
9129 useful if you want to use the same font or colour in your own control
9130 as in a standard control -- which is a much better idea than hard
9131 coding specific colours or fonts which might look completely out of
9132 place on the user's system, especially if it uses themes.
9134 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
9136 def GetClassDefaultAttributes(*args
, **kwargs
):
9138 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9140 Get the default attributes for this class. This is useful if you want
9141 to use the same font or colour in your own control as in a standard
9142 control -- which is a much better idea than hard coding specific
9143 colours or fonts which might look completely out of place on the
9144 user's system, especially if it uses themes.
9146 The variant parameter is only relevant under Mac currently and is
9147 ignore under other platforms. Under Mac, it will change the size of
9148 the returned font. See `wx.Window.SetWindowVariant` for more about
9151 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9153 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
9154 def SetBackgroundColour(*args
, **kwargs
):
9156 SetBackgroundColour(self, Colour colour) -> bool
9158 Sets the background colour of the window. Returns True if the colour
9159 was changed. The background colour is usually painted by the default
9160 EVT_ERASE_BACKGROUND event handler function under Windows and
9161 automatically under GTK. Using `wx.NullColour` will reset the window
9162 to the default background colour.
9164 Note that setting the background colour may not cause an immediate
9165 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9166 calling this function.
9168 Using this function will disable attempts to use themes for this
9169 window, if the system supports them. Use with care since usually the
9170 themes represent the appearance chosen by the user to be used for all
9171 applications on the system.
9173 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
9175 def SetOwnBackgroundColour(*args
, **kwargs
):
9176 """SetOwnBackgroundColour(self, Colour colour)"""
9177 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
9179 def SetForegroundColour(*args
, **kwargs
):
9181 SetForegroundColour(self, Colour colour) -> bool
9183 Sets the foreground colour of the window. Returns True is the colour
9184 was changed. The interpretation of foreground colour is dependent on
9185 the window class; it may be the text colour or other colour, or it may
9188 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
9190 def SetOwnForegroundColour(*args
, **kwargs
):
9191 """SetOwnForegroundColour(self, Colour colour)"""
9192 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
9194 def GetBackgroundColour(*args
, **kwargs
):
9196 GetBackgroundColour(self) -> Colour
9198 Returns the background colour of the window.
9200 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
9202 def GetForegroundColour(*args
, **kwargs
):
9204 GetForegroundColour(self) -> Colour
9206 Returns the foreground colour of the window. The interpretation of
9207 foreground colour is dependent on the window class; it may be the text
9208 colour or other colour, or it may not be used at all.
9210 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
9212 def InheritsBackgroundColour(*args
, **kwargs
):
9213 """InheritsBackgroundColour(self) -> bool"""
9214 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
9216 def UseBgCol(*args
, **kwargs
):
9217 """UseBgCol(self) -> bool"""
9218 return _core_
.Window_UseBgCol(*args
, **kwargs
)
9220 def SetBackgroundStyle(*args
, **kwargs
):
9222 SetBackgroundStyle(self, int style) -> bool
9224 Returns the background style of the window. The background style
9225 indicates how the background of the window is drawn.
9227 ====================== ========================================
9228 wx.BG_STYLE_SYSTEM The background colour or pattern should
9229 be determined by the system
9230 wx.BG_STYLE_COLOUR The background should be a solid colour
9231 wx.BG_STYLE_CUSTOM The background will be implemented by the
9233 ====================== ========================================
9235 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9236 a custom background, such as a tiled bitmap. Currently the style has
9237 no effect on other platforms.
9239 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9241 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
9243 def GetBackgroundStyle(*args
, **kwargs
):
9245 GetBackgroundStyle(self) -> int
9247 Returns the background style of the window.
9249 :see: `SetBackgroundStyle`
9251 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
9253 def HasTransparentBackground(*args
, **kwargs
):
9255 HasTransparentBackground(self) -> bool
9257 Returns True if this window's background is transparent (as, for
9258 example, for `wx.StaticText`) and should show the parent window's
9261 This method is mostly used internally by the library itself and you
9262 normally shouldn't have to call it. You may, however, have to override
9263 it in your custom control classes to ensure that background is painted
9266 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
9268 def SetCursor(*args
, **kwargs
):
9270 SetCursor(self, Cursor cursor) -> bool
9272 Sets the window's cursor. Notice that the window cursor also sets it
9273 for the children of the window implicitly.
9275 The cursor may be wx.NullCursor in which case the window cursor will
9276 be reset back to default.
9278 return _core_
.Window_SetCursor(*args
, **kwargs
)
9280 def GetCursor(*args
, **kwargs
):
9282 GetCursor(self) -> Cursor
9284 Return the cursor associated with this window.
9286 return _core_
.Window_GetCursor(*args
, **kwargs
)
9288 def SetFont(*args
, **kwargs
):
9290 SetFont(self, Font font) -> bool
9292 Sets the font for this window.
9294 return _core_
.Window_SetFont(*args
, **kwargs
)
9296 def SetOwnFont(*args
, **kwargs
):
9297 """SetOwnFont(self, Font font)"""
9298 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9300 def GetFont(*args
, **kwargs
):
9302 GetFont(self) -> Font
9304 Returns the default font used for this window.
9306 return _core_
.Window_GetFont(*args
, **kwargs
)
9308 def SetCaret(*args
, **kwargs
):
9310 SetCaret(self, Caret caret)
9312 Sets the caret associated with the window.
9314 return _core_
.Window_SetCaret(*args
, **kwargs
)
9316 def GetCaret(*args
, **kwargs
):
9318 GetCaret(self) -> Caret
9320 Returns the caret associated with the window.
9322 return _core_
.Window_GetCaret(*args
, **kwargs
)
9324 def GetCharHeight(*args
, **kwargs
):
9326 GetCharHeight(self) -> int
9328 Get the (average) character size for the current font.
9330 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9332 def GetCharWidth(*args
, **kwargs
):
9334 GetCharWidth(self) -> int
9336 Get the (average) character size for the current font.
9338 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9340 def GetTextExtent(*args
, **kwargs
):
9342 GetTextExtent(String string) -> (width, height)
9344 Get the width and height of the text using the current font.
9346 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9348 def GetFullTextExtent(*args
, **kwargs
):
9350 GetFullTextExtent(String string, Font font=None) ->
9351 (width, height, descent, externalLeading)
9353 Get the width, height, decent and leading of the text using the
9354 current or specified font.
9356 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9358 def ClientToScreenXY(*args
, **kwargs
):
9360 ClientToScreenXY(int x, int y) -> (x,y)
9362 Converts to screen coordinates from coordinates relative to this window.
9364 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9366 def ScreenToClientXY(*args
, **kwargs
):
9368 ScreenToClientXY(int x, int y) -> (x,y)
9370 Converts from screen to client window coordinates.
9372 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9374 def ClientToScreen(*args
, **kwargs
):
9376 ClientToScreen(self, Point pt) -> Point
9378 Converts to screen coordinates from coordinates relative to this window.
9380 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9382 def ScreenToClient(*args
, **kwargs
):
9384 ScreenToClient(self, Point pt) -> Point
9386 Converts from screen to client window coordinates.
9388 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9390 def HitTestXY(*args
, **kwargs
):
9392 HitTestXY(self, int x, int y) -> int
9394 Test where the given (in client coords) point lies
9396 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9398 def HitTest(*args
, **kwargs
):
9400 HitTest(self, Point pt) -> int
9402 Test where the given (in client coords) point lies
9404 return _core_
.Window_HitTest(*args
, **kwargs
)
9406 def GetBorder(*args
):
9408 GetBorder(self, long flags) -> int
9409 GetBorder(self) -> int
9411 Get border for the flags of this window
9413 return _core_
.Window_GetBorder(*args
)
9415 def UpdateWindowUI(*args
, **kwargs
):
9417 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9419 This function sends EVT_UPDATE_UI events to the window. The particular
9420 implementation depends on the window; for example a wx.ToolBar will
9421 send an update UI event for each toolbar button, and a wx.Frame will
9422 send an update UI event for each menubar menu item. You can call this
9423 function from your application to ensure that your UI is up-to-date at
9424 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9425 concerned). This may be necessary if you have called
9426 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9427 limit the overhead that wxWindows incurs by sending update UI events
9430 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9432 def PopupMenuXY(*args
, **kwargs
):
9434 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9436 Pops up the given menu at the specified coordinates, relative to this window,
9437 and returns control when the user has dismissed the menu. If a menu item is
9438 selected, the corresponding menu event is generated and will be processed as
9439 usual. If the default position is given then the current position of the
9440 mouse cursor will be used.
9442 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9444 def PopupMenu(*args
, **kwargs
):
9446 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9448 Pops up the given menu at the specified coordinates, relative to this window,
9449 and returns control when the user has dismissed the menu. If a menu item is
9450 selected, the corresponding menu event is generated and will be processed as
9451 usual. If the default position is given then the current position of the
9452 mouse cursor will be used.
9454 return _core_
.Window_PopupMenu(*args
, **kwargs
)
9456 def HasMultiplePages(*args
, **kwargs
):
9457 """HasMultiplePages(self) -> bool"""
9458 return _core_
.Window_HasMultiplePages(*args
, **kwargs
)
9460 def GetHandle(*args
, **kwargs
):
9462 GetHandle(self) -> long
9464 Returns the platform-specific handle (as a long integer) of the
9465 physical window. Currently on wxMac it returns the handle of the
9466 toplevel parent of the window.
9468 return _core_
.Window_GetHandle(*args
, **kwargs
)
9470 def AssociateHandle(*args
, **kwargs
):
9472 AssociateHandle(self, long handle)
9474 Associate the window with a new native handle
9476 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
9478 def DissociateHandle(*args
, **kwargs
):
9480 DissociateHandle(self)
9482 Dissociate the current native handle from the window
9484 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
9486 def HasScrollbar(*args
, **kwargs
):
9488 HasScrollbar(self, int orient) -> bool
9490 Does the window have the scrollbar for this orientation?
9492 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
9494 def SetScrollbar(*args
, **kwargs
):
9496 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9499 Sets the scrollbar properties of a built-in scrollbar.
9501 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
9503 def SetScrollPos(*args
, **kwargs
):
9505 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9507 Sets the position of one of the built-in scrollbars.
9509 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
9511 def GetScrollPos(*args
, **kwargs
):
9513 GetScrollPos(self, int orientation) -> int
9515 Returns the built-in scrollbar position.
9517 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
9519 def GetScrollThumb(*args
, **kwargs
):
9521 GetScrollThumb(self, int orientation) -> int
9523 Returns the built-in scrollbar thumb size.
9525 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
9527 def GetScrollRange(*args
, **kwargs
):
9529 GetScrollRange(self, int orientation) -> int
9531 Returns the built-in scrollbar range.
9533 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
9535 def ScrollWindow(*args
, **kwargs
):
9537 ScrollWindow(self, int dx, int dy, Rect rect=None)
9539 Physically scrolls the pixels in the window and move child windows
9540 accordingly. Use this function to optimise your scrolling
9541 implementations, to minimise the area that must be redrawn. Note that
9542 it is rarely required to call this function from a user program.
9544 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
9546 def ScrollLines(*args
, **kwargs
):
9548 ScrollLines(self, int lines) -> bool
9550 If the platform and window class supports it, scrolls the window by
9551 the given number of lines down, if lines is positive, or up if lines
9552 is negative. Returns True if the window was scrolled, False if it was
9553 already on top/bottom and nothing was done.
9555 return _core_
.Window_ScrollLines(*args
, **kwargs
)
9557 def ScrollPages(*args
, **kwargs
):
9559 ScrollPages(self, int pages) -> bool
9561 If the platform and window class supports it, scrolls the window by
9562 the given number of pages down, if pages is positive, or up if pages
9563 is negative. Returns True if the window was scrolled, False if it was
9564 already on top/bottom and nothing was done.
9566 return _core_
.Window_ScrollPages(*args
, **kwargs
)
9568 def LineUp(*args
, **kwargs
):
9570 LineUp(self) -> bool
9572 This is just a wrapper for ScrollLines(-1).
9574 return _core_
.Window_LineUp(*args
, **kwargs
)
9576 def LineDown(*args
, **kwargs
):
9578 LineDown(self) -> bool
9580 This is just a wrapper for ScrollLines(1).
9582 return _core_
.Window_LineDown(*args
, **kwargs
)
9584 def PageUp(*args
, **kwargs
):
9586 PageUp(self) -> bool
9588 This is just a wrapper for ScrollPages(-1).
9590 return _core_
.Window_PageUp(*args
, **kwargs
)
9592 def PageDown(*args
, **kwargs
):
9594 PageDown(self) -> bool
9596 This is just a wrapper for ScrollPages(1).
9598 return _core_
.Window_PageDown(*args
, **kwargs
)
9600 def SetHelpText(*args
, **kwargs
):
9602 SetHelpText(self, String text)
9604 Sets the help text to be used as context-sensitive help for this
9605 window. Note that the text is actually stored by the current
9606 `wx.HelpProvider` implementation, and not in the window object itself.
9608 return _core_
.Window_SetHelpText(*args
, **kwargs
)
9610 def SetHelpTextForId(*args
, **kwargs
):
9612 SetHelpTextForId(self, String text)
9614 Associate this help text with all windows with the same id as this
9617 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
9619 def GetHelpTextAtPoint(*args
, **kwargs
):
9621 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9623 Get the help string associated with the given position in this window.
9625 Notice that pt may be invalid if event origin is keyboard or unknown
9626 and this method should return the global window help text then
9629 return _core_
.Window_GetHelpTextAtPoint(*args
, **kwargs
)
9631 def GetHelpText(*args
, **kwargs
):
9633 GetHelpText(self) -> String
9635 Gets the help text to be used as context-sensitive help for this
9636 window. Note that the text is actually stored by the current
9637 `wx.HelpProvider` implementation, and not in the window object itself.
9639 return _core_
.Window_GetHelpText(*args
, **kwargs
)
9641 def SetToolTipString(*args
, **kwargs
):
9643 SetToolTipString(self, String tip)
9645 Attach a tooltip to the window.
9647 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
9649 def SetToolTip(*args
, **kwargs
):
9651 SetToolTip(self, ToolTip tip)
9653 Attach a tooltip to the window.
9655 return _core_
.Window_SetToolTip(*args
, **kwargs
)
9657 def GetToolTip(*args
, **kwargs
):
9659 GetToolTip(self) -> ToolTip
9661 get the associated tooltip or None if none
9663 return _core_
.Window_GetToolTip(*args
, **kwargs
)
9665 def SetDropTarget(*args
, **kwargs
):
9667 SetDropTarget(self, DropTarget dropTarget)
9669 Associates a drop target with this window. If the window already has
9670 a drop target, it is deleted.
9672 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
9674 def GetDropTarget(*args
, **kwargs
):
9676 GetDropTarget(self) -> DropTarget
9678 Returns the associated drop target, which may be None.
9680 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
9682 def DragAcceptFiles(*args
, **kwargs
):
9684 DragAcceptFiles(self, bool accept)
9686 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9687 Only functional on Windows.
9689 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
9691 def SetConstraints(*args
, **kwargs
):
9693 SetConstraints(self, LayoutConstraints constraints)
9695 Sets the window to have the given layout constraints. If an existing
9696 layout constraints object is already owned by the window, it will be
9697 deleted. Pass None to disassociate and delete the window's current
9700 You must call SetAutoLayout to tell a window to use the constraints
9701 automatically in its default EVT_SIZE handler; otherwise, you must
9702 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9703 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9706 return _core_
.Window_SetConstraints(*args
, **kwargs
)
9708 def GetConstraints(*args
, **kwargs
):
9710 GetConstraints(self) -> LayoutConstraints
9712 Returns a pointer to the window's layout constraints, or None if there
9715 return _core_
.Window_GetConstraints(*args
, **kwargs
)
9717 def SetAutoLayout(*args
, **kwargs
):
9719 SetAutoLayout(self, bool autoLayout)
9721 Determines whether the Layout function will be called automatically
9722 when the window is resized. lease note that this only happens for the
9723 windows usually used to contain children, namely `wx.Panel` and
9724 `wx.TopLevelWindow` (and the classes deriving from them).
9726 This method is called implicitly by `SetSizer` but if you use
9727 `SetConstraints` you should call it manually or otherwise the window
9728 layout won't be correctly updated when its size changes.
9730 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
9732 def GetAutoLayout(*args
, **kwargs
):
9734 GetAutoLayout(self) -> bool
9736 Returns the current autoLayout setting
9738 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
9740 def Layout(*args
, **kwargs
):
9742 Layout(self) -> bool
9744 Invokes the constraint-based layout algorithm or the sizer-based
9745 algorithm for this window. See SetAutoLayout: when auto layout is on,
9746 this function gets called automatically by the default EVT_SIZE
9747 handler when the window is resized.
9749 return _core_
.Window_Layout(*args
, **kwargs
)
9751 def SetSizer(*args
, **kwargs
):
9753 SetSizer(self, Sizer sizer, bool deleteOld=True)
9755 Sets the window to have the given layout sizer. The window will then
9756 own the object, and will take care of its deletion. If an existing
9757 layout sizer object is already owned by the window, it will be deleted
9758 if the deleteOld parameter is true. Note that this function will also
9759 call SetAutoLayout implicitly with a True parameter if the sizer is
9760 non-None, and False otherwise.
9762 return _core_
.Window_SetSizer(*args
, **kwargs
)
9764 def SetSizerAndFit(*args
, **kwargs
):
9766 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9768 The same as SetSizer, except it also sets the size hints for the
9769 window based on the sizer's minimum size.
9771 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
9773 def GetSizer(*args
, **kwargs
):
9775 GetSizer(self) -> Sizer
9777 Return the sizer associated with the window by a previous call to
9778 SetSizer or None if there isn't one.
9780 return _core_
.Window_GetSizer(*args
, **kwargs
)
9782 def SetContainingSizer(*args
, **kwargs
):
9784 SetContainingSizer(self, Sizer sizer)
9786 This normally does not need to be called by application code. It is
9787 called internally when a window is added to a sizer, and is used so
9788 the window can remove itself from the sizer when it is destroyed.
9790 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
9792 def GetContainingSizer(*args
, **kwargs
):
9794 GetContainingSizer(self) -> Sizer
9796 Return the sizer that this window is a member of, if any, otherwise None.
9798 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
9800 def InheritAttributes(*args
, **kwargs
):
9802 InheritAttributes(self)
9804 This function is (or should be, in case of custom controls) called
9805 during window creation to intelligently set up the window visual
9806 attributes, that is the font and the foreground and background
9809 By 'intelligently' the following is meant: by default, all windows use
9810 their own default attributes. However if some of the parent's
9811 attributes are explicitly changed (that is, using SetFont and not
9812 SetOwnFont) and if the corresponding attribute hadn't been
9813 explicitly set for this window itself, then this window takes the same
9814 value as used by the parent. In addition, if the window overrides
9815 ShouldInheritColours to return false, the colours will not be changed
9816 no matter what and only the font might.
9818 This rather complicated logic is necessary in order to accommodate the
9819 different usage scenarios. The most common one is when all default
9820 attributes are used and in this case, nothing should be inherited as
9821 in modern GUIs different controls use different fonts (and colours)
9822 than their siblings so they can't inherit the same value from the
9823 parent. However it was also deemed desirable to allow to simply change
9824 the attributes of all children at once by just changing the font or
9825 colour of their common parent, hence in this case we do inherit the
9829 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
9831 def ShouldInheritColours(*args
, **kwargs
):
9833 ShouldInheritColours(self) -> bool
9835 Return true from here to allow the colours of this window to be
9836 changed by InheritAttributes, returning false forbids inheriting them
9837 from the parent window.
9839 The base class version returns false, but this method is overridden in
9840 wxControl where it returns true.
9842 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
9844 def CanSetTransparent(*args
, **kwargs
):
9846 CanSetTransparent(self) -> bool
9848 Returns ``True`` if the platform supports setting the transparency for
9849 this window. Note that this method will err on the side of caution,
9850 so it is possible that this will return ``False`` when it is in fact
9851 possible to set the transparency.
9853 NOTE: On X-windows systems the X server must have the composite
9854 extension loaded, and there must be a composite manager program (such
9855 as xcompmgr) running.
9857 return _core_
.Window_CanSetTransparent(*args
, **kwargs
)
9859 def SetTransparent(*args
, **kwargs
):
9861 SetTransparent(self, byte alpha) -> bool
9863 Attempt to set the transparency of this window to the ``alpha`` value,
9864 returns True on success. The ``alpha`` value is an integer in the
9865 range of 0 to 255, where 0 is fully transparent and 255 is fully
9868 return _core_
.Window_SetTransparent(*args
, **kwargs
)
9870 def PostCreate(self
, pre
):
9872 Phase 3 of the 2-phase create <wink!>
9873 Call this method after precreating the window with the 2-phase create method.
9875 self
.this
= pre
.this
9876 self
.thisown
= pre
.thisown
9878 if hasattr(self
, '_setOORInfo'):
9879 self
._setOORInfo
(self
)
9880 if hasattr(self
, '_setCallbackInfo'):
9881 self
._setCallbackInfo
(self
, self
.__class
__)
9883 def SendSizeEvent(self
):
9884 self
.GetEventHandler().ProcessEvent(wx
.SizeEvent((-1,-1)))
9886 AcceleratorTable
= property(GetAcceleratorTable
,SetAcceleratorTable
,doc
="See `GetAcceleratorTable` and `SetAcceleratorTable`")
9887 AdjustedBestSize
= property(GetAdjustedBestSize
,doc
="See `GetAdjustedBestSize`")
9888 AutoLayout
= property(GetAutoLayout
,SetAutoLayout
,doc
="See `GetAutoLayout` and `SetAutoLayout`")
9889 BackgroundColour
= property(GetBackgroundColour
,SetBackgroundColour
,doc
="See `GetBackgroundColour` and `SetBackgroundColour`")
9890 BackgroundStyle
= property(GetBackgroundStyle
,SetBackgroundStyle
,doc
="See `GetBackgroundStyle` and `SetBackgroundStyle`")
9891 BestFittingSize
= property(GetBestFittingSize
,SetBestFittingSize
,doc
="See `GetBestFittingSize` and `SetBestFittingSize`")
9892 BestSize
= property(GetBestSize
,doc
="See `GetBestSize`")
9893 BestVirtualSize
= property(GetBestVirtualSize
,doc
="See `GetBestVirtualSize`")
9894 Border
= property(GetBorder
,doc
="See `GetBorder`")
9895 Caret
= property(GetCaret
,SetCaret
,doc
="See `GetCaret` and `SetCaret`")
9896 CharHeight
= property(GetCharHeight
,doc
="See `GetCharHeight`")
9897 CharWidth
= property(GetCharWidth
,doc
="See `GetCharWidth`")
9898 Children
= property(GetChildren
,doc
="See `GetChildren`")
9899 ClientAreaOrigin
= property(GetClientAreaOrigin
,doc
="See `GetClientAreaOrigin`")
9900 ClientRect
= property(GetClientRect
,SetClientRect
,doc
="See `GetClientRect` and `SetClientRect`")
9901 ClientSize
= property(GetClientSize
,SetClientSize
,doc
="See `GetClientSize` and `SetClientSize`")
9902 Constraints
= property(GetConstraints
,SetConstraints
,doc
="See `GetConstraints` and `SetConstraints`")
9903 ContainingSizer
= property(GetContainingSizer
,SetContainingSizer
,doc
="See `GetContainingSizer` and `SetContainingSizer`")
9904 Cursor
= property(GetCursor
,SetCursor
,doc
="See `GetCursor` and `SetCursor`")
9905 DefaultAttributes
= property(GetDefaultAttributes
,doc
="See `GetDefaultAttributes`")
9906 DropTarget
= property(GetDropTarget
,SetDropTarget
,doc
="See `GetDropTarget` and `SetDropTarget`")
9907 EventHandler
= property(GetEventHandler
,SetEventHandler
,doc
="See `GetEventHandler` and `SetEventHandler`")
9908 ExtraStyle
= property(GetExtraStyle
,SetExtraStyle
,doc
="See `GetExtraStyle` and `SetExtraStyle`")
9909 Font
= property(GetFont
,SetFont
,doc
="See `GetFont` and `SetFont`")
9910 ForegroundColour
= property(GetForegroundColour
,SetForegroundColour
,doc
="See `GetForegroundColour` and `SetForegroundColour`")
9911 GrandParent
= property(GetGrandParent
,doc
="See `GetGrandParent`")
9912 Handle
= property(GetHandle
,doc
="See `GetHandle`")
9913 HelpText
= property(GetHelpText
,SetHelpText
,doc
="See `GetHelpText` and `SetHelpText`")
9914 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
9915 Label
= property(GetLabel
,SetLabel
,doc
="See `GetLabel` and `SetLabel`")
9916 MaxHeight
= property(GetMaxHeight
,doc
="See `GetMaxHeight`")
9917 MaxSize
= property(GetMaxSize
,SetMaxSize
,doc
="See `GetMaxSize` and `SetMaxSize`")
9918 MaxWidth
= property(GetMaxWidth
,doc
="See `GetMaxWidth`")
9919 MinHeight
= property(GetMinHeight
,doc
="See `GetMinHeight`")
9920 MinSize
= property(GetMinSize
,SetMinSize
,doc
="See `GetMinSize` and `SetMinSize`")
9921 MinWidth
= property(GetMinWidth
,doc
="See `GetMinWidth`")
9922 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
9923 Parent
= property(GetParent
,doc
="See `GetParent`")
9924 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
9925 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
9926 ScreenPosition
= property(GetScreenPosition
,doc
="See `GetScreenPosition`")
9927 ScreenRect
= property(GetScreenRect
,doc
="See `GetScreenRect`")
9928 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
9929 Sizer
= property(GetSizer
,SetSizer
,doc
="See `GetSizer` and `SetSizer`")
9930 ThemeEnabled
= property(GetThemeEnabled
,SetThemeEnabled
,doc
="See `GetThemeEnabled` and `SetThemeEnabled`")
9931 ToolTip
= property(GetToolTip
,SetToolTip
,doc
="See `GetToolTip` and `SetToolTip`")
9932 UpdateClientRect
= property(GetUpdateClientRect
,doc
="See `GetUpdateClientRect`")
9933 UpdateRegion
= property(GetUpdateRegion
,doc
="See `GetUpdateRegion`")
9934 Validator
= property(GetValidator
,SetValidator
,doc
="See `GetValidator` and `SetValidator`")
9935 VirtualSize
= property(GetVirtualSize
,SetVirtualSize
,doc
="See `GetVirtualSize` and `SetVirtualSize`")
9936 WindowStyle
= property(GetWindowStyle
,SetWindowStyle
,doc
="See `GetWindowStyle` and `SetWindowStyle`")
9937 WindowStyleFlag
= property(GetWindowStyleFlag
,SetWindowStyleFlag
,doc
="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
9938 WindowVariant
= property(GetWindowVariant
,SetWindowVariant
,doc
="See `GetWindowVariant` and `SetWindowVariant`")
9939 Shown
= property(IsShown
,Show
,doc
="See `IsShown` and `Show`")
9940 Enabled
= property(IsEnabled
,Enable
,doc
="See `IsEnabled` and `Enable`")
9941 TopLevel
= property(IsTopLevel
,doc
="See `IsTopLevel`")
9942 _core_
.Window_swigregister(Window
)
9944 def PreWindow(*args
, **kwargs
):
9946 PreWindow() -> Window
9948 Precreate a Window for 2-phase creation.
9950 val
= _core_
.new_PreWindow(*args
, **kwargs
)
9953 def Window_NewControlId(*args
):
9955 Window_NewControlId() -> int
9957 Generate a control id for the controls which were not given one.
9959 return _core_
.Window_NewControlId(*args
)
9961 def Window_NextControlId(*args
, **kwargs
):
9963 Window_NextControlId(int winid) -> int
9965 Get the id of the control following the one with the given
9968 return _core_
.Window_NextControlId(*args
, **kwargs
)
9970 def Window_PrevControlId(*args
, **kwargs
):
9972 Window_PrevControlId(int winid) -> int
9974 Get the id of the control preceding the one with the given
9977 return _core_
.Window_PrevControlId(*args
, **kwargs
)
9979 def Window_FindFocus(*args
):
9981 Window_FindFocus() -> Window
9983 Returns the window or control that currently has the keyboard focus,
9986 return _core_
.Window_FindFocus(*args
)
9988 def Window_GetCapture(*args
):
9990 Window_GetCapture() -> Window
9992 Returns the window which currently captures the mouse or None
9994 return _core_
.Window_GetCapture(*args
)
9996 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
9998 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10000 Get the default attributes for this class. This is useful if you want
10001 to use the same font or colour in your own control as in a standard
10002 control -- which is a much better idea than hard coding specific
10003 colours or fonts which might look completely out of place on the
10004 user's system, especially if it uses themes.
10006 The variant parameter is only relevant under Mac currently and is
10007 ignore under other platforms. Under Mac, it will change the size of
10008 the returned font. See `wx.Window.SetWindowVariant` for more about
10011 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
10013 def DLG_PNT(win
, point_or_x
, y
=None):
10015 Convenience function for converting a Point or (x,y) in
10016 dialog units to pixel units.
10019 return win
.ConvertDialogPointToPixels(point_or_x
)
10021 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
10023 def DLG_SZE(win
, size_width
, height
=None):
10025 Convenience function for converting a Size or (w,h) in
10026 dialog units to pixel units.
10029 return win
.ConvertDialogSizeToPixels(size_width
)
10031 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
10034 def FindWindowById(*args
, **kwargs
):
10036 FindWindowById(long id, Window parent=None) -> Window
10038 Find the first window in the application with the given id. If parent
10039 is None, the search will start from all top-level frames and dialog
10040 boxes; if non-None, the search will be limited to the given window
10041 hierarchy. The search is recursive in both cases.
10043 return _core_
.FindWindowById(*args
, **kwargs
)
10045 def FindWindowByName(*args
, **kwargs
):
10047 FindWindowByName(String name, Window parent=None) -> Window
10049 Find a window by its name (as given in a window constructor or Create
10050 function call). If parent is None, the search will start from all
10051 top-level frames and dialog boxes; if non-None, the search will be
10052 limited to the given window hierarchy. The search is recursive in both
10055 If no window with such name is found, wx.FindWindowByLabel is called.
10057 return _core_
.FindWindowByName(*args
, **kwargs
)
10059 def FindWindowByLabel(*args
, **kwargs
):
10061 FindWindowByLabel(String label, Window parent=None) -> Window
10063 Find a window by its label. Depending on the type of window, the label
10064 may be a window title or panel item label. If parent is None, the
10065 search will start from all top-level frames and dialog boxes; if
10066 non-None, the search will be limited to the given window
10067 hierarchy. The search is recursive in both cases.
10069 return _core_
.FindWindowByLabel(*args
, **kwargs
)
10071 def Window_FromHWND(*args
, **kwargs
):
10072 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10073 return _core_
.Window_FromHWND(*args
, **kwargs
)
10075 def GetTopLevelWindows(*args
):
10077 GetTopLevelWindows() -> PyObject
10079 Returns a list of the the application's top-level windows, (frames,
10080 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10081 by wxWidgets, and so it is only valid as long as no top-level windows
10082 are closed or new top-level windows are created.
10085 return _core_
.GetTopLevelWindows(*args
)
10086 #---------------------------------------------------------------------------
10088 class Validator(EvtHandler
):
10089 """Proxy of C++ Validator class"""
10090 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10091 __repr__
= _swig_repr
10092 def __init__(self
, *args
, **kwargs
):
10093 """__init__(self) -> Validator"""
10094 _core_
.Validator_swiginit(self
,_core_
.new_Validator(*args
, **kwargs
))
10095 self
._setOORInfo
(self
)
10097 def Clone(*args
, **kwargs
):
10098 """Clone(self) -> Validator"""
10099 return _core_
.Validator_Clone(*args
, **kwargs
)
10101 def Validate(*args
, **kwargs
):
10102 """Validate(self, Window parent) -> bool"""
10103 return _core_
.Validator_Validate(*args
, **kwargs
)
10105 def TransferToWindow(*args
, **kwargs
):
10106 """TransferToWindow(self) -> bool"""
10107 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
10109 def TransferFromWindow(*args
, **kwargs
):
10110 """TransferFromWindow(self) -> bool"""
10111 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
10113 def GetWindow(*args
, **kwargs
):
10114 """GetWindow(self) -> Window"""
10115 return _core_
.Validator_GetWindow(*args
, **kwargs
)
10117 def SetWindow(*args
, **kwargs
):
10118 """SetWindow(self, Window window)"""
10119 return _core_
.Validator_SetWindow(*args
, **kwargs
)
10121 def IsSilent(*args
, **kwargs
):
10122 """IsSilent() -> bool"""
10123 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10125 IsSilent
= staticmethod(IsSilent
)
10126 def SetBellOnError(*args
, **kwargs
):
10127 """SetBellOnError(int doIt=True)"""
10128 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10130 SetBellOnError
= staticmethod(SetBellOnError
)
10131 _core_
.Validator_swigregister(Validator
)
10133 def Validator_IsSilent(*args
):
10134 """Validator_IsSilent() -> bool"""
10135 return _core_
.Validator_IsSilent(*args
)
10137 def Validator_SetBellOnError(*args
, **kwargs
):
10138 """Validator_SetBellOnError(int doIt=True)"""
10139 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10141 class PyValidator(Validator
):
10142 """Proxy of C++ PyValidator class"""
10143 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10144 __repr__
= _swig_repr
10145 def __init__(self
, *args
, **kwargs
):
10146 """__init__(self) -> PyValidator"""
10147 _core_
.PyValidator_swiginit(self
,_core_
.new_PyValidator(*args
, **kwargs
))
10149 self
._setCallbackInfo
(self
, PyValidator
, 1)
10150 self
._setOORInfo
(self
)
10152 def _setCallbackInfo(*args
, **kwargs
):
10153 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10154 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
10156 _core_
.PyValidator_swigregister(PyValidator
)
10158 #---------------------------------------------------------------------------
10160 class Menu(EvtHandler
):
10161 """Proxy of C++ Menu class"""
10162 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10163 __repr__
= _swig_repr
10164 def __init__(self
, *args
, **kwargs
):
10165 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10166 _core_
.Menu_swiginit(self
,_core_
.new_Menu(*args
, **kwargs
))
10167 self
._setOORInfo
(self
)
10169 def Append(*args
, **kwargs
):
10171 Append(self, int id, String text=EmptyString, String help=EmptyString,
10172 int kind=ITEM_NORMAL) -> MenuItem
10174 return _core_
.Menu_Append(*args
, **kwargs
)
10176 def AppendSeparator(*args
, **kwargs
):
10177 """AppendSeparator(self) -> MenuItem"""
10178 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
10180 def AppendCheckItem(*args
, **kwargs
):
10181 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10182 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
10184 def AppendRadioItem(*args
, **kwargs
):
10185 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10186 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
10188 def AppendMenu(*args
, **kwargs
):
10189 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10190 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
10192 def AppendSubMenu(*args
, **kwargs
):
10193 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10194 return _core_
.Menu_AppendSubMenu(*args
, **kwargs
)
10196 def AppendItem(*args
, **kwargs
):
10197 """AppendItem(self, MenuItem item) -> MenuItem"""
10198 return _core_
.Menu_AppendItem(*args
, **kwargs
)
10200 def InsertItem(*args
, **kwargs
):
10201 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10202 return _core_
.Menu_InsertItem(*args
, **kwargs
)
10204 def PrependItem(*args
, **kwargs
):
10205 """PrependItem(self, MenuItem item) -> MenuItem"""
10206 return _core_
.Menu_PrependItem(*args
, **kwargs
)
10208 def Break(*args
, **kwargs
):
10210 return _core_
.Menu_Break(*args
, **kwargs
)
10212 def Insert(*args
, **kwargs
):
10214 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10215 int kind=ITEM_NORMAL) -> MenuItem
10217 return _core_
.Menu_Insert(*args
, **kwargs
)
10219 def InsertSeparator(*args
, **kwargs
):
10220 """InsertSeparator(self, size_t pos) -> MenuItem"""
10221 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
10223 def InsertCheckItem(*args
, **kwargs
):
10224 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10225 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
10227 def InsertRadioItem(*args
, **kwargs
):
10228 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10229 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
10231 def InsertMenu(*args
, **kwargs
):
10232 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10233 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
10235 def Prepend(*args
, **kwargs
):
10237 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10238 int kind=ITEM_NORMAL) -> MenuItem
10240 return _core_
.Menu_Prepend(*args
, **kwargs
)
10242 def PrependSeparator(*args
, **kwargs
):
10243 """PrependSeparator(self) -> MenuItem"""
10244 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
10246 def PrependCheckItem(*args
, **kwargs
):
10247 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10248 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
10250 def PrependRadioItem(*args
, **kwargs
):
10251 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10252 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
10254 def PrependMenu(*args
, **kwargs
):
10255 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10256 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
10258 def Remove(*args
, **kwargs
):
10259 """Remove(self, int id) -> MenuItem"""
10260 return _core_
.Menu_Remove(*args
, **kwargs
)
10262 def RemoveItem(*args
, **kwargs
):
10263 """RemoveItem(self, MenuItem item) -> MenuItem"""
10264 return _core_
.Menu_RemoveItem(*args
, **kwargs
)
10266 def Delete(*args
, **kwargs
):
10267 """Delete(self, int id) -> bool"""
10268 return _core_
.Menu_Delete(*args
, **kwargs
)
10270 def DeleteItem(*args
, **kwargs
):
10271 """DeleteItem(self, MenuItem item) -> bool"""
10272 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
10274 def Destroy(*args
, **kwargs
):
10278 Deletes the C++ object this Python object is a proxy for.
10280 val
= _core_
.Menu_Destroy(*args
, **kwargs
)
10281 args
[0].thisown
= 0
10284 def DestroyId(*args
, **kwargs
):
10286 DestroyId(self, int id) -> bool
10288 Deletes the C++ object this Python object is a proxy for.
10290 val
= _core_
.Menu_DestroyId(*args
, **kwargs
)
10291 args
[0].thisown
= 0
10294 def DestroyItem(*args
, **kwargs
):
10296 DestroyItem(self, MenuItem item) -> bool
10298 Deletes the C++ object this Python object is a proxy for.
10300 val
= _core_
.Menu_DestroyItem(*args
, **kwargs
)
10301 args
[0].thisown
= 0
10304 def GetMenuItemCount(*args
, **kwargs
):
10305 """GetMenuItemCount(self) -> size_t"""
10306 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
10308 def GetMenuItems(*args
, **kwargs
):
10309 """GetMenuItems(self) -> PyObject"""
10310 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
10312 def FindItem(*args
, **kwargs
):
10313 """FindItem(self, String item) -> int"""
10314 return _core_
.Menu_FindItem(*args
, **kwargs
)
10316 def FindItemById(*args
, **kwargs
):
10317 """FindItemById(self, int id) -> MenuItem"""
10318 return _core_
.Menu_FindItemById(*args
, **kwargs
)
10320 def FindItemByPosition(*args
, **kwargs
):
10321 """FindItemByPosition(self, size_t position) -> MenuItem"""
10322 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
10324 def Enable(*args
, **kwargs
):
10325 """Enable(self, int id, bool enable)"""
10326 return _core_
.Menu_Enable(*args
, **kwargs
)
10328 def IsEnabled(*args
, **kwargs
):
10329 """IsEnabled(self, int id) -> bool"""
10330 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
10332 def Check(*args
, **kwargs
):
10333 """Check(self, int id, bool check)"""
10334 return _core_
.Menu_Check(*args
, **kwargs
)
10336 def IsChecked(*args
, **kwargs
):
10337 """IsChecked(self, int id) -> bool"""
10338 return _core_
.Menu_IsChecked(*args
, **kwargs
)
10340 def SetLabel(*args
, **kwargs
):
10341 """SetLabel(self, int id, String label)"""
10342 return _core_
.Menu_SetLabel(*args
, **kwargs
)
10344 def GetLabel(*args
, **kwargs
):
10345 """GetLabel(self, int id) -> String"""
10346 return _core_
.Menu_GetLabel(*args
, **kwargs
)
10348 def SetHelpString(*args
, **kwargs
):
10349 """SetHelpString(self, int id, String helpString)"""
10350 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
10352 def GetHelpString(*args
, **kwargs
):
10353 """GetHelpString(self, int id) -> String"""
10354 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
10356 def SetTitle(*args
, **kwargs
):
10357 """SetTitle(self, String title)"""
10358 return _core_
.Menu_SetTitle(*args
, **kwargs
)
10360 def GetTitle(*args
, **kwargs
):
10361 """GetTitle(self) -> String"""
10362 return _core_
.Menu_GetTitle(*args
, **kwargs
)
10364 def SetEventHandler(*args
, **kwargs
):
10365 """SetEventHandler(self, EvtHandler handler)"""
10366 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
10368 def GetEventHandler(*args
, **kwargs
):
10369 """GetEventHandler(self) -> EvtHandler"""
10370 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
10372 def SetInvokingWindow(*args
, **kwargs
):
10373 """SetInvokingWindow(self, Window win)"""
10374 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
10376 def GetInvokingWindow(*args
, **kwargs
):
10377 """GetInvokingWindow(self) -> Window"""
10378 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
10380 def GetStyle(*args
, **kwargs
):
10381 """GetStyle(self) -> long"""
10382 return _core_
.Menu_GetStyle(*args
, **kwargs
)
10384 def UpdateUI(*args
, **kwargs
):
10385 """UpdateUI(self, EvtHandler source=None)"""
10386 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
10388 def GetMenuBar(*args
, **kwargs
):
10389 """GetMenuBar(self) -> MenuBar"""
10390 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
10392 def Attach(*args
, **kwargs
):
10393 """Attach(self, wxMenuBarBase menubar)"""
10394 return _core_
.Menu_Attach(*args
, **kwargs
)
10396 def Detach(*args
, **kwargs
):
10398 return _core_
.Menu_Detach(*args
, **kwargs
)
10400 def IsAttached(*args
, **kwargs
):
10401 """IsAttached(self) -> bool"""
10402 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10404 def SetParent(*args
, **kwargs
):
10405 """SetParent(self, Menu parent)"""
10406 return _core_
.Menu_SetParent(*args
, **kwargs
)
10408 def GetParent(*args
, **kwargs
):
10409 """GetParent(self) -> Menu"""
10410 return _core_
.Menu_GetParent(*args
, **kwargs
)
10412 _core_
.Menu_swigregister(Menu
)
10413 DefaultValidator
= cvar
.DefaultValidator
10415 #---------------------------------------------------------------------------
10417 class MenuBar(Window
):
10418 """Proxy of C++ MenuBar class"""
10419 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10420 __repr__
= _swig_repr
10421 def __init__(self
, *args
, **kwargs
):
10422 """__init__(self, long style=0) -> MenuBar"""
10423 _core_
.MenuBar_swiginit(self
,_core_
.new_MenuBar(*args
, **kwargs
))
10424 self
._setOORInfo
(self
)
10426 def Append(*args
, **kwargs
):
10427 """Append(self, Menu menu, String title) -> bool"""
10428 return _core_
.MenuBar_Append(*args
, **kwargs
)
10430 def Insert(*args
, **kwargs
):
10431 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10432 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10434 def GetMenuCount(*args
, **kwargs
):
10435 """GetMenuCount(self) -> size_t"""
10436 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
10438 def GetMenu(*args
, **kwargs
):
10439 """GetMenu(self, size_t pos) -> Menu"""
10440 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
10442 def Replace(*args
, **kwargs
):
10443 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10444 return _core_
.MenuBar_Replace(*args
, **kwargs
)
10446 def Remove(*args
, **kwargs
):
10447 """Remove(self, size_t pos) -> Menu"""
10448 return _core_
.MenuBar_Remove(*args
, **kwargs
)
10450 def EnableTop(*args
, **kwargs
):
10451 """EnableTop(self, size_t pos, bool enable)"""
10452 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
10454 def IsEnabledTop(*args
, **kwargs
):
10455 """IsEnabledTop(self, size_t pos) -> bool"""
10456 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
10458 def SetLabelTop(*args
, **kwargs
):
10459 """SetLabelTop(self, size_t pos, String label)"""
10460 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
10462 def GetLabelTop(*args
, **kwargs
):
10463 """GetLabelTop(self, size_t pos) -> String"""
10464 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
10466 def FindMenuItem(*args
, **kwargs
):
10467 """FindMenuItem(self, String menu, String item) -> int"""
10468 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
10470 def FindItemById(*args
, **kwargs
):
10471 """FindItemById(self, int id) -> MenuItem"""
10472 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
10474 def FindMenu(*args
, **kwargs
):
10475 """FindMenu(self, String title) -> int"""
10476 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
10478 def Enable(*args
, **kwargs
):
10479 """Enable(self, int id, bool enable)"""
10480 return _core_
.MenuBar_Enable(*args
, **kwargs
)
10482 def Check(*args
, **kwargs
):
10483 """Check(self, int id, bool check)"""
10484 return _core_
.MenuBar_Check(*args
, **kwargs
)
10486 def IsChecked(*args
, **kwargs
):
10487 """IsChecked(self, int id) -> bool"""
10488 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
10490 def IsEnabled(*args
, **kwargs
):
10491 """IsEnabled(self, int id) -> bool"""
10492 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
10494 def SetLabel(*args
, **kwargs
):
10495 """SetLabel(self, int id, String label)"""
10496 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
10498 def GetLabel(*args
, **kwargs
):
10499 """GetLabel(self, int id) -> String"""
10500 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
10502 def SetHelpString(*args
, **kwargs
):
10503 """SetHelpString(self, int id, String helpString)"""
10504 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
10506 def GetHelpString(*args
, **kwargs
):
10507 """GetHelpString(self, int id) -> String"""
10508 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
10510 def GetFrame(*args
, **kwargs
):
10511 """GetFrame(self) -> wxFrame"""
10512 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
10514 def IsAttached(*args
, **kwargs
):
10515 """IsAttached(self) -> bool"""
10516 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
10518 def Attach(*args
, **kwargs
):
10519 """Attach(self, wxFrame frame)"""
10520 return _core_
.MenuBar_Attach(*args
, **kwargs
)
10522 def Detach(*args
, **kwargs
):
10524 return _core_
.MenuBar_Detach(*args
, **kwargs
)
10526 def UpdateMenus(*args
, **kwargs
):
10527 """UpdateMenus(self)"""
10528 return _core_
.MenuBar_UpdateMenus(*args
, **kwargs
)
10530 def SetAutoWindowMenu(*args
, **kwargs
):
10531 """SetAutoWindowMenu(bool enable)"""
10532 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10534 SetAutoWindowMenu
= staticmethod(SetAutoWindowMenu
)
10535 def GetAutoWindowMenu(*args
, **kwargs
):
10536 """GetAutoWindowMenu() -> bool"""
10537 return _core_
.MenuBar_GetAutoWindowMenu(*args
, **kwargs
)
10539 GetAutoWindowMenu
= staticmethod(GetAutoWindowMenu
)
10540 def GetMenus(self
):
10541 """Return a list of (menu, label) items for the menus in the MenuBar. """
10542 return [(self
.GetMenu(i
), self
.GetLabelTop(i
))
10543 for i
in range(self
.GetMenuCount())]
10545 def SetMenus(self
, items
):
10546 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10547 for i
in range(self
.GetMenuCount()-1, -1, -1):
10552 Menus
= property(GetMenus
,SetMenus
)
10553 _core_
.MenuBar_swigregister(MenuBar
)
10555 def MenuBar_SetAutoWindowMenu(*args
, **kwargs
):
10556 """MenuBar_SetAutoWindowMenu(bool enable)"""
10557 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10559 def MenuBar_GetAutoWindowMenu(*args
):
10560 """MenuBar_GetAutoWindowMenu() -> bool"""
10561 return _core_
.MenuBar_GetAutoWindowMenu(*args
)
10563 #---------------------------------------------------------------------------
10565 class MenuItem(Object
):
10566 """Proxy of C++ MenuItem class"""
10567 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10568 __repr__
= _swig_repr
10569 def __init__(self
, *args
, **kwargs
):
10571 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10572 String help=EmptyString, int kind=ITEM_NORMAL,
10573 Menu subMenu=None) -> MenuItem
10575 _core_
.MenuItem_swiginit(self
,_core_
.new_MenuItem(*args
, **kwargs
))
10576 __swig_destroy__
= _core_
.delete_MenuItem
10577 __del__
= lambda self
: None;
10578 def GetMenu(*args
, **kwargs
):
10579 """GetMenu(self) -> Menu"""
10580 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
10582 def SetMenu(*args
, **kwargs
):
10583 """SetMenu(self, Menu menu)"""
10584 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
10586 def SetId(*args
, **kwargs
):
10587 """SetId(self, int id)"""
10588 return _core_
.MenuItem_SetId(*args
, **kwargs
)
10590 def GetId(*args
, **kwargs
):
10591 """GetId(self) -> int"""
10592 return _core_
.MenuItem_GetId(*args
, **kwargs
)
10594 def IsSeparator(*args
, **kwargs
):
10595 """IsSeparator(self) -> bool"""
10596 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
10598 def SetText(*args
, **kwargs
):
10599 """SetText(self, String str)"""
10600 return _core_
.MenuItem_SetText(*args
, **kwargs
)
10602 def GetLabel(*args
, **kwargs
):
10603 """GetLabel(self) -> String"""
10604 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
10606 def GetText(*args
, **kwargs
):
10607 """GetText(self) -> String"""
10608 return _core_
.MenuItem_GetText(*args
, **kwargs
)
10610 def GetLabelFromText(*args
, **kwargs
):
10611 """GetLabelFromText(String text) -> String"""
10612 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10614 GetLabelFromText
= staticmethod(GetLabelFromText
)
10615 def GetKind(*args
, **kwargs
):
10616 """GetKind(self) -> int"""
10617 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
10619 def SetKind(*args
, **kwargs
):
10620 """SetKind(self, int kind)"""
10621 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
10623 def SetCheckable(*args
, **kwargs
):
10624 """SetCheckable(self, bool checkable)"""
10625 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
10627 def IsCheckable(*args
, **kwargs
):
10628 """IsCheckable(self) -> bool"""
10629 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
10631 def IsSubMenu(*args
, **kwargs
):
10632 """IsSubMenu(self) -> bool"""
10633 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
10635 def SetSubMenu(*args
, **kwargs
):
10636 """SetSubMenu(self, Menu menu)"""
10637 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
10639 def GetSubMenu(*args
, **kwargs
):
10640 """GetSubMenu(self) -> Menu"""
10641 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
10643 def Enable(*args
, **kwargs
):
10644 """Enable(self, bool enable=True)"""
10645 return _core_
.MenuItem_Enable(*args
, **kwargs
)
10647 def IsEnabled(*args
, **kwargs
):
10648 """IsEnabled(self) -> bool"""
10649 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
10651 def Check(*args
, **kwargs
):
10652 """Check(self, bool check=True)"""
10653 return _core_
.MenuItem_Check(*args
, **kwargs
)
10655 def IsChecked(*args
, **kwargs
):
10656 """IsChecked(self) -> bool"""
10657 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
10659 def Toggle(*args
, **kwargs
):
10661 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
10663 def SetHelp(*args
, **kwargs
):
10664 """SetHelp(self, String str)"""
10665 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
10667 def GetHelp(*args
, **kwargs
):
10668 """GetHelp(self) -> String"""
10669 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
10671 def GetAccel(*args
, **kwargs
):
10672 """GetAccel(self) -> AcceleratorEntry"""
10673 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
10675 def SetAccel(*args
, **kwargs
):
10676 """SetAccel(self, AcceleratorEntry accel)"""
10677 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
10679 def SetBitmap(*args
, **kwargs
):
10680 """SetBitmap(self, Bitmap bitmap)"""
10681 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
10683 def GetBitmap(*args
, **kwargs
):
10684 """GetBitmap(self) -> Bitmap"""
10685 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
10687 def SetFont(*args
, **kwargs
):
10688 """SetFont(self, Font font)"""
10689 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
10691 def GetFont(*args
, **kwargs
):
10692 """GetFont(self) -> Font"""
10693 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
10695 def SetTextColour(*args
, **kwargs
):
10696 """SetTextColour(self, Colour colText)"""
10697 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
10699 def GetTextColour(*args
, **kwargs
):
10700 """GetTextColour(self) -> Colour"""
10701 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
10703 def SetBackgroundColour(*args
, **kwargs
):
10704 """SetBackgroundColour(self, Colour colBack)"""
10705 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
10707 def GetBackgroundColour(*args
, **kwargs
):
10708 """GetBackgroundColour(self) -> Colour"""
10709 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
10711 def SetBitmaps(*args
, **kwargs
):
10712 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10713 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
10715 def SetDisabledBitmap(*args
, **kwargs
):
10716 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10717 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
10719 def GetDisabledBitmap(*args
, **kwargs
):
10720 """GetDisabledBitmap(self) -> Bitmap"""
10721 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
10723 def SetMarginWidth(*args
, **kwargs
):
10724 """SetMarginWidth(self, int nWidth)"""
10725 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
10727 def GetMarginWidth(*args
, **kwargs
):
10728 """GetMarginWidth(self) -> int"""
10729 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
10731 def GetDefaultMarginWidth(*args
, **kwargs
):
10732 """GetDefaultMarginWidth() -> int"""
10733 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10735 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
10736 def IsOwnerDrawn(*args
, **kwargs
):
10737 """IsOwnerDrawn(self) -> bool"""
10738 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
10740 def SetOwnerDrawn(*args
, **kwargs
):
10741 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10742 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
10744 def ResetOwnerDrawn(*args
, **kwargs
):
10745 """ResetOwnerDrawn(self)"""
10746 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
10748 _core_
.MenuItem_swigregister(MenuItem
)
10750 def MenuItem_GetLabelFromText(*args
, **kwargs
):
10751 """MenuItem_GetLabelFromText(String text) -> String"""
10752 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10754 def MenuItem_GetDefaultMarginWidth(*args
):
10755 """MenuItem_GetDefaultMarginWidth() -> int"""
10756 return _core_
.MenuItem_GetDefaultMarginWidth(*args
)
10758 #---------------------------------------------------------------------------
10760 class Control(Window
):
10762 This is the base class for a control or 'widget'.
10764 A control is generally a small window which processes user input
10765 and/or displays one or more item of data.
10767 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10768 __repr__
= _swig_repr
10769 def __init__(self
, *args
, **kwargs
):
10771 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10772 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10773 String name=ControlNameStr) -> Control
10775 Create a Control. Normally you should only call this from a subclass'
10776 __init__ as a plain old wx.Control is not very useful.
10778 _core_
.Control_swiginit(self
,_core_
.new_Control(*args
, **kwargs
))
10779 self
._setOORInfo
(self
)
10781 def Create(*args
, **kwargs
):
10783 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10784 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10785 String name=ControlNameStr) -> bool
10787 Do the 2nd phase and create the GUI control.
10789 return _core_
.Control_Create(*args
, **kwargs
)
10791 def GetAlignment(*args
, **kwargs
):
10793 GetAlignment(self) -> int
10795 Get the control alignment (left/right/centre, top/bottom/centre)
10797 return _core_
.Control_GetAlignment(*args
, **kwargs
)
10799 def GetLabelText(*args
, **kwargs
):
10801 GetLabelText(self) -> String
10803 Get just the text of the label, without mnemonic characters ('&')
10805 return _core_
.Control_GetLabelText(*args
, **kwargs
)
10807 def Command(*args
, **kwargs
):
10809 Command(self, CommandEvent event)
10811 Simulates the effect of the user issuing a command to the item.
10813 :see: `wx.CommandEvent`
10816 return _core_
.Control_Command(*args
, **kwargs
)
10818 def GetLabel(*args
, **kwargs
):
10820 GetLabel(self) -> String
10822 Return a control's text.
10824 return _core_
.Control_GetLabel(*args
, **kwargs
)
10826 def GetClassDefaultAttributes(*args
, **kwargs
):
10828 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10830 Get the default attributes for this class. This is useful if you want
10831 to use the same font or colour in your own control as in a standard
10832 control -- which is a much better idea than hard coding specific
10833 colours or fonts which might look completely out of place on the
10834 user's system, especially if it uses themes.
10836 The variant parameter is only relevant under Mac currently and is
10837 ignore under other platforms. Under Mac, it will change the size of
10838 the returned font. See `wx.Window.SetWindowVariant` for more about
10841 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10843 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
10844 Alignment
= property(GetAlignment
,doc
="See `GetAlignment`")
10845 Label
= property(GetLabel
,doc
="See `GetLabel`")
10846 LabelText
= property(GetLabelText
,doc
="See `GetLabelText`")
10847 _core_
.Control_swigregister(Control
)
10848 ControlNameStr
= cvar
.ControlNameStr
10850 def PreControl(*args
, **kwargs
):
10852 PreControl() -> Control
10854 Precreate a Control control for 2-phase creation
10856 val
= _core_
.new_PreControl(*args
, **kwargs
)
10859 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
10861 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10863 Get the default attributes for this class. This is useful if you want
10864 to use the same font or colour in your own control as in a standard
10865 control -- which is a much better idea than hard coding specific
10866 colours or fonts which might look completely out of place on the
10867 user's system, especially if it uses themes.
10869 The variant parameter is only relevant under Mac currently and is
10870 ignore under other platforms. Under Mac, it will change the size of
10871 the returned font. See `wx.Window.SetWindowVariant` for more about
10874 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10876 #---------------------------------------------------------------------------
10878 class ItemContainer(object):
10880 The wx.ItemContainer class defines an interface which is implemented
10881 by all controls which have string subitems, each of which may be
10882 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10883 as `wx.ComboBox` which implements an extended interface deriving from
10886 It defines the methods for accessing the control's items and although
10887 each of the derived classes implements them differently, they still
10888 all conform to the same interface.
10890 The items in a wx.ItemContainer have (non empty) string labels and,
10891 optionally, client data associated with them.
10894 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10895 def __init__(self
): raise AttributeError, "No constructor defined"
10896 __repr__
= _swig_repr
10897 def Append(*args
, **kwargs
):
10899 Append(self, String item, PyObject clientData=None) -> int
10901 Adds the item to the control, associating the given data with the item
10902 if not None. The return value is the index of the newly added item
10903 which may be different from the last one if the control is sorted (e.g.
10904 has wx.LB_SORT or wx.CB_SORT style).
10906 return _core_
.ItemContainer_Append(*args
, **kwargs
)
10908 def AppendItems(*args
, **kwargs
):
10910 AppendItems(self, List strings)
10912 Apend several items at once to the control. Notice that calling this
10913 method may be much faster than appending the items one by one if you
10914 need to add a lot of items.
10916 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
10918 def Insert(*args
, **kwargs
):
10920 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10922 Insert an item into the control before the item at the ``pos`` index,
10923 optionally associating some data object with the item.
10925 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
10927 def Clear(*args
, **kwargs
):
10931 Removes all items from the control.
10933 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
10935 def Delete(*args
, **kwargs
):
10937 Delete(self, unsigned int n)
10939 Deletes the item at the zero-based index 'n' from the control. Note
10940 that it is an error (signalled by a `wx.PyAssertionError` exception if
10941 enabled) to remove an item with the index negative or greater or equal
10942 than the number of items in the control.
10944 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
10946 def GetClientData(*args
, **kwargs
):
10948 GetClientData(self, unsigned int n) -> PyObject
10950 Returns the client data associated with the given item, (if any.)
10952 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
10954 def SetClientData(*args
, **kwargs
):
10956 SetClientData(self, unsigned int n, PyObject clientData)
10958 Associate the given client data with the item at position n.
10960 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
10962 def GetCount(*args
, **kwargs
):
10964 GetCount(self) -> unsigned int
10966 Returns the number of items in the control.
10968 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
10970 def IsEmpty(*args
, **kwargs
):
10972 IsEmpty(self) -> bool
10974 Returns True if the control is empty or False if it has some items.
10976 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
10978 def GetString(*args
, **kwargs
):
10980 GetString(self, unsigned int n) -> String
10982 Returns the label of the item with the given index.
10984 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
10986 def GetStrings(*args
, **kwargs
):
10987 """GetStrings(self) -> wxArrayString"""
10988 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
10990 def SetString(*args
, **kwargs
):
10992 SetString(self, unsigned int n, String s)
10994 Sets the label for the given item.
10996 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
10998 def FindString(*args
, **kwargs
):
11000 FindString(self, String s) -> int
11002 Finds an item whose label matches the given string. Returns the
11003 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11006 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
11008 def SetSelection(*args
, **kwargs
):
11010 SetSelection(self, int n)
11012 Sets the item at index 'n' to be the selected item.
11014 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
11016 def GetSelection(*args
, **kwargs
):
11018 GetSelection(self) -> int
11020 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11023 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
11025 def SetStringSelection(*args
, **kwargs
):
11026 """SetStringSelection(self, String s) -> bool"""
11027 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
11029 def GetStringSelection(*args
, **kwargs
):
11031 GetStringSelection(self) -> String
11033 Returns the label of the selected item or an empty string if no item
11036 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
11038 def Select(*args
, **kwargs
):
11040 Select(self, int n)
11042 This is the same as `SetSelection` and exists only because it is
11043 slightly more natural for controls which support multiple selection.
11045 return _core_
.ItemContainer_Select(*args
, **kwargs
)
11047 def GetItems(self
):
11048 """Return a list of the strings in the control"""
11049 return [self
.GetString(i
) for i
in xrange(self
.GetCount())]
11051 def SetItems(self
, items
):
11052 """Clear and set the strings in the control from a list"""
11057 Count
= property(GetCount
,doc
="See `GetCount`")
11058 Items
= property(GetItems
,SetItems
,doc
="See `GetItems` and `SetItems`")
11059 Selection
= property(GetSelection
,SetSelection
,doc
="See `GetSelection` and `SetSelection`")
11060 StringSelection
= property(GetStringSelection
,SetStringSelection
,doc
="See `GetStringSelection` and `SetStringSelection`")
11061 Strings
= property(GetStrings
,doc
="See `GetStrings`")
11062 _core_
.ItemContainer_swigregister(ItemContainer
)
11064 #---------------------------------------------------------------------------
11066 class ControlWithItems(Control
,ItemContainer
):
11068 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11069 wx.Control class, and is used for the base class of various controls
11072 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11073 def __init__(self
): raise AttributeError, "No constructor defined"
11074 __repr__
= _swig_repr
11075 _core_
.ControlWithItems_swigregister(ControlWithItems
)
11077 #---------------------------------------------------------------------------
11079 class SizerItem(Object
):
11081 The wx.SizerItem class is used to track the position, size and other
11082 attributes of each item managed by a `wx.Sizer`. It is not usually
11083 necessary to use this class because the sizer elements can also be
11084 identified by their positions or window or sizer references but
11085 sometimes it may be more convenient to use wx.SizerItem directly.
11086 Also, custom classes derived from `wx.PySizer` will probably need to
11087 use the collection of wx.SizerItems held by wx.Sizer when calculating
11090 :see: `wx.Sizer`, `wx.GBSizerItem`
11092 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11093 __repr__
= _swig_repr
11094 def __init__(self
, *args
, **kwargs
):
11096 __init__(self) -> SizerItem
11098 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11099 size will need to be set before this item can be used in a Sizer.
11101 You will probably never need to create a wx.SizerItem directly as they
11102 are created automatically when the sizer's Add, Insert or Prepend
11103 methods are called.
11105 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11107 _core_
.SizerItem_swiginit(self
,_core_
.new_SizerItem(*args
, **kwargs
))
11108 __swig_destroy__
= _core_
.delete_SizerItem
11109 __del__
= lambda self
: None;
11110 def DeleteWindows(*args
, **kwargs
):
11112 DeleteWindows(self)
11114 Destroy the window or the windows in a subsizer, depending on the type
11117 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
11119 def DetachSizer(*args
, **kwargs
):
11123 Enable deleting the SizerItem without destroying the contained sizer.
11125 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
11127 def GetSize(*args
, **kwargs
):
11129 GetSize(self) -> Size
11131 Get the current size of the item, as set in the last Layout.
11133 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
11135 def CalcMin(*args
, **kwargs
):
11137 CalcMin(self) -> Size
11139 Calculates the minimum desired size for the item, including any space
11142 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
11144 def SetDimension(*args
, **kwargs
):
11146 SetDimension(self, Point pos, Size size)
11148 Set the position and size of the space allocated for this item by the
11149 sizer, and adjust the position and size of the item (window or
11150 subsizer) to be within that space taking alignment and borders into
11153 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
11155 def GetMinSize(*args
, **kwargs
):
11157 GetMinSize(self) -> Size
11159 Get the minimum size needed for the item.
11161 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
11163 def GetMinSizeWithBorder(*args
, **kwargs
):
11165 GetMinSizeWithBorder(self) -> Size
11167 Get the minimum size needed for the item with space for the borders
11170 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
11172 def SetInitSize(*args
, **kwargs
):
11173 """SetInitSize(self, int x, int y)"""
11174 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
11176 def SetRatioWH(*args
, **kwargs
):
11178 SetRatioWH(self, int width, int height)
11180 Set the ratio item attribute.
11182 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
11184 def SetRatioSize(*args
, **kwargs
):
11186 SetRatioSize(self, Size size)
11188 Set the ratio item attribute.
11190 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
11192 def SetRatio(*args
, **kwargs
):
11194 SetRatio(self, float ratio)
11196 Set the ratio item attribute.
11198 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
11200 def GetRatio(*args
, **kwargs
):
11202 GetRatio(self) -> float
11204 Set the ratio item attribute.
11206 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
11208 def GetRect(*args
, **kwargs
):
11210 GetRect(self) -> Rect
11212 Returns the rectangle that the sizer item should occupy
11214 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
11216 def IsWindow(*args
, **kwargs
):
11218 IsWindow(self) -> bool
11220 Is this sizer item a window?
11222 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
11224 def IsSizer(*args
, **kwargs
):
11226 IsSizer(self) -> bool
11228 Is this sizer item a subsizer?
11230 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
11232 def IsSpacer(*args
, **kwargs
):
11234 IsSpacer(self) -> bool
11236 Is this sizer item a spacer?
11238 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
11240 def SetProportion(*args
, **kwargs
):
11242 SetProportion(self, int proportion)
11244 Set the proportion value for this item.
11246 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
11248 def GetProportion(*args
, **kwargs
):
11250 GetProportion(self) -> int
11252 Get the proportion value for this item.
11254 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
11256 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
11257 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
11258 def SetFlag(*args
, **kwargs
):
11260 SetFlag(self, int flag)
11262 Set the flag value for this item.
11264 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
11266 def GetFlag(*args
, **kwargs
):
11268 GetFlag(self) -> int
11270 Get the flag value for this item.
11272 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
11274 def SetBorder(*args
, **kwargs
):
11276 SetBorder(self, int border)
11278 Set the border value for this item.
11280 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
11282 def GetBorder(*args
, **kwargs
):
11284 GetBorder(self) -> int
11286 Get the border value for this item.
11288 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
11290 def GetWindow(*args
, **kwargs
):
11292 GetWindow(self) -> Window
11294 Get the window (if any) that is managed by this sizer item.
11296 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
11298 def SetWindow(*args
, **kwargs
):
11300 SetWindow(self, Window window)
11302 Set the window to be managed by this sizer item.
11304 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
11306 def GetSizer(*args
, **kwargs
):
11308 GetSizer(self) -> Sizer
11310 Get the subsizer (if any) that is managed by this sizer item.
11312 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
11314 def SetSizer(*args
, **kwargs
):
11316 SetSizer(self, Sizer sizer)
11318 Set the subsizer to be managed by this sizer item.
11320 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
11322 def GetSpacer(*args
, **kwargs
):
11324 GetSpacer(self) -> Size
11326 Get the size of the spacer managed by this sizer item.
11328 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
11330 def SetSpacer(*args
, **kwargs
):
11332 SetSpacer(self, Size size)
11334 Set the size of the spacer to be managed by this sizer item.
11336 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
11338 def Show(*args
, **kwargs
):
11340 Show(self, bool show)
11342 Set the show item attribute, which sizers use to determine if the item
11343 is to be made part of the layout or not. If the item is tracking a
11344 window then it is shown or hidden as needed.
11346 return _core_
.SizerItem_Show(*args
, **kwargs
)
11348 def IsShown(*args
, **kwargs
):
11350 IsShown(self) -> bool
11352 Is the item to be shown in the layout?
11354 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
11356 def GetPosition(*args
, **kwargs
):
11358 GetPosition(self) -> Point
11360 Returns the current position of the item, as set in the last Layout.
11362 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
11364 def GetUserData(*args
, **kwargs
):
11366 GetUserData(self) -> PyObject
11368 Returns the userData associated with this sizer item, or None if there
11371 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
11373 def SetUserData(*args
, **kwargs
):
11375 SetUserData(self, PyObject userData)
11377 Associate a Python object with this sizer item.
11379 return _core_
.SizerItem_SetUserData(*args
, **kwargs
)
11381 _core_
.SizerItem_swigregister(SizerItem
)
11383 def SizerItemWindow(*args
, **kwargs
):
11385 SizerItemWindow(Window window, int proportion, int flag, int border,
11386 PyObject userData=None) -> SizerItem
11388 Constructs a `wx.SizerItem` for tracking a window.
11390 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
11393 def SizerItemSpacer(*args
, **kwargs
):
11395 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11396 PyObject userData=None) -> SizerItem
11398 Constructs a `wx.SizerItem` for tracking a spacer.
11400 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
11403 def SizerItemSizer(*args
, **kwargs
):
11405 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11406 PyObject userData=None) -> SizerItem
11408 Constructs a `wx.SizerItem` for tracking a subsizer
11410 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
11413 class Sizer(Object
):
11415 wx.Sizer is the abstract base class used for laying out subwindows in
11416 a window. You cannot use wx.Sizer directly; instead, you will have to
11417 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11418 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11421 The concept implemented by sizers in wxWidgets is closely related to
11422 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11423 toolkit or the Qt toolkit. It is based upon the idea of the individual
11424 subwindows reporting their minimal required size and their ability to
11425 get stretched if the size of the parent window has changed. This will
11426 most often mean that the programmer does not set the original size of
11427 a dialog in the beginning, rather the dialog will assigned a sizer and
11428 this sizer will be queried about the recommended size. The sizer in
11429 turn will query its children, which can be normal windows or contorls,
11430 empty space or other sizers, so that a hierarchy of sizers can be
11431 constructed. Note that wxSizer does not derive from wxWindow and thus
11432 do not interfere with tab ordering and requires very little resources
11433 compared to a real window on screen.
11435 What makes sizers so well fitted for use in wxWidgets is the fact that
11436 every control reports its own minimal size and the algorithm can
11437 handle differences in font sizes or different window (dialog item)
11438 sizes on different platforms without problems. If for example the
11439 standard font as well as the overall design of Mac widgets requires
11440 more space than on Windows, then the initial size of a dialog using a
11441 sizer will automatically be bigger on Mac than on Windows.
11443 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11444 def __init__(self
): raise AttributeError, "No constructor defined"
11445 __repr__
= _swig_repr
11446 __swig_destroy__
= _core_
.delete_Sizer
11447 __del__
= lambda self
: None;
11448 def _setOORInfo(*args
, **kwargs
):
11449 """_setOORInfo(self, PyObject _self)"""
11450 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
11452 def Add(*args
, **kwargs
):
11454 Add(self, item, int proportion=0, int flag=0, int border=0,
11455 PyObject userData=None) -> wx.SizerItem
11457 Appends a child item to the sizer.
11459 return _core_
.Sizer_Add(*args
, **kwargs
)
11461 def Insert(*args
, **kwargs
):
11463 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11464 PyObject userData=None) -> wx.SizerItem
11466 Inserts a new item into the list of items managed by this sizer before
11467 the item at index *before*. See `Add` for a description of the parameters.
11469 return _core_
.Sizer_Insert(*args
, **kwargs
)
11471 def Prepend(*args
, **kwargs
):
11473 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11474 PyObject userData=None) -> wx.SizerItem
11476 Adds a new item to the begining of the list of sizer items managed by
11477 this sizer. See `Add` for a description of the parameters.
11479 return _core_
.Sizer_Prepend(*args
, **kwargs
)
11481 def Remove(*args
, **kwargs
):
11483 Remove(self, item) -> bool
11485 Removes an item from the sizer and destroys it. This method does not
11486 cause any layout or resizing to take place, call `Layout` to update
11487 the layout on screen after removing a child from the sizer. The
11488 *item* parameter can be either a window, a sizer, or the zero-based
11489 index of an item to remove. Returns True if the child item was found
11492 return _core_
.Sizer_Remove(*args
, **kwargs
)
11494 def Detach(*args
, **kwargs
):
11496 Detach(self, item) -> bool
11498 Detaches an item from the sizer without destroying it. This method
11499 does not cause any layout or resizing to take place, call `Layout` to
11500 do so. The *item* parameter can be either a window, a sizer, or the
11501 zero-based index of the item to be detached. Returns True if the child item
11502 was found and detached.
11504 return _core_
.Sizer_Detach(*args
, **kwargs
)
11506 def GetItem(*args
, **kwargs
):
11508 GetItem(self, item) -> wx.SizerItem
11510 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11511 parameter can be either a window, a sizer, or the zero-based index of
11512 the item to be found.
11514 return _core_
.Sizer_GetItem(*args
, **kwargs
)
11516 def _SetItemMinSize(*args
, **kwargs
):
11517 """_SetItemMinSize(self, PyObject item, Size size)"""
11518 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
11520 def _ReplaceWin(*args
, **kwargs
):
11521 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11522 return _core_
.Sizer__ReplaceWin(*args
, **kwargs
)
11524 def _ReplaceSizer(*args
, **kwargs
):
11525 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11526 return _core_
.Sizer__ReplaceSizer(*args
, **kwargs
)
11528 def _ReplaceItem(*args
, **kwargs
):
11529 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11530 return _core_
.Sizer__ReplaceItem(*args
, **kwargs
)
11532 def Replace(self
, olditem
, item
, recursive
=False):
11534 Detaches the given ``olditem`` from the sizer and replaces it with
11535 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11536 detached child is destroyed only if it is not a window, (because
11537 windows are owned by their parent, not the sizer.) The
11538 ``recursive`` parameter can be used to search for the given
11539 element recursivly in subsizers.
11541 This method does not cause any layout or resizing to take place,
11542 call `Layout` to do so.
11544 Returns ``True`` if the child item was found and removed.
11546 if isinstance(olditem
, wx
.Window
):
11547 return self
._ReplaceWin
(olditem
, item
, recursive
)
11548 elif isinstnace(olditem
, wx
.Sizer
):
11549 return self
._ReplaceSizer
(olditem
, item
, recursive
)
11550 elif isinstnace(olditem
, int):
11551 return self
._ReplaceItem
(olditem
, item
)
11553 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11555 def SetContainingWindow(*args
, **kwargs
):
11557 SetContainingWindow(self, Window window)
11559 Set (or unset) the window this sizer is used in.
11561 return _core_
.Sizer_SetContainingWindow(*args
, **kwargs
)
11563 def GetContainingWindow(*args
, **kwargs
):
11565 GetContainingWindow(self) -> Window
11567 Get the window this sizer is used in.
11569 return _core_
.Sizer_GetContainingWindow(*args
, **kwargs
)
11571 def SetItemMinSize(self
, item
, *args
):
11573 SetItemMinSize(self, item, Size size)
11575 Sets the minimum size that will be allocated for an item in the sizer.
11576 The *item* parameter can be either a window, a sizer, or the
11577 zero-based index of the item. If a window or sizer is given then it
11578 will be searched for recursivly in subsizers if neccessary.
11581 # for backward compatibility accept separate width,height args too
11582 return self
._SetItemMinSize
(item
, args
)
11584 return self
._SetItemMinSize
(item
, args
[0])
11586 def AddItem(*args
, **kwargs
):
11588 AddItem(self, SizerItem item)
11590 Adds a `wx.SizerItem` to the sizer.
11592 return _core_
.Sizer_AddItem(*args
, **kwargs
)
11594 def InsertItem(*args
, **kwargs
):
11596 InsertItem(self, int index, SizerItem item)
11598 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11600 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
11602 def PrependItem(*args
, **kwargs
):
11604 PrependItem(self, SizerItem item)
11606 Prepends a `wx.SizerItem` to the sizer.
11608 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
11610 def AddMany(self
, items
):
11612 AddMany is a convenience method for adding several items
11613 to a sizer at one time. Simply pass it a list of tuples,
11614 where each tuple consists of the parameters that you
11615 would normally pass to the `Add` method.
11618 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
11622 # for backwards compatibility only, please do not use in new code
11623 def AddWindow(self
, *args
, **kw
):
11624 """Compatibility alias for `Add`."""
11625 return self
.Add(*args
, **kw
)
11626 def AddSizer(self
, *args
, **kw
):
11627 """Compatibility alias for `Add`."""
11628 return self
.Add(*args
, **kw
)
11629 def AddSpacer(self
, *args
, **kw
):
11630 """Compatibility alias for `Add`."""
11631 return self
.Add(*args
, **kw
)
11633 def PrependWindow(self
, *args
, **kw
):
11634 """Compatibility alias for `Prepend`."""
11635 return self
.Prepend(*args
, **kw
)
11636 def PrependSizer(self
, *args
, **kw
):
11637 """Compatibility alias for `Prepend`."""
11638 return self
.Prepend(*args
, **kw
)
11639 def PrependSpacer(self
, *args
, **kw
):
11640 """Compatibility alias for `Prepend`."""
11641 return self
.Prepend(*args
, **kw
)
11643 def InsertWindow(self
, *args
, **kw
):
11644 """Compatibility alias for `Insert`."""
11645 return self
.Insert(*args
, **kw
)
11646 def InsertSizer(self
, *args
, **kw
):
11647 """Compatibility alias for `Insert`."""
11648 return self
.Insert(*args
, **kw
)
11649 def InsertSpacer(self
, *args
, **kw
):
11650 """Compatibility alias for `Insert`."""
11651 return self
.Insert(*args
, **kw
)
11653 def RemoveWindow(self
, *args
, **kw
):
11654 """Compatibility alias for `Remove`."""
11655 return self
.Remove(*args
, **kw
)
11656 def RemoveSizer(self
, *args
, **kw
):
11657 """Compatibility alias for `Remove`."""
11658 return self
.Remove(*args
, **kw
)
11659 def RemovePos(self
, *args
, **kw
):
11660 """Compatibility alias for `Remove`."""
11661 return self
.Remove(*args
, **kw
)
11664 def SetDimension(*args
, **kwargs
):
11666 SetDimension(self, int x, int y, int width, int height)
11668 Call this to force the sizer to take the given dimension and thus
11669 force the items owned by the sizer to resize themselves according to
11670 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11673 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
11675 def SetMinSize(*args
, **kwargs
):
11677 SetMinSize(self, Size size)
11679 Call this to give the sizer a minimal size. Normally, the sizer will
11680 calculate its minimal size based purely on how much space its children
11681 need. After calling this method `GetMinSize` will return either the
11682 minimal size as requested by its children or the minimal size set
11683 here, depending on which is bigger.
11685 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
11687 def GetSize(*args
, **kwargs
):
11689 GetSize(self) -> Size
11691 Returns the current size of the space managed by the sizer.
11693 return _core_
.Sizer_GetSize(*args
, **kwargs
)
11695 def GetPosition(*args
, **kwargs
):
11697 GetPosition(self) -> Point
11699 Returns the current position of the sizer's managed space.
11701 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
11703 def GetMinSize(*args
, **kwargs
):
11705 GetMinSize(self) -> Size
11707 Returns the minimal size of the sizer. This is either the combined
11708 minimal size of all the children and their borders or the minimal size
11709 set by SetMinSize, depending on which is bigger.
11711 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
11713 def GetSizeTuple(self
):
11714 return self
.GetSize().Get()
11715 def GetPositionTuple(self
):
11716 return self
.GetPosition().Get()
11717 def GetMinSizeTuple(self
):
11718 return self
.GetMinSize().Get()
11720 def RecalcSizes(*args
, **kwargs
):
11724 Using the sizes calculated by `CalcMin` reposition and resize all the
11725 items managed by this sizer. You should not need to call this directly as
11726 it is called by `Layout`.
11728 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
11730 def CalcMin(*args
, **kwargs
):
11732 CalcMin(self) -> Size
11734 This method is where the sizer will do the actual calculation of its
11735 children's minimal sizes. You should not need to call this directly as
11736 it is called by `Layout`.
11738 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
11740 def Layout(*args
, **kwargs
):
11744 This method will force the recalculation and layout of the items
11745 controlled by the sizer using the current space allocated to the
11746 sizer. Normally this is called automatically from the owning window's
11747 EVT_SIZE handler, but it is also useful to call it from user code when
11748 one of the items in a sizer change size, or items are added or
11751 return _core_
.Sizer_Layout(*args
, **kwargs
)
11753 def Fit(*args
, **kwargs
):
11755 Fit(self, Window window) -> Size
11757 Tell the sizer to resize the *window* to match the sizer's minimal
11758 size. This is commonly done in the constructor of the window itself in
11759 order to set its initial size to match the needs of the children as
11760 determined by the sizer. Returns the new size.
11762 For a top level window this is the total window size, not the client size.
11764 return _core_
.Sizer_Fit(*args
, **kwargs
)
11766 def FitInside(*args
, **kwargs
):
11768 FitInside(self, Window window)
11770 Tell the sizer to resize the *virtual size* of the *window* to match the
11771 sizer's minimal size. This will not alter the on screen size of the
11772 window, but may cause the addition/removal/alteration of scrollbars
11773 required to view the virtual area in windows which manage it.
11775 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11778 return _core_
.Sizer_FitInside(*args
, **kwargs
)
11780 def SetSizeHints(*args
, **kwargs
):
11782 SetSizeHints(self, Window window)
11784 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11785 match the sizer's minimal size. This is commonly done in the
11786 constructor of the window itself if the window is resizable (as are
11787 many dialogs under Unix and frames on probably all platforms) in order
11788 to prevent the window from being sized smaller than the minimal size
11789 required by the sizer.
11791 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
11793 def SetVirtualSizeHints(*args
, **kwargs
):
11795 SetVirtualSizeHints(self, Window window)
11797 Tell the sizer to set the minimal size of the window virtual area to
11798 match the sizer's minimal size. For windows with managed scrollbars
11799 this will set them appropriately.
11801 :see: `wx.ScrolledWindow.SetScrollbars`
11804 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
11806 def Clear(*args
, **kwargs
):
11808 Clear(self, bool deleteWindows=False)
11810 Clear all items from the sizer, optionally destroying the window items
11813 return _core_
.Sizer_Clear(*args
, **kwargs
)
11815 def DeleteWindows(*args
, **kwargs
):
11817 DeleteWindows(self)
11819 Destroy all windows managed by the sizer.
11821 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
11823 def GetChildren(*args
, **kwargs
):
11825 GetChildren(self) -> list
11827 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11829 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
11831 def Show(*args
, **kwargs
):
11833 Show(self, item, bool show=True, bool recursive=false) -> bool
11835 Shows or hides an item managed by the sizer. To make a sizer item
11836 disappear or reappear, use Show followed by `Layout`. The *item*
11837 parameter can be either a window, a sizer, or the zero-based index of
11838 the item. Use the recursive parameter to show or hide an item in a
11839 subsizer. Returns True if the item was found.
11841 return _core_
.Sizer_Show(*args
, **kwargs
)
11843 def IsShown(*args
, **kwargs
):
11845 IsShown(self, item)
11847 Determines if the item is currently shown. To make a sizer
11848 item disappear or reappear, use Show followed by `Layout`. The *item*
11849 parameter can be either a window, a sizer, or the zero-based index of
11852 return _core_
.Sizer_IsShown(*args
, **kwargs
)
11854 def Hide(self
, item
, recursive
=False):
11856 A convenience method for `Show` (item, False, recursive).
11858 return self
.Show(item
, False, recursive
)
11860 def ShowItems(*args
, **kwargs
):
11862 ShowItems(self, bool show)
11864 Recursively call `wx.SizerItem.Show` on all sizer items.
11866 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
11868 _core_
.Sizer_swigregister(Sizer
)
11870 class PySizer(Sizer
):
11872 wx.PySizer is a special version of `wx.Sizer` that has been
11873 instrumented to allow the C++ virtual methods to be overloaded in
11874 Python derived classes. You would derive from this class if you are
11875 wanting to implement a custom sizer in Python code. Simply implement
11876 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11879 class MySizer(wx.PySizer):
11880 def __init__(self):
11881 wx.PySizer.__init__(self)
11884 for item in self.GetChildren():
11885 # calculate the total minimum width and height needed
11886 # by all items in the sizer according to this sizer's
11887 # layout algorithm.
11889 return wx.Size(width, height)
11891 def RecalcSizes(self):
11892 # find the space allotted to this sizer
11893 pos = self.GetPosition()
11894 size = self.GetSize()
11895 for item in self.GetChildren():
11896 # Recalculate (if necessary) the position and size of
11897 # each item and then call item.SetDimension to do the
11898 # actual positioning and sizing of the items within the
11899 # space alloted to this sizer.
11901 item.SetDimension(itemPos, itemSize)
11904 When `Layout` is called it first calls `CalcMin` followed by
11905 `RecalcSizes` so you can optimize a bit by saving the results of
11906 `CalcMin` and reusing them in `RecalcSizes`.
11908 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11912 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11913 __repr__
= _swig_repr
11914 def __init__(self
, *args
, **kwargs
):
11916 __init__(self) -> PySizer
11918 Creates a wx.PySizer. Must be called from the __init__ in the derived
11921 _core_
.PySizer_swiginit(self
,_core_
.new_PySizer(*args
, **kwargs
))
11922 self
._setCallbackInfo
(self
, PySizer
);self
._setOORInfo
(self
)
11924 def _setCallbackInfo(*args
, **kwargs
):
11925 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11926 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
11928 _core_
.PySizer_swigregister(PySizer
)
11930 #---------------------------------------------------------------------------
11932 class BoxSizer(Sizer
):
11934 The basic idea behind a box sizer is that windows will most often be
11935 laid out in rather simple basic geometry, typically in a row or a
11936 column or nested hierarchies of either. A wx.BoxSizer will lay out
11937 its items in a simple row or column, depending on the orientation
11938 parameter passed to the constructor.
11940 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11941 __repr__
= _swig_repr
11942 def __init__(self
, *args
, **kwargs
):
11944 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11946 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11947 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11950 _core_
.BoxSizer_swiginit(self
,_core_
.new_BoxSizer(*args
, **kwargs
))
11951 self
._setOORInfo
(self
)
11953 def GetOrientation(*args
, **kwargs
):
11955 GetOrientation(self) -> int
11957 Returns the current orientation of the sizer.
11959 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
11961 def SetOrientation(*args
, **kwargs
):
11963 SetOrientation(self, int orient)
11965 Resets the orientation of the sizer.
11967 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
11969 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
11970 _core_
.BoxSizer_swigregister(BoxSizer
)
11972 #---------------------------------------------------------------------------
11974 class StaticBoxSizer(BoxSizer
):
11976 wx.StaticBoxSizer derives from and functions identically to the
11977 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11978 manages. Note that this static box must be created separately and
11979 passed to the sizer constructor.
11981 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11982 __repr__
= _swig_repr
11983 def __init__(self
, *args
, **kwargs
):
11985 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11987 Constructor. It takes an associated static box and the orientation
11988 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11991 _core_
.StaticBoxSizer_swiginit(self
,_core_
.new_StaticBoxSizer(*args
, **kwargs
))
11992 self
._setOORInfo
(self
)
11994 def GetStaticBox(*args
, **kwargs
):
11996 GetStaticBox(self) -> StaticBox
11998 Returns the static box associated with this sizer.
12000 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
12002 _core_
.StaticBoxSizer_swigregister(StaticBoxSizer
)
12004 #---------------------------------------------------------------------------
12006 class GridSizer(Sizer
):
12008 A grid sizer is a sizer which lays out its children in a
12009 two-dimensional table with all cells having the same size. In other
12010 words, the width of each cell within the grid is the width of the
12011 widest item added to the sizer and the height of each grid cell is the
12012 height of the tallest item. An optional vertical and/or horizontal
12013 gap between items can also be specified (in pixels.)
12015 Items are placed in the cells of the grid in the order they are added,
12016 in row-major order. In other words, the first row is filled first,
12017 then the second, and so on until all items have been added. (If
12018 neccessary, additional rows will be added as items are added.) If you
12019 need to have greater control over the cells that items are placed in
12020 then use the `wx.GridBagSizer`.
12023 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12024 __repr__
= _swig_repr
12025 def __init__(self
, *args
, **kwargs
):
12027 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12029 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12030 of columns and rows in the sizer - if either of the parameters is
12031 zero, it will be calculated to from the total number of children in
12032 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12033 define extra space between all children.
12035 _core_
.GridSizer_swiginit(self
,_core_
.new_GridSizer(*args
, **kwargs
))
12036 self
._setOORInfo
(self
)
12038 def SetCols(*args
, **kwargs
):
12040 SetCols(self, int cols)
12042 Sets the number of columns in the sizer.
12044 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
12046 def SetRows(*args
, **kwargs
):
12048 SetRows(self, int rows)
12050 Sets the number of rows in the sizer.
12052 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
12054 def SetVGap(*args
, **kwargs
):
12056 SetVGap(self, int gap)
12058 Sets the vertical gap (in pixels) between the cells in the sizer.
12060 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
12062 def SetHGap(*args
, **kwargs
):
12064 SetHGap(self, int gap)
12066 Sets the horizontal gap (in pixels) between cells in the sizer
12068 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
12070 def GetCols(*args
, **kwargs
):
12072 GetCols(self) -> int
12074 Returns the number of columns in the sizer.
12076 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
12078 def GetRows(*args
, **kwargs
):
12080 GetRows(self) -> int
12082 Returns the number of rows in the sizer.
12084 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
12086 def GetVGap(*args
, **kwargs
):
12088 GetVGap(self) -> int
12090 Returns the vertical gap (in pixels) between the cells in the sizer.
12092 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
12094 def GetHGap(*args
, **kwargs
):
12096 GetHGap(self) -> int
12098 Returns the horizontal gap (in pixels) between cells in the sizer.
12100 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
12102 def CalcRowsCols(self
):
12104 CalcRowsCols() -> (rows, cols)
12106 Calculates how many rows and columns will be in the sizer based
12107 on the current number of items and also the rows, cols specified
12108 in the constructor.
12110 nitems
= len(self
.GetChildren())
12111 rows
= self
.GetRows()
12112 cols
= self
.GetCols()
12113 assert rows
!= 0 or cols
!= 0, "Grid sizer must have either rows or columns fixed"
12115 rows
= (nitems
+ cols
- 1) / cols
12117 cols
= (nitems
+ rows
- 1) / rows
12118 return (rows
, cols
)
12120 Cols
= property(GetCols
,SetCols
,doc
="See `GetCols` and `SetCols`")
12121 HGap
= property(GetHGap
,SetHGap
,doc
="See `GetHGap` and `SetHGap`")
12122 Rows
= property(GetRows
,SetRows
,doc
="See `GetRows` and `SetRows`")
12123 VGap
= property(GetVGap
,SetVGap
,doc
="See `GetVGap` and `SetVGap`")
12124 _core_
.GridSizer_swigregister(GridSizer
)
12126 #---------------------------------------------------------------------------
12128 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
12129 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
12130 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
12131 class FlexGridSizer(GridSizer
):
12133 A flex grid sizer is a sizer which lays out its children in a
12134 two-dimensional table with all table cells in one row having the same
12135 height and all cells in one column having the same width, but all
12136 rows or all columns are not necessarily the same height or width as in
12137 the `wx.GridSizer`.
12139 wx.FlexGridSizer can also size items equally in one direction but
12140 unequally ("flexibly") in the other. If the sizer is only flexible
12141 in one direction (this can be changed using `SetFlexibleDirection`), it
12142 needs to be decided how the sizer should grow in the other ("non
12143 flexible") direction in order to fill the available space. The
12144 `SetNonFlexibleGrowMode` method serves this purpose.
12148 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12149 __repr__
= _swig_repr
12150 def __init__(self
, *args
, **kwargs
):
12152 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12154 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12155 number of columns and rows in the sizer - if either of the parameters
12156 is zero, it will be calculated to from the total number of children in
12157 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12158 define extra space between all children.
12160 _core_
.FlexGridSizer_swiginit(self
,_core_
.new_FlexGridSizer(*args
, **kwargs
))
12161 self
._setOORInfo
(self
)
12163 def AddGrowableRow(*args
, **kwargs
):
12165 AddGrowableRow(self, size_t idx, int proportion=0)
12167 Specifies that row *idx* (starting from zero) should be grown if there
12168 is extra space available to the sizer.
12170 The *proportion* parameter has the same meaning as the stretch factor
12171 for the box sizers except that if all proportions are 0, then all
12172 columns are resized equally (instead of not being resized at all).
12174 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
12176 def RemoveGrowableRow(*args
, **kwargs
):
12178 RemoveGrowableRow(self, size_t idx)
12180 Specifies that row *idx* is no longer growable.
12182 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
12184 def AddGrowableCol(*args
, **kwargs
):
12186 AddGrowableCol(self, size_t idx, int proportion=0)
12188 Specifies that column *idx* (starting from zero) should be grown if
12189 there is extra space available to the sizer.
12191 The *proportion* parameter has the same meaning as the stretch factor
12192 for the box sizers except that if all proportions are 0, then all
12193 columns are resized equally (instead of not being resized at all).
12195 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
12197 def RemoveGrowableCol(*args
, **kwargs
):
12199 RemoveGrowableCol(self, size_t idx)
12201 Specifies that column *idx* is no longer growable.
12203 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
12205 def SetFlexibleDirection(*args
, **kwargs
):
12207 SetFlexibleDirection(self, int direction)
12209 Specifies whether the sizer should flexibly resize its columns, rows,
12210 or both. Argument *direction* can be one of the following values. Any
12211 other value is ignored.
12213 ============== =======================================
12214 wx.VERTICAL Rows are flexibly sized.
12215 wx.HORIZONTAL Columns are flexibly sized.
12216 wx.BOTH Both rows and columns are flexibly sized
12217 (this is the default value).
12218 ============== =======================================
12220 Note that this method does not trigger relayout.
12223 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
12225 def GetFlexibleDirection(*args
, **kwargs
):
12227 GetFlexibleDirection(self) -> int
12229 Returns a value that specifies whether the sizer
12230 flexibly resizes its columns, rows, or both (default).
12232 :see: `SetFlexibleDirection`
12234 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
12236 def SetNonFlexibleGrowMode(*args
, **kwargs
):
12238 SetNonFlexibleGrowMode(self, int mode)
12240 Specifies how the sizer should grow in the non-flexible direction if
12241 there is one (so `SetFlexibleDirection` must have been called
12242 previously). Argument *mode* can be one of the following values:
12244 ========================== =================================================
12245 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12246 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12247 `AddGrowableCol` and `AddGrowableRow`. In this
12248 case equal sizing applies to minimum sizes of
12249 columns or rows (this is the default value).
12250 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12251 the non flexible direction, whether they are
12252 growable or not in the flexbile direction.
12253 ========================== =================================================
12255 Note that this method does not trigger relayout.
12257 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
12259 def GetNonFlexibleGrowMode(*args
, **kwargs
):
12261 GetNonFlexibleGrowMode(self) -> int
12263 Returns the value that specifies how the sizer grows in the
12264 non-flexible direction if there is one.
12266 :see: `SetNonFlexibleGrowMode`
12268 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
12270 def GetRowHeights(*args
, **kwargs
):
12272 GetRowHeights(self) -> list
12274 Returns a list of integers representing the heights of each of the
12277 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
12279 def GetColWidths(*args
, **kwargs
):
12281 GetColWidths(self) -> list
12283 Returns a list of integers representing the widths of each of the
12284 columns in the sizer.
12286 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
12288 ColWidths
= property(GetColWidths
,doc
="See `GetColWidths`")
12289 FlexibleDirection
= property(GetFlexibleDirection
,SetFlexibleDirection
,doc
="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12290 NonFlexibleGrowMode
= property(GetNonFlexibleGrowMode
,SetNonFlexibleGrowMode
,doc
="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12291 RowHeights
= property(GetRowHeights
,doc
="See `GetRowHeights`")
12292 _core_
.FlexGridSizer_swigregister(FlexGridSizer
)
12294 class StdDialogButtonSizer(BoxSizer
):
12296 A special sizer that knows how to order and position standard buttons
12297 in order to conform to the current platform's standards. You simply
12298 need to add each `wx.Button` to the sizer, and be sure to create the
12299 buttons using the standard ID's. Then call `Realize` and the sizer
12300 will take care of the rest.
12303 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12304 __repr__
= _swig_repr
12305 def __init__(self
, *args
, **kwargs
):
12306 """__init__(self) -> StdDialogButtonSizer"""
12307 _core_
.StdDialogButtonSizer_swiginit(self
,_core_
.new_StdDialogButtonSizer(*args
, **kwargs
))
12308 def AddButton(*args
, **kwargs
):
12310 AddButton(self, wxButton button)
12312 Use this to add the buttons to this sizer. Do not use the `Add`
12313 method in the base class.
12315 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
12317 def Realize(*args
, **kwargs
):
12321 This funciton needs to be called after all the buttons have been added
12322 to the sizer. It will reorder them and position them in a platform
12325 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
12327 def SetAffirmativeButton(*args
, **kwargs
):
12328 """SetAffirmativeButton(self, wxButton button)"""
12329 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
12331 def SetNegativeButton(*args
, **kwargs
):
12332 """SetNegativeButton(self, wxButton button)"""
12333 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
12335 def SetCancelButton(*args
, **kwargs
):
12336 """SetCancelButton(self, wxButton button)"""
12337 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
12339 def GetAffirmativeButton(*args
, **kwargs
):
12340 """GetAffirmativeButton(self) -> wxButton"""
12341 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
12343 def GetApplyButton(*args
, **kwargs
):
12344 """GetApplyButton(self) -> wxButton"""
12345 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
12347 def GetNegativeButton(*args
, **kwargs
):
12348 """GetNegativeButton(self) -> wxButton"""
12349 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
12351 def GetCancelButton(*args
, **kwargs
):
12352 """GetCancelButton(self) -> wxButton"""
12353 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
12355 def GetHelpButton(*args
, **kwargs
):
12356 """GetHelpButton(self) -> wxButton"""
12357 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
12359 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizer
)
12361 #---------------------------------------------------------------------------
12363 class GBPosition(object):
12365 This class represents the position of an item in a virtual grid of
12366 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12367 typemaps that will automatically convert from a 2-element sequence of
12368 integers to a wx.GBPosition, so you can use the more pythonic
12369 representation of the position nearly transparently in Python code.
12371 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12372 __repr__
= _swig_repr
12373 def __init__(self
, *args
, **kwargs
):
12375 __init__(self, int row=0, int col=0) -> GBPosition
12377 This class represents the position of an item in a virtual grid of
12378 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12379 typemaps that will automatically convert from a 2-element sequence of
12380 integers to a wx.GBPosition, so you can use the more pythonic
12381 representation of the position nearly transparently in Python code.
12383 _core_
.GBPosition_swiginit(self
,_core_
.new_GBPosition(*args
, **kwargs
))
12384 __swig_destroy__
= _core_
.delete_GBPosition
12385 __del__
= lambda self
: None;
12386 def GetRow(*args
, **kwargs
):
12387 """GetRow(self) -> int"""
12388 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
12390 def GetCol(*args
, **kwargs
):
12391 """GetCol(self) -> int"""
12392 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
12394 def SetRow(*args
, **kwargs
):
12395 """SetRow(self, int row)"""
12396 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
12398 def SetCol(*args
, **kwargs
):
12399 """SetCol(self, int col)"""
12400 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
12402 def __eq__(*args
, **kwargs
):
12404 __eq__(self, PyObject other) -> bool
12406 Compare GBPosition for equality.
12408 return _core_
.GBPosition___eq__(*args
, **kwargs
)
12410 def __ne__(*args
, **kwargs
):
12412 __ne__(self, PyObject other) -> bool
12414 Compare GBPosition for inequality.
12416 return _core_
.GBPosition___ne__(*args
, **kwargs
)
12418 def Set(*args
, **kwargs
):
12419 """Set(self, int row=0, int col=0)"""
12420 return _core_
.GBPosition_Set(*args
, **kwargs
)
12422 def Get(*args
, **kwargs
):
12423 """Get(self) -> PyObject"""
12424 return _core_
.GBPosition_Get(*args
, **kwargs
)
12426 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12427 def __str__(self
): return str(self
.Get())
12428 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
12429 def __len__(self
): return len(self
.Get())
12430 def __getitem__(self
, index
): return self
.Get()[index
]
12431 def __setitem__(self
, index
, val
):
12432 if index
== 0: self
.SetRow(val
)
12433 elif index
== 1: self
.SetCol(val
)
12434 else: raise IndexError
12435 def __nonzero__(self
): return self
.Get() != (0,0)
12436 __safe_for_unpickling__
= True
12437 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
12439 row
= property(GetRow
, SetRow
)
12440 col
= property(GetCol
, SetCol
)
12442 _core_
.GBPosition_swigregister(GBPosition
)
12444 class GBSpan(object):
12446 This class is used to hold the row and column spanning attributes of
12447 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12448 automatically convert from a 2-element sequence of integers to a
12449 wx.GBSpan, so you can use the more pythonic representation of the span
12450 nearly transparently in Python code.
12453 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12454 __repr__
= _swig_repr
12455 def __init__(self
, *args
, **kwargs
):
12457 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12459 Construct a new wxGBSpan, optionally setting the rowspan and
12460 colspan. The default is (1,1). (Meaning that the item occupies one
12461 cell in each direction.
12463 _core_
.GBSpan_swiginit(self
,_core_
.new_GBSpan(*args
, **kwargs
))
12464 __swig_destroy__
= _core_
.delete_GBSpan
12465 __del__
= lambda self
: None;
12466 def GetRowspan(*args
, **kwargs
):
12467 """GetRowspan(self) -> int"""
12468 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
12470 def GetColspan(*args
, **kwargs
):
12471 """GetColspan(self) -> int"""
12472 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
12474 def SetRowspan(*args
, **kwargs
):
12475 """SetRowspan(self, int rowspan)"""
12476 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
12478 def SetColspan(*args
, **kwargs
):
12479 """SetColspan(self, int colspan)"""
12480 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
12482 def __eq__(*args
, **kwargs
):
12484 __eq__(self, PyObject other) -> bool
12486 Compare wxGBSpan for equality.
12488 return _core_
.GBSpan___eq__(*args
, **kwargs
)
12490 def __ne__(*args
, **kwargs
):
12492 __ne__(self, PyObject other) -> bool
12494 Compare GBSpan for inequality.
12496 return _core_
.GBSpan___ne__(*args
, **kwargs
)
12498 def Set(*args
, **kwargs
):
12499 """Set(self, int rowspan=1, int colspan=1)"""
12500 return _core_
.GBSpan_Set(*args
, **kwargs
)
12502 def Get(*args
, **kwargs
):
12503 """Get(self) -> PyObject"""
12504 return _core_
.GBSpan_Get(*args
, **kwargs
)
12506 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12507 def __str__(self
): return str(self
.Get())
12508 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
12509 def __len__(self
): return len(self
.Get())
12510 def __getitem__(self
, index
): return self
.Get()[index
]
12511 def __setitem__(self
, index
, val
):
12512 if index
== 0: self
.SetRowspan(val
)
12513 elif index
== 1: self
.SetColspan(val
)
12514 else: raise IndexError
12515 def __nonzero__(self
): return self
.Get() != (0,0)
12516 __safe_for_unpickling__
= True
12517 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
12519 rowspan
= property(GetRowspan
, SetRowspan
)
12520 colspan
= property(GetColspan
, SetColspan
)
12522 _core_
.GBSpan_swigregister(GBSpan
)
12524 class GBSizerItem(SizerItem
):
12526 The wx.GBSizerItem class is used to track the additional data about
12527 items in a `wx.GridBagSizer` such as the item's position in the grid
12528 and how many rows or columns it spans.
12531 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12532 __repr__
= _swig_repr
12533 def __init__(self
, *args
, **kwargs
):
12535 __init__(self) -> GBSizerItem
12537 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12538 size will need to be set, as well as a position and span before this
12539 item can be used in a Sizer.
12541 You will probably never need to create a wx.GBSizerItem directly as they
12542 are created automatically when the sizer's Add method is called.
12544 _core_
.GBSizerItem_swiginit(self
,_core_
.new_GBSizerItem(*args
, **kwargs
))
12545 __swig_destroy__
= _core_
.delete_GBSizerItem
12546 __del__
= lambda self
: None;
12547 def GetPos(*args
, **kwargs
):
12549 GetPos(self) -> GBPosition
12551 Get the grid position of the item
12553 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
12555 def GetPosTuple(self
): return self
.GetPos().Get()
12556 def GetSpan(*args
, **kwargs
):
12558 GetSpan(self) -> GBSpan
12560 Get the row and column spanning of the item
12562 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
12564 def GetSpanTuple(self
): return self
.GetSpan().Get()
12565 def SetPos(*args
, **kwargs
):
12567 SetPos(self, GBPosition pos) -> bool
12569 If the item is already a member of a sizer then first ensure that
12570 there is no other item that would intersect with this one at the new
12571 position, then set the new position. Returns True if the change is
12572 successful and after the next Layout() the item will be moved.
12574 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
12576 def SetSpan(*args
, **kwargs
):
12578 SetSpan(self, GBSpan span) -> bool
12580 If the item is already a member of a sizer then first ensure that
12581 there is no other item that would intersect with this one with its new
12582 spanning size, then set the new spanning. Returns True if the change
12583 is successful and after the next Layout() the item will be resized.
12586 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
12588 def Intersects(*args
, **kwargs
):
12590 Intersects(self, GBSizerItem other) -> bool
12592 Returns True if this item and the other item instersect.
12594 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
12596 def IntersectsPos(*args
, **kwargs
):
12598 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12600 Returns True if the given pos/span would intersect with this item.
12602 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
12604 def GetEndPos(*args
, **kwargs
):
12606 GetEndPos(self) -> GBPosition
12608 Get the row and column of the endpoint of this item.
12610 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
12612 def GetGBSizer(*args
, **kwargs
):
12614 GetGBSizer(self) -> GridBagSizer
12616 Get the sizer this item is a member of.
12618 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
12620 def SetGBSizer(*args
, **kwargs
):
12622 SetGBSizer(self, GridBagSizer sizer)
12624 Set the sizer this item is a member of.
12626 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
12628 EndPos
= property(GetEndPos
,doc
="See `GetEndPos`")
12629 GBSizer
= property(GetGBSizer
,SetGBSizer
,doc
="See `GetGBSizer` and `SetGBSizer`")
12630 Pos
= property(GetPos
,SetPos
,doc
="See `GetPos` and `SetPos`")
12631 Span
= property(GetSpan
,SetSpan
,doc
="See `GetSpan` and `SetSpan`")
12632 _core_
.GBSizerItem_swigregister(GBSizerItem
)
12633 DefaultSpan
= cvar
.DefaultSpan
12635 def GBSizerItemWindow(*args
, **kwargs
):
12637 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12638 int border, PyObject userData=None) -> GBSizerItem
12640 Construct a `wx.GBSizerItem` for a window.
12642 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
12645 def GBSizerItemSizer(*args
, **kwargs
):
12647 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12648 int border, PyObject userData=None) -> GBSizerItem
12650 Construct a `wx.GBSizerItem` for a sizer
12652 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
12655 def GBSizerItemSpacer(*args
, **kwargs
):
12657 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12658 int flag, int border, PyObject userData=None) -> GBSizerItem
12660 Construct a `wx.GBSizerItem` for a spacer.
12662 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
12665 class GridBagSizer(FlexGridSizer
):
12667 A `wx.Sizer` that can lay out items in a virtual grid like a
12668 `wx.FlexGridSizer` but in this case explicit positioning of the items
12669 is allowed using `wx.GBPosition`, and items can optionally span more
12670 than one row and/or column using `wx.GBSpan`. The total size of the
12671 virtual grid is determined by the largest row and column that items are
12672 positioned at, adjusted for spanning.
12675 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12676 __repr__
= _swig_repr
12677 def __init__(self
, *args
, **kwargs
):
12679 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12681 Constructor, with optional parameters to specify the gap between the
12684 _core_
.GridBagSizer_swiginit(self
,_core_
.new_GridBagSizer(*args
, **kwargs
))
12685 self
._setOORInfo
(self
)
12687 def Add(*args
, **kwargs
):
12689 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12690 int border=0, userData=None) -> wx.GBSizerItem
12692 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12693 more than one row or column as specified with *span*. The remaining
12694 args behave similarly to `wx.Sizer.Add`.
12696 Returns True if the item was successfully placed at the given cell
12697 position, False if something was already there.
12700 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
12702 def AddItem(*args
, **kwargs
):
12704 Add(self, GBSizerItem item) -> wx.GBSizerItem
12706 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12707 the item was successfully placed at its given cell position, False if
12708 something was already there.
12710 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
12712 def GetCellSize(*args
, **kwargs
):
12714 GetCellSize(self, int row, int col) -> Size
12716 Get the size of the specified cell, including hgap and
12717 vgap. Only valid after a Layout.
12719 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
12721 def GetEmptyCellSize(*args
, **kwargs
):
12723 GetEmptyCellSize(self) -> Size
12725 Get the size used for cells in the grid with no item.
12727 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
12729 def SetEmptyCellSize(*args
, **kwargs
):
12731 SetEmptyCellSize(self, Size sz)
12733 Set the size used for cells in the grid with no item.
12735 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
12737 def GetItemPosition(*args
):
12739 GetItemPosition(self, item) -> GBPosition
12741 Get the grid position of the specified *item* where *item* is either a
12742 window or subsizer that is a member of this sizer, or a zero-based
12745 return _core_
.GridBagSizer_GetItemPosition(*args
)
12747 def SetItemPosition(*args
):
12749 SetItemPosition(self, item, GBPosition pos) -> bool
12751 Set the grid position of the specified *item* where *item* is either a
12752 window or subsizer that is a member of this sizer, or a zero-based
12753 index of an item. Returns True on success. If the move is not
12754 allowed (because an item is already there) then False is returned.
12757 return _core_
.GridBagSizer_SetItemPosition(*args
)
12759 def GetItemSpan(*args
):
12761 GetItemSpan(self, item) -> GBSpan
12763 Get the row/col spanning of the specified *item* where *item* is
12764 either a window or subsizer that is a member of this sizer, or a
12765 zero-based index of an item.
12767 return _core_
.GridBagSizer_GetItemSpan(*args
)
12769 def SetItemSpan(*args
):
12771 SetItemSpan(self, item, GBSpan span) -> bool
12773 Set the row/col spanning of the specified *item* where *item* is
12774 either a window or subsizer that is a member of this sizer, or a
12775 zero-based index of an item. Returns True on success. If the move is
12776 not allowed (because an item is already there) then False is returned.
12778 return _core_
.GridBagSizer_SetItemSpan(*args
)
12780 def FindItem(*args
):
12782 FindItem(self, item) -> GBSizerItem
12784 Find the sizer item for the given window or subsizer, returns None if
12785 not found. (non-recursive)
12787 return _core_
.GridBagSizer_FindItem(*args
)
12789 def FindItemAtPosition(*args
, **kwargs
):
12791 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12793 Return the sizer item for the given grid cell, or None if there is no
12794 item at that position. (non-recursive)
12796 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
12798 def FindItemAtPoint(*args
, **kwargs
):
12800 FindItemAtPoint(self, Point pt) -> GBSizerItem
12802 Return the sizer item located at the point given in *pt*, or None if
12803 there is no item at that point. The (x,y) coordinates in pt correspond
12804 to the client coordinates of the window using the sizer for
12805 layout. (non-recursive)
12807 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
12809 def CheckForIntersection(*args
, **kwargs
):
12811 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12813 Look at all items and see if any intersect (or would overlap) the
12814 given *item*. Returns True if so, False if there would be no overlap.
12815 If an *excludeItem* is given then it will not be checked for
12816 intersection, for example it may be the item we are checking the
12820 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
12822 def CheckForIntersectionPos(*args
, **kwargs
):
12824 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12826 Look at all items and see if any intersect (or would overlap) the
12827 given position and span. Returns True if so, False if there would be
12828 no overlap. If an *excludeItem* is given then it will not be checked
12829 for intersection, for example it may be the item we are checking the
12832 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
12834 _core_
.GridBagSizer_swigregister(GridBagSizer
)
12836 #---------------------------------------------------------------------------
12840 Right
= _core_
.Right
12841 Bottom
= _core_
.Bottom
12842 Width
= _core_
.Width
12843 Height
= _core_
.Height
12844 Centre
= _core_
.Centre
12845 Center
= _core_
.Center
12846 CentreX
= _core_
.CentreX
12847 CentreY
= _core_
.CentreY
12848 Unconstrained
= _core_
.Unconstrained
12850 PercentOf
= _core_
.PercentOf
12851 Above
= _core_
.Above
12852 Below
= _core_
.Below
12853 LeftOf
= _core_
.LeftOf
12854 RightOf
= _core_
.RightOf
12855 SameAs
= _core_
.SameAs
12856 Absolute
= _core_
.Absolute
12857 class IndividualLayoutConstraint(Object
):
12859 Objects of this class are stored in the `wx.LayoutConstraints` class as
12860 one of eight possible constraints that a window can be involved in.
12861 You will never need to create an instance of
12862 wx.IndividualLayoutConstraint, rather you should create a
12863 `wx.LayoutConstraints` instance and use the individual contstraints
12866 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12867 def __init__(self
): raise AttributeError, "No constructor defined"
12868 __repr__
= _swig_repr
12869 def Set(*args
, **kwargs
):
12871 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12873 Sets the properties of the constraint. Normally called by one of the
12874 convenience functions such as Above, RightOf, SameAs.
12876 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
12878 def LeftOf(*args
, **kwargs
):
12880 LeftOf(self, Window sibling, int marg=0)
12882 Constrains this edge to be to the left of the given window, with an
12883 optional margin. Implicitly, this is relative to the left edge of the
12886 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
12888 def RightOf(*args
, **kwargs
):
12890 RightOf(self, Window sibling, int marg=0)
12892 Constrains this edge to be to the right of the given window, with an
12893 optional margin. Implicitly, this is relative to the right edge of the
12896 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
12898 def Above(*args
, **kwargs
):
12900 Above(self, Window sibling, int marg=0)
12902 Constrains this edge to be above the given window, with an optional
12903 margin. Implicitly, this is relative to the top edge of the other
12906 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
12908 def Below(*args
, **kwargs
):
12910 Below(self, Window sibling, int marg=0)
12912 Constrains this edge to be below the given window, with an optional
12913 margin. Implicitly, this is relative to the bottom edge of the other
12916 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
12918 def SameAs(*args
, **kwargs
):
12920 SameAs(self, Window otherW, int edge, int marg=0)
12922 Constrains this edge or dimension to be to the same as the edge of the
12923 given window, with an optional margin.
12925 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
12927 def PercentOf(*args
, **kwargs
):
12929 PercentOf(self, Window otherW, int wh, int per)
12931 Constrains this edge or dimension to be to a percentage of the given
12932 window, with an optional margin.
12934 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
12936 def Absolute(*args
, **kwargs
):
12938 Absolute(self, int val)
12940 Constrains this edge or dimension to be the given absolute value.
12942 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
12944 def Unconstrained(*args
, **kwargs
):
12946 Unconstrained(self)
12948 Sets this edge or dimension to be unconstrained, that is, dependent on
12949 other edges and dimensions from which this value can be deduced.
12951 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
12953 def AsIs(*args
, **kwargs
):
12957 Sets this edge or constraint to be whatever the window's value is at
12958 the moment. If either of the width and height constraints are *as is*,
12959 the window will not be resized, but moved instead. This is important
12960 when considering panel items which are intended to have a default
12961 size, such as a button, which may take its size from the size of the
12964 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
12966 def GetOtherWindow(*args
, **kwargs
):
12967 """GetOtherWindow(self) -> Window"""
12968 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
12970 def GetMyEdge(*args
, **kwargs
):
12971 """GetMyEdge(self) -> int"""
12972 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
12974 def SetEdge(*args
, **kwargs
):
12975 """SetEdge(self, int which)"""
12976 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
12978 def SetValue(*args
, **kwargs
):
12979 """SetValue(self, int v)"""
12980 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
12982 def GetMargin(*args
, **kwargs
):
12983 """GetMargin(self) -> int"""
12984 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
12986 def SetMargin(*args
, **kwargs
):
12987 """SetMargin(self, int m)"""
12988 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
12990 def GetValue(*args
, **kwargs
):
12991 """GetValue(self) -> int"""
12992 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
12994 def GetPercent(*args
, **kwargs
):
12995 """GetPercent(self) -> int"""
12996 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
12998 def GetOtherEdge(*args
, **kwargs
):
12999 """GetOtherEdge(self) -> int"""
13000 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
13002 def GetDone(*args
, **kwargs
):
13003 """GetDone(self) -> bool"""
13004 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
13006 def SetDone(*args
, **kwargs
):
13007 """SetDone(self, bool d)"""
13008 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
13010 def GetRelationship(*args
, **kwargs
):
13011 """GetRelationship(self) -> int"""
13012 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
13014 def SetRelationship(*args
, **kwargs
):
13015 """SetRelationship(self, int r)"""
13016 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
13018 def ResetIfWin(*args
, **kwargs
):
13020 ResetIfWin(self, Window otherW) -> bool
13022 Reset constraint if it mentions otherWin
13024 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
13026 def SatisfyConstraint(*args
, **kwargs
):
13028 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13030 Try to satisfy constraint
13032 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
13034 def GetEdge(*args
, **kwargs
):
13036 GetEdge(self, int which, Window thisWin, Window other) -> int
13038 Get the value of this edge or dimension, or if this
13039 is not determinable, -1.
13041 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
13043 Done
= property(GetDone
,SetDone
,doc
="See `GetDone` and `SetDone`")
13044 Margin
= property(GetMargin
,SetMargin
,doc
="See `GetMargin` and `SetMargin`")
13045 MyEdge
= property(GetMyEdge
,doc
="See `GetMyEdge`")
13046 OtherEdge
= property(GetOtherEdge
,doc
="See `GetOtherEdge`")
13047 OtherWindow
= property(GetOtherWindow
,doc
="See `GetOtherWindow`")
13048 Percent
= property(GetPercent
,doc
="See `GetPercent`")
13049 Relationship
= property(GetRelationship
,SetRelationship
,doc
="See `GetRelationship` and `SetRelationship`")
13050 Value
= property(GetValue
,SetValue
,doc
="See `GetValue` and `SetValue`")
13051 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint
)
13053 class LayoutConstraints(Object
):
13055 **Note:** constraints are now deprecated and you should use sizers
13058 Objects of this class can be associated with a window to define its
13059 layout constraints, with respect to siblings or its parent.
13061 The class consists of the following eight constraints of class
13062 wx.IndividualLayoutConstraint, some or all of which should be accessed
13063 directly to set the appropriate constraints.
13065 * left: represents the left hand edge of the window
13066 * right: represents the right hand edge of the window
13067 * top: represents the top edge of the window
13068 * bottom: represents the bottom edge of the window
13069 * width: represents the width of the window
13070 * height: represents the height of the window
13071 * centreX: represents the horizontal centre point of the window
13072 * centreY: represents the vertical centre point of the window
13074 Most constraints are initially set to have the relationship
13075 wxUnconstrained, which means that their values should be calculated by
13076 looking at known constraints. The exceptions are width and height,
13077 which are set to wxAsIs to ensure that if the user does not specify a
13078 constraint, the existing width and height will be used, to be
13079 compatible with panel items which often have take a default size. If
13080 the constraint is ``wx.AsIs``, the dimension will not be changed.
13082 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13085 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13086 __repr__
= _swig_repr
13087 left
= property(_core_
.LayoutConstraints_left_get
)
13088 top
= property(_core_
.LayoutConstraints_top_get
)
13089 right
= property(_core_
.LayoutConstraints_right_get
)
13090 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
13091 width
= property(_core_
.LayoutConstraints_width_get
)
13092 height
= property(_core_
.LayoutConstraints_height_get
)
13093 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
13094 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
13095 def __init__(self
, *args
, **kwargs
):
13096 """__init__(self) -> LayoutConstraints"""
13097 _core_
.LayoutConstraints_swiginit(self
,_core_
.new_LayoutConstraints(*args
, **kwargs
))
13098 __swig_destroy__
= _core_
.delete_LayoutConstraints
13099 __del__
= lambda self
: None;
13100 def SatisfyConstraints(*args
, **kwargs
):
13101 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13102 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
13104 def AreSatisfied(*args
, **kwargs
):
13105 """AreSatisfied(self) -> bool"""
13106 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
13108 _core_
.LayoutConstraints_swigregister(LayoutConstraints
)
13110 #----------------------------------------------------------------------------
13112 # Use Python's bool constants if available, make some if not
13116 __builtins__
.True = 1==1
13117 __builtins__
.False = 1==0
13118 def bool(value
): return not not value
13119 __builtins__
.bool = bool
13123 # workarounds for bad wxRTTI names
13124 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
13125 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
13126 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
13129 #----------------------------------------------------------------------------
13130 # Load version numbers from __version__... Ensure that major and minor
13131 # versions are the same for both wxPython and wxWidgets.
13133 from __version__
import *
13134 __version__
= VERSION_STRING
13136 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
13137 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
13138 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
13140 warnings
.warn("wxPython/wxWidgets release number mismatch")
13142 #----------------------------------------------------------------------------
13144 # Set wxPython's default string<-->unicode conversion encoding from
13145 # the locale, but only if Python's default hasn't been changed. (We
13146 # assume that if the user has customized it already then that is the
13147 # encoding we need to use as well.)
13149 # The encoding selected here is used when string or unicode objects
13150 # need to be converted in order to pass them to wxWidgets. Please be
13151 # aware that the default encoding within the same locale may be
13152 # slightly different on different platforms. For example, please see
13153 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13154 # between the common latin/roman encodings.
13156 default
= _sys
.getdefaultencoding()
13157 if default
== 'ascii':
13161 default
= locale
.getdefaultlocale()[1]
13162 codecs
.lookup(default
)
13163 except (ValueError, LookupError, TypeError):
13164 default
= _sys
.getdefaultencoding()
13168 wx
.SetDefaultPyEncoding(default
)
13171 #----------------------------------------------------------------------------
13173 class PyDeadObjectError(AttributeError):
13176 class _wxPyDeadObject(object):
13178 Instances of wx objects that are OOR capable will have their __class__
13179 changed to this class when the C++ object is deleted. This should help
13180 prevent crashes due to referencing a bogus C++ pointer.
13182 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13183 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13185 def __repr__(self
):
13186 if not hasattr(self
, "_name"):
13187 self
._name
= "[unknown]"
13188 return self
.reprStr
% self
._name
13190 def __getattr__(self
, *args
):
13191 if not hasattr(self
, "_name"):
13192 self
._name
= "[unknown]"
13193 raise PyDeadObjectError(self
.attrStr
% self
._name
)
13195 def __nonzero__(self
):
13200 class PyUnbornObjectError(AttributeError):
13203 class _wxPyUnbornObject(object):
13205 Some stock objects are created when the wx._core module is
13206 imported, but their C++ instance is not created until the wx.App
13207 object is created and initialized. These object instances will
13208 temporarily have their __class__ changed to this class so an
13209 exception will be raised if they are used before the C++ instance
13213 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13214 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
13216 def __repr__(self
):
13217 #if not hasattr(self, "_name"):
13218 # self._name = "[unknown]"
13219 return self
.reprStr
#% self._name
13221 def __getattr__(self
, *args
):
13222 #if not hasattr(self, "_name"):
13223 # self._name = "[unknown]"
13224 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
13226 def __nonzero__(self
):
13230 #----------------------------------------------------------------------------
13232 def CallAfter(callable, *args
, **kw
):
13234 Call the specified function after the current and pending event
13235 handlers have been completed. This is also good for making GUI
13236 method calls from non-GUI threads. Any extra positional or
13237 keyword args are passed on to the callable when it is called.
13239 :see: `wx.FutureCall`
13242 assert app
is not None, 'No wx.App created yet'
13244 if not hasattr(app
, "_CallAfterId"):
13245 app
._CallAfterId
= wx
.NewEventType()
13246 app
.Connect(-1, -1, app
._CallAfterId
,
13247 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
13249 evt
.SetEventType(app
._CallAfterId
)
13250 evt
.callable = callable
13253 wx
.PostEvent(app
, evt
)
13255 #----------------------------------------------------------------------------
13260 A convenience class for `wx.Timer`, that calls the given callable
13261 object once after the given amount of milliseconds, passing any
13262 positional or keyword args. The return value of the callable is
13263 availbale after it has been run with the `GetResult` method.
13265 If you don't need to get the return value or restart the timer
13266 then there is no need to hold a reference to this object. It will
13267 hold a reference to itself while the timer is running (the timer
13268 has a reference to self.Notify) but the cycle will be broken when
13269 the timer completes, automatically cleaning up the wx.FutureCall
13272 :see: `wx.CallAfter`
13274 def __init__(self
, millis
, callable, *args
, **kwargs
):
13275 self
.millis
= millis
13276 self
.callable = callable
13277 self
.SetArgs(*args
, **kwargs
)
13279 self
.running
= False
13280 self
.hasRun
= False
13289 def Start(self
, millis
=None, *args
, **kwargs
):
13291 (Re)start the timer
13293 self
.hasRun
= False
13294 if millis
is not None:
13295 self
.millis
= millis
13297 self
.SetArgs(*args
, **kwargs
)
13299 self
.timer
= wx
.PyTimer(self
.Notify
)
13300 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
13301 self
.running
= True
13307 Stop and destroy the timer.
13309 if self
.timer
is not None:
13314 def GetInterval(self
):
13315 if self
.timer
is not None:
13316 return self
.timer
.GetInterval()
13321 def IsRunning(self
):
13322 return self
.timer
is not None and self
.timer
.IsRunning()
13325 def SetArgs(self
, *args
, **kwargs
):
13327 (Re)set the args passed to the callable object. This is
13328 useful in conjunction with Restart if you want to schedule a
13329 new call to the same callable object but with different
13333 self
.kwargs
= kwargs
13339 def GetResult(self
):
13344 The timer has expired so call the callable.
13346 if self
.callable and getattr(self
.callable, 'im_self', True):
13348 self
.running
= False
13349 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
13351 if not self
.running
:
13352 # if it wasn't restarted, then cleanup
13353 wx
.CallAfter(self
.Stop
)
13355 Interval
= property(GetInterval
)
13356 Result
= property(GetResult
)
13359 #----------------------------------------------------------------------------
13360 # Control which items in this module should be documented by epydoc.
13361 # We allow only classes and functions, which will help reduce the size
13362 # of the docs by filtering out the zillions of constants, EVT objects,
13363 # and etc that don't make much sense by themselves, but are instead
13364 # documented (or will be) as part of the classes/functions/methods
13365 # where they should be used.
13369 A filter for epydoc that only allows non-Ptr classes and
13370 functions, in order to reduce the clutter in the API docs.
13372 def __init__(self
, globals):
13373 self
._globals
= globals
13375 def __call__(self
, name
):
13377 obj
= self
._globals
.get(name
, None)
13379 # only document classes and function
13380 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
13383 # skip other things that are private or will be documented as part of somethign else
13384 if name
.startswith('_') or name
.startswith('EVT') or name
.endswith('_swigregister') or name
.endswith('Ptr') :
13387 # skip functions that are duplicates of static functions in a class
13388 if name
.find('_') != -1:
13389 cls
= self
._globals
.get(name
.split('_')[0], None)
13390 methname
= name
.split('_')[1]
13391 if hasattr(cls
, methname
) and type(getattr(cls
, methname
)) is types
.FunctionType
:
13396 #----------------------------------------------------------------------------
13397 #----------------------------------------------------------------------------
13399 # Import other modules in this package that should show up in the
13400 # "core" wx namespace
13402 from _windows
import *
13403 from _controls
import *
13404 from _misc
import *
13406 #----------------------------------------------------------------------------
13407 #----------------------------------------------------------------------------