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 CB_SIMPLE
= _core_
.CB_SIMPLE
120 CB_DROPDOWN
= _core_
.CB_DROPDOWN
121 CB_SORT
= _core_
.CB_SORT
122 CB_READONLY
= _core_
.CB_READONLY
123 RA_HORIZONTAL
= _core_
.RA_HORIZONTAL
124 RA_VERTICAL
= _core_
.RA_VERTICAL
125 RA_SPECIFY_ROWS
= _core_
.RA_SPECIFY_ROWS
126 RA_SPECIFY_COLS
= _core_
.RA_SPECIFY_COLS
127 RA_USE_CHECKBOX
= _core_
.RA_USE_CHECKBOX
128 RB_GROUP
= _core_
.RB_GROUP
129 RB_SINGLE
= _core_
.RB_SINGLE
130 SB_HORIZONTAL
= _core_
.SB_HORIZONTAL
131 SB_VERTICAL
= _core_
.SB_VERTICAL
132 RB_USE_CHECKBOX
= _core_
.RB_USE_CHECKBOX
133 ST_SIZEGRIP
= _core_
.ST_SIZEGRIP
134 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
135 FLOOD_BORDER
= _core_
.FLOOD_BORDER
136 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
137 WINDING_RULE
= _core_
.WINDING_RULE
138 TOOL_TOP
= _core_
.TOOL_TOP
139 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
140 TOOL_LEFT
= _core_
.TOOL_LEFT
141 TOOL_RIGHT
= _core_
.TOOL_RIGHT
143 YES_NO
= _core_
.YES_NO
144 CANCEL
= _core_
.CANCEL
147 NO_DEFAULT
= _core_
.NO_DEFAULT
148 YES_DEFAULT
= _core_
.YES_DEFAULT
149 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
150 ICON_HAND
= _core_
.ICON_HAND
151 ICON_QUESTION
= _core_
.ICON_QUESTION
152 ICON_INFORMATION
= _core_
.ICON_INFORMATION
153 ICON_STOP
= _core_
.ICON_STOP
154 ICON_ASTERISK
= _core_
.ICON_ASTERISK
155 ICON_MASK
= _core_
.ICON_MASK
156 ICON_WARNING
= _core_
.ICON_WARNING
157 ICON_ERROR
= _core_
.ICON_ERROR
158 FORWARD
= _core_
.FORWARD
159 BACKWARD
= _core_
.BACKWARD
164 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
165 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
166 SIZE_AUTO
= _core_
.SIZE_AUTO
167 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
168 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
169 SIZE_FORCE
= _core_
.SIZE_FORCE
170 PORTRAIT
= _core_
.PORTRAIT
171 LANDSCAPE
= _core_
.LANDSCAPE
172 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
173 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
174 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
175 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
176 ID_ANY
= _core_
.ID_ANY
177 ID_SEPARATOR
= _core_
.ID_SEPARATOR
178 ID_NONE
= _core_
.ID_NONE
179 ID_LOWEST
= _core_
.ID_LOWEST
180 ID_OPEN
= _core_
.ID_OPEN
181 ID_CLOSE
= _core_
.ID_CLOSE
182 ID_NEW
= _core_
.ID_NEW
183 ID_SAVE
= _core_
.ID_SAVE
184 ID_SAVEAS
= _core_
.ID_SAVEAS
185 ID_REVERT
= _core_
.ID_REVERT
186 ID_EXIT
= _core_
.ID_EXIT
187 ID_UNDO
= _core_
.ID_UNDO
188 ID_REDO
= _core_
.ID_REDO
189 ID_HELP
= _core_
.ID_HELP
190 ID_PRINT
= _core_
.ID_PRINT
191 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
192 ID_PAGE_SETUP
= _core_
.ID_PAGE_SETUP
193 ID_PREVIEW
= _core_
.ID_PREVIEW
194 ID_ABOUT
= _core_
.ID_ABOUT
195 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
196 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
197 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
198 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
199 ID_HELP_INDEX
= _core_
.ID_HELP_INDEX
200 ID_HELP_SEARCH
= _core_
.ID_HELP_SEARCH
201 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
202 ID_PREFERENCES
= _core_
.ID_PREFERENCES
203 ID_EDIT
= _core_
.ID_EDIT
204 ID_CUT
= _core_
.ID_CUT
205 ID_COPY
= _core_
.ID_COPY
206 ID_PASTE
= _core_
.ID_PASTE
207 ID_CLEAR
= _core_
.ID_CLEAR
208 ID_FIND
= _core_
.ID_FIND
209 ID_DUPLICATE
= _core_
.ID_DUPLICATE
210 ID_SELECTALL
= _core_
.ID_SELECTALL
211 ID_DELETE
= _core_
.ID_DELETE
212 ID_REPLACE
= _core_
.ID_REPLACE
213 ID_REPLACE_ALL
= _core_
.ID_REPLACE_ALL
214 ID_PROPERTIES
= _core_
.ID_PROPERTIES
215 ID_VIEW_DETAILS
= _core_
.ID_VIEW_DETAILS
216 ID_VIEW_LARGEICONS
= _core_
.ID_VIEW_LARGEICONS
217 ID_VIEW_SMALLICONS
= _core_
.ID_VIEW_SMALLICONS
218 ID_VIEW_LIST
= _core_
.ID_VIEW_LIST
219 ID_VIEW_SORTDATE
= _core_
.ID_VIEW_SORTDATE
220 ID_VIEW_SORTNAME
= _core_
.ID_VIEW_SORTNAME
221 ID_VIEW_SORTSIZE
= _core_
.ID_VIEW_SORTSIZE
222 ID_VIEW_SORTTYPE
= _core_
.ID_VIEW_SORTTYPE
223 ID_FILE
= _core_
.ID_FILE
224 ID_FILE1
= _core_
.ID_FILE1
225 ID_FILE2
= _core_
.ID_FILE2
226 ID_FILE3
= _core_
.ID_FILE3
227 ID_FILE4
= _core_
.ID_FILE4
228 ID_FILE5
= _core_
.ID_FILE5
229 ID_FILE6
= _core_
.ID_FILE6
230 ID_FILE7
= _core_
.ID_FILE7
231 ID_FILE8
= _core_
.ID_FILE8
232 ID_FILE9
= _core_
.ID_FILE9
234 ID_CANCEL
= _core_
.ID_CANCEL
235 ID_APPLY
= _core_
.ID_APPLY
236 ID_YES
= _core_
.ID_YES
238 ID_STATIC
= _core_
.ID_STATIC
239 ID_FORWARD
= _core_
.ID_FORWARD
240 ID_BACKWARD
= _core_
.ID_BACKWARD
241 ID_DEFAULT
= _core_
.ID_DEFAULT
242 ID_MORE
= _core_
.ID_MORE
243 ID_SETUP
= _core_
.ID_SETUP
244 ID_RESET
= _core_
.ID_RESET
245 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
246 ID_YESTOALL
= _core_
.ID_YESTOALL
247 ID_NOTOALL
= _core_
.ID_NOTOALL
248 ID_ABORT
= _core_
.ID_ABORT
249 ID_RETRY
= _core_
.ID_RETRY
250 ID_IGNORE
= _core_
.ID_IGNORE
251 ID_ADD
= _core_
.ID_ADD
252 ID_REMOVE
= _core_
.ID_REMOVE
254 ID_DOWN
= _core_
.ID_DOWN
255 ID_HOME
= _core_
.ID_HOME
256 ID_REFRESH
= _core_
.ID_REFRESH
257 ID_STOP
= _core_
.ID_STOP
258 ID_INDEX
= _core_
.ID_INDEX
259 ID_BOLD
= _core_
.ID_BOLD
260 ID_ITALIC
= _core_
.ID_ITALIC
261 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
262 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
263 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
264 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
265 ID_UNDERLINE
= _core_
.ID_UNDERLINE
266 ID_INDENT
= _core_
.ID_INDENT
267 ID_UNINDENT
= _core_
.ID_UNINDENT
268 ID_ZOOM_100
= _core_
.ID_ZOOM_100
269 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
270 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
271 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
272 ID_UNDELETE
= _core_
.ID_UNDELETE
273 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
274 ID_HIGHEST
= _core_
.ID_HIGHEST
275 MENU_TEAROFF
= _core_
.MENU_TEAROFF
276 MB_DOCKABLE
= _core_
.MB_DOCKABLE
277 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
278 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
279 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
280 LI_VERTICAL
= _core_
.LI_VERTICAL
281 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
282 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
283 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
284 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
285 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
286 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
287 MM_TEXT
= _core_
.MM_TEXT
288 MM_LOMETRIC
= _core_
.MM_LOMETRIC
289 MM_HIMETRIC
= _core_
.MM_HIMETRIC
290 MM_LOENGLISH
= _core_
.MM_LOENGLISH
291 MM_HIENGLISH
= _core_
.MM_HIENGLISH
292 MM_TWIPS
= _core_
.MM_TWIPS
293 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
294 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
295 MM_POINTS
= _core_
.MM_POINTS
296 MM_METRIC
= _core_
.MM_METRIC
297 CENTRE
= _core_
.CENTRE
298 CENTER
= _core_
.CENTER
299 HORIZONTAL
= _core_
.HORIZONTAL
300 VERTICAL
= _core_
.VERTICAL
307 BOTTOM
= _core_
.BOTTOM
313 ALIGN_NOT
= _core_
.ALIGN_NOT
314 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
315 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
316 ALIGN_LEFT
= _core_
.ALIGN_LEFT
317 ALIGN_TOP
= _core_
.ALIGN_TOP
318 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
319 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
320 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
321 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
322 ALIGN_CENTER
= _core_
.ALIGN_CENTER
323 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
324 ALIGN_MASK
= _core_
.ALIGN_MASK
325 STRETCH_NOT
= _core_
.STRETCH_NOT
326 SHRINK
= _core_
.SHRINK
328 EXPAND
= _core_
.EXPAND
329 SHAPED
= _core_
.SHAPED
330 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
333 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
334 BORDER_NONE
= _core_
.BORDER_NONE
335 BORDER_STATIC
= _core_
.BORDER_STATIC
336 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
337 BORDER_RAISED
= _core_
.BORDER_RAISED
338 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
339 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
340 BORDER_MASK
= _core_
.BORDER_MASK
341 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
342 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
343 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
344 DEFAULT
= _core_
.DEFAULT
345 DECORATIVE
= _core_
.DECORATIVE
347 SCRIPT
= _core_
.SCRIPT
349 MODERN
= _core_
.MODERN
350 TELETYPE
= _core_
.TELETYPE
351 VARIABLE
= _core_
.VARIABLE
353 NORMAL
= _core_
.NORMAL
356 ITALIC
= _core_
.ITALIC
360 LONG_DASH
= _core_
.LONG_DASH
361 SHORT_DASH
= _core_
.SHORT_DASH
362 DOT_DASH
= _core_
.DOT_DASH
363 USER_DASH
= _core_
.USER_DASH
364 TRANSPARENT
= _core_
.TRANSPARENT
365 STIPPLE
= _core_
.STIPPLE
366 STIPPLE_MASK
= _core_
.STIPPLE_MASK
367 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
368 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
369 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
370 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
371 CROSS_HATCH
= _core_
.CROSS_HATCH
372 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
373 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
374 JOIN_BEVEL
= _core_
.JOIN_BEVEL
375 JOIN_MITER
= _core_
.JOIN_MITER
376 JOIN_ROUND
= _core_
.JOIN_ROUND
377 CAP_ROUND
= _core_
.CAP_ROUND
378 CAP_PROJECTING
= _core_
.CAP_PROJECTING
379 CAP_BUTT
= _core_
.CAP_BUTT
382 INVERT
= _core_
.INVERT
383 OR_REVERSE
= _core_
.OR_REVERSE
384 AND_REVERSE
= _core_
.AND_REVERSE
387 AND_INVERT
= _core_
.AND_INVERT
391 SRC_INVERT
= _core_
.SRC_INVERT
392 OR_INVERT
= _core_
.OR_INVERT
396 WXK_BACK
= _core_
.WXK_BACK
397 WXK_TAB
= _core_
.WXK_TAB
398 WXK_RETURN
= _core_
.WXK_RETURN
399 WXK_ESCAPE
= _core_
.WXK_ESCAPE
400 WXK_SPACE
= _core_
.WXK_SPACE
401 WXK_DELETE
= _core_
.WXK_DELETE
402 WXK_START
= _core_
.WXK_START
403 WXK_LBUTTON
= _core_
.WXK_LBUTTON
404 WXK_RBUTTON
= _core_
.WXK_RBUTTON
405 WXK_CANCEL
= _core_
.WXK_CANCEL
406 WXK_MBUTTON
= _core_
.WXK_MBUTTON
407 WXK_CLEAR
= _core_
.WXK_CLEAR
408 WXK_SHIFT
= _core_
.WXK_SHIFT
409 WXK_ALT
= _core_
.WXK_ALT
410 WXK_CONTROL
= _core_
.WXK_CONTROL
411 WXK_MENU
= _core_
.WXK_MENU
412 WXK_PAUSE
= _core_
.WXK_PAUSE
413 WXK_CAPITAL
= _core_
.WXK_CAPITAL
414 WXK_END
= _core_
.WXK_END
415 WXK_HOME
= _core_
.WXK_HOME
416 WXK_LEFT
= _core_
.WXK_LEFT
417 WXK_UP
= _core_
.WXK_UP
418 WXK_RIGHT
= _core_
.WXK_RIGHT
419 WXK_DOWN
= _core_
.WXK_DOWN
420 WXK_SELECT
= _core_
.WXK_SELECT
421 WXK_PRINT
= _core_
.WXK_PRINT
422 WXK_EXECUTE
= _core_
.WXK_EXECUTE
423 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
424 WXK_INSERT
= _core_
.WXK_INSERT
425 WXK_HELP
= _core_
.WXK_HELP
426 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
427 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
428 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
429 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
430 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
431 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
432 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
433 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
434 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
435 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
436 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
437 WXK_ADD
= _core_
.WXK_ADD
438 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
439 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
440 WXK_DECIMAL
= _core_
.WXK_DECIMAL
441 WXK_DIVIDE
= _core_
.WXK_DIVIDE
442 WXK_F1
= _core_
.WXK_F1
443 WXK_F2
= _core_
.WXK_F2
444 WXK_F3
= _core_
.WXK_F3
445 WXK_F4
= _core_
.WXK_F4
446 WXK_F5
= _core_
.WXK_F5
447 WXK_F6
= _core_
.WXK_F6
448 WXK_F7
= _core_
.WXK_F7
449 WXK_F8
= _core_
.WXK_F8
450 WXK_F9
= _core_
.WXK_F9
451 WXK_F10
= _core_
.WXK_F10
452 WXK_F11
= _core_
.WXK_F11
453 WXK_F12
= _core_
.WXK_F12
454 WXK_F13
= _core_
.WXK_F13
455 WXK_F14
= _core_
.WXK_F14
456 WXK_F15
= _core_
.WXK_F15
457 WXK_F16
= _core_
.WXK_F16
458 WXK_F17
= _core_
.WXK_F17
459 WXK_F18
= _core_
.WXK_F18
460 WXK_F19
= _core_
.WXK_F19
461 WXK_F20
= _core_
.WXK_F20
462 WXK_F21
= _core_
.WXK_F21
463 WXK_F22
= _core_
.WXK_F22
464 WXK_F23
= _core_
.WXK_F23
465 WXK_F24
= _core_
.WXK_F24
466 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
467 WXK_SCROLL
= _core_
.WXK_SCROLL
468 WXK_PAGEUP
= _core_
.WXK_PAGEUP
469 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
470 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
471 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
472 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
473 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
474 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
475 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
476 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
477 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
478 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
479 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
480 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
481 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
482 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
483 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
484 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
485 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
486 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
487 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
488 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
489 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
490 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
491 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
492 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
493 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
494 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
495 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
496 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
497 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
498 WXK_COMMAND
= _core_
.WXK_COMMAND
499 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
500 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
501 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
502 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
503 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
504 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
505 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
506 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
507 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
508 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
509 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
510 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
511 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
512 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
513 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
514 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
515 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
516 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
517 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
518 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
519 WXK_PRIOR
= WXK_PAGEUP
520 WXK_NEXT
= WXK_PAGEDOWN
521 WXK_NUMPAD_PRIOR
= WXK_NUMPAD_PAGEUP
522 WXK_NUMPAD_NEXT
= WXK_NUMPAD_PAGEDOWN
524 PAPER_NONE
= _core_
.PAPER_NONE
525 PAPER_LETTER
= _core_
.PAPER_LETTER
526 PAPER_LEGAL
= _core_
.PAPER_LEGAL
527 PAPER_A4
= _core_
.PAPER_A4
528 PAPER_CSHEET
= _core_
.PAPER_CSHEET
529 PAPER_DSHEET
= _core_
.PAPER_DSHEET
530 PAPER_ESHEET
= _core_
.PAPER_ESHEET
531 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
532 PAPER_TABLOID
= _core_
.PAPER_TABLOID
533 PAPER_LEDGER
= _core_
.PAPER_LEDGER
534 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
535 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
536 PAPER_A3
= _core_
.PAPER_A3
537 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
538 PAPER_A5
= _core_
.PAPER_A5
539 PAPER_B4
= _core_
.PAPER_B4
540 PAPER_B5
= _core_
.PAPER_B5
541 PAPER_FOLIO
= _core_
.PAPER_FOLIO
542 PAPER_QUARTO
= _core_
.PAPER_QUARTO
543 PAPER_10X14
= _core_
.PAPER_10X14
544 PAPER_11X17
= _core_
.PAPER_11X17
545 PAPER_NOTE
= _core_
.PAPER_NOTE
546 PAPER_ENV_9
= _core_
.PAPER_ENV_9
547 PAPER_ENV_10
= _core_
.PAPER_ENV_10
548 PAPER_ENV_11
= _core_
.PAPER_ENV_11
549 PAPER_ENV_12
= _core_
.PAPER_ENV_12
550 PAPER_ENV_14
= _core_
.PAPER_ENV_14
551 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
552 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
553 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
554 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
555 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
556 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
557 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
558 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
559 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
560 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
561 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
562 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
563 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
564 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
565 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
566 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
567 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
568 PAPER_9X11
= _core_
.PAPER_9X11
569 PAPER_10X11
= _core_
.PAPER_10X11
570 PAPER_15X11
= _core_
.PAPER_15X11
571 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
572 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
573 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
574 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
575 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
576 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
577 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
578 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
579 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
580 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
581 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
582 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
583 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
584 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
585 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
586 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
587 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
588 PAPER_A2
= _core_
.PAPER_A2
589 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
590 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
591 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
592 PAPER_A6
= _core_
.PAPER_A6
593 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
594 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
595 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
596 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
597 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
598 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
599 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
600 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
601 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
602 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
603 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
604 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
605 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
606 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
607 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
608 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
609 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
610 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
611 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
612 PAPER_12X11
= _core_
.PAPER_12X11
613 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
614 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
615 PAPER_P16K
= _core_
.PAPER_P16K
616 PAPER_P32K
= _core_
.PAPER_P32K
617 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
618 PAPER_PENV_1
= _core_
.PAPER_PENV_1
619 PAPER_PENV_2
= _core_
.PAPER_PENV_2
620 PAPER_PENV_3
= _core_
.PAPER_PENV_3
621 PAPER_PENV_4
= _core_
.PAPER_PENV_4
622 PAPER_PENV_5
= _core_
.PAPER_PENV_5
623 PAPER_PENV_6
= _core_
.PAPER_PENV_6
624 PAPER_PENV_7
= _core_
.PAPER_PENV_7
625 PAPER_PENV_8
= _core_
.PAPER_PENV_8
626 PAPER_PENV_9
= _core_
.PAPER_PENV_9
627 PAPER_PENV_10
= _core_
.PAPER_PENV_10
628 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
629 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
630 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
631 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
632 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
633 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
634 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
635 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
636 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
637 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
638 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
639 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
640 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
641 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
642 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
643 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
644 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
645 ITEM_NORMAL
= _core_
.ITEM_NORMAL
646 ITEM_CHECK
= _core_
.ITEM_CHECK
647 ITEM_RADIO
= _core_
.ITEM_RADIO
648 ITEM_MAX
= _core_
.ITEM_MAX
649 HT_NOWHERE
= _core_
.HT_NOWHERE
650 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
651 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
652 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
653 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
654 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
655 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
656 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
657 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
658 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
659 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
660 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
661 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
662 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
663 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
664 HT_MAX
= _core_
.HT_MAX
665 MOD_NONE
= _core_
.MOD_NONE
666 MOD_ALT
= _core_
.MOD_ALT
667 MOD_CONTROL
= _core_
.MOD_CONTROL
668 MOD_ALTGR
= _core_
.MOD_ALTGR
669 MOD_SHIFT
= _core_
.MOD_SHIFT
670 MOD_META
= _core_
.MOD_META
671 MOD_WIN
= _core_
.MOD_WIN
672 MOD_CMD
= _core_
.MOD_CMD
673 MOD_ALL
= _core_
.MOD_ALL
674 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
675 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
676 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
677 Layout_Default
= _core_
.Layout_Default
678 Layout_LeftToRight
= _core_
.Layout_LeftToRight
679 Layout_RightToLeft
= _core_
.Layout_RightToLeft
680 #---------------------------------------------------------------------------
682 class Object(object):
684 The base class for most wx objects, although in wxPython not
685 much functionality is needed nor exposed.
687 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
688 def __init__(self
): raise AttributeError, "No constructor defined"
689 __repr__
= _swig_repr
690 def GetClassName(*args
, **kwargs
):
692 GetClassName(self) -> String
694 Returns the class name of the C++ class using wxRTTI.
696 return _core_
.Object_GetClassName(*args
, **kwargs
)
698 def Destroy(*args
, **kwargs
):
702 Deletes the C++ object this Python object is a proxy for.
704 args
[0].this
.own(False)
705 return _core_
.Object_Destroy(*args
, **kwargs
)
707 def IsSameAs(*args
, **kwargs
):
709 IsSameAs(self, Object p) -> bool
711 For wx.Objects that use C++ reference counting internally, this method
712 can be used to determine if two objects are referencing the same data
715 return _core_
.Object_IsSameAs(*args
, **kwargs
)
717 ClassName
= property(GetClassName
,doc
="See `GetClassName`")
718 _core_
.Object_swigregister(Object
)
719 _wxPySetDictionary
= _core_
._wxPySetDictionary
721 EmptyString
= cvar
.EmptyString
723 #---------------------------------------------------------------------------
725 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
726 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
727 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
728 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
729 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
730 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
731 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
732 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
733 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
734 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
735 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
736 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
737 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
738 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
739 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
740 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
741 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
742 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
743 BITMAP_TYPE_TGA
= _core_
.BITMAP_TYPE_TGA
744 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
745 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
746 CURSOR_NONE
= _core_
.CURSOR_NONE
747 CURSOR_ARROW
= _core_
.CURSOR_ARROW
748 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
749 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
750 CURSOR_CHAR
= _core_
.CURSOR_CHAR
751 CURSOR_CROSS
= _core_
.CURSOR_CROSS
752 CURSOR_HAND
= _core_
.CURSOR_HAND
753 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
754 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
755 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
756 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
757 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
758 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
759 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
760 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
761 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
762 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
763 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
764 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
765 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
766 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
767 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
768 CURSOR_SIZING
= _core_
.CURSOR_SIZING
769 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
770 CURSOR_WAIT
= _core_
.CURSOR_WAIT
771 CURSOR_WATCH
= _core_
.CURSOR_WATCH
772 CURSOR_BLANK
= _core_
.CURSOR_BLANK
773 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
774 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
775 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
776 CURSOR_MAX
= _core_
.CURSOR_MAX
777 #---------------------------------------------------------------------------
781 wx.Size is a useful data structure used to represent the size of
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
784 expected a (width, height) tuple can be used instead.
786 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
787 __repr__
= _swig_repr
788 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
789 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
790 x
= width
; y
= height
791 def __init__(self
, *args
, **kwargs
):
793 __init__(self, int w=0, int h=0) -> Size
795 Creates a size object.
797 _core_
.Size_swiginit(self
,_core_
.new_Size(*args
, **kwargs
))
798 __swig_destroy__
= _core_
.delete_Size
799 __del__
= lambda self
: None;
800 def __eq__(*args
, **kwargs
):
802 __eq__(self, PyObject other) -> bool
804 Test for equality of wx.Size objects.
806 return _core_
.Size___eq__(*args
, **kwargs
)
808 def __ne__(*args
, **kwargs
):
810 __ne__(self, PyObject other) -> bool
812 Test for inequality of wx.Size objects.
814 return _core_
.Size___ne__(*args
, **kwargs
)
816 def __add__(*args
, **kwargs
):
818 __add__(self, Size sz) -> Size
820 Add sz's proprties to this and return the result.
822 return _core_
.Size___add__(*args
, **kwargs
)
824 def __sub__(*args
, **kwargs
):
826 __sub__(self, Size sz) -> Size
828 Subtract sz's properties from this and return the result.
830 return _core_
.Size___sub__(*args
, **kwargs
)
832 def IncTo(*args
, **kwargs
):
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
839 return _core_
.Size_IncTo(*args
, **kwargs
)
841 def DecTo(*args
, **kwargs
):
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
848 return _core_
.Size_DecTo(*args
, **kwargs
)
850 def IncBy(*args
, **kwargs
):
851 """IncBy(self, int dx, int dy)"""
852 return _core_
.Size_IncBy(*args
, **kwargs
)
854 def DecBy(*args
, **kwargs
):
855 """DecBy(self, int dx, int dy)"""
856 return _core_
.Size_DecBy(*args
, **kwargs
)
858 def Scale(*args
, **kwargs
):
860 Scale(self, float xscale, float yscale)
862 Scales the dimensions of this object by the given factors.
864 return _core_
.Size_Scale(*args
, **kwargs
)
866 def Set(*args
, **kwargs
):
868 Set(self, int w, int h)
870 Set both width and height.
872 return _core_
.Size_Set(*args
, **kwargs
)
874 def SetWidth(*args
, **kwargs
):
875 """SetWidth(self, int w)"""
876 return _core_
.Size_SetWidth(*args
, **kwargs
)
878 def SetHeight(*args
, **kwargs
):
879 """SetHeight(self, int h)"""
880 return _core_
.Size_SetHeight(*args
, **kwargs
)
882 def GetWidth(*args
, **kwargs
):
883 """GetWidth(self) -> int"""
884 return _core_
.Size_GetWidth(*args
, **kwargs
)
886 def GetHeight(*args
, **kwargs
):
887 """GetHeight(self) -> int"""
888 return _core_
.Size_GetHeight(*args
, **kwargs
)
890 def IsFullySpecified(*args
, **kwargs
):
892 IsFullySpecified(self) -> bool
894 Returns True if both components of the size are non-default values.
896 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
898 def SetDefaults(*args
, **kwargs
):
900 SetDefaults(self, Size size)
902 Combine this size with the other one replacing the default components
903 of this object (i.e. equal to -1) with those of the other.
905 return _core_
.Size_SetDefaults(*args
, **kwargs
)
907 def Get(*args
, **kwargs
):
909 Get() -> (width,height)
911 Returns the width and height properties as a tuple.
913 return _core_
.Size_Get(*args
, **kwargs
)
915 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
916 def __str__(self
): return str(self
.Get())
917 def __repr__(self
): return 'wx.Size'+str(self
.Get())
918 def __len__(self
): return len(self
.Get())
919 def __getitem__(self
, index
): return self
.Get()[index
]
920 def __setitem__(self
, index
, val
):
921 if index
== 0: self
.width
= val
922 elif index
== 1: self
.height
= val
923 else: raise IndexError
924 def __nonzero__(self
): return self
.Get() != (0,0)
925 __safe_for_unpickling__
= True
926 def __reduce__(self
): return (wx
.Size
, self
.Get())
928 _core_
.Size_swigregister(Size
)
930 #---------------------------------------------------------------------------
932 class RealPoint(object):
934 A data structure for representing a point or position with floating
935 point x and y properties. In wxPython most places that expect a
936 wx.RealPoint can also accept a (x,y) tuple.
938 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
939 __repr__
= _swig_repr
940 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
941 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
942 def __init__(self
, *args
, **kwargs
):
944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
946 Create a wx.RealPoint object
948 _core_
.RealPoint_swiginit(self
,_core_
.new_RealPoint(*args
, **kwargs
))
949 __swig_destroy__
= _core_
.delete_RealPoint
950 __del__
= lambda self
: None;
951 def __eq__(*args
, **kwargs
):
953 __eq__(self, PyObject other) -> bool
955 Test for equality of wx.RealPoint objects.
957 return _core_
.RealPoint___eq__(*args
, **kwargs
)
959 def __ne__(*args
, **kwargs
):
961 __ne__(self, PyObject other) -> bool
963 Test for inequality of wx.RealPoint objects.
965 return _core_
.RealPoint___ne__(*args
, **kwargs
)
967 def __add__(*args
, **kwargs
):
969 __add__(self, RealPoint pt) -> RealPoint
971 Add pt's proprties to this and return the result.
973 return _core_
.RealPoint___add__(*args
, **kwargs
)
975 def __sub__(*args
, **kwargs
):
977 __sub__(self, RealPoint pt) -> RealPoint
979 Subtract pt's proprties from this and return the result
981 return _core_
.RealPoint___sub__(*args
, **kwargs
)
983 def Set(*args
, **kwargs
):
985 Set(self, double x, double y)
987 Set both the x and y properties
989 return _core_
.RealPoint_Set(*args
, **kwargs
)
991 def Get(*args
, **kwargs
):
995 Return the x and y properties as a tuple.
997 return _core_
.RealPoint_Get(*args
, **kwargs
)
999 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1000 def __str__(self
): return str(self
.Get())
1001 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
1002 def __len__(self
): return len(self
.Get())
1003 def __getitem__(self
, index
): return self
.Get()[index
]
1004 def __setitem__(self
, index
, val
):
1005 if index
== 0: self
.x
= val
1006 elif index
== 1: self
.y
= val
1007 else: raise IndexError
1008 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1009 __safe_for_unpickling__
= True
1010 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
1012 _core_
.RealPoint_swigregister(RealPoint
)
1014 #---------------------------------------------------------------------------
1016 class Point(object):
1018 A data structure for representing a point or position with integer x
1019 and y properties. Most places in wxPython that expect a wx.Point can
1020 also accept a (x,y) tuple.
1022 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1023 __repr__
= _swig_repr
1024 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1025 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1026 def __init__(self
, *args
, **kwargs
):
1028 __init__(self, int x=0, int y=0) -> Point
1030 Create a wx.Point object
1032 _core_
.Point_swiginit(self
,_core_
.new_Point(*args
, **kwargs
))
1033 __swig_destroy__
= _core_
.delete_Point
1034 __del__
= lambda self
: None;
1035 def __eq__(*args
, **kwargs
):
1037 __eq__(self, PyObject other) -> bool
1039 Test for equality of wx.Point objects.
1041 return _core_
.Point___eq__(*args
, **kwargs
)
1043 def __ne__(*args
, **kwargs
):
1045 __ne__(self, PyObject other) -> bool
1047 Test for inequality of wx.Point objects.
1049 return _core_
.Point___ne__(*args
, **kwargs
)
1051 def __add__(*args
, **kwargs
):
1053 __add__(self, Point pt) -> Point
1055 Add pt's proprties to this and return the result.
1057 return _core_
.Point___add__(*args
, **kwargs
)
1059 def __sub__(*args
, **kwargs
):
1061 __sub__(self, Point pt) -> Point
1063 Subtract pt's proprties from this and return the result
1065 return _core_
.Point___sub__(*args
, **kwargs
)
1067 def __iadd__(*args
, **kwargs
):
1069 __iadd__(self, Point pt) -> Point
1071 Add pt to this object.
1073 return _core_
.Point___iadd__(*args
, **kwargs
)
1075 def __isub__(*args
, **kwargs
):
1077 __isub__(self, Point pt) -> Point
1079 Subtract pt from this object.
1081 return _core_
.Point___isub__(*args
, **kwargs
)
1083 def Set(*args
, **kwargs
):
1085 Set(self, long x, long y)
1087 Set both the x and y properties
1089 return _core_
.Point_Set(*args
, **kwargs
)
1091 def Get(*args
, **kwargs
):
1095 Return the x and y properties as a tuple.
1097 return _core_
.Point_Get(*args
, **kwargs
)
1099 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1100 def __str__(self
): return str(self
.Get())
1101 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1102 def __len__(self
): return len(self
.Get())
1103 def __getitem__(self
, index
): return self
.Get()[index
]
1104 def __setitem__(self
, index
, val
):
1105 if index
== 0: self
.x
= val
1106 elif index
== 1: self
.y
= val
1107 else: raise IndexError
1108 def __nonzero__(self
): return self
.Get() != (0,0)
1109 __safe_for_unpickling__
= True
1110 def __reduce__(self
): return (wx
.Point
, self
.Get())
1112 _core_
.Point_swigregister(Point
)
1114 #---------------------------------------------------------------------------
1118 A class for representing and manipulating rectangles. It has x, y,
1119 width and height properties. In wxPython most palces that expect a
1120 wx.Rect can also accept a (x,y,width,height) tuple.
1122 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1123 __repr__
= _swig_repr
1124 def __init__(self
, *args
, **kwargs
):
1126 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1128 Create a new Rect object.
1130 _core_
.Rect_swiginit(self
,_core_
.new_Rect(*args
, **kwargs
))
1131 __swig_destroy__
= _core_
.delete_Rect
1132 __del__
= lambda self
: None;
1133 def GetX(*args
, **kwargs
):
1134 """GetX(self) -> int"""
1135 return _core_
.Rect_GetX(*args
, **kwargs
)
1137 def SetX(*args
, **kwargs
):
1138 """SetX(self, int x)"""
1139 return _core_
.Rect_SetX(*args
, **kwargs
)
1141 def GetY(*args
, **kwargs
):
1142 """GetY(self) -> int"""
1143 return _core_
.Rect_GetY(*args
, **kwargs
)
1145 def SetY(*args
, **kwargs
):
1146 """SetY(self, int y)"""
1147 return _core_
.Rect_SetY(*args
, **kwargs
)
1149 def GetWidth(*args
, **kwargs
):
1150 """GetWidth(self) -> int"""
1151 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1153 def SetWidth(*args
, **kwargs
):
1154 """SetWidth(self, int w)"""
1155 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1157 def GetHeight(*args
, **kwargs
):
1158 """GetHeight(self) -> int"""
1159 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1161 def SetHeight(*args
, **kwargs
):
1162 """SetHeight(self, int h)"""
1163 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1165 def GetPosition(*args
, **kwargs
):
1166 """GetPosition(self) -> Point"""
1167 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1169 def SetPosition(*args
, **kwargs
):
1170 """SetPosition(self, Point p)"""
1171 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1173 def GetSize(*args
, **kwargs
):
1174 """GetSize(self) -> Size"""
1175 return _core_
.Rect_GetSize(*args
, **kwargs
)
1177 def SetSize(*args
, **kwargs
):
1178 """SetSize(self, Size s)"""
1179 return _core_
.Rect_SetSize(*args
, **kwargs
)
1181 def IsEmpty(*args
, **kwargs
):
1182 """IsEmpty(self) -> bool"""
1183 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1185 def GetTopLeft(*args
, **kwargs
):
1186 """GetTopLeft(self) -> Point"""
1187 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1189 def SetTopLeft(*args
, **kwargs
):
1190 """SetTopLeft(self, Point p)"""
1191 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1193 def GetBottomRight(*args
, **kwargs
):
1194 """GetBottomRight(self) -> Point"""
1195 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1197 def SetBottomRight(*args
, **kwargs
):
1198 """SetBottomRight(self, Point p)"""
1199 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1201 def GetTopRight(*args
, **kwargs
):
1202 """GetTopRight(self) -> Point"""
1203 return _core_
.Rect_GetTopRight(*args
, **kwargs
)
1205 def SetTopRight(*args
, **kwargs
):
1206 """SetTopRight(self, Point p)"""
1207 return _core_
.Rect_SetTopRight(*args
, **kwargs
)
1209 def GetBottomLeft(*args
, **kwargs
):
1210 """GetBottomLeft(self) -> Point"""
1211 return _core_
.Rect_GetBottomLeft(*args
, **kwargs
)
1213 def SetBottomLeft(*args
, **kwargs
):
1214 """SetBottomLeft(self, Point p)"""
1215 return _core_
.Rect_SetBottomLeft(*args
, **kwargs
)
1217 def GetLeft(*args
, **kwargs
):
1218 """GetLeft(self) -> int"""
1219 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1221 def GetTop(*args
, **kwargs
):
1222 """GetTop(self) -> int"""
1223 return _core_
.Rect_GetTop(*args
, **kwargs
)
1225 def GetBottom(*args
, **kwargs
):
1226 """GetBottom(self) -> int"""
1227 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1229 def GetRight(*args
, **kwargs
):
1230 """GetRight(self) -> int"""
1231 return _core_
.Rect_GetRight(*args
, **kwargs
)
1233 def SetLeft(*args
, **kwargs
):
1234 """SetLeft(self, int left)"""
1235 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1237 def SetRight(*args
, **kwargs
):
1238 """SetRight(self, int right)"""
1239 return _core_
.Rect_SetRight(*args
, **kwargs
)
1241 def SetTop(*args
, **kwargs
):
1242 """SetTop(self, int top)"""
1243 return _core_
.Rect_SetTop(*args
, **kwargs
)
1245 def SetBottom(*args
, **kwargs
):
1246 """SetBottom(self, int bottom)"""
1247 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1249 position
= property(GetPosition
, SetPosition
)
1250 size
= property(GetSize
, SetSize
)
1251 left
= property(GetLeft
, SetLeft
)
1252 right
= property(GetRight
, SetRight
)
1253 top
= property(GetTop
, SetTop
)
1254 bottom
= property(GetBottom
, SetBottom
)
1256 def Inflate(*args
, **kwargs
):
1258 Inflate(self, int dx, int dy) -> Rect
1260 Increases the size of the rectangle.
1262 The left border is moved farther left and the right border is moved
1263 farther right by ``dx``. The upper border is moved farther up and the
1264 bottom border is moved farther down by ``dy``. (Note the the width and
1265 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1266 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1267 opposite happens: the rectangle size decreases in the respective
1270 The change is made to the rectangle inplace, if instead you need a
1271 copy that is inflated, preserving the original then make the copy
1274 copy = wx.Rect(*original)
1279 return _core_
.Rect_Inflate(*args
, **kwargs
)
1281 def Deflate(*args
, **kwargs
):
1283 Deflate(self, int dx, int dy) -> Rect
1285 Decrease the rectangle size. This method is the opposite of `Inflate`
1286 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1287 `Inflate` for a full description.
1289 return _core_
.Rect_Deflate(*args
, **kwargs
)
1291 def OffsetXY(*args
, **kwargs
):
1293 OffsetXY(self, int dx, int dy)
1295 Moves the rectangle by the specified offset. If dx is positive, the
1296 rectangle is moved to the right, if dy is positive, it is moved to the
1297 bottom, otherwise it is moved to the left or top respectively.
1299 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1301 def Offset(*args
, **kwargs
):
1303 Offset(self, Point pt)
1305 Same as `OffsetXY` but uses dx,dy from Point
1307 return _core_
.Rect_Offset(*args
, **kwargs
)
1309 def Intersect(*args
, **kwargs
):
1311 Intersect(self, Rect rect) -> Rect
1313 Returns the intersectsion of this rectangle and rect.
1315 return _core_
.Rect_Intersect(*args
, **kwargs
)
1317 def Union(*args
, **kwargs
):
1319 Union(self, Rect rect) -> Rect
1321 Returns the union of this rectangle and rect.
1323 return _core_
.Rect_Union(*args
, **kwargs
)
1325 def __add__(*args
, **kwargs
):
1327 __add__(self, Rect rect) -> Rect
1329 Add the properties of rect to this rectangle and return the result.
1331 return _core_
.Rect___add__(*args
, **kwargs
)
1333 def __iadd__(*args
, **kwargs
):
1335 __iadd__(self, Rect rect) -> Rect
1337 Add the properties of rect to this rectangle, updating this rectangle.
1339 return _core_
.Rect___iadd__(*args
, **kwargs
)
1341 def __eq__(*args
, **kwargs
):
1343 __eq__(self, PyObject other) -> bool
1345 Test for equality of wx.Rect objects.
1347 return _core_
.Rect___eq__(*args
, **kwargs
)
1349 def __ne__(*args
, **kwargs
):
1351 __ne__(self, PyObject other) -> bool
1353 Test for inequality of wx.Rect objects.
1355 return _core_
.Rect___ne__(*args
, **kwargs
)
1357 def ContainsXY(*args
, **kwargs
):
1359 ContainsXY(self, int x, int y) -> bool
1361 Return True if the point is inside the rect.
1363 return _core_
.Rect_ContainsXY(*args
, **kwargs
)
1365 def Contains(*args
, **kwargs
):
1367 Contains(self, Point pt) -> bool
1369 Return True if the point is inside the rect.
1371 return _core_
.Rect_Contains(*args
, **kwargs
)
1373 def ContainsRect(*args
, **kwargs
):
1375 ContainsRect(self, Rect rect) -> bool
1377 Returns ``True`` if the given rectangle is completely inside this
1378 rectangle or touches its boundary.
1380 return _core_
.Rect_ContainsRect(*args
, **kwargs
)
1382 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1383 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1384 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1386 InsideXY
= ContainsXY
1387 InsideRect
= ContainsRect
1389 def Intersects(*args
, **kwargs
):
1391 Intersects(self, Rect rect) -> bool
1393 Returns True if the rectangles have a non empty intersection.
1395 return _core_
.Rect_Intersects(*args
, **kwargs
)
1397 def CenterIn(*args
, **kwargs
):
1399 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1401 Center this rectangle within the one passed to the method, which is
1402 usually, but not necessarily, the larger one.
1404 return _core_
.Rect_CenterIn(*args
, **kwargs
)
1407 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1408 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1409 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1410 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1411 def Set(*args
, **kwargs
):
1413 Set(self, int x=0, int y=0, int width=0, int height=0)
1415 Set all rectangle properties.
1417 return _core_
.Rect_Set(*args
, **kwargs
)
1419 def Get(*args
, **kwargs
):
1421 Get() -> (x,y,width,height)
1423 Return the rectangle properties as a tuple.
1425 return _core_
.Rect_Get(*args
, **kwargs
)
1427 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1428 def __str__(self
): return str(self
.Get())
1429 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1430 def __len__(self
): return len(self
.Get())
1431 def __getitem__(self
, index
): return self
.Get()[index
]
1432 def __setitem__(self
, index
, val
):
1433 if index
== 0: self
.x
= val
1434 elif index
== 1: self
.y
= val
1435 elif index
== 2: self
.width
= val
1436 elif index
== 3: self
.height
= val
1437 else: raise IndexError
1438 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1439 __safe_for_unpickling__
= True
1440 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1442 Bottom
= property(GetBottom
,SetBottom
,doc
="See `GetBottom` and `SetBottom`")
1443 BottomRight
= property(GetBottomRight
,SetBottomRight
,doc
="See `GetBottomRight` and `SetBottomRight`")
1444 BottomLeft
= property(GetBottomLeft
,SetBottomLeft
,doc
="See `GetBottomLeft` and `SetBottomLeft`")
1445 Height
= property(GetHeight
,SetHeight
,doc
="See `GetHeight` and `SetHeight`")
1446 Left
= property(GetLeft
,SetLeft
,doc
="See `GetLeft` and `SetLeft`")
1447 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
1448 Right
= property(GetRight
,SetRight
,doc
="See `GetRight` and `SetRight`")
1449 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
1450 Top
= property(GetTop
,SetTop
,doc
="See `GetTop` and `SetTop`")
1451 TopLeft
= property(GetTopLeft
,SetTopLeft
,doc
="See `GetTopLeft` and `SetTopLeft`")
1452 TopRight
= property(GetTopRight
,SetTopRight
,doc
="See `GetTopRight` and `SetTopRight`")
1453 Width
= property(GetWidth
,SetWidth
,doc
="See `GetWidth` and `SetWidth`")
1454 X
= property(GetX
,SetX
,doc
="See `GetX` and `SetX`")
1455 Y
= property(GetY
,SetY
,doc
="See `GetY` and `SetY`")
1456 Empty
= property(IsEmpty
,doc
="See `IsEmpty`")
1457 _core_
.Rect_swigregister(Rect
)
1459 def RectPP(*args
, **kwargs
):
1461 RectPP(Point topLeft, Point bottomRight) -> Rect
1463 Create a new Rect object from Points representing two corners.
1465 val
= _core_
.new_RectPP(*args
, **kwargs
)
1468 def RectPS(*args
, **kwargs
):
1470 RectPS(Point pos, Size size) -> Rect
1472 Create a new Rect from a position and size.
1474 val
= _core_
.new_RectPS(*args
, **kwargs
)
1477 def RectS(*args
, **kwargs
):
1479 RectS(Size size) -> Rect
1481 Create a new Rect from a size only.
1483 val
= _core_
.new_RectS(*args
, **kwargs
)
1487 def IntersectRect(*args
, **kwargs
):
1489 IntersectRect(Rect r1, Rect r2) -> Rect
1491 Calculate and return the intersection of r1 and r2.
1493 return _core_
.IntersectRect(*args
, **kwargs
)
1494 #---------------------------------------------------------------------------
1496 class Point2D(object):
1498 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1499 with floating point values.
1501 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1502 __repr__
= _swig_repr
1503 def __init__(self
, *args
, **kwargs
):
1505 __init__(self, double x=0.0, double y=0.0) -> Point2D
1507 Create a w.Point2D object.
1509 _core_
.Point2D_swiginit(self
,_core_
.new_Point2D(*args
, **kwargs
))
1510 __swig_destroy__
= _core_
.delete_Point2D
1511 __del__
= lambda self
: None;
1512 def GetFloor(*args
, **kwargs
):
1518 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1520 def GetRounded(*args
, **kwargs
):
1522 GetRounded() -> (x,y)
1526 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1528 def GetVectorLength(*args
, **kwargs
):
1529 """GetVectorLength(self) -> double"""
1530 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1532 def GetVectorAngle(*args
, **kwargs
):
1533 """GetVectorAngle(self) -> double"""
1534 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1536 def SetVectorLength(*args
, **kwargs
):
1537 """SetVectorLength(self, double length)"""
1538 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1540 def SetVectorAngle(*args
, **kwargs
):
1541 """SetVectorAngle(self, double degrees)"""
1542 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1544 def SetPolarCoordinates(self
, angle
, length
):
1545 self
.SetVectorLength(length
)
1546 self
.SetVectorAngle(angle
)
1547 def Normalize(self
):
1548 self
.SetVectorLength(1.0)
1550 def GetDistance(*args
, **kwargs
):
1551 """GetDistance(self, Point2D pt) -> double"""
1552 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1554 def GetDistanceSquare(*args
, **kwargs
):
1555 """GetDistanceSquare(self, Point2D pt) -> double"""
1556 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1558 def GetDotProduct(*args
, **kwargs
):
1559 """GetDotProduct(self, Point2D vec) -> double"""
1560 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1562 def GetCrossProduct(*args
, **kwargs
):
1563 """GetCrossProduct(self, Point2D vec) -> double"""
1564 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1566 def __neg__(*args
, **kwargs
):
1568 __neg__(self) -> Point2D
1570 the reflection of this point
1572 return _core_
.Point2D___neg__(*args
, **kwargs
)
1574 def __iadd__(*args
, **kwargs
):
1575 """__iadd__(self, Point2D pt) -> Point2D"""
1576 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1578 def __isub__(*args
, **kwargs
):
1579 """__isub__(self, Point2D pt) -> Point2D"""
1580 return _core_
.Point2D___isub__(*args
, **kwargs
)
1582 def __imul__(*args
, **kwargs
):
1583 """__imul__(self, Point2D pt) -> Point2D"""
1584 return _core_
.Point2D___imul__(*args
, **kwargs
)
1586 def __idiv__(*args
, **kwargs
):
1587 """__idiv__(self, Point2D pt) -> Point2D"""
1588 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1590 def __eq__(*args
, **kwargs
):
1592 __eq__(self, PyObject other) -> bool
1594 Test for equality of wx.Point2D objects.
1596 return _core_
.Point2D___eq__(*args
, **kwargs
)
1598 def __ne__(*args
, **kwargs
):
1600 __ne__(self, PyObject other) -> bool
1602 Test for inequality of wx.Point2D objects.
1604 return _core_
.Point2D___ne__(*args
, **kwargs
)
1606 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1607 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1608 def Set(*args
, **kwargs
):
1609 """Set(self, double x=0, double y=0)"""
1610 return _core_
.Point2D_Set(*args
, **kwargs
)
1612 def Get(*args
, **kwargs
):
1616 Return x and y properties as a tuple.
1618 return _core_
.Point2D_Get(*args
, **kwargs
)
1620 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1621 def __str__(self
): return str(self
.Get())
1622 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1623 def __len__(self
): return len(self
.Get())
1624 def __getitem__(self
, index
): return self
.Get()[index
]
1625 def __setitem__(self
, index
, val
):
1626 if index
== 0: self
.x
= val
1627 elif index
== 1: self
.y
= val
1628 else: raise IndexError
1629 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1630 __safe_for_unpickling__
= True
1631 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1633 Floor
= property(GetFloor
,doc
="See `GetFloor`")
1634 Rounded
= property(GetRounded
,doc
="See `GetRounded`")
1635 VectorAngle
= property(GetVectorAngle
,SetVectorAngle
,doc
="See `GetVectorAngle` and `SetVectorAngle`")
1636 VectorLength
= property(GetVectorLength
,SetVectorLength
,doc
="See `GetVectorLength` and `SetVectorLength`")
1637 _core_
.Point2D_swigregister(Point2D
)
1639 def Point2DCopy(*args
, **kwargs
):
1641 Point2DCopy(Point2D pt) -> Point2D
1643 Create a w.Point2D object.
1645 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1648 def Point2DFromPoint(*args
, **kwargs
):
1650 Point2DFromPoint(Point pt) -> Point2D
1652 Create a w.Point2D object.
1654 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1657 #---------------------------------------------------------------------------
1659 Inside
= _core_
.Inside
1660 OutLeft
= _core_
.OutLeft
1661 OutRight
= _core_
.OutRight
1662 OutTop
= _core_
.OutTop
1663 OutBottom
= _core_
.OutBottom
1664 class Rect2D(object):
1666 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1667 with floating point component values.
1669 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1670 __repr__
= _swig_repr
1671 def __init__(self
, *args
, **kwargs
):
1673 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1675 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1676 with floating point component values.
1678 _core_
.Rect2D_swiginit(self
,_core_
.new_Rect2D(*args
, **kwargs
))
1679 __swig_destroy__
= _core_
.delete_Rect2D
1680 __del__
= lambda self
: None;
1681 def GetPosition(*args
, **kwargs
):
1682 """GetPosition(self) -> Point2D"""
1683 return _core_
.Rect2D_GetPosition(*args
, **kwargs
)
1685 def GetSize(*args
, **kwargs
):
1686 """GetSize(self) -> Size"""
1687 return _core_
.Rect2D_GetSize(*args
, **kwargs
)
1689 def GetLeft(*args
, **kwargs
):
1690 """GetLeft(self) -> wxDouble"""
1691 return _core_
.Rect2D_GetLeft(*args
, **kwargs
)
1693 def SetLeft(*args
, **kwargs
):
1694 """SetLeft(self, wxDouble n)"""
1695 return _core_
.Rect2D_SetLeft(*args
, **kwargs
)
1697 def MoveLeftTo(*args
, **kwargs
):
1698 """MoveLeftTo(self, wxDouble n)"""
1699 return _core_
.Rect2D_MoveLeftTo(*args
, **kwargs
)
1701 def GetTop(*args
, **kwargs
):
1702 """GetTop(self) -> wxDouble"""
1703 return _core_
.Rect2D_GetTop(*args
, **kwargs
)
1705 def SetTop(*args
, **kwargs
):
1706 """SetTop(self, wxDouble n)"""
1707 return _core_
.Rect2D_SetTop(*args
, **kwargs
)
1709 def MoveTopTo(*args
, **kwargs
):
1710 """MoveTopTo(self, wxDouble n)"""
1711 return _core_
.Rect2D_MoveTopTo(*args
, **kwargs
)
1713 def GetBottom(*args
, **kwargs
):
1714 """GetBottom(self) -> wxDouble"""
1715 return _core_
.Rect2D_GetBottom(*args
, **kwargs
)
1717 def SetBottom(*args
, **kwargs
):
1718 """SetBottom(self, wxDouble n)"""
1719 return _core_
.Rect2D_SetBottom(*args
, **kwargs
)
1721 def MoveBottomTo(*args
, **kwargs
):
1722 """MoveBottomTo(self, wxDouble n)"""
1723 return _core_
.Rect2D_MoveBottomTo(*args
, **kwargs
)
1725 def GetRight(*args
, **kwargs
):
1726 """GetRight(self) -> wxDouble"""
1727 return _core_
.Rect2D_GetRight(*args
, **kwargs
)
1729 def SetRight(*args
, **kwargs
):
1730 """SetRight(self, wxDouble n)"""
1731 return _core_
.Rect2D_SetRight(*args
, **kwargs
)
1733 def MoveRightTo(*args
, **kwargs
):
1734 """MoveRightTo(self, wxDouble n)"""
1735 return _core_
.Rect2D_MoveRightTo(*args
, **kwargs
)
1737 def GetLeftTop(*args
, **kwargs
):
1738 """GetLeftTop(self) -> Point2D"""
1739 return _core_
.Rect2D_GetLeftTop(*args
, **kwargs
)
1741 def SetLeftTop(*args
, **kwargs
):
1742 """SetLeftTop(self, Point2D pt)"""
1743 return _core_
.Rect2D_SetLeftTop(*args
, **kwargs
)
1745 def MoveLeftTopTo(*args
, **kwargs
):
1746 """MoveLeftTopTo(self, Point2D pt)"""
1747 return _core_
.Rect2D_MoveLeftTopTo(*args
, **kwargs
)
1749 def GetLeftBottom(*args
, **kwargs
):
1750 """GetLeftBottom(self) -> Point2D"""
1751 return _core_
.Rect2D_GetLeftBottom(*args
, **kwargs
)
1753 def SetLeftBottom(*args
, **kwargs
):
1754 """SetLeftBottom(self, Point2D pt)"""
1755 return _core_
.Rect2D_SetLeftBottom(*args
, **kwargs
)
1757 def MoveLeftBottomTo(*args
, **kwargs
):
1758 """MoveLeftBottomTo(self, Point2D pt)"""
1759 return _core_
.Rect2D_MoveLeftBottomTo(*args
, **kwargs
)
1761 def GetRightTop(*args
, **kwargs
):
1762 """GetRightTop(self) -> Point2D"""
1763 return _core_
.Rect2D_GetRightTop(*args
, **kwargs
)
1765 def SetRightTop(*args
, **kwargs
):
1766 """SetRightTop(self, Point2D pt)"""
1767 return _core_
.Rect2D_SetRightTop(*args
, **kwargs
)
1769 def MoveRightTopTo(*args
, **kwargs
):
1770 """MoveRightTopTo(self, Point2D pt)"""
1771 return _core_
.Rect2D_MoveRightTopTo(*args
, **kwargs
)
1773 def GetRightBottom(*args
, **kwargs
):
1774 """GetRightBottom(self) -> Point2D"""
1775 return _core_
.Rect2D_GetRightBottom(*args
, **kwargs
)
1777 def SetRightBottom(*args
, **kwargs
):
1778 """SetRightBottom(self, Point2D pt)"""
1779 return _core_
.Rect2D_SetRightBottom(*args
, **kwargs
)
1781 def MoveRightBottomTo(*args
, **kwargs
):
1782 """MoveRightBottomTo(self, Point2D pt)"""
1783 return _core_
.Rect2D_MoveRightBottomTo(*args
, **kwargs
)
1785 def GetCentre(*args
, **kwargs
):
1786 """GetCentre(self) -> Point2D"""
1787 return _core_
.Rect2D_GetCentre(*args
, **kwargs
)
1789 def SetCentre(*args
, **kwargs
):
1790 """SetCentre(self, Point2D pt)"""
1791 return _core_
.Rect2D_SetCentre(*args
, **kwargs
)
1793 def MoveCentreTo(*args
, **kwargs
):
1794 """MoveCentreTo(self, Point2D pt)"""
1795 return _core_
.Rect2D_MoveCentreTo(*args
, **kwargs
)
1797 def GetOutcode(*args
, **kwargs
):
1798 """GetOutcode(self, Point2D pt) -> int"""
1799 return _core_
.Rect2D_GetOutcode(*args
, **kwargs
)
1801 def Contains(*args
, **kwargs
):
1802 """Contains(self, Point2D pt) -> bool"""
1803 return _core_
.Rect2D_Contains(*args
, **kwargs
)
1805 def ContainsRect(*args
, **kwargs
):
1806 """ContainsRect(self, Rect2D rect) -> bool"""
1807 return _core_
.Rect2D_ContainsRect(*args
, **kwargs
)
1809 def IsEmpty(*args
, **kwargs
):
1810 """IsEmpty(self) -> bool"""
1811 return _core_
.Rect2D_IsEmpty(*args
, **kwargs
)
1813 def HaveEqualSize(*args
, **kwargs
):
1814 """HaveEqualSize(self, Rect2D rect) -> bool"""
1815 return _core_
.Rect2D_HaveEqualSize(*args
, **kwargs
)
1819 Inset(self, wxDouble x, wxDouble y)
1820 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1822 return _core_
.Rect2D_Inset(*args
)
1824 def Offset(*args
, **kwargs
):
1825 """Offset(self, Point2D pt)"""
1826 return _core_
.Rect2D_Offset(*args
, **kwargs
)
1828 def ConstrainTo(*args
, **kwargs
):
1829 """ConstrainTo(self, Rect2D rect)"""
1830 return _core_
.Rect2D_ConstrainTo(*args
, **kwargs
)
1832 def Interpolate(*args
, **kwargs
):
1833 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1834 return _core_
.Rect2D_Interpolate(*args
, **kwargs
)
1836 def Intersect(*args
, **kwargs
):
1837 """Intersect(self, Rect2D otherRect)"""
1838 return _core_
.Rect2D_Intersect(*args
, **kwargs
)
1840 def CreateIntersection(*args
, **kwargs
):
1841 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1842 return _core_
.Rect2D_CreateIntersection(*args
, **kwargs
)
1844 def Intersects(*args
, **kwargs
):
1845 """Intersects(self, Rect2D rect) -> bool"""
1846 return _core_
.Rect2D_Intersects(*args
, **kwargs
)
1848 def Union(*args
, **kwargs
):
1849 """Union(self, Rect2D otherRect)"""
1850 return _core_
.Rect2D_Union(*args
, **kwargs
)
1852 def CreateUnion(*args
, **kwargs
):
1853 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1854 return _core_
.Rect2D_CreateUnion(*args
, **kwargs
)
1858 Scale(self, wxDouble f)
1859 Scale(self, int num, int denum)
1861 return _core_
.Rect2D_Scale(*args
)
1863 def __eq__(*args
, **kwargs
):
1865 __eq__(self, PyObject other) -> bool
1867 Test for equality of wx.Rect2D objects.
1869 return _core_
.Rect2D___eq__(*args
, **kwargs
)
1871 def __ne__(*args
, **kwargs
):
1873 __ne__(self, PyObject other) -> bool
1875 Test for inequality of wx.Rect2D objects.
1877 return _core_
.Rect2D___ne__(*args
, **kwargs
)
1879 x
= property(_core_
.Rect2D_x_get
, _core_
.Rect2D_x_set
)
1880 y
= property(_core_
.Rect2D_y_get
, _core_
.Rect2D_y_set
)
1881 width
= property(_core_
.Rect2D_width_get
, _core_
.Rect2D_width_set
)
1882 height
= property(_core_
.Rect2D_height_get
, _core_
.Rect2D_height_set
)
1883 def Set(*args
, **kwargs
):
1884 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1885 return _core_
.Rect2D_Set(*args
, **kwargs
)
1887 def Get(*args
, **kwargs
):
1889 Get() -> (x,y, width, height)
1891 Return x, y, width and height y properties as a tuple.
1893 return _core_
.Rect2D_Get(*args
, **kwargs
)
1895 def __str__(self
): return str(self
.Get())
1896 def __repr__(self
): return 'wx.Rect2D'+str(self
.Get())
1897 def __len__(self
): return len(self
.Get())
1898 def __getitem__(self
, index
): return self
.Get()[index
]
1899 def __setitem__(self
, index
, val
):
1900 if index
== 0: self
.x
= val
1901 elif index
== 1: self
.y
= val
1902 elif index
== 2: self
.width
= val
1903 elif index
== 3: self
.height
= val
1904 else: raise IndexError
1905 def __nonzero__(self
): return self
.Get() != (0.0, 0.0, 0.0, 0.0)
1906 __safe_for_unpickling__
= True
1907 def __reduce__(self
): return (wx
.Rect2D
, self
.Get())
1909 _core_
.Rect2D_swigregister(Rect2D
)
1911 #---------------------------------------------------------------------------
1913 FromStart
= _core_
.FromStart
1914 FromCurrent
= _core_
.FromCurrent
1915 FromEnd
= _core_
.FromEnd
1916 class InputStream(object):
1917 """Proxy of C++ InputStream class"""
1918 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1919 __repr__
= _swig_repr
1920 def __init__(self
, *args
, **kwargs
):
1921 """__init__(self, PyObject p) -> InputStream"""
1922 _core_
.InputStream_swiginit(self
,_core_
.new_InputStream(*args
, **kwargs
))
1923 __swig_destroy__
= _core_
.delete_InputStream
1924 __del__
= lambda self
: None;
1925 def close(*args
, **kwargs
):
1927 return _core_
.InputStream_close(*args
, **kwargs
)
1929 def flush(*args
, **kwargs
):
1931 return _core_
.InputStream_flush(*args
, **kwargs
)
1933 def eof(*args
, **kwargs
):
1934 """eof(self) -> bool"""
1935 return _core_
.InputStream_eof(*args
, **kwargs
)
1937 def read(*args
, **kwargs
):
1938 """read(self, int size=-1) -> PyObject"""
1939 return _core_
.InputStream_read(*args
, **kwargs
)
1941 def readline(*args
, **kwargs
):
1942 """readline(self, int size=-1) -> PyObject"""
1943 return _core_
.InputStream_readline(*args
, **kwargs
)
1945 def readlines(*args
, **kwargs
):
1946 """readlines(self, int sizehint=-1) -> PyObject"""
1947 return _core_
.InputStream_readlines(*args
, **kwargs
)
1949 def seek(*args
, **kwargs
):
1950 """seek(self, int offset, int whence=0)"""
1951 return _core_
.InputStream_seek(*args
, **kwargs
)
1953 def tell(*args
, **kwargs
):
1954 """tell(self) -> int"""
1955 return _core_
.InputStream_tell(*args
, **kwargs
)
1957 def Peek(*args
, **kwargs
):
1958 """Peek(self) -> char"""
1959 return _core_
.InputStream_Peek(*args
, **kwargs
)
1961 def GetC(*args
, **kwargs
):
1962 """GetC(self) -> char"""
1963 return _core_
.InputStream_GetC(*args
, **kwargs
)
1965 def LastRead(*args
, **kwargs
):
1966 """LastRead(self) -> size_t"""
1967 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1969 def CanRead(*args
, **kwargs
):
1970 """CanRead(self) -> bool"""
1971 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1973 def Eof(*args
, **kwargs
):
1974 """Eof(self) -> bool"""
1975 return _core_
.InputStream_Eof(*args
, **kwargs
)
1977 def Ungetch(*args
, **kwargs
):
1978 """Ungetch(self, char c) -> bool"""
1979 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1981 def SeekI(*args
, **kwargs
):
1982 """SeekI(self, long pos, int mode=FromStart) -> long"""
1983 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1985 def TellI(*args
, **kwargs
):
1986 """TellI(self) -> long"""
1987 return _core_
.InputStream_TellI(*args
, **kwargs
)
1989 _core_
.InputStream_swigregister(InputStream
)
1990 DefaultPosition
= cvar
.DefaultPosition
1991 DefaultSize
= cvar
.DefaultSize
1993 class OutputStream(object):
1994 """Proxy of C++ OutputStream class"""
1995 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1996 def __init__(self
): raise AttributeError, "No constructor defined"
1997 __repr__
= _swig_repr
1998 def write(*args
, **kwargs
):
1999 """write(self, PyObject obj)"""
2000 return _core_
.OutputStream_write(*args
, **kwargs
)
2002 def LastWrite(*args
, **kwargs
):
2003 """LastWrite(self) -> size_t"""
2004 return _core_
.OutputStream_LastWrite(*args
, **kwargs
)
2006 _core_
.OutputStream_swigregister(OutputStream
)
2008 #---------------------------------------------------------------------------
2010 class FSFile(Object
):
2011 """Proxy of C++ FSFile class"""
2012 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2013 __repr__
= _swig_repr
2014 def __init__(self
, *args
, **kwargs
):
2016 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
2017 DateTime modif) -> FSFile
2019 _core_
.FSFile_swiginit(self
,_core_
.new_FSFile(*args
, **kwargs
))
2020 __swig_destroy__
= _core_
.delete_FSFile
2021 __del__
= lambda self
: None;
2022 def GetStream(*args
, **kwargs
):
2023 """GetStream(self) -> InputStream"""
2024 return _core_
.FSFile_GetStream(*args
, **kwargs
)
2026 def DetachStream(*args
, **kwargs
):
2027 """DetachStream(self)"""
2028 return _core_
.FSFile_DetachStream(*args
, **kwargs
)
2030 def GetMimeType(*args
, **kwargs
):
2031 """GetMimeType(self) -> String"""
2032 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
2034 def GetLocation(*args
, **kwargs
):
2035 """GetLocation(self) -> String"""
2036 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
2038 def GetAnchor(*args
, **kwargs
):
2039 """GetAnchor(self) -> String"""
2040 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
2042 def GetModificationTime(*args
, **kwargs
):
2043 """GetModificationTime(self) -> DateTime"""
2044 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
2046 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
2047 Location
= property(GetLocation
,doc
="See `GetLocation`")
2048 MimeType
= property(GetMimeType
,doc
="See `GetMimeType`")
2049 ModificationTime
= property(GetModificationTime
,doc
="See `GetModificationTime`")
2050 Stream
= property(GetStream
,doc
="See `GetStream`")
2051 _core_
.FSFile_swigregister(FSFile
)
2053 class CPPFileSystemHandler(object):
2054 """Proxy of C++ CPPFileSystemHandler class"""
2055 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2056 def __init__(self
): raise AttributeError, "No constructor defined"
2057 __repr__
= _swig_repr
2058 __swig_destroy__
= _core_
.delete_CPPFileSystemHandler
2059 __del__
= lambda self
: None;
2060 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandler
)
2062 class FileSystemHandler(CPPFileSystemHandler
):
2063 """Proxy of C++ FileSystemHandler class"""
2064 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2065 __repr__
= _swig_repr
2066 def __init__(self
, *args
, **kwargs
):
2067 """__init__(self) -> FileSystemHandler"""
2068 _core_
.FileSystemHandler_swiginit(self
,_core_
.new_FileSystemHandler(*args
, **kwargs
))
2069 FileSystemHandler
._setCallbackInfo
(self
, self
, FileSystemHandler
)
2071 def _setCallbackInfo(*args
, **kwargs
):
2072 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
2073 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
2075 def CanOpen(*args
, **kwargs
):
2076 """CanOpen(self, String location) -> bool"""
2077 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
2079 def OpenFile(*args
, **kwargs
):
2080 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2081 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
2083 def FindFirst(*args
, **kwargs
):
2084 """FindFirst(self, String spec, int flags=0) -> String"""
2085 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
2087 def FindNext(*args
, **kwargs
):
2088 """FindNext(self) -> String"""
2089 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
2091 def GetProtocol(*args
, **kwargs
):
2092 """GetProtocol(self, String location) -> String"""
2093 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
2095 def GetLeftLocation(*args
, **kwargs
):
2096 """GetLeftLocation(self, String location) -> String"""
2097 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
2099 def GetAnchor(*args
, **kwargs
):
2100 """GetAnchor(self, String location) -> String"""
2101 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
2103 def GetRightLocation(*args
, **kwargs
):
2104 """GetRightLocation(self, String location) -> String"""
2105 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
2107 def GetMimeTypeFromExt(*args
, **kwargs
):
2108 """GetMimeTypeFromExt(self, String location) -> String"""
2109 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
2111 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
2112 LeftLocation
= property(GetLeftLocation
,doc
="See `GetLeftLocation`")
2113 MimeTypeFromExt
= property(GetMimeTypeFromExt
,doc
="See `GetMimeTypeFromExt`")
2114 Protocol
= property(GetProtocol
,doc
="See `GetProtocol`")
2115 RightLocation
= property(GetRightLocation
,doc
="See `GetRightLocation`")
2116 _core_
.FileSystemHandler_swigregister(FileSystemHandler
)
2118 class FileSystem(Object
):
2119 """Proxy of C++ FileSystem 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) -> FileSystem"""
2124 _core_
.FileSystem_swiginit(self
,_core_
.new_FileSystem(*args
, **kwargs
))
2125 __swig_destroy__
= _core_
.delete_FileSystem
2126 __del__
= lambda self
: None;
2127 def ChangePathTo(*args
, **kwargs
):
2128 """ChangePathTo(self, String location, bool is_dir=False)"""
2129 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
2131 def GetPath(*args
, **kwargs
):
2132 """GetPath(self) -> String"""
2133 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
2135 def OpenFile(*args
, **kwargs
):
2136 """OpenFile(self, String location) -> FSFile"""
2137 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
2139 def FindFirst(*args
, **kwargs
):
2140 """FindFirst(self, String spec, int flags=0) -> String"""
2141 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
2143 def FindNext(*args
, **kwargs
):
2144 """FindNext(self) -> String"""
2145 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
2147 def AddHandler(*args
, **kwargs
):
2148 """AddHandler(CPPFileSystemHandler handler)"""
2149 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
2151 AddHandler
= staticmethod(AddHandler
)
2152 def RemoveHandler(*args
, **kwargs
):
2153 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2154 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
2156 RemoveHandler
= staticmethod(RemoveHandler
)
2157 def CleanUpHandlers(*args
, **kwargs
):
2158 """CleanUpHandlers()"""
2159 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
2161 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
2162 def FileNameToURL(*args
, **kwargs
):
2163 """FileNameToURL(String filename) -> String"""
2164 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
2166 FileNameToURL
= staticmethod(FileNameToURL
)
2167 def URLToFileName(*args
, **kwargs
):
2168 """URLToFileName(String url) -> String"""
2169 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
2171 URLToFileName
= staticmethod(URLToFileName
)
2172 Path
= property(GetPath
,doc
="See `GetPath`")
2173 _core_
.FileSystem_swigregister(FileSystem
)
2175 def FileSystem_AddHandler(*args
, **kwargs
):
2176 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2177 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
2179 def FileSystem_RemoveHandler(*args
, **kwargs
):
2180 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2181 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
2183 def FileSystem_CleanUpHandlers(*args
):
2184 """FileSystem_CleanUpHandlers()"""
2185 return _core_
.FileSystem_CleanUpHandlers(*args
)
2187 def FileSystem_FileNameToURL(*args
, **kwargs
):
2188 """FileSystem_FileNameToURL(String filename) -> String"""
2189 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
2191 def FileSystem_URLToFileName(*args
, **kwargs
):
2192 """FileSystem_URLToFileName(String url) -> String"""
2193 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
2195 class InternetFSHandler(CPPFileSystemHandler
):
2196 """Proxy of C++ InternetFSHandler class"""
2197 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2198 __repr__
= _swig_repr
2199 def __init__(self
, *args
, **kwargs
):
2200 """__init__(self) -> InternetFSHandler"""
2201 _core_
.InternetFSHandler_swiginit(self
,_core_
.new_InternetFSHandler(*args
, **kwargs
))
2202 def CanOpen(*args
, **kwargs
):
2203 """CanOpen(self, String location) -> bool"""
2204 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
2206 def OpenFile(*args
, **kwargs
):
2207 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2208 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
2210 _core_
.InternetFSHandler_swigregister(InternetFSHandler
)
2212 class ZipFSHandler(CPPFileSystemHandler
):
2213 """Proxy of C++ ZipFSHandler class"""
2214 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2215 __repr__
= _swig_repr
2216 def __init__(self
, *args
, **kwargs
):
2217 """__init__(self) -> ZipFSHandler"""
2218 _core_
.ZipFSHandler_swiginit(self
,_core_
.new_ZipFSHandler(*args
, **kwargs
))
2219 def CanOpen(*args
, **kwargs
):
2220 """CanOpen(self, String location) -> bool"""
2221 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
2223 def OpenFile(*args
, **kwargs
):
2224 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2225 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
2227 def FindFirst(*args
, **kwargs
):
2228 """FindFirst(self, String spec, int flags=0) -> String"""
2229 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
2231 def FindNext(*args
, **kwargs
):
2232 """FindNext(self) -> String"""
2233 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
2235 _core_
.ZipFSHandler_swigregister(ZipFSHandler
)
2238 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
2239 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2240 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
2242 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
2243 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2244 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
2246 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
2247 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2248 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
2249 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
2251 Add 'file' to the memory filesystem. The dataItem parameter can
2252 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2253 arbitrary data. If a bitmap or image is used then the imgType
2254 parameter should specify what kind of image file it should be
2255 written as, wx.BITMAP_TYPE_PNG, etc.
2257 if isinstance(dataItem
, wx
.Image
):
2258 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
2259 elif isinstance(dataItem
, wx
.Bitmap
):
2260 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
2261 elif type(dataItem
) == str:
2262 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
2264 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
2266 class MemoryFSHandler(CPPFileSystemHandler
):
2267 """Proxy of C++ MemoryFSHandler class"""
2268 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2269 __repr__
= _swig_repr
2270 def __init__(self
, *args
, **kwargs
):
2271 """__init__(self) -> MemoryFSHandler"""
2272 _core_
.MemoryFSHandler_swiginit(self
,_core_
.new_MemoryFSHandler(*args
, **kwargs
))
2273 def RemoveFile(*args
, **kwargs
):
2274 """RemoveFile(String filename)"""
2275 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2277 RemoveFile
= staticmethod(RemoveFile
)
2278 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
2279 def CanOpen(*args
, **kwargs
):
2280 """CanOpen(self, String location) -> bool"""
2281 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
2283 def OpenFile(*args
, **kwargs
):
2284 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2285 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
2287 def FindFirst(*args
, **kwargs
):
2288 """FindFirst(self, String spec, int flags=0) -> String"""
2289 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
2291 def FindNext(*args
, **kwargs
):
2292 """FindNext(self) -> String"""
2293 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
2295 _core_
.MemoryFSHandler_swigregister(MemoryFSHandler
)
2297 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
2298 """MemoryFSHandler_RemoveFile(String filename)"""
2299 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2301 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
2302 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
2303 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
2304 IMAGE_QUALITY_NORMAL
= _core_
.IMAGE_QUALITY_NORMAL
2305 IMAGE_QUALITY_HIGH
= _core_
.IMAGE_QUALITY_HIGH
2306 #---------------------------------------------------------------------------
2308 class ImageHandler(Object
):
2310 This is the base class for implementing image file loading/saving, and
2311 image creation from data. It is used within `wx.Image` and is not
2312 normally seen by the application.
2314 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2315 def __init__(self
): raise AttributeError, "No constructor defined"
2316 __repr__
= _swig_repr
2317 def GetName(*args
, **kwargs
):
2318 """GetName(self) -> String"""
2319 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
2321 def GetExtension(*args
, **kwargs
):
2322 """GetExtension(self) -> String"""
2323 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
2325 def GetType(*args
, **kwargs
):
2326 """GetType(self) -> long"""
2327 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2329 def GetMimeType(*args
, **kwargs
):
2330 """GetMimeType(self) -> String"""
2331 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2333 def CanRead(*args
, **kwargs
):
2334 """CanRead(self, String name) -> bool"""
2335 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2337 def CanReadStream(*args
, **kwargs
):
2338 """CanReadStream(self, InputStream stream) -> bool"""
2339 return _core_
.ImageHandler_CanReadStream(*args
, **kwargs
)
2341 def SetName(*args
, **kwargs
):
2342 """SetName(self, String name)"""
2343 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2345 def SetExtension(*args
, **kwargs
):
2346 """SetExtension(self, String extension)"""
2347 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2349 def SetType(*args
, **kwargs
):
2350 """SetType(self, long type)"""
2351 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2353 def SetMimeType(*args
, **kwargs
):
2354 """SetMimeType(self, String mimetype)"""
2355 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2357 Extension
= property(GetExtension
,SetExtension
,doc
="See `GetExtension` and `SetExtension`")
2358 MimeType
= property(GetMimeType
,SetMimeType
,doc
="See `GetMimeType` and `SetMimeType`")
2359 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
2360 Type
= property(GetType
,SetType
,doc
="See `GetType` and `SetType`")
2361 _core_
.ImageHandler_swigregister(ImageHandler
)
2363 class PyImageHandler(ImageHandler
):
2365 This is the base class for implementing image file loading/saving, and
2366 image creation from data, all written in Python. To create a custom
2367 image handler derive a new class from wx.PyImageHandler and provide
2368 the following methods::
2370 def DoCanRead(self, stream) --> bool
2371 '''Check if this handler can read the image on the stream'''
2373 def LoadFile(self, image, stream, verbose, index) --> bool
2374 '''Load image data from the stream and load it into image.'''
2376 def SaveFile(self, image, stream, verbose) --> bool
2377 '''Save the iamge data in image to the stream using
2378 this handler's image file format.'''
2380 def GetImageCount(self, stream) --> int
2381 '''If this image format can hold more than one image,
2382 how many does the image on the stream have?'''
2384 To activate your handler create an instance of it and pass it to
2385 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2386 `SetExtension` from your constructor.
2389 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2390 __repr__
= _swig_repr
2391 def __init__(self
, *args
, **kwargs
):
2393 __init__(self) -> PyImageHandler
2395 This is the base class for implementing image file loading/saving, and
2396 image creation from data, all written in Python. To create a custom
2397 image handler derive a new class from wx.PyImageHandler and provide
2398 the following methods::
2400 def DoCanRead(self, stream) --> bool
2401 '''Check if this handler can read the image on the stream'''
2403 def LoadFile(self, image, stream, verbose, index) --> bool
2404 '''Load image data from the stream and load it into image.'''
2406 def SaveFile(self, image, stream, verbose) --> bool
2407 '''Save the iamge data in image to the stream using
2408 this handler's image file format.'''
2410 def GetImageCount(self, stream) --> int
2411 '''If this image format can hold more than one image,
2412 how many does the image on the stream have?'''
2414 To activate your handler create an instance of it and pass it to
2415 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2416 `SetExtension` from your constructor.
2419 _core_
.PyImageHandler_swiginit(self
,_core_
.new_PyImageHandler(*args
, **kwargs
))
2422 def _SetSelf(*args
, **kwargs
):
2423 """_SetSelf(self, PyObject self)"""
2424 return _core_
.PyImageHandler__SetSelf(*args
, **kwargs
)
2426 _core_
.PyImageHandler_swigregister(PyImageHandler
)
2428 class ImageHistogram(object):
2429 """Proxy of C++ ImageHistogram class"""
2430 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2431 __repr__
= _swig_repr
2432 def __init__(self
, *args
, **kwargs
):
2433 """__init__(self) -> ImageHistogram"""
2434 _core_
.ImageHistogram_swiginit(self
,_core_
.new_ImageHistogram(*args
, **kwargs
))
2435 def MakeKey(*args
, **kwargs
):
2437 MakeKey(byte r, byte g, byte b) -> unsigned long
2439 Get the key in the histogram for the given RGB values
2441 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2443 MakeKey
= staticmethod(MakeKey
)
2444 def FindFirstUnusedColour(*args
, **kwargs
):
2446 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2448 Find first colour that is not used in the image and has higher RGB
2449 values than startR, startG, startB. Returns a tuple consisting of a
2450 success flag and rgb values.
2452 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2454 def GetCount(*args
, **kwargs
):
2456 GetCount(self, unsigned long key) -> unsigned long
2458 Returns the pixel count for the given key. Use `MakeKey` to create a
2459 key value from a RGB tripple.
2461 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2463 def GetCountRGB(*args
, **kwargs
):
2465 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2467 Returns the pixel count for the given RGB values.
2469 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2471 def GetCountColour(*args
, **kwargs
):
2473 GetCountColour(self, Colour colour) -> unsigned long
2475 Returns the pixel count for the given `wx.Colour` value.
2477 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2479 _core_
.ImageHistogram_swigregister(ImageHistogram
)
2481 def ImageHistogram_MakeKey(*args
, **kwargs
):
2483 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2485 Get the key in the histogram for the given RGB values
2487 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2489 class Image_RGBValue(object):
2491 An object that contains values for red, green and blue which represent
2492 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2493 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2496 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2497 __repr__
= _swig_repr
2498 def __init__(self
, *args
, **kwargs
):
2500 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2504 _core_
.Image_RGBValue_swiginit(self
,_core_
.new_Image_RGBValue(*args
, **kwargs
))
2505 red
= property(_core_
.Image_RGBValue_red_get
, _core_
.Image_RGBValue_red_set
)
2506 green
= property(_core_
.Image_RGBValue_green_get
, _core_
.Image_RGBValue_green_set
)
2507 blue
= property(_core_
.Image_RGBValue_blue_get
, _core_
.Image_RGBValue_blue_set
)
2508 _core_
.Image_RGBValue_swigregister(Image_RGBValue
)
2510 class Image_HSVValue(object):
2512 An object that contains values for hue, saturation and value which
2513 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2514 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2517 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2518 __repr__
= _swig_repr
2519 def __init__(self
, *args
, **kwargs
):
2521 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2525 _core_
.Image_HSVValue_swiginit(self
,_core_
.new_Image_HSVValue(*args
, **kwargs
))
2526 hue
= property(_core_
.Image_HSVValue_hue_get
, _core_
.Image_HSVValue_hue_set
)
2527 saturation
= property(_core_
.Image_HSVValue_saturation_get
, _core_
.Image_HSVValue_saturation_set
)
2528 value
= property(_core_
.Image_HSVValue_value_get
, _core_
.Image_HSVValue_value_set
)
2529 _core_
.Image_HSVValue_swigregister(Image_HSVValue
)
2531 class Image(Object
):
2533 A platform-independent image class. An image can be created from
2534 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2535 variety of formats. Functions are available to set and get image
2536 bits, so it can be used for basic image manipulation.
2538 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2539 platform-specific `wx.Bitmap` object must be created from it using the
2540 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2541 device context, using `wx.DC.DrawBitmap`.
2543 One colour value of the image may be used as a mask colour which will
2544 lead to the automatic creation of a `wx.Mask` object associated to the
2547 wx.Image supports alpha channel data, that is in addition to a byte
2548 for the red, green and blue colour components for each pixel it also
2549 stores a byte representing the pixel opacity. An alpha value of 0
2550 corresponds to a transparent pixel (null opacity) while a value of 255
2551 means that the pixel is 100% opaque.
2553 Unlike RGB data, not all images have an alpha channel and before using
2554 `GetAlpha` you should check if this image contains an alpha channel
2555 with `HasAlpha`. Note that currently only images loaded from PNG files
2556 with transparency information will have an alpha channel.
2558 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2559 __repr__
= _swig_repr
2560 def __init__(self
, *args
, **kwargs
):
2562 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2564 Loads an image from a file.
2566 _core_
.Image_swiginit(self
,_core_
.new_Image(*args
, **kwargs
))
2567 __swig_destroy__
= _core_
.delete_Image
2568 __del__
= lambda self
: None;
2569 def Create(*args
, **kwargs
):
2571 Create(self, int width, int height, bool clear=True)
2573 Creates a fresh image. If clear is ``True``, the new image will be
2574 initialized to black. Otherwise, the image data will be uninitialized.
2576 return _core_
.Image_Create(*args
, **kwargs
)
2578 def Destroy(*args
, **kwargs
):
2582 Destroys the image data.
2584 args
[0].this
.own(False)
2585 return _core_
.Image_Destroy(*args
, **kwargs
)
2587 def Scale(*args
, **kwargs
):
2589 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2591 Returns a scaled version of the image. This is also useful for scaling
2592 bitmaps in general as the only other way to scale bitmaps is to blit a
2593 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2594 specifies what method to use for resampling the image. It can be
2595 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2596 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2597 bicubic and box averaging resampling methods for upsampling and
2598 downsampling respectively.
2600 return _core_
.Image_Scale(*args
, **kwargs
)
2602 def ResampleBox(*args
, **kwargs
):
2603 """ResampleBox(self, int width, int height) -> Image"""
2604 return _core_
.Image_ResampleBox(*args
, **kwargs
)
2606 def ResampleBicubic(*args
, **kwargs
):
2607 """ResampleBicubic(self, int width, int height) -> Image"""
2608 return _core_
.Image_ResampleBicubic(*args
, **kwargs
)
2610 def Blur(*args
, **kwargs
):
2612 Blur(self, int radius) -> Image
2614 Blurs the image in both horizontal and vertical directions by the
2615 specified pixel ``radius``. This should not be used when using a
2616 single mask colour for transparency.
2618 return _core_
.Image_Blur(*args
, **kwargs
)
2620 def BlurHorizontal(*args
, **kwargs
):
2622 BlurHorizontal(self, int radius) -> Image
2624 Blurs the image in the horizontal direction only. This should not be
2625 used when using a single mask colour for transparency.
2628 return _core_
.Image_BlurHorizontal(*args
, **kwargs
)
2630 def BlurVertical(*args
, **kwargs
):
2632 BlurVertical(self, int radius) -> Image
2634 Blurs the image in the vertical direction only. This should not be
2635 used when using a single mask colour for transparency.
2637 return _core_
.Image_BlurVertical(*args
, **kwargs
)
2639 def ShrinkBy(*args
, **kwargs
):
2641 ShrinkBy(self, int xFactor, int yFactor) -> Image
2643 Return a version of the image scaled smaller by the given factors.
2645 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2647 def Rescale(*args
, **kwargs
):
2649 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2651 Changes the size of the image in-place by scaling it: after a call to
2652 this function, the image will have the given width and height.
2654 Returns the (modified) image itself.
2656 return _core_
.Image_Rescale(*args
, **kwargs
)
2658 def Resize(*args
, **kwargs
):
2660 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2662 Changes the size of the image in-place without scaling it, by adding
2663 either a border with the given colour or cropping as necessary. The
2664 image is pasted into a new image with the given size and background
2665 colour at the position pos relative to the upper left of the new
2666 image. If red = green = blue = -1 then use either the current mask
2667 colour if set or find, use, and set a suitable mask colour for any
2668 newly exposed areas.
2670 Returns the (modified) image itself.
2672 return _core_
.Image_Resize(*args
, **kwargs
)
2674 def SetRGB(*args
, **kwargs
):
2676 SetRGB(self, int x, int y, byte r, byte g, byte b)
2678 Sets the pixel at the given coordinate. This routine performs
2679 bounds-checks for the coordinate so it can be considered a safe way to
2680 manipulate the data, but in some cases this might be too slow so that
2681 the data will have to be set directly. In that case you will have to
2682 get access to the image data using the `GetData` method.
2684 return _core_
.Image_SetRGB(*args
, **kwargs
)
2686 def SetRGBRect(*args
, **kwargs
):
2688 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2690 Sets the colour of the pixels within the given rectangle. This routine
2691 performs bounds-checks for the rectangle so it can be considered a
2692 safe way to manipulate the data.
2694 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2696 def GetRed(*args
, **kwargs
):
2698 GetRed(self, int x, int y) -> byte
2700 Returns the red intensity at the given coordinate.
2702 return _core_
.Image_GetRed(*args
, **kwargs
)
2704 def GetGreen(*args
, **kwargs
):
2706 GetGreen(self, int x, int y) -> byte
2708 Returns the green intensity at the given coordinate.
2710 return _core_
.Image_GetGreen(*args
, **kwargs
)
2712 def GetBlue(*args
, **kwargs
):
2714 GetBlue(self, int x, int y) -> byte
2716 Returns the blue intensity at the given coordinate.
2718 return _core_
.Image_GetBlue(*args
, **kwargs
)
2720 def SetAlpha(*args
, **kwargs
):
2722 SetAlpha(self, int x, int y, byte alpha)
2724 Sets the alpha value for the given pixel. This function should only be
2725 called if the image has alpha channel data, use `HasAlpha` to check
2728 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2730 def GetAlpha(*args
, **kwargs
):
2732 GetAlpha(self, int x, int y) -> byte
2734 Returns the alpha value for the given pixel. This function may only be
2735 called for the images with alpha channel, use `HasAlpha` to check for
2738 The returned value is the *opacity* of the image, i.e. the value of 0
2739 corresponds to the fully transparent pixels while the value of 255 to
2740 the fully opaque pixels.
2742 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2744 def HasAlpha(*args
, **kwargs
):
2746 HasAlpha(self) -> bool
2748 Returns true if this image has alpha channel, false otherwise.
2750 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2752 def InitAlpha(*args
, **kwargs
):
2756 Initializes the image alpha channel data. It is an error to call it if
2757 the image already has alpha data. If it doesn't, alpha data will be by
2758 default initialized to all pixels being fully opaque. But if the image
2759 has a a mask colour, all mask pixels will be completely transparent.
2761 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2763 def IsTransparent(*args
, **kwargs
):
2765 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2767 Returns ``True`` if this pixel is masked or has an alpha value less
2768 than the spcified threshold.
2770 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2772 def FindFirstUnusedColour(*args
, **kwargs
):
2774 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2776 Find first colour that is not used in the image and has higher RGB
2777 values than startR, startG, startB. Returns a tuple consisting of a
2778 success flag and rgb values.
2780 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2782 def ConvertAlphaToMask(*args
, **kwargs
):
2784 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2786 If the image has alpha channel, this method converts it to mask. All
2787 pixels with alpha value less than ``threshold`` are replaced with the
2788 mask colour and the alpha channel is removed. The mask colour is
2789 chosen automatically using `FindFirstUnusedColour`.
2791 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2794 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2796 def ConvertColourToAlpha(*args
, **kwargs
):
2798 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2800 This method converts an image where the original alpha information is
2801 only available as a shades of a colour (actually shades of grey)
2802 typically when you draw anti-aliased text into a bitmap. The DC
2803 drawing routines draw grey values on the black background although
2804 they actually mean to draw white with differnt alpha values. This
2805 method reverses it, assuming a black (!) background and white text.
2806 The method will then fill up the whole image with the colour given.
2808 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2810 def SetMaskFromImage(*args
, **kwargs
):
2812 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2814 Sets the image's mask so that the pixels that have RGB value of
2815 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2816 by first finding an unused colour in the image, setting this colour as
2817 the mask colour and then using this colour to draw all pixels in the
2818 image who corresponding pixel in mask has given RGB value.
2820 Returns ``False`` if ``mask`` does not have same dimensions as the
2821 image or if there is no unused colour left. Returns ``True`` if the
2822 mask was successfully applied.
2824 Note that this method involves computing the histogram, which is
2825 computationally intensive operation.
2827 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2829 def CanRead(*args
, **kwargs
):
2831 CanRead(String filename) -> bool
2833 Returns True if the image handlers can read this file.
2835 return _core_
.Image_CanRead(*args
, **kwargs
)
2837 CanRead
= staticmethod(CanRead
)
2838 def GetImageCount(*args
, **kwargs
):
2840 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2842 If the image file contains more than one image and the image handler
2843 is capable of retrieving these individually, this function will return
2844 the number of available images.
2846 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2848 GetImageCount
= staticmethod(GetImageCount
)
2849 def LoadFile(*args
, **kwargs
):
2851 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2853 Loads an image from a file. If no handler type is provided, the
2854 library will try to autodetect the format.
2856 return _core_
.Image_LoadFile(*args
, **kwargs
)
2858 def LoadMimeFile(*args
, **kwargs
):
2860 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2862 Loads an image from a file, specifying the image type with a MIME type
2865 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2867 def SaveFile(*args
, **kwargs
):
2869 SaveFile(self, String name, int type) -> bool
2871 Saves an image in the named file.
2873 return _core_
.Image_SaveFile(*args
, **kwargs
)
2875 def SaveMimeFile(*args
, **kwargs
):
2877 SaveMimeFile(self, String name, String mimetype) -> bool
2879 Saves an image in the named file.
2881 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2883 def CanReadStream(*args
, **kwargs
):
2885 CanReadStream(InputStream stream) -> bool
2887 Returns True if the image handlers can read an image file from the
2888 data currently on the input stream, or a readable Python file-like
2891 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2893 CanReadStream
= staticmethod(CanReadStream
)
2894 def LoadStream(*args
, **kwargs
):
2896 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2898 Loads an image from an input stream or a readable Python file-like
2899 object. If no handler type is provided, the library will try to
2900 autodetect the format.
2902 return _core_
.Image_LoadStream(*args
, **kwargs
)
2904 def LoadMimeStream(*args
, **kwargs
):
2906 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2908 Loads an image from an input stream or a readable Python file-like
2909 object, using a MIME type string to specify the image file format.
2911 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2913 def IsOk(*args
, **kwargs
):
2917 Returns true if image data is present.
2919 return _core_
.Image_IsOk(*args
, **kwargs
)
2922 def GetWidth(*args
, **kwargs
):
2924 GetWidth(self) -> int
2926 Gets the width of the image in pixels.
2928 return _core_
.Image_GetWidth(*args
, **kwargs
)
2930 def GetHeight(*args
, **kwargs
):
2932 GetHeight(self) -> int
2934 Gets the height of the image in pixels.
2936 return _core_
.Image_GetHeight(*args
, **kwargs
)
2938 def GetSize(*args
, **kwargs
):
2940 GetSize(self) -> Size
2942 Returns the size of the image in pixels.
2944 return _core_
.Image_GetSize(*args
, **kwargs
)
2946 def GetSubImage(*args
, **kwargs
):
2948 GetSubImage(self, Rect rect) -> Image
2950 Returns a sub image of the current one as long as the rect belongs
2951 entirely to the image.
2953 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2955 def Size(*args
, **kwargs
):
2957 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2959 Returns a resized version of this image without scaling it by adding
2960 either a border with the given colour or cropping as necessary. The
2961 image is pasted into a new image with the given size and background
2962 colour at the position ``pos`` relative to the upper left of the new
2963 image. If red = green = blue = -1 then use either the current mask
2964 colour if set or find, use, and set a suitable mask colour for any
2965 newly exposed areas.
2967 return _core_
.Image_Size(*args
, **kwargs
)
2969 def Copy(*args
, **kwargs
):
2973 Returns an identical copy of the image.
2975 return _core_
.Image_Copy(*args
, **kwargs
)
2977 def Paste(*args
, **kwargs
):
2979 Paste(self, Image image, int x, int y)
2981 Pastes ``image`` into this instance and takes care of the mask colour
2982 and any out of bounds problems.
2984 return _core_
.Image_Paste(*args
, **kwargs
)
2986 def GetData(*args
, **kwargs
):
2988 GetData(self) -> PyObject
2990 Returns a string containing a copy of the RGB bytes of the image.
2992 return _core_
.Image_GetData(*args
, **kwargs
)
2994 def SetData(*args
, **kwargs
):
2996 SetData(self, buffer data)
2998 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2999 either a string or a buffer object holding the data and the length of
3000 the data must be width*height*3.
3002 return _core_
.Image_SetData(*args
, **kwargs
)
3004 def GetDataBuffer(*args
, **kwargs
):
3006 GetDataBuffer(self) -> PyObject
3008 Returns a writable Python buffer object that is pointing at the RGB
3009 image data buffer inside the wx.Image. You need to ensure that you do
3010 not use this buffer object after the image has been destroyed.
3012 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
3014 def SetDataBuffer(*args
, **kwargs
):
3016 SetDataBuffer(self, buffer data)
3018 Sets the internal image data pointer to point at a Python buffer
3019 object. This can save making an extra copy of the data but you must
3020 ensure that the buffer object lives longer than the wx.Image does.
3022 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
3024 def GetAlphaData(*args
, **kwargs
):
3026 GetAlphaData(self) -> PyObject
3028 Returns a string containing a copy of the alpha bytes of the image.
3030 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
3032 def SetAlphaData(*args
, **kwargs
):
3034 SetAlphaData(self, buffer alpha)
3036 Resets the Image's alpha data from a buffer of bytes. Accepts either
3037 a string or a buffer object holding the data and the length of the
3038 data must be width*height.
3040 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
3042 def GetAlphaBuffer(*args
, **kwargs
):
3044 GetAlphaBuffer(self) -> PyObject
3046 Returns a writable Python buffer object that is pointing at the Alpha
3047 data buffer inside the wx.Image. You need to ensure that you do not
3048 use this buffer object after the image has been destroyed.
3050 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
3052 def SetAlphaBuffer(*args
, **kwargs
):
3054 SetAlphaBuffer(self, buffer alpha)
3056 Sets the internal image alpha pointer to point at a Python buffer
3057 object. This can save making an extra copy of the data but you must
3058 ensure that the buffer object lives as long as the wx.Image does.
3060 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
3062 def SetMaskColour(*args
, **kwargs
):
3064 SetMaskColour(self, byte r, byte g, byte b)
3066 Sets the mask colour for this image (and tells the image to use the
3069 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
3071 def GetOrFindMaskColour(*args
, **kwargs
):
3073 GetOrFindMaskColour() -> (r,g,b)
3075 Get the current mask colour or find a suitable colour.
3077 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
3079 def GetMaskRed(*args
, **kwargs
):
3081 GetMaskRed(self) -> byte
3083 Gets the red component of the mask colour.
3085 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
3087 def GetMaskGreen(*args
, **kwargs
):
3089 GetMaskGreen(self) -> byte
3091 Gets the green component of the mask colour.
3093 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
3095 def GetMaskBlue(*args
, **kwargs
):
3097 GetMaskBlue(self) -> byte
3099 Gets the blue component of the mask colour.
3101 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
3103 def SetMask(*args
, **kwargs
):
3105 SetMask(self, bool mask=True)
3107 Specifies whether there is a mask or not. The area of the mask is
3108 determined by the current mask colour.
3110 return _core_
.Image_SetMask(*args
, **kwargs
)
3112 def HasMask(*args
, **kwargs
):
3114 HasMask(self) -> bool
3116 Returns ``True`` if there is a mask active, ``False`` otherwise.
3118 return _core_
.Image_HasMask(*args
, **kwargs
)
3120 def Rotate(*args
, **kwargs
):
3122 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
3123 Point offset_after_rotation=None) -> Image
3125 Rotates the image about the given point, by ``angle`` radians. Passing
3126 ``True`` to ``interpolating`` results in better image quality, but is
3127 slower. If the image has a mask, then the mask colour is used for the
3128 uncovered pixels in the rotated image background. Otherwise, black
3129 will be used as the fill colour.
3131 Returns the rotated image, leaving this image intact.
3133 return _core_
.Image_Rotate(*args
, **kwargs
)
3135 def Rotate90(*args
, **kwargs
):
3137 Rotate90(self, bool clockwise=True) -> Image
3139 Returns a copy of the image rotated 90 degrees in the direction
3140 indicated by ``clockwise``.
3142 return _core_
.Image_Rotate90(*args
, **kwargs
)
3144 def Mirror(*args
, **kwargs
):
3146 Mirror(self, bool horizontally=True) -> Image
3148 Returns a mirrored copy of the image. The parameter ``horizontally``
3149 indicates the orientation.
3151 return _core_
.Image_Mirror(*args
, **kwargs
)
3153 def Replace(*args
, **kwargs
):
3155 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3157 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3160 return _core_
.Image_Replace(*args
, **kwargs
)
3162 def ConvertToGreyscale(*args
, **kwargs
):
3164 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3166 Convert to greyscale image. Uses the luminance component (Y) of the
3167 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3168 defaults to ITU-T BT.601
3170 return _core_
.Image_ConvertToGreyscale(*args
, **kwargs
)
3172 def ConvertToMono(*args
, **kwargs
):
3174 ConvertToMono(self, byte r, byte g, byte b) -> Image
3176 Returns monochromatic version of the image. The returned image has
3177 white colour where the original has ``(r,g,b)`` colour and black
3178 colour everywhere else.
3180 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
3182 def SetOption(*args
, **kwargs
):
3184 SetOption(self, String name, String value)
3186 Sets an image handler defined option. For example, when saving as a
3187 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3188 number between 0 and 100 (0 is terrible, 100 is very good).
3190 return _core_
.Image_SetOption(*args
, **kwargs
)
3192 def SetOptionInt(*args
, **kwargs
):
3194 SetOptionInt(self, String name, int value)
3196 Sets an image option as an integer.
3198 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
3200 def GetOption(*args
, **kwargs
):
3202 GetOption(self, String name) -> String
3204 Gets the value of an image handler option.
3206 return _core_
.Image_GetOption(*args
, **kwargs
)
3208 def GetOptionInt(*args
, **kwargs
):
3210 GetOptionInt(self, String name) -> int
3212 Gets the value of an image handler option as an integer. If the given
3213 option is not present, the function returns 0.
3215 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
3217 def HasOption(*args
, **kwargs
):
3219 HasOption(self, String name) -> bool
3221 Returns true if the given option is present.
3223 return _core_
.Image_HasOption(*args
, **kwargs
)
3225 def CountColours(*args
, **kwargs
):
3226 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
3227 return _core_
.Image_CountColours(*args
, **kwargs
)
3229 def ComputeHistogram(*args
, **kwargs
):
3230 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3231 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
3233 def AddHandler(*args
, **kwargs
):
3234 """AddHandler(ImageHandler handler)"""
3235 return _core_
.Image_AddHandler(*args
, **kwargs
)
3237 AddHandler
= staticmethod(AddHandler
)
3238 def InsertHandler(*args
, **kwargs
):
3239 """InsertHandler(ImageHandler handler)"""
3240 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3242 InsertHandler
= staticmethod(InsertHandler
)
3243 def RemoveHandler(*args
, **kwargs
):
3244 """RemoveHandler(String name) -> bool"""
3245 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3247 RemoveHandler
= staticmethod(RemoveHandler
)
3248 def GetHandlers(*args
, **kwargs
):
3249 """GetHandlers() -> PyObject"""
3250 return _core_
.Image_GetHandlers(*args
, **kwargs
)
3252 GetHandlers
= staticmethod(GetHandlers
)
3253 def GetImageExtWildcard(*args
, **kwargs
):
3255 GetImageExtWildcard() -> String
3257 Iterates all registered wxImageHandler objects, and returns a string
3258 containing file extension masks suitable for passing to file open/save
3261 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
3263 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
3264 def ConvertToBitmap(*args
, **kwargs
):
3265 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3266 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
3268 def ConvertToMonoBitmap(*args
, **kwargs
):
3269 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
3270 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
3272 def RotateHue(*args
, **kwargs
):
3274 RotateHue(self, double angle)
3276 Rotates the hue of each pixel of the image. Hue is a double in the
3277 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3279 return _core_
.Image_RotateHue(*args
, **kwargs
)
3281 def RGBtoHSV(*args
, **kwargs
):
3283 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3285 Converts a color in RGB color space to HSV color space.
3287 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3289 RGBtoHSV
= staticmethod(RGBtoHSV
)
3290 def HSVtoRGB(*args
, **kwargs
):
3292 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3294 Converts a color in HSV color space to RGB color space.
3296 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3298 HSVtoRGB
= staticmethod(HSVtoRGB
)
3299 def __nonzero__(self
): return self
.IsOk()
3300 AlphaBuffer
= property(GetAlphaBuffer
,SetAlphaBuffer
,doc
="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3301 AlphaData
= property(GetAlphaData
,SetAlphaData
,doc
="See `GetAlphaData` and `SetAlphaData`")
3302 Data
= property(GetData
,SetData
,doc
="See `GetData` and `SetData`")
3303 DataBuffer
= property(GetDataBuffer
,SetDataBuffer
,doc
="See `GetDataBuffer` and `SetDataBuffer`")
3304 Height
= property(GetHeight
,doc
="See `GetHeight`")
3305 MaskBlue
= property(GetMaskBlue
,doc
="See `GetMaskBlue`")
3306 MaskGreen
= property(GetMaskGreen
,doc
="See `GetMaskGreen`")
3307 MaskRed
= property(GetMaskRed
,doc
="See `GetMaskRed`")
3308 Width
= property(GetWidth
,doc
="See `GetWidth`")
3309 _core_
.Image_swigregister(Image
)
3311 def ImageFromMime(*args
, **kwargs
):
3313 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3315 Loads an image from a file, using a MIME type string (such as
3316 'image/jpeg') to specify image type.
3318 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
3321 def ImageFromStream(*args
, **kwargs
):
3323 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3325 Loads an image from an input stream, or any readable Python file-like
3328 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
3331 def ImageFromStreamMime(*args
, **kwargs
):
3333 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3335 Loads an image from an input stream, or any readable Python file-like
3336 object, specifying the image format with a MIME type string.
3338 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
3341 def EmptyImage(*args
, **kwargs
):
3343 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3345 Construct an empty image of a given size, optionally setting all
3348 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
3351 def ImageFromBitmap(*args
, **kwargs
):
3353 ImageFromBitmap(Bitmap bitmap) -> Image
3355 Construct an Image from a `wx.Bitmap`.
3357 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
3360 def ImageFromData(*args
, **kwargs
):
3362 ImageFromData(int width, int height, buffer data) -> Image
3364 Construct an Image from a buffer of RGB bytes. Accepts either a
3365 string or a buffer object holding the data and the length of the data
3366 must be width*height*3.
3368 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
3371 def ImageFromDataWithAlpha(*args
, **kwargs
):
3373 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3375 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3376 Accepts either a string or a buffer object holding the data and the
3377 length of the data must be width*height*3 bytes, and the length of the
3378 alpha data must be width*height bytes.
3380 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
3383 def Image_CanRead(*args
, **kwargs
):
3385 Image_CanRead(String filename) -> bool
3387 Returns True if the image handlers can read this file.
3389 return _core_
.Image_CanRead(*args
, **kwargs
)
3391 def Image_GetImageCount(*args
, **kwargs
):
3393 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3395 If the image file contains more than one image and the image handler
3396 is capable of retrieving these individually, this function will return
3397 the number of available images.
3399 return _core_
.Image_GetImageCount(*args
, **kwargs
)
3401 def Image_CanReadStream(*args
, **kwargs
):
3403 Image_CanReadStream(InputStream stream) -> bool
3405 Returns True if the image handlers can read an image file from the
3406 data currently on the input stream, or a readable Python file-like
3409 return _core_
.Image_CanReadStream(*args
, **kwargs
)
3411 def Image_AddHandler(*args
, **kwargs
):
3412 """Image_AddHandler(ImageHandler handler)"""
3413 return _core_
.Image_AddHandler(*args
, **kwargs
)
3415 def Image_InsertHandler(*args
, **kwargs
):
3416 """Image_InsertHandler(ImageHandler handler)"""
3417 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3419 def Image_RemoveHandler(*args
, **kwargs
):
3420 """Image_RemoveHandler(String name) -> bool"""
3421 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3423 def Image_GetHandlers(*args
):
3424 """Image_GetHandlers() -> PyObject"""
3425 return _core_
.Image_GetHandlers(*args
)
3427 def Image_GetImageExtWildcard(*args
):
3429 Image_GetImageExtWildcard() -> String
3431 Iterates all registered wxImageHandler objects, and returns a string
3432 containing file extension masks suitable for passing to file open/save
3435 return _core_
.Image_GetImageExtWildcard(*args
)
3437 def Image_RGBtoHSV(*args
, **kwargs
):
3439 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3441 Converts a color in RGB color space to HSV color space.
3443 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3445 def Image_HSVtoRGB(*args
, **kwargs
):
3447 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3449 Converts a color in HSV color space to RGB color space.
3451 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3454 def _ImageFromBuffer(*args
, **kwargs
):
3455 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3456 return _core_
._ImageFromBuffer
(*args
, **kwargs
)
3457 def ImageFromBuffer(width
, height
, dataBuffer
, alphaBuffer
=None):
3459 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3460 parameter must be a Python object that implements the buffer interface,
3461 such as a string, array, etc. The dataBuffer object is expected to
3462 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3463 object can optionally be supplied for the image's alpha channel data, and
3464 it is expected to be width*height bytes long.
3466 The wx.Image will be created with its data and alpha pointers initialized
3467 to the memory address pointed to by the buffer objects, thus saving the
3468 time needed to copy the image data from the buffer object to the wx.Image.
3469 While this has advantages, it also has the shoot-yourself-in-the-foot
3470 risks associated with sharing a C pointer between two objects.
3472 To help alleviate the risk a reference to the data and alpha buffer
3473 objects are kept with the wx.Image, so that they won't get deleted until
3474 after the wx.Image is deleted. However please be aware that it is not
3475 guaranteed that an object won't move its memory buffer to a new location
3476 when it needs to resize its contents. If that happens then the wx.Image
3477 will end up referring to an invalid memory location and could cause the
3478 application to crash. Therefore care should be taken to not manipulate
3479 the objects used for the data and alpha buffers in a way that would cause
3480 them to change size.
3482 image
= _core_
._ImageFromBuffer
(width
, height
, dataBuffer
, alphaBuffer
)
3483 image
._buffer
= dataBuffer
3484 image
._alpha
= alphaBuffer
3487 def InitAllImageHandlers():
3489 The former functionality of InitAllImageHanders is now done internal to
3490 the _core_ extension module and so this function has become a simple NOP.
3494 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3495 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3496 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3497 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3498 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3499 BMP_24BPP
= _core_
.BMP_24BPP
3500 BMP_8BPP
= _core_
.BMP_8BPP
3501 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3502 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3503 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3504 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3505 BMP_4BPP
= _core_
.BMP_4BPP
3506 BMP_1BPP
= _core_
.BMP_1BPP
3507 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3508 class BMPHandler(ImageHandler
):
3509 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3510 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3511 __repr__
= _swig_repr
3512 def __init__(self
, *args
, **kwargs
):
3514 __init__(self) -> BMPHandler
3516 A `wx.ImageHandler` for \*.bmp bitmap files.
3518 _core_
.BMPHandler_swiginit(self
,_core_
.new_BMPHandler(*args
, **kwargs
))
3519 _core_
.BMPHandler_swigregister(BMPHandler
)
3520 NullImage
= cvar
.NullImage
3521 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3522 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3523 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3524 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3525 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3526 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3527 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3528 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3529 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3530 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3531 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3532 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3533 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3534 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3535 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3537 class ICOHandler(BMPHandler
):
3538 """A `wx.ImageHandler` for \*.ico icon files."""
3539 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3540 __repr__
= _swig_repr
3541 def __init__(self
, *args
, **kwargs
):
3543 __init__(self) -> ICOHandler
3545 A `wx.ImageHandler` for \*.ico icon files.
3547 _core_
.ICOHandler_swiginit(self
,_core_
.new_ICOHandler(*args
, **kwargs
))
3548 _core_
.ICOHandler_swigregister(ICOHandler
)
3550 class CURHandler(ICOHandler
):
3551 """A `wx.ImageHandler` for \*.cur cursor files."""
3552 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3553 __repr__
= _swig_repr
3554 def __init__(self
, *args
, **kwargs
):
3556 __init__(self) -> CURHandler
3558 A `wx.ImageHandler` for \*.cur cursor files.
3560 _core_
.CURHandler_swiginit(self
,_core_
.new_CURHandler(*args
, **kwargs
))
3561 _core_
.CURHandler_swigregister(CURHandler
)
3563 class ANIHandler(CURHandler
):
3564 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3565 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3566 __repr__
= _swig_repr
3567 def __init__(self
, *args
, **kwargs
):
3569 __init__(self) -> ANIHandler
3571 A `wx.ImageHandler` for \*.ani animated cursor files.
3573 _core_
.ANIHandler_swiginit(self
,_core_
.new_ANIHandler(*args
, **kwargs
))
3574 _core_
.ANIHandler_swigregister(ANIHandler
)
3576 class PNGHandler(ImageHandler
):
3577 """A `wx.ImageHandler` for PNG image files."""
3578 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3579 __repr__
= _swig_repr
3580 def __init__(self
, *args
, **kwargs
):
3582 __init__(self) -> PNGHandler
3584 A `wx.ImageHandler` for PNG image files.
3586 _core_
.PNGHandler_swiginit(self
,_core_
.new_PNGHandler(*args
, **kwargs
))
3587 _core_
.PNGHandler_swigregister(PNGHandler
)
3589 class GIFHandler(ImageHandler
):
3590 """A `wx.ImageHandler` for GIF image files."""
3591 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3592 __repr__
= _swig_repr
3593 def __init__(self
, *args
, **kwargs
):
3595 __init__(self) -> GIFHandler
3597 A `wx.ImageHandler` for GIF image files.
3599 _core_
.GIFHandler_swiginit(self
,_core_
.new_GIFHandler(*args
, **kwargs
))
3600 _core_
.GIFHandler_swigregister(GIFHandler
)
3602 class PCXHandler(ImageHandler
):
3603 """A `wx.ImageHandler` for PCX imager files."""
3604 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3605 __repr__
= _swig_repr
3606 def __init__(self
, *args
, **kwargs
):
3608 __init__(self) -> PCXHandler
3610 A `wx.ImageHandler` for PCX imager files.
3612 _core_
.PCXHandler_swiginit(self
,_core_
.new_PCXHandler(*args
, **kwargs
))
3613 _core_
.PCXHandler_swigregister(PCXHandler
)
3615 class JPEGHandler(ImageHandler
):
3616 """A `wx.ImageHandler` for JPEG/JPG image files."""
3617 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3618 __repr__
= _swig_repr
3619 def __init__(self
, *args
, **kwargs
):
3621 __init__(self) -> JPEGHandler
3623 A `wx.ImageHandler` for JPEG/JPG image files.
3625 _core_
.JPEGHandler_swiginit(self
,_core_
.new_JPEGHandler(*args
, **kwargs
))
3626 _core_
.JPEGHandler_swigregister(JPEGHandler
)
3628 class PNMHandler(ImageHandler
):
3629 """A `wx.ImageHandler` for PNM image files."""
3630 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3631 __repr__
= _swig_repr
3632 def __init__(self
, *args
, **kwargs
):
3634 __init__(self) -> PNMHandler
3636 A `wx.ImageHandler` for PNM image files.
3638 _core_
.PNMHandler_swiginit(self
,_core_
.new_PNMHandler(*args
, **kwargs
))
3639 _core_
.PNMHandler_swigregister(PNMHandler
)
3641 class XPMHandler(ImageHandler
):
3642 """A `wx.ImageHandler` for XPM image."""
3643 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3644 __repr__
= _swig_repr
3645 def __init__(self
, *args
, **kwargs
):
3647 __init__(self) -> XPMHandler
3649 A `wx.ImageHandler` for XPM image.
3651 _core_
.XPMHandler_swiginit(self
,_core_
.new_XPMHandler(*args
, **kwargs
))
3652 _core_
.XPMHandler_swigregister(XPMHandler
)
3654 class TIFFHandler(ImageHandler
):
3655 """A `wx.ImageHandler` for TIFF image files."""
3656 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3657 __repr__
= _swig_repr
3658 def __init__(self
, *args
, **kwargs
):
3660 __init__(self) -> TIFFHandler
3662 A `wx.ImageHandler` for TIFF image files.
3664 _core_
.TIFFHandler_swiginit(self
,_core_
.new_TIFFHandler(*args
, **kwargs
))
3665 _core_
.TIFFHandler_swigregister(TIFFHandler
)
3667 class TGAHandler(ImageHandler
):
3668 """A `wx.ImageHandler` for TGA image files."""
3669 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3670 __repr__
= _swig_repr
3671 def __init__(self
, *args
, **kwargs
):
3673 __init__(self) -> TGAHandler
3675 A `wx.ImageHandler` for TGA image files.
3677 _core_
.TGAHandler_swiginit(self
,_core_
.new_TGAHandler(*args
, **kwargs
))
3678 _core_
.TGAHandler_swigregister(TGAHandler
)
3680 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3681 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3682 class Quantize(object):
3683 """Performs quantization, or colour reduction, on a wxImage."""
3684 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3685 def __init__(self
): raise AttributeError, "No constructor defined"
3686 __repr__
= _swig_repr
3687 def Quantize(*args
, **kwargs
):
3689 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3691 Reduce the colours in the source image and put the result into the
3692 destination image, setting the palette in the destination if
3693 needed. Both images may be the same, to overwrite the source image.
3695 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3697 Quantize
= staticmethod(Quantize
)
3698 _core_
.Quantize_swigregister(Quantize
)
3700 def Quantize_Quantize(*args
, **kwargs
):
3702 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3704 Reduce the colours in the source image and put the result into the
3705 destination image, setting the palette in the destination if
3706 needed. Both images may be the same, to overwrite the source image.
3708 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3710 #---------------------------------------------------------------------------
3712 class EvtHandler(Object
):
3713 """Proxy of C++ EvtHandler class"""
3714 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3715 __repr__
= _swig_repr
3716 def __init__(self
, *args
, **kwargs
):
3717 """__init__(self) -> EvtHandler"""
3718 _core_
.EvtHandler_swiginit(self
,_core_
.new_EvtHandler(*args
, **kwargs
))
3719 self
._setOORInfo
(self
)
3721 def GetNextHandler(*args
, **kwargs
):
3722 """GetNextHandler(self) -> EvtHandler"""
3723 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3725 def GetPreviousHandler(*args
, **kwargs
):
3726 """GetPreviousHandler(self) -> EvtHandler"""
3727 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3729 def SetNextHandler(*args
, **kwargs
):
3730 """SetNextHandler(self, EvtHandler handler)"""
3731 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3733 def SetPreviousHandler(*args
, **kwargs
):
3734 """SetPreviousHandler(self, EvtHandler handler)"""
3735 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3737 def GetEvtHandlerEnabled(*args
, **kwargs
):
3738 """GetEvtHandlerEnabled(self) -> bool"""
3739 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3741 def SetEvtHandlerEnabled(*args
, **kwargs
):
3742 """SetEvtHandlerEnabled(self, bool enabled)"""
3743 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3745 def ProcessEvent(*args
, **kwargs
):
3746 """ProcessEvent(self, Event event) -> bool"""
3747 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3749 def AddPendingEvent(*args
, **kwargs
):
3750 """AddPendingEvent(self, Event event)"""
3751 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3753 def ProcessPendingEvents(*args
, **kwargs
):
3754 """ProcessPendingEvents(self)"""
3755 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3757 def Connect(*args
, **kwargs
):
3758 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3759 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3761 def Disconnect(*args
, **kwargs
):
3762 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3763 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3765 def _setOORInfo(*args
, **kwargs
):
3766 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3767 val
= _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3768 args
[0].this
.own(False)
3771 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3773 Bind an event to an event handler.
3775 :param event: One of the EVT_* objects that specifies the
3776 type of event to bind,
3778 :param handler: A callable object to be invoked when the
3779 event is delivered to self. Pass None to
3780 disconnect an event handler.
3782 :param source: Sometimes the event originates from a
3783 different window than self, but you still
3784 want to catch it in self. (For example, a
3785 button event delivered to a frame.) By
3786 passing the source of the event, the event
3787 handling system is able to differentiate
3788 between the same event type from different
3791 :param id: Used to spcify the event source by ID instead
3794 :param id2: Used when it is desirable to bind a handler
3795 to a range of IDs, such as with EVT_MENU_RANGE.
3797 if source
is not None:
3799 event
.Bind(self
, id, id2
, handler
)
3801 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3803 Disconencts the event handler binding for event from self.
3804 Returns True if successful.
3806 if source
is not None:
3808 return event
.Unbind(self
, id, id2
)
3810 EvtHandlerEnabled
= property(GetEvtHandlerEnabled
,SetEvtHandlerEnabled
,doc
="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3811 NextHandler
= property(GetNextHandler
,SetNextHandler
,doc
="See `GetNextHandler` and `SetNextHandler`")
3812 PreviousHandler
= property(GetPreviousHandler
,SetPreviousHandler
,doc
="See `GetPreviousHandler` and `SetPreviousHandler`")
3813 _core_
.EvtHandler_swigregister(EvtHandler
)
3815 #---------------------------------------------------------------------------
3817 class PyEventBinder(object):
3819 Instances of this class are used to bind specific events to event
3822 def __init__(self
, evtType
, expectedIDs
=0):
3823 if expectedIDs
not in [0, 1, 2]:
3824 raise ValueError, "Invalid number of expectedIDs"
3825 self
.expectedIDs
= expectedIDs
3827 if type(evtType
) == list or type(evtType
) == tuple:
3828 self
.evtType
= evtType
3830 self
.evtType
= [evtType
]
3833 def Bind(self
, target
, id1
, id2
, function
):
3834 """Bind this set of event types to target."""
3835 for et
in self
.evtType
:
3836 target
.Connect(id1
, id2
, et
, function
)
3839 def Unbind(self
, target
, id1
, id2
):
3840 """Remove an event binding."""
3842 for et
in self
.evtType
:
3843 success
+= target
.Disconnect(id1
, id2
, et
)
3846 def _getEvtType(self
):
3848 Make it easy to get to the default wxEventType typeID for this
3851 return self
.evtType
[0]
3853 typeId
= property(_getEvtType
)
3856 def __call__(self
, *args
):
3858 For backwards compatibility with the old EVT_* functions.
3859 Should be called with either (window, func), (window, ID,
3860 func) or (window, ID1, ID2, func) parameters depending on the
3863 assert len(args
) == 2 + self
.expectedIDs
3867 if self
.expectedIDs
== 0:
3869 elif self
.expectedIDs
== 1:
3872 elif self
.expectedIDs
== 2:
3877 raise ValueError, "Unexpected number of IDs"
3879 self
.Bind(target
, id1
, id2
, func
)
3882 # These two are square pegs that don't fit the PyEventBinder hole...
3883 def EVT_COMMAND(win
, id, cmd
, func
):
3884 win
.Connect(id, -1, cmd
, func
)
3885 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3886 win
.Connect(id1
, id2
, cmd
, func
)
3889 #---------------------------------------------------------------------------
3891 #---------------------------------------------------------------------------
3893 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3894 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3896 def NewEventType(*args
):
3897 """NewEventType() -> EventType"""
3898 return _core_
.NewEventType(*args
)
3899 wxEVT_ANY
= _core_
.wxEVT_ANY
3900 wxEVT_NULL
= _core_
.wxEVT_NULL
3901 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3902 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3903 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3904 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3905 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3906 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3907 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3908 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3909 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3910 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3911 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3912 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3913 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3914 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3915 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3916 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3917 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3918 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3919 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3920 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3921 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3922 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3923 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3924 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3925 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3926 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3927 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3928 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3929 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3930 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3931 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3932 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3933 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3934 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3935 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3936 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3937 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3938 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3939 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3940 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3941 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3942 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3943 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3944 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3945 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3946 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3947 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3948 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3949 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3950 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3951 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3952 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3953 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3954 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3955 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3956 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3957 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3958 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3959 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3960 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3961 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3962 wxEVT_SCROLL_CHANGED
= _core_
.wxEVT_SCROLL_CHANGED
3963 wxEVT_SCROLL_ENDSCROLL
= wxEVT_SCROLL_CHANGED
3964 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3965 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3966 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3967 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3968 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3969 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3970 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3971 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3972 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3973 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3974 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3975 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3976 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3977 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3978 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3979 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3980 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3981 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3982 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3983 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3984 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3985 wxEVT_MOUSE_CAPTURE_LOST
= _core_
.wxEVT_MOUSE_CAPTURE_LOST
3986 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3987 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3988 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3989 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3990 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3991 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3992 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3993 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3994 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3995 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3996 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3997 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3998 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3999 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
4000 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
4001 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
4002 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
4003 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
4004 wxEVT_IDLE
= _core_
.wxEVT_IDLE
4005 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
4006 wxEVT_SIZING
= _core_
.wxEVT_SIZING
4007 wxEVT_MOVING
= _core_
.wxEVT_MOVING
4008 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
4009 wxEVT_COMMAND_TEXT_COPY
= _core_
.wxEVT_COMMAND_TEXT_COPY
4010 wxEVT_COMMAND_TEXT_CUT
= _core_
.wxEVT_COMMAND_TEXT_CUT
4011 wxEVT_COMMAND_TEXT_PASTE
= _core_
.wxEVT_COMMAND_TEXT_PASTE
4012 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
4013 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
4014 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
4015 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
4016 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
4017 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
4018 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
4020 # Create some event binders
4021 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
4022 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
4023 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
4024 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
4025 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
4026 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
4027 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
4028 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
4029 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
4030 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
4031 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
4032 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
4033 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
4034 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
4035 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
4036 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
4037 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
4038 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
4039 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
4040 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
4041 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
4042 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
4043 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
4044 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
4045 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
4046 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
4047 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
4048 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
4049 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
4050 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
4051 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
4052 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
4053 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
4054 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
4055 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
4056 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
4057 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
4058 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
4059 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
4060 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
4061 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
4062 EVT_MOUSE_CAPTURE_LOST
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST
)
4064 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
4065 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
4066 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
4067 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
4068 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
4069 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
4070 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
4071 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
4072 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
4073 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
4074 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
4075 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
4076 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
4078 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
4086 wxEVT_MIDDLE_DCLICK
,
4094 # Scrolling from wxWindow (sent to wxScrolledWindow)
4095 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
4096 wxEVT_SCROLLWIN_BOTTOM
,
4097 wxEVT_SCROLLWIN_LINEUP
,
4098 wxEVT_SCROLLWIN_LINEDOWN
,
4099 wxEVT_SCROLLWIN_PAGEUP
,
4100 wxEVT_SCROLLWIN_PAGEDOWN
,
4101 wxEVT_SCROLLWIN_THUMBTRACK
,
4102 wxEVT_SCROLLWIN_THUMBRELEASE
,
4105 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
4106 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
4107 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
4108 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
4109 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
4110 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
4111 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
4112 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
4114 # Scrolling from wx.Slider and wx.ScrollBar
4115 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
4116 wxEVT_SCROLL_BOTTOM
,
4117 wxEVT_SCROLL_LINEUP
,
4118 wxEVT_SCROLL_LINEDOWN
,
4119 wxEVT_SCROLL_PAGEUP
,
4120 wxEVT_SCROLL_PAGEDOWN
,
4121 wxEVT_SCROLL_THUMBTRACK
,
4122 wxEVT_SCROLL_THUMBRELEASE
,
4123 wxEVT_SCROLL_CHANGED
,
4126 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
4127 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
4128 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
4129 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
4130 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
4131 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
4132 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
4133 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
4134 EVT_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
)
4135 EVT_SCROLL_ENDSCROLL
= EVT_SCROLL_CHANGED
4137 # Scrolling from wx.Slider and wx.ScrollBar, with an id
4138 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
4139 wxEVT_SCROLL_BOTTOM
,
4140 wxEVT_SCROLL_LINEUP
,
4141 wxEVT_SCROLL_LINEDOWN
,
4142 wxEVT_SCROLL_PAGEUP
,
4143 wxEVT_SCROLL_PAGEDOWN
,
4144 wxEVT_SCROLL_THUMBTRACK
,
4145 wxEVT_SCROLL_THUMBRELEASE
,
4146 wxEVT_SCROLL_CHANGED
,
4149 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
4150 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
4151 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
4152 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
4153 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
4154 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
4155 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
4156 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
4157 EVT_COMMAND_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
, 1)
4158 EVT_COMMAND_SCROLL_ENDSCROLL
= EVT_COMMAND_SCROLL_CHANGED
4160 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
4161 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
4162 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
4163 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
4164 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
4165 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
4166 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
4167 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
4168 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
4169 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
4171 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
4172 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
4173 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
4174 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
4175 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
4176 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
4177 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
4178 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
4179 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
4182 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
4183 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
4184 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
4185 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
4186 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
4187 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
4188 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
4190 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
4192 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
4193 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
4195 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
4197 EVT_TEXT_CUT
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_CUT
)
4198 EVT_TEXT_COPY
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_COPY
)
4199 EVT_TEXT_PASTE
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE
)
4202 #---------------------------------------------------------------------------
4204 class Event(Object
):
4206 An event is a structure holding information about an event passed to a
4207 callback or member function. wx.Event is an abstract base class for
4210 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4211 def __init__(self
): raise AttributeError, "No constructor defined"
4212 __repr__
= _swig_repr
4213 __swig_destroy__
= _core_
.delete_Event
4214 __del__
= lambda self
: None;
4215 def SetEventType(*args
, **kwargs
):
4217 SetEventType(self, EventType typ)
4219 Sets the specific type of the event.
4221 return _core_
.Event_SetEventType(*args
, **kwargs
)
4223 def GetEventType(*args
, **kwargs
):
4225 GetEventType(self) -> EventType
4227 Returns the identifier of the given event type, such as
4228 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4230 return _core_
.Event_GetEventType(*args
, **kwargs
)
4232 def GetEventObject(*args
, **kwargs
):
4234 GetEventObject(self) -> Object
4236 Returns the object (usually a window) associated with the event, if
4239 return _core_
.Event_GetEventObject(*args
, **kwargs
)
4241 def SetEventObject(*args
, **kwargs
):
4243 SetEventObject(self, Object obj)
4245 Sets the originating object, or in other words, obj is normally the
4246 object that is sending the event.
4248 return _core_
.Event_SetEventObject(*args
, **kwargs
)
4250 def GetTimestamp(*args
, **kwargs
):
4251 """GetTimestamp(self) -> long"""
4252 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
4254 def SetTimestamp(*args
, **kwargs
):
4255 """SetTimestamp(self, long ts=0)"""
4256 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
4258 def GetId(*args
, **kwargs
):
4262 Returns the identifier associated with this event, such as a button
4265 return _core_
.Event_GetId(*args
, **kwargs
)
4267 def SetId(*args
, **kwargs
):
4271 Set's the ID for the event. This is usually the ID of the window that
4272 is sending the event, but it can also be a command id from a menu
4275 return _core_
.Event_SetId(*args
, **kwargs
)
4277 def IsCommandEvent(*args
, **kwargs
):
4279 IsCommandEvent(self) -> bool
4281 Returns true if the event is or is derived from `wx.CommandEvent` else
4282 it returns false. Note: Exists only for optimization purposes.
4284 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
4286 def Skip(*args
, **kwargs
):
4288 Skip(self, bool skip=True)
4290 This method can be used inside an event handler to control whether
4291 further event handlers bound to this event will be called after the
4292 current one returns. Without Skip() (or equivalently if Skip(False) is
4293 used), the event will not be processed any more. If Skip(True) is
4294 called, the event processing system continues searching for a further
4295 handler function for this event, even though it has been processed
4296 already in the current handler.
4298 return _core_
.Event_Skip(*args
, **kwargs
)
4300 def GetSkipped(*args
, **kwargs
):
4302 GetSkipped(self) -> bool
4304 Returns true if the event handler should be skipped, false otherwise.
4307 return _core_
.Event_GetSkipped(*args
, **kwargs
)
4309 def ShouldPropagate(*args
, **kwargs
):
4311 ShouldPropagate(self) -> bool
4313 Test if this event should be propagated to the parent window or not,
4314 i.e. if the propagation level is currently greater than 0.
4316 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
4318 def StopPropagation(*args
, **kwargs
):
4320 StopPropagation(self) -> int
4322 Stop the event from propagating to its parent window. Returns the old
4323 propagation level value which may be later passed to
4324 `ResumePropagation` to allow propagating the event again.
4326 return _core_
.Event_StopPropagation(*args
, **kwargs
)
4328 def ResumePropagation(*args
, **kwargs
):
4330 ResumePropagation(self, int propagationLevel)
4332 Resume the event propagation by restoring the propagation level. (For
4333 example, you can use the value returned by an earlier call to
4337 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
4339 def Clone(*args
, **kwargs
):
4340 """Clone(self) -> Event"""
4341 return _core_
.Event_Clone(*args
, **kwargs
)
4343 EventObject
= property(GetEventObject
,SetEventObject
,doc
="See `GetEventObject` and `SetEventObject`")
4344 EventType
= property(GetEventType
,SetEventType
,doc
="See `GetEventType` and `SetEventType`")
4345 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
4346 Skipped
= property(GetSkipped
,doc
="See `GetSkipped`")
4347 Timestamp
= property(GetTimestamp
,SetTimestamp
,doc
="See `GetTimestamp` and `SetTimestamp`")
4348 _core_
.Event_swigregister(Event
)
4350 #---------------------------------------------------------------------------
4352 class PropagationDisabler(object):
4354 Helper class to temporarily change an event not to propagate. Simply
4355 create an instance of this class and then whe it is destroyed the
4356 propogation of the event will be restored.
4358 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4359 __repr__
= _swig_repr
4360 def __init__(self
, *args
, **kwargs
):
4362 __init__(self, Event event) -> PropagationDisabler
4364 Helper class to temporarily change an event not to propagate. Simply
4365 create an instance of this class and then whe it is destroyed the
4366 propogation of the event will be restored.
4368 _core_
.PropagationDisabler_swiginit(self
,_core_
.new_PropagationDisabler(*args
, **kwargs
))
4369 __swig_destroy__
= _core_
.delete_PropagationDisabler
4370 __del__
= lambda self
: None;
4371 _core_
.PropagationDisabler_swigregister(PropagationDisabler
)
4373 class PropagateOnce(object):
4375 A helper class that will temporarily lower propagation level of an
4376 event. Simply create an instance of this class and then whe it is
4377 destroyed the propogation of the event will be restored.
4379 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4380 __repr__
= _swig_repr
4381 def __init__(self
, *args
, **kwargs
):
4383 __init__(self, Event event) -> PropagateOnce
4385 A helper class that will temporarily lower propagation level of an
4386 event. Simply create an instance of this class and then whe it is
4387 destroyed the propogation of the event will be restored.
4389 _core_
.PropagateOnce_swiginit(self
,_core_
.new_PropagateOnce(*args
, **kwargs
))
4390 __swig_destroy__
= _core_
.delete_PropagateOnce
4391 __del__
= lambda self
: None;
4392 _core_
.PropagateOnce_swigregister(PropagateOnce
)
4394 #---------------------------------------------------------------------------
4396 class CommandEvent(Event
):
4398 This event class contains information about command events, which
4399 originate from a variety of simple controls, as well as menus and
4402 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4403 __repr__
= _swig_repr
4404 def __init__(self
, *args
, **kwargs
):
4406 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4408 This event class contains information about command events, which
4409 originate from a variety of simple controls, as well as menus and
4412 _core_
.CommandEvent_swiginit(self
,_core_
.new_CommandEvent(*args
, **kwargs
))
4413 def GetSelection(*args
, **kwargs
):
4415 GetSelection(self) -> int
4417 Returns item index for a listbox or choice selection event (not valid
4420 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
4422 def SetString(*args
, **kwargs
):
4423 """SetString(self, String s)"""
4424 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
4426 def GetString(*args
, **kwargs
):
4428 GetString(self) -> String
4430 Returns item string for a listbox or choice selection event (not valid
4433 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
4435 def IsChecked(*args
, **kwargs
):
4437 IsChecked(self) -> bool
4439 This method can be used with checkbox and menu events: for the
4440 checkboxes, the method returns true for a selection event and false
4441 for a deselection one. For the menu events, this method indicates if
4442 the menu item just has become checked or unchecked (and thus only
4443 makes sense for checkable menu items).
4445 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
4448 def IsSelection(*args
, **kwargs
):
4450 IsSelection(self) -> bool
4452 For a listbox or similar event, returns true if it is a selection,
4453 false if it is a deselection.
4455 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4457 def SetExtraLong(*args
, **kwargs
):
4458 """SetExtraLong(self, long extraLong)"""
4459 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4461 def GetExtraLong(*args
, **kwargs
):
4463 GetExtraLong(self) -> long
4465 Returns extra information dependant on the event objects type. If the
4466 event comes from a listbox selection, it is a boolean determining
4467 whether the event was a selection (true) or a deselection (false). A
4468 listbox deselection only occurs for multiple-selection boxes, and in
4469 this case the index and string values are indeterminate and the
4470 listbox must be examined by the application.
4472 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4474 def SetInt(*args
, **kwargs
):
4475 """SetInt(self, int i)"""
4476 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4478 def GetInt(*args
, **kwargs
):
4482 Returns the integer identifier corresponding to a listbox, choice or
4483 radiobox selection (only if the event was a selection, not a
4484 deselection), or a boolean value representing the value of a checkbox.
4486 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4488 def GetClientData(*args
, **kwargs
):
4490 GetClientData(self) -> PyObject
4492 Returns the client data object for a listbox or choice selection event, (if any.)
4494 return _core_
.CommandEvent_GetClientData(*args
, **kwargs
)
4496 def SetClientData(*args
, **kwargs
):
4498 SetClientData(self, PyObject clientData)
4500 Associate the given client data with the item at position n.
4502 return _core_
.CommandEvent_SetClientData(*args
, **kwargs
)
4504 GetClientObject
= GetClientData
4505 SetClientObject
= SetClientData
4507 def Clone(*args
, **kwargs
):
4508 """Clone(self) -> Event"""
4509 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4511 ClientData
= property(GetClientData
,SetClientData
,doc
="See `GetClientData` and `SetClientData`")
4512 ClientObject
= property(GetClientObject
,SetClientObject
,doc
="See `GetClientObject` and `SetClientObject`")
4513 ExtraLong
= property(GetExtraLong
,SetExtraLong
,doc
="See `GetExtraLong` and `SetExtraLong`")
4514 Int
= property(GetInt
,SetInt
,doc
="See `GetInt` and `SetInt`")
4515 Selection
= property(GetSelection
,doc
="See `GetSelection`")
4516 String
= property(GetString
,SetString
,doc
="See `GetString` and `SetString`")
4517 _core_
.CommandEvent_swigregister(CommandEvent
)
4519 #---------------------------------------------------------------------------
4521 class NotifyEvent(CommandEvent
):
4523 An instance of this class (or one of its derived classes) is sent from
4524 a control when the control's state is being changed and the control
4525 allows that change to be prevented from happening. The event handler
4526 can call `Veto` or `Allow` to tell the control what to do.
4528 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4529 __repr__
= _swig_repr
4530 def __init__(self
, *args
, **kwargs
):
4532 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4534 An instance of this class (or one of its derived classes) is sent from
4535 a control when the control's state is being changed and the control
4536 allows that change to be prevented from happening. The event handler
4537 can call `Veto` or `Allow` to tell the control what to do.
4539 _core_
.NotifyEvent_swiginit(self
,_core_
.new_NotifyEvent(*args
, **kwargs
))
4540 def Veto(*args
, **kwargs
):
4544 Prevents the change announced by this event from happening.
4546 It is in general a good idea to notify the user about the reasons for
4547 vetoing the change because otherwise the applications behaviour (which
4548 just refuses to do what the user wants) might be quite surprising.
4550 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4552 def Allow(*args
, **kwargs
):
4556 This is the opposite of `Veto`: it explicitly allows the event to be
4557 processed. For most events it is not necessary to call this method as
4558 the events are allowed anyhow but some are forbidden by default (this
4559 will be mentioned in the corresponding event description).
4561 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4563 def IsAllowed(*args
, **kwargs
):
4565 IsAllowed(self) -> bool
4567 Returns true if the change is allowed (`Veto` hasn't been called) or
4568 false otherwise (if it was).
4570 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4572 _core_
.NotifyEvent_swigregister(NotifyEvent
)
4574 #---------------------------------------------------------------------------
4576 class ScrollEvent(CommandEvent
):
4578 A scroll event holds information about events sent from stand-alone
4579 scrollbars and sliders. Note that scrolled windows do not send
4580 instances of this event class, but send the `wx.ScrollWinEvent`
4583 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4584 __repr__
= _swig_repr
4585 def __init__(self
, *args
, **kwargs
):
4587 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4588 int orient=0) -> ScrollEvent
4590 _core_
.ScrollEvent_swiginit(self
,_core_
.new_ScrollEvent(*args
, **kwargs
))
4591 def GetOrientation(*args
, **kwargs
):
4593 GetOrientation(self) -> int
4595 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4598 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4600 def GetPosition(*args
, **kwargs
):
4602 GetPosition(self) -> int
4604 Returns the position of the scrollbar.
4606 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4608 def SetOrientation(*args
, **kwargs
):
4609 """SetOrientation(self, int orient)"""
4610 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4612 def SetPosition(*args
, **kwargs
):
4613 """SetPosition(self, int pos)"""
4614 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4616 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
4617 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
4618 _core_
.ScrollEvent_swigregister(ScrollEvent
)
4620 #---------------------------------------------------------------------------
4622 class ScrollWinEvent(Event
):
4624 A wx.ScrollWinEvent holds information about scrolling and is sent from
4627 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4628 __repr__
= _swig_repr
4629 def __init__(self
, *args
, **kwargs
):
4631 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4633 A wx.ScrollWinEvent holds information about scrolling and is sent from
4636 _core_
.ScrollWinEvent_swiginit(self
,_core_
.new_ScrollWinEvent(*args
, **kwargs
))
4637 def GetOrientation(*args
, **kwargs
):
4639 GetOrientation(self) -> int
4641 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4644 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4646 def GetPosition(*args
, **kwargs
):
4648 GetPosition(self) -> int
4650 Returns the position of the scrollbar for the thumb track and release
4651 events. Note that this field can't be used for the other events, you
4652 need to query the window itself for the current position in that case.
4654 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4656 def SetOrientation(*args
, **kwargs
):
4657 """SetOrientation(self, int orient)"""
4658 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4660 def SetPosition(*args
, **kwargs
):
4661 """SetPosition(self, int pos)"""
4662 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4664 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
4665 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
4666 _core_
.ScrollWinEvent_swigregister(ScrollWinEvent
)
4668 #---------------------------------------------------------------------------
4670 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4671 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4672 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4673 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4674 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4675 class MouseEvent(Event
):
4677 This event class contains information about the events generated by
4678 the mouse: they include mouse buttons press and release events and
4681 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4682 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4683 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4684 a middle button so a portable application should avoid relying on the
4687 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4688 the former returns true when the event corresponds to the left mouse
4689 button click while the latter returns true if the left mouse button is
4690 currently being pressed. For example, when the user is dragging the
4691 mouse you can use `LeftIsDown` to test whether the left mouse button
4692 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4693 `LeftIsDown` will also return true in wxWidgets whatever the
4694 underlying GUI behaviour is (which is platform-dependent). The same
4695 applies, of course, to other mouse buttons as well.
4697 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4698 __repr__
= _swig_repr
4699 def __init__(self
, *args
, **kwargs
):
4701 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4703 Constructs a wx.MouseEvent. Valid event types are:
4705 * wxEVT_ENTER_WINDOW
4706 * wxEVT_LEAVE_WINDOW
4712 * wxEVT_MIDDLE_DCLICK
4715 * wxEVT_RIGHT_DCLICK
4719 _core_
.MouseEvent_swiginit(self
,_core_
.new_MouseEvent(*args
, **kwargs
))
4720 def IsButton(*args
, **kwargs
):
4722 IsButton(self) -> bool
4724 Returns true if the event was a mouse button event (not necessarily a
4725 button down event - that may be tested using `ButtonDown`).
4727 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4729 def ButtonDown(*args
, **kwargs
):
4731 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4733 If the argument is omitted, this returns true if the event was any
4734 mouse button down event. Otherwise the argument specifies which
4735 button-down event shold be checked for (see `Button` for the possible
4738 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4740 def ButtonDClick(*args
, **kwargs
):
4742 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4744 If the argument is omitted, this returns true if the event was any
4745 mouse double click event. Otherwise the argument specifies which
4746 double click event to check for (see `Button` for the possible
4749 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4751 def ButtonUp(*args
, **kwargs
):
4753 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4755 If the argument is omitted, this returns true if the event was any
4756 mouse button up event. Otherwise the argument specifies which button
4757 up event to check for (see `Button` for the possible values).
4759 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4761 def Button(*args
, **kwargs
):
4763 Button(self, int button) -> bool
4765 Returns true if the identified mouse button is changing state. Valid
4766 values of button are:
4768 ==================== =====================================
4769 wx.MOUSE_BTN_LEFT check if left button was pressed
4770 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4771 wx.MOUSE_BTN_RIGHT check if right button was pressed
4772 wx.MOUSE_BTN_ANY check if any button was pressed
4773 ==================== =====================================
4776 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4778 def ButtonIsDown(*args
, **kwargs
):
4779 """ButtonIsDown(self, int but) -> bool"""
4780 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4782 def GetButton(*args
, **kwargs
):
4784 GetButton(self) -> int
4786 Returns the mouse button which generated this event or
4787 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4788 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4789 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4790 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4791 right buttons respectively.
4793 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4795 def ControlDown(*args
, **kwargs
):
4797 ControlDown(self) -> bool
4799 Returns true if the control key was down at the time of the event.
4801 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4803 def MetaDown(*args
, **kwargs
):
4805 MetaDown(self) -> bool
4807 Returns true if the Meta key was down at the time of the event.
4809 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4811 def AltDown(*args
, **kwargs
):
4813 AltDown(self) -> bool
4815 Returns true if the Alt key was down at the time of the event.
4817 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4819 def ShiftDown(*args
, **kwargs
):
4821 ShiftDown(self) -> bool
4823 Returns true if the Shift key was down at the time of the event.
4825 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4827 def CmdDown(*args
, **kwargs
):
4829 CmdDown(self) -> bool
4831 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4832 platforms but the special "Apple" (a.k.a as "Command") key on
4833 Macs. It often makes sense to use it instead of, say, `ControlDown`
4834 because Cmd key is used for the same thing under Mac as Ctrl
4835 elsewhere. The Ctrl key still exists, it's just not used for this
4836 purpose. So for non-Mac platforms this is the same as `ControlDown`
4837 and Macs this is the same as `MetaDown`.
4839 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4841 def LeftDown(*args
, **kwargs
):
4843 LeftDown(self) -> bool
4845 Returns true if the left mouse button state changed to down.
4847 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4849 def MiddleDown(*args
, **kwargs
):
4851 MiddleDown(self) -> bool
4853 Returns true if the middle mouse button state changed to down.
4855 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4857 def RightDown(*args
, **kwargs
):
4859 RightDown(self) -> bool
4861 Returns true if the right mouse button state changed to down.
4863 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4865 def LeftUp(*args
, **kwargs
):
4867 LeftUp(self) -> bool
4869 Returns true if the left mouse button state changed to up.
4871 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4873 def MiddleUp(*args
, **kwargs
):
4875 MiddleUp(self) -> bool
4877 Returns true if the middle mouse button state changed to up.
4879 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4881 def RightUp(*args
, **kwargs
):
4883 RightUp(self) -> bool
4885 Returns true if the right mouse button state changed to up.
4887 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4889 def LeftDClick(*args
, **kwargs
):
4891 LeftDClick(self) -> bool
4893 Returns true if the event was a left button double click.
4895 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4897 def MiddleDClick(*args
, **kwargs
):
4899 MiddleDClick(self) -> bool
4901 Returns true if the event was a middle button double click.
4903 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4905 def RightDClick(*args
, **kwargs
):
4907 RightDClick(self) -> bool
4909 Returns true if the event was a right button double click.
4911 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4913 def LeftIsDown(*args
, **kwargs
):
4915 LeftIsDown(self) -> bool
4917 Returns true if the left mouse button is currently down, independent
4918 of the current event type.
4920 Please notice that it is not the same as LeftDown which returns true
4921 if the left mouse button was just pressed. Rather, it describes the
4922 state of the mouse button before the event happened.
4924 This event is usually used in the mouse event handlers which process
4925 "move mouse" messages to determine whether the user is (still)
4928 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4930 def MiddleIsDown(*args
, **kwargs
):
4932 MiddleIsDown(self) -> bool
4934 Returns true if the middle mouse button is currently down, independent
4935 of the current event type.
4937 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4939 def RightIsDown(*args
, **kwargs
):
4941 RightIsDown(self) -> bool
4943 Returns true if the right mouse button is currently down, independent
4944 of the current event type.
4946 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4948 def Dragging(*args
, **kwargs
):
4950 Dragging(self) -> bool
4952 Returns true if this was a dragging event (motion while a button is
4955 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4957 def Moving(*args
, **kwargs
):
4959 Moving(self) -> bool
4961 Returns true if this was a motion event and no mouse buttons were
4962 pressed. If any mouse button is held pressed, then this method returns
4963 false and Dragging returns true.
4965 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4967 def Entering(*args
, **kwargs
):
4969 Entering(self) -> bool
4971 Returns true if the mouse was entering the window.
4973 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4975 def Leaving(*args
, **kwargs
):
4977 Leaving(self) -> bool
4979 Returns true if the mouse was leaving the window.
4981 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4983 def GetPosition(*args
, **kwargs
):
4985 GetPosition(self) -> Point
4987 Returns the pixel position of the mouse in window coordinates when the
4990 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4992 def GetPositionTuple(*args
, **kwargs
):
4994 GetPositionTuple() -> (x,y)
4996 Returns the pixel position of the mouse in window coordinates when the
4999 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
5001 def GetLogicalPosition(*args
, **kwargs
):
5003 GetLogicalPosition(self, DC dc) -> Point
5005 Returns the logical mouse position in pixels (i.e. translated
5006 according to the translation set for the DC, which usually indicates
5007 that the window has been scrolled).
5009 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
5011 def GetX(*args
, **kwargs
):
5015 Returns X coordinate of the physical mouse event position.
5017 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
5019 def GetY(*args
, **kwargs
):
5023 Returns Y coordinate of the physical mouse event position.
5025 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
5027 def GetWheelRotation(*args
, **kwargs
):
5029 GetWheelRotation(self) -> int
5031 Get wheel rotation, positive or negative indicates direction of
5032 rotation. Current devices all send an event when rotation is equal to
5033 +/-WheelDelta, but this allows for finer resolution devices to be
5034 created in the future. Because of this you shouldn't assume that one
5035 event is equal to 1 line or whatever, but you should be able to either
5036 do partial line scrolling or wait until +/-WheelDelta rotation values
5037 have been accumulated before scrolling.
5039 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
5041 def GetWheelDelta(*args
, **kwargs
):
5043 GetWheelDelta(self) -> int
5045 Get wheel delta, normally 120. This is the threshold for action to be
5046 taken, and one such action (for example, scrolling one increment)
5047 should occur for each delta.
5049 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
5051 def GetWheelAxis(*args
, **kwargs
):
5053 GetWheelAxis(self) -> int
5055 Gets the axis the wheel operation concerns, 0 being the y axis as on
5056 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5057 or horizontal trackpad scrolling.
5059 return _core_
.MouseEvent_GetWheelAxis(*args
, **kwargs
)
5061 def GetLinesPerAction(*args
, **kwargs
):
5063 GetLinesPerAction(self) -> int
5065 Returns the configured number of lines (or whatever) to be scrolled
5066 per wheel action. Defaults to three.
5068 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
5070 def IsPageScroll(*args
, **kwargs
):
5072 IsPageScroll(self) -> bool
5074 Returns true if the system has been setup to do page scrolling with
5075 the mouse wheel instead of line scrolling.
5077 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
5079 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
5080 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
5081 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
5082 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
5083 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
5084 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
5085 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
5086 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
5087 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
5088 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
5089 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
5090 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
5091 Button
= property(GetButton
,doc
="See `GetButton`")
5092 LinesPerAction
= property(GetLinesPerAction
,doc
="See `GetLinesPerAction`")
5093 LogicalPosition
= property(GetLogicalPosition
,doc
="See `GetLogicalPosition`")
5094 Position
= property(GetPosition
,doc
="See `GetPosition`")
5095 WheelDelta
= property(GetWheelDelta
,doc
="See `GetWheelDelta`")
5096 WheelRotation
= property(GetWheelRotation
,doc
="See `GetWheelRotation`")
5097 X
= property(GetX
,doc
="See `GetX`")
5098 Y
= property(GetY
,doc
="See `GetY`")
5099 _core_
.MouseEvent_swigregister(MouseEvent
)
5101 #---------------------------------------------------------------------------
5103 class SetCursorEvent(Event
):
5105 A SetCursorEvent is generated when the mouse cursor is about to be set
5106 as a result of mouse motion. This event gives the application the
5107 chance to perform specific mouse cursor processing based on the
5108 current position of the mouse within the window. Use the `SetCursor`
5109 method to specify the cursor you want to be displayed.
5111 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5112 __repr__
= _swig_repr
5113 def __init__(self
, *args
, **kwargs
):
5115 __init__(self, int x=0, int y=0) -> SetCursorEvent
5117 Construct a new `wx.SetCursorEvent`.
5119 _core_
.SetCursorEvent_swiginit(self
,_core_
.new_SetCursorEvent(*args
, **kwargs
))
5120 def GetX(*args
, **kwargs
):
5124 Returns the X coordinate of the mouse in client coordinates.
5126 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
5128 def GetY(*args
, **kwargs
):
5132 Returns the Y coordinate of the mouse in client coordinates.
5134 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
5136 def SetCursor(*args
, **kwargs
):
5138 SetCursor(self, Cursor cursor)
5140 Sets the cursor associated with this event.
5142 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
5144 def GetCursor(*args
, **kwargs
):
5146 GetCursor(self) -> Cursor
5148 Returns a reference to the cursor specified by this event.
5150 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
5152 def HasCursor(*args
, **kwargs
):
5154 HasCursor(self) -> bool
5156 Returns true if the cursor specified by this event is a valid cursor.
5158 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
5160 Cursor
= property(GetCursor
,SetCursor
,doc
="See `GetCursor` and `SetCursor`")
5161 X
= property(GetX
,doc
="See `GetX`")
5162 Y
= property(GetY
,doc
="See `GetY`")
5163 _core_
.SetCursorEvent_swigregister(SetCursorEvent
)
5165 #---------------------------------------------------------------------------
5167 class KeyEvent(Event
):
5169 This event class contains information about keypress and character
5170 events. These events are only sent to the widget that currently has
5173 Notice that there are three different kinds of keyboard events in
5174 wxWidgets: key down and up events and char events. The difference
5175 between the first two is clear - the first corresponds to a key press
5176 and the second to a key release - otherwise they are identical. Just
5177 note that if the key is maintained in a pressed state you will
5178 typically get a lot of (automatically generated) down events but only
5179 one up so it is wrong to assume that there is one up event
5180 corresponding to each down one.
5182 Both key events provide untranslated key codes while the char event
5183 carries the translated one. The untranslated code for alphanumeric
5184 keys is always an upper case value. For the other keys it is one of
5185 WXK_XXX values from the keycodes table. The translated key is, in
5186 general, the character the user expects to appear as the result of the
5187 key combination when typing the text into a text entry zone, for
5190 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5191 and the standard US keyboard): when the 'A' key is pressed, the key
5192 down event key code is equal to ASCII A == 65. But the char event key
5193 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5194 'A' keys simultaneously , the key code in key down event will still be
5195 just 'A' while the char event key code parameter will now be 'A' as
5198 Although in this simple case it is clear that the correct key code
5199 could be found in the key down event handler by checking the value
5200 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5201 as for non alphanumeric keys or non-US keyboard layouts the
5202 translation is keyboard-layout dependent and can only be done properly
5203 by the system itself.
5205 Another kind of translation is done when the control key is pressed:
5206 for example, for CTRL-A key press the key down event still carries the
5207 same key code 'A' as usual but the char event will have key code of 1,
5208 the ASCII value of this key combination.
5210 You may discover how the other keys on your system behave
5211 interactively by running the KeyEvents sample in the wxPython demo and
5212 pressing some keys while the blue box at the top has the keyboard
5215 **Note**: If a key down event is caught and the event handler does not
5216 call event.Skip() then the coresponding char event will not
5217 happen. This is by design and enables the programs that handle both
5218 types of events to be a bit simpler.
5220 **Note for Windows programmers**: The key and char events in wxWidgets
5221 are similar to but slightly different from Windows WM_KEYDOWN and
5222 WM_CHAR events. In particular, Alt-x combination will generate a char
5223 event in wxWidgets (unless it is used as an accelerator).
5225 **Tip**: be sure to call event.Skip() for events that you don't
5226 process in key event function, otherwise menu shortcuts may cease to
5230 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5231 __repr__
= _swig_repr
5232 def __init__(self
, *args
, **kwargs
):
5234 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5236 Construct a new `wx.KeyEvent`. Valid event types are:
5239 _core_
.KeyEvent_swiginit(self
,_core_
.new_KeyEvent(*args
, **kwargs
))
5240 def GetModifiers(*args
, **kwargs
):
5242 GetModifiers(self) -> int
5244 Returns a bitmask of the current modifier settings. Can be used to
5245 check if the key event has exactly the given modifiers without having
5246 to explicitly check that the other modifiers are not down. For
5249 if event.GetModifers() == wx.MOD_CONTROL:
5253 return _core_
.KeyEvent_GetModifiers(*args
, **kwargs
)
5255 def ControlDown(*args
, **kwargs
):
5257 ControlDown(self) -> bool
5259 Returns ``True`` if the Control key was down at the time of the event.
5261 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
5263 def MetaDown(*args
, **kwargs
):
5265 MetaDown(self) -> bool
5267 Returns ``True`` if the Meta key was down at the time of the event.
5269 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
5271 def AltDown(*args
, **kwargs
):
5273 AltDown(self) -> bool
5275 Returns ``True`` if the Alt key was down at the time of the event.
5277 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
5279 def ShiftDown(*args
, **kwargs
):
5281 ShiftDown(self) -> bool
5283 Returns ``True`` if the Shift key was down at the time of the event.
5285 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
5287 def CmdDown(*args
, **kwargs
):
5289 CmdDown(self) -> bool
5291 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5292 platforms but the special "Apple" (a.k.a as "Command") key on
5293 Macs. It makes often sense to use it instead of, say, `ControlDown`
5294 because Cmd key is used for the same thing under Mac as Ctrl
5295 elsewhere. The Ctrl still exists, it's just not used for this
5296 purpose. So for non-Mac platforms this is the same as `ControlDown`
5297 and Macs this is the same as `MetaDown`.
5299 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
5301 def HasModifiers(*args
, **kwargs
):
5303 HasModifiers(self) -> bool
5305 Returns true if either CTRL or ALT keys was down at the time of the
5306 key event. Note that this function does not take into account neither
5307 SHIFT nor META key states (the reason for ignoring the latter is that
5308 it is common for NUMLOCK key to be configured as META under X but the
5309 key presses even while NUMLOCK is on should be still processed
5312 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
5314 def GetKeyCode(*args
, **kwargs
):
5316 GetKeyCode(self) -> int
5318 Returns the virtual key code. ASCII events return normal ASCII values,
5319 while non-ASCII events return values such as WXK_LEFT for the left
5320 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5323 Note that in Unicode build, the returned value is meaningful only if
5324 the user entered a character that can be represented in current
5325 locale's default charset. You can obtain the corresponding Unicode
5326 character using `GetUnicodeKey`.
5328 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
5330 def GetUnicodeKey(*args
, **kwargs
):
5332 GetUnicodeKey(self) -> int
5334 Returns the Unicode character corresponding to this key event. This
5335 function is only meaningfule in a Unicode build of wxPython.
5337 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
5339 GetUniChar
= GetUnicodeKey
5340 def SetUnicodeKey(*args
, **kwargs
):
5342 SetUnicodeKey(self, int uniChar)
5344 Set the Unicode value of the key event, but only if this is a Unicode
5347 return _core_
.KeyEvent_SetUnicodeKey(*args
, **kwargs
)
5349 def GetRawKeyCode(*args
, **kwargs
):
5351 GetRawKeyCode(self) -> unsigned int
5353 Returns the raw key code for this event. This is a platform-dependent
5354 scan code which should only be used in advanced
5355 applications. Currently the raw key codes are not supported by all
5358 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
5360 def GetRawKeyFlags(*args
, **kwargs
):
5362 GetRawKeyFlags(self) -> unsigned int
5364 Returns the low level key flags for this event. The flags are
5365 platform-dependent and should only be used in advanced applications.
5366 Currently the raw key flags are not supported by all ports.
5368 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
5370 def GetPosition(*args
, **kwargs
):
5372 GetPosition(self) -> Point
5374 Find the position of the event, if applicable.
5376 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
5378 def GetPositionTuple(*args
, **kwargs
):
5380 GetPositionTuple() -> (x,y)
5382 Find the position of the event, if applicable.
5384 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
5386 def GetX(*args
, **kwargs
):
5390 Returns the X position (in client coordinates) of the event, if
5393 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
5395 def GetY(*args
, **kwargs
):
5399 Returns the Y position (in client coordinates) of the event, if
5402 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
5404 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
5405 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
5406 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
5407 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
5408 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
5409 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
5410 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
5411 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
5412 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
5413 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
5414 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
5415 Modifiers
= property(GetModifiers
,doc
="See `GetModifiers`")
5416 Position
= property(GetPosition
,doc
="See `GetPosition`")
5417 RawKeyCode
= property(GetRawKeyCode
,doc
="See `GetRawKeyCode`")
5418 RawKeyFlags
= property(GetRawKeyFlags
,doc
="See `GetRawKeyFlags`")
5419 UnicodeKey
= property(GetUnicodeKey
,SetUnicodeKey
,doc
="See `GetUnicodeKey` and `SetUnicodeKey`")
5420 X
= property(GetX
,doc
="See `GetX`")
5421 Y
= property(GetY
,doc
="See `GetY`")
5422 _core_
.KeyEvent_swigregister(KeyEvent
)
5424 #---------------------------------------------------------------------------
5426 class SizeEvent(Event
):
5428 A size event holds information about size change events. The EVT_SIZE
5429 handler function will be called when the window it is bound to has
5432 Note that the size passed is of the whole window: call
5433 `wx.Window.GetClientSize` for the area which may be used by the
5436 When a window is resized, usually only a small part of the window is
5437 damaged and and that area is all that is in the update region for the
5438 next paint event. However, if your drawing depends on the size of the
5439 window, you may need to clear the DC explicitly and repaint the whole
5440 window. In which case, you may need to call `wx.Window.Refresh` to
5441 invalidate the entire window.
5444 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5445 __repr__
= _swig_repr
5446 def __init__(self
, *args
, **kwargs
):
5448 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5450 Construct a new ``wx.SizeEvent``.
5452 _core_
.SizeEvent_swiginit(self
,_core_
.new_SizeEvent(*args
, **kwargs
))
5453 def GetSize(*args
, **kwargs
):
5455 GetSize(self) -> Size
5457 Returns the entire size of the window generating the size change
5460 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
5462 def GetRect(*args
, **kwargs
):
5463 """GetRect(self) -> Rect"""
5464 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
5466 def SetRect(*args
, **kwargs
):
5467 """SetRect(self, Rect rect)"""
5468 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
5470 def SetSize(*args
, **kwargs
):
5471 """SetSize(self, Size size)"""
5472 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
5474 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
5475 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
5476 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
5477 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
5478 _core_
.SizeEvent_swigregister(SizeEvent
)
5480 #---------------------------------------------------------------------------
5482 class MoveEvent(Event
):
5484 This event object is sent for EVT_MOVE event bindings when a window is
5485 moved to a new position.
5487 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5488 __repr__
= _swig_repr
5489 def __init__(self
, *args
, **kwargs
):
5491 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5495 _core_
.MoveEvent_swiginit(self
,_core_
.new_MoveEvent(*args
, **kwargs
))
5496 def GetPosition(*args
, **kwargs
):
5498 GetPosition(self) -> Point
5500 Returns the position of the window generating the move change event.
5502 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
5504 def GetRect(*args
, **kwargs
):
5505 """GetRect(self) -> Rect"""
5506 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
5508 def SetRect(*args
, **kwargs
):
5509 """SetRect(self, Rect rect)"""
5510 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
5512 def SetPosition(*args
, **kwargs
):
5513 """SetPosition(self, Point pos)"""
5514 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
5516 m_pos
= property(GetPosition
, SetPosition
)
5517 m_rect
= property(GetRect
, SetRect
)
5519 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
5520 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
5521 _core_
.MoveEvent_swigregister(MoveEvent
)
5523 #---------------------------------------------------------------------------
5525 class PaintEvent(Event
):
5527 A paint event is sent when a window's contents needs to be repainted.
5528 Note that in an EVT_PAINT handler the application must *always* create
5529 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5530 Windows assumes that the window has not been painted yet and will send
5531 the event again, causing endless refreshes.
5533 You can optimize painting by retrieving the rectangles that have been
5534 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5535 and only repainting these rectangles. The rectangles are in terms of
5536 the client area, and are unscrolled, so you will need to do some
5537 calculations using the current view position to obtain logical,
5541 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5542 __repr__
= _swig_repr
5543 def __init__(self
, *args
, **kwargs
):
5544 """__init__(self, int Id=0) -> PaintEvent"""
5545 _core_
.PaintEvent_swiginit(self
,_core_
.new_PaintEvent(*args
, **kwargs
))
5546 _core_
.PaintEvent_swigregister(PaintEvent
)
5548 class NcPaintEvent(Event
):
5549 """Proxy of C++ NcPaintEvent class"""
5550 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5551 __repr__
= _swig_repr
5552 def __init__(self
, *args
, **kwargs
):
5553 """__init__(self, int winid=0) -> NcPaintEvent"""
5554 _core_
.NcPaintEvent_swiginit(self
,_core_
.new_NcPaintEvent(*args
, **kwargs
))
5555 _core_
.NcPaintEvent_swigregister(NcPaintEvent
)
5557 #---------------------------------------------------------------------------
5559 class EraseEvent(Event
):
5561 An erase event is sent whenever the background of a window needs to be
5562 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5563 binder. On some platforms, such as GTK+, this event is simulated
5564 (simply generated just before the paint event) and may cause flicker.
5566 To paint a custom background use the `GetDC` method and use the returned
5567 device context if it is not ``None``, otherwise create a temporary
5568 `wx.ClientDC` and draw on that.
5571 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5572 __repr__
= _swig_repr
5573 def __init__(self
, *args
, **kwargs
):
5575 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5579 _core_
.EraseEvent_swiginit(self
,_core_
.new_EraseEvent(*args
, **kwargs
))
5580 def GetDC(*args
, **kwargs
):
5584 Returns the device context the event handler should draw upon. If
5585 ``None`` is returned then create a temporary `wx.ClientDC` and use
5588 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5590 DC
= property(GetDC
,doc
="See `GetDC`")
5591 _core_
.EraseEvent_swigregister(EraseEvent
)
5593 #---------------------------------------------------------------------------
5595 class FocusEvent(Event
):
5597 A focus event is sent when a window's focus changes. The window losing
5598 focus receives an EVT_KILL_FOCUS event while the window gaining it
5599 gets an EVT_SET_FOCUS event.
5601 Notice that the set focus event happens both when the user gives focus
5602 to the window (whether using the mouse or keyboard) and when it is
5603 done from the program itself using `wx.Window.SetFocus`.
5606 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5607 __repr__
= _swig_repr
5608 def __init__(self
, *args
, **kwargs
):
5610 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5614 _core_
.FocusEvent_swiginit(self
,_core_
.new_FocusEvent(*args
, **kwargs
))
5615 def GetWindow(*args
, **kwargs
):
5617 GetWindow(self) -> Window
5619 Returns the other window associated with this event, that is the
5620 window which had the focus before for the EVT_SET_FOCUS event and the
5621 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5623 Warning: the window returned may be None!
5625 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5627 def SetWindow(*args
, **kwargs
):
5628 """SetWindow(self, Window win)"""
5629 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5631 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
5632 _core_
.FocusEvent_swigregister(FocusEvent
)
5634 #---------------------------------------------------------------------------
5636 class ChildFocusEvent(CommandEvent
):
5638 A child focus event is sent to a (parent-)window when one of its child
5639 windows gains focus, so that the window could restore the focus back
5640 to its corresponding child if it loses it now and regains later.
5642 Notice that child window is the direct child of the window receiving
5643 the event, and so may not be the actual widget recieving focus if it
5644 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5645 to get the widget that is actually receiving focus.
5647 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5648 __repr__
= _swig_repr
5649 def __init__(self
, *args
, **kwargs
):
5651 __init__(self, Window win=None) -> ChildFocusEvent
5655 _core_
.ChildFocusEvent_swiginit(self
,_core_
.new_ChildFocusEvent(*args
, **kwargs
))
5656 def GetWindow(*args
, **kwargs
):
5658 GetWindow(self) -> Window
5660 The window, or (grand)parent of the window which has just received the
5663 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5665 Window
= property(GetWindow
,doc
="See `GetWindow`")
5666 _core_
.ChildFocusEvent_swigregister(ChildFocusEvent
)
5668 #---------------------------------------------------------------------------
5670 class ActivateEvent(Event
):
5672 An activate event is sent when a top-level window or the entire
5673 application is being activated or deactivated.
5675 A top-level window (a dialog or frame) receives an activate event when
5676 is being activated or deactivated. This is indicated visually by the
5677 title bar changing colour, and a subwindow gaining the keyboard focus.
5678 An application is activated or deactivated when one of its frames
5679 becomes activated, or a frame becomes inactivate resulting in all
5680 application frames being inactive.
5682 Please note that usually you should call event.Skip() in your handlers
5683 for these events so the default handlers will still be called, as not
5684 doing so can result in strange effects.
5687 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5688 __repr__
= _swig_repr
5689 def __init__(self
, *args
, **kwargs
):
5691 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5695 _core_
.ActivateEvent_swiginit(self
,_core_
.new_ActivateEvent(*args
, **kwargs
))
5696 def GetActive(*args
, **kwargs
):
5698 GetActive(self) -> bool
5700 Returns true if the application or window is being activated, false
5703 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5705 Active
= property(GetActive
,doc
="See `GetActive`")
5706 _core_
.ActivateEvent_swigregister(ActivateEvent
)
5708 #---------------------------------------------------------------------------
5710 class InitDialogEvent(Event
):
5712 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5713 any window when `wx.Window.InitDialog` is called. Handlers for this
5714 event can transfer data to the window, or anything else that should be
5715 done before the user begins editing the form. The default handler
5716 calls `wx.Window.TransferDataToWindow`.
5718 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5719 __repr__
= _swig_repr
5720 def __init__(self
, *args
, **kwargs
):
5722 __init__(self, int Id=0) -> InitDialogEvent
5726 _core_
.InitDialogEvent_swiginit(self
,_core_
.new_InitDialogEvent(*args
, **kwargs
))
5727 _core_
.InitDialogEvent_swigregister(InitDialogEvent
)
5729 #---------------------------------------------------------------------------
5731 class MenuEvent(Event
):
5733 This class is used for a variety of menu-related events. Note that
5734 these do not include menu command events, which are handled by sending
5735 `wx.CommandEvent` objects.
5737 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5738 text in the first field of the status bar.
5740 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5741 __repr__
= _swig_repr
5742 def __init__(self
, *args
, **kwargs
):
5744 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5748 _core_
.MenuEvent_swiginit(self
,_core_
.new_MenuEvent(*args
, **kwargs
))
5749 def GetMenuId(*args
, **kwargs
):
5751 GetMenuId(self) -> int
5753 Returns the menu identifier associated with the event. This method
5754 should be only used with the HIGHLIGHT events.
5756 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5758 def IsPopup(*args
, **kwargs
):
5760 IsPopup(self) -> bool
5762 Returns ``True`` if the menu which is being opened or closed is a
5763 popup menu, ``False`` if it is a normal one. This method should only
5764 be used with the OPEN and CLOSE events.
5766 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5768 def GetMenu(*args
, **kwargs
):
5770 GetMenu(self) -> Menu
5772 Returns the menu which is being opened or closed. This method should
5773 only be used with the OPEN and CLOSE events.
5775 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5777 Menu
= property(GetMenu
,doc
="See `GetMenu`")
5778 MenuId
= property(GetMenuId
,doc
="See `GetMenuId`")
5779 _core_
.MenuEvent_swigregister(MenuEvent
)
5781 #---------------------------------------------------------------------------
5783 class CloseEvent(Event
):
5785 This event class contains information about window and session close
5788 The handler function for EVT_CLOSE is called when the user has tried
5789 to close a a frame or dialog box using the window manager controls or
5790 the system menu. It can also be invoked by the application itself
5791 programmatically, for example by calling the `wx.Window.Close`
5794 You should check whether the application is forcing the deletion of
5795 the window using `CanVeto`. If it returns ``False``, you must destroy
5796 the window using `wx.Window.Destroy`. If the return value is ``True``,
5797 it is up to you whether you respond by destroying the window or not.
5798 For example you may wish to display a message dialog prompting to save
5799 files or to cancel the close.
5801 If you don't destroy the window, you should call `Veto` to let the
5802 calling code know that you did not destroy the window. This allows the
5803 `wx.Window.Close` function to return ``True`` or ``False`` depending
5804 on whether the close instruction was honored or not.
5806 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5807 __repr__
= _swig_repr
5808 def __init__(self
, *args
, **kwargs
):
5810 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5814 _core_
.CloseEvent_swiginit(self
,_core_
.new_CloseEvent(*args
, **kwargs
))
5815 def SetLoggingOff(*args
, **kwargs
):
5817 SetLoggingOff(self, bool logOff)
5819 Sets the 'logging off' flag.
5821 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5823 def GetLoggingOff(*args
, **kwargs
):
5825 GetLoggingOff(self) -> bool
5827 Returns ``True`` if the user is logging off or ``False`` if the
5828 system is shutting down. This method can only be called for end
5829 session and query end session events, it doesn't make sense for close
5832 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5834 def Veto(*args
, **kwargs
):
5836 Veto(self, bool veto=True)
5838 Call this from your event handler to veto a system shutdown or to
5839 signal to the calling application that a window close did not happen.
5841 You can only veto a shutdown or close if `CanVeto` returns true.
5843 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5845 def GetVeto(*args
, **kwargs
):
5846 """GetVeto(self) -> bool"""
5847 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5849 def SetCanVeto(*args
, **kwargs
):
5851 SetCanVeto(self, bool canVeto)
5853 Sets the 'can veto' flag.
5855 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5857 def CanVeto(*args
, **kwargs
):
5859 CanVeto(self) -> bool
5861 Returns true if you can veto a system shutdown or a window close
5862 event. Vetoing a window close event is not possible if the calling
5863 code wishes to force the application to exit, and so this function
5864 must be called to check this.
5866 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5868 LoggingOff
= property(GetLoggingOff
,SetLoggingOff
,doc
="See `GetLoggingOff` and `SetLoggingOff`")
5869 _core_
.CloseEvent_swigregister(CloseEvent
)
5871 #---------------------------------------------------------------------------
5873 class ShowEvent(Event
):
5874 """An EVT_SHOW event is sent when a window is shown or hidden."""
5875 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5876 __repr__
= _swig_repr
5877 def __init__(self
, *args
, **kwargs
):
5879 __init__(self, int winid=0, bool show=False) -> ShowEvent
5881 An EVT_SHOW event is sent when a window is shown or hidden.
5883 _core_
.ShowEvent_swiginit(self
,_core_
.new_ShowEvent(*args
, **kwargs
))
5884 def SetShow(*args
, **kwargs
):
5885 """SetShow(self, bool show)"""
5886 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5888 def GetShow(*args
, **kwargs
):
5889 """GetShow(self) -> bool"""
5890 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5892 Show
= property(GetShow
,SetShow
,doc
="See `GetShow` and `SetShow`")
5893 _core_
.ShowEvent_swigregister(ShowEvent
)
5895 #---------------------------------------------------------------------------
5897 class IconizeEvent(Event
):
5899 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5902 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5903 __repr__
= _swig_repr
5904 def __init__(self
, *args
, **kwargs
):
5906 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5908 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5911 _core_
.IconizeEvent_swiginit(self
,_core_
.new_IconizeEvent(*args
, **kwargs
))
5912 def Iconized(*args
, **kwargs
):
5914 Iconized(self) -> bool
5916 Returns ``True`` if the frame has been iconized, ``False`` if it has
5919 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5921 _core_
.IconizeEvent_swigregister(IconizeEvent
)
5923 #---------------------------------------------------------------------------
5925 class MaximizeEvent(Event
):
5926 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5927 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5928 __repr__
= _swig_repr
5929 def __init__(self
, *args
, **kwargs
):
5931 __init__(self, int id=0) -> MaximizeEvent
5933 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5935 _core_
.MaximizeEvent_swiginit(self
,_core_
.new_MaximizeEvent(*args
, **kwargs
))
5936 _core_
.MaximizeEvent_swigregister(MaximizeEvent
)
5938 #---------------------------------------------------------------------------
5940 class DropFilesEvent(Event
):
5942 This class is used for drop files events, that is, when files have
5943 been dropped onto the window. This functionality is only available
5944 under Windows. The window must have previously been enabled for
5945 dropping by calling `wx.Window.DragAcceptFiles`.
5947 Important note: this is a separate implementation to the more general
5948 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5949 implementation uses the older, Windows message-based approach of
5952 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5956 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5957 def __init__(self
): raise AttributeError, "No constructor defined"
5958 __repr__
= _swig_repr
5959 def GetPosition(*args
, **kwargs
):
5961 GetPosition(self) -> Point
5963 Returns the position at which the files were dropped.
5965 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5967 def GetNumberOfFiles(*args
, **kwargs
):
5969 GetNumberOfFiles(self) -> int
5971 Returns the number of files dropped.
5973 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5975 def GetFiles(*args
, **kwargs
):
5977 GetFiles(self) -> PyObject
5979 Returns a list of the filenames that were dropped.
5981 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5983 Files
= property(GetFiles
,doc
="See `GetFiles`")
5984 NumberOfFiles
= property(GetNumberOfFiles
,doc
="See `GetNumberOfFiles`")
5985 Position
= property(GetPosition
,doc
="See `GetPosition`")
5986 _core_
.DropFilesEvent_swigregister(DropFilesEvent
)
5988 #---------------------------------------------------------------------------
5990 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5991 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5992 class UpdateUIEvent(CommandEvent
):
5994 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5995 wxWidgets to give an application the chance to update various user
5998 Without update UI events, an application has to work hard to
5999 check/uncheck, enable/disable, and set the text for elements such as
6000 menu items and toolbar buttons. The code for doing this has to be
6001 mixed up with the code that is invoked when an action is invoked for a
6002 menu item or button.
6004 With update UI events, you define an event handler to look at the
6005 state of the application and change UI elements accordingly. wxWidgets
6006 will call your handler functions in idle time, so you don't have to
6007 worry where to call this code. In addition to being a clearer and more
6008 declarative method, it also means you don't have to worry whether
6009 you're updating a toolbar or menubar identifier. The same handler can
6010 update a menu item and toolbar button, if the ID values are the same.
6012 Instead of directly manipulating the menu or button, you call
6013 functions in the event object, such as `Check`. wxWidgets will
6014 determine whether such a call has been made, and which UI element to
6017 These events will work for popup menus as well as menubars. Just
6018 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6019 any UI events for the window that owns the menu.
6021 If you find that the overhead of UI update processing is affecting
6022 your application, you can do one or both of the following:
6024 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6025 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6026 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6027 receive update events. No other windows will receive update
6030 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6031 value to set the delay between updates. You may need to call
6032 `wx.Window.UpdateWindowUI` at critical points, for example when
6033 a dialog is about to be shown, in case the user sees a slight
6034 delay before windows are updated.
6036 Note that although events are sent in idle time, defining a EVT_IDLE
6037 handler for a window does not affect this because the events are sent
6038 from an internal idle handler.
6040 wxWidgets tries to optimize update events on some platforms. On
6041 Windows and GTK+, events for menubar items are only sent when the menu
6042 is about to be shown, and not in idle time.
6045 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6046 __repr__
= _swig_repr
6047 def __init__(self
, *args
, **kwargs
):
6049 __init__(self, int commandId=0) -> UpdateUIEvent
6053 _core_
.UpdateUIEvent_swiginit(self
,_core_
.new_UpdateUIEvent(*args
, **kwargs
))
6054 def GetChecked(*args
, **kwargs
):
6056 GetChecked(self) -> bool
6058 Returns ``True`` if the UI element should be checked.
6060 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
6062 def GetEnabled(*args
, **kwargs
):
6064 GetEnabled(self) -> bool
6066 Returns ``True`` if the UI element should be enabled.
6068 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
6070 def GetShown(*args
, **kwargs
):
6072 GetShown(self) -> bool
6074 Returns ``True`` if the UI element should be shown.
6076 return _core_
.UpdateUIEvent_GetShown(*args
, **kwargs
)
6078 def GetText(*args
, **kwargs
):
6080 GetText(self) -> String
6082 Returns the text that should be set for the UI element.
6084 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
6086 def GetSetText(*args
, **kwargs
):
6088 GetSetText(self) -> bool
6090 Returns ``True`` if the application has called `SetText`. For
6091 wxWidgets internal use only.
6093 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
6095 def GetSetChecked(*args
, **kwargs
):
6097 GetSetChecked(self) -> bool
6099 Returns ``True`` if the application has called `Check`. For wxWidgets
6102 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
6104 def GetSetEnabled(*args
, **kwargs
):
6106 GetSetEnabled(self) -> bool
6108 Returns ``True`` if the application has called `Enable`. For wxWidgets
6111 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
6113 def GetSetShown(*args
, **kwargs
):
6115 GetSetShown(self) -> bool
6117 Returns ``True`` if the application has called `Show`. For wxWidgets
6120 return _core_
.UpdateUIEvent_GetSetShown(*args
, **kwargs
)
6122 def Check(*args
, **kwargs
):
6124 Check(self, bool check)
6126 Check or uncheck the UI element.
6128 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
6130 def Enable(*args
, **kwargs
):
6132 Enable(self, bool enable)
6134 Enable or disable the UI element.
6136 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
6138 def Show(*args
, **kwargs
):
6140 Show(self, bool show)
6142 Show or hide the UI element.
6144 return _core_
.UpdateUIEvent_Show(*args
, **kwargs
)
6146 def SetText(*args
, **kwargs
):
6148 SetText(self, String text)
6150 Sets the text for this UI element.
6152 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
6154 def SetUpdateInterval(*args
, **kwargs
):
6156 SetUpdateInterval(long updateInterval)
6158 Sets the interval between updates in milliseconds. Set to -1 to
6159 disable updates, or to 0 to update as frequently as possible. The
6162 Use this to reduce the overhead of UI update events if your
6163 application has a lot of windows. If you set the value to -1 or
6164 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6165 at appropriate points in your application, such as when a dialog is
6168 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
6170 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
6171 def GetUpdateInterval(*args
, **kwargs
):
6173 GetUpdateInterval() -> long
6175 Returns the current interval between updates in milliseconds. -1
6176 disables updates, 0 updates as frequently as possible.
6178 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
6180 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
6181 def CanUpdate(*args
, **kwargs
):
6183 CanUpdate(Window win) -> bool
6185 Returns ``True`` if it is appropriate to update (send UI update events
6188 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6189 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6190 events were last sent in idle time, and the update interval, to
6191 determine whether events should be sent to this window now. By default
6192 this will always return true because the update mode is initially
6193 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6194 events will be sent as often as possible. You can reduce the frequency
6195 that events are sent by changing the mode and/or setting an update
6199 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
6201 CanUpdate
= staticmethod(CanUpdate
)
6202 def ResetUpdateTime(*args
, **kwargs
):
6206 Used internally to reset the last-updated time to the current time. It
6207 is assumed that update events are normally sent in idle time, so this
6208 is called at the end of idle processing.
6210 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
6212 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
6213 def SetMode(*args
, **kwargs
):
6217 Specify how wxWidgets will send update events: to all windows, or only
6218 to those which specify that they will process the events.
6220 The mode may be one of the following values:
6222 ============================= ==========================================
6223 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6224 is the default setting.
6225 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6226 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6228 ============================= ==========================================
6231 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
6233 SetMode
= staticmethod(SetMode
)
6234 def GetMode(*args
, **kwargs
):
6238 Returns a value specifying how wxWidgets will send update events: to
6239 all windows, or only to those which specify that they will process the
6242 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
6244 GetMode
= staticmethod(GetMode
)
6245 Checked
= property(GetChecked
,Check
,doc
="See `GetChecked`")
6246 Enabled
= property(GetEnabled
,Enable
,doc
="See `GetEnabled`")
6247 Shown
= property(GetShown
,Show
,doc
="See `GetShown`")
6248 Text
= property(GetText
,SetText
,doc
="See `GetText` and `SetText`")
6249 _core_
.UpdateUIEvent_swigregister(UpdateUIEvent
)
6251 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
6253 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6255 Sets the interval between updates in milliseconds. Set to -1 to
6256 disable updates, or to 0 to update as frequently as possible. The
6259 Use this to reduce the overhead of UI update events if your
6260 application has a lot of windows. If you set the value to -1 or
6261 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6262 at appropriate points in your application, such as when a dialog is
6265 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
6267 def UpdateUIEvent_GetUpdateInterval(*args
):
6269 UpdateUIEvent_GetUpdateInterval() -> long
6271 Returns the current interval between updates in milliseconds. -1
6272 disables updates, 0 updates as frequently as possible.
6274 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
)
6276 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
6278 UpdateUIEvent_CanUpdate(Window win) -> bool
6280 Returns ``True`` if it is appropriate to update (send UI update events
6283 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6284 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6285 events were last sent in idle time, and the update interval, to
6286 determine whether events should be sent to this window now. By default
6287 this will always return true because the update mode is initially
6288 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6289 events will be sent as often as possible. You can reduce the frequency
6290 that events are sent by changing the mode and/or setting an update
6294 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
6296 def UpdateUIEvent_ResetUpdateTime(*args
):
6298 UpdateUIEvent_ResetUpdateTime()
6300 Used internally to reset the last-updated time to the current time. It
6301 is assumed that update events are normally sent in idle time, so this
6302 is called at the end of idle processing.
6304 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
)
6306 def UpdateUIEvent_SetMode(*args
, **kwargs
):
6308 UpdateUIEvent_SetMode(int mode)
6310 Specify how wxWidgets will send update events: to all windows, or only
6311 to those which specify that they will process the events.
6313 The mode may be one of the following values:
6315 ============================= ==========================================
6316 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6317 is the default setting.
6318 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6319 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6321 ============================= ==========================================
6324 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
6326 def UpdateUIEvent_GetMode(*args
):
6328 UpdateUIEvent_GetMode() -> int
6330 Returns a value specifying how wxWidgets will send update events: to
6331 all windows, or only to those which specify that they will process the
6334 return _core_
.UpdateUIEvent_GetMode(*args
)
6336 #---------------------------------------------------------------------------
6338 class SysColourChangedEvent(Event
):
6340 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6341 when the user changes the colour settings using the control
6342 panel. This is only applicable under Windows.
6344 The default event handler for this event propagates the event to child
6345 windows, since Windows only sends the events to top-level windows. If
6346 intercepting this event for a top-level window, remember to call
6347 `Skip` so the the base class handler will still be executed, or to
6348 pass the event on to the window's children explicitly.
6351 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6352 __repr__
= _swig_repr
6353 def __init__(self
, *args
, **kwargs
):
6355 __init__(self) -> SysColourChangedEvent
6359 _core_
.SysColourChangedEvent_swiginit(self
,_core_
.new_SysColourChangedEvent(*args
, **kwargs
))
6360 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEvent
)
6362 #---------------------------------------------------------------------------
6364 class MouseCaptureChangedEvent(Event
):
6366 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6367 a window that loses its mouse capture. This is called even if
6368 `wx.Window.ReleaseMouse` was called by the application code. Handling
6369 this event allows an application to cater for unexpected capture
6370 releases which might otherwise confuse mouse handling code.
6372 This event is implemented under Windows only.
6374 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6375 __repr__
= _swig_repr
6376 def __init__(self
, *args
, **kwargs
):
6378 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6382 _core_
.MouseCaptureChangedEvent_swiginit(self
,_core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
))
6383 def GetCapturedWindow(*args
, **kwargs
):
6385 GetCapturedWindow(self) -> Window
6387 Returns the window that gained the capture, or ``None`` if it was a
6388 non-wxWidgets window.
6390 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
6392 CapturedWindow
= property(GetCapturedWindow
,doc
="See `GetCapturedWindow`")
6393 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent
)
6395 #---------------------------------------------------------------------------
6397 class MouseCaptureLostEvent(Event
):
6399 A mouse capture lost event is sent to a window that obtained mouse
6400 capture, which was subsequently loss due to "external" event, for
6401 example when a dialog box is shown or if another application captures
6404 If this happens, this event is sent to all windows that are on the
6405 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6406 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6407 if the capture changes because of a call to CaptureMouse or
6410 This event is currently emitted under Windows only.
6413 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6414 __repr__
= _swig_repr
6415 def __init__(self
, *args
, **kwargs
):
6417 __init__(self, int winid=0) -> MouseCaptureLostEvent
6419 A mouse capture lost event is sent to a window that obtained mouse
6420 capture, which was subsequently loss due to "external" event, for
6421 example when a dialog box is shown or if another application captures
6424 If this happens, this event is sent to all windows that are on the
6425 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6426 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6427 if the capture changes because of a call to CaptureMouse or
6430 This event is currently emitted under Windows only.
6433 _core_
.MouseCaptureLostEvent_swiginit(self
,_core_
.new_MouseCaptureLostEvent(*args
, **kwargs
))
6434 _core_
.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent
)
6436 #---------------------------------------------------------------------------
6438 class DisplayChangedEvent(Event
):
6440 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6441 resolution has changed.
6443 This event is implemented under Windows only.
6445 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6446 __repr__
= _swig_repr
6447 def __init__(self
, *args
, **kwargs
):
6448 """__init__(self) -> DisplayChangedEvent"""
6449 _core_
.DisplayChangedEvent_swiginit(self
,_core_
.new_DisplayChangedEvent(*args
, **kwargs
))
6450 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEvent
)
6452 #---------------------------------------------------------------------------
6454 class PaletteChangedEvent(Event
):
6456 An EVT_PALETTE_CHANGED event is sent when the system palette has
6457 changed, thereby giving each window a chance to redo their own to
6460 This event is implemented under Windows only.
6462 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6463 __repr__
= _swig_repr
6464 def __init__(self
, *args
, **kwargs
):
6466 __init__(self, int id=0) -> PaletteChangedEvent
6468 An EVT_PALETTE_CHANGED event is sent when the system palette has
6469 changed, thereby giving each window a chance to redo their own to
6472 This event is implemented under Windows only.
6474 _core_
.PaletteChangedEvent_swiginit(self
,_core_
.new_PaletteChangedEvent(*args
, **kwargs
))
6475 def SetChangedWindow(*args
, **kwargs
):
6476 """SetChangedWindow(self, Window win)"""
6477 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
6479 def GetChangedWindow(*args
, **kwargs
):
6480 """GetChangedWindow(self) -> Window"""
6481 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
6483 ChangedWindow
= property(GetChangedWindow
,SetChangedWindow
,doc
="See `GetChangedWindow` and `SetChangedWindow`")
6484 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEvent
)
6486 #---------------------------------------------------------------------------
6488 class QueryNewPaletteEvent(Event
):
6490 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6491 focus and should re-do its palette.
6493 This event is implemented under Windows only.
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
):
6499 __init__(self, int winid=0) -> QueryNewPaletteEvent
6503 _core_
.QueryNewPaletteEvent_swiginit(self
,_core_
.new_QueryNewPaletteEvent(*args
, **kwargs
))
6504 def SetPaletteRealized(*args
, **kwargs
):
6506 SetPaletteRealized(self, bool realized)
6508 App should set this if it changes the palette.
6510 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
6512 def GetPaletteRealized(*args
, **kwargs
):
6513 """GetPaletteRealized(self) -> bool"""
6514 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
6516 PaletteRealized
= property(GetPaletteRealized
,SetPaletteRealized
,doc
="See `GetPaletteRealized` and `SetPaletteRealized`")
6517 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent
)
6519 #---------------------------------------------------------------------------
6521 class NavigationKeyEvent(Event
):
6523 EVT_NAVIGATION_KEY events are used to control moving the focus between
6524 widgets, otherwise known as tab-traversal. You woudl normally not
6525 catch navigation events in applications as there are already
6526 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6527 it useful to send navigation events in certain situations to change
6528 the focus in certain ways, although it's probably easier to just call
6529 `wx.Window.Navigate`.
6531 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6532 __repr__
= _swig_repr
6533 def __init__(self
, *args
, **kwargs
):
6534 """__init__(self) -> NavigationKeyEvent"""
6535 _core_
.NavigationKeyEvent_swiginit(self
,_core_
.new_NavigationKeyEvent(*args
, **kwargs
))
6536 def GetDirection(*args
, **kwargs
):
6538 GetDirection(self) -> bool
6540 Returns ``True`` if the direction is forward, ``False`` otherwise.
6542 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
6544 def SetDirection(*args
, **kwargs
):
6546 SetDirection(self, bool forward)
6548 Specify the direction that the navigation should take. Usually the
6549 difference between using Tab and Shift-Tab.
6551 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
6553 def IsWindowChange(*args
, **kwargs
):
6555 IsWindowChange(self) -> bool
6557 Returns ``True`` if window change is allowed.
6559 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
6561 def SetWindowChange(*args
, **kwargs
):
6563 SetWindowChange(self, bool ischange)
6565 Specify if the navigation should be able to change parent windows.
6566 For example, changing notebook pages, etc. This is usually implemented
6567 by using Control-Tab.
6569 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
6571 def IsFromTab(*args
, **kwargs
):
6573 IsFromTab(self) -> bool
6575 Returns ``True`` if the navigation event is originated from the Tab
6578 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
6580 def SetFromTab(*args
, **kwargs
):
6582 SetFromTab(self, bool bIs)
6584 Set to true under MSW if the event was generated using the tab key.
6585 This is required for proper navogation over radio buttons.
6587 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
6589 def SetFlags(*args
, **kwargs
):
6591 SetFlags(self, long flags)
6593 Set the navigation flags to a combination of the following:
6595 * wx.NavigationKeyEvent.IsBackward
6596 * wx.NavigationKeyEvent.IsForward
6597 * wx.NavigationKeyEvent.WinChange
6598 * wx.NavigationKeyEvent.FromTab
6601 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6603 def GetCurrentFocus(*args
, **kwargs
):
6605 GetCurrentFocus(self) -> Window
6607 Returns the child window which currenty has the focus. May be
6610 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6612 def SetCurrentFocus(*args
, **kwargs
):
6614 SetCurrentFocus(self, Window win)
6616 Set the window that has the focus.
6618 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6620 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6621 IsForward
= _core_
.NavigationKeyEvent_IsForward
6622 WinChange
= _core_
.NavigationKeyEvent_WinChange
6623 FromTab
= _core_
.NavigationKeyEvent_FromTab
6624 CurrentFocus
= property(GetCurrentFocus
,SetCurrentFocus
,doc
="See `GetCurrentFocus` and `SetCurrentFocus`")
6625 Direction
= property(GetDirection
,SetDirection
,doc
="See `GetDirection` and `SetDirection`")
6626 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEvent
)
6628 #---------------------------------------------------------------------------
6630 class WindowCreateEvent(CommandEvent
):
6632 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6633 underlying GUI object) exists.
6635 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6636 __repr__
= _swig_repr
6637 def __init__(self
, *args
, **kwargs
):
6639 __init__(self, Window win=None) -> WindowCreateEvent
6641 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6642 underlying GUI object) exists.
6644 _core_
.WindowCreateEvent_swiginit(self
,_core_
.new_WindowCreateEvent(*args
, **kwargs
))
6645 def GetWindow(*args
, **kwargs
):
6647 GetWindow(self) -> Window
6649 Returns the window that this event refers to.
6651 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6653 Window
= property(GetWindow
,doc
="See `GetWindow`")
6654 _core_
.WindowCreateEvent_swigregister(WindowCreateEvent
)
6656 class WindowDestroyEvent(CommandEvent
):
6658 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6659 when the GUI window is destroyed.
6661 When a class derived from `wx.Window` is destroyed its destructor will
6662 have already run by the time this event is sent. Therefore this event
6663 will not usually be received at all by the window itself. Since it is
6664 received after the destructor has run, an object should not try to
6665 handle its own wx.WindowDestroyEvent, but it can be used to get
6666 notification of the destruction of another window.
6668 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6669 __repr__
= _swig_repr
6670 def __init__(self
, *args
, **kwargs
):
6672 __init__(self, Window win=None) -> WindowDestroyEvent
6674 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6675 when the GUI window is destroyed.
6677 When a class derived from `wx.Window` is destroyed its destructor will
6678 have already run by the time this event is sent. Therefore this event
6679 will not usually be received at all by the window itself. Since it is
6680 received after the destructor has run, an object should not try to
6681 handle its own wx.WindowDestroyEvent, but it can be used to get
6682 notification of the destruction of another window.
6684 _core_
.WindowDestroyEvent_swiginit(self
,_core_
.new_WindowDestroyEvent(*args
, **kwargs
))
6685 def GetWindow(*args
, **kwargs
):
6687 GetWindow(self) -> Window
6689 Returns the window that this event refers to.
6691 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6693 Window
= property(GetWindow
,doc
="See `GetWindow`")
6694 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEvent
)
6696 #---------------------------------------------------------------------------
6698 class ContextMenuEvent(CommandEvent
):
6700 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6701 give the application a chance to show a context (popup) menu.
6703 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6704 __repr__
= _swig_repr
6705 def __init__(self
, *args
, **kwargs
):
6707 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6711 _core_
.ContextMenuEvent_swiginit(self
,_core_
.new_ContextMenuEvent(*args
, **kwargs
))
6712 def GetPosition(*args
, **kwargs
):
6714 GetPosition(self) -> Point
6716 Returns the position (in screen coordinants) at which the menu should
6719 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6721 def SetPosition(*args
, **kwargs
):
6723 SetPosition(self, Point pos)
6725 Sets the position at which the menu should be shown.
6727 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6729 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
6730 _core_
.ContextMenuEvent_swigregister(ContextMenuEvent
)
6732 #---------------------------------------------------------------------------
6734 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6735 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6736 class IdleEvent(Event
):
6738 This class is used for EVT_IDLE events, which are generated and sent
6739 when the application *becomes* idle. In other words, the when the
6740 event queue becomes empty then idle events are sent to all windows (by
6741 default) and as long as none of them call `RequestMore` then there are
6742 no more idle events until after the system event queue has some normal
6743 events and then becomes empty again.
6745 By default, idle events are sent to all windows. If this is causing a
6746 significant overhead in your application, you can call
6747 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6748 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6749 which should receive idle events. Then idle events will only be sent
6750 to those windows and not to any others.
6752 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6753 __repr__
= _swig_repr
6754 def __init__(self
, *args
, **kwargs
):
6756 __init__(self) -> IdleEvent
6760 _core_
.IdleEvent_swiginit(self
,_core_
.new_IdleEvent(*args
, **kwargs
))
6761 def RequestMore(*args
, **kwargs
):
6763 RequestMore(self, bool needMore=True)
6765 Tells wxWidgets that more processing is required. This function can be
6766 called by an EVT_IDLE handler for a window to indicate that the
6767 application should forward the EVT_IDLE event once more to the
6768 application windows. If no window calls this function during its
6769 EVT_IDLE handler, then the application will remain in a passive event
6770 loop until a new event is posted to the application by the windowing
6773 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6775 def MoreRequested(*args
, **kwargs
):
6777 MoreRequested(self) -> bool
6779 Returns ``True`` if the OnIdle function processing this event
6780 requested more processing time.
6782 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6784 def SetMode(*args
, **kwargs
):
6788 Static method for specifying how wxWidgets will send idle events: to
6789 all windows, or only to those which specify that they will process the
6792 The mode can be one of the following values:
6794 ========================= ========================================
6795 wx.IDLE_PROCESS_ALL Send idle events to all windows
6796 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6797 the wx.WS_EX_PROCESS_IDLE extra style
6799 ========================= ========================================
6802 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6804 SetMode
= staticmethod(SetMode
)
6805 def GetMode(*args
, **kwargs
):
6809 Static method returning a value specifying how wxWidgets will send
6810 idle events: to all windows, or only to those which specify that they
6811 will process the events.
6813 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6815 GetMode
= staticmethod(GetMode
)
6816 def CanSend(*args
, **kwargs
):
6818 CanSend(Window win) -> bool
6820 Returns ``True`` if it is appropriate to send idle events to this
6823 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6824 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6825 events should be sent to this window now. By default this will always
6826 return ``True`` because the update mode is initially
6827 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6828 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6830 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6832 CanSend
= staticmethod(CanSend
)
6833 _core_
.IdleEvent_swigregister(IdleEvent
)
6835 def IdleEvent_SetMode(*args
, **kwargs
):
6837 IdleEvent_SetMode(int mode)
6839 Static method for specifying how wxWidgets will send idle events: to
6840 all windows, or only to those which specify that they will process the
6843 The mode can be one of the following values:
6845 ========================= ========================================
6846 wx.IDLE_PROCESS_ALL Send idle events to all windows
6847 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6848 the wx.WS_EX_PROCESS_IDLE extra style
6850 ========================= ========================================
6853 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6855 def IdleEvent_GetMode(*args
):
6857 IdleEvent_GetMode() -> int
6859 Static method returning a value specifying how wxWidgets will send
6860 idle events: to all windows, or only to those which specify that they
6861 will process the events.
6863 return _core_
.IdleEvent_GetMode(*args
)
6865 def IdleEvent_CanSend(*args
, **kwargs
):
6867 IdleEvent_CanSend(Window win) -> bool
6869 Returns ``True`` if it is appropriate to send idle events to this
6872 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6873 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6874 events should be sent to this window now. By default this will always
6875 return ``True`` because the update mode is initially
6876 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6877 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6879 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6881 #---------------------------------------------------------------------------
6883 class ClipboardTextEvent(CommandEvent
):
6885 A Clipboard Text event is sent when a window intercepts a text
6886 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6887 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6888 popup menu command, etc. NOTE : under windows these events are *NOT*
6889 generated automatically for a Rich Edit text control.
6891 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6892 __repr__
= _swig_repr
6893 def __init__(self
, *args
, **kwargs
):
6895 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6897 A Clipboard Text event is sent when a window intercepts a text
6898 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6899 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6900 popup menu command, etc. NOTE : under windows these events are *NOT*
6901 generated automatically for a Rich Edit text control.
6903 _core_
.ClipboardTextEvent_swiginit(self
,_core_
.new_ClipboardTextEvent(*args
, **kwargs
))
6904 _core_
.ClipboardTextEvent_swigregister(ClipboardTextEvent
)
6906 #---------------------------------------------------------------------------
6908 class PyEvent(Event
):
6910 wx.PyEvent can be used as a base class for implementing custom event
6911 types in Python. You should derived from this class instead of
6912 `wx.Event` because this class is Python-aware and is able to transport
6913 its Python bits safely through the wxWidgets event system and have
6914 them still be there when the event handler is invoked.
6916 :see: `wx.PyCommandEvent`
6919 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6920 __repr__
= _swig_repr
6921 def __init__(self
, *args
, **kwargs
):
6922 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6923 _core_
.PyEvent_swiginit(self
,_core_
.new_PyEvent(*args
, **kwargs
))
6926 __swig_destroy__
= _core_
.delete_PyEvent
6927 __del__
= lambda self
: None;
6928 def _SetSelf(*args
, **kwargs
):
6929 """_SetSelf(self, PyObject self)"""
6930 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6932 def _GetSelf(*args
, **kwargs
):
6933 """_GetSelf(self) -> PyObject"""
6934 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6936 _core_
.PyEvent_swigregister(PyEvent
)
6938 class PyCommandEvent(CommandEvent
):
6940 wx.PyCommandEvent can be used as a base class for implementing custom
6941 event types in Python, where the event shoudl travel up to parent
6942 windows looking for a handler. You should derived from this class
6943 instead of `wx.CommandEvent` because this class is Python-aware and is
6944 able to transport its Python bits safely through the wxWidgets event
6945 system and have them still be there when the event handler is invoked.
6950 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6951 __repr__
= _swig_repr
6952 def __init__(self
, *args
, **kwargs
):
6953 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6954 _core_
.PyCommandEvent_swiginit(self
,_core_
.new_PyCommandEvent(*args
, **kwargs
))
6957 __swig_destroy__
= _core_
.delete_PyCommandEvent
6958 __del__
= lambda self
: None;
6959 def _SetSelf(*args
, **kwargs
):
6960 """_SetSelf(self, PyObject self)"""
6961 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6963 def _GetSelf(*args
, **kwargs
):
6964 """_GetSelf(self) -> PyObject"""
6965 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6967 _core_
.PyCommandEvent_swigregister(PyCommandEvent
)
6969 class DateEvent(CommandEvent
):
6971 This event class holds information about a date change event and is
6972 used together with `wx.DatePickerCtrl`. It also serves as a base class
6973 for `wx.calendar.CalendarEvent`. Bind these event types with
6976 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6977 __repr__
= _swig_repr
6978 def __init__(self
, *args
, **kwargs
):
6979 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6980 _core_
.DateEvent_swiginit(self
,_core_
.new_DateEvent(*args
, **kwargs
))
6981 def GetDate(*args
, **kwargs
):
6983 GetDate(self) -> DateTime
6987 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6989 def SetDate(*args
, **kwargs
):
6991 SetDate(self, DateTime date)
6993 Sets the date carried by the event, normally only used by the library
6996 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
6998 Date
= property(GetDate
,SetDate
,doc
="See `GetDate` and `SetDate`")
6999 _core_
.DateEvent_swigregister(DateEvent
)
7001 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
7002 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
7004 class EventBlocker(EvtHandler
):
7005 """Helper class to temporarily disable event handling for a window."""
7006 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7007 __repr__
= _swig_repr
7008 def __init__(self
, *args
, **kwargs
):
7010 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7012 Helper class to temporarily disable event handling for a window.
7014 _core_
.EventBlocker_swiginit(self
,_core_
.new_EventBlocker(*args
, **kwargs
))
7015 __swig_destroy__
= _core_
.delete_EventBlocker
7016 __del__
= lambda self
: None;
7017 def Block(*args
, **kwargs
):
7018 """Block(self, EventType type)"""
7019 return _core_
.EventBlocker_Block(*args
, **kwargs
)
7021 _core_
.EventBlocker_swigregister(EventBlocker
)
7023 #---------------------------------------------------------------------------
7025 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
7026 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
7027 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
7028 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
7029 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
7030 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
7031 class PyApp(EvtHandler
):
7033 The ``wx.PyApp`` class is an *implementation detail*, please use the
7034 `wx.App` class (or some other derived class) instead.
7036 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7037 __repr__
= _swig_repr
7038 def __init__(self
, *args
, **kwargs
):
7040 __init__(self) -> PyApp
7042 Create a new application object, starting the bootstrap process.
7044 _core_
.PyApp_swiginit(self
,_core_
.new_PyApp(*args
, **kwargs
))
7045 self
._setOORInfo
(self
, False);PyApp
._setCallbackInfo
(self
, self
, PyApp
)
7047 __swig_destroy__
= _core_
.delete_PyApp
7048 __del__
= lambda self
: None;
7049 def _setCallbackInfo(*args
, **kwargs
):
7050 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
7051 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
7053 def GetAppName(*args
, **kwargs
):
7055 GetAppName(self) -> String
7057 Get the application name.
7059 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
7061 def SetAppName(*args
, **kwargs
):
7063 SetAppName(self, String name)
7065 Set the application name. This value may be used automatically by
7066 `wx.Config` and such.
7068 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
7070 def GetClassName(*args
, **kwargs
):
7072 GetClassName(self) -> String
7074 Get the application's class name.
7076 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
7078 def SetClassName(*args
, **kwargs
):
7080 SetClassName(self, String name)
7082 Set the application's class name. This value may be used for
7083 X-resources if applicable for the platform
7085 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
7087 def GetVendorName(*args
, **kwargs
):
7089 GetVendorName(self) -> String
7091 Get the application's vendor name.
7093 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
7095 def SetVendorName(*args
, **kwargs
):
7097 SetVendorName(self, String name)
7099 Set the application's vendor name. This value may be used
7100 automatically by `wx.Config` and such.
7102 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
7104 def GetTraits(*args
, **kwargs
):
7106 GetTraits(self) -> wxAppTraits
7108 Return (and create if necessary) the app traits object to which we
7109 delegate for everything which either should be configurable by the
7110 user (then he can change the default behaviour simply by overriding
7111 CreateTraits() and returning his own traits object) or which is
7112 GUI/console dependent as then wx.AppTraits allows us to abstract the
7113 differences behind the common facade.
7115 :todo: Add support for overriding CreateAppTraits in wxPython.
7117 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
7119 def ProcessPendingEvents(*args
, **kwargs
):
7121 ProcessPendingEvents(self)
7123 Process all events in the Pending Events list -- it is necessary to
7124 call this function to process posted events. This normally happens
7125 during each event loop iteration.
7127 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
7129 def Yield(*args
, **kwargs
):
7131 Yield(self, bool onlyIfNeeded=False) -> bool
7133 Process all currently pending events right now, instead of waiting
7134 until return to the event loop. It is an error to call ``Yield``
7135 recursively unless the value of ``onlyIfNeeded`` is True.
7137 :warning: This function is dangerous as it can lead to unexpected
7138 reentrancies (i.e. when called from an event handler it may
7139 result in calling the same event handler again), use with
7140 extreme care or, better, don't use at all!
7142 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
7145 return _core_
.PyApp_Yield(*args
, **kwargs
)
7147 def WakeUpIdle(*args
, **kwargs
):
7151 Make sure that idle events are sent again.
7152 :see: `wx.WakeUpIdle`
7154 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
7156 def IsMainLoopRunning(*args
, **kwargs
):
7158 IsMainLoopRunning() -> bool
7160 Returns True if we're running the main loop, i.e. if the events can
7161 currently be dispatched.
7163 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
7165 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
7166 def MainLoop(*args
, **kwargs
):
7168 MainLoop(self) -> int
7170 Execute the main GUI loop, the function doesn't normally return until
7171 all top level windows have been closed and destroyed.
7173 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
7175 def Exit(*args
, **kwargs
):
7179 Exit the main loop thus terminating the application.
7182 return _core_
.PyApp_Exit(*args
, **kwargs
)
7184 def GetLayoutDirection(*args
, **kwargs
):
7186 GetLayoutDirection(self) -> int
7188 Return the layout direction for the current locale.
7190 return _core_
.PyApp_GetLayoutDirection(*args
, **kwargs
)
7192 def ExitMainLoop(*args
, **kwargs
):
7196 Exit the main GUI loop during the next iteration of the main
7197 loop, (i.e. it does not stop the program immediately!)
7199 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
7201 def Pending(*args
, **kwargs
):
7203 Pending(self) -> bool
7205 Returns True if there are unprocessed events in the event queue.
7207 return _core_
.PyApp_Pending(*args
, **kwargs
)
7209 def Dispatch(*args
, **kwargs
):
7211 Dispatch(self) -> bool
7213 Process the first event in the event queue (blocks until an event
7214 appears if there are none currently)
7216 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
7218 def ProcessIdle(*args
, **kwargs
):
7220 ProcessIdle(self) -> bool
7222 Called from the MainLoop when the application becomes idle (there are
7223 no pending events) and sends a `wx.IdleEvent` to all interested
7224 parties. Returns True if more idle events are needed, False if not.
7226 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
7228 def SendIdleEvents(*args
, **kwargs
):
7230 SendIdleEvents(self, Window win, IdleEvent event) -> bool
7232 Send idle event to window and all subwindows. Returns True if more
7233 idle time is requested.
7235 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
7237 def IsActive(*args
, **kwargs
):
7239 IsActive(self) -> bool
7241 Return True if our app has focus.
7243 return _core_
.PyApp_IsActive(*args
, **kwargs
)
7245 def SetTopWindow(*args
, **kwargs
):
7247 SetTopWindow(self, Window win)
7249 Set the *main* top level window
7251 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
7253 def GetTopWindow(*args
, **kwargs
):
7255 GetTopWindow(self) -> Window
7257 Return the *main* top level window (if it hadn't been set previously
7258 with SetTopWindow(), will return just some top level window and, if
7259 there not any, will return None)
7261 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
7263 def SetExitOnFrameDelete(*args
, **kwargs
):
7265 SetExitOnFrameDelete(self, bool flag)
7267 Control the exit behaviour: by default, the program will exit the main
7268 loop (and so, usually, terminate) when the last top-level program
7269 window is deleted. Beware that if you disable this behaviour (with
7270 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7271 explicitly from somewhere.
7273 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
7275 def GetExitOnFrameDelete(*args
, **kwargs
):
7277 GetExitOnFrameDelete(self) -> bool
7279 Get the current exit behaviour setting.
7281 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
7283 def SetUseBestVisual(*args
, **kwargs
):
7285 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
7287 Set whether the app should try to use the best available visual on
7288 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
7290 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
7292 def GetUseBestVisual(*args
, **kwargs
):
7294 GetUseBestVisual(self) -> bool
7296 Get current UseBestVisual setting.
7298 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
7300 def SetPrintMode(*args
, **kwargs
):
7301 """SetPrintMode(self, int mode)"""
7302 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
7304 def GetPrintMode(*args
, **kwargs
):
7305 """GetPrintMode(self) -> int"""
7306 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
7308 def SetAssertMode(*args
, **kwargs
):
7310 SetAssertMode(self, int mode)
7312 Set the OnAssert behaviour for debug and hybrid builds.
7314 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
7316 def GetAssertMode(*args
, **kwargs
):
7318 GetAssertMode(self) -> int
7320 Get the current OnAssert behaviour setting.
7322 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
7324 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7325 """GetMacSupportPCMenuShortcuts() -> bool"""
7326 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7328 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
7329 def GetMacAboutMenuItemId(*args
, **kwargs
):
7330 """GetMacAboutMenuItemId() -> long"""
7331 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
7333 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
7334 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
7335 """GetMacPreferencesMenuItemId() -> long"""
7336 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
7338 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
7339 def GetMacExitMenuItemId(*args
, **kwargs
):
7340 """GetMacExitMenuItemId() -> long"""
7341 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
7343 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
7344 def GetMacHelpMenuTitleName(*args
, **kwargs
):
7345 """GetMacHelpMenuTitleName() -> String"""
7346 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
7348 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
7349 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7350 """SetMacSupportPCMenuShortcuts(bool val)"""
7351 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7353 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
7354 def SetMacAboutMenuItemId(*args
, **kwargs
):
7355 """SetMacAboutMenuItemId(long val)"""
7356 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7358 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
7359 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
7360 """SetMacPreferencesMenuItemId(long val)"""
7361 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7363 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
7364 def SetMacExitMenuItemId(*args
, **kwargs
):
7365 """SetMacExitMenuItemId(long val)"""
7366 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7368 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
7369 def SetMacHelpMenuTitleName(*args
, **kwargs
):
7370 """SetMacHelpMenuTitleName(String val)"""
7371 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7373 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
7374 def _BootstrapApp(*args
, **kwargs
):
7378 For internal use only
7380 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
7382 def GetComCtl32Version(*args
, **kwargs
):
7384 GetComCtl32Version() -> int
7386 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7387 it wasn't found at all. Raises an exception on non-Windows platforms.
7389 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
7391 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
7392 def IsDisplayAvailable(*args
, **kwargs
):
7394 IsDisplayAvailable() -> bool
7396 Tests if it is possible to create a GUI in the current environment.
7397 This will mean different things on the different platforms.
7399 * On X Windows systems this function will return ``False`` if it is
7400 not able to open a connection to the X display, which can happen
7401 if $DISPLAY is not set, or is not set correctly.
7403 * On Mac OS X a ``False`` return value will mean that wx is not
7404 able to access the window manager, which can happen if logged in
7405 remotely or if running from the normal version of python instead
7406 of the framework version, (i.e., pythonw.)
7411 return _core_
.PyApp_IsDisplayAvailable(*args
, **kwargs
)
7413 IsDisplayAvailable
= staticmethod(IsDisplayAvailable
)
7414 AppName
= property(GetAppName
,SetAppName
,doc
="See `GetAppName` and `SetAppName`")
7415 AssertMode
= property(GetAssertMode
,SetAssertMode
,doc
="See `GetAssertMode` and `SetAssertMode`")
7416 ClassName
= property(GetClassName
,SetClassName
,doc
="See `GetClassName` and `SetClassName`")
7417 ExitOnFrameDelete
= property(GetExitOnFrameDelete
,SetExitOnFrameDelete
,doc
="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7418 LayoutDirection
= property(GetLayoutDirection
,doc
="See `GetLayoutDirection`")
7419 PrintMode
= property(GetPrintMode
,SetPrintMode
,doc
="See `GetPrintMode` and `SetPrintMode`")
7420 TopWindow
= property(GetTopWindow
,SetTopWindow
,doc
="See `GetTopWindow` and `SetTopWindow`")
7421 Traits
= property(GetTraits
,doc
="See `GetTraits`")
7422 UseBestVisual
= property(GetUseBestVisual
,SetUseBestVisual
,doc
="See `GetUseBestVisual` and `SetUseBestVisual`")
7423 VendorName
= property(GetVendorName
,SetVendorName
,doc
="See `GetVendorName` and `SetVendorName`")
7424 Active
= property(IsActive
)
7425 _core_
.PyApp_swigregister(PyApp
)
7427 def PyApp_IsMainLoopRunning(*args
):
7429 PyApp_IsMainLoopRunning() -> bool
7431 Returns True if we're running the main loop, i.e. if the events can
7432 currently be dispatched.
7434 return _core_
.PyApp_IsMainLoopRunning(*args
)
7436 def PyApp_GetMacSupportPCMenuShortcuts(*args
):
7437 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7438 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
)
7440 def PyApp_GetMacAboutMenuItemId(*args
):
7441 """PyApp_GetMacAboutMenuItemId() -> long"""
7442 return _core_
.PyApp_GetMacAboutMenuItemId(*args
)
7444 def PyApp_GetMacPreferencesMenuItemId(*args
):
7445 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7446 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
)
7448 def PyApp_GetMacExitMenuItemId(*args
):
7449 """PyApp_GetMacExitMenuItemId() -> long"""
7450 return _core_
.PyApp_GetMacExitMenuItemId(*args
)
7452 def PyApp_GetMacHelpMenuTitleName(*args
):
7453 """PyApp_GetMacHelpMenuTitleName() -> String"""
7454 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
)
7456 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7457 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7458 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7460 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
7461 """PyApp_SetMacAboutMenuItemId(long val)"""
7462 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7464 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
7465 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7466 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7468 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
7469 """PyApp_SetMacExitMenuItemId(long val)"""
7470 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7472 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
7473 """PyApp_SetMacHelpMenuTitleName(String val)"""
7474 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7476 def PyApp_GetComCtl32Version(*args
):
7478 PyApp_GetComCtl32Version() -> int
7480 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7481 it wasn't found at all. Raises an exception on non-Windows platforms.
7483 return _core_
.PyApp_GetComCtl32Version(*args
)
7485 def PyApp_IsDisplayAvailable(*args
):
7487 PyApp_IsDisplayAvailable() -> bool
7489 Tests if it is possible to create a GUI in the current environment.
7490 This will mean different things on the different platforms.
7492 * On X Windows systems this function will return ``False`` if it is
7493 not able to open a connection to the X display, which can happen
7494 if $DISPLAY is not set, or is not set correctly.
7496 * On Mac OS X a ``False`` return value will mean that wx is not
7497 able to access the window manager, which can happen if logged in
7498 remotely or if running from the normal version of python instead
7499 of the framework version, (i.e., pythonw.)
7504 return _core_
.PyApp_IsDisplayAvailable(*args
)
7506 #---------------------------------------------------------------------------
7513 Force an exit of the application. Convenience for wx.GetApp().Exit()
7515 return _core_
.Exit(*args
)
7521 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7523 return _core_
.Yield(*args
)
7525 def YieldIfNeeded(*args
):
7527 YieldIfNeeded() -> bool
7529 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7531 return _core_
.YieldIfNeeded(*args
)
7533 def SafeYield(*args
, **kwargs
):
7535 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7537 This function is similar to `wx.Yield`, except that it disables the
7538 user input to all program windows before calling `wx.Yield` and
7539 re-enables it again afterwards. If ``win`` is not None, this window
7540 will remain enabled, allowing the implementation of some limited user
7543 :Returns: the result of the call to `wx.Yield`.
7545 return _core_
.SafeYield(*args
, **kwargs
)
7547 def WakeUpIdle(*args
):
7551 Cause the message queue to become empty again, so idle events will be
7554 return _core_
.WakeUpIdle(*args
)
7556 def PostEvent(*args
, **kwargs
):
7558 PostEvent(EvtHandler dest, Event event)
7560 Send an event to a window or other wx.EvtHandler to be processed
7563 return _core_
.PostEvent(*args
, **kwargs
)
7565 def App_CleanUp(*args
):
7569 For internal use only, it is used to cleanup after wxWidgets when
7572 return _core_
.App_CleanUp(*args
)
7578 Return a reference to the current wx.App object.
7580 return _core_
.GetApp(*args
)
7582 def SetDefaultPyEncoding(*args
, **kwargs
):
7584 SetDefaultPyEncoding(string encoding)
7586 Sets the encoding that wxPython will use when it needs to convert a
7587 Python string or unicode object to or from a wxString.
7589 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7590 but please be aware that the default encoding within the same locale
7591 may be slightly different on different platforms. For example, please
7592 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7593 between the common latin/roman encodings.
7595 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
7597 def GetDefaultPyEncoding(*args
):
7599 GetDefaultPyEncoding() -> string
7601 Gets the current encoding that wxPython will use when it needs to
7602 convert a Python string or unicode object to or from a wxString.
7604 return _core_
.GetDefaultPyEncoding(*args
)
7605 #----------------------------------------------------------------------
7607 class PyOnDemandOutputWindow
:
7609 A class that can be used for redirecting Python's stdout and
7610 stderr streams. It will do nothing until something is wrriten to
7611 the stream at which point it will create a Frame with a text area
7612 and write the text there.
7614 def __init__(self
, title
= "wxPython: stdout/stderr"):
7617 self
.pos
= wx
.DefaultPosition
7618 self
.size
= (450, 300)
7621 def SetParent(self
, parent
):
7622 """Set the window to be used as the popup Frame's parent."""
7623 self
.parent
= parent
7626 def CreateOutputWindow(self
, st
):
7627 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
7628 style
=wx
.DEFAULT_FRAME_STYLE
)
7629 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
7630 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
7631 self
.text
.AppendText(st
)
7632 self
.frame
.Show(True)
7633 self
.frame
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
7636 def OnCloseWindow(self
, event
):
7637 if self
.frame
is not None:
7638 self
.frame
.Destroy()
7643 # These methods provide the file-like output behaviour.
7644 def write(self
, text
):
7646 Create the output window if needed and write the string to it.
7647 If not called in the context of the gui thread then uses
7648 CallAfter to do the work there.
7650 if self
.frame
is None:
7651 if not wx
.Thread_IsMain():
7652 wx
.CallAfter(self
.CreateOutputWindow
, text
)
7654 self
.CreateOutputWindow(text
)
7656 if not wx
.Thread_IsMain():
7657 wx
.CallAfter(self
.text
.AppendText
, text
)
7659 self
.text
.AppendText(text
)
7663 if self
.frame
is not None:
7664 wx
.CallAfter(self
.frame
.Close
)
7672 #----------------------------------------------------------------------
7674 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
7676 class App(wx
.PyApp
):
7678 The ``wx.App`` class represents the application and is used to:
7680 * bootstrap the wxPython system and initialize the underlying
7682 * set and get application-wide properties
7683 * implement the windowing system main message or event loop,
7684 and to dispatch events to window instances
7687 Every application must have a ``wx.App`` instance, and all
7688 creation of UI objects should be delayed until after the
7689 ``wx.App`` object has been created in order to ensure that the gui
7690 platform and wxWidgets have been fully initialized.
7692 Normally you would derive from this class and implement an
7693 ``OnInit`` method that creates a frame and then calls
7694 ``self.SetTopWindow(frame)``.
7696 :see: `wx.PySimpleApp` for a simpler app class that can be used
7700 outputWindowClass
= PyOnDemandOutputWindow
7702 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7703 useBestVisual
=False, clearSigInt
=True):
7705 Construct a ``wx.App`` object.
7707 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7708 redirected? Defaults to True on Windows and Mac, False
7709 otherwise. If `filename` is None then output will be
7710 redirected to a window that pops up as needed. (You can
7711 control what kind of window is created for the output by
7712 resetting the class variable ``outputWindowClass`` to a
7713 class of your choosing.)
7715 :param filename: The name of a file to redirect output to, if
7718 :param useBestVisual: Should the app try to use the best
7719 available visual provided by the system (only relevant on
7720 systems that have more than one visual.) This parameter
7721 must be used instead of calling `SetUseBestVisual` later
7722 on because it must be set before the underlying GUI
7723 toolkit is initialized.
7725 :param clearSigInt: Should SIGINT be cleared? This allows the
7726 app to terminate upon a Ctrl-C in the console like other
7729 :note: You should override OnInit to do applicaition
7730 initialization to ensure that the system, toolkit and
7731 wxWidgets are fully initialized.
7734 wx
.PyApp
.__init
__(self
)
7736 # make sure we can create a GUI
7737 if not self
.IsDisplayAvailable():
7739 if wx
.Platform
== "__WXMAC__":
7740 msg
= """This program needs access to the screen.
7741 Please run with 'pythonw', not 'python', and only when you are logged
7742 in on the main display of your Mac."""
7744 elif wx
.Platform
== "__WXGTK__":
7745 msg
="Unable to access the X Display, is $DISPLAY set properly?"
7748 msg
= "Unable to create GUI"
7749 # TODO: more description is needed for wxMSW...
7751 raise SystemExit(msg
)
7753 # This has to be done before OnInit
7754 self
.SetUseBestVisual(useBestVisual
)
7756 # Set the default handler for SIGINT. This fixes a problem
7757 # where if Ctrl-C is pressed in the console that started this
7758 # app then it will not appear to do anything, (not even send
7759 # KeyboardInterrupt???) but will later segfault on exit. By
7760 # setting the default handler then the app will exit, as
7761 # expected (depending on platform.)
7765 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7769 # Save and redirect the stdio to a window?
7770 self
.stdioWin
= None
7771 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7773 self
.RedirectStdio(filename
)
7775 # Use Python's install prefix as the default
7776 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7778 # Until the new native control for wxMac is up to par, still use the generic one.
7779 wx
.SystemOptions
.SetOptionInt("mac.listctrl.always_use_generic", 1)
7781 # This finishes the initialization of wxWindows and then calls
7782 # the OnInit that should be present in the derived class
7783 self
._BootstrapApp
()
7786 def OnPreInit(self
):
7788 Things that must be done after _BootstrapApp has done its
7789 thing, but would be nice if they were already done by the time
7790 that OnInit is called.
7792 wx
.StockGDI
._initStockObjects
()
7795 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7796 self
.RestoreStdio() # Just in case the MainLoop was overridden
7800 self
.this
.own(False)
7801 wx
.PyApp
.Destroy(self
)
7803 def SetTopWindow(self
, frame
):
7804 """Set the \"main\" top level window"""
7806 self
.stdioWin
.SetParent(frame
)
7807 wx
.PyApp
.SetTopWindow(self
, frame
)
7811 """Execute the main GUI event loop"""
7812 wx
.PyApp
.MainLoop(self
)
7816 def RedirectStdio(self
, filename
=None):
7817 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7819 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7821 self
.stdioWin
= self
.outputWindowClass()
7822 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7825 def RestoreStdio(self
):
7827 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7832 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7834 Set the title, position and/or size of the output window if
7835 the stdio has been redirected. This should be called before
7836 any output would cause the output window to be created.
7839 if title
is not None:
7840 self
.stdioWin
.title
= title
7842 self
.stdioWin
.pos
= pos
7843 if size
is not None:
7844 self
.stdioWin
.size
= size
7849 # change from wx.PyApp_XX to wx.App_XX
7850 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7851 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7852 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7853 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7854 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7855 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7856 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7857 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7858 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7859 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7860 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7862 #----------------------------------------------------------------------------
7864 class PySimpleApp(wx
.App
):
7866 A simple application class. You can just create one of these and
7867 then then make your top level windows later, and not have to worry
7868 about OnInit. For example::
7870 app = wx.PySimpleApp()
7871 frame = wx.Frame(None, title='Hello World')
7878 def __init__(self
, redirect
=False, filename
=None,
7879 useBestVisual
=False, clearSigInt
=True):
7881 :see: `wx.App.__init__`
7883 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7890 # Is anybody using this one?
7891 class PyWidgetTester(wx
.App
):
7892 def __init__(self
, size
= (250, 100)):
7894 wx
.App
.__init
__(self
, 0)
7897 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7898 self
.SetTopWindow(self
.frame
)
7901 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7902 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7903 self
.frame
.Show(True)
7905 #----------------------------------------------------------------------------
7906 # DO NOT hold any other references to this object. This is how we
7907 # know when to cleanup system resources that wxWidgets is holding. When
7908 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7909 # goes to zero and it calls the wx.App_CleanUp function.
7911 class __wxPyCleanup
:
7913 self
.cleanup
= _core_
.App_CleanUp
7917 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7919 ## # another possible solution, but it gets called too early...
7921 ## atexit.register(_core_.wxApp_CleanUp)
7924 #----------------------------------------------------------------------------
7926 #---------------------------------------------------------------------------
7928 class EventLoop(object):
7929 """Proxy of C++ EventLoop class"""
7930 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7931 __repr__
= _swig_repr
7932 def __init__(self
, *args
, **kwargs
):
7933 """__init__(self) -> EventLoop"""
7934 _core_
.EventLoop_swiginit(self
,_core_
.new_EventLoop(*args
, **kwargs
))
7935 __swig_destroy__
= _core_
.delete_EventLoop
7936 __del__
= lambda self
: None;
7937 def Run(*args
, **kwargs
):
7938 """Run(self) -> int"""
7939 return _core_
.EventLoop_Run(*args
, **kwargs
)
7941 def Exit(*args
, **kwargs
):
7942 """Exit(self, int rc=0)"""
7943 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7945 def Pending(*args
, **kwargs
):
7946 """Pending(self) -> bool"""
7947 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7949 def Dispatch(*args
, **kwargs
):
7950 """Dispatch(self) -> bool"""
7951 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7953 def IsRunning(*args
, **kwargs
):
7954 """IsRunning(self) -> bool"""
7955 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7957 def GetActive(*args
, **kwargs
):
7958 """GetActive() -> EventLoop"""
7959 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7961 GetActive
= staticmethod(GetActive
)
7962 def SetActive(*args
, **kwargs
):
7963 """SetActive(EventLoop loop)"""
7964 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7966 SetActive
= staticmethod(SetActive
)
7967 _core_
.EventLoop_swigregister(EventLoop
)
7969 def EventLoop_GetActive(*args
):
7970 """EventLoop_GetActive() -> EventLoop"""
7971 return _core_
.EventLoop_GetActive(*args
)
7973 def EventLoop_SetActive(*args
, **kwargs
):
7974 """EventLoop_SetActive(EventLoop loop)"""
7975 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7977 class EventLoopActivator(object):
7978 """Proxy of C++ EventLoopActivator class"""
7979 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7980 __repr__
= _swig_repr
7981 def __init__(self
, *args
, **kwargs
):
7982 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7983 _core_
.EventLoopActivator_swiginit(self
,_core_
.new_EventLoopActivator(*args
, **kwargs
))
7984 __swig_destroy__
= _core_
.delete_EventLoopActivator
7985 __del__
= lambda self
: None;
7986 _core_
.EventLoopActivator_swigregister(EventLoopActivator
)
7988 #---------------------------------------------------------------------------
7990 ACCEL_ALT
= _core_
.ACCEL_ALT
7991 ACCEL_CTRL
= _core_
.ACCEL_CTRL
7992 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
7993 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
7994 ACCEL_CMD
= _core_
.ACCEL_CMD
7995 class AcceleratorEntry(object):
7997 A class used to define items in an `wx.AcceleratorTable`. wxPython
7998 programs can choose to use wx.AcceleratorEntry objects, but using a
7999 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
8000 as well. See `__init__` for of the tuple values.
8002 :see: `wx.AcceleratorTable`
8004 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8005 __repr__
= _swig_repr
8006 def __init__(self
, *args
, **kwargs
):
8008 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
8010 Construct a wx.AcceleratorEntry.
8012 _core_
.AcceleratorEntry_swiginit(self
,_core_
.new_AcceleratorEntry(*args
, **kwargs
))
8013 __swig_destroy__
= _core_
.delete_AcceleratorEntry
8014 __del__
= lambda self
: None;
8015 def Set(*args
, **kwargs
):
8017 Set(self, int flags, int keyCode, int cmd)
8019 (Re)set the attributes of a wx.AcceleratorEntry.
8022 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
8024 def Create(*args
, **kwargs
):
8026 Create(String str) -> AcceleratorEntry
8028 Create accelerator corresponding to the specified string, or None if
8029 it coulnd't be parsed.
8031 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
8033 Create
= staticmethod(Create
)
8034 def GetFlags(*args
, **kwargs
):
8036 GetFlags(self) -> int
8038 Get the AcceleratorEntry's flags.
8040 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
8042 def GetKeyCode(*args
, **kwargs
):
8044 GetKeyCode(self) -> int
8046 Get the AcceleratorEntry's keycode.
8048 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
8050 def GetCommand(*args
, **kwargs
):
8052 GetCommand(self) -> int
8054 Get the AcceleratorEntry's command ID.
8056 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
8058 def IsOk(*args
, **kwargs
):
8059 """IsOk(self) -> bool"""
8060 return _core_
.AcceleratorEntry_IsOk(*args
, **kwargs
)
8062 def ToString(*args
, **kwargs
):
8064 ToString(self) -> String
8066 Returns a string representation for the this accelerator. The string
8067 is formatted using the <flags>-<keycode> format where <flags> maybe a
8068 hyphen-separed list of "shift|alt|ctrl"
8071 return _core_
.AcceleratorEntry_ToString(*args
, **kwargs
)
8073 def FromString(*args
, **kwargs
):
8075 FromString(self, String str) -> bool
8077 Returns true if the given string correctly initialized this object.
8079 return _core_
.AcceleratorEntry_FromString(*args
, **kwargs
)
8081 Command
= property(GetCommand
,doc
="See `GetCommand`")
8082 Flags
= property(GetFlags
,doc
="See `GetFlags`")
8083 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
8084 _core_
.AcceleratorEntry_swigregister(AcceleratorEntry
)
8086 def AcceleratorEntry_Create(*args
, **kwargs
):
8088 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8090 Create accelerator corresponding to the specified string, or None if
8091 it coulnd't be parsed.
8093 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
8095 class AcceleratorTable(Object
):
8097 An accelerator table allows the application to specify a table of
8098 keyboard shortcuts for menus or other commands. On Windows, menu or
8099 button commands are supported; on GTK, only menu commands are
8102 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8103 __repr__
= _swig_repr
8104 def __init__(self
, *args
, **kwargs
):
8106 __init__(entries) -> AcceleratorTable
8108 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8109 items or or of 3-tuples (flags, keyCode, cmdID)
8111 :see: `wx.AcceleratorEntry`
8113 _core_
.AcceleratorTable_swiginit(self
,_core_
.new_AcceleratorTable(*args
, **kwargs
))
8114 __swig_destroy__
= _core_
.delete_AcceleratorTable
8115 __del__
= lambda self
: None;
8116 def IsOk(*args
, **kwargs
):
8117 """IsOk(self) -> bool"""
8118 return _core_
.AcceleratorTable_IsOk(*args
, **kwargs
)
8121 _core_
.AcceleratorTable_swigregister(AcceleratorTable
)
8123 def GetAccelFromString(label
):
8124 entry
= AcceleratorEntry()
8125 entry
.FromString(label
)
8128 #---------------------------------------------------------------------------
8130 class VisualAttributes(object):
8131 """struct containing all the visual attributes of a control"""
8132 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8133 __repr__
= _swig_repr
8134 def __init__(self
, *args
, **kwargs
):
8136 __init__(self) -> VisualAttributes
8138 struct containing all the visual attributes of a control
8140 _core_
.VisualAttributes_swiginit(self
,_core_
.new_VisualAttributes(*args
, **kwargs
))
8141 __swig_destroy__
= _core_
.delete_VisualAttributes
8142 __del__
= lambda self
: None;
8143 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
8144 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
8145 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
8146 _core_
.VisualAttributes_swigregister(VisualAttributes
)
8147 NullAcceleratorTable
= cvar
.NullAcceleratorTable
8148 PanelNameStr
= cvar
.PanelNameStr
8150 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
8151 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
8152 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
8153 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
8154 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
8155 class Window(EvtHandler
):
8157 wx.Window is the base class for all windows and represents any visible
8158 object on the screen. All controls, top level windows and so on are
8159 wx.Windows. Sizers and device contexts are not however, as they don't
8160 appear on screen themselves.
8163 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8164 __repr__
= _swig_repr
8165 def __init__(self
, *args
, **kwargs
):
8167 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8168 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
8170 Construct and show a generic Window.
8172 _core_
.Window_swiginit(self
,_core_
.new_Window(*args
, **kwargs
))
8173 self
._setOORInfo
(self
)
8175 def Create(*args
, **kwargs
):
8177 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8178 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
8180 Create the GUI part of the Window for 2-phase creation mode.
8182 return _core_
.Window_Create(*args
, **kwargs
)
8184 def Close(*args
, **kwargs
):
8186 Close(self, bool force=False) -> bool
8188 This function simply generates a EVT_CLOSE event whose handler usually
8189 tries to close the window. It doesn't close the window itself,
8190 however. If force is False (the default) then the window's close
8191 handler will be allowed to veto the destruction of the window.
8193 return _core_
.Window_Close(*args
, **kwargs
)
8195 def Destroy(*args
, **kwargs
):
8197 Destroy(self) -> bool
8199 Destroys the window safely. Frames and dialogs are not destroyed
8200 immediately when this function is called -- they are added to a list
8201 of windows to be deleted on idle time, when all the window's events
8202 have been processed. This prevents problems with events being sent to
8203 non-existent windows.
8205 Returns True if the window has either been successfully deleted, or it
8206 has been added to the list of windows pending real deletion.
8208 args
[0].this
.own(False)
8209 return _core_
.Window_Destroy(*args
, **kwargs
)
8211 def DestroyChildren(*args
, **kwargs
):
8213 DestroyChildren(self) -> bool
8215 Destroys all children of a window. Called automatically by the
8218 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
8220 def IsBeingDeleted(*args
, **kwargs
):
8222 IsBeingDeleted(self) -> bool
8224 Is the window in the process of being deleted?
8226 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
8228 def SetLabel(*args
, **kwargs
):
8230 SetLabel(self, String label)
8232 Set the text which the window shows in its label if applicable.
8234 return _core_
.Window_SetLabel(*args
, **kwargs
)
8236 def GetLabel(*args
, **kwargs
):
8238 GetLabel(self) -> String
8240 Generic way of getting a label from any window, for identification
8241 purposes. The interpretation of this function differs from class to
8242 class. For frames and dialogs, the value returned is the title. For
8243 buttons or static text controls, it is the button text. This function
8244 can be useful for meta-programs such as testing tools or special-needs
8245 access programs)which need to identify windows by name.
8247 return _core_
.Window_GetLabel(*args
, **kwargs
)
8249 def SetName(*args
, **kwargs
):
8251 SetName(self, String name)
8253 Sets the window's name. The window name is used for ressource setting
8254 in X, it is not the same as the window title/label
8256 return _core_
.Window_SetName(*args
, **kwargs
)
8258 def GetName(*args
, **kwargs
):
8260 GetName(self) -> String
8262 Returns the windows name. This name is not guaranteed to be unique;
8263 it is up to the programmer to supply an appropriate name in the window
8264 constructor or via wx.Window.SetName.
8266 return _core_
.Window_GetName(*args
, **kwargs
)
8268 def SetWindowVariant(*args
, **kwargs
):
8270 SetWindowVariant(self, int variant)
8272 Sets the variant of the window/font size to use for this window, if
8273 the platform supports variants, for example, wxMac.
8275 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
8277 def GetWindowVariant(*args
, **kwargs
):
8278 """GetWindowVariant(self) -> int"""
8279 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
8281 def SetId(*args
, **kwargs
):
8283 SetId(self, int winid)
8285 Sets the identifier of the window. Each window has an integer
8286 identifier. If the application has not provided one, an identifier
8287 will be generated. Normally, the identifier should be provided on
8288 creation and should not be modified subsequently.
8290 return _core_
.Window_SetId(*args
, **kwargs
)
8292 def GetId(*args
, **kwargs
):
8296 Returns the identifier of the window. Each window has an integer
8297 identifier. If the application has not provided one (or the default Id
8298 -1 is used) then an unique identifier with a negative value will be
8301 return _core_
.Window_GetId(*args
, **kwargs
)
8303 def NewControlId(*args
, **kwargs
):
8305 NewControlId() -> int
8307 Generate a control id for the controls which were not given one.
8309 return _core_
.Window_NewControlId(*args
, **kwargs
)
8311 NewControlId
= staticmethod(NewControlId
)
8312 def NextControlId(*args
, **kwargs
):
8314 NextControlId(int winid) -> int
8316 Get the id of the control following the one with the given
8319 return _core_
.Window_NextControlId(*args
, **kwargs
)
8321 NextControlId
= staticmethod(NextControlId
)
8322 def PrevControlId(*args
, **kwargs
):
8324 PrevControlId(int winid) -> int
8326 Get the id of the control preceding the one with the given
8329 return _core_
.Window_PrevControlId(*args
, **kwargs
)
8331 PrevControlId
= staticmethod(PrevControlId
)
8332 def GetLayoutDirection(*args
, **kwargs
):
8334 GetLayoutDirection(self) -> int
8336 Get the layout direction (LTR or RTL) for this window. Returns
8337 ``wx.Layout_Default`` if layout direction is not supported.
8339 return _core_
.Window_GetLayoutDirection(*args
, **kwargs
)
8341 def SetLayoutDirection(*args
, **kwargs
):
8343 SetLayoutDirection(self, int dir)
8345 Set the layout direction (LTR or RTL) for this window.
8347 return _core_
.Window_SetLayoutDirection(*args
, **kwargs
)
8349 def AdjustForLayoutDirection(*args
, **kwargs
):
8351 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8353 Mirror coordinates for RTL layout if this window uses it and if the
8354 mirroring is not done automatically like Win32.
8356 return _core_
.Window_AdjustForLayoutDirection(*args
, **kwargs
)
8358 def SetSize(*args
, **kwargs
):
8360 SetSize(self, Size size)
8362 Sets the size of the window in pixels.
8364 return _core_
.Window_SetSize(*args
, **kwargs
)
8366 def SetDimensions(*args
, **kwargs
):
8368 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8370 Sets the position and size of the window in pixels. The sizeFlags
8371 parameter indicates the interpretation of the other params if they are
8374 ======================== ======================================
8375 wx.SIZE_AUTO A -1 indicates that a class-specific
8376 default should be used.
8377 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8378 -1 values are supplied.
8379 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8380 interpreted as real dimensions, not
8382 ======================== ======================================
8385 return _core_
.Window_SetDimensions(*args
, **kwargs
)
8387 def SetRect(*args
, **kwargs
):
8389 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8391 Sets the position and size of the window in pixels using a wx.Rect.
8393 return _core_
.Window_SetRect(*args
, **kwargs
)
8395 def SetSizeWH(*args
, **kwargs
):
8397 SetSizeWH(self, int width, int height)
8399 Sets the size of the window in pixels.
8401 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
8403 def Move(*args
, **kwargs
):
8405 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8407 Moves the window to the given position.
8409 return _core_
.Window_Move(*args
, **kwargs
)
8412 def MoveXY(*args
, **kwargs
):
8414 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8416 Moves the window to the given position.
8418 return _core_
.Window_MoveXY(*args
, **kwargs
)
8420 def SetInitialSize(*args
, **kwargs
):
8422 SetInitialSize(self, Size size=DefaultSize)
8424 A 'Smart' SetSize that will fill in default size components with the
8425 window's *best size* values. Also set's the minsize for use with sizers.
8427 return _core_
.Window_SetInitialSize(*args
, **kwargs
)
8429 SetBestFittingSize
= wx
._deprecated
(SetInitialSize
, 'Use `SetInitialSize`')
8430 def Raise(*args
, **kwargs
):
8434 Raises the window to the top of the window hierarchy. In current
8435 version of wxWidgets this works both for managed and child windows.
8437 return _core_
.Window_Raise(*args
, **kwargs
)
8439 def Lower(*args
, **kwargs
):
8443 Lowers the window to the bottom of the window hierarchy. In current
8444 version of wxWidgets this works both for managed and child windows.
8446 return _core_
.Window_Lower(*args
, **kwargs
)
8448 def SetClientSize(*args
, **kwargs
):
8450 SetClientSize(self, Size size)
8452 This sets the size of the window client area in pixels. Using this
8453 function to size a window tends to be more device-independent than
8454 wx.Window.SetSize, since the application need not worry about what
8455 dimensions the border or title bar have when trying to fit the window
8456 around panel items, for example.
8458 return _core_
.Window_SetClientSize(*args
, **kwargs
)
8460 def SetClientSizeWH(*args
, **kwargs
):
8462 SetClientSizeWH(self, int width, int height)
8464 This sets the size of the window client area in pixels. Using this
8465 function to size a window tends to be more device-independent than
8466 wx.Window.SetSize, since the application need not worry about what
8467 dimensions the border or title bar have when trying to fit the window
8468 around panel items, for example.
8470 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
8472 def SetClientRect(*args
, **kwargs
):
8474 SetClientRect(self, Rect rect)
8476 This sets the size of the window client area in pixels. Using this
8477 function to size a window tends to be more device-independent than
8478 wx.Window.SetSize, since the application need not worry about what
8479 dimensions the border or title bar have when trying to fit the window
8480 around panel items, for example.
8482 return _core_
.Window_SetClientRect(*args
, **kwargs
)
8484 def GetPosition(*args
, **kwargs
):
8486 GetPosition(self) -> Point
8488 Get the window's position. Notice that the position is in client
8489 coordinates for child windows and screen coordinates for the top level
8490 ones, use `GetScreenPosition` if you need screen coordinates for all
8493 return _core_
.Window_GetPosition(*args
, **kwargs
)
8495 def GetPositionTuple(*args
, **kwargs
):
8497 GetPositionTuple() -> (x,y)
8499 Get the window's position. Notice that the position is in client
8500 coordinates for child windows and screen coordinates for the top level
8501 ones, use `GetScreenPosition` if you need screen coordinates for all
8504 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
8506 def GetScreenPosition(*args
, **kwargs
):
8508 GetScreenPosition(self) -> Point
8510 Get the position of the window in screen coordinantes.
8512 return _core_
.Window_GetScreenPosition(*args
, **kwargs
)
8514 def GetScreenPositionTuple(*args
, **kwargs
):
8516 GetScreenPositionTuple() -> (x,y)
8518 Get the position of the window in screen coordinantes.
8520 return _core_
.Window_GetScreenPositionTuple(*args
, **kwargs
)
8522 def GetScreenRect(*args
, **kwargs
):
8524 GetScreenRect(self) -> Rect
8526 Returns the size and position of the window in screen coordinantes as
8529 return _core_
.Window_GetScreenRect(*args
, **kwargs
)
8531 def GetSize(*args
, **kwargs
):
8533 GetSize(self) -> Size
8535 Get the window size.
8537 return _core_
.Window_GetSize(*args
, **kwargs
)
8539 def GetSizeTuple(*args
, **kwargs
):
8541 GetSizeTuple() -> (width, height)
8543 Get the window size.
8545 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
8547 def GetRect(*args
, **kwargs
):
8549 GetRect(self) -> Rect
8551 Returns the size and position of the window as a `wx.Rect` object.
8553 return _core_
.Window_GetRect(*args
, **kwargs
)
8555 def GetClientSize(*args
, **kwargs
):
8557 GetClientSize(self) -> Size
8559 This gets the size of the window's 'client area' in pixels. The client
8560 area is the area which may be drawn on by the programmer, excluding
8561 title bar, border, scrollbars, etc.
8563 return _core_
.Window_GetClientSize(*args
, **kwargs
)
8565 def GetClientSizeTuple(*args
, **kwargs
):
8567 GetClientSizeTuple() -> (width, height)
8569 This gets the size of the window's 'client area' in pixels. The client
8570 area is the area which may be drawn on by the programmer, excluding
8571 title bar, border, scrollbars, etc.
8573 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
8575 def GetClientAreaOrigin(*args
, **kwargs
):
8577 GetClientAreaOrigin(self) -> Point
8579 Get the origin of the client area of the window relative to the
8580 window's top left corner (the client area may be shifted because of
8581 the borders, scrollbars, other decorations...)
8583 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
8585 def GetClientRect(*args
, **kwargs
):
8587 GetClientRect(self) -> Rect
8589 Get the client area position and size as a `wx.Rect` object.
8591 return _core_
.Window_GetClientRect(*args
, **kwargs
)
8593 def GetBestSize(*args
, **kwargs
):
8595 GetBestSize(self) -> Size
8597 This function returns the best acceptable minimal size for the
8598 window, if applicable. For example, for a static text control, it will
8599 be the minimal size such that the control label is not truncated. For
8600 windows containing subwindows (suzh aswx.Panel), the size returned by
8601 this function will be the same as the size the window would have had
8604 return _core_
.Window_GetBestSize(*args
, **kwargs
)
8606 def GetBestSizeTuple(*args
, **kwargs
):
8608 GetBestSizeTuple() -> (width, height)
8610 This function returns the best acceptable minimal size for the
8611 window, if applicable. For example, for a static text control, it will
8612 be the minimal size such that the control label is not truncated. For
8613 windows containing subwindows (suzh aswx.Panel), the size returned by
8614 this function will be the same as the size the window would have had
8617 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
8619 def InvalidateBestSize(*args
, **kwargs
):
8621 InvalidateBestSize(self)
8623 Reset the cached best size value so it will be recalculated the next
8626 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
8628 def CacheBestSize(*args
, **kwargs
):
8630 CacheBestSize(self, Size size)
8632 Cache the best size so it doesn't need to be calculated again, (at least until
8633 some properties of the window change.)
8635 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
8637 def GetEffectiveMinSize(*args
, **kwargs
):
8639 GetEffectiveMinSize(self) -> Size
8641 This function will merge the window's best size into the window's
8642 minimum size, giving priority to the min size components, and returns
8646 return _core_
.Window_GetEffectiveMinSize(*args
, **kwargs
)
8648 GetBestFittingSize
= wx
._deprecated
(GetEffectiveMinSize
, 'Use `GetEffectiveMinSize` instead.')
8649 def GetAdjustedBestSize(self
):
8650 s
= self
.GetBestSize()
8651 return wx
.Size(max(s
.width
, self
.GetMinWidth()),
8652 max(s
.height
, self
.GetMinHeight()))
8653 GetAdjustedBestSize
= wx
._deprecated
(GetAdjustedBestSize
, 'Use `GetEffectiveMinSize` instead.')
8655 def Center(*args
, **kwargs
):
8657 Center(self, int direction=BOTH)
8659 Centers the window. The parameter specifies the direction for
8660 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8661 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8662 on the entire screen and not on its parent window. If it is a
8663 top-level window and has no parent then it will always be centered
8664 relative to the screen.
8666 return _core_
.Window_Center(*args
, **kwargs
)
8669 def CenterOnParent(*args
, **kwargs
):
8671 CenterOnParent(self, int dir=BOTH)
8673 Center with respect to the the parent window
8675 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
8677 CentreOnParent
= CenterOnParent
8678 def Fit(*args
, **kwargs
):
8682 Sizes the window so that it fits around its subwindows. This function
8683 won't do anything if there are no subwindows and will only really work
8684 correctly if sizers are used for the subwindows layout. Also, if the
8685 window has exactly one subwindow it is better (faster and the result
8686 is more precise as Fit adds some margin to account for fuzziness of
8687 its calculations) to call window.SetClientSize(child.GetSize())
8688 instead of calling Fit.
8690 return _core_
.Window_Fit(*args
, **kwargs
)
8692 def FitInside(*args
, **kwargs
):
8696 Similar to Fit, but sizes the interior (virtual) size of a
8697 window. Mainly useful with scrolled windows to reset scrollbars after
8698 sizing changes that do not trigger a size event, and/or scrolled
8699 windows without an interior sizer. This function similarly won't do
8700 anything if there are no subwindows.
8702 return _core_
.Window_FitInside(*args
, **kwargs
)
8704 def SetSizeHints(*args
, **kwargs
):
8706 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8709 Allows specification of minimum and maximum window sizes, and window
8710 size increments. If a pair of values is not set (or set to -1), the
8711 default values will be used. If this function is called, the user
8712 will not be able to size the window outside the given bounds (if it is
8713 a top-level window.) Sizers will also inspect the minimum window size
8714 and will use that value if set when calculating layout.
8716 The resizing increments are only significant under Motif or Xt.
8718 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
8720 def SetSizeHintsSz(*args
, **kwargs
):
8722 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8724 Allows specification of minimum and maximum window sizes, and window
8725 size increments. If a pair of values is not set (or set to -1), the
8726 default values will be used. If this function is called, the user
8727 will not be able to size the window outside the given bounds (if it is
8728 a top-level window.) Sizers will also inspect the minimum window size
8729 and will use that value if set when calculating layout.
8731 The resizing increments are only significant under Motif or Xt.
8733 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
8735 def SetVirtualSizeHints(*args
, **kwargs
):
8737 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8739 Allows specification of minimum and maximum virtual window sizes. If a
8740 pair of values is not set (or set to -1), the default values will be
8741 used. If this function is called, the user will not be able to size
8742 the virtual area of the window outside the given bounds.
8744 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
8746 def SetVirtualSizeHintsSz(*args
, **kwargs
):
8748 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8750 Allows specification of minimum and maximum virtual window sizes. If a
8751 pair of values is not set (or set to -1), the default values will be
8752 used. If this function is called, the user will not be able to size
8753 the virtual area of the window outside the given bounds.
8755 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
8757 def GetMaxSize(*args
, **kwargs
):
8758 """GetMaxSize(self) -> Size"""
8759 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8761 def GetMinSize(*args
, **kwargs
):
8762 """GetMinSize(self) -> Size"""
8763 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8765 def SetMinSize(*args
, **kwargs
):
8767 SetMinSize(self, Size minSize)
8769 A more convenient method than `SetSizeHints` for setting just the
8772 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8774 def SetMaxSize(*args
, **kwargs
):
8776 SetMaxSize(self, Size maxSize)
8778 A more convenient method than `SetSizeHints` for setting just the
8781 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8783 def GetMinWidth(*args
, **kwargs
):
8784 """GetMinWidth(self) -> int"""
8785 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8787 def GetMinHeight(*args
, **kwargs
):
8788 """GetMinHeight(self) -> int"""
8789 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8791 def GetMaxWidth(*args
, **kwargs
):
8792 """GetMaxWidth(self) -> int"""
8793 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8795 def GetMaxHeight(*args
, **kwargs
):
8796 """GetMaxHeight(self) -> int"""
8797 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8799 def SetVirtualSize(*args
, **kwargs
):
8801 SetVirtualSize(self, Size size)
8803 Set the the virtual size of a window in pixels. For most windows this
8804 is just the client area of the window, but for some like scrolled
8805 windows it is more or less independent of the screen window size.
8807 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8809 def SetVirtualSizeWH(*args
, **kwargs
):
8811 SetVirtualSizeWH(self, int w, int h)
8813 Set the the virtual size of a window in pixels. For most windows this
8814 is just the client area of the window, but for some like scrolled
8815 windows it is more or less independent of the screen window size.
8817 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8819 def GetVirtualSize(*args
, **kwargs
):
8821 GetVirtualSize(self) -> Size
8823 Get the the virtual size of the window in pixels. For most windows
8824 this is just the client area of the window, but for some like scrolled
8825 windows it is more or less independent of the screen window size.
8827 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8829 def GetVirtualSizeTuple(*args
, **kwargs
):
8831 GetVirtualSizeTuple() -> (width, height)
8833 Get the the virtual size of the window in pixels. For most windows
8834 this is just the client area of the window, but for some like scrolled
8835 windows it is more or less independent of the screen window size.
8837 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8839 def GetWindowBorderSize(*args
, **kwargs
):
8841 GetWindowBorderSize(self) -> Size
8843 Return the size of the left/right and top/bottom borders.
8845 return _core_
.Window_GetWindowBorderSize(*args
, **kwargs
)
8847 def GetBestVirtualSize(*args
, **kwargs
):
8849 GetBestVirtualSize(self) -> Size
8851 Return the largest of ClientSize and BestSize (as determined by a
8852 sizer, interior children, or other means)
8854 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8856 def Show(*args
, **kwargs
):
8858 Show(self, bool show=True) -> bool
8860 Shows or hides the window. You may need to call Raise for a top level
8861 window if you want to bring it to top, although this is not needed if
8862 Show is called immediately after the frame creation. Returns True if
8863 the window has been shown or hidden or False if nothing was done
8864 because it already was in the requested state.
8866 return _core_
.Window_Show(*args
, **kwargs
)
8868 def Hide(*args
, **kwargs
):
8872 Equivalent to calling Show(False).
8874 return _core_
.Window_Hide(*args
, **kwargs
)
8876 def Enable(*args
, **kwargs
):
8878 Enable(self, bool enable=True) -> bool
8880 Enable or disable the window for user input. Note that when a parent
8881 window is disabled, all of its children are disabled as well and they
8882 are reenabled again when the parent is. Returns true if the window
8883 has been enabled or disabled, false if nothing was done, i.e. if the
8884 window had already been in the specified state.
8886 return _core_
.Window_Enable(*args
, **kwargs
)
8888 def Disable(*args
, **kwargs
):
8890 Disable(self) -> bool
8892 Disables the window, same as Enable(false).
8894 return _core_
.Window_Disable(*args
, **kwargs
)
8896 def IsShown(*args
, **kwargs
):
8898 IsShown(self) -> bool
8900 Returns true if the window is shown, false if it has been hidden.
8902 return _core_
.Window_IsShown(*args
, **kwargs
)
8904 def IsEnabled(*args
, **kwargs
):
8906 IsEnabled(self) -> bool
8908 Returns true if the window is enabled for input, false otherwise.
8909 This method takes into account the enabled state of parent windows up
8910 to the top-level window.
8912 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8914 def IsThisEnabled(*args
, **kwargs
):
8916 IsThisEnabled(self) -> bool
8918 Returns the internal enabled state independent of the parent(s) state,
8919 i.e. the state in which the window would be if all of its parents are
8920 enabled. Use `IsEnabled` to get the effective window state.
8922 return _core_
.Window_IsThisEnabled(*args
, **kwargs
)
8924 def IsShownOnScreen(*args
, **kwargs
):
8926 IsShownOnScreen(self) -> bool
8928 Returns ``True`` if the window is physically visible on the screen,
8929 i.e. it is shown and all its parents up to the toplevel window are
8932 return _core_
.Window_IsShownOnScreen(*args
, **kwargs
)
8934 def SetWindowStyleFlag(*args
, **kwargs
):
8936 SetWindowStyleFlag(self, long style)
8938 Sets the style of the window. Please note that some styles cannot be
8939 changed after the window creation and that Refresh() might need to be
8940 called after changing the others for the change to take place
8943 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8945 def GetWindowStyleFlag(*args
, **kwargs
):
8947 GetWindowStyleFlag(self) -> long
8949 Gets the window style that was passed to the constructor or Create
8952 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8954 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8955 def HasFlag(*args
, **kwargs
):
8957 HasFlag(self, int flag) -> bool
8959 Test if the given style is set for this window.
8961 return _core_
.Window_HasFlag(*args
, **kwargs
)
8963 def IsRetained(*args
, **kwargs
):
8965 IsRetained(self) -> bool
8967 Returns true if the window is retained, false otherwise. Retained
8968 windows are only available on X platforms.
8970 return _core_
.Window_IsRetained(*args
, **kwargs
)
8972 def ToggleWindowStyle(*args
, **kwargs
):
8974 ToggleWindowStyle(self, int flag) -> bool
8976 Turn the flag on if it had been turned off before and vice versa,
8977 returns True if the flag is turned on by this function call.
8979 return _core_
.Window_ToggleWindowStyle(*args
, **kwargs
)
8981 def SetExtraStyle(*args
, **kwargs
):
8983 SetExtraStyle(self, long exStyle)
8985 Sets the extra style bits for the window. Extra styles are the less
8986 often used style bits which can't be set with the constructor or with
8987 SetWindowStyleFlag()
8989 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8991 def GetExtraStyle(*args
, **kwargs
):
8993 GetExtraStyle(self) -> long
8995 Returns the extra style bits for the window.
8997 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
8999 def MakeModal(*args
, **kwargs
):
9001 MakeModal(self, bool modal=True)
9003 Disables all other windows in the application so that the user can
9004 only interact with this window. Passing False will reverse this
9007 return _core_
.Window_MakeModal(*args
, **kwargs
)
9009 def SetThemeEnabled(*args
, **kwargs
):
9011 SetThemeEnabled(self, bool enableTheme)
9013 This function tells a window if it should use the system's "theme"
9014 code to draw the windows' background instead if its own background
9015 drawing code. This will only have an effect on platforms that support
9016 the notion of themes in user defined windows. One such platform is
9017 GTK+ where windows can have (very colourful) backgrounds defined by a
9018 user's selected theme.
9020 Dialogs, notebook pages and the status bar have this flag set to true
9021 by default so that the default look and feel is simulated best.
9023 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
9025 def GetThemeEnabled(*args
, **kwargs
):
9027 GetThemeEnabled(self) -> bool
9029 Return the themeEnabled flag.
9031 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
9033 def SetFocus(*args
, **kwargs
):
9037 Set's the focus to this window, allowing it to receive keyboard input.
9039 return _core_
.Window_SetFocus(*args
, **kwargs
)
9041 def SetFocusFromKbd(*args
, **kwargs
):
9043 SetFocusFromKbd(self)
9045 Set focus to this window as the result of a keyboard action. Normally
9046 only called internally.
9048 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
9050 def FindFocus(*args
, **kwargs
):
9052 FindFocus() -> Window
9054 Returns the window or control that currently has the keyboard focus,
9057 return _core_
.Window_FindFocus(*args
, **kwargs
)
9059 FindFocus
= staticmethod(FindFocus
)
9060 def AcceptsFocus(*args
, **kwargs
):
9062 AcceptsFocus(self) -> bool
9064 Can this window have focus?
9066 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
9068 def CanAcceptFocus(*args
, **kwargs
):
9070 CanAcceptFocus(self) -> bool
9072 Can this window have focus right now?
9074 return _core_
.Window_CanAcceptFocus(*args
, **kwargs
)
9076 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
9078 AcceptsFocusFromKeyboard(self) -> bool
9080 Can this window be given focus by keyboard navigation? if not, the
9081 only way to give it focus (provided it accepts it at all) is to click
9084 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
9086 def CanAcceptFocusFromKeyboard(*args
, **kwargs
):
9088 CanAcceptFocusFromKeyboard(self) -> bool
9090 Can this window be assigned focus from keyboard right now?
9092 return _core_
.Window_CanAcceptFocusFromKeyboard(*args
, **kwargs
)
9094 def NavigateIn(*args
, **kwargs
):
9096 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9098 Navigates inside this window.
9100 return _core_
.Window_NavigateIn(*args
, **kwargs
)
9102 def Navigate(*args
, **kwargs
):
9104 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9106 Does keyboard navigation starting from this window to another. This is
9107 equivalient to self.GetParent().NavigateIn().
9109 return _core_
.Window_Navigate(*args
, **kwargs
)
9111 def MoveAfterInTabOrder(*args
, **kwargs
):
9113 MoveAfterInTabOrder(self, Window win)
9115 Moves this window in the tab navigation order after the specified
9116 sibling window. This means that when the user presses the TAB key on
9117 that other window, the focus switches to this window.
9119 The default tab order is the same as creation order. This function
9120 and `MoveBeforeInTabOrder` allow to change it after creating all the
9124 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
9126 def MoveBeforeInTabOrder(*args
, **kwargs
):
9128 MoveBeforeInTabOrder(self, Window win)
9130 Same as `MoveAfterInTabOrder` except that it inserts this window just
9131 before win instead of putting it right after it.
9133 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
9135 def GetChildren(*args
, **kwargs
):
9137 GetChildren(self) -> PyObject
9139 Returns a list of the window's children. NOTE: Currently this is a
9140 copy of the child window list maintained by the window, so the return
9141 value of this function is only valid as long as the window's children
9144 return _core_
.Window_GetChildren(*args
, **kwargs
)
9146 def GetParent(*args
, **kwargs
):
9148 GetParent(self) -> Window
9150 Returns the parent window of this window, or None if there isn't one.
9152 return _core_
.Window_GetParent(*args
, **kwargs
)
9154 def GetGrandParent(*args
, **kwargs
):
9156 GetGrandParent(self) -> Window
9158 Returns the parent of the parent of this window, or None if there
9161 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
9163 def GetTopLevelParent(*args
, **kwargs
):
9165 GetTopLevelParent(self) -> Window
9167 Returns the first frame or dialog in this window's parental hierarchy.
9169 return _core_
.Window_GetTopLevelParent(*args
, **kwargs
)
9171 def IsTopLevel(*args
, **kwargs
):
9173 IsTopLevel(self) -> bool
9175 Returns true if the given window is a top-level one. Currently all
9176 frames and dialogs are always considered to be top-level windows (even
9177 if they have a parent window).
9179 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
9181 def Reparent(*args
, **kwargs
):
9183 Reparent(self, Window newParent) -> bool
9185 Reparents the window, i.e the window will be removed from its current
9186 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9187 re-inserted into another. Available on Windows and GTK. Returns True
9188 if the parent was changed, False otherwise (error or newParent ==
9191 return _core_
.Window_Reparent(*args
, **kwargs
)
9193 def AddChild(*args
, **kwargs
):
9195 AddChild(self, Window child)
9197 Adds a child window. This is called automatically by window creation
9198 functions so should not be required by the application programmer.
9200 return _core_
.Window_AddChild(*args
, **kwargs
)
9202 def RemoveChild(*args
, **kwargs
):
9204 RemoveChild(self, Window child)
9206 Removes a child window. This is called automatically by window
9207 deletion functions so should not be required by the application
9210 return _core_
.Window_RemoveChild(*args
, **kwargs
)
9212 def SetDoubleBuffered(*args
, **kwargs
):
9214 SetDoubleBuffered(self, bool on)
9216 Currently wxGTK2 only.
9218 return _core_
.Window_SetDoubleBuffered(*args
, **kwargs
)
9220 def FindWindowById(*args
, **kwargs
):
9222 FindWindowById(self, long winid) -> Window
9224 Find a chld of this window by window ID
9226 return _core_
.Window_FindWindowById(*args
, **kwargs
)
9228 def FindWindowByName(*args
, **kwargs
):
9230 FindWindowByName(self, String name) -> Window
9232 Find a child of this window by name
9234 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
9236 def GetEventHandler(*args
, **kwargs
):
9238 GetEventHandler(self) -> EvtHandler
9240 Returns the event handler for this window. By default, the window is
9241 its own event handler.
9243 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
9245 def SetEventHandler(*args
, **kwargs
):
9247 SetEventHandler(self, EvtHandler handler)
9249 Sets the event handler for this window. An event handler is an object
9250 that is capable of processing the events sent to a window. (In other
9251 words, is able to dispatch the events to handler function.) By
9252 default, the window is its own event handler, but an application may
9253 wish to substitute another, for example to allow central
9254 implementation of event-handling for a variety of different window
9257 It is usually better to use `wx.Window.PushEventHandler` since this sets
9258 up a chain of event handlers, where an event not handled by one event
9259 handler is handed off to the next one in the chain.
9261 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
9263 def PushEventHandler(*args
, **kwargs
):
9265 PushEventHandler(self, EvtHandler handler)
9267 Pushes this event handler onto the event handler stack for the window.
9268 An event handler is an object that is capable of processing the events
9269 sent to a window. (In other words, is able to dispatch the events to
9270 handler function.) By default, the window is its own event handler,
9271 but an application may wish to substitute another, for example to
9272 allow central implementation of event-handling for a variety of
9273 different window classes.
9275 wx.Window.PushEventHandler allows an application to set up a chain of
9276 event handlers, where an event not handled by one event handler is
9277 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9278 to remove the event handler. Ownership of the handler is *not* given
9279 to the window, so you should be sure to pop the handler before the
9280 window is destroyed and either let PopEventHandler destroy it, or call
9281 its Destroy method yourself.
9283 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
9285 def PopEventHandler(*args
, **kwargs
):
9287 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
9289 Removes and returns the top-most event handler on the event handler
9290 stack. If deleteHandler is True then the wx.EvtHandler object will be
9291 destroyed after it is popped, and ``None`` will be returned instead.
9293 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
9295 def RemoveEventHandler(*args
, **kwargs
):
9297 RemoveEventHandler(self, EvtHandler handler) -> bool
9299 Find the given handler in the event handler chain and remove (but not
9300 delete) it from the event handler chain, returns True if it was found
9301 and False otherwise (this also results in an assert failure so this
9302 function should only be called when the handler is supposed to be
9305 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
9307 def SetValidator(*args
, **kwargs
):
9309 SetValidator(self, Validator validator)
9311 Deletes the current validator (if any) and sets the window validator,
9312 having called wx.Validator.Clone to create a new validator of this
9315 return _core_
.Window_SetValidator(*args
, **kwargs
)
9317 def GetValidator(*args
, **kwargs
):
9319 GetValidator(self) -> Validator
9321 Returns a pointer to the current validator for the window, or None if
9324 return _core_
.Window_GetValidator(*args
, **kwargs
)
9326 def Validate(*args
, **kwargs
):
9328 Validate(self) -> bool
9330 Validates the current values of the child controls using their
9331 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9332 style flag set, the method will also call Validate() of all child
9333 windows. Returns false if any of the validations failed.
9335 return _core_
.Window_Validate(*args
, **kwargs
)
9337 def TransferDataToWindow(*args
, **kwargs
):
9339 TransferDataToWindow(self) -> bool
9341 Transfers values to child controls from data areas specified by their
9342 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9343 style flag set, the method will also call TransferDataToWindow() of
9346 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
9348 def TransferDataFromWindow(*args
, **kwargs
):
9350 TransferDataFromWindow(self) -> bool
9352 Transfers values from child controls to data areas specified by their
9353 validators. Returns false if a transfer failed. If the window has
9354 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9355 also call TransferDataFromWindow() of all child windows.
9357 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
9359 def InitDialog(*args
, **kwargs
):
9363 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9364 to the dialog via validators.
9366 return _core_
.Window_InitDialog(*args
, **kwargs
)
9368 def SetAcceleratorTable(*args
, **kwargs
):
9370 SetAcceleratorTable(self, AcceleratorTable accel)
9372 Sets the accelerator table for this window.
9374 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
9376 def GetAcceleratorTable(*args
, **kwargs
):
9378 GetAcceleratorTable(self) -> AcceleratorTable
9380 Gets the accelerator table for this window.
9382 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
9384 def RegisterHotKey(*args
, **kwargs
):
9386 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9388 Registers a system wide hotkey. Every time the user presses the hotkey
9389 registered here, this window will receive a hotkey event. It will
9390 receive the event even if the application is in the background and
9391 does not have the input focus because the user is working with some
9392 other application. To bind an event handler function to this hotkey
9393 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9394 hotkey was registered successfully.
9396 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
9398 def UnregisterHotKey(*args
, **kwargs
):
9400 UnregisterHotKey(self, int hotkeyId) -> bool
9402 Unregisters a system wide hotkey.
9404 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
9406 def ConvertDialogPointToPixels(*args
, **kwargs
):
9408 ConvertDialogPointToPixels(self, Point pt) -> Point
9410 Converts a point or size from dialog units to pixels. Dialog units
9411 are used for maintaining a dialog's proportions even if the font
9412 changes. For the x dimension, the dialog units are multiplied by the
9413 average character width and then divided by 4. For the y dimension,
9414 the dialog units are multiplied by the average character height and
9417 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
9419 def ConvertDialogSizeToPixels(*args
, **kwargs
):
9421 ConvertDialogSizeToPixels(self, Size sz) -> Size
9423 Converts a point or size from dialog units to pixels. Dialog units
9424 are used for maintaining a dialog's proportions even if the font
9425 changes. For the x dimension, the dialog units are multiplied by the
9426 average character width and then divided by 4. For the y dimension,
9427 the dialog units are multiplied by the average character height and
9430 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
9432 def DLG_PNT(*args
, **kwargs
):
9434 DLG_PNT(self, Point pt) -> Point
9436 Converts a point or size from dialog units to pixels. Dialog units
9437 are used for maintaining a dialog's proportions even if the font
9438 changes. For the x dimension, the dialog units are multiplied by the
9439 average character width and then divided by 4. For the y dimension,
9440 the dialog units are multiplied by the average character height and
9443 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
9445 def DLG_SZE(*args
, **kwargs
):
9447 DLG_SZE(self, Size sz) -> Size
9449 Converts a point or size from dialog units to pixels. Dialog units
9450 are used for maintaining a dialog's proportions even if the font
9451 changes. For the x dimension, the dialog units are multiplied by the
9452 average character width and then divided by 4. For the y dimension,
9453 the dialog units are multiplied by the average character height and
9456 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
9458 def ConvertPixelPointToDialog(*args
, **kwargs
):
9459 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9460 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
9462 def ConvertPixelSizeToDialog(*args
, **kwargs
):
9463 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9464 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
9466 def WarpPointer(*args
, **kwargs
):
9468 WarpPointer(self, int x, int y)
9470 Moves the pointer to the given position on the window.
9472 NOTE: This function is not supported under Mac because Apple Human
9473 Interface Guidelines forbid moving the mouse cursor programmatically.
9475 return _core_
.Window_WarpPointer(*args
, **kwargs
)
9477 def CaptureMouse(*args
, **kwargs
):
9481 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9482 release the capture.
9484 Note that wxWindows maintains the stack of windows having captured the
9485 mouse and when the mouse is released the capture returns to the window
9486 which had had captured it previously and it is only really released if
9487 there were no previous window. In particular, this means that you must
9488 release the mouse as many times as you capture it, unless the window
9489 receives the `wx.MouseCaptureLostEvent` event.
9491 Any application which captures the mouse in the beginning of some
9492 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9493 operation when it receives the event. The event handler must not
9496 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
9498 def ReleaseMouse(*args
, **kwargs
):
9502 Releases mouse input captured with wx.Window.CaptureMouse.
9504 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
9506 def GetCapture(*args
, **kwargs
):
9508 GetCapture() -> Window
9510 Returns the window which currently captures the mouse or None
9512 return _core_
.Window_GetCapture(*args
, **kwargs
)
9514 GetCapture
= staticmethod(GetCapture
)
9515 def HasCapture(*args
, **kwargs
):
9517 HasCapture(self) -> bool
9519 Returns true if this window has the current mouse capture.
9521 return _core_
.Window_HasCapture(*args
, **kwargs
)
9523 def Refresh(*args
, **kwargs
):
9525 Refresh(self, bool eraseBackground=True, Rect rect=None)
9527 Mark the specified rectangle (or the whole window) as "dirty" so it
9528 will be repainted. Causes an EVT_PAINT event to be generated and sent
9531 return _core_
.Window_Refresh(*args
, **kwargs
)
9533 def RefreshRect(*args
, **kwargs
):
9535 RefreshRect(self, Rect rect, bool eraseBackground=True)
9537 Redraws the contents of the given rectangle: the area inside it will
9538 be repainted. This is the same as Refresh but has a nicer syntax.
9540 return _core_
.Window_RefreshRect(*args
, **kwargs
)
9542 def Update(*args
, **kwargs
):
9546 Calling this method immediately repaints the invalidated area of the
9547 window instead of waiting for the EVT_PAINT event to happen, (normally
9548 this would usually only happen when the flow of control returns to the
9549 event loop.) Notice that this function doesn't refresh the window and
9550 does nothing if the window has been already repainted. Use `Refresh`
9551 first if you want to immediately redraw the window (or some portion of
9552 it) unconditionally.
9554 return _core_
.Window_Update(*args
, **kwargs
)
9556 def ClearBackground(*args
, **kwargs
):
9558 ClearBackground(self)
9560 Clears the window by filling it with the current background
9561 colour. Does not cause an erase background event to be generated.
9563 return _core_
.Window_ClearBackground(*args
, **kwargs
)
9565 def Freeze(*args
, **kwargs
):
9569 Freezes the window or, in other words, prevents any updates from
9570 taking place on screen, the window is not redrawn at all. Thaw must be
9571 called to reenable window redrawing. Calls to Freeze/Thaw may be
9572 nested, with the actual Thaw being delayed until all the nesting has
9575 This method is useful for visual appearance optimization (for example,
9576 it is a good idea to use it before inserting large amount of text into
9577 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9578 for all controls so it is mostly just a hint to wxWindows and not a
9579 mandatory directive.
9581 return _core_
.Window_Freeze(*args
, **kwargs
)
9583 def IsFrozen(*args
, **kwargs
):
9585 IsFrozen(self) -> bool
9587 Returns ``True`` if the window has been frozen and not thawed yet.
9589 :see: `Freeze` and `Thaw`
9591 return _core_
.Window_IsFrozen(*args
, **kwargs
)
9593 def Thaw(*args
, **kwargs
):
9597 Reenables window updating after a previous call to Freeze. Calls to
9598 Freeze/Thaw may be nested, so Thaw must be called the same number of
9599 times that Freeze was before the window will be updated.
9601 return _core_
.Window_Thaw(*args
, **kwargs
)
9603 def PrepareDC(*args
, **kwargs
):
9605 PrepareDC(self, DC dc)
9607 Call this function to prepare the device context for drawing a
9608 scrolled image. It sets the device origin according to the current
9611 return _core_
.Window_PrepareDC(*args
, **kwargs
)
9613 def IsDoubleBuffered(*args
, **kwargs
):
9615 IsDoubleBuffered(self) -> bool
9617 Returns ``True`` if the window contents is double-buffered by the
9618 system, i.e. if any drawing done on the window is really done on a
9619 temporary backing surface and transferred to the screen all at once
9622 return _core_
.Window_IsDoubleBuffered(*args
, **kwargs
)
9624 def GetUpdateRegion(*args
, **kwargs
):
9626 GetUpdateRegion(self) -> Region
9628 Returns the region specifying which parts of the window have been
9629 damaged. Should only be called within an EVT_PAINT handler.
9631 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
9633 def GetUpdateClientRect(*args
, **kwargs
):
9635 GetUpdateClientRect(self) -> Rect
9637 Get the update rectangle region bounding box in client coords.
9639 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
9641 def IsExposed(*args
, **kwargs
):
9643 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9645 Returns true if the given point or rectangle area has been exposed
9646 since the last repaint. Call this in an paint event handler to
9647 optimize redrawing by only redrawing those areas, which have been
9650 return _core_
.Window_IsExposed(*args
, **kwargs
)
9652 def IsExposedPoint(*args
, **kwargs
):
9654 IsExposedPoint(self, Point pt) -> bool
9656 Returns true if the given point or rectangle area has been exposed
9657 since the last repaint. Call this in an paint event handler to
9658 optimize redrawing by only redrawing those areas, which have been
9661 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
9663 def IsExposedRect(*args
, **kwargs
):
9665 IsExposedRect(self, Rect rect) -> bool
9667 Returns true if the given point or rectangle area has been exposed
9668 since the last repaint. Call this in an paint event handler to
9669 optimize redrawing by only redrawing those areas, which have been
9672 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
9674 def GetDefaultAttributes(*args
, **kwargs
):
9676 GetDefaultAttributes(self) -> VisualAttributes
9678 Get the default attributes for an instance of this class. This is
9679 useful if you want to use the same font or colour in your own control
9680 as in a standard control -- which is a much better idea than hard
9681 coding specific colours or fonts which might look completely out of
9682 place on the user's system, especially if it uses themes.
9684 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
9686 def GetClassDefaultAttributes(*args
, **kwargs
):
9688 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9690 Get the default attributes for this class. This is useful if you want
9691 to use the same font or colour in your own control as in a standard
9692 control -- which is a much better idea than hard coding specific
9693 colours or fonts which might look completely out of place on the
9694 user's system, especially if it uses themes.
9696 The variant parameter is only relevant under Mac currently and is
9697 ignore under other platforms. Under Mac, it will change the size of
9698 the returned font. See `wx.Window.SetWindowVariant` for more about
9701 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9703 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
9704 def SetBackgroundColour(*args
, **kwargs
):
9706 SetBackgroundColour(self, Colour colour) -> bool
9708 Sets the background colour of the window. Returns True if the colour
9709 was changed. The background colour is usually painted by the default
9710 EVT_ERASE_BACKGROUND event handler function under Windows and
9711 automatically under GTK. Using `wx.NullColour` will reset the window
9712 to the default background colour.
9714 Note that setting the background colour may not cause an immediate
9715 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9716 calling this function.
9718 Using this function will disable attempts to use themes for this
9719 window, if the system supports them. Use with care since usually the
9720 themes represent the appearance chosen by the user to be used for all
9721 applications on the system.
9723 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
9725 def SetOwnBackgroundColour(*args
, **kwargs
):
9726 """SetOwnBackgroundColour(self, Colour colour)"""
9727 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
9729 def SetForegroundColour(*args
, **kwargs
):
9731 SetForegroundColour(self, Colour colour) -> bool
9733 Sets the foreground colour of the window. Returns True is the colour
9734 was changed. The interpretation of foreground colour is dependent on
9735 the window class; it may be the text colour or other colour, or it may
9738 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
9740 def SetOwnForegroundColour(*args
, **kwargs
):
9741 """SetOwnForegroundColour(self, Colour colour)"""
9742 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
9744 def GetBackgroundColour(*args
, **kwargs
):
9746 GetBackgroundColour(self) -> Colour
9748 Returns the background colour of the window.
9750 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
9752 def GetForegroundColour(*args
, **kwargs
):
9754 GetForegroundColour(self) -> Colour
9756 Returns the foreground colour of the window. The interpretation of
9757 foreground colour is dependent on the window class; it may be the text
9758 colour or other colour, or it may not be used at all.
9760 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
9762 def InheritsBackgroundColour(*args
, **kwargs
):
9763 """InheritsBackgroundColour(self) -> bool"""
9764 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
9766 def UseBgCol(*args
, **kwargs
):
9767 """UseBgCol(self) -> bool"""
9768 return _core_
.Window_UseBgCol(*args
, **kwargs
)
9770 def SetBackgroundStyle(*args
, **kwargs
):
9772 SetBackgroundStyle(self, int style) -> bool
9774 Returns the background style of the window. The background style
9775 indicates how the background of the window is drawn.
9777 ====================== ========================================
9778 wx.BG_STYLE_SYSTEM The background colour or pattern should
9779 be determined by the system
9780 wx.BG_STYLE_COLOUR The background should be a solid colour
9781 wx.BG_STYLE_CUSTOM The background will be implemented by the
9783 ====================== ========================================
9785 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9786 a custom background, such as a tiled bitmap. Currently the style has
9787 no effect on other platforms.
9789 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9791 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
9793 def GetBackgroundStyle(*args
, **kwargs
):
9795 GetBackgroundStyle(self) -> int
9797 Returns the background style of the window.
9799 :see: `SetBackgroundStyle`
9801 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
9803 def HasTransparentBackground(*args
, **kwargs
):
9805 HasTransparentBackground(self) -> bool
9807 Returns True if this window's background is transparent (as, for
9808 example, for `wx.StaticText`) and should show the parent window's
9811 This method is mostly used internally by the library itself and you
9812 normally shouldn't have to call it. You may, however, have to override
9813 it in your custom control classes to ensure that background is painted
9816 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
9818 def SetCursor(*args
, **kwargs
):
9820 SetCursor(self, Cursor cursor) -> bool
9822 Sets the window's cursor. Notice that the window cursor also sets it
9823 for the children of the window implicitly.
9825 The cursor may be wx.NullCursor in which case the window cursor will
9826 be reset back to default.
9828 return _core_
.Window_SetCursor(*args
, **kwargs
)
9830 def GetCursor(*args
, **kwargs
):
9832 GetCursor(self) -> Cursor
9834 Return the cursor associated with this window.
9836 return _core_
.Window_GetCursor(*args
, **kwargs
)
9838 def SetFont(*args
, **kwargs
):
9840 SetFont(self, Font font) -> bool
9842 Sets the font for this window.
9844 return _core_
.Window_SetFont(*args
, **kwargs
)
9846 def SetOwnFont(*args
, **kwargs
):
9847 """SetOwnFont(self, Font font)"""
9848 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9850 def GetFont(*args
, **kwargs
):
9852 GetFont(self) -> Font
9854 Returns the default font used for this window.
9856 return _core_
.Window_GetFont(*args
, **kwargs
)
9858 def SetCaret(*args
, **kwargs
):
9860 SetCaret(self, Caret caret)
9862 Sets the caret associated with the window.
9864 return _core_
.Window_SetCaret(*args
, **kwargs
)
9866 def GetCaret(*args
, **kwargs
):
9868 GetCaret(self) -> Caret
9870 Returns the caret associated with the window.
9872 return _core_
.Window_GetCaret(*args
, **kwargs
)
9874 def GetCharHeight(*args
, **kwargs
):
9876 GetCharHeight(self) -> int
9878 Get the (average) character size for the current font.
9880 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9882 def GetCharWidth(*args
, **kwargs
):
9884 GetCharWidth(self) -> int
9886 Get the (average) character size for the current font.
9888 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9890 def GetTextExtent(*args
, **kwargs
):
9892 GetTextExtent(String string) -> (width, height)
9894 Get the width and height of the text using the current font.
9896 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9898 def GetFullTextExtent(*args
, **kwargs
):
9900 GetFullTextExtent(String string, Font font=None) ->
9901 (width, height, descent, externalLeading)
9903 Get the width, height, decent and leading of the text using the
9904 current or specified font.
9906 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9908 def ClientToScreenXY(*args
, **kwargs
):
9910 ClientToScreenXY(int x, int y) -> (x,y)
9912 Converts to screen coordinates from coordinates relative to this window.
9914 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9916 def ScreenToClientXY(*args
, **kwargs
):
9918 ScreenToClientXY(int x, int y) -> (x,y)
9920 Converts from screen to client window coordinates.
9922 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9924 def ClientToScreen(*args
, **kwargs
):
9926 ClientToScreen(self, Point pt) -> Point
9928 Converts to screen coordinates from coordinates relative to this window.
9930 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9932 def ScreenToClient(*args
, **kwargs
):
9934 ScreenToClient(self, Point pt) -> Point
9936 Converts from screen to client window coordinates.
9938 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9940 def HitTestXY(*args
, **kwargs
):
9942 HitTestXY(self, int x, int y) -> int
9944 Test where the given (in client coords) point lies
9946 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9948 def HitTest(*args
, **kwargs
):
9950 HitTest(self, Point pt) -> int
9952 Test where the given (in client coords) point lies
9954 return _core_
.Window_HitTest(*args
, **kwargs
)
9956 def GetBorder(*args
):
9958 GetBorder(self, long flags) -> int
9959 GetBorder(self) -> int
9961 Get border for the flags of this window
9963 return _core_
.Window_GetBorder(*args
)
9965 def UpdateWindowUI(*args
, **kwargs
):
9967 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9969 This function sends EVT_UPDATE_UI events to the window. The particular
9970 implementation depends on the window; for example a wx.ToolBar will
9971 send an update UI event for each toolbar button, and a wx.Frame will
9972 send an update UI event for each menubar menu item. You can call this
9973 function from your application to ensure that your UI is up-to-date at
9974 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9975 concerned). This may be necessary if you have called
9976 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9977 limit the overhead that wxWindows incurs by sending update UI events
9980 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9982 def PopupMenuXY(*args
, **kwargs
):
9984 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9986 Pops up the given menu at the specified coordinates, relative to this window,
9987 and returns control when the user has dismissed the menu. If a menu item is
9988 selected, the corresponding menu event is generated and will be processed as
9989 usual. If the default position is given then the current position of the
9990 mouse cursor will be used.
9992 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9994 def PopupMenu(*args
, **kwargs
):
9996 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9998 Pops up the given menu at the specified coordinates, relative to this window,
9999 and returns control when the user has dismissed the menu. If a menu item is
10000 selected, the corresponding menu event is generated and will be processed as
10001 usual. If the default position is given then the current position of the
10002 mouse cursor will be used.
10004 return _core_
.Window_PopupMenu(*args
, **kwargs
)
10006 def HasMultiplePages(*args
, **kwargs
):
10007 """HasMultiplePages(self) -> bool"""
10008 return _core_
.Window_HasMultiplePages(*args
, **kwargs
)
10010 def GetHandle(*args
, **kwargs
):
10012 GetHandle(self) -> long
10014 Returns the platform-specific handle (as a long integer) of the
10015 physical window. Currently on wxMac it returns the handle of the
10016 toplevel parent of the window.
10018 return _core_
.Window_GetHandle(*args
, **kwargs
)
10020 def AssociateHandle(*args
, **kwargs
):
10022 AssociateHandle(self, long handle)
10024 Associate the window with a new native handle
10026 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
10028 def DissociateHandle(*args
, **kwargs
):
10030 DissociateHandle(self)
10032 Dissociate the current native handle from the window
10034 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
10036 def OnPaint(*args
, **kwargs
):
10037 """OnPaint(self, PaintEvent event)"""
10038 return _core_
.Window_OnPaint(*args
, **kwargs
)
10040 def HasScrollbar(*args
, **kwargs
):
10042 HasScrollbar(self, int orient) -> bool
10044 Does the window have the scrollbar for this orientation?
10046 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
10048 def SetScrollbar(*args
, **kwargs
):
10050 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
10053 Sets the scrollbar properties of a built-in scrollbar.
10055 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
10057 def SetScrollPos(*args
, **kwargs
):
10059 SetScrollPos(self, int orientation, int pos, bool refresh=True)
10061 Sets the position of one of the built-in scrollbars.
10063 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
10065 def GetScrollPos(*args
, **kwargs
):
10067 GetScrollPos(self, int orientation) -> int
10069 Returns the built-in scrollbar position.
10071 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
10073 def GetScrollThumb(*args
, **kwargs
):
10075 GetScrollThumb(self, int orientation) -> int
10077 Returns the built-in scrollbar thumb size.
10079 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
10081 def GetScrollRange(*args
, **kwargs
):
10083 GetScrollRange(self, int orientation) -> int
10085 Returns the built-in scrollbar range.
10087 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
10089 def ScrollWindow(*args
, **kwargs
):
10091 ScrollWindow(self, int dx, int dy, Rect rect=None)
10093 Physically scrolls the pixels in the window and move child windows
10094 accordingly. Use this function to optimise your scrolling
10095 implementations, to minimise the area that must be redrawn. Note that
10096 it is rarely required to call this function from a user program.
10098 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
10100 def ScrollLines(*args
, **kwargs
):
10102 ScrollLines(self, int lines) -> bool
10104 If the platform and window class supports it, scrolls the window by
10105 the given number of lines down, if lines is positive, or up if lines
10106 is negative. Returns True if the window was scrolled, False if it was
10107 already on top/bottom and nothing was done.
10109 return _core_
.Window_ScrollLines(*args
, **kwargs
)
10111 def ScrollPages(*args
, **kwargs
):
10113 ScrollPages(self, int pages) -> bool
10115 If the platform and window class supports it, scrolls the window by
10116 the given number of pages down, if pages is positive, or up if pages
10117 is negative. Returns True if the window was scrolled, False if it was
10118 already on top/bottom and nothing was done.
10120 return _core_
.Window_ScrollPages(*args
, **kwargs
)
10122 def LineUp(*args
, **kwargs
):
10124 LineUp(self) -> bool
10126 This is just a wrapper for ScrollLines(-1).
10128 return _core_
.Window_LineUp(*args
, **kwargs
)
10130 def LineDown(*args
, **kwargs
):
10132 LineDown(self) -> bool
10134 This is just a wrapper for ScrollLines(1).
10136 return _core_
.Window_LineDown(*args
, **kwargs
)
10138 def PageUp(*args
, **kwargs
):
10140 PageUp(self) -> bool
10142 This is just a wrapper for ScrollPages(-1).
10144 return _core_
.Window_PageUp(*args
, **kwargs
)
10146 def PageDown(*args
, **kwargs
):
10148 PageDown(self) -> bool
10150 This is just a wrapper for ScrollPages(1).
10152 return _core_
.Window_PageDown(*args
, **kwargs
)
10154 def SetHelpText(*args
, **kwargs
):
10156 SetHelpText(self, String text)
10158 Sets the help text to be used as context-sensitive help for this
10159 window. Note that the text is actually stored by the current
10160 `wx.HelpProvider` implementation, and not in the window object itself.
10162 return _core_
.Window_SetHelpText(*args
, **kwargs
)
10164 def SetHelpTextForId(*args
, **kwargs
):
10166 SetHelpTextForId(self, String text)
10168 Associate this help text with all windows with the same id as this
10171 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
10173 def GetHelpTextAtPoint(*args
, **kwargs
):
10175 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10177 Get the help string associated with the given position in this window.
10179 Notice that pt may be invalid if event origin is keyboard or unknown
10180 and this method should return the global window help text then
10183 return _core_
.Window_GetHelpTextAtPoint(*args
, **kwargs
)
10185 def GetHelpText(*args
, **kwargs
):
10187 GetHelpText(self) -> String
10189 Gets the help text to be used as context-sensitive help for this
10190 window. Note that the text is actually stored by the current
10191 `wx.HelpProvider` implementation, and not in the window object itself.
10193 return _core_
.Window_GetHelpText(*args
, **kwargs
)
10195 def SetToolTipString(*args
, **kwargs
):
10197 SetToolTipString(self, String tip)
10199 Attach a tooltip to the window.
10201 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
10203 def SetToolTip(*args
, **kwargs
):
10205 SetToolTip(self, ToolTip tip)
10207 Attach a tooltip to the window.
10209 return _core_
.Window_SetToolTip(*args
, **kwargs
)
10211 def GetToolTip(*args
, **kwargs
):
10213 GetToolTip(self) -> ToolTip
10215 get the associated tooltip or None if none
10217 return _core_
.Window_GetToolTip(*args
, **kwargs
)
10219 def SetDropTarget(*args
, **kwargs
):
10221 SetDropTarget(self, DropTarget dropTarget)
10223 Associates a drop target with this window. If the window already has
10224 a drop target, it is deleted.
10226 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
10228 def GetDropTarget(*args
, **kwargs
):
10230 GetDropTarget(self) -> DropTarget
10232 Returns the associated drop target, which may be None.
10234 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
10236 def DragAcceptFiles(*args
, **kwargs
):
10238 DragAcceptFiles(self, bool accept)
10240 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10241 Only functional on Windows.
10243 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
10245 def SetConstraints(*args
, **kwargs
):
10247 SetConstraints(self, LayoutConstraints constraints)
10249 Sets the window to have the given layout constraints. If an existing
10250 layout constraints object is already owned by the window, it will be
10251 deleted. Pass None to disassociate and delete the window's current
10254 You must call SetAutoLayout to tell a window to use the constraints
10255 automatically in its default EVT_SIZE handler; otherwise, you must
10256 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10257 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10260 return _core_
.Window_SetConstraints(*args
, **kwargs
)
10262 def GetConstraints(*args
, **kwargs
):
10264 GetConstraints(self) -> LayoutConstraints
10266 Returns a pointer to the window's layout constraints, or None if there
10269 return _core_
.Window_GetConstraints(*args
, **kwargs
)
10271 def SetAutoLayout(*args
, **kwargs
):
10273 SetAutoLayout(self, bool autoLayout)
10275 Determines whether the Layout function will be called automatically
10276 when the window is resized. lease note that this only happens for the
10277 windows usually used to contain children, namely `wx.Panel` and
10278 `wx.TopLevelWindow` (and the classes deriving from them).
10280 This method is called implicitly by `SetSizer` but if you use
10281 `SetConstraints` you should call it manually or otherwise the window
10282 layout won't be correctly updated when its size changes.
10284 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
10286 def GetAutoLayout(*args
, **kwargs
):
10288 GetAutoLayout(self) -> bool
10290 Returns the current autoLayout setting
10292 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
10294 def Layout(*args
, **kwargs
):
10296 Layout(self) -> bool
10298 Invokes the constraint-based layout algorithm or the sizer-based
10299 algorithm for this window. See SetAutoLayout: when auto layout is on,
10300 this function gets called automatically by the default EVT_SIZE
10301 handler when the window is resized.
10303 return _core_
.Window_Layout(*args
, **kwargs
)
10305 def SetSizer(*args
, **kwargs
):
10307 SetSizer(self, Sizer sizer, bool deleteOld=True)
10309 Sets the window to have the given layout sizer. The window will then
10310 own the object, and will take care of its deletion. If an existing
10311 layout sizer object is already owned by the window, it will be deleted
10312 if the deleteOld parameter is true. Note that this function will also
10313 call SetAutoLayout implicitly with a True parameter if the sizer is
10314 non-None, and False otherwise.
10316 return _core_
.Window_SetSizer(*args
, **kwargs
)
10318 def SetSizerAndFit(*args
, **kwargs
):
10320 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
10322 The same as SetSizer, except it also sets the size hints for the
10323 window based on the sizer's minimum size.
10325 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
10327 def GetSizer(*args
, **kwargs
):
10329 GetSizer(self) -> Sizer
10331 Return the sizer associated with the window by a previous call to
10332 SetSizer or None if there isn't one.
10334 return _core_
.Window_GetSizer(*args
, **kwargs
)
10336 def SetContainingSizer(*args
, **kwargs
):
10338 SetContainingSizer(self, Sizer sizer)
10340 This normally does not need to be called by application code. It is
10341 called internally when a window is added to a sizer, and is used so
10342 the window can remove itself from the sizer when it is destroyed.
10344 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
10346 def GetContainingSizer(*args
, **kwargs
):
10348 GetContainingSizer(self) -> Sizer
10350 Return the sizer that this window is a member of, if any, otherwise None.
10352 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
10354 def InheritAttributes(*args
, **kwargs
):
10356 InheritAttributes(self)
10358 This function is (or should be, in case of custom controls) called
10359 during window creation to intelligently set up the window visual
10360 attributes, that is the font and the foreground and background
10363 By 'intelligently' the following is meant: by default, all windows use
10364 their own default attributes. However if some of the parent's
10365 attributes are explicitly changed (that is, using SetFont and not
10366 SetOwnFont) and if the corresponding attribute hadn't been
10367 explicitly set for this window itself, then this window takes the same
10368 value as used by the parent. In addition, if the window overrides
10369 ShouldInheritColours to return false, the colours will not be changed
10370 no matter what and only the font might.
10372 This rather complicated logic is necessary in order to accommodate the
10373 different usage scenarios. The most common one is when all default
10374 attributes are used and in this case, nothing should be inherited as
10375 in modern GUIs different controls use different fonts (and colours)
10376 than their siblings so they can't inherit the same value from the
10377 parent. However it was also deemed desirable to allow to simply change
10378 the attributes of all children at once by just changing the font or
10379 colour of their common parent, hence in this case we do inherit the
10380 parents attributes.
10383 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
10385 def ShouldInheritColours(*args
, **kwargs
):
10387 ShouldInheritColours(self) -> bool
10389 Return true from here to allow the colours of this window to be
10390 changed by InheritAttributes, returning false forbids inheriting them
10391 from the parent window.
10393 The base class version returns false, but this method is overridden in
10394 wxControl where it returns true.
10396 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
10398 def CanSetTransparent(*args
, **kwargs
):
10400 CanSetTransparent(self) -> bool
10402 Returns ``True`` if the platform supports setting the transparency for
10403 this window. Note that this method will err on the side of caution,
10404 so it is possible that this will return ``False`` when it is in fact
10405 possible to set the transparency.
10407 NOTE: On X-windows systems the X server must have the composite
10408 extension loaded, and there must be a composite manager program (such
10409 as xcompmgr) running.
10411 return _core_
.Window_CanSetTransparent(*args
, **kwargs
)
10413 def SetTransparent(*args
, **kwargs
):
10415 SetTransparent(self, byte alpha) -> bool
10417 Attempt to set the transparency of this window to the ``alpha`` value,
10418 returns True on success. The ``alpha`` value is an integer in the
10419 range of 0 to 255, where 0 is fully transparent and 255 is fully
10422 return _core_
.Window_SetTransparent(*args
, **kwargs
)
10424 def PostCreate(self
, pre
):
10426 Phase 3 of the 2-phase create <wink!>
10427 Call this method after precreating the window with the 2-phase create method.
10429 self
.this
= pre
.this
10430 self
.thisown
= pre
.thisown
10432 if hasattr(self
, '_setOORInfo'):
10434 self
._setOORInfo
(self
)
10437 if hasattr(self
, '_setCallbackInfo'):
10439 self
._setCallbackInfo
(self
, pre
.__class
__)
10443 def SendSizeEvent(self
):
10444 self
.GetEventHandler().ProcessEvent(wx
.SizeEvent((-1,-1)))
10446 AcceleratorTable
= property(GetAcceleratorTable
,SetAcceleratorTable
,doc
="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10447 AutoLayout
= property(GetAutoLayout
,SetAutoLayout
,doc
="See `GetAutoLayout` and `SetAutoLayout`")
10448 BackgroundColour
= property(GetBackgroundColour
,SetBackgroundColour
,doc
="See `GetBackgroundColour` and `SetBackgroundColour`")
10449 BackgroundStyle
= property(GetBackgroundStyle
,SetBackgroundStyle
,doc
="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10450 EffectiveMinSize
= property(GetEffectiveMinSize
,doc
="See `GetEffectiveMinSize`")
10451 BestSize
= property(GetBestSize
,doc
="See `GetBestSize`")
10452 BestVirtualSize
= property(GetBestVirtualSize
,doc
="See `GetBestVirtualSize`")
10453 Border
= property(GetBorder
,doc
="See `GetBorder`")
10454 Caret
= property(GetCaret
,SetCaret
,doc
="See `GetCaret` and `SetCaret`")
10455 CharHeight
= property(GetCharHeight
,doc
="See `GetCharHeight`")
10456 CharWidth
= property(GetCharWidth
,doc
="See `GetCharWidth`")
10457 Children
= property(GetChildren
,doc
="See `GetChildren`")
10458 ClientAreaOrigin
= property(GetClientAreaOrigin
,doc
="See `GetClientAreaOrigin`")
10459 ClientRect
= property(GetClientRect
,SetClientRect
,doc
="See `GetClientRect` and `SetClientRect`")
10460 ClientSize
= property(GetClientSize
,SetClientSize
,doc
="See `GetClientSize` and `SetClientSize`")
10461 Constraints
= property(GetConstraints
,SetConstraints
,doc
="See `GetConstraints` and `SetConstraints`")
10462 ContainingSizer
= property(GetContainingSizer
,SetContainingSizer
,doc
="See `GetContainingSizer` and `SetContainingSizer`")
10463 Cursor
= property(GetCursor
,SetCursor
,doc
="See `GetCursor` and `SetCursor`")
10464 DefaultAttributes
= property(GetDefaultAttributes
,doc
="See `GetDefaultAttributes`")
10465 DropTarget
= property(GetDropTarget
,SetDropTarget
,doc
="See `GetDropTarget` and `SetDropTarget`")
10466 EventHandler
= property(GetEventHandler
,SetEventHandler
,doc
="See `GetEventHandler` and `SetEventHandler`")
10467 ExtraStyle
= property(GetExtraStyle
,SetExtraStyle
,doc
="See `GetExtraStyle` and `SetExtraStyle`")
10468 Font
= property(GetFont
,SetFont
,doc
="See `GetFont` and `SetFont`")
10469 ForegroundColour
= property(GetForegroundColour
,SetForegroundColour
,doc
="See `GetForegroundColour` and `SetForegroundColour`")
10470 GrandParent
= property(GetGrandParent
,doc
="See `GetGrandParent`")
10471 TopLevelParent
= property(GetTopLevelParent
,doc
="See `GetTopLevelParent`")
10472 Handle
= property(GetHandle
,doc
="See `GetHandle`")
10473 HelpText
= property(GetHelpText
,SetHelpText
,doc
="See `GetHelpText` and `SetHelpText`")
10474 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
10475 Label
= property(GetLabel
,SetLabel
,doc
="See `GetLabel` and `SetLabel`")
10476 LayoutDirection
= property(GetLayoutDirection
,SetLayoutDirection
,doc
="See `GetLayoutDirection` and `SetLayoutDirection`")
10477 MaxHeight
= property(GetMaxHeight
,doc
="See `GetMaxHeight`")
10478 MaxSize
= property(GetMaxSize
,SetMaxSize
,doc
="See `GetMaxSize` and `SetMaxSize`")
10479 MaxWidth
= property(GetMaxWidth
,doc
="See `GetMaxWidth`")
10480 MinHeight
= property(GetMinHeight
,doc
="See `GetMinHeight`")
10481 MinSize
= property(GetMinSize
,SetMinSize
,doc
="See `GetMinSize` and `SetMinSize`")
10482 MinWidth
= property(GetMinWidth
,doc
="See `GetMinWidth`")
10483 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
10484 Parent
= property(GetParent
,doc
="See `GetParent`")
10485 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
10486 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
10487 ScreenPosition
= property(GetScreenPosition
,doc
="See `GetScreenPosition`")
10488 ScreenRect
= property(GetScreenRect
,doc
="See `GetScreenRect`")
10489 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
10490 Sizer
= property(GetSizer
,SetSizer
,doc
="See `GetSizer` and `SetSizer`")
10491 ThemeEnabled
= property(GetThemeEnabled
,SetThemeEnabled
,doc
="See `GetThemeEnabled` and `SetThemeEnabled`")
10492 ToolTip
= property(GetToolTip
,SetToolTip
,doc
="See `GetToolTip` and `SetToolTip`")
10493 UpdateClientRect
= property(GetUpdateClientRect
,doc
="See `GetUpdateClientRect`")
10494 UpdateRegion
= property(GetUpdateRegion
,doc
="See `GetUpdateRegion`")
10495 Validator
= property(GetValidator
,SetValidator
,doc
="See `GetValidator` and `SetValidator`")
10496 VirtualSize
= property(GetVirtualSize
,SetVirtualSize
,doc
="See `GetVirtualSize` and `SetVirtualSize`")
10497 WindowStyle
= property(GetWindowStyle
,SetWindowStyle
,doc
="See `GetWindowStyle` and `SetWindowStyle`")
10498 WindowStyleFlag
= property(GetWindowStyleFlag
,SetWindowStyleFlag
,doc
="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10499 WindowVariant
= property(GetWindowVariant
,SetWindowVariant
,doc
="See `GetWindowVariant` and `SetWindowVariant`")
10500 Shown
= property(IsShown
,Show
,doc
="See `IsShown` and `Show`")
10501 Enabled
= property(IsEnabled
,Enable
,doc
="See `IsEnabled` and `Enable`")
10502 TopLevel
= property(IsTopLevel
,doc
="See `IsTopLevel`")
10503 _core_
.Window_swigregister(Window
)
10505 def PreWindow(*args
, **kwargs
):
10507 PreWindow() -> Window
10509 Precreate a Window for 2-phase creation.
10511 val
= _core_
.new_PreWindow(*args
, **kwargs
)
10514 def Window_NewControlId(*args
):
10516 Window_NewControlId() -> int
10518 Generate a control id for the controls which were not given one.
10520 return _core_
.Window_NewControlId(*args
)
10522 def Window_NextControlId(*args
, **kwargs
):
10524 Window_NextControlId(int winid) -> int
10526 Get the id of the control following the one with the given
10529 return _core_
.Window_NextControlId(*args
, **kwargs
)
10531 def Window_PrevControlId(*args
, **kwargs
):
10533 Window_PrevControlId(int winid) -> int
10535 Get the id of the control preceding the one with the given
10538 return _core_
.Window_PrevControlId(*args
, **kwargs
)
10540 def Window_FindFocus(*args
):
10542 Window_FindFocus() -> Window
10544 Returns the window or control that currently has the keyboard focus,
10547 return _core_
.Window_FindFocus(*args
)
10549 def Window_GetCapture(*args
):
10551 Window_GetCapture() -> Window
10553 Returns the window which currently captures the mouse or None
10555 return _core_
.Window_GetCapture(*args
)
10557 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
10559 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10561 Get the default attributes for this class. This is useful if you want
10562 to use the same font or colour in your own control as in a standard
10563 control -- which is a much better idea than hard coding specific
10564 colours or fonts which might look completely out of place on the
10565 user's system, especially if it uses themes.
10567 The variant parameter is only relevant under Mac currently and is
10568 ignore under other platforms. Under Mac, it will change the size of
10569 the returned font. See `wx.Window.SetWindowVariant` for more about
10572 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
10574 def DLG_PNT(win
, point_or_x
, y
=None):
10576 Convenience function for converting a Point or (x,y) in
10577 dialog units to pixel units.
10580 return win
.ConvertDialogPointToPixels(point_or_x
)
10582 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
10584 def DLG_SZE(win
, size_width
, height
=None):
10586 Convenience function for converting a Size or (w,h) in
10587 dialog units to pixel units.
10590 return win
.ConvertDialogSizeToPixels(size_width
)
10592 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
10595 def FindWindowById(*args
, **kwargs
):
10597 FindWindowById(long id, Window parent=None) -> Window
10599 Find the first window in the application with the given id. If parent
10600 is None, the search will start from all top-level frames and dialog
10601 boxes; if non-None, the search will be limited to the given window
10602 hierarchy. The search is recursive in both cases.
10604 return _core_
.FindWindowById(*args
, **kwargs
)
10606 def FindWindowByName(*args
, **kwargs
):
10608 FindWindowByName(String name, Window parent=None) -> Window
10610 Find a window by its name (as given in a window constructor or Create
10611 function call). If parent is None, the search will start from all
10612 top-level frames and dialog boxes; if non-None, the search will be
10613 limited to the given window hierarchy. The search is recursive in both
10616 If no window with such name is found, wx.FindWindowByLabel is called.
10618 return _core_
.FindWindowByName(*args
, **kwargs
)
10620 def FindWindowByLabel(*args
, **kwargs
):
10622 FindWindowByLabel(String label, Window parent=None) -> Window
10624 Find a window by its label. Depending on the type of window, the label
10625 may be a window title or panel item label. If parent is None, the
10626 search will start from all top-level frames and dialog boxes; if
10627 non-None, the search will be limited to the given window
10628 hierarchy. The search is recursive in both cases.
10630 return _core_
.FindWindowByLabel(*args
, **kwargs
)
10632 def Window_FromHWND(*args
, **kwargs
):
10633 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10634 return _core_
.Window_FromHWND(*args
, **kwargs
)
10636 def GetTopLevelWindows(*args
):
10638 GetTopLevelWindows() -> PyObject
10640 Returns a list of the the application's top-level windows, (frames,
10641 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10642 by wxWidgets, and so it is only valid as long as no top-level windows
10643 are closed or new top-level windows are created.
10646 return _core_
.GetTopLevelWindows(*args
)
10647 #---------------------------------------------------------------------------
10649 class Validator(EvtHandler
):
10650 """Proxy of C++ Validator class"""
10651 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10652 __repr__
= _swig_repr
10653 def __init__(self
, *args
, **kwargs
):
10654 """__init__(self) -> Validator"""
10655 _core_
.Validator_swiginit(self
,_core_
.new_Validator(*args
, **kwargs
))
10656 self
._setOORInfo
(self
)
10658 def Clone(*args
, **kwargs
):
10659 """Clone(self) -> Validator"""
10660 return _core_
.Validator_Clone(*args
, **kwargs
)
10662 def Validate(*args
, **kwargs
):
10663 """Validate(self, Window parent) -> bool"""
10664 return _core_
.Validator_Validate(*args
, **kwargs
)
10666 def TransferToWindow(*args
, **kwargs
):
10667 """TransferToWindow(self) -> bool"""
10668 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
10670 def TransferFromWindow(*args
, **kwargs
):
10671 """TransferFromWindow(self) -> bool"""
10672 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
10674 def GetWindow(*args
, **kwargs
):
10675 """GetWindow(self) -> Window"""
10676 return _core_
.Validator_GetWindow(*args
, **kwargs
)
10678 def SetWindow(*args
, **kwargs
):
10679 """SetWindow(self, Window window)"""
10680 return _core_
.Validator_SetWindow(*args
, **kwargs
)
10682 def IsSilent(*args
, **kwargs
):
10683 """IsSilent() -> bool"""
10684 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10686 IsSilent
= staticmethod(IsSilent
)
10687 def SetBellOnError(*args
, **kwargs
):
10688 """SetBellOnError(int doIt=True)"""
10689 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10691 SetBellOnError
= staticmethod(SetBellOnError
)
10692 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
10693 _core_
.Validator_swigregister(Validator
)
10695 def Validator_IsSilent(*args
):
10696 """Validator_IsSilent() -> bool"""
10697 return _core_
.Validator_IsSilent(*args
)
10699 def Validator_SetBellOnError(*args
, **kwargs
):
10700 """Validator_SetBellOnError(int doIt=True)"""
10701 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10703 class PyValidator(Validator
):
10704 """Proxy of C++ PyValidator class"""
10705 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10706 __repr__
= _swig_repr
10707 def __init__(self
, *args
, **kwargs
):
10708 """__init__(self) -> PyValidator"""
10709 _core_
.PyValidator_swiginit(self
,_core_
.new_PyValidator(*args
, **kwargs
))
10710 self
._setOORInfo
(self
);PyValidator
._setCallbackInfo
(self
, self
, PyValidator
)
10712 def _setCallbackInfo(*args
, **kwargs
):
10713 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
10714 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
10716 _core_
.PyValidator_swigregister(PyValidator
)
10718 #---------------------------------------------------------------------------
10720 class Menu(EvtHandler
):
10721 """Proxy of C++ Menu class"""
10722 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10723 __repr__
= _swig_repr
10724 def __init__(self
, *args
, **kwargs
):
10725 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10726 _core_
.Menu_swiginit(self
,_core_
.new_Menu(*args
, **kwargs
))
10727 self
._setOORInfo
(self
)
10729 def Append(*args
, **kwargs
):
10731 Append(self, int id, String text=EmptyString, String help=EmptyString,
10732 int kind=ITEM_NORMAL) -> MenuItem
10734 return _core_
.Menu_Append(*args
, **kwargs
)
10736 def AppendSeparator(*args
, **kwargs
):
10737 """AppendSeparator(self) -> MenuItem"""
10738 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
10740 def AppendCheckItem(*args
, **kwargs
):
10741 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10742 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
10744 def AppendRadioItem(*args
, **kwargs
):
10745 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10746 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
10748 def AppendMenu(*args
, **kwargs
):
10749 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10750 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
10752 def AppendSubMenu(*args
, **kwargs
):
10753 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10754 return _core_
.Menu_AppendSubMenu(*args
, **kwargs
)
10756 def AppendItem(*args
, **kwargs
):
10757 """AppendItem(self, MenuItem item) -> MenuItem"""
10758 return _core_
.Menu_AppendItem(*args
, **kwargs
)
10760 def InsertItem(*args
, **kwargs
):
10761 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10762 return _core_
.Menu_InsertItem(*args
, **kwargs
)
10764 def PrependItem(*args
, **kwargs
):
10765 """PrependItem(self, MenuItem item) -> MenuItem"""
10766 return _core_
.Menu_PrependItem(*args
, **kwargs
)
10768 def Break(*args
, **kwargs
):
10770 return _core_
.Menu_Break(*args
, **kwargs
)
10772 def Insert(*args
, **kwargs
):
10774 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10775 int kind=ITEM_NORMAL) -> MenuItem
10777 return _core_
.Menu_Insert(*args
, **kwargs
)
10779 def InsertSeparator(*args
, **kwargs
):
10780 """InsertSeparator(self, size_t pos) -> MenuItem"""
10781 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
10783 def InsertCheckItem(*args
, **kwargs
):
10784 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10785 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
10787 def InsertRadioItem(*args
, **kwargs
):
10788 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10789 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
10791 def InsertMenu(*args
, **kwargs
):
10792 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10793 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
10795 def Prepend(*args
, **kwargs
):
10797 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10798 int kind=ITEM_NORMAL) -> MenuItem
10800 return _core_
.Menu_Prepend(*args
, **kwargs
)
10802 def PrependSeparator(*args
, **kwargs
):
10803 """PrependSeparator(self) -> MenuItem"""
10804 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
10806 def PrependCheckItem(*args
, **kwargs
):
10807 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10808 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
10810 def PrependRadioItem(*args
, **kwargs
):
10811 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10812 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
10814 def PrependMenu(*args
, **kwargs
):
10815 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10816 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
10818 def Remove(*args
, **kwargs
):
10819 """Remove(self, int id) -> MenuItem"""
10820 return _core_
.Menu_Remove(*args
, **kwargs
)
10822 def RemoveItem(self
, item
):
10823 """RemoveItem(self, MenuItem item) -> MenuItem"""
10824 #// The return object is always the parameter, so return that
10825 #// proxy instead of the new one
10826 val
= _core_
.Menu_RemoveItem(self
, item
)
10827 item
.this
.own(val
.this
.own())
10832 def Delete(*args
, **kwargs
):
10833 """Delete(self, int id) -> bool"""
10834 return _core_
.Menu_Delete(*args
, **kwargs
)
10836 def DeleteItem(*args
, **kwargs
):
10837 """DeleteItem(self, MenuItem item) -> bool"""
10838 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
10840 def Destroy(*args
, **kwargs
):
10844 Deletes the C++ object this Python object is a proxy for.
10846 args
[0].this
.own(False)
10847 return _core_
.Menu_Destroy(*args
, **kwargs
)
10849 def DestroyId(*args
, **kwargs
):
10850 """DestroyId(self, int id) -> bool"""
10851 return _core_
.Menu_DestroyId(*args
, **kwargs
)
10853 def DestroyItem(*args
, **kwargs
):
10854 """DestroyItem(self, MenuItem item) -> bool"""
10855 return _core_
.Menu_DestroyItem(*args
, **kwargs
)
10857 def GetMenuItemCount(*args
, **kwargs
):
10858 """GetMenuItemCount(self) -> size_t"""
10859 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
10861 def GetMenuItems(*args
, **kwargs
):
10862 """GetMenuItems(self) -> PyObject"""
10863 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
10865 def FindItem(*args
, **kwargs
):
10866 """FindItem(self, String item) -> int"""
10867 return _core_
.Menu_FindItem(*args
, **kwargs
)
10869 def FindItemById(*args
, **kwargs
):
10870 """FindItemById(self, int id) -> MenuItem"""
10871 return _core_
.Menu_FindItemById(*args
, **kwargs
)
10873 def FindItemByPosition(*args
, **kwargs
):
10874 """FindItemByPosition(self, size_t position) -> MenuItem"""
10875 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
10877 def Enable(*args
, **kwargs
):
10878 """Enable(self, int id, bool enable)"""
10879 return _core_
.Menu_Enable(*args
, **kwargs
)
10881 def IsEnabled(*args
, **kwargs
):
10882 """IsEnabled(self, int id) -> bool"""
10883 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
10885 def Check(*args
, **kwargs
):
10886 """Check(self, int id, bool check)"""
10887 return _core_
.Menu_Check(*args
, **kwargs
)
10889 def IsChecked(*args
, **kwargs
):
10890 """IsChecked(self, int id) -> bool"""
10891 return _core_
.Menu_IsChecked(*args
, **kwargs
)
10893 def SetLabel(*args
, **kwargs
):
10894 """SetLabel(self, int id, String label)"""
10895 return _core_
.Menu_SetLabel(*args
, **kwargs
)
10897 def GetLabel(*args
, **kwargs
):
10898 """GetLabel(self, int id) -> String"""
10899 return _core_
.Menu_GetLabel(*args
, **kwargs
)
10901 def SetHelpString(*args
, **kwargs
):
10902 """SetHelpString(self, int id, String helpString)"""
10903 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
10905 def GetHelpString(*args
, **kwargs
):
10906 """GetHelpString(self, int id) -> String"""
10907 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
10909 def SetTitle(*args
, **kwargs
):
10910 """SetTitle(self, String title)"""
10911 return _core_
.Menu_SetTitle(*args
, **kwargs
)
10913 def GetTitle(*args
, **kwargs
):
10914 """GetTitle(self) -> String"""
10915 return _core_
.Menu_GetTitle(*args
, **kwargs
)
10917 def SetEventHandler(*args
, **kwargs
):
10918 """SetEventHandler(self, EvtHandler handler)"""
10919 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
10921 def GetEventHandler(*args
, **kwargs
):
10922 """GetEventHandler(self) -> EvtHandler"""
10923 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
10925 def SetInvokingWindow(*args
, **kwargs
):
10926 """SetInvokingWindow(self, Window win)"""
10927 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
10929 def GetInvokingWindow(*args
, **kwargs
):
10930 """GetInvokingWindow(self) -> Window"""
10931 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
10933 def GetStyle(*args
, **kwargs
):
10934 """GetStyle(self) -> long"""
10935 return _core_
.Menu_GetStyle(*args
, **kwargs
)
10937 def UpdateUI(*args
, **kwargs
):
10938 """UpdateUI(self, EvtHandler source=None)"""
10939 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
10941 def GetMenuBar(*args
, **kwargs
):
10942 """GetMenuBar(self) -> MenuBar"""
10943 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
10945 def Attach(*args
, **kwargs
):
10946 """Attach(self, wxMenuBarBase menubar)"""
10947 return _core_
.Menu_Attach(*args
, **kwargs
)
10949 def Detach(*args
, **kwargs
):
10951 return _core_
.Menu_Detach(*args
, **kwargs
)
10953 def IsAttached(*args
, **kwargs
):
10954 """IsAttached(self) -> bool"""
10955 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10957 def SetParent(*args
, **kwargs
):
10958 """SetParent(self, Menu parent)"""
10959 return _core_
.Menu_SetParent(*args
, **kwargs
)
10961 def GetParent(*args
, **kwargs
):
10962 """GetParent(self) -> Menu"""
10963 return _core_
.Menu_GetParent(*args
, **kwargs
)
10965 EventHandler
= property(GetEventHandler
,SetEventHandler
,doc
="See `GetEventHandler` and `SetEventHandler`")
10966 HelpString
= property(GetHelpString
,SetHelpString
,doc
="See `GetHelpString` and `SetHelpString`")
10967 InvokingWindow
= property(GetInvokingWindow
,SetInvokingWindow
,doc
="See `GetInvokingWindow` and `SetInvokingWindow`")
10968 MenuBar
= property(GetMenuBar
,doc
="See `GetMenuBar`")
10969 MenuItemCount
= property(GetMenuItemCount
,doc
="See `GetMenuItemCount`")
10970 MenuItems
= property(GetMenuItems
,doc
="See `GetMenuItems`")
10971 Parent
= property(GetParent
,SetParent
,doc
="See `GetParent` and `SetParent`")
10972 Style
= property(GetStyle
,doc
="See `GetStyle`")
10973 Title
= property(GetTitle
,SetTitle
,doc
="See `GetTitle` and `SetTitle`")
10974 _core_
.Menu_swigregister(Menu
)
10975 DefaultValidator
= cvar
.DefaultValidator
10977 #---------------------------------------------------------------------------
10979 class MenuBar(Window
):
10980 """Proxy of C++ MenuBar class"""
10981 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10982 __repr__
= _swig_repr
10983 def __init__(self
, *args
, **kwargs
):
10984 """__init__(self, long style=0) -> MenuBar"""
10985 _core_
.MenuBar_swiginit(self
,_core_
.new_MenuBar(*args
, **kwargs
))
10986 self
._setOORInfo
(self
)
10988 def Append(*args
, **kwargs
):
10989 """Append(self, Menu menu, String title) -> bool"""
10990 return _core_
.MenuBar_Append(*args
, **kwargs
)
10992 def Insert(*args
, **kwargs
):
10993 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10994 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10996 def GetMenuCount(*args
, **kwargs
):
10997 """GetMenuCount(self) -> size_t"""
10998 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
11000 def GetMenu(*args
, **kwargs
):
11001 """GetMenu(self, size_t pos) -> Menu"""
11002 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
11004 def Replace(*args
, **kwargs
):
11005 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
11006 return _core_
.MenuBar_Replace(*args
, **kwargs
)
11008 def Remove(*args
, **kwargs
):
11009 """Remove(self, size_t pos) -> Menu"""
11010 return _core_
.MenuBar_Remove(*args
, **kwargs
)
11012 def EnableTop(*args
, **kwargs
):
11013 """EnableTop(self, size_t pos, bool enable)"""
11014 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
11016 def IsEnabledTop(*args
, **kwargs
):
11017 """IsEnabledTop(self, size_t pos) -> bool"""
11018 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
11020 def SetLabelTop(*args
, **kwargs
):
11021 """SetLabelTop(self, size_t pos, String label)"""
11022 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
11024 def GetLabelTop(*args
, **kwargs
):
11025 """GetLabelTop(self, size_t pos) -> String"""
11026 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
11028 def FindMenuItem(*args
, **kwargs
):
11029 """FindMenuItem(self, String menu, String item) -> int"""
11030 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
11032 def FindItemById(*args
, **kwargs
):
11033 """FindItemById(self, int id) -> MenuItem"""
11034 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
11036 def FindMenu(*args
, **kwargs
):
11037 """FindMenu(self, String title) -> int"""
11038 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
11040 def Enable(*args
, **kwargs
):
11041 """Enable(self, int id, bool enable)"""
11042 return _core_
.MenuBar_Enable(*args
, **kwargs
)
11044 def Check(*args
, **kwargs
):
11045 """Check(self, int id, bool check)"""
11046 return _core_
.MenuBar_Check(*args
, **kwargs
)
11048 def IsChecked(*args
, **kwargs
):
11049 """IsChecked(self, int id) -> bool"""
11050 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
11052 def IsEnabled(*args
, **kwargs
):
11053 """IsEnabled(self, int id) -> bool"""
11054 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
11056 def SetLabel(*args
, **kwargs
):
11057 """SetLabel(self, int id, String label)"""
11058 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
11060 def GetLabel(*args
, **kwargs
):
11061 """GetLabel(self, int id) -> String"""
11062 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
11064 def SetHelpString(*args
, **kwargs
):
11065 """SetHelpString(self, int id, String helpString)"""
11066 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
11068 def GetHelpString(*args
, **kwargs
):
11069 """GetHelpString(self, int id) -> String"""
11070 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
11072 def GetFrame(*args
, **kwargs
):
11073 """GetFrame(self) -> wxFrame"""
11074 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
11076 def IsAttached(*args
, **kwargs
):
11077 """IsAttached(self) -> bool"""
11078 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
11080 def Attach(*args
, **kwargs
):
11081 """Attach(self, wxFrame frame)"""
11082 return _core_
.MenuBar_Attach(*args
, **kwargs
)
11084 def Detach(*args
, **kwargs
):
11086 return _core_
.MenuBar_Detach(*args
, **kwargs
)
11088 def UpdateMenus(*args
, **kwargs
):
11089 """UpdateMenus(self)"""
11090 return _core_
.MenuBar_UpdateMenus(*args
, **kwargs
)
11092 def SetAutoWindowMenu(*args
, **kwargs
):
11093 """SetAutoWindowMenu(bool enable)"""
11094 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
11096 SetAutoWindowMenu
= staticmethod(SetAutoWindowMenu
)
11097 def GetAutoWindowMenu(*args
, **kwargs
):
11098 """GetAutoWindowMenu() -> bool"""
11099 return _core_
.MenuBar_GetAutoWindowMenu(*args
, **kwargs
)
11101 GetAutoWindowMenu
= staticmethod(GetAutoWindowMenu
)
11102 def GetMenus(self
):
11103 """Return a list of (menu, label) items for the menus in the MenuBar. """
11104 return [(self
.GetMenu(i
), self
.GetLabelTop(i
))
11105 for i
in range(self
.GetMenuCount())]
11107 def SetMenus(self
, items
):
11108 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11109 for i
in range(self
.GetMenuCount()-1, -1, -1):
11114 Frame
= property(GetFrame
,doc
="See `GetFrame`")
11115 MenuCount
= property(GetMenuCount
,doc
="See `GetMenuCount`")
11116 Menus
= property(GetMenus
,SetMenus
,doc
="See `GetMenus` and `SetMenus`")
11117 _core_
.MenuBar_swigregister(MenuBar
)
11119 def MenuBar_SetAutoWindowMenu(*args
, **kwargs
):
11120 """MenuBar_SetAutoWindowMenu(bool enable)"""
11121 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
11123 def MenuBar_GetAutoWindowMenu(*args
):
11124 """MenuBar_GetAutoWindowMenu() -> bool"""
11125 return _core_
.MenuBar_GetAutoWindowMenu(*args
)
11127 #---------------------------------------------------------------------------
11129 class MenuItem(Object
):
11130 """Proxy of C++ MenuItem class"""
11131 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11132 __repr__
= _swig_repr
11133 def __init__(self
, *args
, **kwargs
):
11135 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
11136 String help=EmptyString, int kind=ITEM_NORMAL,
11137 Menu subMenu=None) -> MenuItem
11139 _core_
.MenuItem_swiginit(self
,_core_
.new_MenuItem(*args
, **kwargs
))
11140 __swig_destroy__
= _core_
.delete_MenuItem
11141 __del__
= lambda self
: None;
11142 def Destroy(self
): pass
11143 def GetMenu(*args
, **kwargs
):
11144 """GetMenu(self) -> Menu"""
11145 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
11147 def SetMenu(*args
, **kwargs
):
11148 """SetMenu(self, Menu menu)"""
11149 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
11151 def SetId(*args
, **kwargs
):
11152 """SetId(self, int id)"""
11153 return _core_
.MenuItem_SetId(*args
, **kwargs
)
11155 def GetId(*args
, **kwargs
):
11156 """GetId(self) -> int"""
11157 return _core_
.MenuItem_GetId(*args
, **kwargs
)
11159 def IsSeparator(*args
, **kwargs
):
11160 """IsSeparator(self) -> bool"""
11161 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
11163 def SetText(*args
, **kwargs
):
11164 """SetText(self, String str)"""
11165 return _core_
.MenuItem_SetText(*args
, **kwargs
)
11167 def GetLabel(*args
, **kwargs
):
11168 """GetLabel(self) -> String"""
11169 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
11171 def GetText(*args
, **kwargs
):
11172 """GetText(self) -> String"""
11173 return _core_
.MenuItem_GetText(*args
, **kwargs
)
11175 def GetLabelFromText(*args
, **kwargs
):
11176 """GetLabelFromText(String text) -> String"""
11177 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
11179 GetLabelFromText
= staticmethod(GetLabelFromText
)
11180 def GetKind(*args
, **kwargs
):
11181 """GetKind(self) -> int"""
11182 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
11184 def SetKind(*args
, **kwargs
):
11185 """SetKind(self, int kind)"""
11186 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
11188 def SetCheckable(*args
, **kwargs
):
11189 """SetCheckable(self, bool checkable)"""
11190 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
11192 def IsCheckable(*args
, **kwargs
):
11193 """IsCheckable(self) -> bool"""
11194 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
11196 def IsSubMenu(*args
, **kwargs
):
11197 """IsSubMenu(self) -> bool"""
11198 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
11200 def SetSubMenu(*args
, **kwargs
):
11201 """SetSubMenu(self, Menu menu)"""
11202 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
11204 def GetSubMenu(*args
, **kwargs
):
11205 """GetSubMenu(self) -> Menu"""
11206 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
11208 def Enable(*args
, **kwargs
):
11209 """Enable(self, bool enable=True)"""
11210 return _core_
.MenuItem_Enable(*args
, **kwargs
)
11212 def IsEnabled(*args
, **kwargs
):
11213 """IsEnabled(self) -> bool"""
11214 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
11216 def Check(*args
, **kwargs
):
11217 """Check(self, bool check=True)"""
11218 return _core_
.MenuItem_Check(*args
, **kwargs
)
11220 def IsChecked(*args
, **kwargs
):
11221 """IsChecked(self) -> bool"""
11222 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
11224 def Toggle(*args
, **kwargs
):
11226 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
11228 def SetHelp(*args
, **kwargs
):
11229 """SetHelp(self, String str)"""
11230 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
11232 def GetHelp(*args
, **kwargs
):
11233 """GetHelp(self) -> String"""
11234 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
11236 def GetAccel(*args
, **kwargs
):
11237 """GetAccel(self) -> AcceleratorEntry"""
11238 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
11240 def SetAccel(*args
, **kwargs
):
11241 """SetAccel(self, AcceleratorEntry accel)"""
11242 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
11244 def SetBitmap(*args
, **kwargs
):
11245 """SetBitmap(self, Bitmap bitmap)"""
11246 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
11248 def GetBitmap(*args
, **kwargs
):
11249 """GetBitmap(self) -> Bitmap"""
11250 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
11252 def SetFont(*args
, **kwargs
):
11253 """SetFont(self, Font font)"""
11254 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
11256 def GetFont(*args
, **kwargs
):
11257 """GetFont(self) -> Font"""
11258 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
11260 def SetTextColour(*args
, **kwargs
):
11261 """SetTextColour(self, Colour colText)"""
11262 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
11264 def GetTextColour(*args
, **kwargs
):
11265 """GetTextColour(self) -> Colour"""
11266 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
11268 def SetBackgroundColour(*args
, **kwargs
):
11269 """SetBackgroundColour(self, Colour colBack)"""
11270 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
11272 def GetBackgroundColour(*args
, **kwargs
):
11273 """GetBackgroundColour(self) -> Colour"""
11274 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
11276 def SetBitmaps(*args
, **kwargs
):
11277 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11278 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
11280 def SetDisabledBitmap(*args
, **kwargs
):
11281 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11282 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
11284 def GetDisabledBitmap(*args
, **kwargs
):
11285 """GetDisabledBitmap(self) -> Bitmap"""
11286 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
11288 def SetMarginWidth(*args
, **kwargs
):
11289 """SetMarginWidth(self, int nWidth)"""
11290 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
11292 def GetMarginWidth(*args
, **kwargs
):
11293 """GetMarginWidth(self) -> int"""
11294 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
11296 def GetDefaultMarginWidth(*args
, **kwargs
):
11297 """GetDefaultMarginWidth() -> int"""
11298 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
11300 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
11301 def IsOwnerDrawn(*args
, **kwargs
):
11302 """IsOwnerDrawn(self) -> bool"""
11303 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
11305 def SetOwnerDrawn(*args
, **kwargs
):
11306 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11307 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
11309 def ResetOwnerDrawn(*args
, **kwargs
):
11310 """ResetOwnerDrawn(self)"""
11311 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
11313 Accel
= property(GetAccel
,SetAccel
,doc
="See `GetAccel` and `SetAccel`")
11314 BackgroundColour
= property(GetBackgroundColour
,SetBackgroundColour
,doc
="See `GetBackgroundColour` and `SetBackgroundColour`")
11315 Bitmap
= property(GetBitmap
,SetBitmap
,doc
="See `GetBitmap` and `SetBitmap`")
11316 DisabledBitmap
= property(GetDisabledBitmap
,SetDisabledBitmap
,doc
="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11317 Font
= property(GetFont
,SetFont
,doc
="See `GetFont` and `SetFont`")
11318 Help
= property(GetHelp
,SetHelp
,doc
="See `GetHelp` and `SetHelp`")
11319 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
11320 Kind
= property(GetKind
,SetKind
,doc
="See `GetKind` and `SetKind`")
11321 Label
= property(GetLabel
,doc
="See `GetLabel`")
11322 MarginWidth
= property(GetMarginWidth
,SetMarginWidth
,doc
="See `GetMarginWidth` and `SetMarginWidth`")
11323 Menu
= property(GetMenu
,SetMenu
,doc
="See `GetMenu` and `SetMenu`")
11324 SubMenu
= property(GetSubMenu
,SetSubMenu
,doc
="See `GetSubMenu` and `SetSubMenu`")
11325 Text
= property(GetText
,SetText
,doc
="See `GetText` and `SetText`")
11326 TextColour
= property(GetTextColour
,SetTextColour
,doc
="See `GetTextColour` and `SetTextColour`")
11327 _core_
.MenuItem_swigregister(MenuItem
)
11329 def MenuItem_GetLabelFromText(*args
, **kwargs
):
11330 """MenuItem_GetLabelFromText(String text) -> String"""
11331 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
11333 def MenuItem_GetDefaultMarginWidth(*args
):
11334 """MenuItem_GetDefaultMarginWidth() -> int"""
11335 return _core_
.MenuItem_GetDefaultMarginWidth(*args
)
11337 #---------------------------------------------------------------------------
11339 class Control(Window
):
11341 This is the base class for a control or 'widget'.
11343 A control is generally a small window which processes user input
11344 and/or displays one or more item of data.
11346 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11347 __repr__
= _swig_repr
11348 def __init__(self
, *args
, **kwargs
):
11350 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11351 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11352 String name=ControlNameStr) -> Control
11354 Create a Control. Normally you should only call this from a subclass'
11355 __init__ as a plain old wx.Control is not very useful.
11357 _core_
.Control_swiginit(self
,_core_
.new_Control(*args
, **kwargs
))
11358 self
._setOORInfo
(self
)
11360 def Create(*args
, **kwargs
):
11362 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11363 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11364 String name=ControlNameStr) -> bool
11366 Do the 2nd phase and create the GUI control.
11368 return _core_
.Control_Create(*args
, **kwargs
)
11370 def GetAlignment(*args
, **kwargs
):
11372 GetAlignment(self) -> int
11374 Get the control alignment (left/right/centre, top/bottom/centre)
11376 return _core_
.Control_GetAlignment(*args
, **kwargs
)
11378 def GetLabelText(*args
, **kwargs
):
11380 GetLabelText(self) -> String
11382 Get just the text of the label, without mnemonic characters ('&')
11384 return _core_
.Control_GetLabelText(*args
, **kwargs
)
11386 def Command(*args
, **kwargs
):
11388 Command(self, CommandEvent event)
11390 Simulates the effect of the user issuing a command to the item.
11392 :see: `wx.CommandEvent`
11395 return _core_
.Control_Command(*args
, **kwargs
)
11397 def RemoveMnemonics(*args
, **kwargs
):
11399 RemoveMnemonics(String str) -> String
11401 removes the mnemonics characters
11403 return _core_
.Control_RemoveMnemonics(*args
, **kwargs
)
11405 RemoveMnemonics
= staticmethod(RemoveMnemonics
)
11406 def GetClassDefaultAttributes(*args
, **kwargs
):
11408 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11410 Get the default attributes for this class. This is useful if you want
11411 to use the same font or colour in your own control as in a standard
11412 control -- which is a much better idea than hard coding specific
11413 colours or fonts which might look completely out of place on the
11414 user's system, especially if it uses themes.
11416 The variant parameter is only relevant under Mac currently and is
11417 ignore under other platforms. Under Mac, it will change the size of
11418 the returned font. See `wx.Window.SetWindowVariant` for more about
11421 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
11423 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
11424 Alignment
= property(GetAlignment
,doc
="See `GetAlignment`")
11425 LabelText
= property(GetLabelText
,doc
="See `GetLabelText`")
11426 _core_
.Control_swigregister(Control
)
11427 ControlNameStr
= cvar
.ControlNameStr
11429 def PreControl(*args
, **kwargs
):
11431 PreControl() -> Control
11433 Precreate a Control control for 2-phase creation
11435 val
= _core_
.new_PreControl(*args
, **kwargs
)
11438 def Control_RemoveMnemonics(*args
, **kwargs
):
11440 Control_RemoveMnemonics(String str) -> String
11442 removes the mnemonics characters
11444 return _core_
.Control_RemoveMnemonics(*args
, **kwargs
)
11446 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
11448 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11450 Get the default attributes for this class. This is useful if you want
11451 to use the same font or colour in your own control as in a standard
11452 control -- which is a much better idea than hard coding specific
11453 colours or fonts which might look completely out of place on the
11454 user's system, especially if it uses themes.
11456 The variant parameter is only relevant under Mac currently and is
11457 ignore under other platforms. Under Mac, it will change the size of
11458 the returned font. See `wx.Window.SetWindowVariant` for more about
11461 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
11463 #---------------------------------------------------------------------------
11465 class ItemContainer(object):
11467 The wx.ItemContainer class defines an interface which is implemented
11468 by all controls which have string subitems, each of which may be
11469 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11470 as `wx.ComboBox` which implements an extended interface deriving from
11473 It defines the methods for accessing the control's items and although
11474 each of the derived classes implements them differently, they still
11475 all conform to the same interface.
11477 The items in a wx.ItemContainer have (non empty) string labels and,
11478 optionally, client data associated with them.
11481 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11482 def __init__(self
): raise AttributeError, "No constructor defined"
11483 __repr__
= _swig_repr
11484 def Append(*args
, **kwargs
):
11486 Append(self, String item, PyObject clientData=None) -> int
11488 Adds the item to the control, associating the given data with the item
11489 if not None. The return value is the index of the newly added item
11490 which may be different from the last one if the control is sorted (e.g.
11491 has wx.LB_SORT or wx.CB_SORT style).
11493 return _core_
.ItemContainer_Append(*args
, **kwargs
)
11495 def AppendItems(*args
, **kwargs
):
11497 AppendItems(self, List strings)
11499 Apend several items at once to the control. Notice that calling this
11500 method may be much faster than appending the items one by one if you
11501 need to add a lot of items.
11503 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
11505 def Insert(*args
, **kwargs
):
11507 Insert(self, String item, int pos, PyObject clientData=None) -> int
11509 Insert an item into the control before the item at the ``pos`` index,
11510 optionally associating some data object with the item.
11512 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
11514 def Clear(*args
, **kwargs
):
11518 Removes all items from the control.
11520 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
11522 def Delete(*args
, **kwargs
):
11524 Delete(self, int n)
11526 Deletes the item at the zero-based index 'n' from the control. Note
11527 that it is an error (signalled by a `wx.PyAssertionError` exception if
11528 enabled) to remove an item with the index negative or greater or equal
11529 than the number of items in the control.
11531 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
11533 def GetClientData(*args
, **kwargs
):
11535 GetClientData(self, int n) -> PyObject
11537 Returns the client data associated with the given item, (if any.)
11539 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
11541 def SetClientData(*args
, **kwargs
):
11543 SetClientData(self, int n, PyObject clientData)
11545 Associate the given client data with the item at position n.
11547 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
11549 def GetCount(*args
, **kwargs
):
11551 GetCount(self) -> int
11553 Returns the number of items in the control.
11555 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
11557 def IsEmpty(*args
, **kwargs
):
11559 IsEmpty(self) -> bool
11561 Returns True if the control is empty or False if it has some items.
11563 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
11565 def GetString(*args
, **kwargs
):
11567 GetString(self, int n) -> String
11569 Returns the label of the item with the given index.
11571 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
11573 def GetStrings(*args
, **kwargs
):
11574 """GetStrings(self) -> wxArrayString"""
11575 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
11577 def SetString(*args
, **kwargs
):
11579 SetString(self, int n, String s)
11581 Sets the label for the given item.
11583 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
11585 def FindString(*args
, **kwargs
):
11587 FindString(self, String s) -> int
11589 Finds an item whose label matches the given string. Returns the
11590 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11593 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
11595 def SetSelection(*args
, **kwargs
):
11597 SetSelection(self, int n)
11599 Sets the item at index 'n' to be the selected item.
11601 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
11603 def GetSelection(*args
, **kwargs
):
11605 GetSelection(self) -> int
11607 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11610 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
11612 def SetStringSelection(*args
, **kwargs
):
11613 """SetStringSelection(self, String s) -> bool"""
11614 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
11616 def GetStringSelection(*args
, **kwargs
):
11618 GetStringSelection(self) -> String
11620 Returns the label of the selected item or an empty string if no item
11623 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
11625 def Select(*args
, **kwargs
):
11627 Select(self, int n)
11629 This is the same as `SetSelection` and exists only because it is
11630 slightly more natural for controls which support multiple selection.
11632 return _core_
.ItemContainer_Select(*args
, **kwargs
)
11634 def GetItems(self
):
11635 """Return a list of the strings in the control"""
11636 return [self
.GetString(i
) for i
in xrange(self
.GetCount())]
11638 def SetItems(self
, items
):
11639 """Clear and set the strings in the control from a list"""
11644 Count
= property(GetCount
,doc
="See `GetCount`")
11645 Items
= property(GetItems
,SetItems
,doc
="See `GetItems` and `SetItems`")
11646 Selection
= property(GetSelection
,SetSelection
,doc
="See `GetSelection` and `SetSelection`")
11647 StringSelection
= property(GetStringSelection
,SetStringSelection
,doc
="See `GetStringSelection` and `SetStringSelection`")
11648 Strings
= property(GetStrings
,doc
="See `GetStrings`")
11649 _core_
.ItemContainer_swigregister(ItemContainer
)
11651 #---------------------------------------------------------------------------
11653 class ControlWithItems(Control
,ItemContainer
):
11655 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11656 wx.Control class, and is used for the base class of various controls
11659 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11660 def __init__(self
): raise AttributeError, "No constructor defined"
11661 __repr__
= _swig_repr
11662 _core_
.ControlWithItems_swigregister(ControlWithItems
)
11664 #---------------------------------------------------------------------------
11666 class SizerFlags(object):
11668 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11669 to specify a lot of flags and parameters which can be unwieldy. This
11670 is where wx.SizerFlags comes in: it allows you to specify all
11671 parameters using the named methods instead. For example, instead of::
11673 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11675 you can now write::
11677 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11679 This is more readable and also allows you to create wx.SizerFlags
11680 objects which can be reused for several sizer items.::
11682 flagsExpand = wx.SizerFlags(1)
11683 flagsExpand.Expand().Border(wx.ALL, 10)
11684 sizer.AddF(ctrl1, flagsExpand)
11685 sizer.AddF(ctrl2, flagsExpand)
11687 Note that by specification, all methods of wx.SizerFlags return the
11688 wx.SizerFlags object itself allowing chaining multiple method calls
11689 like in the examples above.
11691 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11692 __repr__
= _swig_repr
11693 def __init__(self
, *args
, **kwargs
):
11695 __init__(self, int proportion=0) -> SizerFlags
11697 Constructs the flags object with the specified proportion.
11699 _core_
.SizerFlags_swiginit(self
,_core_
.new_SizerFlags(*args
, **kwargs
))
11700 __swig_destroy__
= _core_
.delete_SizerFlags
11701 __del__
= lambda self
: None;
11702 def Proportion(*args
, **kwargs
):
11704 Proportion(self, int proportion) -> SizerFlags
11706 Sets the item's proportion value.
11708 return _core_
.SizerFlags_Proportion(*args
, **kwargs
)
11710 def Align(*args
, **kwargs
):
11712 Align(self, int alignment) -> SizerFlags
11714 Sets the item's alignment
11716 return _core_
.SizerFlags_Align(*args
, **kwargs
)
11718 def Expand(*args
, **kwargs
):
11720 Expand(self) -> SizerFlags
11722 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11723 fill as much space as it is given by the sizer.
11725 return _core_
.SizerFlags_Expand(*args
, **kwargs
)
11727 def Centre(*args
, **kwargs
):
11729 Centre(self) -> SizerFlags
11731 Same as `Center` for those with an alternate dialect of English.
11733 return _core_
.SizerFlags_Centre(*args
, **kwargs
)
11735 def Center(*args
, **kwargs
):
11737 Center(self) -> SizerFlags
11739 Sets the centering alignment flags.
11741 return _core_
.SizerFlags_Center(*args
, **kwargs
)
11743 def Left(*args
, **kwargs
):
11745 Left(self) -> SizerFlags
11747 Aligns the object to the left, a shortcut for calling
11748 Align(wx.ALIGN_LEFT)
11750 return _core_
.SizerFlags_Left(*args
, **kwargs
)
11752 def Right(*args
, **kwargs
):
11754 Right(self) -> SizerFlags
11756 Aligns the object to the right, a shortcut for calling
11757 Align(wx.ALIGN_RIGHT)
11759 return _core_
.SizerFlags_Right(*args
, **kwargs
)
11761 def Top(*args
, **kwargs
):
11763 Top(self) -> SizerFlags
11765 Aligns the object to the top of the available space, a shortcut for
11766 calling Align(wx.ALIGN_TOP)
11768 return _core_
.SizerFlags_Top(*args
, **kwargs
)
11770 def Bottom(*args
, **kwargs
):
11772 Bottom(self) -> SizerFlags
11774 Aligns the object to the bottom of the available space, a shortcut for
11775 calling Align(wx.ALIGN_BOTTOM)
11777 return _core_
.SizerFlags_Bottom(*args
, **kwargs
)
11779 def Shaped(*args
, **kwargs
):
11781 Shaped(self) -> SizerFlags
11783 Sets the wx.SHAPED flag.
11785 return _core_
.SizerFlags_Shaped(*args
, **kwargs
)
11787 def FixedMinSize(*args
, **kwargs
):
11789 FixedMinSize(self) -> SizerFlags
11791 Sets the wx.FIXED_MINSIZE flag.
11793 return _core_
.SizerFlags_FixedMinSize(*args
, **kwargs
)
11795 def Border(*args
, **kwargs
):
11797 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11799 Sets the border of the item in the direction(s) or sides given by the
11800 direction parameter. If the borderInPixels value is not given then
11801 the default border size (see `GetDefaultBorder`) will be used.
11803 return _core_
.SizerFlags_Border(*args
, **kwargs
)
11805 def DoubleBorder(*args
, **kwargs
):
11807 DoubleBorder(self, int direction=ALL) -> SizerFlags
11809 Sets the border in the given direction to twice the default border
11812 return _core_
.SizerFlags_DoubleBorder(*args
, **kwargs
)
11814 def TripleBorder(*args
, **kwargs
):
11816 TripleBorder(self, int direction=ALL) -> SizerFlags
11818 Sets the border in the given direction to three times the default
11821 return _core_
.SizerFlags_TripleBorder(*args
, **kwargs
)
11823 def HorzBorder(*args
, **kwargs
):
11825 HorzBorder(self) -> SizerFlags
11827 Sets the left and right borders to the default border size.
11829 return _core_
.SizerFlags_HorzBorder(*args
, **kwargs
)
11831 def DoubleHorzBorder(*args
, **kwargs
):
11833 DoubleHorzBorder(self) -> SizerFlags
11835 Sets the left and right borders to twice the default border size.
11837 return _core_
.SizerFlags_DoubleHorzBorder(*args
, **kwargs
)
11839 def GetDefaultBorder(*args
, **kwargs
):
11841 GetDefaultBorder() -> int
11843 Returns the default border size used by the other border methods
11845 return _core_
.SizerFlags_GetDefaultBorder(*args
, **kwargs
)
11847 GetDefaultBorder
= staticmethod(GetDefaultBorder
)
11848 def GetProportion(*args
, **kwargs
):
11850 GetProportion(self) -> int
11852 Returns the proportion value to be used in the sizer item.
11854 return _core_
.SizerFlags_GetProportion(*args
, **kwargs
)
11856 def GetFlags(*args
, **kwargs
):
11858 GetFlags(self) -> int
11860 Returns the flags value to be used in the sizer item.
11862 return _core_
.SizerFlags_GetFlags(*args
, **kwargs
)
11864 def GetBorderInPixels(*args
, **kwargs
):
11866 GetBorderInPixels(self) -> int
11868 Returns the border value in pixels to be used in the sizer item.
11870 return _core_
.SizerFlags_GetBorderInPixels(*args
, **kwargs
)
11872 _core_
.SizerFlags_swigregister(SizerFlags
)
11874 def SizerFlags_GetDefaultBorder(*args
):
11876 SizerFlags_GetDefaultBorder() -> int
11878 Returns the default border size used by the other border methods
11880 return _core_
.SizerFlags_GetDefaultBorder(*args
)
11882 class SizerItem(Object
):
11884 The wx.SizerItem class is used to track the position, size and other
11885 attributes of each item managed by a `wx.Sizer`. It is not usually
11886 necessary to use this class because the sizer elements can also be
11887 identified by their positions or window or sizer references but
11888 sometimes it may be more convenient to use wx.SizerItem directly.
11889 Also, custom classes derived from `wx.PySizer` will probably need to
11890 use the collection of wx.SizerItems held by wx.Sizer when calculating
11893 :see: `wx.Sizer`, `wx.GBSizerItem`
11895 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11896 __repr__
= _swig_repr
11897 def __init__(self
, *args
, **kwargs
):
11899 __init__(self) -> SizerItem
11901 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11902 size will need to be set before this item can be used in a Sizer.
11904 You will probably never need to create a wx.SizerItem directly as they
11905 are created automatically when the sizer's Add, Insert or Prepend
11906 methods are called.
11908 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11910 _core_
.SizerItem_swiginit(self
,_core_
.new_SizerItem(*args
, **kwargs
))
11911 __swig_destroy__
= _core_
.delete_SizerItem
11912 __del__
= lambda self
: None;
11913 def DeleteWindows(*args
, **kwargs
):
11915 DeleteWindows(self)
11917 Destroy the window or the windows in a subsizer, depending on the type
11920 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
11922 def DetachSizer(*args
, **kwargs
):
11926 Enable deleting the SizerItem without destroying the contained sizer.
11928 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
11930 def GetSize(*args
, **kwargs
):
11932 GetSize(self) -> Size
11934 Get the current size of the item, as set in the last Layout.
11936 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
11938 def CalcMin(*args
, **kwargs
):
11940 CalcMin(self) -> Size
11942 Calculates the minimum desired size for the item, including any space
11945 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
11947 def SetDimension(*args
, **kwargs
):
11949 SetDimension(self, Point pos, Size size)
11951 Set the position and size of the space allocated for this item by the
11952 sizer, and adjust the position and size of the item (window or
11953 subsizer) to be within that space taking alignment and borders into
11956 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
11958 def GetMinSize(*args
, **kwargs
):
11960 GetMinSize(self) -> Size
11962 Get the minimum size needed for the item.
11964 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
11966 def GetMinSizeWithBorder(*args
, **kwargs
):
11968 GetMinSizeWithBorder(self) -> Size
11970 Get the minimum size needed for the item with space for the borders
11973 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
11975 def SetInitSize(*args
, **kwargs
):
11976 """SetInitSize(self, int x, int y)"""
11977 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
11979 def SetRatioWH(*args
, **kwargs
):
11981 SetRatioWH(self, int width, int height)
11983 Set the ratio item attribute.
11985 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
11987 def SetRatioSize(*args
, **kwargs
):
11989 SetRatioSize(self, Size size)
11991 Set the ratio item attribute.
11993 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
11995 def SetRatio(*args
, **kwargs
):
11997 SetRatio(self, float ratio)
11999 Set the ratio item attribute.
12001 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
12003 def GetRatio(*args
, **kwargs
):
12005 GetRatio(self) -> float
12007 Set the ratio item attribute.
12009 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
12011 def GetRect(*args
, **kwargs
):
12013 GetRect(self) -> Rect
12015 Returns the rectangle that the sizer item should occupy
12017 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
12019 def IsWindow(*args
, **kwargs
):
12021 IsWindow(self) -> bool
12023 Is this sizer item a window?
12025 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
12027 def IsSizer(*args
, **kwargs
):
12029 IsSizer(self) -> bool
12031 Is this sizer item a subsizer?
12033 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
12035 def IsSpacer(*args
, **kwargs
):
12037 IsSpacer(self) -> bool
12039 Is this sizer item a spacer?
12041 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
12043 def SetProportion(*args
, **kwargs
):
12045 SetProportion(self, int proportion)
12047 Set the proportion value for this item.
12049 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
12051 def GetProportion(*args
, **kwargs
):
12053 GetProportion(self) -> int
12055 Get the proportion value for this item.
12057 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
12059 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
12060 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
12061 def SetFlag(*args
, **kwargs
):
12063 SetFlag(self, int flag)
12065 Set the flag value for this item.
12067 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
12069 def GetFlag(*args
, **kwargs
):
12071 GetFlag(self) -> int
12073 Get the flag value for this item.
12075 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
12077 def SetBorder(*args
, **kwargs
):
12079 SetBorder(self, int border)
12081 Set the border value for this item.
12083 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
12085 def GetBorder(*args
, **kwargs
):
12087 GetBorder(self) -> int
12089 Get the border value for this item.
12091 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
12093 def GetWindow(*args
, **kwargs
):
12095 GetWindow(self) -> Window
12097 Get the window (if any) that is managed by this sizer item.
12099 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
12101 def GetSizer(*args
, **kwargs
):
12103 GetSizer(self) -> Sizer
12105 Get the subsizer (if any) that is managed by this sizer item.
12107 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
12109 def GetSpacer(*args
, **kwargs
):
12111 GetSpacer(self) -> Size
12113 Get the size of the spacer managed by this sizer item.
12115 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
12117 def SetWindow(*args
, **kwargs
):
12119 SetWindow(self, Window window)
12121 Set the window to be managed by this sizer item.
12123 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
12125 def SetSizer(*args
, **kwargs
):
12127 SetSizer(self, Sizer sizer)
12129 Set the subsizer to be managed by this sizer item.
12131 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
12133 def SetSpacer(*args
, **kwargs
):
12135 SetSpacer(self, Size size)
12137 Set the size of the spacer to be managed by this sizer item.
12139 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
12141 SetWindow
= wx
._deprecated
(SetWindow
, "Use `AssignWindow` instead.")
12142 SetSizer
= wx
._deprecated
(SetSizer
, "Use `AssignSizer` instead.")
12143 SetSpacer
= wx
._deprecated
(SetSpacer
, "Use `AssignSpacer` instead.")
12145 def AssignWindow(*args
, **kwargs
):
12147 AssignWindow(self, Window window)
12149 Set the window to be managed by this sizer item.
12151 return _core_
.SizerItem_AssignWindow(*args
, **kwargs
)
12153 def AssignSizer(*args
, **kwargs
):
12155 AssignSizer(self, Sizer sizer)
12157 Set the subsizer to be managed by this sizer item.
12159 return _core_
.SizerItem_AssignSizer(*args
, **kwargs
)
12161 def AssignSpacer(*args
, **kwargs
):
12163 AssignSpacer(self, Size size)
12165 Set the size of the spacer to be managed by this sizer item.
12167 return _core_
.SizerItem_AssignSpacer(*args
, **kwargs
)
12169 def Show(*args
, **kwargs
):
12171 Show(self, bool show)
12173 Set the show item attribute, which sizers use to determine if the item
12174 is to be made part of the layout or not. If the item is tracking a
12175 window then it is shown or hidden as needed.
12177 return _core_
.SizerItem_Show(*args
, **kwargs
)
12179 def IsShown(*args
, **kwargs
):
12181 IsShown(self) -> bool
12183 Is the item to be shown in the layout?
12185 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
12187 def GetPosition(*args
, **kwargs
):
12189 GetPosition(self) -> Point
12191 Returns the current position of the item, as set in the last Layout.
12193 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
12195 def GetUserData(*args
, **kwargs
):
12197 GetUserData(self) -> PyObject
12199 Returns the userData associated with this sizer item, or None if there
12202 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
12204 def SetUserData(*args
, **kwargs
):
12206 SetUserData(self, PyObject userData)
12208 Associate a Python object with this sizer item.
12210 return _core_
.SizerItem_SetUserData(*args
, **kwargs
)
12212 Border
= property(GetBorder
,SetBorder
,doc
="See `GetBorder` and `SetBorder`")
12213 Flag
= property(GetFlag
,SetFlag
,doc
="See `GetFlag` and `SetFlag`")
12214 MinSize
= property(GetMinSize
,doc
="See `GetMinSize`")
12215 MinSizeWithBorder
= property(GetMinSizeWithBorder
,doc
="See `GetMinSizeWithBorder`")
12216 Position
= property(GetPosition
,doc
="See `GetPosition`")
12217 Proportion
= property(GetProportion
,SetProportion
,doc
="See `GetProportion` and `SetProportion`")
12218 Ratio
= property(GetRatio
,SetRatio
,doc
="See `GetRatio` and `SetRatio`")
12219 Rect
= property(GetRect
,doc
="See `GetRect`")
12220 Size
= property(GetSize
,doc
="See `GetSize`")
12221 Sizer
= property(GetSizer
,AssignSizer
,doc
="See `GetSizer` and `AssignSizer`")
12222 Spacer
= property(GetSpacer
,AssignSpacer
,doc
="See `GetSpacer` and `AssignSpacer`")
12223 UserData
= property(GetUserData
,SetUserData
,doc
="See `GetUserData` and `SetUserData`")
12224 Window
= property(GetWindow
,AssignWindow
,doc
="See `GetWindow` and `AssignWindow`")
12225 _core_
.SizerItem_swigregister(SizerItem
)
12227 def SizerItemWindow(*args
, **kwargs
):
12229 SizerItemWindow(Window window, int proportion, int flag, int border,
12230 PyObject userData=None) -> SizerItem
12232 Constructs a `wx.SizerItem` for tracking a window.
12234 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
12237 def SizerItemSpacer(*args
, **kwargs
):
12239 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
12240 PyObject userData=None) -> SizerItem
12242 Constructs a `wx.SizerItem` for tracking a spacer.
12244 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
12247 def SizerItemSizer(*args
, **kwargs
):
12249 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
12250 PyObject userData=None) -> SizerItem
12252 Constructs a `wx.SizerItem` for tracking a subsizer
12254 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
12257 class Sizer(Object
):
12259 wx.Sizer is the abstract base class used for laying out subwindows in
12260 a window. You cannot use wx.Sizer directly; instead, you will have to
12261 use one of the sizer classes derived from it such as `wx.BoxSizer`,
12262 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12265 The concept implemented by sizers in wxWidgets is closely related to
12266 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12267 toolkit or the Qt toolkit. It is based upon the idea of the individual
12268 subwindows reporting their minimal required size and their ability to
12269 get stretched if the size of the parent window has changed. This will
12270 most often mean that the programmer does not set the original size of
12271 a dialog in the beginning, rather the dialog will assigned a sizer and
12272 this sizer will be queried about the recommended size. The sizer in
12273 turn will query its children, which can be normal windows or contorls,
12274 empty space or other sizers, so that a hierarchy of sizers can be
12275 constructed. Note that wxSizer does not derive from wxWindow and thus
12276 do not interfere with tab ordering and requires very little resources
12277 compared to a real window on screen.
12279 What makes sizers so well fitted for use in wxWidgets is the fact that
12280 every control reports its own minimal size and the algorithm can
12281 handle differences in font sizes or different window (dialog item)
12282 sizes on different platforms without problems. If for example the
12283 standard font as well as the overall design of Mac widgets requires
12284 more space than on Windows, then the initial size of a dialog using a
12285 sizer will automatically be bigger on Mac than on Windows.
12287 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12288 def __init__(self
): raise AttributeError, "No constructor defined"
12289 __repr__
= _swig_repr
12290 __swig_destroy__
= _core_
.delete_Sizer
12291 __del__
= lambda self
: None;
12292 def _setOORInfo(*args
, **kwargs
):
12293 """_setOORInfo(self, PyObject _self)"""
12294 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
12296 def Add(*args
, **kwargs
):
12298 Add(self, item, int proportion=0, int flag=0, int border=0,
12299 PyObject userData=None) -> wx.SizerItem
12301 Appends a child item to the sizer.
12303 return _core_
.Sizer_Add(*args
, **kwargs
)
12305 def AddF(*args
, **kwargs
):
12307 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12309 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12310 setting the various flags, options and borders.
12312 return _core_
.Sizer_AddF(*args
, **kwargs
)
12314 def Insert(*args
, **kwargs
):
12316 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
12317 PyObject userData=None) -> wx.SizerItem
12319 Inserts a new item into the list of items managed by this sizer before
12320 the item at index *before*. See `Add` for a description of the parameters.
12322 return _core_
.Sizer_Insert(*args
, **kwargs
)
12324 def InsertF(*args
, **kwargs
):
12326 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12328 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12329 for setting the various flags, options and borders.
12331 return _core_
.Sizer_InsertF(*args
, **kwargs
)
12333 def Prepend(*args
, **kwargs
):
12335 Prepend(self, item, int proportion=0, int flag=0, int border=0,
12336 PyObject userData=None) -> wx.SizerItem
12338 Adds a new item to the begining of the list of sizer items managed by
12339 this sizer. See `Add` for a description of the parameters.
12341 return _core_
.Sizer_Prepend(*args
, **kwargs
)
12343 def PrependF(*args
, **kwargs
):
12345 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12347 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12348 for setting the various flags, options and borders.
12350 return _core_
.Sizer_PrependF(*args
, **kwargs
)
12352 def Remove(*args
, **kwargs
):
12354 Remove(self, item) -> bool
12356 Removes an item from the sizer and destroys it. This method does not
12357 cause any layout or resizing to take place, call `Layout` to update
12358 the layout on screen after removing a child from the sizer. The
12359 *item* parameter can be either a window, a sizer, or the zero-based
12360 index of an item to remove. Returns True if the child item was found
12363 return _core_
.Sizer_Remove(*args
, **kwargs
)
12365 def Detach(*args
, **kwargs
):
12367 Detach(self, item) -> bool
12369 Detaches an item from the sizer without destroying it. This method
12370 does not cause any layout or resizing to take place, call `Layout` to
12371 do so. The *item* parameter can be either a window, a sizer, or the
12372 zero-based index of the item to be detached. Returns True if the child item
12373 was found and detached.
12375 return _core_
.Sizer_Detach(*args
, **kwargs
)
12377 def GetItem(*args
, **kwargs
):
12379 GetItem(self, item, recursive=False) -> wx.SizerItem
12381 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12382 parameter can be either a window, a sizer, or the zero-based index of
12383 the item to be found.
12385 return _core_
.Sizer_GetItem(*args
, **kwargs
)
12387 def _SetItemMinSize(*args
, **kwargs
):
12388 """_SetItemMinSize(self, PyObject item, Size size)"""
12389 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
12391 def _ReplaceWin(*args
, **kwargs
):
12392 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12393 return _core_
.Sizer__ReplaceWin(*args
, **kwargs
)
12395 def _ReplaceSizer(*args
, **kwargs
):
12396 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12397 return _core_
.Sizer__ReplaceSizer(*args
, **kwargs
)
12399 def _ReplaceItem(*args
, **kwargs
):
12400 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12401 return _core_
.Sizer__ReplaceItem(*args
, **kwargs
)
12403 def Replace(self
, olditem
, item
, recursive
=False):
12405 Detaches the given ``olditem`` from the sizer and replaces it with
12406 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12407 detached child is destroyed only if it is not a window, (because
12408 windows are owned by their parent, not the sizer.) The
12409 ``recursive`` parameter can be used to search for the given
12410 element recursivly in subsizers.
12412 This method does not cause any layout or resizing to take place,
12413 call `Layout` to do so.
12415 Returns ``True`` if the child item was found and removed.
12417 if isinstance(olditem
, wx
.Window
):
12418 return self
._ReplaceWin
(olditem
, item
, recursive
)
12419 elif isinstance(olditem
, wx
.Sizer
):
12420 return self
._ReplaceSizer
(olditem
, item
, recursive
)
12421 elif isinstance(olditem
, int):
12422 return self
._ReplaceItem
(olditem
, item
)
12424 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12426 def SetContainingWindow(*args
, **kwargs
):
12428 SetContainingWindow(self, Window window)
12430 Set (or unset) the window this sizer is used in.
12432 return _core_
.Sizer_SetContainingWindow(*args
, **kwargs
)
12434 def GetContainingWindow(*args
, **kwargs
):
12436 GetContainingWindow(self) -> Window
12438 Get the window this sizer is used in.
12440 return _core_
.Sizer_GetContainingWindow(*args
, **kwargs
)
12442 def SetItemMinSize(self
, item
, *args
):
12444 SetItemMinSize(self, item, Size size)
12446 Sets the minimum size that will be allocated for an item in the sizer.
12447 The *item* parameter can be either a window, a sizer, or the
12448 zero-based index of the item. If a window or sizer is given then it
12449 will be searched for recursivly in subsizers if neccessary.
12452 # for backward compatibility accept separate width,height args too
12453 return self
._SetItemMinSize
(item
, args
)
12455 return self
._SetItemMinSize
(item
, args
[0])
12457 def AddItem(*args
, **kwargs
):
12459 AddItem(self, SizerItem item)
12461 Adds a `wx.SizerItem` to the sizer.
12463 return _core_
.Sizer_AddItem(*args
, **kwargs
)
12465 def InsertItem(*args
, **kwargs
):
12467 InsertItem(self, int index, SizerItem item)
12469 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12471 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
12473 def PrependItem(*args
, **kwargs
):
12475 PrependItem(self, SizerItem item)
12477 Prepends a `wx.SizerItem` to the sizer.
12479 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
12481 def AddMany(self
, items
):
12483 AddMany is a convenience method for adding several items
12484 to a sizer at one time. Simply pass it a list of tuples,
12485 where each tuple consists of the parameters that you
12486 would normally pass to the `Add` method.
12489 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
12493 def AddSpacer(self
, *args
, **kw
):
12494 """AddSpacer(int size) --> SizerItem
12496 Add a spacer that is (size,size) pixels.
12498 if args
and type(args
[0]) == int:
12499 return self
.Add( (args
[0],args
[0] ), 0)
12500 else: # otherwise stay compatible with old AddSpacer
12501 return self
.Add(*args
, **kw
)
12502 def PrependSpacer(self
, *args
, **kw
):
12503 """PrependSpacer(int size) --> SizerItem
12505 Prepend a spacer that is (size, size) pixels."""
12506 if args
and type(args
[0]) == int:
12507 return self
.Prepend( (args
[0],args
[0] ), 0)
12508 else: # otherwise stay compatible with old PrependSpacer
12509 return self
.Prepend(*args
, **kw
)
12510 def InsertSpacer(self
, index
, *args
, **kw
):
12511 """InsertSpacer(int index, int size) --> SizerItem
12513 Insert a spacer at position index that is (size, size) pixels."""
12514 if args
and type(args
[0]) == int:
12515 return self
.Insert( index
, (args
[0],args
[0] ), 0)
12516 else: # otherwise stay compatible with old InsertSpacer
12517 return self
.Insert(index
, *args
, **kw
)
12520 def AddStretchSpacer(self
, prop
=1):
12521 """AddStretchSpacer(int prop=1) --> SizerItem
12523 Add a stretchable spacer."""
12524 return self
.Add((0,0), prop
)
12525 def PrependStretchSpacer(self
, prop
=1):
12526 """PrependStretchSpacer(int prop=1) --> SizerItem
12528 Prepend a stretchable spacer."""
12529 return self
.Prepend((0,0), prop
)
12530 def InsertStretchSpacer(self
, index
, prop
=1):
12531 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12533 Insert a stretchable spacer."""
12534 return self
.Insert(index
, (0,0), prop
)
12537 # for backwards compatibility only, please do not use in new code
12538 def AddWindow(self
, *args
, **kw
):
12539 """Compatibility alias for `Add`."""
12540 return self
.Add(*args
, **kw
)
12541 def AddSizer(self
, *args
, **kw
):
12542 """Compatibility alias for `Add`."""
12543 return self
.Add(*args
, **kw
)
12545 def PrependWindow(self
, *args
, **kw
):
12546 """Compatibility alias for `Prepend`."""
12547 return self
.Prepend(*args
, **kw
)
12548 def PrependSizer(self
, *args
, **kw
):
12549 """Compatibility alias for `Prepend`."""
12550 return self
.Prepend(*args
, **kw
)
12552 def InsertWindow(self
, *args
, **kw
):
12553 """Compatibility alias for `Insert`."""
12554 return self
.Insert(*args
, **kw
)
12555 def InsertSizer(self
, *args
, **kw
):
12556 """Compatibility alias for `Insert`."""
12557 return self
.Insert(*args
, **kw
)
12559 def RemoveWindow(self
, *args
, **kw
):
12560 """Compatibility alias for `Remove`."""
12561 return self
.Remove(*args
, **kw
)
12562 def RemoveSizer(self
, *args
, **kw
):
12563 """Compatibility alias for `Remove`."""
12564 return self
.Remove(*args
, **kw
)
12565 def RemovePos(self
, *args
, **kw
):
12566 """Compatibility alias for `Remove`."""
12567 return self
.Remove(*args
, **kw
)
12570 def SetDimension(*args
, **kwargs
):
12572 SetDimension(self, int x, int y, int width, int height)
12574 Call this to force the sizer to take the given dimension and thus
12575 force the items owned by the sizer to resize themselves according to
12576 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12579 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
12581 def SetMinSize(*args
, **kwargs
):
12583 SetMinSize(self, Size size)
12585 Call this to give the sizer a minimal size. Normally, the sizer will
12586 calculate its minimal size based purely on how much space its children
12587 need. After calling this method `GetMinSize` will return either the
12588 minimal size as requested by its children or the minimal size set
12589 here, depending on which is bigger.
12591 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
12593 def GetSize(*args
, **kwargs
):
12595 GetSize(self) -> Size
12597 Returns the current size of the space managed by the sizer.
12599 return _core_
.Sizer_GetSize(*args
, **kwargs
)
12601 def GetPosition(*args
, **kwargs
):
12603 GetPosition(self) -> Point
12605 Returns the current position of the sizer's managed space.
12607 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
12609 def GetMinSize(*args
, **kwargs
):
12611 GetMinSize(self) -> Size
12613 Returns the minimal size of the sizer. This is either the combined
12614 minimal size of all the children and their borders or the minimal size
12615 set by SetMinSize, depending on which is bigger.
12617 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
12619 def GetSizeTuple(self
):
12620 return self
.GetSize().Get()
12621 def GetPositionTuple(self
):
12622 return self
.GetPosition().Get()
12623 def GetMinSizeTuple(self
):
12624 return self
.GetMinSize().Get()
12626 def RecalcSizes(*args
, **kwargs
):
12630 Using the sizes calculated by `CalcMin` reposition and resize all the
12631 items managed by this sizer. You should not need to call this directly as
12632 it is called by `Layout`.
12634 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
12636 def CalcMin(*args
, **kwargs
):
12638 CalcMin(self) -> Size
12640 This method is where the sizer will do the actual calculation of its
12641 children's minimal sizes. You should not need to call this directly as
12642 it is called by `Layout`.
12644 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
12646 def Layout(*args
, **kwargs
):
12650 This method will force the recalculation and layout of the items
12651 controlled by the sizer using the current space allocated to the
12652 sizer. Normally this is called automatically from the owning window's
12653 EVT_SIZE handler, but it is also useful to call it from user code when
12654 one of the items in a sizer change size, or items are added or
12657 return _core_
.Sizer_Layout(*args
, **kwargs
)
12659 def Fit(*args
, **kwargs
):
12661 Fit(self, Window window) -> Size
12663 Tell the sizer to resize the *window* to match the sizer's minimal
12664 size. This is commonly done in the constructor of the window itself in
12665 order to set its initial size to match the needs of the children as
12666 determined by the sizer. Returns the new size.
12668 For a top level window this is the total window size, not the client size.
12670 return _core_
.Sizer_Fit(*args
, **kwargs
)
12672 def FitInside(*args
, **kwargs
):
12674 FitInside(self, Window window)
12676 Tell the sizer to resize the *virtual size* of the *window* to match the
12677 sizer's minimal size. This will not alter the on screen size of the
12678 window, but may cause the addition/removal/alteration of scrollbars
12679 required to view the virtual area in windows which manage it.
12681 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12684 return _core_
.Sizer_FitInside(*args
, **kwargs
)
12686 def SetSizeHints(*args
, **kwargs
):
12688 SetSizeHints(self, Window window)
12690 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12691 match the sizer's minimal size. This is commonly done in the
12692 constructor of the window itself if the window is resizable (as are
12693 many dialogs under Unix and frames on probably all platforms) in order
12694 to prevent the window from being sized smaller than the minimal size
12695 required by the sizer.
12697 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
12699 def SetVirtualSizeHints(*args
, **kwargs
):
12701 SetVirtualSizeHints(self, Window window)
12703 Tell the sizer to set the minimal size of the window virtual area to
12704 match the sizer's minimal size. For windows with managed scrollbars
12705 this will set them appropriately.
12707 :see: `wx.ScrolledWindow.SetScrollbars`
12710 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
12712 def Clear(*args
, **kwargs
):
12714 Clear(self, bool deleteWindows=False)
12716 Clear all items from the sizer, optionally destroying the window items
12719 return _core_
.Sizer_Clear(*args
, **kwargs
)
12721 def DeleteWindows(*args
, **kwargs
):
12723 DeleteWindows(self)
12725 Destroy all windows managed by the sizer.
12727 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
12729 def GetChildren(*args
, **kwargs
):
12731 GetChildren(self) -> list
12733 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12735 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
12737 def Show(*args
, **kwargs
):
12739 Show(self, item, bool show=True, bool recursive=false) -> bool
12741 Shows or hides an item managed by the sizer. To make a sizer item
12742 disappear or reappear, use Show followed by `Layout`. The *item*
12743 parameter can be either a window, a sizer, or the zero-based index of
12744 the item. Use the recursive parameter to show or hide an item in a
12745 subsizer. Returns True if the item was found.
12747 return _core_
.Sizer_Show(*args
, **kwargs
)
12749 def IsShown(*args
, **kwargs
):
12751 IsShown(self, item)
12753 Determines if the item is currently shown. To make a sizer
12754 item disappear or reappear, use Show followed by `Layout`. The *item*
12755 parameter can be either a window, a sizer, or the zero-based index of
12758 return _core_
.Sizer_IsShown(*args
, **kwargs
)
12760 def Hide(self
, item
, recursive
=False):
12762 A convenience method for `Show` (item, False, recursive).
12764 return self
.Show(item
, False, recursive
)
12766 def ShowItems(*args
, **kwargs
):
12768 ShowItems(self, bool show)
12770 Recursively call `wx.SizerItem.Show` on all sizer items.
12772 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
12774 Children
= property(GetChildren
,doc
="See `GetChildren`")
12775 ContainingWindow
= property(GetContainingWindow
,SetContainingWindow
,doc
="See `GetContainingWindow` and `SetContainingWindow`")
12776 MinSize
= property(GetMinSize
,SetMinSize
,doc
="See `GetMinSize` and `SetMinSize`")
12777 Position
= property(GetPosition
,doc
="See `GetPosition`")
12778 Size
= property(GetSize
,doc
="See `GetSize`")
12779 _core_
.Sizer_swigregister(Sizer
)
12781 class PySizer(Sizer
):
12783 wx.PySizer is a special version of `wx.Sizer` that has been
12784 instrumented to allow the C++ virtual methods to be overloaded in
12785 Python derived classes. You would derive from this class if you are
12786 wanting to implement a custom sizer in Python code. Simply implement
12787 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12790 class MySizer(wx.PySizer):
12791 def __init__(self):
12792 wx.PySizer.__init__(self)
12795 for item in self.GetChildren():
12796 # calculate the total minimum width and height needed
12797 # by all items in the sizer according to this sizer's
12798 # layout algorithm.
12800 return wx.Size(width, height)
12802 def RecalcSizes(self):
12803 # find the space allotted to this sizer
12804 pos = self.GetPosition()
12805 size = self.GetSize()
12806 for item in self.GetChildren():
12807 # Recalculate (if necessary) the position and size of
12808 # each item and then call item.SetDimension to do the
12809 # actual positioning and sizing of the items within the
12810 # space alloted to this sizer.
12812 item.SetDimension(itemPos, itemSize)
12815 When `Layout` is called it first calls `CalcMin` followed by
12816 `RecalcSizes` so you can optimize a bit by saving the results of
12817 `CalcMin` and reusing them in `RecalcSizes`.
12819 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12823 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12824 __repr__
= _swig_repr
12825 def __init__(self
, *args
, **kwargs
):
12827 __init__(self) -> PySizer
12829 Creates a wx.PySizer. Must be called from the __init__ in the derived
12832 _core_
.PySizer_swiginit(self
,_core_
.new_PySizer(*args
, **kwargs
))
12833 self
._setOORInfo
(self
);PySizer
._setCallbackInfo
(self
, self
, PySizer
)
12835 def _setCallbackInfo(*args
, **kwargs
):
12836 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12837 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
12839 _core_
.PySizer_swigregister(PySizer
)
12841 #---------------------------------------------------------------------------
12843 class BoxSizer(Sizer
):
12845 The basic idea behind a box sizer is that windows will most often be
12846 laid out in rather simple basic geometry, typically in a row or a
12847 column or nested hierarchies of either. A wx.BoxSizer will lay out
12848 its items in a simple row or column, depending on the orientation
12849 parameter passed to the constructor.
12851 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12852 __repr__
= _swig_repr
12853 def __init__(self
, *args
, **kwargs
):
12855 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12857 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12858 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12861 _core_
.BoxSizer_swiginit(self
,_core_
.new_BoxSizer(*args
, **kwargs
))
12862 self
._setOORInfo
(self
)
12864 def GetOrientation(*args
, **kwargs
):
12866 GetOrientation(self) -> int
12868 Returns the current orientation of the sizer.
12870 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
12872 def SetOrientation(*args
, **kwargs
):
12874 SetOrientation(self, int orient)
12876 Resets the orientation of the sizer.
12878 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
12880 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
12881 _core_
.BoxSizer_swigregister(BoxSizer
)
12883 #---------------------------------------------------------------------------
12885 class StaticBoxSizer(BoxSizer
):
12887 wx.StaticBoxSizer derives from and functions identically to the
12888 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12889 manages. Note that this static box must be created separately and
12890 passed to the sizer constructor.
12892 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12893 __repr__
= _swig_repr
12894 def __init__(self
, *args
, **kwargs
):
12896 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12898 Constructor. It takes an associated static box and the orientation
12899 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12902 _core_
.StaticBoxSizer_swiginit(self
,_core_
.new_StaticBoxSizer(*args
, **kwargs
))
12903 self
._setOORInfo
(self
)
12905 def GetStaticBox(*args
, **kwargs
):
12907 GetStaticBox(self) -> StaticBox
12909 Returns the static box associated with this sizer.
12911 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
12913 StaticBox
= property(GetStaticBox
,doc
="See `GetStaticBox`")
12914 _core_
.StaticBoxSizer_swigregister(StaticBoxSizer
)
12916 #---------------------------------------------------------------------------
12918 class GridSizer(Sizer
):
12920 A grid sizer is a sizer which lays out its children in a
12921 two-dimensional table with all cells having the same size. In other
12922 words, the width of each cell within the grid is the width of the
12923 widest item added to the sizer and the height of each grid cell is the
12924 height of the tallest item. An optional vertical and/or horizontal
12925 gap between items can also be specified (in pixels.)
12927 Items are placed in the cells of the grid in the order they are added,
12928 in row-major order. In other words, the first row is filled first,
12929 then the second, and so on until all items have been added. (If
12930 neccessary, additional rows will be added as items are added.) If you
12931 need to have greater control over the cells that items are placed in
12932 then use the `wx.GridBagSizer`.
12935 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12936 __repr__
= _swig_repr
12937 def __init__(self
, *args
, **kwargs
):
12939 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12941 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12942 of columns and rows in the sizer - if either of the parameters is
12943 zero, it will be calculated to from the total number of children in
12944 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12945 define extra space between all children.
12947 _core_
.GridSizer_swiginit(self
,_core_
.new_GridSizer(*args
, **kwargs
))
12948 self
._setOORInfo
(self
)
12950 def SetCols(*args
, **kwargs
):
12952 SetCols(self, int cols)
12954 Sets the number of columns in the sizer.
12956 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
12958 def SetRows(*args
, **kwargs
):
12960 SetRows(self, int rows)
12962 Sets the number of rows in the sizer.
12964 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
12966 def SetVGap(*args
, **kwargs
):
12968 SetVGap(self, int gap)
12970 Sets the vertical gap (in pixels) between the cells in the sizer.
12972 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
12974 def SetHGap(*args
, **kwargs
):
12976 SetHGap(self, int gap)
12978 Sets the horizontal gap (in pixels) between cells in the sizer
12980 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
12982 def GetCols(*args
, **kwargs
):
12984 GetCols(self) -> int
12986 Returns the number of columns in the sizer.
12988 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
12990 def GetRows(*args
, **kwargs
):
12992 GetRows(self) -> int
12994 Returns the number of rows in the sizer.
12996 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
12998 def GetVGap(*args
, **kwargs
):
13000 GetVGap(self) -> int
13002 Returns the vertical gap (in pixels) between the cells in the sizer.
13004 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
13006 def GetHGap(*args
, **kwargs
):
13008 GetHGap(self) -> int
13010 Returns the horizontal gap (in pixels) between cells in the sizer.
13012 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
13014 def CalcRowsCols(self
):
13016 CalcRowsCols() -> (rows, cols)
13018 Calculates how many rows and columns will be in the sizer based
13019 on the current number of items and also the rows, cols specified
13020 in the constructor.
13022 nitems
= len(self
.GetChildren())
13023 rows
= self
.GetRows()
13024 cols
= self
.GetCols()
13025 assert rows
!= 0 or cols
!= 0, "Grid sizer must have either rows or columns fixed"
13027 rows
= (nitems
+ cols
- 1) / cols
13029 cols
= (nitems
+ rows
- 1) / rows
13030 return (rows
, cols
)
13032 Cols
= property(GetCols
,SetCols
,doc
="See `GetCols` and `SetCols`")
13033 HGap
= property(GetHGap
,SetHGap
,doc
="See `GetHGap` and `SetHGap`")
13034 Rows
= property(GetRows
,SetRows
,doc
="See `GetRows` and `SetRows`")
13035 VGap
= property(GetVGap
,SetVGap
,doc
="See `GetVGap` and `SetVGap`")
13036 _core_
.GridSizer_swigregister(GridSizer
)
13038 #---------------------------------------------------------------------------
13040 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
13041 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
13042 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
13043 class FlexGridSizer(GridSizer
):
13045 A flex grid sizer is a sizer which lays out its children in a
13046 two-dimensional table with all table cells in one row having the same
13047 height and all cells in one column having the same width, but all
13048 rows or all columns are not necessarily the same height or width as in
13049 the `wx.GridSizer`.
13051 wx.FlexGridSizer can also size items equally in one direction but
13052 unequally ("flexibly") in the other. If the sizer is only flexible
13053 in one direction (this can be changed using `SetFlexibleDirection`), it
13054 needs to be decided how the sizer should grow in the other ("non
13055 flexible") direction in order to fill the available space. The
13056 `SetNonFlexibleGrowMode` method serves this purpose.
13060 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13061 __repr__
= _swig_repr
13062 def __init__(self
, *args
, **kwargs
):
13064 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
13066 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13067 number of columns and rows in the sizer - if either of the parameters
13068 is zero, it will be calculated to from the total number of children in
13069 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13070 define extra space between all children.
13072 _core_
.FlexGridSizer_swiginit(self
,_core_
.new_FlexGridSizer(*args
, **kwargs
))
13073 self
._setOORInfo
(self
)
13075 def AddGrowableRow(*args
, **kwargs
):
13077 AddGrowableRow(self, size_t idx, int proportion=0)
13079 Specifies that row *idx* (starting from zero) should be grown if there
13080 is extra space available to the sizer.
13082 The *proportion* parameter has the same meaning as the stretch factor
13083 for the box sizers except that if all proportions are 0, then all
13084 columns are resized equally (instead of not being resized at all).
13086 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
13088 def RemoveGrowableRow(*args
, **kwargs
):
13090 RemoveGrowableRow(self, size_t idx)
13092 Specifies that row *idx* is no longer growable.
13094 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
13096 def AddGrowableCol(*args
, **kwargs
):
13098 AddGrowableCol(self, size_t idx, int proportion=0)
13100 Specifies that column *idx* (starting from zero) should be grown if
13101 there is extra space available to the sizer.
13103 The *proportion* parameter has the same meaning as the stretch factor
13104 for the box sizers except that if all proportions are 0, then all
13105 columns are resized equally (instead of not being resized at all).
13107 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
13109 def RemoveGrowableCol(*args
, **kwargs
):
13111 RemoveGrowableCol(self, size_t idx)
13113 Specifies that column *idx* is no longer growable.
13115 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
13117 def SetFlexibleDirection(*args
, **kwargs
):
13119 SetFlexibleDirection(self, int direction)
13121 Specifies whether the sizer should flexibly resize its columns, rows,
13122 or both. Argument *direction* can be one of the following values. Any
13123 other value is ignored.
13125 ============== =======================================
13126 wx.VERTICAL Rows are flexibly sized.
13127 wx.HORIZONTAL Columns are flexibly sized.
13128 wx.BOTH Both rows and columns are flexibly sized
13129 (this is the default value).
13130 ============== =======================================
13132 Note that this method does not trigger relayout.
13135 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
13137 def GetFlexibleDirection(*args
, **kwargs
):
13139 GetFlexibleDirection(self) -> int
13141 Returns a value that specifies whether the sizer
13142 flexibly resizes its columns, rows, or both (default).
13144 :see: `SetFlexibleDirection`
13146 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
13148 def SetNonFlexibleGrowMode(*args
, **kwargs
):
13150 SetNonFlexibleGrowMode(self, int mode)
13152 Specifies how the sizer should grow in the non-flexible direction if
13153 there is one (so `SetFlexibleDirection` must have been called
13154 previously). Argument *mode* can be one of the following values:
13156 ========================== =================================================
13157 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13158 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13159 `AddGrowableCol` and `AddGrowableRow`. In this
13160 case equal sizing applies to minimum sizes of
13161 columns or rows (this is the default value).
13162 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13163 the non flexible direction, whether they are
13164 growable or not in the flexbile direction.
13165 ========================== =================================================
13167 Note that this method does not trigger relayout.
13169 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
13171 def GetNonFlexibleGrowMode(*args
, **kwargs
):
13173 GetNonFlexibleGrowMode(self) -> int
13175 Returns the value that specifies how the sizer grows in the
13176 non-flexible direction if there is one.
13178 :see: `SetNonFlexibleGrowMode`
13180 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
13182 def GetRowHeights(*args
, **kwargs
):
13184 GetRowHeights(self) -> list
13186 Returns a list of integers representing the heights of each of the
13189 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
13191 def GetColWidths(*args
, **kwargs
):
13193 GetColWidths(self) -> list
13195 Returns a list of integers representing the widths of each of the
13196 columns in the sizer.
13198 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
13200 ColWidths
= property(GetColWidths
,doc
="See `GetColWidths`")
13201 FlexibleDirection
= property(GetFlexibleDirection
,SetFlexibleDirection
,doc
="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13202 NonFlexibleGrowMode
= property(GetNonFlexibleGrowMode
,SetNonFlexibleGrowMode
,doc
="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13203 RowHeights
= property(GetRowHeights
,doc
="See `GetRowHeights`")
13204 _core_
.FlexGridSizer_swigregister(FlexGridSizer
)
13206 class StdDialogButtonSizer(BoxSizer
):
13208 A special sizer that knows how to order and position standard buttons
13209 in order to conform to the current platform's standards. You simply
13210 need to add each `wx.Button` to the sizer, and be sure to create the
13211 buttons using the standard ID's. Then call `Realize` and the sizer
13212 will take care of the rest.
13215 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13216 __repr__
= _swig_repr
13217 def __init__(self
, *args
, **kwargs
):
13218 """__init__(self) -> StdDialogButtonSizer"""
13219 _core_
.StdDialogButtonSizer_swiginit(self
,_core_
.new_StdDialogButtonSizer(*args
, **kwargs
))
13220 def AddButton(*args
, **kwargs
):
13222 AddButton(self, wxButton button)
13224 Use this to add the buttons to this sizer. Do not use the `Add`
13225 method in the base class.
13227 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
13229 def Realize(*args
, **kwargs
):
13233 This funciton needs to be called after all the buttons have been added
13234 to the sizer. It will reorder them and position them in a platform
13237 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
13239 def SetAffirmativeButton(*args
, **kwargs
):
13240 """SetAffirmativeButton(self, wxButton button)"""
13241 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
13243 def SetNegativeButton(*args
, **kwargs
):
13244 """SetNegativeButton(self, wxButton button)"""
13245 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
13247 def SetCancelButton(*args
, **kwargs
):
13248 """SetCancelButton(self, wxButton button)"""
13249 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
13251 def GetAffirmativeButton(*args
, **kwargs
):
13252 """GetAffirmativeButton(self) -> wxButton"""
13253 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
13255 def GetApplyButton(*args
, **kwargs
):
13256 """GetApplyButton(self) -> wxButton"""
13257 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
13259 def GetNegativeButton(*args
, **kwargs
):
13260 """GetNegativeButton(self) -> wxButton"""
13261 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
13263 def GetCancelButton(*args
, **kwargs
):
13264 """GetCancelButton(self) -> wxButton"""
13265 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
13267 def GetHelpButton(*args
, **kwargs
):
13268 """GetHelpButton(self) -> wxButton"""
13269 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
13271 AffirmativeButton
= property(GetAffirmativeButton
,SetAffirmativeButton
,doc
="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13272 ApplyButton
= property(GetApplyButton
,doc
="See `GetApplyButton`")
13273 CancelButton
= property(GetCancelButton
,SetCancelButton
,doc
="See `GetCancelButton` and `SetCancelButton`")
13274 HelpButton
= property(GetHelpButton
,doc
="See `GetHelpButton`")
13275 NegativeButton
= property(GetNegativeButton
,SetNegativeButton
,doc
="See `GetNegativeButton` and `SetNegativeButton`")
13276 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizer
)
13278 #---------------------------------------------------------------------------
13280 class GBPosition(object):
13282 This class represents the position of an item in a virtual grid of
13283 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13284 typemaps that will automatically convert from a 2-element sequence of
13285 integers to a wx.GBPosition, so you can use the more pythonic
13286 representation of the position nearly transparently in Python code.
13288 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13289 __repr__
= _swig_repr
13290 def __init__(self
, *args
, **kwargs
):
13292 __init__(self, int row=0, int col=0) -> GBPosition
13294 This class represents the position of an item in a virtual grid of
13295 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13296 typemaps that will automatically convert from a 2-element sequence of
13297 integers to a wx.GBPosition, so you can use the more pythonic
13298 representation of the position nearly transparently in Python code.
13300 _core_
.GBPosition_swiginit(self
,_core_
.new_GBPosition(*args
, **kwargs
))
13301 __swig_destroy__
= _core_
.delete_GBPosition
13302 __del__
= lambda self
: None;
13303 def GetRow(*args
, **kwargs
):
13304 """GetRow(self) -> int"""
13305 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
13307 def GetCol(*args
, **kwargs
):
13308 """GetCol(self) -> int"""
13309 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
13311 def SetRow(*args
, **kwargs
):
13312 """SetRow(self, int row)"""
13313 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
13315 def SetCol(*args
, **kwargs
):
13316 """SetCol(self, int col)"""
13317 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
13319 def __eq__(*args
, **kwargs
):
13321 __eq__(self, PyObject other) -> bool
13323 Compare GBPosition for equality.
13325 return _core_
.GBPosition___eq__(*args
, **kwargs
)
13327 def __ne__(*args
, **kwargs
):
13329 __ne__(self, PyObject other) -> bool
13331 Compare GBPosition for inequality.
13333 return _core_
.GBPosition___ne__(*args
, **kwargs
)
13335 def Set(*args
, **kwargs
):
13336 """Set(self, int row=0, int col=0)"""
13337 return _core_
.GBPosition_Set(*args
, **kwargs
)
13339 def Get(*args
, **kwargs
):
13340 """Get(self) -> PyObject"""
13341 return _core_
.GBPosition_Get(*args
, **kwargs
)
13343 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
13344 def __str__(self
): return str(self
.Get())
13345 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
13346 def __len__(self
): return len(self
.Get())
13347 def __getitem__(self
, index
): return self
.Get()[index
]
13348 def __setitem__(self
, index
, val
):
13349 if index
== 0: self
.SetRow(val
)
13350 elif index
== 1: self
.SetCol(val
)
13351 else: raise IndexError
13352 def __nonzero__(self
): return self
.Get() != (0,0)
13353 __safe_for_unpickling__
= True
13354 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
13356 row
= property(GetRow
, SetRow
)
13357 col
= property(GetCol
, SetCol
)
13359 _core_
.GBPosition_swigregister(GBPosition
)
13361 class GBSpan(object):
13363 This class is used to hold the row and column spanning attributes of
13364 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13365 automatically convert from a 2-element sequence of integers to a
13366 wx.GBSpan, so you can use the more pythonic representation of the span
13367 nearly transparently in Python code.
13370 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13371 __repr__
= _swig_repr
13372 def __init__(self
, *args
, **kwargs
):
13374 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
13376 Construct a new wxGBSpan, optionally setting the rowspan and
13377 colspan. The default is (1,1). (Meaning that the item occupies one
13378 cell in each direction.
13380 _core_
.GBSpan_swiginit(self
,_core_
.new_GBSpan(*args
, **kwargs
))
13381 __swig_destroy__
= _core_
.delete_GBSpan
13382 __del__
= lambda self
: None;
13383 def GetRowspan(*args
, **kwargs
):
13384 """GetRowspan(self) -> int"""
13385 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
13387 def GetColspan(*args
, **kwargs
):
13388 """GetColspan(self) -> int"""
13389 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
13391 def SetRowspan(*args
, **kwargs
):
13392 """SetRowspan(self, int rowspan)"""
13393 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
13395 def SetColspan(*args
, **kwargs
):
13396 """SetColspan(self, int colspan)"""
13397 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
13399 def __eq__(*args
, **kwargs
):
13401 __eq__(self, PyObject other) -> bool
13403 Compare wxGBSpan for equality.
13405 return _core_
.GBSpan___eq__(*args
, **kwargs
)
13407 def __ne__(*args
, **kwargs
):
13409 __ne__(self, PyObject other) -> bool
13411 Compare GBSpan for inequality.
13413 return _core_
.GBSpan___ne__(*args
, **kwargs
)
13415 def Set(*args
, **kwargs
):
13416 """Set(self, int rowspan=1, int colspan=1)"""
13417 return _core_
.GBSpan_Set(*args
, **kwargs
)
13419 def Get(*args
, **kwargs
):
13420 """Get(self) -> PyObject"""
13421 return _core_
.GBSpan_Get(*args
, **kwargs
)
13423 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
13424 def __str__(self
): return str(self
.Get())
13425 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
13426 def __len__(self
): return len(self
.Get())
13427 def __getitem__(self
, index
): return self
.Get()[index
]
13428 def __setitem__(self
, index
, val
):
13429 if index
== 0: self
.SetRowspan(val
)
13430 elif index
== 1: self
.SetColspan(val
)
13431 else: raise IndexError
13432 def __nonzero__(self
): return self
.Get() != (0,0)
13433 __safe_for_unpickling__
= True
13434 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
13436 rowspan
= property(GetRowspan
, SetRowspan
)
13437 colspan
= property(GetColspan
, SetColspan
)
13439 _core_
.GBSpan_swigregister(GBSpan
)
13441 class GBSizerItem(SizerItem
):
13443 The wx.GBSizerItem class is used to track the additional data about
13444 items in a `wx.GridBagSizer` such as the item's position in the grid
13445 and how many rows or columns it spans.
13448 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13449 __repr__
= _swig_repr
13450 def __init__(self
, *args
, **kwargs
):
13452 __init__(self) -> GBSizerItem
13454 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13455 size will need to be set, as well as a position and span before this
13456 item can be used in a Sizer.
13458 You will probably never need to create a wx.GBSizerItem directly as they
13459 are created automatically when the sizer's Add method is called.
13461 _core_
.GBSizerItem_swiginit(self
,_core_
.new_GBSizerItem(*args
, **kwargs
))
13462 __swig_destroy__
= _core_
.delete_GBSizerItem
13463 __del__
= lambda self
: None;
13464 def GetPos(*args
, **kwargs
):
13466 GetPos(self) -> GBPosition
13468 Get the grid position of the item
13470 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
13472 def GetPosTuple(self
): return self
.GetPos().Get()
13473 def GetSpan(*args
, **kwargs
):
13475 GetSpan(self) -> GBSpan
13477 Get the row and column spanning of the item
13479 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
13481 def GetSpanTuple(self
): return self
.GetSpan().Get()
13482 def SetPos(*args
, **kwargs
):
13484 SetPos(self, GBPosition pos) -> bool
13486 If the item is already a member of a sizer then first ensure that
13487 there is no other item that would intersect with this one at the new
13488 position, then set the new position. Returns True if the change is
13489 successful and after the next Layout() the item will be moved.
13491 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
13493 def SetSpan(*args
, **kwargs
):
13495 SetSpan(self, GBSpan span) -> bool
13497 If the item is already a member of a sizer then first ensure that
13498 there is no other item that would intersect with this one with its new
13499 spanning size, then set the new spanning. Returns True if the change
13500 is successful and after the next Layout() the item will be resized.
13503 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
13505 def Intersects(*args
, **kwargs
):
13507 Intersects(self, GBSizerItem other) -> bool
13509 Returns True if this item and the other item instersect.
13511 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
13513 def IntersectsPos(*args
, **kwargs
):
13515 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
13517 Returns True if the given pos/span would intersect with this item.
13519 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
13521 def GetEndPos(*args
, **kwargs
):
13523 GetEndPos(self) -> GBPosition
13525 Get the row and column of the endpoint of this item.
13527 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
13529 def GetGBSizer(*args
, **kwargs
):
13531 GetGBSizer(self) -> GridBagSizer
13533 Get the sizer this item is a member of.
13535 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
13537 def SetGBSizer(*args
, **kwargs
):
13539 SetGBSizer(self, GridBagSizer sizer)
13541 Set the sizer this item is a member of.
13543 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
13545 EndPos
= property(GetEndPos
,doc
="See `GetEndPos`")
13546 GBSizer
= property(GetGBSizer
,SetGBSizer
,doc
="See `GetGBSizer` and `SetGBSizer`")
13547 Pos
= property(GetPos
,SetPos
,doc
="See `GetPos` and `SetPos`")
13548 Span
= property(GetSpan
,SetSpan
,doc
="See `GetSpan` and `SetSpan`")
13549 _core_
.GBSizerItem_swigregister(GBSizerItem
)
13550 DefaultSpan
= cvar
.DefaultSpan
13552 def GBSizerItemWindow(*args
, **kwargs
):
13554 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
13555 int border, PyObject userData=None) -> GBSizerItem
13557 Construct a `wx.GBSizerItem` for a window.
13559 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
13562 def GBSizerItemSizer(*args
, **kwargs
):
13564 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
13565 int border, PyObject userData=None) -> GBSizerItem
13567 Construct a `wx.GBSizerItem` for a sizer
13569 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
13572 def GBSizerItemSpacer(*args
, **kwargs
):
13574 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
13575 int flag, int border, PyObject userData=None) -> GBSizerItem
13577 Construct a `wx.GBSizerItem` for a spacer.
13579 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
13582 class GridBagSizer(FlexGridSizer
):
13584 A `wx.Sizer` that can lay out items in a virtual grid like a
13585 `wx.FlexGridSizer` but in this case explicit positioning of the items
13586 is allowed using `wx.GBPosition`, and items can optionally span more
13587 than one row and/or column using `wx.GBSpan`. The total size of the
13588 virtual grid is determined by the largest row and column that items are
13589 positioned at, adjusted for spanning.
13592 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13593 __repr__
= _swig_repr
13594 def __init__(self
, *args
, **kwargs
):
13596 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
13598 Constructor, with optional parameters to specify the gap between the
13601 _core_
.GridBagSizer_swiginit(self
,_core_
.new_GridBagSizer(*args
, **kwargs
))
13602 self
._setOORInfo
(self
)
13604 def Add(*args
, **kwargs
):
13606 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
13607 int border=0, userData=None) -> wx.GBSizerItem
13609 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13610 more than one row or column as specified with *span*. The remaining
13611 args behave similarly to `wx.Sizer.Add`.
13613 Returns True if the item was successfully placed at the given cell
13614 position, False if something was already there.
13617 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
13619 def AddItem(*args
, **kwargs
):
13621 Add(self, GBSizerItem item) -> wx.GBSizerItem
13623 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13624 the item was successfully placed at its given cell position, False if
13625 something was already there.
13627 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
13629 def GetCellSize(*args
, **kwargs
):
13631 GetCellSize(self, int row, int col) -> Size
13633 Get the size of the specified cell, including hgap and
13634 vgap. Only valid after a Layout.
13636 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
13638 def GetEmptyCellSize(*args
, **kwargs
):
13640 GetEmptyCellSize(self) -> Size
13642 Get the size used for cells in the grid with no item.
13644 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
13646 def SetEmptyCellSize(*args
, **kwargs
):
13648 SetEmptyCellSize(self, Size sz)
13650 Set the size used for cells in the grid with no item.
13652 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
13654 def GetItemPosition(*args
):
13656 GetItemPosition(self, item) -> GBPosition
13658 Get the grid position of the specified *item* where *item* is either a
13659 window or subsizer that is a member of this sizer, or a zero-based
13662 return _core_
.GridBagSizer_GetItemPosition(*args
)
13664 def SetItemPosition(*args
):
13666 SetItemPosition(self, item, GBPosition pos) -> bool
13668 Set the grid position of the specified *item* where *item* is either a
13669 window or subsizer that is a member of this sizer, or a zero-based
13670 index of an item. Returns True on success. If the move is not
13671 allowed (because an item is already there) then False is returned.
13674 return _core_
.GridBagSizer_SetItemPosition(*args
)
13676 def GetItemSpan(*args
):
13678 GetItemSpan(self, item) -> GBSpan
13680 Get the row/col spanning of the specified *item* where *item* is
13681 either a window or subsizer that is a member of this sizer, or a
13682 zero-based index of an item.
13684 return _core_
.GridBagSizer_GetItemSpan(*args
)
13686 def SetItemSpan(*args
):
13688 SetItemSpan(self, item, GBSpan span) -> bool
13690 Set the row/col spanning of the specified *item* where *item* is
13691 either a window or subsizer that is a member of this sizer, or a
13692 zero-based index of an item. Returns True on success. If the move is
13693 not allowed (because an item is already there) then False is returned.
13695 return _core_
.GridBagSizer_SetItemSpan(*args
)
13697 def FindItem(*args
):
13699 FindItem(self, item) -> GBSizerItem
13701 Find the sizer item for the given window or subsizer, returns None if
13702 not found. (non-recursive)
13704 return _core_
.GridBagSizer_FindItem(*args
)
13706 def GetItem(self
, item
):
13708 si
= wx
.FlexGridSizer
.GetItem(self
, item
)
13711 if type(item
) is not int:
13712 gbsi
= self
.FindItem(item
)
13713 if gbsi
: return gbsi
13716 def FindItemAtPosition(*args
, **kwargs
):
13718 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13720 Return the sizer item for the given grid cell, or None if there is no
13721 item at that position. (non-recursive)
13723 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
13725 def FindItemAtPoint(*args
, **kwargs
):
13727 FindItemAtPoint(self, Point pt) -> GBSizerItem
13729 Return the sizer item located at the point given in *pt*, or None if
13730 there is no item at that point. The (x,y) coordinates in pt correspond
13731 to the client coordinates of the window using the sizer for
13732 layout. (non-recursive)
13734 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
13736 def CheckForIntersection(*args
, **kwargs
):
13738 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
13740 Look at all items and see if any intersect (or would overlap) the
13741 given *item*. Returns True if so, False if there would be no overlap.
13742 If an *excludeItem* is given then it will not be checked for
13743 intersection, for example it may be the item we are checking the
13747 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
13749 def CheckForIntersectionPos(*args
, **kwargs
):
13751 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13753 Look at all items and see if any intersect (or would overlap) the
13754 given position and span. Returns True if so, False if there would be
13755 no overlap. If an *excludeItem* is given then it will not be checked
13756 for intersection, for example it may be the item we are checking the
13759 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
13761 _core_
.GridBagSizer_swigregister(GridBagSizer
)
13763 #---------------------------------------------------------------------------
13767 Right
= _core_
.Right
13768 Bottom
= _core_
.Bottom
13769 Width
= _core_
.Width
13770 Height
= _core_
.Height
13771 Centre
= _core_
.Centre
13772 Center
= _core_
.Center
13773 CentreX
= _core_
.CentreX
13774 CentreY
= _core_
.CentreY
13775 Unconstrained
= _core_
.Unconstrained
13777 PercentOf
= _core_
.PercentOf
13778 Above
= _core_
.Above
13779 Below
= _core_
.Below
13780 LeftOf
= _core_
.LeftOf
13781 RightOf
= _core_
.RightOf
13782 SameAs
= _core_
.SameAs
13783 Absolute
= _core_
.Absolute
13784 class IndividualLayoutConstraint(Object
):
13786 Objects of this class are stored in the `wx.LayoutConstraints` class as
13787 one of eight possible constraints that a window can be involved in.
13788 You will never need to create an instance of
13789 wx.IndividualLayoutConstraint, rather you should create a
13790 `wx.LayoutConstraints` instance and use the individual contstraints
13793 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13794 def __init__(self
): raise AttributeError, "No constructor defined"
13795 __repr__
= _swig_repr
13796 def Set(*args
, **kwargs
):
13798 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13800 Sets the properties of the constraint. Normally called by one of the
13801 convenience functions such as Above, RightOf, SameAs.
13803 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
13805 def LeftOf(*args
, **kwargs
):
13807 LeftOf(self, Window sibling, int marg=0)
13809 Constrains this edge to be to the left of the given window, with an
13810 optional margin. Implicitly, this is relative to the left edge of the
13813 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
13815 def RightOf(*args
, **kwargs
):
13817 RightOf(self, Window sibling, int marg=0)
13819 Constrains this edge to be to the right of the given window, with an
13820 optional margin. Implicitly, this is relative to the right edge of the
13823 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
13825 def Above(*args
, **kwargs
):
13827 Above(self, Window sibling, int marg=0)
13829 Constrains this edge to be above the given window, with an optional
13830 margin. Implicitly, this is relative to the top edge of the other
13833 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
13835 def Below(*args
, **kwargs
):
13837 Below(self, Window sibling, int marg=0)
13839 Constrains this edge to be below the given window, with an optional
13840 margin. Implicitly, this is relative to the bottom edge of the other
13843 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
13845 def SameAs(*args
, **kwargs
):
13847 SameAs(self, Window otherW, int edge, int marg=0)
13849 Constrains this edge or dimension to be to the same as the edge of the
13850 given window, with an optional margin.
13852 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
13854 def PercentOf(*args
, **kwargs
):
13856 PercentOf(self, Window otherW, int wh, int per)
13858 Constrains this edge or dimension to be to a percentage of the given
13859 window, with an optional margin.
13861 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
13863 def Absolute(*args
, **kwargs
):
13865 Absolute(self, int val)
13867 Constrains this edge or dimension to be the given absolute value.
13869 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
13871 def Unconstrained(*args
, **kwargs
):
13873 Unconstrained(self)
13875 Sets this edge or dimension to be unconstrained, that is, dependent on
13876 other edges and dimensions from which this value can be deduced.
13878 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
13880 def AsIs(*args
, **kwargs
):
13884 Sets this edge or constraint to be whatever the window's value is at
13885 the moment. If either of the width and height constraints are *as is*,
13886 the window will not be resized, but moved instead. This is important
13887 when considering panel items which are intended to have a default
13888 size, such as a button, which may take its size from the size of the
13891 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
13893 def GetOtherWindow(*args
, **kwargs
):
13894 """GetOtherWindow(self) -> Window"""
13895 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
13897 def GetMyEdge(*args
, **kwargs
):
13898 """GetMyEdge(self) -> int"""
13899 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
13901 def SetEdge(*args
, **kwargs
):
13902 """SetEdge(self, int which)"""
13903 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
13905 def SetValue(*args
, **kwargs
):
13906 """SetValue(self, int v)"""
13907 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
13909 def GetMargin(*args
, **kwargs
):
13910 """GetMargin(self) -> int"""
13911 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
13913 def SetMargin(*args
, **kwargs
):
13914 """SetMargin(self, int m)"""
13915 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
13917 def GetValue(*args
, **kwargs
):
13918 """GetValue(self) -> int"""
13919 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
13921 def GetPercent(*args
, **kwargs
):
13922 """GetPercent(self) -> int"""
13923 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
13925 def GetOtherEdge(*args
, **kwargs
):
13926 """GetOtherEdge(self) -> int"""
13927 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
13929 def GetDone(*args
, **kwargs
):
13930 """GetDone(self) -> bool"""
13931 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
13933 def SetDone(*args
, **kwargs
):
13934 """SetDone(self, bool d)"""
13935 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
13937 def GetRelationship(*args
, **kwargs
):
13938 """GetRelationship(self) -> int"""
13939 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
13941 def SetRelationship(*args
, **kwargs
):
13942 """SetRelationship(self, int r)"""
13943 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
13945 def ResetIfWin(*args
, **kwargs
):
13947 ResetIfWin(self, Window otherW) -> bool
13949 Reset constraint if it mentions otherWin
13951 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
13953 def SatisfyConstraint(*args
, **kwargs
):
13955 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13957 Try to satisfy constraint
13959 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
13961 def GetEdge(*args
, **kwargs
):
13963 GetEdge(self, int which, Window thisWin, Window other) -> int
13965 Get the value of this edge or dimension, or if this
13966 is not determinable, -1.
13968 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
13970 Done
= property(GetDone
,SetDone
,doc
="See `GetDone` and `SetDone`")
13971 Margin
= property(GetMargin
,SetMargin
,doc
="See `GetMargin` and `SetMargin`")
13972 MyEdge
= property(GetMyEdge
,doc
="See `GetMyEdge`")
13973 OtherEdge
= property(GetOtherEdge
,doc
="See `GetOtherEdge`")
13974 OtherWindow
= property(GetOtherWindow
,doc
="See `GetOtherWindow`")
13975 Percent
= property(GetPercent
,doc
="See `GetPercent`")
13976 Relationship
= property(GetRelationship
,SetRelationship
,doc
="See `GetRelationship` and `SetRelationship`")
13977 Value
= property(GetValue
,SetValue
,doc
="See `GetValue` and `SetValue`")
13978 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint
)
13980 class LayoutConstraints(Object
):
13982 **Note:** constraints are now deprecated and you should use sizers
13985 Objects of this class can be associated with a window to define its
13986 layout constraints, with respect to siblings or its parent.
13988 The class consists of the following eight constraints of class
13989 wx.IndividualLayoutConstraint, some or all of which should be accessed
13990 directly to set the appropriate constraints.
13992 * left: represents the left hand edge of the window
13993 * right: represents the right hand edge of the window
13994 * top: represents the top edge of the window
13995 * bottom: represents the bottom edge of the window
13996 * width: represents the width of the window
13997 * height: represents the height of the window
13998 * centreX: represents the horizontal centre point of the window
13999 * centreY: represents the vertical centre point of the window
14001 Most constraints are initially set to have the relationship
14002 wxUnconstrained, which means that their values should be calculated by
14003 looking at known constraints. The exceptions are width and height,
14004 which are set to wxAsIs to ensure that if the user does not specify a
14005 constraint, the existing width and height will be used, to be
14006 compatible with panel items which often have take a default size. If
14007 the constraint is ``wx.AsIs``, the dimension will not be changed.
14009 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
14012 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
14013 __repr__
= _swig_repr
14014 left
= property(_core_
.LayoutConstraints_left_get
)
14015 top
= property(_core_
.LayoutConstraints_top_get
)
14016 right
= property(_core_
.LayoutConstraints_right_get
)
14017 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
14018 width
= property(_core_
.LayoutConstraints_width_get
)
14019 height
= property(_core_
.LayoutConstraints_height_get
)
14020 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
14021 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
14022 def __init__(self
, *args
, **kwargs
):
14023 """__init__(self) -> LayoutConstraints"""
14024 _core_
.LayoutConstraints_swiginit(self
,_core_
.new_LayoutConstraints(*args
, **kwargs
))
14025 __swig_destroy__
= _core_
.delete_LayoutConstraints
14026 __del__
= lambda self
: None;
14027 def SatisfyConstraints(*args
, **kwargs
):
14028 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
14029 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
14031 def AreSatisfied(*args
, **kwargs
):
14032 """AreSatisfied(self) -> bool"""
14033 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
14035 _core_
.LayoutConstraints_swigregister(LayoutConstraints
)
14037 #----------------------------------------------------------------------------
14039 # Use Python's bool constants if available, make some if not
14043 __builtins__
.True = 1==1
14044 __builtins__
.False = 1==0
14045 def bool(value
): return not not value
14046 __builtins__
.bool = bool
14050 # workarounds for bad wxRTTI names
14051 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
14052 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
14053 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
14056 #----------------------------------------------------------------------------
14057 # Load version numbers from __version__... Ensure that major and minor
14058 # versions are the same for both wxPython and wxWidgets.
14060 from __version__
import *
14061 __version__
= VERSION_STRING
14063 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
14064 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
14065 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
14067 warnings
.warn("wxPython/wxWidgets release number mismatch")
14071 """Returns a string containing version and port info"""
14072 ctype
= wx
.USE_UNICODE
and 'unicode' or 'ansi'
14073 if wx
.Platform
== '__WXMSW__':
14075 elif wx
.Platform
== '__WXMAC__':
14077 elif wx
.Platform
== '__WXGTK__':
14079 if 'gtk2' in wx
.PlatformInfo
:
14084 return "%s (%s-%s)" % (wx
.VERSION_STRING
, port
, ctype
)
14087 #----------------------------------------------------------------------------
14089 # Set wxPython's default string<-->unicode conversion encoding from
14090 # the locale, but only if Python's default hasn't been changed. (We
14091 # assume that if the user has customized it already then that is the
14092 # encoding we need to use as well.)
14094 # The encoding selected here is used when string or unicode objects
14095 # need to be converted in order to pass them to wxWidgets. Please be
14096 # aware that the default encoding within the same locale may be
14097 # slightly different on different platforms. For example, please see
14098 # http://www.alanwood.net/demos/charsetdiffs.html for differences
14099 # between the common latin/roman encodings.
14101 default
= _sys
.getdefaultencoding()
14102 if default
== 'ascii':
14106 if hasattr(locale
, 'getpreferredencoding'):
14107 default
= locale
.getpreferredencoding()
14109 default
= locale
.getdefaultlocale()[1]
14110 codecs
.lookup(default
)
14111 except (ValueError, LookupError, TypeError):
14112 default
= _sys
.getdefaultencoding()
14116 wx
.SetDefaultPyEncoding(default
)
14119 #----------------------------------------------------------------------------
14121 class PyDeadObjectError(AttributeError):
14124 class _wxPyDeadObject(object):
14126 Instances of wx objects that are OOR capable will have their __class__
14127 changed to this class when the C++ object is deleted. This should help
14128 prevent crashes due to referencing a bogus C++ pointer.
14130 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14131 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14133 def __repr__(self
):
14134 if not hasattr(self
, "_name"):
14135 self
._name
= "[unknown]"
14136 return self
.reprStr
% self
._name
14138 def __getattr__(self
, *args
):
14139 if not hasattr(self
, "_name"):
14140 self
._name
= "[unknown]"
14141 raise PyDeadObjectError(self
.attrStr
% self
._name
)
14143 def __nonzero__(self
):
14148 class PyUnbornObjectError(AttributeError):
14151 class _wxPyUnbornObject(object):
14153 Some stock objects are created when the wx._core module is
14154 imported, but their C++ instance is not created until the wx.App
14155 object is created and initialized. These object instances will
14156 temporarily have their __class__ changed to this class so an
14157 exception will be raised if they are used before the C++ instance
14161 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14162 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
14164 def __repr__(self
):
14165 #if not hasattr(self, "_name"):
14166 # self._name = "[unknown]"
14167 return self
.reprStr
#% self._name
14169 def __getattr__(self
, *args
):
14170 #if not hasattr(self, "_name"):
14171 # self._name = "[unknown]"
14172 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
14174 def __nonzero__(self
):
14178 #----------------------------------------------------------------------------
14180 def CallAfter(callable, *args
, **kw
):
14182 Call the specified function after the current and pending event
14183 handlers have been completed. This is also good for making GUI
14184 method calls from non-GUI threads. Any extra positional or
14185 keyword args are passed on to the callable when it is called.
14187 :see: `wx.CallLater`
14190 assert app
is not None, 'No wx.App created yet'
14192 if not hasattr(app
, "_CallAfterId"):
14193 app
._CallAfterId
= wx
.NewEventType()
14194 app
.Connect(-1, -1, app
._CallAfterId
,
14195 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
14197 evt
.SetEventType(app
._CallAfterId
)
14198 evt
.callable = callable
14201 wx
.PostEvent(app
, evt
)
14203 #----------------------------------------------------------------------------
14208 A convenience class for `wx.Timer`, that calls the given callable
14209 object once after the given amount of milliseconds, passing any
14210 positional or keyword args. The return value of the callable is
14211 availbale after it has been run with the `GetResult` method.
14213 If you don't need to get the return value or restart the timer
14214 then there is no need to hold a reference to this object. It will
14215 hold a reference to itself while the timer is running (the timer
14216 has a reference to self.Notify) but the cycle will be broken when
14217 the timer completes, automatically cleaning up the wx.CallLater
14220 :see: `wx.CallAfter`
14222 def __init__(self
, millis
, callable, *args
, **kwargs
):
14223 self
.millis
= millis
14224 self
.callable = callable
14225 self
.SetArgs(*args
, **kwargs
)
14227 self
.running
= False
14228 self
.hasRun
= False
14237 def Start(self
, millis
=None, *args
, **kwargs
):
14239 (Re)start the timer
14241 self
.hasRun
= False
14242 if millis
is not None:
14243 self
.millis
= millis
14245 self
.SetArgs(*args
, **kwargs
)
14247 self
.timer
= wx
.PyTimer(self
.Notify
)
14248 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
14249 self
.running
= True
14255 Stop and destroy the timer.
14257 if self
.timer
is not None:
14262 def GetInterval(self
):
14263 if self
.timer
is not None:
14264 return self
.timer
.GetInterval()
14269 def IsRunning(self
):
14270 return self
.timer
is not None and self
.timer
.IsRunning()
14273 def SetArgs(self
, *args
, **kwargs
):
14275 (Re)set the args passed to the callable object. This is
14276 useful in conjunction with Restart if you want to schedule a
14277 new call to the same callable object but with different
14281 self
.kwargs
= kwargs
14287 def GetResult(self
):
14292 The timer has expired so call the callable.
14294 if self
.callable and getattr(self
.callable, 'im_self', True):
14296 self
.running
= False
14297 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
14299 if not self
.running
:
14300 # if it wasn't restarted, then cleanup
14301 wx
.CallAfter(self
.Stop
)
14303 Interval
= property(GetInterval
)
14304 Result
= property(GetResult
)
14307 class FutureCall(CallLater
):
14308 """A compatibility alias for `CallLater`."""
14310 #----------------------------------------------------------------------------
14311 # Control which items in this module should be documented by epydoc.
14312 # We allow only classes and functions, which will help reduce the size
14313 # of the docs by filtering out the zillions of constants, EVT objects,
14314 # and etc that don't make much sense by themselves, but are instead
14315 # documented (or will be) as part of the classes/functions/methods
14316 # where they should be used.
14320 A filter for epydoc that only allows non-Ptr classes and
14321 functions, in order to reduce the clutter in the API docs.
14323 def __init__(self
, globals):
14324 self
._globals
= globals
14326 def __call__(self
, name
):
14328 obj
= self
._globals
.get(name
, None)
14330 # only document classes and function
14331 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
14334 # skip other things that are private or will be documented as part of somethign else
14335 if name
.startswith('_') or name
.startswith('EVT') or name
.endswith('_swigregister') or name
.endswith('Ptr') :
14338 # skip functions that are duplicates of static functions in a class
14339 if name
.find('_') != -1:
14340 cls
= self
._globals
.get(name
.split('_')[0], None)
14341 methname
= name
.split('_')[1]
14342 if hasattr(cls
, methname
) and type(getattr(cls
, methname
)) is types
.FunctionType
:
14347 #----------------------------------------------------------------------------
14348 #----------------------------------------------------------------------------
14350 # Import other modules in this package that should show up in the
14351 # "core" wx namespace
14353 from _windows
import *
14354 from _controls
import *
14355 from _misc
import *
14357 #----------------------------------------------------------------------------
14358 #----------------------------------------------------------------------------