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 ST_NO_AUTORESIZE
= _core_
.ST_NO_AUTORESIZE
135 ST_DOTS_MIDDLE
= _core_
.ST_DOTS_MIDDLE
136 ST_DOTS_END
= _core_
.ST_DOTS_END
137 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
138 FLOOD_BORDER
= _core_
.FLOOD_BORDER
139 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
140 WINDING_RULE
= _core_
.WINDING_RULE
141 TOOL_TOP
= _core_
.TOOL_TOP
142 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
143 TOOL_LEFT
= _core_
.TOOL_LEFT
144 TOOL_RIGHT
= _core_
.TOOL_RIGHT
146 YES_NO
= _core_
.YES_NO
147 CANCEL
= _core_
.CANCEL
150 NO_DEFAULT
= _core_
.NO_DEFAULT
151 YES_DEFAULT
= _core_
.YES_DEFAULT
152 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
153 ICON_HAND
= _core_
.ICON_HAND
154 ICON_QUESTION
= _core_
.ICON_QUESTION
155 ICON_INFORMATION
= _core_
.ICON_INFORMATION
156 ICON_STOP
= _core_
.ICON_STOP
157 ICON_ASTERISK
= _core_
.ICON_ASTERISK
158 ICON_MASK
= _core_
.ICON_MASK
159 ICON_WARNING
= _core_
.ICON_WARNING
160 ICON_ERROR
= _core_
.ICON_ERROR
161 FORWARD
= _core_
.FORWARD
162 BACKWARD
= _core_
.BACKWARD
167 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
168 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
169 SIZE_AUTO
= _core_
.SIZE_AUTO
170 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
171 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
172 SIZE_FORCE
= _core_
.SIZE_FORCE
173 PORTRAIT
= _core_
.PORTRAIT
174 LANDSCAPE
= _core_
.LANDSCAPE
175 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
176 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
177 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
178 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
179 ID_ANY
= _core_
.ID_ANY
180 ID_SEPARATOR
= _core_
.ID_SEPARATOR
181 ID_NONE
= _core_
.ID_NONE
182 ID_LOWEST
= _core_
.ID_LOWEST
183 ID_OPEN
= _core_
.ID_OPEN
184 ID_CLOSE
= _core_
.ID_CLOSE
185 ID_NEW
= _core_
.ID_NEW
186 ID_SAVE
= _core_
.ID_SAVE
187 ID_SAVEAS
= _core_
.ID_SAVEAS
188 ID_REVERT
= _core_
.ID_REVERT
189 ID_EXIT
= _core_
.ID_EXIT
190 ID_UNDO
= _core_
.ID_UNDO
191 ID_REDO
= _core_
.ID_REDO
192 ID_HELP
= _core_
.ID_HELP
193 ID_PRINT
= _core_
.ID_PRINT
194 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
195 ID_PAGE_SETUP
= _core_
.ID_PAGE_SETUP
196 ID_PREVIEW
= _core_
.ID_PREVIEW
197 ID_ABOUT
= _core_
.ID_ABOUT
198 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
199 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
200 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
201 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
202 ID_HELP_INDEX
= _core_
.ID_HELP_INDEX
203 ID_HELP_SEARCH
= _core_
.ID_HELP_SEARCH
204 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
205 ID_PREFERENCES
= _core_
.ID_PREFERENCES
206 ID_EDIT
= _core_
.ID_EDIT
207 ID_CUT
= _core_
.ID_CUT
208 ID_COPY
= _core_
.ID_COPY
209 ID_PASTE
= _core_
.ID_PASTE
210 ID_CLEAR
= _core_
.ID_CLEAR
211 ID_FIND
= _core_
.ID_FIND
212 ID_DUPLICATE
= _core_
.ID_DUPLICATE
213 ID_SELECTALL
= _core_
.ID_SELECTALL
214 ID_DELETE
= _core_
.ID_DELETE
215 ID_REPLACE
= _core_
.ID_REPLACE
216 ID_REPLACE_ALL
= _core_
.ID_REPLACE_ALL
217 ID_PROPERTIES
= _core_
.ID_PROPERTIES
218 ID_VIEW_DETAILS
= _core_
.ID_VIEW_DETAILS
219 ID_VIEW_LARGEICONS
= _core_
.ID_VIEW_LARGEICONS
220 ID_VIEW_SMALLICONS
= _core_
.ID_VIEW_SMALLICONS
221 ID_VIEW_LIST
= _core_
.ID_VIEW_LIST
222 ID_VIEW_SORTDATE
= _core_
.ID_VIEW_SORTDATE
223 ID_VIEW_SORTNAME
= _core_
.ID_VIEW_SORTNAME
224 ID_VIEW_SORTSIZE
= _core_
.ID_VIEW_SORTSIZE
225 ID_VIEW_SORTTYPE
= _core_
.ID_VIEW_SORTTYPE
226 ID_FILE
= _core_
.ID_FILE
227 ID_FILE1
= _core_
.ID_FILE1
228 ID_FILE2
= _core_
.ID_FILE2
229 ID_FILE3
= _core_
.ID_FILE3
230 ID_FILE4
= _core_
.ID_FILE4
231 ID_FILE5
= _core_
.ID_FILE5
232 ID_FILE6
= _core_
.ID_FILE6
233 ID_FILE7
= _core_
.ID_FILE7
234 ID_FILE8
= _core_
.ID_FILE8
235 ID_FILE9
= _core_
.ID_FILE9
237 ID_CANCEL
= _core_
.ID_CANCEL
238 ID_APPLY
= _core_
.ID_APPLY
239 ID_YES
= _core_
.ID_YES
241 ID_STATIC
= _core_
.ID_STATIC
242 ID_FORWARD
= _core_
.ID_FORWARD
243 ID_BACKWARD
= _core_
.ID_BACKWARD
244 ID_DEFAULT
= _core_
.ID_DEFAULT
245 ID_MORE
= _core_
.ID_MORE
246 ID_SETUP
= _core_
.ID_SETUP
247 ID_RESET
= _core_
.ID_RESET
248 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
249 ID_YESTOALL
= _core_
.ID_YESTOALL
250 ID_NOTOALL
= _core_
.ID_NOTOALL
251 ID_ABORT
= _core_
.ID_ABORT
252 ID_RETRY
= _core_
.ID_RETRY
253 ID_IGNORE
= _core_
.ID_IGNORE
254 ID_ADD
= _core_
.ID_ADD
255 ID_REMOVE
= _core_
.ID_REMOVE
257 ID_DOWN
= _core_
.ID_DOWN
258 ID_HOME
= _core_
.ID_HOME
259 ID_REFRESH
= _core_
.ID_REFRESH
260 ID_STOP
= _core_
.ID_STOP
261 ID_INDEX
= _core_
.ID_INDEX
262 ID_BOLD
= _core_
.ID_BOLD
263 ID_ITALIC
= _core_
.ID_ITALIC
264 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
265 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
266 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
267 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
268 ID_UNDERLINE
= _core_
.ID_UNDERLINE
269 ID_INDENT
= _core_
.ID_INDENT
270 ID_UNINDENT
= _core_
.ID_UNINDENT
271 ID_ZOOM_100
= _core_
.ID_ZOOM_100
272 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
273 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
274 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
275 ID_UNDELETE
= _core_
.ID_UNDELETE
276 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
277 ID_HIGHEST
= _core_
.ID_HIGHEST
278 MENU_TEAROFF
= _core_
.MENU_TEAROFF
279 MB_DOCKABLE
= _core_
.MB_DOCKABLE
280 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
281 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
282 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
283 LI_VERTICAL
= _core_
.LI_VERTICAL
284 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
285 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
286 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
287 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
288 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
289 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
290 MM_TEXT
= _core_
.MM_TEXT
291 MM_LOMETRIC
= _core_
.MM_LOMETRIC
292 MM_HIMETRIC
= _core_
.MM_HIMETRIC
293 MM_LOENGLISH
= _core_
.MM_LOENGLISH
294 MM_HIENGLISH
= _core_
.MM_HIENGLISH
295 MM_TWIPS
= _core_
.MM_TWIPS
296 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
297 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
298 MM_POINTS
= _core_
.MM_POINTS
299 MM_METRIC
= _core_
.MM_METRIC
300 CENTRE
= _core_
.CENTRE
301 CENTER
= _core_
.CENTER
302 HORIZONTAL
= _core_
.HORIZONTAL
303 VERTICAL
= _core_
.VERTICAL
310 BOTTOM
= _core_
.BOTTOM
316 ALIGN_NOT
= _core_
.ALIGN_NOT
317 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
318 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
319 ALIGN_LEFT
= _core_
.ALIGN_LEFT
320 ALIGN_TOP
= _core_
.ALIGN_TOP
321 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
322 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
323 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
324 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
325 ALIGN_CENTER
= _core_
.ALIGN_CENTER
326 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
327 ALIGN_MASK
= _core_
.ALIGN_MASK
328 STRETCH_NOT
= _core_
.STRETCH_NOT
329 SHRINK
= _core_
.SHRINK
331 EXPAND
= _core_
.EXPAND
332 SHAPED
= _core_
.SHAPED
333 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
336 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
337 BORDER_NONE
= _core_
.BORDER_NONE
338 BORDER_STATIC
= _core_
.BORDER_STATIC
339 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
340 BORDER_RAISED
= _core_
.BORDER_RAISED
341 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
342 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
343 BORDER_MASK
= _core_
.BORDER_MASK
344 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
345 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
346 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
347 DEFAULT
= _core_
.DEFAULT
348 DECORATIVE
= _core_
.DECORATIVE
350 SCRIPT
= _core_
.SCRIPT
352 MODERN
= _core_
.MODERN
353 TELETYPE
= _core_
.TELETYPE
354 VARIABLE
= _core_
.VARIABLE
356 NORMAL
= _core_
.NORMAL
359 ITALIC
= _core_
.ITALIC
363 LONG_DASH
= _core_
.LONG_DASH
364 SHORT_DASH
= _core_
.SHORT_DASH
365 DOT_DASH
= _core_
.DOT_DASH
366 USER_DASH
= _core_
.USER_DASH
367 TRANSPARENT
= _core_
.TRANSPARENT
368 STIPPLE
= _core_
.STIPPLE
369 STIPPLE_MASK
= _core_
.STIPPLE_MASK
370 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
371 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
372 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
373 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
374 CROSS_HATCH
= _core_
.CROSS_HATCH
375 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
376 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
377 JOIN_BEVEL
= _core_
.JOIN_BEVEL
378 JOIN_MITER
= _core_
.JOIN_MITER
379 JOIN_ROUND
= _core_
.JOIN_ROUND
380 CAP_ROUND
= _core_
.CAP_ROUND
381 CAP_PROJECTING
= _core_
.CAP_PROJECTING
382 CAP_BUTT
= _core_
.CAP_BUTT
385 INVERT
= _core_
.INVERT
386 OR_REVERSE
= _core_
.OR_REVERSE
387 AND_REVERSE
= _core_
.AND_REVERSE
390 AND_INVERT
= _core_
.AND_INVERT
394 SRC_INVERT
= _core_
.SRC_INVERT
395 OR_INVERT
= _core_
.OR_INVERT
399 WXK_BACK
= _core_
.WXK_BACK
400 WXK_TAB
= _core_
.WXK_TAB
401 WXK_RETURN
= _core_
.WXK_RETURN
402 WXK_ESCAPE
= _core_
.WXK_ESCAPE
403 WXK_SPACE
= _core_
.WXK_SPACE
404 WXK_DELETE
= _core_
.WXK_DELETE
405 WXK_START
= _core_
.WXK_START
406 WXK_LBUTTON
= _core_
.WXK_LBUTTON
407 WXK_RBUTTON
= _core_
.WXK_RBUTTON
408 WXK_CANCEL
= _core_
.WXK_CANCEL
409 WXK_MBUTTON
= _core_
.WXK_MBUTTON
410 WXK_CLEAR
= _core_
.WXK_CLEAR
411 WXK_SHIFT
= _core_
.WXK_SHIFT
412 WXK_ALT
= _core_
.WXK_ALT
413 WXK_CONTROL
= _core_
.WXK_CONTROL
414 WXK_MENU
= _core_
.WXK_MENU
415 WXK_PAUSE
= _core_
.WXK_PAUSE
416 WXK_CAPITAL
= _core_
.WXK_CAPITAL
417 WXK_END
= _core_
.WXK_END
418 WXK_HOME
= _core_
.WXK_HOME
419 WXK_LEFT
= _core_
.WXK_LEFT
420 WXK_UP
= _core_
.WXK_UP
421 WXK_RIGHT
= _core_
.WXK_RIGHT
422 WXK_DOWN
= _core_
.WXK_DOWN
423 WXK_SELECT
= _core_
.WXK_SELECT
424 WXK_PRINT
= _core_
.WXK_PRINT
425 WXK_EXECUTE
= _core_
.WXK_EXECUTE
426 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
427 WXK_INSERT
= _core_
.WXK_INSERT
428 WXK_HELP
= _core_
.WXK_HELP
429 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
430 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
431 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
432 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
433 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
434 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
435 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
436 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
437 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
438 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
439 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
440 WXK_ADD
= _core_
.WXK_ADD
441 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
442 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
443 WXK_DECIMAL
= _core_
.WXK_DECIMAL
444 WXK_DIVIDE
= _core_
.WXK_DIVIDE
445 WXK_F1
= _core_
.WXK_F1
446 WXK_F2
= _core_
.WXK_F2
447 WXK_F3
= _core_
.WXK_F3
448 WXK_F4
= _core_
.WXK_F4
449 WXK_F5
= _core_
.WXK_F5
450 WXK_F6
= _core_
.WXK_F6
451 WXK_F7
= _core_
.WXK_F7
452 WXK_F8
= _core_
.WXK_F8
453 WXK_F9
= _core_
.WXK_F9
454 WXK_F10
= _core_
.WXK_F10
455 WXK_F11
= _core_
.WXK_F11
456 WXK_F12
= _core_
.WXK_F12
457 WXK_F13
= _core_
.WXK_F13
458 WXK_F14
= _core_
.WXK_F14
459 WXK_F15
= _core_
.WXK_F15
460 WXK_F16
= _core_
.WXK_F16
461 WXK_F17
= _core_
.WXK_F17
462 WXK_F18
= _core_
.WXK_F18
463 WXK_F19
= _core_
.WXK_F19
464 WXK_F20
= _core_
.WXK_F20
465 WXK_F21
= _core_
.WXK_F21
466 WXK_F22
= _core_
.WXK_F22
467 WXK_F23
= _core_
.WXK_F23
468 WXK_F24
= _core_
.WXK_F24
469 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
470 WXK_SCROLL
= _core_
.WXK_SCROLL
471 WXK_PAGEUP
= _core_
.WXK_PAGEUP
472 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
473 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
474 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
475 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
476 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
477 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
478 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
479 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
480 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
481 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
482 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
483 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
484 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
485 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
486 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
487 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
488 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
489 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
490 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
491 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
492 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
493 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
494 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
495 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
496 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
497 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
498 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
499 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
500 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
501 WXK_COMMAND
= _core_
.WXK_COMMAND
502 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
503 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
504 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
505 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
506 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
507 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
508 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
509 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
510 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
511 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
512 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
513 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
514 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
515 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
516 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
517 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
518 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
519 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
520 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
521 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
522 WXK_PRIOR
= WXK_PAGEUP
523 WXK_NEXT
= WXK_PAGEDOWN
524 WXK_NUMPAD_PRIOR
= WXK_NUMPAD_PAGEUP
525 WXK_NUMPAD_NEXT
= WXK_NUMPAD_PAGEDOWN
527 PAPER_NONE
= _core_
.PAPER_NONE
528 PAPER_LETTER
= _core_
.PAPER_LETTER
529 PAPER_LEGAL
= _core_
.PAPER_LEGAL
530 PAPER_A4
= _core_
.PAPER_A4
531 PAPER_CSHEET
= _core_
.PAPER_CSHEET
532 PAPER_DSHEET
= _core_
.PAPER_DSHEET
533 PAPER_ESHEET
= _core_
.PAPER_ESHEET
534 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
535 PAPER_TABLOID
= _core_
.PAPER_TABLOID
536 PAPER_LEDGER
= _core_
.PAPER_LEDGER
537 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
538 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
539 PAPER_A3
= _core_
.PAPER_A3
540 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
541 PAPER_A5
= _core_
.PAPER_A5
542 PAPER_B4
= _core_
.PAPER_B4
543 PAPER_B5
= _core_
.PAPER_B5
544 PAPER_FOLIO
= _core_
.PAPER_FOLIO
545 PAPER_QUARTO
= _core_
.PAPER_QUARTO
546 PAPER_10X14
= _core_
.PAPER_10X14
547 PAPER_11X17
= _core_
.PAPER_11X17
548 PAPER_NOTE
= _core_
.PAPER_NOTE
549 PAPER_ENV_9
= _core_
.PAPER_ENV_9
550 PAPER_ENV_10
= _core_
.PAPER_ENV_10
551 PAPER_ENV_11
= _core_
.PAPER_ENV_11
552 PAPER_ENV_12
= _core_
.PAPER_ENV_12
553 PAPER_ENV_14
= _core_
.PAPER_ENV_14
554 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
555 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
556 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
557 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
558 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
559 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
560 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
561 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
562 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
563 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
564 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
565 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
566 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
567 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
568 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
569 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
570 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
571 PAPER_9X11
= _core_
.PAPER_9X11
572 PAPER_10X11
= _core_
.PAPER_10X11
573 PAPER_15X11
= _core_
.PAPER_15X11
574 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
575 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
576 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
577 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
578 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
579 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
580 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
581 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
582 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
583 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
584 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
585 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
586 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
587 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
588 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
589 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
590 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
591 PAPER_A2
= _core_
.PAPER_A2
592 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
593 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
594 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
595 PAPER_A6
= _core_
.PAPER_A6
596 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
597 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
598 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
599 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
600 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
601 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
602 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
603 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
604 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
605 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
606 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
607 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
608 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
609 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
610 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
611 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
612 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
613 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
614 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
615 PAPER_12X11
= _core_
.PAPER_12X11
616 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
617 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
618 PAPER_P16K
= _core_
.PAPER_P16K
619 PAPER_P32K
= _core_
.PAPER_P32K
620 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
621 PAPER_PENV_1
= _core_
.PAPER_PENV_1
622 PAPER_PENV_2
= _core_
.PAPER_PENV_2
623 PAPER_PENV_3
= _core_
.PAPER_PENV_3
624 PAPER_PENV_4
= _core_
.PAPER_PENV_4
625 PAPER_PENV_5
= _core_
.PAPER_PENV_5
626 PAPER_PENV_6
= _core_
.PAPER_PENV_6
627 PAPER_PENV_7
= _core_
.PAPER_PENV_7
628 PAPER_PENV_8
= _core_
.PAPER_PENV_8
629 PAPER_PENV_9
= _core_
.PAPER_PENV_9
630 PAPER_PENV_10
= _core_
.PAPER_PENV_10
631 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
632 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
633 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
634 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
635 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
636 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
637 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
638 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
639 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
640 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
641 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
642 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
643 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
644 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
645 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
646 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
647 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
648 ITEM_NORMAL
= _core_
.ITEM_NORMAL
649 ITEM_CHECK
= _core_
.ITEM_CHECK
650 ITEM_RADIO
= _core_
.ITEM_RADIO
651 ITEM_MAX
= _core_
.ITEM_MAX
652 HT_NOWHERE
= _core_
.HT_NOWHERE
653 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
654 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
655 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
656 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
657 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
658 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
659 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
660 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
661 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
662 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
663 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
664 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
665 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
666 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
667 HT_MAX
= _core_
.HT_MAX
668 MOD_NONE
= _core_
.MOD_NONE
669 MOD_ALT
= _core_
.MOD_ALT
670 MOD_CONTROL
= _core_
.MOD_CONTROL
671 MOD_ALTGR
= _core_
.MOD_ALTGR
672 MOD_SHIFT
= _core_
.MOD_SHIFT
673 MOD_META
= _core_
.MOD_META
674 MOD_WIN
= _core_
.MOD_WIN
675 MOD_CMD
= _core_
.MOD_CMD
676 MOD_ALL
= _core_
.MOD_ALL
677 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
678 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
679 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
680 Layout_Default
= _core_
.Layout_Default
681 Layout_LeftToRight
= _core_
.Layout_LeftToRight
682 Layout_RightToLeft
= _core_
.Layout_RightToLeft
683 #---------------------------------------------------------------------------
685 class Object(object):
687 The base class for most wx objects, although in wxPython not
688 much functionality is needed nor exposed.
690 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
691 def __init__(self
): raise AttributeError, "No constructor defined"
692 __repr__
= _swig_repr
693 def GetClassName(*args
, **kwargs
):
695 GetClassName(self) -> String
697 Returns the class name of the C++ class using wxRTTI.
699 return _core_
.Object_GetClassName(*args
, **kwargs
)
701 def Destroy(*args
, **kwargs
):
705 Deletes the C++ object this Python object is a proxy for.
707 args
[0].this
.own(False)
708 return _core_
.Object_Destroy(*args
, **kwargs
)
710 def IsSameAs(*args
, **kwargs
):
712 IsSameAs(self, Object p) -> bool
714 For wx.Objects that use C++ reference counting internally, this method
715 can be used to determine if two objects are referencing the same data
718 return _core_
.Object_IsSameAs(*args
, **kwargs
)
720 ClassName
= property(GetClassName
,doc
="See `GetClassName`")
721 _core_
.Object_swigregister(Object
)
722 _wxPySetDictionary
= _core_
._wxPySetDictionary
724 EmptyString
= cvar
.EmptyString
726 #---------------------------------------------------------------------------
728 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
729 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
730 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
731 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
732 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
733 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
734 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
735 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
736 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
737 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
738 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
739 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
740 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
741 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
742 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
743 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
744 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
745 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
746 BITMAP_TYPE_TGA
= _core_
.BITMAP_TYPE_TGA
747 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
748 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
749 CURSOR_NONE
= _core_
.CURSOR_NONE
750 CURSOR_ARROW
= _core_
.CURSOR_ARROW
751 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
752 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
753 CURSOR_CHAR
= _core_
.CURSOR_CHAR
754 CURSOR_CROSS
= _core_
.CURSOR_CROSS
755 CURSOR_HAND
= _core_
.CURSOR_HAND
756 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
757 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
758 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
759 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
760 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
761 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
762 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
763 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
764 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
765 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
766 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
767 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
768 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
769 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
770 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
771 CURSOR_SIZING
= _core_
.CURSOR_SIZING
772 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
773 CURSOR_WAIT
= _core_
.CURSOR_WAIT
774 CURSOR_WATCH
= _core_
.CURSOR_WATCH
775 CURSOR_BLANK
= _core_
.CURSOR_BLANK
776 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
777 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
778 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
779 CURSOR_MAX
= _core_
.CURSOR_MAX
780 #---------------------------------------------------------------------------
784 wx.Size is a useful data structure used to represent the size of
785 something. It simply contains integer width and height
786 properties. In most places in wxPython where a wx.Size is
787 expected a (width, height) tuple can be used instead.
789 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
790 __repr__
= _swig_repr
791 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
792 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
793 x
= width
; y
= height
794 def __init__(self
, *args
, **kwargs
):
796 __init__(self, int w=0, int h=0) -> Size
798 Creates a size object.
800 _core_
.Size_swiginit(self
,_core_
.new_Size(*args
, **kwargs
))
801 __swig_destroy__
= _core_
.delete_Size
802 __del__
= lambda self
: None;
803 def __eq__(*args
, **kwargs
):
805 __eq__(self, PyObject other) -> bool
807 Test for equality of wx.Size objects.
809 return _core_
.Size___eq__(*args
, **kwargs
)
811 def __ne__(*args
, **kwargs
):
813 __ne__(self, PyObject other) -> bool
815 Test for inequality of wx.Size objects.
817 return _core_
.Size___ne__(*args
, **kwargs
)
819 def __add__(*args
, **kwargs
):
821 __add__(self, Size sz) -> Size
823 Add sz's proprties to this and return the result.
825 return _core_
.Size___add__(*args
, **kwargs
)
827 def __sub__(*args
, **kwargs
):
829 __sub__(self, Size sz) -> Size
831 Subtract sz's properties from this and return the result.
833 return _core_
.Size___sub__(*args
, **kwargs
)
835 def IncTo(*args
, **kwargs
):
839 Increments this object so that both of its dimensions are not less
840 than the corresponding dimensions of the size.
842 return _core_
.Size_IncTo(*args
, **kwargs
)
844 def DecTo(*args
, **kwargs
):
848 Decrements this object so that both of its dimensions are not greater
849 than the corresponding dimensions of the size.
851 return _core_
.Size_DecTo(*args
, **kwargs
)
853 def IncBy(*args
, **kwargs
):
854 """IncBy(self, int dx, int dy)"""
855 return _core_
.Size_IncBy(*args
, **kwargs
)
857 def DecBy(*args
, **kwargs
):
858 """DecBy(self, int dx, int dy)"""
859 return _core_
.Size_DecBy(*args
, **kwargs
)
861 def Scale(*args
, **kwargs
):
863 Scale(self, float xscale, float yscale)
865 Scales the dimensions of this object by the given factors.
867 return _core_
.Size_Scale(*args
, **kwargs
)
869 def Set(*args
, **kwargs
):
871 Set(self, int w, int h)
873 Set both width and height.
875 return _core_
.Size_Set(*args
, **kwargs
)
877 def SetWidth(*args
, **kwargs
):
878 """SetWidth(self, int w)"""
879 return _core_
.Size_SetWidth(*args
, **kwargs
)
881 def SetHeight(*args
, **kwargs
):
882 """SetHeight(self, int h)"""
883 return _core_
.Size_SetHeight(*args
, **kwargs
)
885 def GetWidth(*args
, **kwargs
):
886 """GetWidth(self) -> int"""
887 return _core_
.Size_GetWidth(*args
, **kwargs
)
889 def GetHeight(*args
, **kwargs
):
890 """GetHeight(self) -> int"""
891 return _core_
.Size_GetHeight(*args
, **kwargs
)
893 def IsFullySpecified(*args
, **kwargs
):
895 IsFullySpecified(self) -> bool
897 Returns True if both components of the size are non-default values.
899 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
901 def SetDefaults(*args
, **kwargs
):
903 SetDefaults(self, Size size)
905 Combine this size with the other one replacing the default components
906 of this object (i.e. equal to -1) with those of the other.
908 return _core_
.Size_SetDefaults(*args
, **kwargs
)
910 def Get(*args
, **kwargs
):
912 Get() -> (width,height)
914 Returns the width and height properties as a tuple.
916 return _core_
.Size_Get(*args
, **kwargs
)
918 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
919 def __str__(self
): return str(self
.Get())
920 def __repr__(self
): return 'wx.Size'+str(self
.Get())
921 def __len__(self
): return len(self
.Get())
922 def __getitem__(self
, index
): return self
.Get()[index
]
923 def __setitem__(self
, index
, val
):
924 if index
== 0: self
.width
= val
925 elif index
== 1: self
.height
= val
926 else: raise IndexError
927 def __nonzero__(self
): return self
.Get() != (0,0)
928 __safe_for_unpickling__
= True
929 def __reduce__(self
): return (wx
.Size
, self
.Get())
931 _core_
.Size_swigregister(Size
)
933 #---------------------------------------------------------------------------
935 class RealPoint(object):
937 A data structure for representing a point or position with floating
938 point x and y properties. In wxPython most places that expect a
939 wx.RealPoint can also accept a (x,y) tuple.
941 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
942 __repr__
= _swig_repr
943 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
944 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
945 def __init__(self
, *args
, **kwargs
):
947 __init__(self, double x=0.0, double y=0.0) -> RealPoint
949 Create a wx.RealPoint object
951 _core_
.RealPoint_swiginit(self
,_core_
.new_RealPoint(*args
, **kwargs
))
952 __swig_destroy__
= _core_
.delete_RealPoint
953 __del__
= lambda self
: None;
954 def __eq__(*args
, **kwargs
):
956 __eq__(self, PyObject other) -> bool
958 Test for equality of wx.RealPoint objects.
960 return _core_
.RealPoint___eq__(*args
, **kwargs
)
962 def __ne__(*args
, **kwargs
):
964 __ne__(self, PyObject other) -> bool
966 Test for inequality of wx.RealPoint objects.
968 return _core_
.RealPoint___ne__(*args
, **kwargs
)
970 def __add__(*args
, **kwargs
):
972 __add__(self, RealPoint pt) -> RealPoint
974 Add pt's proprties to this and return the result.
976 return _core_
.RealPoint___add__(*args
, **kwargs
)
978 def __sub__(*args
, **kwargs
):
980 __sub__(self, RealPoint pt) -> RealPoint
982 Subtract pt's proprties from this and return the result
984 return _core_
.RealPoint___sub__(*args
, **kwargs
)
986 def Set(*args
, **kwargs
):
988 Set(self, double x, double y)
990 Set both the x and y properties
992 return _core_
.RealPoint_Set(*args
, **kwargs
)
994 def Get(*args
, **kwargs
):
998 Return the x and y properties as a tuple.
1000 return _core_
.RealPoint_Get(*args
, **kwargs
)
1002 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1003 def __str__(self
): return str(self
.Get())
1004 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
1005 def __len__(self
): return len(self
.Get())
1006 def __getitem__(self
, index
): return self
.Get()[index
]
1007 def __setitem__(self
, index
, val
):
1008 if index
== 0: self
.x
= val
1009 elif index
== 1: self
.y
= val
1010 else: raise IndexError
1011 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1012 __safe_for_unpickling__
= True
1013 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
1015 _core_
.RealPoint_swigregister(RealPoint
)
1017 #---------------------------------------------------------------------------
1019 class Point(object):
1021 A data structure for representing a point or position with integer x
1022 and y properties. Most places in wxPython that expect a wx.Point can
1023 also accept a (x,y) tuple.
1025 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1026 __repr__
= _swig_repr
1027 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1028 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1029 def __init__(self
, *args
, **kwargs
):
1031 __init__(self, int x=0, int y=0) -> Point
1033 Create a wx.Point object
1035 _core_
.Point_swiginit(self
,_core_
.new_Point(*args
, **kwargs
))
1036 __swig_destroy__
= _core_
.delete_Point
1037 __del__
= lambda self
: None;
1038 def __eq__(*args
, **kwargs
):
1040 __eq__(self, PyObject other) -> bool
1042 Test for equality of wx.Point objects.
1044 return _core_
.Point___eq__(*args
, **kwargs
)
1046 def __ne__(*args
, **kwargs
):
1048 __ne__(self, PyObject other) -> bool
1050 Test for inequality of wx.Point objects.
1052 return _core_
.Point___ne__(*args
, **kwargs
)
1054 def __add__(*args
, **kwargs
):
1056 __add__(self, Point pt) -> Point
1058 Add pt's proprties to this and return the result.
1060 return _core_
.Point___add__(*args
, **kwargs
)
1062 def __sub__(*args
, **kwargs
):
1064 __sub__(self, Point pt) -> Point
1066 Subtract pt's proprties from this and return the result
1068 return _core_
.Point___sub__(*args
, **kwargs
)
1070 def __iadd__(*args
, **kwargs
):
1072 __iadd__(self, Point pt) -> Point
1074 Add pt to this object.
1076 return _core_
.Point___iadd__(*args
, **kwargs
)
1078 def __isub__(*args
, **kwargs
):
1080 __isub__(self, Point pt) -> Point
1082 Subtract pt from this object.
1084 return _core_
.Point___isub__(*args
, **kwargs
)
1086 def Set(*args
, **kwargs
):
1088 Set(self, long x, long y)
1090 Set both the x and y properties
1092 return _core_
.Point_Set(*args
, **kwargs
)
1094 def Get(*args
, **kwargs
):
1098 Return the x and y properties as a tuple.
1100 return _core_
.Point_Get(*args
, **kwargs
)
1102 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1103 def __str__(self
): return str(self
.Get())
1104 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1105 def __len__(self
): return len(self
.Get())
1106 def __getitem__(self
, index
): return self
.Get()[index
]
1107 def __setitem__(self
, index
, val
):
1108 if index
== 0: self
.x
= val
1109 elif index
== 1: self
.y
= val
1110 else: raise IndexError
1111 def __nonzero__(self
): return self
.Get() != (0,0)
1112 __safe_for_unpickling__
= True
1113 def __reduce__(self
): return (wx
.Point
, self
.Get())
1115 _core_
.Point_swigregister(Point
)
1117 #---------------------------------------------------------------------------
1121 A class for representing and manipulating rectangles. It has x, y,
1122 width and height properties. In wxPython most palces that expect a
1123 wx.Rect can also accept a (x,y,width,height) tuple.
1125 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1126 __repr__
= _swig_repr
1127 def __init__(self
, *args
, **kwargs
):
1129 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1131 Create a new Rect object.
1133 _core_
.Rect_swiginit(self
,_core_
.new_Rect(*args
, **kwargs
))
1134 __swig_destroy__
= _core_
.delete_Rect
1135 __del__
= lambda self
: None;
1136 def GetX(*args
, **kwargs
):
1137 """GetX(self) -> int"""
1138 return _core_
.Rect_GetX(*args
, **kwargs
)
1140 def SetX(*args
, **kwargs
):
1141 """SetX(self, int x)"""
1142 return _core_
.Rect_SetX(*args
, **kwargs
)
1144 def GetY(*args
, **kwargs
):
1145 """GetY(self) -> int"""
1146 return _core_
.Rect_GetY(*args
, **kwargs
)
1148 def SetY(*args
, **kwargs
):
1149 """SetY(self, int y)"""
1150 return _core_
.Rect_SetY(*args
, **kwargs
)
1152 def GetWidth(*args
, **kwargs
):
1153 """GetWidth(self) -> int"""
1154 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1156 def SetWidth(*args
, **kwargs
):
1157 """SetWidth(self, int w)"""
1158 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1160 def GetHeight(*args
, **kwargs
):
1161 """GetHeight(self) -> int"""
1162 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1164 def SetHeight(*args
, **kwargs
):
1165 """SetHeight(self, int h)"""
1166 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1168 def GetPosition(*args
, **kwargs
):
1169 """GetPosition(self) -> Point"""
1170 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1172 def SetPosition(*args
, **kwargs
):
1173 """SetPosition(self, Point p)"""
1174 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1176 def GetSize(*args
, **kwargs
):
1177 """GetSize(self) -> Size"""
1178 return _core_
.Rect_GetSize(*args
, **kwargs
)
1180 def SetSize(*args
, **kwargs
):
1181 """SetSize(self, Size s)"""
1182 return _core_
.Rect_SetSize(*args
, **kwargs
)
1184 def IsEmpty(*args
, **kwargs
):
1185 """IsEmpty(self) -> bool"""
1186 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1188 def GetTopLeft(*args
, **kwargs
):
1189 """GetTopLeft(self) -> Point"""
1190 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1192 def SetTopLeft(*args
, **kwargs
):
1193 """SetTopLeft(self, Point p)"""
1194 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1196 def GetBottomRight(*args
, **kwargs
):
1197 """GetBottomRight(self) -> Point"""
1198 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1200 def SetBottomRight(*args
, **kwargs
):
1201 """SetBottomRight(self, Point p)"""
1202 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1204 def GetTopRight(*args
, **kwargs
):
1205 """GetTopRight(self) -> Point"""
1206 return _core_
.Rect_GetTopRight(*args
, **kwargs
)
1208 def SetTopRight(*args
, **kwargs
):
1209 """SetTopRight(self, Point p)"""
1210 return _core_
.Rect_SetTopRight(*args
, **kwargs
)
1212 def GetBottomLeft(*args
, **kwargs
):
1213 """GetBottomLeft(self) -> Point"""
1214 return _core_
.Rect_GetBottomLeft(*args
, **kwargs
)
1216 def SetBottomLeft(*args
, **kwargs
):
1217 """SetBottomLeft(self, Point p)"""
1218 return _core_
.Rect_SetBottomLeft(*args
, **kwargs
)
1220 def GetLeft(*args
, **kwargs
):
1221 """GetLeft(self) -> int"""
1222 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1224 def GetTop(*args
, **kwargs
):
1225 """GetTop(self) -> int"""
1226 return _core_
.Rect_GetTop(*args
, **kwargs
)
1228 def GetBottom(*args
, **kwargs
):
1229 """GetBottom(self) -> int"""
1230 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1232 def GetRight(*args
, **kwargs
):
1233 """GetRight(self) -> int"""
1234 return _core_
.Rect_GetRight(*args
, **kwargs
)
1236 def SetLeft(*args
, **kwargs
):
1237 """SetLeft(self, int left)"""
1238 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1240 def SetRight(*args
, **kwargs
):
1241 """SetRight(self, int right)"""
1242 return _core_
.Rect_SetRight(*args
, **kwargs
)
1244 def SetTop(*args
, **kwargs
):
1245 """SetTop(self, int top)"""
1246 return _core_
.Rect_SetTop(*args
, **kwargs
)
1248 def SetBottom(*args
, **kwargs
):
1249 """SetBottom(self, int bottom)"""
1250 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1252 position
= property(GetPosition
, SetPosition
)
1253 size
= property(GetSize
, SetSize
)
1254 left
= property(GetLeft
, SetLeft
)
1255 right
= property(GetRight
, SetRight
)
1256 top
= property(GetTop
, SetTop
)
1257 bottom
= property(GetBottom
, SetBottom
)
1259 def Inflate(*args
, **kwargs
):
1261 Inflate(self, int dx, int dy) -> Rect
1263 Increases the size of the rectangle.
1265 The left border is moved farther left and the right border is moved
1266 farther right by ``dx``. The upper border is moved farther up and the
1267 bottom border is moved farther down by ``dy``. (Note the the width and
1268 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1269 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1270 opposite happens: the rectangle size decreases in the respective
1273 The change is made to the rectangle inplace, if instead you need a
1274 copy that is inflated, preserving the original then make the copy
1277 copy = wx.Rect(*original)
1282 return _core_
.Rect_Inflate(*args
, **kwargs
)
1284 def Deflate(*args
, **kwargs
):
1286 Deflate(self, int dx, int dy) -> Rect
1288 Decrease the rectangle size. This method is the opposite of `Inflate`
1289 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1290 `Inflate` for a full description.
1292 return _core_
.Rect_Deflate(*args
, **kwargs
)
1294 def OffsetXY(*args
, **kwargs
):
1296 OffsetXY(self, int dx, int dy)
1298 Moves the rectangle by the specified offset. If dx is positive, the
1299 rectangle is moved to the right, if dy is positive, it is moved to the
1300 bottom, otherwise it is moved to the left or top respectively.
1302 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1304 def Offset(*args
, **kwargs
):
1306 Offset(self, Point pt)
1308 Same as `OffsetXY` but uses dx,dy from Point
1310 return _core_
.Rect_Offset(*args
, **kwargs
)
1312 def Intersect(*args
, **kwargs
):
1314 Intersect(self, Rect rect) -> Rect
1316 Returns the intersectsion of this rectangle and rect.
1318 return _core_
.Rect_Intersect(*args
, **kwargs
)
1320 def Union(*args
, **kwargs
):
1322 Union(self, Rect rect) -> Rect
1324 Returns the union of this rectangle and rect.
1326 return _core_
.Rect_Union(*args
, **kwargs
)
1328 def __add__(*args
, **kwargs
):
1330 __add__(self, Rect rect) -> Rect
1332 Add the properties of rect to this rectangle and return the result.
1334 return _core_
.Rect___add__(*args
, **kwargs
)
1336 def __iadd__(*args
, **kwargs
):
1338 __iadd__(self, Rect rect) -> Rect
1340 Add the properties of rect to this rectangle, updating this rectangle.
1342 return _core_
.Rect___iadd__(*args
, **kwargs
)
1344 def __eq__(*args
, **kwargs
):
1346 __eq__(self, PyObject other) -> bool
1348 Test for equality of wx.Rect objects.
1350 return _core_
.Rect___eq__(*args
, **kwargs
)
1352 def __ne__(*args
, **kwargs
):
1354 __ne__(self, PyObject other) -> bool
1356 Test for inequality of wx.Rect objects.
1358 return _core_
.Rect___ne__(*args
, **kwargs
)
1360 def ContainsXY(*args
, **kwargs
):
1362 ContainsXY(self, int x, int y) -> bool
1364 Return True if the point is inside the rect.
1366 return _core_
.Rect_ContainsXY(*args
, **kwargs
)
1368 def Contains(*args
, **kwargs
):
1370 Contains(self, Point pt) -> bool
1372 Return True if the point is inside the rect.
1374 return _core_
.Rect_Contains(*args
, **kwargs
)
1376 def ContainsRect(*args
, **kwargs
):
1378 ContainsRect(self, Rect rect) -> bool
1380 Returns ``True`` if the given rectangle is completely inside this
1381 rectangle or touches its boundary.
1383 return _core_
.Rect_ContainsRect(*args
, **kwargs
)
1385 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1386 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1387 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1389 InsideXY
= ContainsXY
1390 InsideRect
= ContainsRect
1392 def Intersects(*args
, **kwargs
):
1394 Intersects(self, Rect rect) -> bool
1396 Returns True if the rectangles have a non empty intersection.
1398 return _core_
.Rect_Intersects(*args
, **kwargs
)
1400 def CenterIn(*args
, **kwargs
):
1402 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1404 Center this rectangle within the one passed to the method, which is
1405 usually, but not necessarily, the larger one.
1407 return _core_
.Rect_CenterIn(*args
, **kwargs
)
1410 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1411 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1412 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1413 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1414 def Set(*args
, **kwargs
):
1416 Set(self, int x=0, int y=0, int width=0, int height=0)
1418 Set all rectangle properties.
1420 return _core_
.Rect_Set(*args
, **kwargs
)
1422 def Get(*args
, **kwargs
):
1424 Get() -> (x,y,width,height)
1426 Return the rectangle properties as a tuple.
1428 return _core_
.Rect_Get(*args
, **kwargs
)
1430 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1431 def __str__(self
): return str(self
.Get())
1432 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1433 def __len__(self
): return len(self
.Get())
1434 def __getitem__(self
, index
): return self
.Get()[index
]
1435 def __setitem__(self
, index
, val
):
1436 if index
== 0: self
.x
= val
1437 elif index
== 1: self
.y
= val
1438 elif index
== 2: self
.width
= val
1439 elif index
== 3: self
.height
= val
1440 else: raise IndexError
1441 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1442 __safe_for_unpickling__
= True
1443 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1445 Bottom
= property(GetBottom
,SetBottom
,doc
="See `GetBottom` and `SetBottom`")
1446 BottomRight
= property(GetBottomRight
,SetBottomRight
,doc
="See `GetBottomRight` and `SetBottomRight`")
1447 BottomLeft
= property(GetBottomLeft
,SetBottomLeft
,doc
="See `GetBottomLeft` and `SetBottomLeft`")
1448 Height
= property(GetHeight
,SetHeight
,doc
="See `GetHeight` and `SetHeight`")
1449 Left
= property(GetLeft
,SetLeft
,doc
="See `GetLeft` and `SetLeft`")
1450 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
1451 Right
= property(GetRight
,SetRight
,doc
="See `GetRight` and `SetRight`")
1452 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
1453 Top
= property(GetTop
,SetTop
,doc
="See `GetTop` and `SetTop`")
1454 TopLeft
= property(GetTopLeft
,SetTopLeft
,doc
="See `GetTopLeft` and `SetTopLeft`")
1455 TopRight
= property(GetTopRight
,SetTopRight
,doc
="See `GetTopRight` and `SetTopRight`")
1456 Width
= property(GetWidth
,SetWidth
,doc
="See `GetWidth` and `SetWidth`")
1457 X
= property(GetX
,SetX
,doc
="See `GetX` and `SetX`")
1458 Y
= property(GetY
,SetY
,doc
="See `GetY` and `SetY`")
1459 Empty
= property(IsEmpty
,doc
="See `IsEmpty`")
1460 _core_
.Rect_swigregister(Rect
)
1462 def RectPP(*args
, **kwargs
):
1464 RectPP(Point topLeft, Point bottomRight) -> Rect
1466 Create a new Rect object from Points representing two corners.
1468 val
= _core_
.new_RectPP(*args
, **kwargs
)
1471 def RectPS(*args
, **kwargs
):
1473 RectPS(Point pos, Size size) -> Rect
1475 Create a new Rect from a position and size.
1477 val
= _core_
.new_RectPS(*args
, **kwargs
)
1480 def RectS(*args
, **kwargs
):
1482 RectS(Size size) -> Rect
1484 Create a new Rect from a size only.
1486 val
= _core_
.new_RectS(*args
, **kwargs
)
1490 def IntersectRect(*args
, **kwargs
):
1492 IntersectRect(Rect r1, Rect r2) -> Rect
1494 Calculate and return the intersection of r1 and r2.
1496 return _core_
.IntersectRect(*args
, **kwargs
)
1497 #---------------------------------------------------------------------------
1499 class Point2D(object):
1501 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1502 with floating point values.
1504 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1505 __repr__
= _swig_repr
1506 def __init__(self
, *args
, **kwargs
):
1508 __init__(self, double x=0.0, double y=0.0) -> Point2D
1510 Create a w.Point2D object.
1512 _core_
.Point2D_swiginit(self
,_core_
.new_Point2D(*args
, **kwargs
))
1513 __swig_destroy__
= _core_
.delete_Point2D
1514 __del__
= lambda self
: None;
1515 def GetFloor(*args
, **kwargs
):
1521 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1523 def GetRounded(*args
, **kwargs
):
1525 GetRounded() -> (x,y)
1529 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1531 def GetVectorLength(*args
, **kwargs
):
1532 """GetVectorLength(self) -> double"""
1533 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1535 def GetVectorAngle(*args
, **kwargs
):
1536 """GetVectorAngle(self) -> double"""
1537 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1539 def SetVectorLength(*args
, **kwargs
):
1540 """SetVectorLength(self, double length)"""
1541 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1543 def SetVectorAngle(*args
, **kwargs
):
1544 """SetVectorAngle(self, double degrees)"""
1545 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1547 def SetPolarCoordinates(self
, angle
, length
):
1548 self
.SetVectorLength(length
)
1549 self
.SetVectorAngle(angle
)
1550 def Normalize(self
):
1551 self
.SetVectorLength(1.0)
1553 def GetDistance(*args
, **kwargs
):
1554 """GetDistance(self, Point2D pt) -> double"""
1555 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1557 def GetDistanceSquare(*args
, **kwargs
):
1558 """GetDistanceSquare(self, Point2D pt) -> double"""
1559 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1561 def GetDotProduct(*args
, **kwargs
):
1562 """GetDotProduct(self, Point2D vec) -> double"""
1563 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1565 def GetCrossProduct(*args
, **kwargs
):
1566 """GetCrossProduct(self, Point2D vec) -> double"""
1567 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1569 def __neg__(*args
, **kwargs
):
1571 __neg__(self) -> Point2D
1573 the reflection of this point
1575 return _core_
.Point2D___neg__(*args
, **kwargs
)
1577 def __iadd__(*args
, **kwargs
):
1578 """__iadd__(self, Point2D pt) -> Point2D"""
1579 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1581 def __isub__(*args
, **kwargs
):
1582 """__isub__(self, Point2D pt) -> Point2D"""
1583 return _core_
.Point2D___isub__(*args
, **kwargs
)
1585 def __imul__(*args
, **kwargs
):
1586 """__imul__(self, Point2D pt) -> Point2D"""
1587 return _core_
.Point2D___imul__(*args
, **kwargs
)
1589 def __idiv__(*args
, **kwargs
):
1590 """__idiv__(self, Point2D pt) -> Point2D"""
1591 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1593 def __eq__(*args
, **kwargs
):
1595 __eq__(self, PyObject other) -> bool
1597 Test for equality of wx.Point2D objects.
1599 return _core_
.Point2D___eq__(*args
, **kwargs
)
1601 def __ne__(*args
, **kwargs
):
1603 __ne__(self, PyObject other) -> bool
1605 Test for inequality of wx.Point2D objects.
1607 return _core_
.Point2D___ne__(*args
, **kwargs
)
1609 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1610 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1611 def Set(*args
, **kwargs
):
1612 """Set(self, double x=0, double y=0)"""
1613 return _core_
.Point2D_Set(*args
, **kwargs
)
1615 def Get(*args
, **kwargs
):
1619 Return x and y properties as a tuple.
1621 return _core_
.Point2D_Get(*args
, **kwargs
)
1623 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1624 def __str__(self
): return str(self
.Get())
1625 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1626 def __len__(self
): return len(self
.Get())
1627 def __getitem__(self
, index
): return self
.Get()[index
]
1628 def __setitem__(self
, index
, val
):
1629 if index
== 0: self
.x
= val
1630 elif index
== 1: self
.y
= val
1631 else: raise IndexError
1632 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1633 __safe_for_unpickling__
= True
1634 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1636 Floor
= property(GetFloor
,doc
="See `GetFloor`")
1637 Rounded
= property(GetRounded
,doc
="See `GetRounded`")
1638 VectorAngle
= property(GetVectorAngle
,SetVectorAngle
,doc
="See `GetVectorAngle` and `SetVectorAngle`")
1639 VectorLength
= property(GetVectorLength
,SetVectorLength
,doc
="See `GetVectorLength` and `SetVectorLength`")
1640 _core_
.Point2D_swigregister(Point2D
)
1642 def Point2DCopy(*args
, **kwargs
):
1644 Point2DCopy(Point2D pt) -> Point2D
1646 Create a w.Point2D object.
1648 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1651 def Point2DFromPoint(*args
, **kwargs
):
1653 Point2DFromPoint(Point pt) -> Point2D
1655 Create a w.Point2D object.
1657 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1660 #---------------------------------------------------------------------------
1662 Inside
= _core_
.Inside
1663 OutLeft
= _core_
.OutLeft
1664 OutRight
= _core_
.OutRight
1665 OutTop
= _core_
.OutTop
1666 OutBottom
= _core_
.OutBottom
1667 class Rect2D(object):
1669 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1670 with floating point component values.
1672 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1673 __repr__
= _swig_repr
1674 def __init__(self
, *args
, **kwargs
):
1676 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1678 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1679 with floating point component values.
1681 _core_
.Rect2D_swiginit(self
,_core_
.new_Rect2D(*args
, **kwargs
))
1682 __swig_destroy__
= _core_
.delete_Rect2D
1683 __del__
= lambda self
: None;
1684 def GetPosition(*args
, **kwargs
):
1685 """GetPosition(self) -> Point2D"""
1686 return _core_
.Rect2D_GetPosition(*args
, **kwargs
)
1688 def GetSize(*args
, **kwargs
):
1689 """GetSize(self) -> Size"""
1690 return _core_
.Rect2D_GetSize(*args
, **kwargs
)
1692 def GetLeft(*args
, **kwargs
):
1693 """GetLeft(self) -> wxDouble"""
1694 return _core_
.Rect2D_GetLeft(*args
, **kwargs
)
1696 def SetLeft(*args
, **kwargs
):
1697 """SetLeft(self, wxDouble n)"""
1698 return _core_
.Rect2D_SetLeft(*args
, **kwargs
)
1700 def MoveLeftTo(*args
, **kwargs
):
1701 """MoveLeftTo(self, wxDouble n)"""
1702 return _core_
.Rect2D_MoveLeftTo(*args
, **kwargs
)
1704 def GetTop(*args
, **kwargs
):
1705 """GetTop(self) -> wxDouble"""
1706 return _core_
.Rect2D_GetTop(*args
, **kwargs
)
1708 def SetTop(*args
, **kwargs
):
1709 """SetTop(self, wxDouble n)"""
1710 return _core_
.Rect2D_SetTop(*args
, **kwargs
)
1712 def MoveTopTo(*args
, **kwargs
):
1713 """MoveTopTo(self, wxDouble n)"""
1714 return _core_
.Rect2D_MoveTopTo(*args
, **kwargs
)
1716 def GetBottom(*args
, **kwargs
):
1717 """GetBottom(self) -> wxDouble"""
1718 return _core_
.Rect2D_GetBottom(*args
, **kwargs
)
1720 def SetBottom(*args
, **kwargs
):
1721 """SetBottom(self, wxDouble n)"""
1722 return _core_
.Rect2D_SetBottom(*args
, **kwargs
)
1724 def MoveBottomTo(*args
, **kwargs
):
1725 """MoveBottomTo(self, wxDouble n)"""
1726 return _core_
.Rect2D_MoveBottomTo(*args
, **kwargs
)
1728 def GetRight(*args
, **kwargs
):
1729 """GetRight(self) -> wxDouble"""
1730 return _core_
.Rect2D_GetRight(*args
, **kwargs
)
1732 def SetRight(*args
, **kwargs
):
1733 """SetRight(self, wxDouble n)"""
1734 return _core_
.Rect2D_SetRight(*args
, **kwargs
)
1736 def MoveRightTo(*args
, **kwargs
):
1737 """MoveRightTo(self, wxDouble n)"""
1738 return _core_
.Rect2D_MoveRightTo(*args
, **kwargs
)
1740 def GetLeftTop(*args
, **kwargs
):
1741 """GetLeftTop(self) -> Point2D"""
1742 return _core_
.Rect2D_GetLeftTop(*args
, **kwargs
)
1744 def SetLeftTop(*args
, **kwargs
):
1745 """SetLeftTop(self, Point2D pt)"""
1746 return _core_
.Rect2D_SetLeftTop(*args
, **kwargs
)
1748 def MoveLeftTopTo(*args
, **kwargs
):
1749 """MoveLeftTopTo(self, Point2D pt)"""
1750 return _core_
.Rect2D_MoveLeftTopTo(*args
, **kwargs
)
1752 def GetLeftBottom(*args
, **kwargs
):
1753 """GetLeftBottom(self) -> Point2D"""
1754 return _core_
.Rect2D_GetLeftBottom(*args
, **kwargs
)
1756 def SetLeftBottom(*args
, **kwargs
):
1757 """SetLeftBottom(self, Point2D pt)"""
1758 return _core_
.Rect2D_SetLeftBottom(*args
, **kwargs
)
1760 def MoveLeftBottomTo(*args
, **kwargs
):
1761 """MoveLeftBottomTo(self, Point2D pt)"""
1762 return _core_
.Rect2D_MoveLeftBottomTo(*args
, **kwargs
)
1764 def GetRightTop(*args
, **kwargs
):
1765 """GetRightTop(self) -> Point2D"""
1766 return _core_
.Rect2D_GetRightTop(*args
, **kwargs
)
1768 def SetRightTop(*args
, **kwargs
):
1769 """SetRightTop(self, Point2D pt)"""
1770 return _core_
.Rect2D_SetRightTop(*args
, **kwargs
)
1772 def MoveRightTopTo(*args
, **kwargs
):
1773 """MoveRightTopTo(self, Point2D pt)"""
1774 return _core_
.Rect2D_MoveRightTopTo(*args
, **kwargs
)
1776 def GetRightBottom(*args
, **kwargs
):
1777 """GetRightBottom(self) -> Point2D"""
1778 return _core_
.Rect2D_GetRightBottom(*args
, **kwargs
)
1780 def SetRightBottom(*args
, **kwargs
):
1781 """SetRightBottom(self, Point2D pt)"""
1782 return _core_
.Rect2D_SetRightBottom(*args
, **kwargs
)
1784 def MoveRightBottomTo(*args
, **kwargs
):
1785 """MoveRightBottomTo(self, Point2D pt)"""
1786 return _core_
.Rect2D_MoveRightBottomTo(*args
, **kwargs
)
1788 def GetCentre(*args
, **kwargs
):
1789 """GetCentre(self) -> Point2D"""
1790 return _core_
.Rect2D_GetCentre(*args
, **kwargs
)
1792 def SetCentre(*args
, **kwargs
):
1793 """SetCentre(self, Point2D pt)"""
1794 return _core_
.Rect2D_SetCentre(*args
, **kwargs
)
1796 def MoveCentreTo(*args
, **kwargs
):
1797 """MoveCentreTo(self, Point2D pt)"""
1798 return _core_
.Rect2D_MoveCentreTo(*args
, **kwargs
)
1800 def GetOutcode(*args
, **kwargs
):
1801 """GetOutcode(self, Point2D pt) -> int"""
1802 return _core_
.Rect2D_GetOutcode(*args
, **kwargs
)
1804 def Contains(*args
, **kwargs
):
1805 """Contains(self, Point2D pt) -> bool"""
1806 return _core_
.Rect2D_Contains(*args
, **kwargs
)
1808 def ContainsRect(*args
, **kwargs
):
1809 """ContainsRect(self, Rect2D rect) -> bool"""
1810 return _core_
.Rect2D_ContainsRect(*args
, **kwargs
)
1812 def IsEmpty(*args
, **kwargs
):
1813 """IsEmpty(self) -> bool"""
1814 return _core_
.Rect2D_IsEmpty(*args
, **kwargs
)
1816 def HaveEqualSize(*args
, **kwargs
):
1817 """HaveEqualSize(self, Rect2D rect) -> bool"""
1818 return _core_
.Rect2D_HaveEqualSize(*args
, **kwargs
)
1822 Inset(self, wxDouble x, wxDouble y)
1823 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1825 return _core_
.Rect2D_Inset(*args
)
1827 def Offset(*args
, **kwargs
):
1828 """Offset(self, Point2D pt)"""
1829 return _core_
.Rect2D_Offset(*args
, **kwargs
)
1831 def ConstrainTo(*args
, **kwargs
):
1832 """ConstrainTo(self, Rect2D rect)"""
1833 return _core_
.Rect2D_ConstrainTo(*args
, **kwargs
)
1835 def Interpolate(*args
, **kwargs
):
1836 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1837 return _core_
.Rect2D_Interpolate(*args
, **kwargs
)
1839 def Intersect(*args
, **kwargs
):
1840 """Intersect(self, Rect2D otherRect)"""
1841 return _core_
.Rect2D_Intersect(*args
, **kwargs
)
1843 def CreateIntersection(*args
, **kwargs
):
1844 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1845 return _core_
.Rect2D_CreateIntersection(*args
, **kwargs
)
1847 def Intersects(*args
, **kwargs
):
1848 """Intersects(self, Rect2D rect) -> bool"""
1849 return _core_
.Rect2D_Intersects(*args
, **kwargs
)
1851 def Union(*args
, **kwargs
):
1852 """Union(self, Rect2D otherRect)"""
1853 return _core_
.Rect2D_Union(*args
, **kwargs
)
1855 def CreateUnion(*args
, **kwargs
):
1856 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1857 return _core_
.Rect2D_CreateUnion(*args
, **kwargs
)
1861 Scale(self, wxDouble f)
1862 Scale(self, int num, int denum)
1864 return _core_
.Rect2D_Scale(*args
)
1866 def __eq__(*args
, **kwargs
):
1868 __eq__(self, PyObject other) -> bool
1870 Test for equality of wx.Rect2D objects.
1872 return _core_
.Rect2D___eq__(*args
, **kwargs
)
1874 def __ne__(*args
, **kwargs
):
1876 __ne__(self, PyObject other) -> bool
1878 Test for inequality of wx.Rect2D objects.
1880 return _core_
.Rect2D___ne__(*args
, **kwargs
)
1882 x
= property(_core_
.Rect2D_x_get
, _core_
.Rect2D_x_set
)
1883 y
= property(_core_
.Rect2D_y_get
, _core_
.Rect2D_y_set
)
1884 width
= property(_core_
.Rect2D_width_get
, _core_
.Rect2D_width_set
)
1885 height
= property(_core_
.Rect2D_height_get
, _core_
.Rect2D_height_set
)
1886 def Set(*args
, **kwargs
):
1887 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1888 return _core_
.Rect2D_Set(*args
, **kwargs
)
1890 def Get(*args
, **kwargs
):
1892 Get() -> (x,y, width, height)
1894 Return x, y, width and height y properties as a tuple.
1896 return _core_
.Rect2D_Get(*args
, **kwargs
)
1898 def __str__(self
): return str(self
.Get())
1899 def __repr__(self
): return 'wx.Rect2D'+str(self
.Get())
1900 def __len__(self
): return len(self
.Get())
1901 def __getitem__(self
, index
): return self
.Get()[index
]
1902 def __setitem__(self
, index
, val
):
1903 if index
== 0: self
.x
= val
1904 elif index
== 1: self
.y
= val
1905 elif index
== 2: self
.width
= val
1906 elif index
== 3: self
.height
= val
1907 else: raise IndexError
1908 def __nonzero__(self
): return self
.Get() != (0.0, 0.0, 0.0, 0.0)
1909 __safe_for_unpickling__
= True
1910 def __reduce__(self
): return (wx
.Rect2D
, self
.Get())
1912 _core_
.Rect2D_swigregister(Rect2D
)
1914 #---------------------------------------------------------------------------
1916 FromStart
= _core_
.FromStart
1917 FromCurrent
= _core_
.FromCurrent
1918 FromEnd
= _core_
.FromEnd
1919 class InputStream(object):
1920 """Proxy of C++ InputStream class"""
1921 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1922 __repr__
= _swig_repr
1923 def __init__(self
, *args
, **kwargs
):
1924 """__init__(self, PyObject p) -> InputStream"""
1925 _core_
.InputStream_swiginit(self
,_core_
.new_InputStream(*args
, **kwargs
))
1926 __swig_destroy__
= _core_
.delete_InputStream
1927 __del__
= lambda self
: None;
1928 def close(*args
, **kwargs
):
1930 return _core_
.InputStream_close(*args
, **kwargs
)
1932 def flush(*args
, **kwargs
):
1934 return _core_
.InputStream_flush(*args
, **kwargs
)
1936 def eof(*args
, **kwargs
):
1937 """eof(self) -> bool"""
1938 return _core_
.InputStream_eof(*args
, **kwargs
)
1940 def read(*args
, **kwargs
):
1941 """read(self, int size=-1) -> PyObject"""
1942 return _core_
.InputStream_read(*args
, **kwargs
)
1944 def readline(*args
, **kwargs
):
1945 """readline(self, int size=-1) -> PyObject"""
1946 return _core_
.InputStream_readline(*args
, **kwargs
)
1948 def readlines(*args
, **kwargs
):
1949 """readlines(self, int sizehint=-1) -> PyObject"""
1950 return _core_
.InputStream_readlines(*args
, **kwargs
)
1952 def seek(*args
, **kwargs
):
1953 """seek(self, int offset, int whence=0)"""
1954 return _core_
.InputStream_seek(*args
, **kwargs
)
1956 def tell(*args
, **kwargs
):
1957 """tell(self) -> int"""
1958 return _core_
.InputStream_tell(*args
, **kwargs
)
1960 def Peek(*args
, **kwargs
):
1961 """Peek(self) -> char"""
1962 return _core_
.InputStream_Peek(*args
, **kwargs
)
1964 def GetC(*args
, **kwargs
):
1965 """GetC(self) -> char"""
1966 return _core_
.InputStream_GetC(*args
, **kwargs
)
1968 def LastRead(*args
, **kwargs
):
1969 """LastRead(self) -> size_t"""
1970 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1972 def CanRead(*args
, **kwargs
):
1973 """CanRead(self) -> bool"""
1974 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1976 def Eof(*args
, **kwargs
):
1977 """Eof(self) -> bool"""
1978 return _core_
.InputStream_Eof(*args
, **kwargs
)
1980 def Ungetch(*args
, **kwargs
):
1981 """Ungetch(self, char c) -> bool"""
1982 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1984 def SeekI(*args
, **kwargs
):
1985 """SeekI(self, long pos, int mode=FromStart) -> long"""
1986 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1988 def TellI(*args
, **kwargs
):
1989 """TellI(self) -> long"""
1990 return _core_
.InputStream_TellI(*args
, **kwargs
)
1992 _core_
.InputStream_swigregister(InputStream
)
1993 DefaultPosition
= cvar
.DefaultPosition
1994 DefaultSize
= cvar
.DefaultSize
1996 class OutputStream(object):
1997 """Proxy of C++ OutputStream class"""
1998 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1999 def __init__(self
): raise AttributeError, "No constructor defined"
2000 __repr__
= _swig_repr
2001 def write(*args
, **kwargs
):
2002 """write(self, PyObject obj)"""
2003 return _core_
.OutputStream_write(*args
, **kwargs
)
2005 def LastWrite(*args
, **kwargs
):
2006 """LastWrite(self) -> size_t"""
2007 return _core_
.OutputStream_LastWrite(*args
, **kwargs
)
2009 _core_
.OutputStream_swigregister(OutputStream
)
2011 #---------------------------------------------------------------------------
2013 class FSFile(Object
):
2014 """Proxy of C++ FSFile class"""
2015 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2016 __repr__
= _swig_repr
2017 def __init__(self
, *args
, **kwargs
):
2019 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
2020 DateTime modif) -> FSFile
2022 _core_
.FSFile_swiginit(self
,_core_
.new_FSFile(*args
, **kwargs
))
2023 __swig_destroy__
= _core_
.delete_FSFile
2024 __del__
= lambda self
: None;
2025 def GetStream(*args
, **kwargs
):
2026 """GetStream(self) -> InputStream"""
2027 return _core_
.FSFile_GetStream(*args
, **kwargs
)
2029 def DetachStream(*args
, **kwargs
):
2030 """DetachStream(self)"""
2031 return _core_
.FSFile_DetachStream(*args
, **kwargs
)
2033 def GetMimeType(*args
, **kwargs
):
2034 """GetMimeType(self) -> String"""
2035 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
2037 def GetLocation(*args
, **kwargs
):
2038 """GetLocation(self) -> String"""
2039 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
2041 def GetAnchor(*args
, **kwargs
):
2042 """GetAnchor(self) -> String"""
2043 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
2045 def GetModificationTime(*args
, **kwargs
):
2046 """GetModificationTime(self) -> DateTime"""
2047 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
2049 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
2050 Location
= property(GetLocation
,doc
="See `GetLocation`")
2051 MimeType
= property(GetMimeType
,doc
="See `GetMimeType`")
2052 ModificationTime
= property(GetModificationTime
,doc
="See `GetModificationTime`")
2053 Stream
= property(GetStream
,doc
="See `GetStream`")
2054 _core_
.FSFile_swigregister(FSFile
)
2056 class CPPFileSystemHandler(object):
2057 """Proxy of C++ CPPFileSystemHandler class"""
2058 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2059 def __init__(self
): raise AttributeError, "No constructor defined"
2060 __repr__
= _swig_repr
2061 __swig_destroy__
= _core_
.delete_CPPFileSystemHandler
2062 __del__
= lambda self
: None;
2063 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandler
)
2065 class FileSystemHandler(CPPFileSystemHandler
):
2066 """Proxy of C++ FileSystemHandler class"""
2067 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2068 __repr__
= _swig_repr
2069 def __init__(self
, *args
, **kwargs
):
2070 """__init__(self) -> FileSystemHandler"""
2071 _core_
.FileSystemHandler_swiginit(self
,_core_
.new_FileSystemHandler(*args
, **kwargs
))
2072 FileSystemHandler
._setCallbackInfo
(self
, self
, FileSystemHandler
)
2074 def _setCallbackInfo(*args
, **kwargs
):
2075 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
2076 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
2078 def CanOpen(*args
, **kwargs
):
2079 """CanOpen(self, String location) -> bool"""
2080 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
2082 def OpenFile(*args
, **kwargs
):
2083 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2084 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
2086 def FindFirst(*args
, **kwargs
):
2087 """FindFirst(self, String spec, int flags=0) -> String"""
2088 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
2090 def FindNext(*args
, **kwargs
):
2091 """FindNext(self) -> String"""
2092 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
2094 def GetProtocol(*args
, **kwargs
):
2095 """GetProtocol(self, String location) -> String"""
2096 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
2098 def GetLeftLocation(*args
, **kwargs
):
2099 """GetLeftLocation(self, String location) -> String"""
2100 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
2102 def GetAnchor(*args
, **kwargs
):
2103 """GetAnchor(self, String location) -> String"""
2104 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
2106 def GetRightLocation(*args
, **kwargs
):
2107 """GetRightLocation(self, String location) -> String"""
2108 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
2110 def GetMimeTypeFromExt(*args
, **kwargs
):
2111 """GetMimeTypeFromExt(self, String location) -> String"""
2112 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
2114 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
2115 LeftLocation
= property(GetLeftLocation
,doc
="See `GetLeftLocation`")
2116 MimeTypeFromExt
= property(GetMimeTypeFromExt
,doc
="See `GetMimeTypeFromExt`")
2117 Protocol
= property(GetProtocol
,doc
="See `GetProtocol`")
2118 RightLocation
= property(GetRightLocation
,doc
="See `GetRightLocation`")
2119 _core_
.FileSystemHandler_swigregister(FileSystemHandler
)
2121 class FileSystem(Object
):
2122 """Proxy of C++ FileSystem class"""
2123 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2124 __repr__
= _swig_repr
2125 def __init__(self
, *args
, **kwargs
):
2126 """__init__(self) -> FileSystem"""
2127 _core_
.FileSystem_swiginit(self
,_core_
.new_FileSystem(*args
, **kwargs
))
2128 __swig_destroy__
= _core_
.delete_FileSystem
2129 __del__
= lambda self
: None;
2130 def ChangePathTo(*args
, **kwargs
):
2131 """ChangePathTo(self, String location, bool is_dir=False)"""
2132 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
2134 def GetPath(*args
, **kwargs
):
2135 """GetPath(self) -> String"""
2136 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
2138 def OpenFile(*args
, **kwargs
):
2139 """OpenFile(self, String location) -> FSFile"""
2140 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
2142 def FindFirst(*args
, **kwargs
):
2143 """FindFirst(self, String spec, int flags=0) -> String"""
2144 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
2146 def FindNext(*args
, **kwargs
):
2147 """FindNext(self) -> String"""
2148 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
2150 def AddHandler(*args
, **kwargs
):
2151 """AddHandler(CPPFileSystemHandler handler)"""
2152 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
2154 AddHandler
= staticmethod(AddHandler
)
2155 def RemoveHandler(*args
, **kwargs
):
2156 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2157 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
2159 RemoveHandler
= staticmethod(RemoveHandler
)
2160 def CleanUpHandlers(*args
, **kwargs
):
2161 """CleanUpHandlers()"""
2162 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
2164 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
2165 def FileNameToURL(*args
, **kwargs
):
2166 """FileNameToURL(String filename) -> String"""
2167 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
2169 FileNameToURL
= staticmethod(FileNameToURL
)
2170 def URLToFileName(*args
, **kwargs
):
2171 """URLToFileName(String url) -> String"""
2172 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
2174 URLToFileName
= staticmethod(URLToFileName
)
2175 Path
= property(GetPath
,doc
="See `GetPath`")
2176 _core_
.FileSystem_swigregister(FileSystem
)
2178 def FileSystem_AddHandler(*args
, **kwargs
):
2179 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2180 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
2182 def FileSystem_RemoveHandler(*args
, **kwargs
):
2183 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2184 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
2186 def FileSystem_CleanUpHandlers(*args
):
2187 """FileSystem_CleanUpHandlers()"""
2188 return _core_
.FileSystem_CleanUpHandlers(*args
)
2190 def FileSystem_FileNameToURL(*args
, **kwargs
):
2191 """FileSystem_FileNameToURL(String filename) -> String"""
2192 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
2194 def FileSystem_URLToFileName(*args
, **kwargs
):
2195 """FileSystem_URLToFileName(String url) -> String"""
2196 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
2198 class InternetFSHandler(CPPFileSystemHandler
):
2199 """Proxy of C++ InternetFSHandler class"""
2200 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2201 __repr__
= _swig_repr
2202 def __init__(self
, *args
, **kwargs
):
2203 """__init__(self) -> InternetFSHandler"""
2204 _core_
.InternetFSHandler_swiginit(self
,_core_
.new_InternetFSHandler(*args
, **kwargs
))
2205 def CanOpen(*args
, **kwargs
):
2206 """CanOpen(self, String location) -> bool"""
2207 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
2209 def OpenFile(*args
, **kwargs
):
2210 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2211 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
2213 _core_
.InternetFSHandler_swigregister(InternetFSHandler
)
2215 class ZipFSHandler(CPPFileSystemHandler
):
2216 """Proxy of C++ ZipFSHandler class"""
2217 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2218 __repr__
= _swig_repr
2219 def __init__(self
, *args
, **kwargs
):
2220 """__init__(self) -> ZipFSHandler"""
2221 _core_
.ZipFSHandler_swiginit(self
,_core_
.new_ZipFSHandler(*args
, **kwargs
))
2222 def CanOpen(*args
, **kwargs
):
2223 """CanOpen(self, String location) -> bool"""
2224 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
2226 def OpenFile(*args
, **kwargs
):
2227 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2228 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
2230 def FindFirst(*args
, **kwargs
):
2231 """FindFirst(self, String spec, int flags=0) -> String"""
2232 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
2234 def FindNext(*args
, **kwargs
):
2235 """FindNext(self) -> String"""
2236 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
2238 _core_
.ZipFSHandler_swigregister(ZipFSHandler
)
2241 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
2242 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2243 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
2245 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
2246 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2247 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
2249 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
2250 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2251 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
2252 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
2254 Add 'file' to the memory filesystem. The dataItem parameter can
2255 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2256 arbitrary data. If a bitmap or image is used then the imgType
2257 parameter should specify what kind of image file it should be
2258 written as, wx.BITMAP_TYPE_PNG, etc.
2260 if isinstance(dataItem
, wx
.Image
):
2261 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
2262 elif isinstance(dataItem
, wx
.Bitmap
):
2263 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
2264 elif type(dataItem
) == str:
2265 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
2267 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
2269 class MemoryFSHandler(CPPFileSystemHandler
):
2270 """Proxy of C++ MemoryFSHandler class"""
2271 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2272 __repr__
= _swig_repr
2273 def __init__(self
, *args
, **kwargs
):
2274 """__init__(self) -> MemoryFSHandler"""
2275 _core_
.MemoryFSHandler_swiginit(self
,_core_
.new_MemoryFSHandler(*args
, **kwargs
))
2276 def RemoveFile(*args
, **kwargs
):
2277 """RemoveFile(String filename)"""
2278 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2280 RemoveFile
= staticmethod(RemoveFile
)
2281 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
2282 def CanOpen(*args
, **kwargs
):
2283 """CanOpen(self, String location) -> bool"""
2284 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
2286 def OpenFile(*args
, **kwargs
):
2287 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2288 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
2290 def FindFirst(*args
, **kwargs
):
2291 """FindFirst(self, String spec, int flags=0) -> String"""
2292 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
2294 def FindNext(*args
, **kwargs
):
2295 """FindNext(self) -> String"""
2296 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
2298 _core_
.MemoryFSHandler_swigregister(MemoryFSHandler
)
2300 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
2301 """MemoryFSHandler_RemoveFile(String filename)"""
2302 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2304 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
2305 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
2306 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
2307 IMAGE_QUALITY_NORMAL
= _core_
.IMAGE_QUALITY_NORMAL
2308 IMAGE_QUALITY_HIGH
= _core_
.IMAGE_QUALITY_HIGH
2309 #---------------------------------------------------------------------------
2311 class ImageHandler(Object
):
2313 This is the base class for implementing image file loading/saving, and
2314 image creation from data. It is used within `wx.Image` and is not
2315 normally seen by the application.
2317 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2318 def __init__(self
): raise AttributeError, "No constructor defined"
2319 __repr__
= _swig_repr
2320 def GetName(*args
, **kwargs
):
2321 """GetName(self) -> String"""
2322 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
2324 def GetExtension(*args
, **kwargs
):
2325 """GetExtension(self) -> String"""
2326 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
2328 def GetType(*args
, **kwargs
):
2329 """GetType(self) -> long"""
2330 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2332 def GetMimeType(*args
, **kwargs
):
2333 """GetMimeType(self) -> String"""
2334 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2336 def CanRead(*args
, **kwargs
):
2337 """CanRead(self, String name) -> bool"""
2338 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2340 def CanReadStream(*args
, **kwargs
):
2341 """CanReadStream(self, InputStream stream) -> bool"""
2342 return _core_
.ImageHandler_CanReadStream(*args
, **kwargs
)
2344 def SetName(*args
, **kwargs
):
2345 """SetName(self, String name)"""
2346 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2348 def SetExtension(*args
, **kwargs
):
2349 """SetExtension(self, String extension)"""
2350 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2352 def SetType(*args
, **kwargs
):
2353 """SetType(self, long type)"""
2354 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2356 def SetMimeType(*args
, **kwargs
):
2357 """SetMimeType(self, String mimetype)"""
2358 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2360 Extension
= property(GetExtension
,SetExtension
,doc
="See `GetExtension` and `SetExtension`")
2361 MimeType
= property(GetMimeType
,SetMimeType
,doc
="See `GetMimeType` and `SetMimeType`")
2362 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
2363 Type
= property(GetType
,SetType
,doc
="See `GetType` and `SetType`")
2364 _core_
.ImageHandler_swigregister(ImageHandler
)
2366 class PyImageHandler(ImageHandler
):
2368 This is the base class for implementing image file loading/saving, and
2369 image creation from data, all written in Python. To create a custom
2370 image handler derive a new class from wx.PyImageHandler and provide
2371 the following methods::
2373 def DoCanRead(self, stream) --> bool
2374 '''Check if this handler can read the image on the stream'''
2376 def LoadFile(self, image, stream, verbose, index) --> bool
2377 '''Load image data from the stream and load it into image.'''
2379 def SaveFile(self, image, stream, verbose) --> bool
2380 '''Save the iamge data in image to the stream using
2381 this handler's image file format.'''
2383 def GetImageCount(self, stream) --> int
2384 '''If this image format can hold more than one image,
2385 how many does the image on the stream have?'''
2387 To activate your handler create an instance of it and pass it to
2388 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2389 `SetExtension` from your constructor.
2392 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2393 __repr__
= _swig_repr
2394 def __init__(self
, *args
, **kwargs
):
2396 __init__(self) -> PyImageHandler
2398 This is the base class for implementing image file loading/saving, and
2399 image creation from data, all written in Python. To create a custom
2400 image handler derive a new class from wx.PyImageHandler and provide
2401 the following methods::
2403 def DoCanRead(self, stream) --> bool
2404 '''Check if this handler can read the image on the stream'''
2406 def LoadFile(self, image, stream, verbose, index) --> bool
2407 '''Load image data from the stream and load it into image.'''
2409 def SaveFile(self, image, stream, verbose) --> bool
2410 '''Save the iamge data in image to the stream using
2411 this handler's image file format.'''
2413 def GetImageCount(self, stream) --> int
2414 '''If this image format can hold more than one image,
2415 how many does the image on the stream have?'''
2417 To activate your handler create an instance of it and pass it to
2418 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2419 `SetExtension` from your constructor.
2422 _core_
.PyImageHandler_swiginit(self
,_core_
.new_PyImageHandler(*args
, **kwargs
))
2425 def _SetSelf(*args
, **kwargs
):
2426 """_SetSelf(self, PyObject self)"""
2427 return _core_
.PyImageHandler__SetSelf(*args
, **kwargs
)
2429 _core_
.PyImageHandler_swigregister(PyImageHandler
)
2431 class ImageHistogram(object):
2432 """Proxy of C++ ImageHistogram class"""
2433 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2434 __repr__
= _swig_repr
2435 def __init__(self
, *args
, **kwargs
):
2436 """__init__(self) -> ImageHistogram"""
2437 _core_
.ImageHistogram_swiginit(self
,_core_
.new_ImageHistogram(*args
, **kwargs
))
2438 def MakeKey(*args
, **kwargs
):
2440 MakeKey(byte r, byte g, byte b) -> unsigned long
2442 Get the key in the histogram for the given RGB values
2444 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2446 MakeKey
= staticmethod(MakeKey
)
2447 def FindFirstUnusedColour(*args
, **kwargs
):
2449 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2451 Find first colour that is not used in the image and has higher RGB
2452 values than startR, startG, startB. Returns a tuple consisting of a
2453 success flag and rgb values.
2455 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2457 def GetCount(*args
, **kwargs
):
2459 GetCount(self, unsigned long key) -> unsigned long
2461 Returns the pixel count for the given key. Use `MakeKey` to create a
2462 key value from a RGB tripple.
2464 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2466 def GetCountRGB(*args
, **kwargs
):
2468 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2470 Returns the pixel count for the given RGB values.
2472 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2474 def GetCountColour(*args
, **kwargs
):
2476 GetCountColour(self, Colour colour) -> unsigned long
2478 Returns the pixel count for the given `wx.Colour` value.
2480 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2482 _core_
.ImageHistogram_swigregister(ImageHistogram
)
2484 def ImageHistogram_MakeKey(*args
, **kwargs
):
2486 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2488 Get the key in the histogram for the given RGB values
2490 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2492 class Image_RGBValue(object):
2494 An object that contains values for red, green and blue which represent
2495 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2496 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2499 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2500 __repr__
= _swig_repr
2501 def __init__(self
, *args
, **kwargs
):
2503 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2507 _core_
.Image_RGBValue_swiginit(self
,_core_
.new_Image_RGBValue(*args
, **kwargs
))
2508 red
= property(_core_
.Image_RGBValue_red_get
, _core_
.Image_RGBValue_red_set
)
2509 green
= property(_core_
.Image_RGBValue_green_get
, _core_
.Image_RGBValue_green_set
)
2510 blue
= property(_core_
.Image_RGBValue_blue_get
, _core_
.Image_RGBValue_blue_set
)
2511 _core_
.Image_RGBValue_swigregister(Image_RGBValue
)
2513 class Image_HSVValue(object):
2515 An object that contains values for hue, saturation and value which
2516 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2517 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2520 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2521 __repr__
= _swig_repr
2522 def __init__(self
, *args
, **kwargs
):
2524 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2528 _core_
.Image_HSVValue_swiginit(self
,_core_
.new_Image_HSVValue(*args
, **kwargs
))
2529 hue
= property(_core_
.Image_HSVValue_hue_get
, _core_
.Image_HSVValue_hue_set
)
2530 saturation
= property(_core_
.Image_HSVValue_saturation_get
, _core_
.Image_HSVValue_saturation_set
)
2531 value
= property(_core_
.Image_HSVValue_value_get
, _core_
.Image_HSVValue_value_set
)
2532 _core_
.Image_HSVValue_swigregister(Image_HSVValue
)
2534 class Image(Object
):
2536 A platform-independent image class. An image can be created from
2537 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2538 variety of formats. Functions are available to set and get image
2539 bits, so it can be used for basic image manipulation.
2541 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2542 platform-specific `wx.Bitmap` object must be created from it using the
2543 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2544 device context, using `wx.DC.DrawBitmap`.
2546 One colour value of the image may be used as a mask colour which will
2547 lead to the automatic creation of a `wx.Mask` object associated to the
2550 wx.Image supports alpha channel data, that is in addition to a byte
2551 for the red, green and blue colour components for each pixel it also
2552 stores a byte representing the pixel opacity. An alpha value of 0
2553 corresponds to a transparent pixel (null opacity) while a value of 255
2554 means that the pixel is 100% opaque.
2556 Unlike RGB data, not all images have an alpha channel and before using
2557 `GetAlpha` you should check if this image contains an alpha channel
2558 with `HasAlpha`. Note that currently only images loaded from PNG files
2559 with transparency information will have an alpha channel.
2561 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2562 __repr__
= _swig_repr
2563 def __init__(self
, *args
, **kwargs
):
2565 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2567 Loads an image from a file.
2569 _core_
.Image_swiginit(self
,_core_
.new_Image(*args
, **kwargs
))
2570 __swig_destroy__
= _core_
.delete_Image
2571 __del__
= lambda self
: None;
2572 def Create(*args
, **kwargs
):
2574 Create(self, int width, int height, bool clear=True)
2576 Creates a fresh image. If clear is ``True``, the new image will be
2577 initialized to black. Otherwise, the image data will be uninitialized.
2579 return _core_
.Image_Create(*args
, **kwargs
)
2581 def Destroy(*args
, **kwargs
):
2585 Destroys the image data.
2587 args
[0].this
.own(False)
2588 return _core_
.Image_Destroy(*args
, **kwargs
)
2590 def Scale(*args
, **kwargs
):
2592 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2594 Returns a scaled version of the image. This is also useful for scaling
2595 bitmaps in general as the only other way to scale bitmaps is to blit a
2596 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2597 specifies what method to use for resampling the image. It can be
2598 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2599 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2600 bicubic and box averaging resampling methods for upsampling and
2601 downsampling respectively.
2603 return _core_
.Image_Scale(*args
, **kwargs
)
2605 def ResampleBox(*args
, **kwargs
):
2606 """ResampleBox(self, int width, int height) -> Image"""
2607 return _core_
.Image_ResampleBox(*args
, **kwargs
)
2609 def ResampleBicubic(*args
, **kwargs
):
2610 """ResampleBicubic(self, int width, int height) -> Image"""
2611 return _core_
.Image_ResampleBicubic(*args
, **kwargs
)
2613 def Blur(*args
, **kwargs
):
2615 Blur(self, int radius) -> Image
2617 Blurs the image in both horizontal and vertical directions by the
2618 specified pixel ``radius``. This should not be used when using a
2619 single mask colour for transparency.
2621 return _core_
.Image_Blur(*args
, **kwargs
)
2623 def BlurHorizontal(*args
, **kwargs
):
2625 BlurHorizontal(self, int radius) -> Image
2627 Blurs the image in the horizontal direction only. This should not be
2628 used when using a single mask colour for transparency.
2631 return _core_
.Image_BlurHorizontal(*args
, **kwargs
)
2633 def BlurVertical(*args
, **kwargs
):
2635 BlurVertical(self, int radius) -> Image
2637 Blurs the image in the vertical direction only. This should not be
2638 used when using a single mask colour for transparency.
2640 return _core_
.Image_BlurVertical(*args
, **kwargs
)
2642 def ShrinkBy(*args
, **kwargs
):
2644 ShrinkBy(self, int xFactor, int yFactor) -> Image
2646 Return a version of the image scaled smaller by the given factors.
2648 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2650 def Rescale(*args
, **kwargs
):
2652 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2654 Changes the size of the image in-place by scaling it: after a call to
2655 this function, the image will have the given width and height.
2657 Returns the (modified) image itself.
2659 return _core_
.Image_Rescale(*args
, **kwargs
)
2661 def Resize(*args
, **kwargs
):
2663 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2665 Changes the size of the image in-place without scaling it, by adding
2666 either a border with the given colour or cropping as necessary. The
2667 image is pasted into a new image with the given size and background
2668 colour at the position pos relative to the upper left of the new
2669 image. If red = green = blue = -1 then use either the current mask
2670 colour if set or find, use, and set a suitable mask colour for any
2671 newly exposed areas.
2673 Returns the (modified) image itself.
2675 return _core_
.Image_Resize(*args
, **kwargs
)
2677 def SetRGB(*args
, **kwargs
):
2679 SetRGB(self, int x, int y, byte r, byte g, byte b)
2681 Sets the pixel at the given coordinate. This routine performs
2682 bounds-checks for the coordinate so it can be considered a safe way to
2683 manipulate the data, but in some cases this might be too slow so that
2684 the data will have to be set directly. In that case you will have to
2685 get access to the image data using the `GetData` method.
2687 return _core_
.Image_SetRGB(*args
, **kwargs
)
2689 def SetRGBRect(*args
, **kwargs
):
2691 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2693 Sets the colour of the pixels within the given rectangle. This routine
2694 performs bounds-checks for the rectangle so it can be considered a
2695 safe way to manipulate the data.
2697 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2699 def GetRed(*args
, **kwargs
):
2701 GetRed(self, int x, int y) -> byte
2703 Returns the red intensity at the given coordinate.
2705 return _core_
.Image_GetRed(*args
, **kwargs
)
2707 def GetGreen(*args
, **kwargs
):
2709 GetGreen(self, int x, int y) -> byte
2711 Returns the green intensity at the given coordinate.
2713 return _core_
.Image_GetGreen(*args
, **kwargs
)
2715 def GetBlue(*args
, **kwargs
):
2717 GetBlue(self, int x, int y) -> byte
2719 Returns the blue intensity at the given coordinate.
2721 return _core_
.Image_GetBlue(*args
, **kwargs
)
2723 def SetAlpha(*args
, **kwargs
):
2725 SetAlpha(self, int x, int y, byte alpha)
2727 Sets the alpha value for the given pixel. This function should only be
2728 called if the image has alpha channel data, use `HasAlpha` to check
2731 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2733 def GetAlpha(*args
, **kwargs
):
2735 GetAlpha(self, int x, int y) -> byte
2737 Returns the alpha value for the given pixel. This function may only be
2738 called for the images with alpha channel, use `HasAlpha` to check for
2741 The returned value is the *opacity* of the image, i.e. the value of 0
2742 corresponds to the fully transparent pixels while the value of 255 to
2743 the fully opaque pixels.
2745 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2747 def HasAlpha(*args
, **kwargs
):
2749 HasAlpha(self) -> bool
2751 Returns true if this image has alpha channel, false otherwise.
2753 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2755 def InitAlpha(*args
, **kwargs
):
2759 Initializes the image alpha channel data. It is an error to call it if
2760 the image already has alpha data. If it doesn't, alpha data will be by
2761 default initialized to all pixels being fully opaque. But if the image
2762 has a a mask colour, all mask pixels will be completely transparent.
2764 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2766 def IsTransparent(*args
, **kwargs
):
2768 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2770 Returns ``True`` if this pixel is masked or has an alpha value less
2771 than the spcified threshold.
2773 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2775 def FindFirstUnusedColour(*args
, **kwargs
):
2777 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2779 Find first colour that is not used in the image and has higher RGB
2780 values than startR, startG, startB. Returns a tuple consisting of a
2781 success flag and rgb values.
2783 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2785 def ConvertAlphaToMask(*args
, **kwargs
):
2787 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2789 If the image has alpha channel, this method converts it to mask. All
2790 pixels with alpha value less than ``threshold`` are replaced with the
2791 mask colour and the alpha channel is removed. The mask colour is
2792 chosen automatically using `FindFirstUnusedColour`.
2794 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2797 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2799 def ConvertColourToAlpha(*args
, **kwargs
):
2801 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2803 This method converts an image where the original alpha information is
2804 only available as a shades of a colour (actually shades of grey)
2805 typically when you draw anti-aliased text into a bitmap. The DC
2806 drawing routines draw grey values on the black background although
2807 they actually mean to draw white with differnt alpha values. This
2808 method reverses it, assuming a black (!) background and white text.
2809 The method will then fill up the whole image with the colour given.
2811 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2813 def SetMaskFromImage(*args
, **kwargs
):
2815 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2817 Sets the image's mask so that the pixels that have RGB value of
2818 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2819 by first finding an unused colour in the image, setting this colour as
2820 the mask colour and then using this colour to draw all pixels in the
2821 image who corresponding pixel in mask has given RGB value.
2823 Returns ``False`` if ``mask`` does not have same dimensions as the
2824 image or if there is no unused colour left. Returns ``True`` if the
2825 mask was successfully applied.
2827 Note that this method involves computing the histogram, which is
2828 computationally intensive operation.
2830 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2832 def CanRead(*args
, **kwargs
):
2834 CanRead(String filename) -> bool
2836 Returns True if the image handlers can read this file.
2838 return _core_
.Image_CanRead(*args
, **kwargs
)
2840 CanRead
= staticmethod(CanRead
)
2841 def GetImageCount(*args
, **kwargs
):
2843 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2845 If the image file contains more than one image and the image handler
2846 is capable of retrieving these individually, this function will return
2847 the number of available images.
2849 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2851 GetImageCount
= staticmethod(GetImageCount
)
2852 def LoadFile(*args
, **kwargs
):
2854 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2856 Loads an image from a file. If no handler type is provided, the
2857 library will try to autodetect the format.
2859 return _core_
.Image_LoadFile(*args
, **kwargs
)
2861 def LoadMimeFile(*args
, **kwargs
):
2863 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2865 Loads an image from a file, specifying the image type with a MIME type
2868 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2870 def SaveFile(*args
, **kwargs
):
2872 SaveFile(self, String name, int type) -> bool
2874 Saves an image in the named file.
2876 return _core_
.Image_SaveFile(*args
, **kwargs
)
2878 def SaveMimeFile(*args
, **kwargs
):
2880 SaveMimeFile(self, String name, String mimetype) -> bool
2882 Saves an image in the named file.
2884 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2886 def CanReadStream(*args
, **kwargs
):
2888 CanReadStream(InputStream stream) -> bool
2890 Returns True if the image handlers can read an image file from the
2891 data currently on the input stream, or a readable Python file-like
2894 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2896 CanReadStream
= staticmethod(CanReadStream
)
2897 def LoadStream(*args
, **kwargs
):
2899 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2901 Loads an image from an input stream or a readable Python file-like
2902 object. If no handler type is provided, the library will try to
2903 autodetect the format.
2905 return _core_
.Image_LoadStream(*args
, **kwargs
)
2907 def LoadMimeStream(*args
, **kwargs
):
2909 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2911 Loads an image from an input stream or a readable Python file-like
2912 object, using a MIME type string to specify the image file format.
2914 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2916 def IsOk(*args
, **kwargs
):
2920 Returns true if image data is present.
2922 return _core_
.Image_IsOk(*args
, **kwargs
)
2925 def GetWidth(*args
, **kwargs
):
2927 GetWidth(self) -> int
2929 Gets the width of the image in pixels.
2931 return _core_
.Image_GetWidth(*args
, **kwargs
)
2933 def GetHeight(*args
, **kwargs
):
2935 GetHeight(self) -> int
2937 Gets the height of the image in pixels.
2939 return _core_
.Image_GetHeight(*args
, **kwargs
)
2941 def GetSize(*args
, **kwargs
):
2943 GetSize(self) -> Size
2945 Returns the size of the image in pixels.
2947 return _core_
.Image_GetSize(*args
, **kwargs
)
2949 def GetSubImage(*args
, **kwargs
):
2951 GetSubImage(self, Rect rect) -> Image
2953 Returns a sub image of the current one as long as the rect belongs
2954 entirely to the image.
2956 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2958 def Size(*args
, **kwargs
):
2960 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2962 Returns a resized version of this image without scaling it by adding
2963 either a border with the given colour or cropping as necessary. The
2964 image is pasted into a new image with the given size and background
2965 colour at the position ``pos`` relative to the upper left of the new
2966 image. If red = green = blue = -1 then use either the current mask
2967 colour if set or find, use, and set a suitable mask colour for any
2968 newly exposed areas.
2970 return _core_
.Image_Size(*args
, **kwargs
)
2972 def Copy(*args
, **kwargs
):
2976 Returns an identical copy of the image.
2978 return _core_
.Image_Copy(*args
, **kwargs
)
2980 def Paste(*args
, **kwargs
):
2982 Paste(self, Image image, int x, int y)
2984 Pastes ``image`` into this instance and takes care of the mask colour
2985 and any out of bounds problems.
2987 return _core_
.Image_Paste(*args
, **kwargs
)
2989 def GetData(*args
, **kwargs
):
2991 GetData(self) -> PyObject
2993 Returns a string containing a copy of the RGB bytes of the image.
2995 return _core_
.Image_GetData(*args
, **kwargs
)
2997 def SetData(*args
, **kwargs
):
2999 SetData(self, buffer data)
3001 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
3002 either a string or a buffer object holding the data and the length of
3003 the data must be width*height*3.
3005 return _core_
.Image_SetData(*args
, **kwargs
)
3007 def GetDataBuffer(*args
, **kwargs
):
3009 GetDataBuffer(self) -> PyObject
3011 Returns a writable Python buffer object that is pointing at the RGB
3012 image data buffer inside the wx.Image. You need to ensure that you do
3013 not use this buffer object after the image has been destroyed.
3015 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
3017 def SetDataBuffer(*args
, **kwargs
):
3019 SetDataBuffer(self, buffer data)
3021 Sets the internal image data pointer to point at a Python buffer
3022 object. This can save making an extra copy of the data but you must
3023 ensure that the buffer object lives longer than the wx.Image does.
3025 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
3027 def GetAlphaData(*args
, **kwargs
):
3029 GetAlphaData(self) -> PyObject
3031 Returns a string containing a copy of the alpha bytes of the image.
3033 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
3035 def SetAlphaData(*args
, **kwargs
):
3037 SetAlphaData(self, buffer alpha)
3039 Resets the Image's alpha data from a buffer of bytes. Accepts either
3040 a string or a buffer object holding the data and the length of the
3041 data must be width*height.
3043 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
3045 def GetAlphaBuffer(*args
, **kwargs
):
3047 GetAlphaBuffer(self) -> PyObject
3049 Returns a writable Python buffer object that is pointing at the Alpha
3050 data buffer inside the wx.Image. You need to ensure that you do not
3051 use this buffer object after the image has been destroyed.
3053 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
3055 def SetAlphaBuffer(*args
, **kwargs
):
3057 SetAlphaBuffer(self, buffer alpha)
3059 Sets the internal image alpha pointer to point at a Python buffer
3060 object. This can save making an extra copy of the data but you must
3061 ensure that the buffer object lives as long as the wx.Image does.
3063 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
3065 def SetMaskColour(*args
, **kwargs
):
3067 SetMaskColour(self, byte r, byte g, byte b)
3069 Sets the mask colour for this image (and tells the image to use the
3072 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
3074 def GetOrFindMaskColour(*args
, **kwargs
):
3076 GetOrFindMaskColour() -> (r,g,b)
3078 Get the current mask colour or find a suitable colour.
3080 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
3082 def GetMaskRed(*args
, **kwargs
):
3084 GetMaskRed(self) -> byte
3086 Gets the red component of the mask colour.
3088 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
3090 def GetMaskGreen(*args
, **kwargs
):
3092 GetMaskGreen(self) -> byte
3094 Gets the green component of the mask colour.
3096 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
3098 def GetMaskBlue(*args
, **kwargs
):
3100 GetMaskBlue(self) -> byte
3102 Gets the blue component of the mask colour.
3104 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
3106 def SetMask(*args
, **kwargs
):
3108 SetMask(self, bool mask=True)
3110 Specifies whether there is a mask or not. The area of the mask is
3111 determined by the current mask colour.
3113 return _core_
.Image_SetMask(*args
, **kwargs
)
3115 def HasMask(*args
, **kwargs
):
3117 HasMask(self) -> bool
3119 Returns ``True`` if there is a mask active, ``False`` otherwise.
3121 return _core_
.Image_HasMask(*args
, **kwargs
)
3123 def Rotate(*args
, **kwargs
):
3125 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
3126 Point offset_after_rotation=None) -> Image
3128 Rotates the image about the given point, by ``angle`` radians. Passing
3129 ``True`` to ``interpolating`` results in better image quality, but is
3130 slower. If the image has a mask, then the mask colour is used for the
3131 uncovered pixels in the rotated image background. Otherwise, black
3132 will be used as the fill colour.
3134 Returns the rotated image, leaving this image intact.
3136 return _core_
.Image_Rotate(*args
, **kwargs
)
3138 def Rotate90(*args
, **kwargs
):
3140 Rotate90(self, bool clockwise=True) -> Image
3142 Returns a copy of the image rotated 90 degrees in the direction
3143 indicated by ``clockwise``.
3145 return _core_
.Image_Rotate90(*args
, **kwargs
)
3147 def Mirror(*args
, **kwargs
):
3149 Mirror(self, bool horizontally=True) -> Image
3151 Returns a mirrored copy of the image. The parameter ``horizontally``
3152 indicates the orientation.
3154 return _core_
.Image_Mirror(*args
, **kwargs
)
3156 def Replace(*args
, **kwargs
):
3158 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3160 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3163 return _core_
.Image_Replace(*args
, **kwargs
)
3165 def ConvertToGreyscale(*args
, **kwargs
):
3167 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3169 Convert to greyscale image. Uses the luminance component (Y) of the
3170 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3171 defaults to ITU-T BT.601
3173 return _core_
.Image_ConvertToGreyscale(*args
, **kwargs
)
3175 def ConvertToMono(*args
, **kwargs
):
3177 ConvertToMono(self, byte r, byte g, byte b) -> Image
3179 Returns monochromatic version of the image. The returned image has
3180 white colour where the original has ``(r,g,b)`` colour and black
3181 colour everywhere else.
3183 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
3185 def SetOption(*args
, **kwargs
):
3187 SetOption(self, String name, String value)
3189 Sets an image handler defined option. For example, when saving as a
3190 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3191 number between 0 and 100 (0 is terrible, 100 is very good).
3193 return _core_
.Image_SetOption(*args
, **kwargs
)
3195 def SetOptionInt(*args
, **kwargs
):
3197 SetOptionInt(self, String name, int value)
3199 Sets an image option as an integer.
3201 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
3203 def GetOption(*args
, **kwargs
):
3205 GetOption(self, String name) -> String
3207 Gets the value of an image handler option.
3209 return _core_
.Image_GetOption(*args
, **kwargs
)
3211 def GetOptionInt(*args
, **kwargs
):
3213 GetOptionInt(self, String name) -> int
3215 Gets the value of an image handler option as an integer. If the given
3216 option is not present, the function returns 0.
3218 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
3220 def HasOption(*args
, **kwargs
):
3222 HasOption(self, String name) -> bool
3224 Returns true if the given option is present.
3226 return _core_
.Image_HasOption(*args
, **kwargs
)
3228 def CountColours(*args
, **kwargs
):
3229 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
3230 return _core_
.Image_CountColours(*args
, **kwargs
)
3232 def ComputeHistogram(*args
, **kwargs
):
3233 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3234 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
3236 def AddHandler(*args
, **kwargs
):
3237 """AddHandler(ImageHandler handler)"""
3238 return _core_
.Image_AddHandler(*args
, **kwargs
)
3240 AddHandler
= staticmethod(AddHandler
)
3241 def InsertHandler(*args
, **kwargs
):
3242 """InsertHandler(ImageHandler handler)"""
3243 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3245 InsertHandler
= staticmethod(InsertHandler
)
3246 def RemoveHandler(*args
, **kwargs
):
3247 """RemoveHandler(String name) -> bool"""
3248 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3250 RemoveHandler
= staticmethod(RemoveHandler
)
3251 def GetHandlers(*args
, **kwargs
):
3252 """GetHandlers() -> PyObject"""
3253 return _core_
.Image_GetHandlers(*args
, **kwargs
)
3255 GetHandlers
= staticmethod(GetHandlers
)
3256 def GetImageExtWildcard(*args
, **kwargs
):
3258 GetImageExtWildcard() -> String
3260 Iterates all registered wxImageHandler objects, and returns a string
3261 containing file extension masks suitable for passing to file open/save
3264 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
3266 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
3267 def ConvertToBitmap(*args
, **kwargs
):
3268 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3269 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
3271 def ConvertToMonoBitmap(*args
, **kwargs
):
3272 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
3273 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
3275 def RotateHue(*args
, **kwargs
):
3277 RotateHue(self, double angle)
3279 Rotates the hue of each pixel of the image. Hue is a double in the
3280 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3282 return _core_
.Image_RotateHue(*args
, **kwargs
)
3284 def RGBtoHSV(*args
, **kwargs
):
3286 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3288 Converts a color in RGB color space to HSV color space.
3290 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3292 RGBtoHSV
= staticmethod(RGBtoHSV
)
3293 def HSVtoRGB(*args
, **kwargs
):
3295 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3297 Converts a color in HSV color space to RGB color space.
3299 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3301 HSVtoRGB
= staticmethod(HSVtoRGB
)
3302 def __nonzero__(self
): return self
.IsOk()
3303 AlphaBuffer
= property(GetAlphaBuffer
,SetAlphaBuffer
,doc
="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3304 AlphaData
= property(GetAlphaData
,SetAlphaData
,doc
="See `GetAlphaData` and `SetAlphaData`")
3305 Data
= property(GetData
,SetData
,doc
="See `GetData` and `SetData`")
3306 DataBuffer
= property(GetDataBuffer
,SetDataBuffer
,doc
="See `GetDataBuffer` and `SetDataBuffer`")
3307 Height
= property(GetHeight
,doc
="See `GetHeight`")
3308 MaskBlue
= property(GetMaskBlue
,doc
="See `GetMaskBlue`")
3309 MaskGreen
= property(GetMaskGreen
,doc
="See `GetMaskGreen`")
3310 MaskRed
= property(GetMaskRed
,doc
="See `GetMaskRed`")
3311 Width
= property(GetWidth
,doc
="See `GetWidth`")
3312 _core_
.Image_swigregister(Image
)
3314 def ImageFromMime(*args
, **kwargs
):
3316 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3318 Loads an image from a file, using a MIME type string (such as
3319 'image/jpeg') to specify image type.
3321 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
3324 def ImageFromStream(*args
, **kwargs
):
3326 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3328 Loads an image from an input stream, or any readable Python file-like
3331 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
3334 def ImageFromStreamMime(*args
, **kwargs
):
3336 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3338 Loads an image from an input stream, or any readable Python file-like
3339 object, specifying the image format with a MIME type string.
3341 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
3344 def EmptyImage(*args
, **kwargs
):
3346 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3348 Construct an empty image of a given size, optionally setting all
3351 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
3354 def ImageFromBitmap(*args
, **kwargs
):
3356 ImageFromBitmap(Bitmap bitmap) -> Image
3358 Construct an Image from a `wx.Bitmap`.
3360 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
3363 def ImageFromData(*args
, **kwargs
):
3365 ImageFromData(int width, int height, buffer data) -> Image
3367 Construct an Image from a buffer of RGB bytes. Accepts either a
3368 string or a buffer object holding the data and the length of the data
3369 must be width*height*3.
3371 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
3374 def ImageFromDataWithAlpha(*args
, **kwargs
):
3376 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3378 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3379 Accepts either a string or a buffer object holding the data and the
3380 length of the data must be width*height*3 bytes, and the length of the
3381 alpha data must be width*height bytes.
3383 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
3386 def Image_CanRead(*args
, **kwargs
):
3388 Image_CanRead(String filename) -> bool
3390 Returns True if the image handlers can read this file.
3392 return _core_
.Image_CanRead(*args
, **kwargs
)
3394 def Image_GetImageCount(*args
, **kwargs
):
3396 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3398 If the image file contains more than one image and the image handler
3399 is capable of retrieving these individually, this function will return
3400 the number of available images.
3402 return _core_
.Image_GetImageCount(*args
, **kwargs
)
3404 def Image_CanReadStream(*args
, **kwargs
):
3406 Image_CanReadStream(InputStream stream) -> bool
3408 Returns True if the image handlers can read an image file from the
3409 data currently on the input stream, or a readable Python file-like
3412 return _core_
.Image_CanReadStream(*args
, **kwargs
)
3414 def Image_AddHandler(*args
, **kwargs
):
3415 """Image_AddHandler(ImageHandler handler)"""
3416 return _core_
.Image_AddHandler(*args
, **kwargs
)
3418 def Image_InsertHandler(*args
, **kwargs
):
3419 """Image_InsertHandler(ImageHandler handler)"""
3420 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3422 def Image_RemoveHandler(*args
, **kwargs
):
3423 """Image_RemoveHandler(String name) -> bool"""
3424 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3426 def Image_GetHandlers(*args
):
3427 """Image_GetHandlers() -> PyObject"""
3428 return _core_
.Image_GetHandlers(*args
)
3430 def Image_GetImageExtWildcard(*args
):
3432 Image_GetImageExtWildcard() -> String
3434 Iterates all registered wxImageHandler objects, and returns a string
3435 containing file extension masks suitable for passing to file open/save
3438 return _core_
.Image_GetImageExtWildcard(*args
)
3440 def Image_RGBtoHSV(*args
, **kwargs
):
3442 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3444 Converts a color in RGB color space to HSV color space.
3446 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3448 def Image_HSVtoRGB(*args
, **kwargs
):
3450 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3452 Converts a color in HSV color space to RGB color space.
3454 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3457 def _ImageFromBuffer(*args
, **kwargs
):
3458 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3459 return _core_
._ImageFromBuffer
(*args
, **kwargs
)
3460 def ImageFromBuffer(width
, height
, dataBuffer
, alphaBuffer
=None):
3462 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3463 parameter must be a Python object that implements the buffer interface,
3464 such as a string, array, etc. The dataBuffer object is expected to
3465 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3466 object can optionally be supplied for the image's alpha channel data, and
3467 it is expected to be width*height bytes long.
3469 The wx.Image will be created with its data and alpha pointers initialized
3470 to the memory address pointed to by the buffer objects, thus saving the
3471 time needed to copy the image data from the buffer object to the wx.Image.
3472 While this has advantages, it also has the shoot-yourself-in-the-foot
3473 risks associated with sharing a C pointer between two objects.
3475 To help alleviate the risk a reference to the data and alpha buffer
3476 objects are kept with the wx.Image, so that they won't get deleted until
3477 after the wx.Image is deleted. However please be aware that it is not
3478 guaranteed that an object won't move its memory buffer to a new location
3479 when it needs to resize its contents. If that happens then the wx.Image
3480 will end up referring to an invalid memory location and could cause the
3481 application to crash. Therefore care should be taken to not manipulate
3482 the objects used for the data and alpha buffers in a way that would cause
3483 them to change size.
3485 image
= _core_
._ImageFromBuffer
(width
, height
, dataBuffer
, alphaBuffer
)
3486 image
._buffer
= dataBuffer
3487 image
._alpha
= alphaBuffer
3490 def InitAllImageHandlers():
3492 The former functionality of InitAllImageHanders is now done internal to
3493 the _core_ extension module and so this function has become a simple NOP.
3497 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3498 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3499 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3500 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3501 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3502 BMP_24BPP
= _core_
.BMP_24BPP
3503 BMP_8BPP
= _core_
.BMP_8BPP
3504 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3505 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3506 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3507 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3508 BMP_4BPP
= _core_
.BMP_4BPP
3509 BMP_1BPP
= _core_
.BMP_1BPP
3510 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3511 class BMPHandler(ImageHandler
):
3512 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3513 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3514 __repr__
= _swig_repr
3515 def __init__(self
, *args
, **kwargs
):
3517 __init__(self) -> BMPHandler
3519 A `wx.ImageHandler` for \*.bmp bitmap files.
3521 _core_
.BMPHandler_swiginit(self
,_core_
.new_BMPHandler(*args
, **kwargs
))
3522 _core_
.BMPHandler_swigregister(BMPHandler
)
3523 NullImage
= cvar
.NullImage
3524 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3525 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3526 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3527 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3528 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3529 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3530 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3531 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3532 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3533 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3534 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3535 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3536 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3537 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3538 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3540 class ICOHandler(BMPHandler
):
3541 """A `wx.ImageHandler` for \*.ico icon files."""
3542 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3543 __repr__
= _swig_repr
3544 def __init__(self
, *args
, **kwargs
):
3546 __init__(self) -> ICOHandler
3548 A `wx.ImageHandler` for \*.ico icon files.
3550 _core_
.ICOHandler_swiginit(self
,_core_
.new_ICOHandler(*args
, **kwargs
))
3551 _core_
.ICOHandler_swigregister(ICOHandler
)
3553 class CURHandler(ICOHandler
):
3554 """A `wx.ImageHandler` for \*.cur cursor files."""
3555 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3556 __repr__
= _swig_repr
3557 def __init__(self
, *args
, **kwargs
):
3559 __init__(self) -> CURHandler
3561 A `wx.ImageHandler` for \*.cur cursor files.
3563 _core_
.CURHandler_swiginit(self
,_core_
.new_CURHandler(*args
, **kwargs
))
3564 _core_
.CURHandler_swigregister(CURHandler
)
3566 class ANIHandler(CURHandler
):
3567 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3568 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3569 __repr__
= _swig_repr
3570 def __init__(self
, *args
, **kwargs
):
3572 __init__(self) -> ANIHandler
3574 A `wx.ImageHandler` for \*.ani animated cursor files.
3576 _core_
.ANIHandler_swiginit(self
,_core_
.new_ANIHandler(*args
, **kwargs
))
3577 _core_
.ANIHandler_swigregister(ANIHandler
)
3579 class PNGHandler(ImageHandler
):
3580 """A `wx.ImageHandler` for PNG image files."""
3581 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3582 __repr__
= _swig_repr
3583 def __init__(self
, *args
, **kwargs
):
3585 __init__(self) -> PNGHandler
3587 A `wx.ImageHandler` for PNG image files.
3589 _core_
.PNGHandler_swiginit(self
,_core_
.new_PNGHandler(*args
, **kwargs
))
3590 _core_
.PNGHandler_swigregister(PNGHandler
)
3592 class GIFHandler(ImageHandler
):
3593 """A `wx.ImageHandler` for GIF image files."""
3594 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3595 __repr__
= _swig_repr
3596 def __init__(self
, *args
, **kwargs
):
3598 __init__(self) -> GIFHandler
3600 A `wx.ImageHandler` for GIF image files.
3602 _core_
.GIFHandler_swiginit(self
,_core_
.new_GIFHandler(*args
, **kwargs
))
3603 _core_
.GIFHandler_swigregister(GIFHandler
)
3605 class PCXHandler(ImageHandler
):
3606 """A `wx.ImageHandler` for PCX imager files."""
3607 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3608 __repr__
= _swig_repr
3609 def __init__(self
, *args
, **kwargs
):
3611 __init__(self) -> PCXHandler
3613 A `wx.ImageHandler` for PCX imager files.
3615 _core_
.PCXHandler_swiginit(self
,_core_
.new_PCXHandler(*args
, **kwargs
))
3616 _core_
.PCXHandler_swigregister(PCXHandler
)
3618 class JPEGHandler(ImageHandler
):
3619 """A `wx.ImageHandler` for JPEG/JPG image files."""
3620 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3621 __repr__
= _swig_repr
3622 def __init__(self
, *args
, **kwargs
):
3624 __init__(self) -> JPEGHandler
3626 A `wx.ImageHandler` for JPEG/JPG image files.
3628 _core_
.JPEGHandler_swiginit(self
,_core_
.new_JPEGHandler(*args
, **kwargs
))
3629 _core_
.JPEGHandler_swigregister(JPEGHandler
)
3631 class PNMHandler(ImageHandler
):
3632 """A `wx.ImageHandler` for PNM image files."""
3633 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3634 __repr__
= _swig_repr
3635 def __init__(self
, *args
, **kwargs
):
3637 __init__(self) -> PNMHandler
3639 A `wx.ImageHandler` for PNM image files.
3641 _core_
.PNMHandler_swiginit(self
,_core_
.new_PNMHandler(*args
, **kwargs
))
3642 _core_
.PNMHandler_swigregister(PNMHandler
)
3644 class XPMHandler(ImageHandler
):
3645 """A `wx.ImageHandler` for XPM image."""
3646 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3647 __repr__
= _swig_repr
3648 def __init__(self
, *args
, **kwargs
):
3650 __init__(self) -> XPMHandler
3652 A `wx.ImageHandler` for XPM image.
3654 _core_
.XPMHandler_swiginit(self
,_core_
.new_XPMHandler(*args
, **kwargs
))
3655 _core_
.XPMHandler_swigregister(XPMHandler
)
3657 class TIFFHandler(ImageHandler
):
3658 """A `wx.ImageHandler` for TIFF image files."""
3659 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3660 __repr__
= _swig_repr
3661 def __init__(self
, *args
, **kwargs
):
3663 __init__(self) -> TIFFHandler
3665 A `wx.ImageHandler` for TIFF image files.
3667 _core_
.TIFFHandler_swiginit(self
,_core_
.new_TIFFHandler(*args
, **kwargs
))
3668 _core_
.TIFFHandler_swigregister(TIFFHandler
)
3670 class TGAHandler(ImageHandler
):
3671 """A `wx.ImageHandler` for TGA image files."""
3672 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3673 __repr__
= _swig_repr
3674 def __init__(self
, *args
, **kwargs
):
3676 __init__(self) -> TGAHandler
3678 A `wx.ImageHandler` for TGA image files.
3680 _core_
.TGAHandler_swiginit(self
,_core_
.new_TGAHandler(*args
, **kwargs
))
3681 _core_
.TGAHandler_swigregister(TGAHandler
)
3683 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3684 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3685 class Quantize(object):
3686 """Performs quantization, or colour reduction, on a wxImage."""
3687 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3688 def __init__(self
): raise AttributeError, "No constructor defined"
3689 __repr__
= _swig_repr
3690 def Quantize(*args
, **kwargs
):
3692 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3694 Reduce the colours in the source image and put the result into the
3695 destination image, setting the palette in the destination if
3696 needed. Both images may be the same, to overwrite the source image.
3698 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3700 Quantize
= staticmethod(Quantize
)
3701 _core_
.Quantize_swigregister(Quantize
)
3703 def Quantize_Quantize(*args
, **kwargs
):
3705 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3707 Reduce the colours in the source image and put the result into the
3708 destination image, setting the palette in the destination if
3709 needed. Both images may be the same, to overwrite the source image.
3711 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3713 #---------------------------------------------------------------------------
3715 class EvtHandler(Object
):
3716 """Proxy of C++ EvtHandler class"""
3717 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3718 __repr__
= _swig_repr
3719 def __init__(self
, *args
, **kwargs
):
3720 """__init__(self) -> EvtHandler"""
3721 _core_
.EvtHandler_swiginit(self
,_core_
.new_EvtHandler(*args
, **kwargs
))
3722 self
._setOORInfo
(self
)
3724 def GetNextHandler(*args
, **kwargs
):
3725 """GetNextHandler(self) -> EvtHandler"""
3726 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3728 def GetPreviousHandler(*args
, **kwargs
):
3729 """GetPreviousHandler(self) -> EvtHandler"""
3730 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3732 def SetNextHandler(*args
, **kwargs
):
3733 """SetNextHandler(self, EvtHandler handler)"""
3734 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3736 def SetPreviousHandler(*args
, **kwargs
):
3737 """SetPreviousHandler(self, EvtHandler handler)"""
3738 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3740 def GetEvtHandlerEnabled(*args
, **kwargs
):
3741 """GetEvtHandlerEnabled(self) -> bool"""
3742 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3744 def SetEvtHandlerEnabled(*args
, **kwargs
):
3745 """SetEvtHandlerEnabled(self, bool enabled)"""
3746 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3748 def ProcessEvent(*args
, **kwargs
):
3749 """ProcessEvent(self, Event event) -> bool"""
3750 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3752 def AddPendingEvent(*args
, **kwargs
):
3753 """AddPendingEvent(self, Event event)"""
3754 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3756 def ProcessPendingEvents(*args
, **kwargs
):
3757 """ProcessPendingEvents(self)"""
3758 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3760 def Connect(*args
, **kwargs
):
3761 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3762 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3764 def Disconnect(*args
, **kwargs
):
3765 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3766 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3768 def _setOORInfo(*args
, **kwargs
):
3769 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3770 val
= _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3771 args
[0].this
.own(False)
3774 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3776 Bind an event to an event handler.
3778 :param event: One of the EVT_* objects that specifies the
3779 type of event to bind,
3781 :param handler: A callable object to be invoked when the
3782 event is delivered to self. Pass None to
3783 disconnect an event handler.
3785 :param source: Sometimes the event originates from a
3786 different window than self, but you still
3787 want to catch it in self. (For example, a
3788 button event delivered to a frame.) By
3789 passing the source of the event, the event
3790 handling system is able to differentiate
3791 between the same event type from different
3794 :param id: Used to spcify the event source by ID instead
3797 :param id2: Used when it is desirable to bind a handler
3798 to a range of IDs, such as with EVT_MENU_RANGE.
3800 if source
is not None:
3802 event
.Bind(self
, id, id2
, handler
)
3804 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3806 Disconencts the event handler binding for event from self.
3807 Returns True if successful.
3809 if source
is not None:
3811 return event
.Unbind(self
, id, id2
)
3813 EvtHandlerEnabled
= property(GetEvtHandlerEnabled
,SetEvtHandlerEnabled
,doc
="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3814 NextHandler
= property(GetNextHandler
,SetNextHandler
,doc
="See `GetNextHandler` and `SetNextHandler`")
3815 PreviousHandler
= property(GetPreviousHandler
,SetPreviousHandler
,doc
="See `GetPreviousHandler` and `SetPreviousHandler`")
3816 _core_
.EvtHandler_swigregister(EvtHandler
)
3818 #---------------------------------------------------------------------------
3820 class PyEventBinder(object):
3822 Instances of this class are used to bind specific events to event
3825 def __init__(self
, evtType
, expectedIDs
=0):
3826 if expectedIDs
not in [0, 1, 2]:
3827 raise ValueError, "Invalid number of expectedIDs"
3828 self
.expectedIDs
= expectedIDs
3830 if type(evtType
) == list or type(evtType
) == tuple:
3831 self
.evtType
= evtType
3833 self
.evtType
= [evtType
]
3836 def Bind(self
, target
, id1
, id2
, function
):
3837 """Bind this set of event types to target."""
3838 for et
in self
.evtType
:
3839 target
.Connect(id1
, id2
, et
, function
)
3842 def Unbind(self
, target
, id1
, id2
):
3843 """Remove an event binding."""
3845 for et
in self
.evtType
:
3846 success
+= target
.Disconnect(id1
, id2
, et
)
3849 def _getEvtType(self
):
3851 Make it easy to get to the default wxEventType typeID for this
3854 return self
.evtType
[0]
3856 typeId
= property(_getEvtType
)
3859 def __call__(self
, *args
):
3861 For backwards compatibility with the old EVT_* functions.
3862 Should be called with either (window, func), (window, ID,
3863 func) or (window, ID1, ID2, func) parameters depending on the
3866 assert len(args
) == 2 + self
.expectedIDs
3870 if self
.expectedIDs
== 0:
3872 elif self
.expectedIDs
== 1:
3875 elif self
.expectedIDs
== 2:
3880 raise ValueError, "Unexpected number of IDs"
3882 self
.Bind(target
, id1
, id2
, func
)
3885 # These two are square pegs that don't fit the PyEventBinder hole...
3886 def EVT_COMMAND(win
, id, cmd
, func
):
3887 win
.Connect(id, -1, cmd
, func
)
3888 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3889 win
.Connect(id1
, id2
, cmd
, func
)
3892 #---------------------------------------------------------------------------
3894 #---------------------------------------------------------------------------
3896 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3897 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3899 def NewEventType(*args
):
3900 """NewEventType() -> EventType"""
3901 return _core_
.NewEventType(*args
)
3902 wxEVT_ANY
= _core_
.wxEVT_ANY
3903 wxEVT_NULL
= _core_
.wxEVT_NULL
3904 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3905 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3906 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3907 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3908 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3909 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3910 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3911 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3912 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3913 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3914 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3915 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3916 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3917 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3918 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3919 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3920 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3921 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3922 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3923 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3924 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3925 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3926 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3927 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3928 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3929 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3930 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3931 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3932 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3933 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3934 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3935 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3936 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3937 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3938 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3939 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3940 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3941 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3942 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3943 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3944 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3945 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3946 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3947 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3948 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3949 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3950 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3951 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3952 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3953 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3954 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3955 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3956 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3957 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3958 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3959 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3960 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3961 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3962 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3963 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3964 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3965 wxEVT_SCROLL_CHANGED
= _core_
.wxEVT_SCROLL_CHANGED
3966 wxEVT_SCROLL_ENDSCROLL
= wxEVT_SCROLL_CHANGED
3967 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3968 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3969 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3970 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3971 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3972 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3973 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3974 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3975 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3976 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3977 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3978 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3979 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3980 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3981 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3982 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3983 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3984 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3985 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3986 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3987 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3988 wxEVT_MOUSE_CAPTURE_LOST
= _core_
.wxEVT_MOUSE_CAPTURE_LOST
3989 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3990 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3991 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3992 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3993 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3994 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3995 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3996 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3997 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3998 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3999 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
4000 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
4001 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
4002 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
4003 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
4004 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
4005 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
4006 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
4007 wxEVT_IDLE
= _core_
.wxEVT_IDLE
4008 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
4009 wxEVT_SIZING
= _core_
.wxEVT_SIZING
4010 wxEVT_MOVING
= _core_
.wxEVT_MOVING
4011 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
4012 wxEVT_COMMAND_TEXT_COPY
= _core_
.wxEVT_COMMAND_TEXT_COPY
4013 wxEVT_COMMAND_TEXT_CUT
= _core_
.wxEVT_COMMAND_TEXT_CUT
4014 wxEVT_COMMAND_TEXT_PASTE
= _core_
.wxEVT_COMMAND_TEXT_PASTE
4015 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
4016 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
4017 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
4018 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
4019 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
4020 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
4021 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
4023 # Create some event binders
4024 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
4025 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
4026 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
4027 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
4028 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
4029 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
4030 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
4031 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
4032 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
4033 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
4034 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
4035 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
4036 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
4037 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
4038 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
4039 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
4040 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
4041 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
4042 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
4043 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
4044 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
4045 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
4046 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
4047 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
4048 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
4049 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
4050 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
4051 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
4052 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
4053 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
4054 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
4055 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
4056 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
4057 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
4058 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
4059 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
4060 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
4061 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
4062 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
4063 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
4064 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
4065 EVT_MOUSE_CAPTURE_LOST
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST
)
4067 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
4068 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
4069 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
4070 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
4071 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
4072 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
4073 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
4074 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
4075 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
4076 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
4077 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
4078 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
4079 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
4081 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
4089 wxEVT_MIDDLE_DCLICK
,
4097 # Scrolling from wxWindow (sent to wxScrolledWindow)
4098 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
4099 wxEVT_SCROLLWIN_BOTTOM
,
4100 wxEVT_SCROLLWIN_LINEUP
,
4101 wxEVT_SCROLLWIN_LINEDOWN
,
4102 wxEVT_SCROLLWIN_PAGEUP
,
4103 wxEVT_SCROLLWIN_PAGEDOWN
,
4104 wxEVT_SCROLLWIN_THUMBTRACK
,
4105 wxEVT_SCROLLWIN_THUMBRELEASE
,
4108 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
4109 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
4110 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
4111 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
4112 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
4113 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
4114 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
4115 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
4117 # Scrolling from wx.Slider and wx.ScrollBar
4118 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
4119 wxEVT_SCROLL_BOTTOM
,
4120 wxEVT_SCROLL_LINEUP
,
4121 wxEVT_SCROLL_LINEDOWN
,
4122 wxEVT_SCROLL_PAGEUP
,
4123 wxEVT_SCROLL_PAGEDOWN
,
4124 wxEVT_SCROLL_THUMBTRACK
,
4125 wxEVT_SCROLL_THUMBRELEASE
,
4126 wxEVT_SCROLL_CHANGED
,
4129 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
4130 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
4131 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
4132 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
4133 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
4134 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
4135 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
4136 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
4137 EVT_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
)
4138 EVT_SCROLL_ENDSCROLL
= EVT_SCROLL_CHANGED
4140 # Scrolling from wx.Slider and wx.ScrollBar, with an id
4141 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
4142 wxEVT_SCROLL_BOTTOM
,
4143 wxEVT_SCROLL_LINEUP
,
4144 wxEVT_SCROLL_LINEDOWN
,
4145 wxEVT_SCROLL_PAGEUP
,
4146 wxEVT_SCROLL_PAGEDOWN
,
4147 wxEVT_SCROLL_THUMBTRACK
,
4148 wxEVT_SCROLL_THUMBRELEASE
,
4149 wxEVT_SCROLL_CHANGED
,
4152 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
4153 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
4154 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
4155 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
4156 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
4157 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
4158 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
4159 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
4160 EVT_COMMAND_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
, 1)
4161 EVT_COMMAND_SCROLL_ENDSCROLL
= EVT_COMMAND_SCROLL_CHANGED
4163 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
4164 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
4165 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
4166 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
4167 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
4168 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
4169 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
4170 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
4171 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
4172 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
4174 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
4175 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
4176 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
4177 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
4178 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
4179 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
4180 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
4181 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
4182 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
4185 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
4186 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
4187 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
4188 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
4189 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
4190 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
4191 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
4193 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
4195 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
4196 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
4198 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
4200 EVT_TEXT_CUT
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_CUT
)
4201 EVT_TEXT_COPY
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_COPY
)
4202 EVT_TEXT_PASTE
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE
)
4205 #---------------------------------------------------------------------------
4207 class Event(Object
):
4209 An event is a structure holding information about an event passed to a
4210 callback or member function. wx.Event is an abstract base class for
4213 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4214 def __init__(self
): raise AttributeError, "No constructor defined"
4215 __repr__
= _swig_repr
4216 __swig_destroy__
= _core_
.delete_Event
4217 __del__
= lambda self
: None;
4218 def SetEventType(*args
, **kwargs
):
4220 SetEventType(self, EventType typ)
4222 Sets the specific type of the event.
4224 return _core_
.Event_SetEventType(*args
, **kwargs
)
4226 def GetEventType(*args
, **kwargs
):
4228 GetEventType(self) -> EventType
4230 Returns the identifier of the given event type, such as
4231 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4233 return _core_
.Event_GetEventType(*args
, **kwargs
)
4235 def GetEventObject(*args
, **kwargs
):
4237 GetEventObject(self) -> Object
4239 Returns the object (usually a window) associated with the event, if
4242 return _core_
.Event_GetEventObject(*args
, **kwargs
)
4244 def SetEventObject(*args
, **kwargs
):
4246 SetEventObject(self, Object obj)
4248 Sets the originating object, or in other words, obj is normally the
4249 object that is sending the event.
4251 return _core_
.Event_SetEventObject(*args
, **kwargs
)
4253 def GetTimestamp(*args
, **kwargs
):
4254 """GetTimestamp(self) -> long"""
4255 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
4257 def SetTimestamp(*args
, **kwargs
):
4258 """SetTimestamp(self, long ts=0)"""
4259 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
4261 def GetId(*args
, **kwargs
):
4265 Returns the identifier associated with this event, such as a button
4268 return _core_
.Event_GetId(*args
, **kwargs
)
4270 def SetId(*args
, **kwargs
):
4274 Set's the ID for the event. This is usually the ID of the window that
4275 is sending the event, but it can also be a command id from a menu
4278 return _core_
.Event_SetId(*args
, **kwargs
)
4280 def IsCommandEvent(*args
, **kwargs
):
4282 IsCommandEvent(self) -> bool
4284 Returns true if the event is or is derived from `wx.CommandEvent` else
4285 it returns false. Note: Exists only for optimization purposes.
4287 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
4289 def Skip(*args
, **kwargs
):
4291 Skip(self, bool skip=True)
4293 This method can be used inside an event handler to control whether
4294 further event handlers bound to this event will be called after the
4295 current one returns. Without Skip() (or equivalently if Skip(False) is
4296 used), the event will not be processed any more. If Skip(True) is
4297 called, the event processing system continues searching for a further
4298 handler function for this event, even though it has been processed
4299 already in the current handler.
4301 return _core_
.Event_Skip(*args
, **kwargs
)
4303 def GetSkipped(*args
, **kwargs
):
4305 GetSkipped(self) -> bool
4307 Returns true if the event handler should be skipped, false otherwise.
4310 return _core_
.Event_GetSkipped(*args
, **kwargs
)
4312 def ShouldPropagate(*args
, **kwargs
):
4314 ShouldPropagate(self) -> bool
4316 Test if this event should be propagated to the parent window or not,
4317 i.e. if the propagation level is currently greater than 0.
4319 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
4321 def StopPropagation(*args
, **kwargs
):
4323 StopPropagation(self) -> int
4325 Stop the event from propagating to its parent window. Returns the old
4326 propagation level value which may be later passed to
4327 `ResumePropagation` to allow propagating the event again.
4329 return _core_
.Event_StopPropagation(*args
, **kwargs
)
4331 def ResumePropagation(*args
, **kwargs
):
4333 ResumePropagation(self, int propagationLevel)
4335 Resume the event propagation by restoring the propagation level. (For
4336 example, you can use the value returned by an earlier call to
4340 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
4342 def Clone(*args
, **kwargs
):
4343 """Clone(self) -> Event"""
4344 return _core_
.Event_Clone(*args
, **kwargs
)
4346 EventObject
= property(GetEventObject
,SetEventObject
,doc
="See `GetEventObject` and `SetEventObject`")
4347 EventType
= property(GetEventType
,SetEventType
,doc
="See `GetEventType` and `SetEventType`")
4348 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
4349 Skipped
= property(GetSkipped
,doc
="See `GetSkipped`")
4350 Timestamp
= property(GetTimestamp
,SetTimestamp
,doc
="See `GetTimestamp` and `SetTimestamp`")
4351 _core_
.Event_swigregister(Event
)
4353 #---------------------------------------------------------------------------
4355 class PropagationDisabler(object):
4357 Helper class to temporarily change an event not to propagate. Simply
4358 create an instance of this class and then whe it is destroyed the
4359 propogation of the event will be restored.
4361 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4362 __repr__
= _swig_repr
4363 def __init__(self
, *args
, **kwargs
):
4365 __init__(self, Event event) -> PropagationDisabler
4367 Helper class to temporarily change an event not to propagate. Simply
4368 create an instance of this class and then whe it is destroyed the
4369 propogation of the event will be restored.
4371 _core_
.PropagationDisabler_swiginit(self
,_core_
.new_PropagationDisabler(*args
, **kwargs
))
4372 __swig_destroy__
= _core_
.delete_PropagationDisabler
4373 __del__
= lambda self
: None;
4374 _core_
.PropagationDisabler_swigregister(PropagationDisabler
)
4376 class PropagateOnce(object):
4378 A helper class that will temporarily lower propagation level of an
4379 event. Simply create an instance of this class and then whe it is
4380 destroyed the propogation of the event will be restored.
4382 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4383 __repr__
= _swig_repr
4384 def __init__(self
, *args
, **kwargs
):
4386 __init__(self, Event event) -> PropagateOnce
4388 A helper class that will temporarily lower propagation level of an
4389 event. Simply create an instance of this class and then whe it is
4390 destroyed the propogation of the event will be restored.
4392 _core_
.PropagateOnce_swiginit(self
,_core_
.new_PropagateOnce(*args
, **kwargs
))
4393 __swig_destroy__
= _core_
.delete_PropagateOnce
4394 __del__
= lambda self
: None;
4395 _core_
.PropagateOnce_swigregister(PropagateOnce
)
4397 #---------------------------------------------------------------------------
4399 class CommandEvent(Event
):
4401 This event class contains information about command events, which
4402 originate from a variety of simple controls, as well as menus and
4405 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4406 __repr__
= _swig_repr
4407 def __init__(self
, *args
, **kwargs
):
4409 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4411 This event class contains information about command events, which
4412 originate from a variety of simple controls, as well as menus and
4415 _core_
.CommandEvent_swiginit(self
,_core_
.new_CommandEvent(*args
, **kwargs
))
4416 def GetSelection(*args
, **kwargs
):
4418 GetSelection(self) -> int
4420 Returns item index for a listbox or choice selection event (not valid
4423 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
4425 def SetString(*args
, **kwargs
):
4426 """SetString(self, String s)"""
4427 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
4429 def GetString(*args
, **kwargs
):
4431 GetString(self) -> String
4433 Returns item string for a listbox or choice selection event (not valid
4436 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
4438 def IsChecked(*args
, **kwargs
):
4440 IsChecked(self) -> bool
4442 This method can be used with checkbox and menu events: for the
4443 checkboxes, the method returns true for a selection event and false
4444 for a deselection one. For the menu events, this method indicates if
4445 the menu item just has become checked or unchecked (and thus only
4446 makes sense for checkable menu items).
4448 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
4451 def IsSelection(*args
, **kwargs
):
4453 IsSelection(self) -> bool
4455 For a listbox or similar event, returns true if it is a selection,
4456 false if it is a deselection.
4458 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4460 def SetExtraLong(*args
, **kwargs
):
4461 """SetExtraLong(self, long extraLong)"""
4462 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4464 def GetExtraLong(*args
, **kwargs
):
4466 GetExtraLong(self) -> long
4468 Returns extra information dependant on the event objects type. If the
4469 event comes from a listbox selection, it is a boolean determining
4470 whether the event was a selection (true) or a deselection (false). A
4471 listbox deselection only occurs for multiple-selection boxes, and in
4472 this case the index and string values are indeterminate and the
4473 listbox must be examined by the application.
4475 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4477 def SetInt(*args
, **kwargs
):
4478 """SetInt(self, int i)"""
4479 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4481 def GetInt(*args
, **kwargs
):
4485 Returns the integer identifier corresponding to a listbox, choice or
4486 radiobox selection (only if the event was a selection, not a
4487 deselection), or a boolean value representing the value of a checkbox.
4489 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4491 def GetClientData(*args
, **kwargs
):
4493 GetClientData(self) -> PyObject
4495 Returns the client data object for a listbox or choice selection event, (if any.)
4497 return _core_
.CommandEvent_GetClientData(*args
, **kwargs
)
4499 def SetClientData(*args
, **kwargs
):
4501 SetClientData(self, PyObject clientData)
4503 Associate the given client data with the item at position n.
4505 return _core_
.CommandEvent_SetClientData(*args
, **kwargs
)
4507 GetClientObject
= GetClientData
4508 SetClientObject
= SetClientData
4510 def Clone(*args
, **kwargs
):
4511 """Clone(self) -> Event"""
4512 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4514 ClientData
= property(GetClientData
,SetClientData
,doc
="See `GetClientData` and `SetClientData`")
4515 ClientObject
= property(GetClientObject
,SetClientObject
,doc
="See `GetClientObject` and `SetClientObject`")
4516 ExtraLong
= property(GetExtraLong
,SetExtraLong
,doc
="See `GetExtraLong` and `SetExtraLong`")
4517 Int
= property(GetInt
,SetInt
,doc
="See `GetInt` and `SetInt`")
4518 Selection
= property(GetSelection
,doc
="See `GetSelection`")
4519 String
= property(GetString
,SetString
,doc
="See `GetString` and `SetString`")
4520 _core_
.CommandEvent_swigregister(CommandEvent
)
4522 #---------------------------------------------------------------------------
4524 class NotifyEvent(CommandEvent
):
4526 An instance of this class (or one of its derived classes) is sent from
4527 a control when the control's state is being changed and the control
4528 allows that change to be prevented from happening. The event handler
4529 can call `Veto` or `Allow` to tell the control what to do.
4531 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4532 __repr__
= _swig_repr
4533 def __init__(self
, *args
, **kwargs
):
4535 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4537 An instance of this class (or one of its derived classes) is sent from
4538 a control when the control's state is being changed and the control
4539 allows that change to be prevented from happening. The event handler
4540 can call `Veto` or `Allow` to tell the control what to do.
4542 _core_
.NotifyEvent_swiginit(self
,_core_
.new_NotifyEvent(*args
, **kwargs
))
4543 def Veto(*args
, **kwargs
):
4547 Prevents the change announced by this event from happening.
4549 It is in general a good idea to notify the user about the reasons for
4550 vetoing the change because otherwise the applications behaviour (which
4551 just refuses to do what the user wants) might be quite surprising.
4553 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4555 def Allow(*args
, **kwargs
):
4559 This is the opposite of `Veto`: it explicitly allows the event to be
4560 processed. For most events it is not necessary to call this method as
4561 the events are allowed anyhow but some are forbidden by default (this
4562 will be mentioned in the corresponding event description).
4564 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4566 def IsAllowed(*args
, **kwargs
):
4568 IsAllowed(self) -> bool
4570 Returns true if the change is allowed (`Veto` hasn't been called) or
4571 false otherwise (if it was).
4573 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4575 _core_
.NotifyEvent_swigregister(NotifyEvent
)
4577 #---------------------------------------------------------------------------
4579 class ScrollEvent(CommandEvent
):
4581 A scroll event holds information about events sent from stand-alone
4582 scrollbars and sliders. Note that scrolled windows do not send
4583 instances of this event class, but send the `wx.ScrollWinEvent`
4586 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4587 __repr__
= _swig_repr
4588 def __init__(self
, *args
, **kwargs
):
4590 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4591 int orient=0) -> ScrollEvent
4593 _core_
.ScrollEvent_swiginit(self
,_core_
.new_ScrollEvent(*args
, **kwargs
))
4594 def GetOrientation(*args
, **kwargs
):
4596 GetOrientation(self) -> int
4598 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4601 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4603 def GetPosition(*args
, **kwargs
):
4605 GetPosition(self) -> int
4607 Returns the position of the scrollbar.
4609 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4611 def SetOrientation(*args
, **kwargs
):
4612 """SetOrientation(self, int orient)"""
4613 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4615 def SetPosition(*args
, **kwargs
):
4616 """SetPosition(self, int pos)"""
4617 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4619 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
4620 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
4621 _core_
.ScrollEvent_swigregister(ScrollEvent
)
4623 #---------------------------------------------------------------------------
4625 class ScrollWinEvent(Event
):
4627 A wx.ScrollWinEvent holds information about scrolling and is sent from
4630 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4631 __repr__
= _swig_repr
4632 def __init__(self
, *args
, **kwargs
):
4634 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4636 A wx.ScrollWinEvent holds information about scrolling and is sent from
4639 _core_
.ScrollWinEvent_swiginit(self
,_core_
.new_ScrollWinEvent(*args
, **kwargs
))
4640 def GetOrientation(*args
, **kwargs
):
4642 GetOrientation(self) -> int
4644 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4647 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4649 def GetPosition(*args
, **kwargs
):
4651 GetPosition(self) -> int
4653 Returns the position of the scrollbar for the thumb track and release
4654 events. Note that this field can't be used for the other events, you
4655 need to query the window itself for the current position in that case.
4657 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4659 def SetOrientation(*args
, **kwargs
):
4660 """SetOrientation(self, int orient)"""
4661 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4663 def SetPosition(*args
, **kwargs
):
4664 """SetPosition(self, int pos)"""
4665 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4667 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
4668 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
4669 _core_
.ScrollWinEvent_swigregister(ScrollWinEvent
)
4671 #---------------------------------------------------------------------------
4673 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4674 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4675 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4676 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4677 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4678 class MouseEvent(Event
):
4680 This event class contains information about the events generated by
4681 the mouse: they include mouse buttons press and release events and
4684 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4685 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4686 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4687 a middle button so a portable application should avoid relying on the
4690 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4691 the former returns true when the event corresponds to the left mouse
4692 button click while the latter returns true if the left mouse button is
4693 currently being pressed. For example, when the user is dragging the
4694 mouse you can use `LeftIsDown` to test whether the left mouse button
4695 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4696 `LeftIsDown` will also return true in wxWidgets whatever the
4697 underlying GUI behaviour is (which is platform-dependent). The same
4698 applies, of course, to other mouse buttons as well.
4700 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4701 __repr__
= _swig_repr
4702 def __init__(self
, *args
, **kwargs
):
4704 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4706 Constructs a wx.MouseEvent. Valid event types are:
4708 * wxEVT_ENTER_WINDOW
4709 * wxEVT_LEAVE_WINDOW
4715 * wxEVT_MIDDLE_DCLICK
4718 * wxEVT_RIGHT_DCLICK
4722 _core_
.MouseEvent_swiginit(self
,_core_
.new_MouseEvent(*args
, **kwargs
))
4723 def IsButton(*args
, **kwargs
):
4725 IsButton(self) -> bool
4727 Returns true if the event was a mouse button event (not necessarily a
4728 button down event - that may be tested using `ButtonDown`).
4730 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4732 def ButtonDown(*args
, **kwargs
):
4734 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4736 If the argument is omitted, this returns true if the event was any
4737 mouse button down event. Otherwise the argument specifies which
4738 button-down event shold be checked for (see `Button` for the possible
4741 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4743 def ButtonDClick(*args
, **kwargs
):
4745 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4747 If the argument is omitted, this returns true if the event was any
4748 mouse double click event. Otherwise the argument specifies which
4749 double click event to check for (see `Button` for the possible
4752 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4754 def ButtonUp(*args
, **kwargs
):
4756 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4758 If the argument is omitted, this returns true if the event was any
4759 mouse button up event. Otherwise the argument specifies which button
4760 up event to check for (see `Button` for the possible values).
4762 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4764 def Button(*args
, **kwargs
):
4766 Button(self, int button) -> bool
4768 Returns true if the identified mouse button is changing state. Valid
4769 values of button are:
4771 ==================== =====================================
4772 wx.MOUSE_BTN_LEFT check if left button was pressed
4773 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4774 wx.MOUSE_BTN_RIGHT check if right button was pressed
4775 wx.MOUSE_BTN_ANY check if any button was pressed
4776 ==================== =====================================
4779 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4781 def ButtonIsDown(*args
, **kwargs
):
4782 """ButtonIsDown(self, int but) -> bool"""
4783 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4785 def GetButton(*args
, **kwargs
):
4787 GetButton(self) -> int
4789 Returns the mouse button which generated this event or
4790 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4791 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4792 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4793 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4794 right buttons respectively.
4796 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4798 def ControlDown(*args
, **kwargs
):
4800 ControlDown(self) -> bool
4802 Returns true if the control key was down at the time of the event.
4804 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4806 def MetaDown(*args
, **kwargs
):
4808 MetaDown(self) -> bool
4810 Returns true if the Meta key was down at the time of the event.
4812 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4814 def AltDown(*args
, **kwargs
):
4816 AltDown(self) -> bool
4818 Returns true if the Alt key was down at the time of the event.
4820 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4822 def ShiftDown(*args
, **kwargs
):
4824 ShiftDown(self) -> bool
4826 Returns true if the Shift key was down at the time of the event.
4828 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4830 def CmdDown(*args
, **kwargs
):
4832 CmdDown(self) -> bool
4834 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4835 platforms but the special "Apple" (a.k.a as "Command") key on
4836 Macs. It often makes sense to use it instead of, say, `ControlDown`
4837 because Cmd key is used for the same thing under Mac as Ctrl
4838 elsewhere. The Ctrl key still exists, it's just not used for this
4839 purpose. So for non-Mac platforms this is the same as `ControlDown`
4840 and Macs this is the same as `MetaDown`.
4842 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4844 def LeftDown(*args
, **kwargs
):
4846 LeftDown(self) -> bool
4848 Returns true if the left mouse button state changed to down.
4850 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4852 def MiddleDown(*args
, **kwargs
):
4854 MiddleDown(self) -> bool
4856 Returns true if the middle mouse button state changed to down.
4858 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4860 def RightDown(*args
, **kwargs
):
4862 RightDown(self) -> bool
4864 Returns true if the right mouse button state changed to down.
4866 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4868 def LeftUp(*args
, **kwargs
):
4870 LeftUp(self) -> bool
4872 Returns true if the left mouse button state changed to up.
4874 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4876 def MiddleUp(*args
, **kwargs
):
4878 MiddleUp(self) -> bool
4880 Returns true if the middle mouse button state changed to up.
4882 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4884 def RightUp(*args
, **kwargs
):
4886 RightUp(self) -> bool
4888 Returns true if the right mouse button state changed to up.
4890 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4892 def LeftDClick(*args
, **kwargs
):
4894 LeftDClick(self) -> bool
4896 Returns true if the event was a left button double click.
4898 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4900 def MiddleDClick(*args
, **kwargs
):
4902 MiddleDClick(self) -> bool
4904 Returns true if the event was a middle button double click.
4906 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4908 def RightDClick(*args
, **kwargs
):
4910 RightDClick(self) -> bool
4912 Returns true if the event was a right button double click.
4914 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4916 def LeftIsDown(*args
, **kwargs
):
4918 LeftIsDown(self) -> bool
4920 Returns true if the left mouse button is currently down, independent
4921 of the current event type.
4923 Please notice that it is not the same as LeftDown which returns true
4924 if the left mouse button was just pressed. Rather, it describes the
4925 state of the mouse button before the event happened.
4927 This event is usually used in the mouse event handlers which process
4928 "move mouse" messages to determine whether the user is (still)
4931 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4933 def MiddleIsDown(*args
, **kwargs
):
4935 MiddleIsDown(self) -> bool
4937 Returns true if the middle mouse button is currently down, independent
4938 of the current event type.
4940 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4942 def RightIsDown(*args
, **kwargs
):
4944 RightIsDown(self) -> bool
4946 Returns true if the right mouse button is currently down, independent
4947 of the current event type.
4949 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4951 def Dragging(*args
, **kwargs
):
4953 Dragging(self) -> bool
4955 Returns true if this was a dragging event (motion while a button is
4958 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4960 def Moving(*args
, **kwargs
):
4962 Moving(self) -> bool
4964 Returns true if this was a motion event and no mouse buttons were
4965 pressed. If any mouse button is held pressed, then this method returns
4966 false and Dragging returns true.
4968 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4970 def Entering(*args
, **kwargs
):
4972 Entering(self) -> bool
4974 Returns true if the mouse was entering the window.
4976 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4978 def Leaving(*args
, **kwargs
):
4980 Leaving(self) -> bool
4982 Returns true if the mouse was leaving the window.
4984 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4986 def GetPosition(*args
, **kwargs
):
4988 GetPosition(self) -> Point
4990 Returns the pixel position of the mouse in window coordinates when the
4993 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4995 def GetPositionTuple(*args
, **kwargs
):
4997 GetPositionTuple() -> (x,y)
4999 Returns the pixel position of the mouse in window coordinates when the
5002 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
5004 def GetLogicalPosition(*args
, **kwargs
):
5006 GetLogicalPosition(self, DC dc) -> Point
5008 Returns the logical mouse position in pixels (i.e. translated
5009 according to the translation set for the DC, which usually indicates
5010 that the window has been scrolled).
5012 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
5014 def GetX(*args
, **kwargs
):
5018 Returns X coordinate of the physical mouse event position.
5020 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
5022 def GetY(*args
, **kwargs
):
5026 Returns Y coordinate of the physical mouse event position.
5028 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
5030 def GetWheelRotation(*args
, **kwargs
):
5032 GetWheelRotation(self) -> int
5034 Get wheel rotation, positive or negative indicates direction of
5035 rotation. Current devices all send an event when rotation is equal to
5036 +/-WheelDelta, but this allows for finer resolution devices to be
5037 created in the future. Because of this you shouldn't assume that one
5038 event is equal to 1 line or whatever, but you should be able to either
5039 do partial line scrolling or wait until +/-WheelDelta rotation values
5040 have been accumulated before scrolling.
5042 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
5044 def GetWheelDelta(*args
, **kwargs
):
5046 GetWheelDelta(self) -> int
5048 Get wheel delta, normally 120. This is the threshold for action to be
5049 taken, and one such action (for example, scrolling one increment)
5050 should occur for each delta.
5052 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
5054 def GetWheelAxis(*args
, **kwargs
):
5056 GetWheelAxis(self) -> int
5058 Gets the axis the wheel operation concerns, 0 being the y axis as on
5059 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5060 or horizontal trackpad scrolling.
5062 return _core_
.MouseEvent_GetWheelAxis(*args
, **kwargs
)
5064 def GetLinesPerAction(*args
, **kwargs
):
5066 GetLinesPerAction(self) -> int
5068 Returns the configured number of lines (or whatever) to be scrolled
5069 per wheel action. Defaults to three.
5071 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
5073 def IsPageScroll(*args
, **kwargs
):
5075 IsPageScroll(self) -> bool
5077 Returns true if the system has been setup to do page scrolling with
5078 the mouse wheel instead of line scrolling.
5080 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
5082 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
5083 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
5084 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
5085 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
5086 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
5087 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
5088 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
5089 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
5090 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
5091 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
5092 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
5093 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
5094 Button
= property(GetButton
,doc
="See `GetButton`")
5095 LinesPerAction
= property(GetLinesPerAction
,doc
="See `GetLinesPerAction`")
5096 LogicalPosition
= property(GetLogicalPosition
,doc
="See `GetLogicalPosition`")
5097 Position
= property(GetPosition
,doc
="See `GetPosition`")
5098 WheelDelta
= property(GetWheelDelta
,doc
="See `GetWheelDelta`")
5099 WheelRotation
= property(GetWheelRotation
,doc
="See `GetWheelRotation`")
5100 X
= property(GetX
,doc
="See `GetX`")
5101 Y
= property(GetY
,doc
="See `GetY`")
5102 _core_
.MouseEvent_swigregister(MouseEvent
)
5104 #---------------------------------------------------------------------------
5106 class SetCursorEvent(Event
):
5108 A SetCursorEvent is generated when the mouse cursor is about to be set
5109 as a result of mouse motion. This event gives the application the
5110 chance to perform specific mouse cursor processing based on the
5111 current position of the mouse within the window. Use the `SetCursor`
5112 method to specify the cursor you want to be displayed.
5114 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5115 __repr__
= _swig_repr
5116 def __init__(self
, *args
, **kwargs
):
5118 __init__(self, int x=0, int y=0) -> SetCursorEvent
5120 Construct a new `wx.SetCursorEvent`.
5122 _core_
.SetCursorEvent_swiginit(self
,_core_
.new_SetCursorEvent(*args
, **kwargs
))
5123 def GetX(*args
, **kwargs
):
5127 Returns the X coordinate of the mouse in client coordinates.
5129 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
5131 def GetY(*args
, **kwargs
):
5135 Returns the Y coordinate of the mouse in client coordinates.
5137 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
5139 def SetCursor(*args
, **kwargs
):
5141 SetCursor(self, Cursor cursor)
5143 Sets the cursor associated with this event.
5145 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
5147 def GetCursor(*args
, **kwargs
):
5149 GetCursor(self) -> Cursor
5151 Returns a reference to the cursor specified by this event.
5153 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
5155 def HasCursor(*args
, **kwargs
):
5157 HasCursor(self) -> bool
5159 Returns true if the cursor specified by this event is a valid cursor.
5161 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
5163 Cursor
= property(GetCursor
,SetCursor
,doc
="See `GetCursor` and `SetCursor`")
5164 X
= property(GetX
,doc
="See `GetX`")
5165 Y
= property(GetY
,doc
="See `GetY`")
5166 _core_
.SetCursorEvent_swigregister(SetCursorEvent
)
5168 #---------------------------------------------------------------------------
5170 class KeyEvent(Event
):
5172 This event class contains information about keypress and character
5173 events. These events are only sent to the widget that currently has
5176 Notice that there are three different kinds of keyboard events in
5177 wxWidgets: key down and up events and char events. The difference
5178 between the first two is clear - the first corresponds to a key press
5179 and the second to a key release - otherwise they are identical. Just
5180 note that if the key is maintained in a pressed state you will
5181 typically get a lot of (automatically generated) down events but only
5182 one up so it is wrong to assume that there is one up event
5183 corresponding to each down one.
5185 Both key events provide untranslated key codes while the char event
5186 carries the translated one. The untranslated code for alphanumeric
5187 keys is always an upper case value. For the other keys it is one of
5188 WXK_XXX values from the keycodes table. The translated key is, in
5189 general, the character the user expects to appear as the result of the
5190 key combination when typing the text into a text entry zone, for
5193 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5194 and the standard US keyboard): when the 'A' key is pressed, the key
5195 down event key code is equal to ASCII A == 65. But the char event key
5196 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5197 'A' keys simultaneously , the key code in key down event will still be
5198 just 'A' while the char event key code parameter will now be 'A' as
5201 Although in this simple case it is clear that the correct key code
5202 could be found in the key down event handler by checking the value
5203 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5204 as for non alphanumeric keys or non-US keyboard layouts the
5205 translation is keyboard-layout dependent and can only be done properly
5206 by the system itself.
5208 Another kind of translation is done when the control key is pressed:
5209 for example, for CTRL-A key press the key down event still carries the
5210 same key code 'A' as usual but the char event will have key code of 1,
5211 the ASCII value of this key combination.
5213 You may discover how the other keys on your system behave
5214 interactively by running the KeyEvents sample in the wxPython demo and
5215 pressing some keys while the blue box at the top has the keyboard
5218 **Note**: If a key down event is caught and the event handler does not
5219 call event.Skip() then the coresponding char event will not
5220 happen. This is by design and enables the programs that handle both
5221 types of events to be a bit simpler.
5223 **Note for Windows programmers**: The key and char events in wxWidgets
5224 are similar to but slightly different from Windows WM_KEYDOWN and
5225 WM_CHAR events. In particular, Alt-x combination will generate a char
5226 event in wxWidgets (unless it is used as an accelerator).
5228 **Tip**: be sure to call event.Skip() for events that you don't
5229 process in key event function, otherwise menu shortcuts may cease to
5233 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5234 __repr__
= _swig_repr
5235 def __init__(self
, *args
, **kwargs
):
5237 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5239 Construct a new `wx.KeyEvent`. Valid event types are:
5242 _core_
.KeyEvent_swiginit(self
,_core_
.new_KeyEvent(*args
, **kwargs
))
5243 def GetModifiers(*args
, **kwargs
):
5245 GetModifiers(self) -> int
5247 Returns a bitmask of the current modifier settings. Can be used to
5248 check if the key event has exactly the given modifiers without having
5249 to explicitly check that the other modifiers are not down. For
5252 if event.GetModifers() == wx.MOD_CONTROL:
5256 return _core_
.KeyEvent_GetModifiers(*args
, **kwargs
)
5258 def ControlDown(*args
, **kwargs
):
5260 ControlDown(self) -> bool
5262 Returns ``True`` if the Control key was down at the time of the event.
5264 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
5266 def MetaDown(*args
, **kwargs
):
5268 MetaDown(self) -> bool
5270 Returns ``True`` if the Meta key was down at the time of the event.
5272 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
5274 def AltDown(*args
, **kwargs
):
5276 AltDown(self) -> bool
5278 Returns ``True`` if the Alt key was down at the time of the event.
5280 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
5282 def ShiftDown(*args
, **kwargs
):
5284 ShiftDown(self) -> bool
5286 Returns ``True`` if the Shift key was down at the time of the event.
5288 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
5290 def CmdDown(*args
, **kwargs
):
5292 CmdDown(self) -> bool
5294 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5295 platforms but the special "Apple" (a.k.a as "Command") key on
5296 Macs. It makes often sense to use it instead of, say, `ControlDown`
5297 because Cmd key is used for the same thing under Mac as Ctrl
5298 elsewhere. The Ctrl still exists, it's just not used for this
5299 purpose. So for non-Mac platforms this is the same as `ControlDown`
5300 and Macs this is the same as `MetaDown`.
5302 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
5304 def HasModifiers(*args
, **kwargs
):
5306 HasModifiers(self) -> bool
5308 Returns true if either CTRL or ALT keys was down at the time of the
5309 key event. Note that this function does not take into account neither
5310 SHIFT nor META key states (the reason for ignoring the latter is that
5311 it is common for NUMLOCK key to be configured as META under X but the
5312 key presses even while NUMLOCK is on should be still processed
5315 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
5317 def GetKeyCode(*args
, **kwargs
):
5319 GetKeyCode(self) -> int
5321 Returns the virtual key code. ASCII events return normal ASCII values,
5322 while non-ASCII events return values such as WXK_LEFT for the left
5323 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5326 Note that in Unicode build, the returned value is meaningful only if
5327 the user entered a character that can be represented in current
5328 locale's default charset. You can obtain the corresponding Unicode
5329 character using `GetUnicodeKey`.
5331 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
5333 def GetUnicodeKey(*args
, **kwargs
):
5335 GetUnicodeKey(self) -> int
5337 Returns the Unicode character corresponding to this key event. This
5338 function is only meaningfule in a Unicode build of wxPython.
5340 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
5342 GetUniChar
= GetUnicodeKey
5343 def SetUnicodeKey(*args
, **kwargs
):
5345 SetUnicodeKey(self, int uniChar)
5347 Set the Unicode value of the key event, but only if this is a Unicode
5350 return _core_
.KeyEvent_SetUnicodeKey(*args
, **kwargs
)
5352 def GetRawKeyCode(*args
, **kwargs
):
5354 GetRawKeyCode(self) -> unsigned int
5356 Returns the raw key code for this event. This is a platform-dependent
5357 scan code which should only be used in advanced
5358 applications. Currently the raw key codes are not supported by all
5361 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
5363 def GetRawKeyFlags(*args
, **kwargs
):
5365 GetRawKeyFlags(self) -> unsigned int
5367 Returns the low level key flags for this event. The flags are
5368 platform-dependent and should only be used in advanced applications.
5369 Currently the raw key flags are not supported by all ports.
5371 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
5373 def GetPosition(*args
, **kwargs
):
5375 GetPosition(self) -> Point
5377 Find the position of the event, if applicable.
5379 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
5381 def GetPositionTuple(*args
, **kwargs
):
5383 GetPositionTuple() -> (x,y)
5385 Find the position of the event, if applicable.
5387 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
5389 def GetX(*args
, **kwargs
):
5393 Returns the X position (in client coordinates) of the event, if
5396 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
5398 def GetY(*args
, **kwargs
):
5402 Returns the Y position (in client coordinates) of the event, if
5405 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
5407 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
5408 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
5409 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
5410 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
5411 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
5412 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
5413 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
5414 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
5415 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
5416 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
5417 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
5418 Modifiers
= property(GetModifiers
,doc
="See `GetModifiers`")
5419 Position
= property(GetPosition
,doc
="See `GetPosition`")
5420 RawKeyCode
= property(GetRawKeyCode
,doc
="See `GetRawKeyCode`")
5421 RawKeyFlags
= property(GetRawKeyFlags
,doc
="See `GetRawKeyFlags`")
5422 UnicodeKey
= property(GetUnicodeKey
,SetUnicodeKey
,doc
="See `GetUnicodeKey` and `SetUnicodeKey`")
5423 X
= property(GetX
,doc
="See `GetX`")
5424 Y
= property(GetY
,doc
="See `GetY`")
5425 _core_
.KeyEvent_swigregister(KeyEvent
)
5427 #---------------------------------------------------------------------------
5429 class SizeEvent(Event
):
5431 A size event holds information about size change events. The EVT_SIZE
5432 handler function will be called when the window it is bound to has
5435 Note that the size passed is of the whole window: call
5436 `wx.Window.GetClientSize` for the area which may be used by the
5439 When a window is resized, usually only a small part of the window is
5440 damaged and and that area is all that is in the update region for the
5441 next paint event. However, if your drawing depends on the size of the
5442 window, you may need to clear the DC explicitly and repaint the whole
5443 window. In which case, you may need to call `wx.Window.Refresh` to
5444 invalidate the entire window.
5447 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5448 __repr__
= _swig_repr
5449 def __init__(self
, *args
, **kwargs
):
5451 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5453 Construct a new ``wx.SizeEvent``.
5455 _core_
.SizeEvent_swiginit(self
,_core_
.new_SizeEvent(*args
, **kwargs
))
5456 def GetSize(*args
, **kwargs
):
5458 GetSize(self) -> Size
5460 Returns the entire size of the window generating the size change
5463 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
5465 def GetRect(*args
, **kwargs
):
5466 """GetRect(self) -> Rect"""
5467 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
5469 def SetRect(*args
, **kwargs
):
5470 """SetRect(self, Rect rect)"""
5471 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
5473 def SetSize(*args
, **kwargs
):
5474 """SetSize(self, Size size)"""
5475 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
5477 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
5478 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
5479 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
5480 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
5481 _core_
.SizeEvent_swigregister(SizeEvent
)
5483 #---------------------------------------------------------------------------
5485 class MoveEvent(Event
):
5487 This event object is sent for EVT_MOVE event bindings when a window is
5488 moved to a new position.
5490 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5491 __repr__
= _swig_repr
5492 def __init__(self
, *args
, **kwargs
):
5494 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5498 _core_
.MoveEvent_swiginit(self
,_core_
.new_MoveEvent(*args
, **kwargs
))
5499 def GetPosition(*args
, **kwargs
):
5501 GetPosition(self) -> Point
5503 Returns the position of the window generating the move change event.
5505 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
5507 def GetRect(*args
, **kwargs
):
5508 """GetRect(self) -> Rect"""
5509 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
5511 def SetRect(*args
, **kwargs
):
5512 """SetRect(self, Rect rect)"""
5513 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
5515 def SetPosition(*args
, **kwargs
):
5516 """SetPosition(self, Point pos)"""
5517 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
5519 m_pos
= property(GetPosition
, SetPosition
)
5520 m_rect
= property(GetRect
, SetRect
)
5522 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
5523 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
5524 _core_
.MoveEvent_swigregister(MoveEvent
)
5526 #---------------------------------------------------------------------------
5528 class PaintEvent(Event
):
5530 A paint event is sent when a window's contents needs to be repainted.
5531 Note that in an EVT_PAINT handler the application must *always* create
5532 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5533 Windows assumes that the window has not been painted yet and will send
5534 the event again, causing endless refreshes.
5536 You can optimize painting by retrieving the rectangles that have been
5537 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5538 and only repainting these rectangles. The rectangles are in terms of
5539 the client area, and are unscrolled, so you will need to do some
5540 calculations using the current view position to obtain logical,
5544 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5545 __repr__
= _swig_repr
5546 def __init__(self
, *args
, **kwargs
):
5547 """__init__(self, int Id=0) -> PaintEvent"""
5548 _core_
.PaintEvent_swiginit(self
,_core_
.new_PaintEvent(*args
, **kwargs
))
5549 _core_
.PaintEvent_swigregister(PaintEvent
)
5551 class NcPaintEvent(Event
):
5552 """Proxy of C++ NcPaintEvent class"""
5553 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5554 __repr__
= _swig_repr
5555 def __init__(self
, *args
, **kwargs
):
5556 """__init__(self, int winid=0) -> NcPaintEvent"""
5557 _core_
.NcPaintEvent_swiginit(self
,_core_
.new_NcPaintEvent(*args
, **kwargs
))
5558 _core_
.NcPaintEvent_swigregister(NcPaintEvent
)
5560 #---------------------------------------------------------------------------
5562 class EraseEvent(Event
):
5564 An erase event is sent whenever the background of a window needs to be
5565 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5566 binder. On some platforms, such as GTK+, this event is simulated
5567 (simply generated just before the paint event) and may cause flicker.
5569 To paint a custom background use the `GetDC` method and use the returned
5570 device context if it is not ``None``, otherwise create a temporary
5571 `wx.ClientDC` and draw on that.
5574 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5575 __repr__
= _swig_repr
5576 def __init__(self
, *args
, **kwargs
):
5578 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5582 _core_
.EraseEvent_swiginit(self
,_core_
.new_EraseEvent(*args
, **kwargs
))
5583 def GetDC(*args
, **kwargs
):
5587 Returns the device context the event handler should draw upon. If
5588 ``None`` is returned then create a temporary `wx.ClientDC` and use
5591 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5593 DC
= property(GetDC
,doc
="See `GetDC`")
5594 _core_
.EraseEvent_swigregister(EraseEvent
)
5596 #---------------------------------------------------------------------------
5598 class FocusEvent(Event
):
5600 A focus event is sent when a window's focus changes. The window losing
5601 focus receives an EVT_KILL_FOCUS event while the window gaining it
5602 gets an EVT_SET_FOCUS event.
5604 Notice that the set focus event happens both when the user gives focus
5605 to the window (whether using the mouse or keyboard) and when it is
5606 done from the program itself using `wx.Window.SetFocus`.
5609 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5610 __repr__
= _swig_repr
5611 def __init__(self
, *args
, **kwargs
):
5613 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5617 _core_
.FocusEvent_swiginit(self
,_core_
.new_FocusEvent(*args
, **kwargs
))
5618 def GetWindow(*args
, **kwargs
):
5620 GetWindow(self) -> Window
5622 Returns the other window associated with this event, that is the
5623 window which had the focus before for the EVT_SET_FOCUS event and the
5624 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5626 Warning: the window returned may be None!
5628 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5630 def SetWindow(*args
, **kwargs
):
5631 """SetWindow(self, Window win)"""
5632 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5634 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
5635 _core_
.FocusEvent_swigregister(FocusEvent
)
5637 #---------------------------------------------------------------------------
5639 class ChildFocusEvent(CommandEvent
):
5641 A child focus event is sent to a (parent-)window when one of its child
5642 windows gains focus, so that the window could restore the focus back
5643 to its corresponding child if it loses it now and regains later.
5645 Notice that child window is the direct child of the window receiving
5646 the event, and so may not be the actual widget recieving focus if it
5647 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5648 to get the widget that is actually receiving focus.
5650 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5651 __repr__
= _swig_repr
5652 def __init__(self
, *args
, **kwargs
):
5654 __init__(self, Window win=None) -> ChildFocusEvent
5658 _core_
.ChildFocusEvent_swiginit(self
,_core_
.new_ChildFocusEvent(*args
, **kwargs
))
5659 def GetWindow(*args
, **kwargs
):
5661 GetWindow(self) -> Window
5663 The window, or (grand)parent of the window which has just received the
5666 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5668 Window
= property(GetWindow
,doc
="See `GetWindow`")
5669 _core_
.ChildFocusEvent_swigregister(ChildFocusEvent
)
5671 #---------------------------------------------------------------------------
5673 class ActivateEvent(Event
):
5675 An activate event is sent when a top-level window or the entire
5676 application is being activated or deactivated.
5678 A top-level window (a dialog or frame) receives an activate event when
5679 is being activated or deactivated. This is indicated visually by the
5680 title bar changing colour, and a subwindow gaining the keyboard focus.
5681 An application is activated or deactivated when one of its frames
5682 becomes activated, or a frame becomes inactivate resulting in all
5683 application frames being inactive.
5685 Please note that usually you should call event.Skip() in your handlers
5686 for these events so the default handlers will still be called, as not
5687 doing so can result in strange effects.
5690 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5691 __repr__
= _swig_repr
5692 def __init__(self
, *args
, **kwargs
):
5694 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5698 _core_
.ActivateEvent_swiginit(self
,_core_
.new_ActivateEvent(*args
, **kwargs
))
5699 def GetActive(*args
, **kwargs
):
5701 GetActive(self) -> bool
5703 Returns true if the application or window is being activated, false
5706 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5708 Active
= property(GetActive
,doc
="See `GetActive`")
5709 _core_
.ActivateEvent_swigregister(ActivateEvent
)
5711 #---------------------------------------------------------------------------
5713 class InitDialogEvent(Event
):
5715 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5716 any window when `wx.Window.InitDialog` is called. Handlers for this
5717 event can transfer data to the window, or anything else that should be
5718 done before the user begins editing the form. The default handler
5719 calls `wx.Window.TransferDataToWindow`.
5721 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5722 __repr__
= _swig_repr
5723 def __init__(self
, *args
, **kwargs
):
5725 __init__(self, int Id=0) -> InitDialogEvent
5729 _core_
.InitDialogEvent_swiginit(self
,_core_
.new_InitDialogEvent(*args
, **kwargs
))
5730 _core_
.InitDialogEvent_swigregister(InitDialogEvent
)
5732 #---------------------------------------------------------------------------
5734 class MenuEvent(Event
):
5736 This class is used for a variety of menu-related events. Note that
5737 these do not include menu command events, which are handled by sending
5738 `wx.CommandEvent` objects.
5740 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5741 text in the first field of the status bar.
5743 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5744 __repr__
= _swig_repr
5745 def __init__(self
, *args
, **kwargs
):
5747 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5751 _core_
.MenuEvent_swiginit(self
,_core_
.new_MenuEvent(*args
, **kwargs
))
5752 def GetMenuId(*args
, **kwargs
):
5754 GetMenuId(self) -> int
5756 Returns the menu identifier associated with the event. This method
5757 should be only used with the HIGHLIGHT events.
5759 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5761 def IsPopup(*args
, **kwargs
):
5763 IsPopup(self) -> bool
5765 Returns ``True`` if the menu which is being opened or closed is a
5766 popup menu, ``False`` if it is a normal one. This method should only
5767 be used with the OPEN and CLOSE events.
5769 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5771 def GetMenu(*args
, **kwargs
):
5773 GetMenu(self) -> Menu
5775 Returns the menu which is being opened or closed. This method should
5776 only be used with the OPEN and CLOSE events.
5778 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5780 Menu
= property(GetMenu
,doc
="See `GetMenu`")
5781 MenuId
= property(GetMenuId
,doc
="See `GetMenuId`")
5782 _core_
.MenuEvent_swigregister(MenuEvent
)
5784 #---------------------------------------------------------------------------
5786 class CloseEvent(Event
):
5788 This event class contains information about window and session close
5791 The handler function for EVT_CLOSE is called when the user has tried
5792 to close a a frame or dialog box using the window manager controls or
5793 the system menu. It can also be invoked by the application itself
5794 programmatically, for example by calling the `wx.Window.Close`
5797 You should check whether the application is forcing the deletion of
5798 the window using `CanVeto`. If it returns ``False``, you must destroy
5799 the window using `wx.Window.Destroy`. If the return value is ``True``,
5800 it is up to you whether you respond by destroying the window or not.
5801 For example you may wish to display a message dialog prompting to save
5802 files or to cancel the close.
5804 If you don't destroy the window, you should call `Veto` to let the
5805 calling code know that you did not destroy the window. This allows the
5806 `wx.Window.Close` function to return ``True`` or ``False`` depending
5807 on whether the close instruction was honored or not.
5809 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5810 __repr__
= _swig_repr
5811 def __init__(self
, *args
, **kwargs
):
5813 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5817 _core_
.CloseEvent_swiginit(self
,_core_
.new_CloseEvent(*args
, **kwargs
))
5818 def SetLoggingOff(*args
, **kwargs
):
5820 SetLoggingOff(self, bool logOff)
5822 Sets the 'logging off' flag.
5824 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5826 def GetLoggingOff(*args
, **kwargs
):
5828 GetLoggingOff(self) -> bool
5830 Returns ``True`` if the user is logging off or ``False`` if the
5831 system is shutting down. This method can only be called for end
5832 session and query end session events, it doesn't make sense for close
5835 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5837 def Veto(*args
, **kwargs
):
5839 Veto(self, bool veto=True)
5841 Call this from your event handler to veto a system shutdown or to
5842 signal to the calling application that a window close did not happen.
5844 You can only veto a shutdown or close if `CanVeto` returns true.
5846 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5848 def GetVeto(*args
, **kwargs
):
5849 """GetVeto(self) -> bool"""
5850 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5852 def SetCanVeto(*args
, **kwargs
):
5854 SetCanVeto(self, bool canVeto)
5856 Sets the 'can veto' flag.
5858 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5860 def CanVeto(*args
, **kwargs
):
5862 CanVeto(self) -> bool
5864 Returns true if you can veto a system shutdown or a window close
5865 event. Vetoing a window close event is not possible if the calling
5866 code wishes to force the application to exit, and so this function
5867 must be called to check this.
5869 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5871 LoggingOff
= property(GetLoggingOff
,SetLoggingOff
,doc
="See `GetLoggingOff` and `SetLoggingOff`")
5872 _core_
.CloseEvent_swigregister(CloseEvent
)
5874 #---------------------------------------------------------------------------
5876 class ShowEvent(Event
):
5877 """An EVT_SHOW event is sent when a window is shown or hidden."""
5878 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5879 __repr__
= _swig_repr
5880 def __init__(self
, *args
, **kwargs
):
5882 __init__(self, int winid=0, bool show=False) -> ShowEvent
5884 An EVT_SHOW event is sent when a window is shown or hidden.
5886 _core_
.ShowEvent_swiginit(self
,_core_
.new_ShowEvent(*args
, **kwargs
))
5887 def SetShow(*args
, **kwargs
):
5888 """SetShow(self, bool show)"""
5889 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5891 def GetShow(*args
, **kwargs
):
5892 """GetShow(self) -> bool"""
5893 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5895 Show
= property(GetShow
,SetShow
,doc
="See `GetShow` and `SetShow`")
5896 _core_
.ShowEvent_swigregister(ShowEvent
)
5898 #---------------------------------------------------------------------------
5900 class IconizeEvent(Event
):
5902 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5905 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5906 __repr__
= _swig_repr
5907 def __init__(self
, *args
, **kwargs
):
5909 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5911 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5914 _core_
.IconizeEvent_swiginit(self
,_core_
.new_IconizeEvent(*args
, **kwargs
))
5915 def Iconized(*args
, **kwargs
):
5917 Iconized(self) -> bool
5919 Returns ``True`` if the frame has been iconized, ``False`` if it has
5922 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5924 _core_
.IconizeEvent_swigregister(IconizeEvent
)
5926 #---------------------------------------------------------------------------
5928 class MaximizeEvent(Event
):
5929 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5930 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5931 __repr__
= _swig_repr
5932 def __init__(self
, *args
, **kwargs
):
5934 __init__(self, int id=0) -> MaximizeEvent
5936 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5938 _core_
.MaximizeEvent_swiginit(self
,_core_
.new_MaximizeEvent(*args
, **kwargs
))
5939 _core_
.MaximizeEvent_swigregister(MaximizeEvent
)
5941 #---------------------------------------------------------------------------
5943 class DropFilesEvent(Event
):
5945 This class is used for drop files events, that is, when files have
5946 been dropped onto the window. This functionality is only available
5947 under Windows. The window must have previously been enabled for
5948 dropping by calling `wx.Window.DragAcceptFiles`.
5950 Important note: this is a separate implementation to the more general
5951 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5952 implementation uses the older, Windows message-based approach of
5955 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5959 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5960 def __init__(self
): raise AttributeError, "No constructor defined"
5961 __repr__
= _swig_repr
5962 def GetPosition(*args
, **kwargs
):
5964 GetPosition(self) -> Point
5966 Returns the position at which the files were dropped.
5968 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5970 def GetNumberOfFiles(*args
, **kwargs
):
5972 GetNumberOfFiles(self) -> int
5974 Returns the number of files dropped.
5976 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5978 def GetFiles(*args
, **kwargs
):
5980 GetFiles(self) -> PyObject
5982 Returns a list of the filenames that were dropped.
5984 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5986 Files
= property(GetFiles
,doc
="See `GetFiles`")
5987 NumberOfFiles
= property(GetNumberOfFiles
,doc
="See `GetNumberOfFiles`")
5988 Position
= property(GetPosition
,doc
="See `GetPosition`")
5989 _core_
.DropFilesEvent_swigregister(DropFilesEvent
)
5991 #---------------------------------------------------------------------------
5993 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5994 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5995 class UpdateUIEvent(CommandEvent
):
5997 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5998 wxWidgets to give an application the chance to update various user
6001 Without update UI events, an application has to work hard to
6002 check/uncheck, enable/disable, and set the text for elements such as
6003 menu items and toolbar buttons. The code for doing this has to be
6004 mixed up with the code that is invoked when an action is invoked for a
6005 menu item or button.
6007 With update UI events, you define an event handler to look at the
6008 state of the application and change UI elements accordingly. wxWidgets
6009 will call your handler functions in idle time, so you don't have to
6010 worry where to call this code. In addition to being a clearer and more
6011 declarative method, it also means you don't have to worry whether
6012 you're updating a toolbar or menubar identifier. The same handler can
6013 update a menu item and toolbar button, if the ID values are the same.
6015 Instead of directly manipulating the menu or button, you call
6016 functions in the event object, such as `Check`. wxWidgets will
6017 determine whether such a call has been made, and which UI element to
6020 These events will work for popup menus as well as menubars. Just
6021 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6022 any UI events for the window that owns the menu.
6024 If you find that the overhead of UI update processing is affecting
6025 your application, you can do one or both of the following:
6027 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6028 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6029 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6030 receive update events. No other windows will receive update
6033 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6034 value to set the delay between updates. You may need to call
6035 `wx.Window.UpdateWindowUI` at critical points, for example when
6036 a dialog is about to be shown, in case the user sees a slight
6037 delay before windows are updated.
6039 Note that although events are sent in idle time, defining a EVT_IDLE
6040 handler for a window does not affect this because the events are sent
6041 from an internal idle handler.
6043 wxWidgets tries to optimize update events on some platforms. On
6044 Windows and GTK+, events for menubar items are only sent when the menu
6045 is about to be shown, and not in idle time.
6048 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6049 __repr__
= _swig_repr
6050 def __init__(self
, *args
, **kwargs
):
6052 __init__(self, int commandId=0) -> UpdateUIEvent
6056 _core_
.UpdateUIEvent_swiginit(self
,_core_
.new_UpdateUIEvent(*args
, **kwargs
))
6057 def GetChecked(*args
, **kwargs
):
6059 GetChecked(self) -> bool
6061 Returns ``True`` if the UI element should be checked.
6063 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
6065 def GetEnabled(*args
, **kwargs
):
6067 GetEnabled(self) -> bool
6069 Returns ``True`` if the UI element should be enabled.
6071 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
6073 def GetShown(*args
, **kwargs
):
6075 GetShown(self) -> bool
6077 Returns ``True`` if the UI element should be shown.
6079 return _core_
.UpdateUIEvent_GetShown(*args
, **kwargs
)
6081 def GetText(*args
, **kwargs
):
6083 GetText(self) -> String
6085 Returns the text that should be set for the UI element.
6087 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
6089 def GetSetText(*args
, **kwargs
):
6091 GetSetText(self) -> bool
6093 Returns ``True`` if the application has called `SetText`. For
6094 wxWidgets internal use only.
6096 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
6098 def GetSetChecked(*args
, **kwargs
):
6100 GetSetChecked(self) -> bool
6102 Returns ``True`` if the application has called `Check`. For wxWidgets
6105 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
6107 def GetSetEnabled(*args
, **kwargs
):
6109 GetSetEnabled(self) -> bool
6111 Returns ``True`` if the application has called `Enable`. For wxWidgets
6114 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
6116 def GetSetShown(*args
, **kwargs
):
6118 GetSetShown(self) -> bool
6120 Returns ``True`` if the application has called `Show`. For wxWidgets
6123 return _core_
.UpdateUIEvent_GetSetShown(*args
, **kwargs
)
6125 def Check(*args
, **kwargs
):
6127 Check(self, bool check)
6129 Check or uncheck the UI element.
6131 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
6133 def Enable(*args
, **kwargs
):
6135 Enable(self, bool enable)
6137 Enable or disable the UI element.
6139 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
6141 def Show(*args
, **kwargs
):
6143 Show(self, bool show)
6145 Show or hide the UI element.
6147 return _core_
.UpdateUIEvent_Show(*args
, **kwargs
)
6149 def SetText(*args
, **kwargs
):
6151 SetText(self, String text)
6153 Sets the text for this UI element.
6155 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
6157 def SetUpdateInterval(*args
, **kwargs
):
6159 SetUpdateInterval(long updateInterval)
6161 Sets the interval between updates in milliseconds. Set to -1 to
6162 disable updates, or to 0 to update as frequently as possible. The
6165 Use this to reduce the overhead of UI update events if your
6166 application has a lot of windows. If you set the value to -1 or
6167 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6168 at appropriate points in your application, such as when a dialog is
6171 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
6173 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
6174 def GetUpdateInterval(*args
, **kwargs
):
6176 GetUpdateInterval() -> long
6178 Returns the current interval between updates in milliseconds. -1
6179 disables updates, 0 updates as frequently as possible.
6181 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
6183 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
6184 def CanUpdate(*args
, **kwargs
):
6186 CanUpdate(Window win) -> bool
6188 Returns ``True`` if it is appropriate to update (send UI update events
6191 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6192 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6193 events were last sent in idle time, and the update interval, to
6194 determine whether events should be sent to this window now. By default
6195 this will always return true because the update mode is initially
6196 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6197 events will be sent as often as possible. You can reduce the frequency
6198 that events are sent by changing the mode and/or setting an update
6202 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
6204 CanUpdate
= staticmethod(CanUpdate
)
6205 def ResetUpdateTime(*args
, **kwargs
):
6209 Used internally to reset the last-updated time to the current time. It
6210 is assumed that update events are normally sent in idle time, so this
6211 is called at the end of idle processing.
6213 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
6215 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
6216 def SetMode(*args
, **kwargs
):
6220 Specify how wxWidgets will send update events: to all windows, or only
6221 to those which specify that they will process the events.
6223 The mode may be one of the following values:
6225 ============================= ==========================================
6226 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6227 is the default setting.
6228 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6229 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6231 ============================= ==========================================
6234 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
6236 SetMode
= staticmethod(SetMode
)
6237 def GetMode(*args
, **kwargs
):
6241 Returns a value specifying how wxWidgets will send update events: to
6242 all windows, or only to those which specify that they will process the
6245 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
6247 GetMode
= staticmethod(GetMode
)
6248 Checked
= property(GetChecked
,Check
,doc
="See `GetChecked`")
6249 Enabled
= property(GetEnabled
,Enable
,doc
="See `GetEnabled`")
6250 Shown
= property(GetShown
,Show
,doc
="See `GetShown`")
6251 Text
= property(GetText
,SetText
,doc
="See `GetText` and `SetText`")
6252 _core_
.UpdateUIEvent_swigregister(UpdateUIEvent
)
6254 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
6256 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6258 Sets the interval between updates in milliseconds. Set to -1 to
6259 disable updates, or to 0 to update as frequently as possible. The
6262 Use this to reduce the overhead of UI update events if your
6263 application has a lot of windows. If you set the value to -1 or
6264 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6265 at appropriate points in your application, such as when a dialog is
6268 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
6270 def UpdateUIEvent_GetUpdateInterval(*args
):
6272 UpdateUIEvent_GetUpdateInterval() -> long
6274 Returns the current interval between updates in milliseconds. -1
6275 disables updates, 0 updates as frequently as possible.
6277 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
)
6279 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
6281 UpdateUIEvent_CanUpdate(Window win) -> bool
6283 Returns ``True`` if it is appropriate to update (send UI update events
6286 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6287 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6288 events were last sent in idle time, and the update interval, to
6289 determine whether events should be sent to this window now. By default
6290 this will always return true because the update mode is initially
6291 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6292 events will be sent as often as possible. You can reduce the frequency
6293 that events are sent by changing the mode and/or setting an update
6297 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
6299 def UpdateUIEvent_ResetUpdateTime(*args
):
6301 UpdateUIEvent_ResetUpdateTime()
6303 Used internally to reset the last-updated time to the current time. It
6304 is assumed that update events are normally sent in idle time, so this
6305 is called at the end of idle processing.
6307 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
)
6309 def UpdateUIEvent_SetMode(*args
, **kwargs
):
6311 UpdateUIEvent_SetMode(int mode)
6313 Specify how wxWidgets will send update events: to all windows, or only
6314 to those which specify that they will process the events.
6316 The mode may be one of the following values:
6318 ============================= ==========================================
6319 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6320 is the default setting.
6321 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6322 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6324 ============================= ==========================================
6327 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
6329 def UpdateUIEvent_GetMode(*args
):
6331 UpdateUIEvent_GetMode() -> int
6333 Returns a value specifying how wxWidgets will send update events: to
6334 all windows, or only to those which specify that they will process the
6337 return _core_
.UpdateUIEvent_GetMode(*args
)
6339 #---------------------------------------------------------------------------
6341 class SysColourChangedEvent(Event
):
6343 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6344 when the user changes the colour settings using the control
6345 panel. This is only applicable under Windows.
6347 The default event handler for this event propagates the event to child
6348 windows, since Windows only sends the events to top-level windows. If
6349 intercepting this event for a top-level window, remember to call
6350 `Skip` so the the base class handler will still be executed, or to
6351 pass the event on to the window's children explicitly.
6354 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6355 __repr__
= _swig_repr
6356 def __init__(self
, *args
, **kwargs
):
6358 __init__(self) -> SysColourChangedEvent
6362 _core_
.SysColourChangedEvent_swiginit(self
,_core_
.new_SysColourChangedEvent(*args
, **kwargs
))
6363 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEvent
)
6365 #---------------------------------------------------------------------------
6367 class MouseCaptureChangedEvent(Event
):
6369 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6370 a window that loses its mouse capture. This is called even if
6371 `wx.Window.ReleaseMouse` was called by the application code. Handling
6372 this event allows an application to cater for unexpected capture
6373 releases which might otherwise confuse mouse handling code.
6375 This event is implemented under Windows only.
6377 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6378 __repr__
= _swig_repr
6379 def __init__(self
, *args
, **kwargs
):
6381 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6385 _core_
.MouseCaptureChangedEvent_swiginit(self
,_core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
))
6386 def GetCapturedWindow(*args
, **kwargs
):
6388 GetCapturedWindow(self) -> Window
6390 Returns the window that gained the capture, or ``None`` if it was a
6391 non-wxWidgets window.
6393 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
6395 CapturedWindow
= property(GetCapturedWindow
,doc
="See `GetCapturedWindow`")
6396 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent
)
6398 #---------------------------------------------------------------------------
6400 class MouseCaptureLostEvent(Event
):
6402 A mouse capture lost event is sent to a window that obtained mouse
6403 capture, which was subsequently loss due to "external" event, for
6404 example when a dialog box is shown or if another application captures
6407 If this happens, this event is sent to all windows that are on the
6408 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6409 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6410 if the capture changes because of a call to CaptureMouse or
6413 This event is currently emitted under Windows only.
6416 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6417 __repr__
= _swig_repr
6418 def __init__(self
, *args
, **kwargs
):
6420 __init__(self, int winid=0) -> MouseCaptureLostEvent
6422 A mouse capture lost event is sent to a window that obtained mouse
6423 capture, which was subsequently loss due to "external" event, for
6424 example when a dialog box is shown or if another application captures
6427 If this happens, this event is sent to all windows that are on the
6428 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6429 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6430 if the capture changes because of a call to CaptureMouse or
6433 This event is currently emitted under Windows only.
6436 _core_
.MouseCaptureLostEvent_swiginit(self
,_core_
.new_MouseCaptureLostEvent(*args
, **kwargs
))
6437 _core_
.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent
)
6439 #---------------------------------------------------------------------------
6441 class DisplayChangedEvent(Event
):
6443 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6444 resolution has changed.
6446 This event is implemented under Windows only.
6448 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6449 __repr__
= _swig_repr
6450 def __init__(self
, *args
, **kwargs
):
6451 """__init__(self) -> DisplayChangedEvent"""
6452 _core_
.DisplayChangedEvent_swiginit(self
,_core_
.new_DisplayChangedEvent(*args
, **kwargs
))
6453 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEvent
)
6455 #---------------------------------------------------------------------------
6457 class PaletteChangedEvent(Event
):
6459 An EVT_PALETTE_CHANGED event is sent when the system palette has
6460 changed, thereby giving each window a chance to redo their own to
6463 This event is implemented under Windows only.
6465 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6466 __repr__
= _swig_repr
6467 def __init__(self
, *args
, **kwargs
):
6469 __init__(self, int id=0) -> PaletteChangedEvent
6471 An EVT_PALETTE_CHANGED event is sent when the system palette has
6472 changed, thereby giving each window a chance to redo their own to
6475 This event is implemented under Windows only.
6477 _core_
.PaletteChangedEvent_swiginit(self
,_core_
.new_PaletteChangedEvent(*args
, **kwargs
))
6478 def SetChangedWindow(*args
, **kwargs
):
6479 """SetChangedWindow(self, Window win)"""
6480 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
6482 def GetChangedWindow(*args
, **kwargs
):
6483 """GetChangedWindow(self) -> Window"""
6484 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
6486 ChangedWindow
= property(GetChangedWindow
,SetChangedWindow
,doc
="See `GetChangedWindow` and `SetChangedWindow`")
6487 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEvent
)
6489 #---------------------------------------------------------------------------
6491 class QueryNewPaletteEvent(Event
):
6493 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6494 focus and should re-do its palette.
6496 This event is implemented under Windows only.
6498 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6499 __repr__
= _swig_repr
6500 def __init__(self
, *args
, **kwargs
):
6502 __init__(self, int winid=0) -> QueryNewPaletteEvent
6506 _core_
.QueryNewPaletteEvent_swiginit(self
,_core_
.new_QueryNewPaletteEvent(*args
, **kwargs
))
6507 def SetPaletteRealized(*args
, **kwargs
):
6509 SetPaletteRealized(self, bool realized)
6511 App should set this if it changes the palette.
6513 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
6515 def GetPaletteRealized(*args
, **kwargs
):
6516 """GetPaletteRealized(self) -> bool"""
6517 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
6519 PaletteRealized
= property(GetPaletteRealized
,SetPaletteRealized
,doc
="See `GetPaletteRealized` and `SetPaletteRealized`")
6520 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent
)
6522 #---------------------------------------------------------------------------
6524 class NavigationKeyEvent(Event
):
6526 EVT_NAVIGATION_KEY events are used to control moving the focus between
6527 widgets, otherwise known as tab-traversal. You woudl normally not
6528 catch navigation events in applications as there are already
6529 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6530 it useful to send navigation events in certain situations to change
6531 the focus in certain ways, although it's probably easier to just call
6532 `wx.Window.Navigate`.
6534 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6535 __repr__
= _swig_repr
6536 def __init__(self
, *args
, **kwargs
):
6537 """__init__(self) -> NavigationKeyEvent"""
6538 _core_
.NavigationKeyEvent_swiginit(self
,_core_
.new_NavigationKeyEvent(*args
, **kwargs
))
6539 def GetDirection(*args
, **kwargs
):
6541 GetDirection(self) -> bool
6543 Returns ``True`` if the direction is forward, ``False`` otherwise.
6545 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
6547 def SetDirection(*args
, **kwargs
):
6549 SetDirection(self, bool forward)
6551 Specify the direction that the navigation should take. Usually the
6552 difference between using Tab and Shift-Tab.
6554 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
6556 def IsWindowChange(*args
, **kwargs
):
6558 IsWindowChange(self) -> bool
6560 Returns ``True`` if window change is allowed.
6562 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
6564 def SetWindowChange(*args
, **kwargs
):
6566 SetWindowChange(self, bool ischange)
6568 Specify if the navigation should be able to change parent windows.
6569 For example, changing notebook pages, etc. This is usually implemented
6570 by using Control-Tab.
6572 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
6574 def IsFromTab(*args
, **kwargs
):
6576 IsFromTab(self) -> bool
6578 Returns ``True`` if the navigation event is originated from the Tab
6581 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
6583 def SetFromTab(*args
, **kwargs
):
6585 SetFromTab(self, bool bIs)
6587 Set to true under MSW if the event was generated using the tab key.
6588 This is required for proper navogation over radio buttons.
6590 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
6592 def SetFlags(*args
, **kwargs
):
6594 SetFlags(self, long flags)
6596 Set the navigation flags to a combination of the following:
6598 * wx.NavigationKeyEvent.IsBackward
6599 * wx.NavigationKeyEvent.IsForward
6600 * wx.NavigationKeyEvent.WinChange
6601 * wx.NavigationKeyEvent.FromTab
6604 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6606 def GetCurrentFocus(*args
, **kwargs
):
6608 GetCurrentFocus(self) -> Window
6610 Returns the child window which currenty has the focus. May be
6613 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6615 def SetCurrentFocus(*args
, **kwargs
):
6617 SetCurrentFocus(self, Window win)
6619 Set the window that has the focus.
6621 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6623 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6624 IsForward
= _core_
.NavigationKeyEvent_IsForward
6625 WinChange
= _core_
.NavigationKeyEvent_WinChange
6626 FromTab
= _core_
.NavigationKeyEvent_FromTab
6627 CurrentFocus
= property(GetCurrentFocus
,SetCurrentFocus
,doc
="See `GetCurrentFocus` and `SetCurrentFocus`")
6628 Direction
= property(GetDirection
,SetDirection
,doc
="See `GetDirection` and `SetDirection`")
6629 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEvent
)
6631 #---------------------------------------------------------------------------
6633 class WindowCreateEvent(CommandEvent
):
6635 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6636 underlying GUI object) exists.
6638 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6639 __repr__
= _swig_repr
6640 def __init__(self
, *args
, **kwargs
):
6642 __init__(self, Window win=None) -> WindowCreateEvent
6644 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6645 underlying GUI object) exists.
6647 _core_
.WindowCreateEvent_swiginit(self
,_core_
.new_WindowCreateEvent(*args
, **kwargs
))
6648 def GetWindow(*args
, **kwargs
):
6650 GetWindow(self) -> Window
6652 Returns the window that this event refers to.
6654 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6656 Window
= property(GetWindow
,doc
="See `GetWindow`")
6657 _core_
.WindowCreateEvent_swigregister(WindowCreateEvent
)
6659 class WindowDestroyEvent(CommandEvent
):
6661 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6662 when the GUI window is destroyed.
6664 When a class derived from `wx.Window` is destroyed its destructor will
6665 have already run by the time this event is sent. Therefore this event
6666 will not usually be received at all by the window itself. Since it is
6667 received after the destructor has run, an object should not try to
6668 handle its own wx.WindowDestroyEvent, but it can be used to get
6669 notification of the destruction of another window.
6671 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6672 __repr__
= _swig_repr
6673 def __init__(self
, *args
, **kwargs
):
6675 __init__(self, Window win=None) -> WindowDestroyEvent
6677 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6678 when the GUI window is destroyed.
6680 When a class derived from `wx.Window` is destroyed its destructor will
6681 have already run by the time this event is sent. Therefore this event
6682 will not usually be received at all by the window itself. Since it is
6683 received after the destructor has run, an object should not try to
6684 handle its own wx.WindowDestroyEvent, but it can be used to get
6685 notification of the destruction of another window.
6687 _core_
.WindowDestroyEvent_swiginit(self
,_core_
.new_WindowDestroyEvent(*args
, **kwargs
))
6688 def GetWindow(*args
, **kwargs
):
6690 GetWindow(self) -> Window
6692 Returns the window that this event refers to.
6694 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6696 Window
= property(GetWindow
,doc
="See `GetWindow`")
6697 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEvent
)
6699 #---------------------------------------------------------------------------
6701 class ContextMenuEvent(CommandEvent
):
6703 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6704 give the application a chance to show a context (popup) menu.
6706 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6707 __repr__
= _swig_repr
6708 def __init__(self
, *args
, **kwargs
):
6710 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6714 _core_
.ContextMenuEvent_swiginit(self
,_core_
.new_ContextMenuEvent(*args
, **kwargs
))
6715 def GetPosition(*args
, **kwargs
):
6717 GetPosition(self) -> Point
6719 Returns the position (in screen coordinants) at which the menu should
6722 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6724 def SetPosition(*args
, **kwargs
):
6726 SetPosition(self, Point pos)
6728 Sets the position at which the menu should be shown.
6730 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6732 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
6733 _core_
.ContextMenuEvent_swigregister(ContextMenuEvent
)
6735 #---------------------------------------------------------------------------
6737 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6738 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6739 class IdleEvent(Event
):
6741 This class is used for EVT_IDLE events, which are generated and sent
6742 when the application *becomes* idle. In other words, the when the
6743 event queue becomes empty then idle events are sent to all windows (by
6744 default) and as long as none of them call `RequestMore` then there are
6745 no more idle events until after the system event queue has some normal
6746 events and then becomes empty again.
6748 By default, idle events are sent to all windows. If this is causing a
6749 significant overhead in your application, you can call
6750 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6751 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6752 which should receive idle events. Then idle events will only be sent
6753 to those windows and not to any others.
6755 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6756 __repr__
= _swig_repr
6757 def __init__(self
, *args
, **kwargs
):
6759 __init__(self) -> IdleEvent
6763 _core_
.IdleEvent_swiginit(self
,_core_
.new_IdleEvent(*args
, **kwargs
))
6764 def RequestMore(*args
, **kwargs
):
6766 RequestMore(self, bool needMore=True)
6768 Tells wxWidgets that more processing is required. This function can be
6769 called by an EVT_IDLE handler for a window to indicate that the
6770 application should forward the EVT_IDLE event once more to the
6771 application windows. If no window calls this function during its
6772 EVT_IDLE handler, then the application will remain in a passive event
6773 loop until a new event is posted to the application by the windowing
6776 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6778 def MoreRequested(*args
, **kwargs
):
6780 MoreRequested(self) -> bool
6782 Returns ``True`` if the OnIdle function processing this event
6783 requested more processing time.
6785 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6787 def SetMode(*args
, **kwargs
):
6791 Static method for specifying how wxWidgets will send idle events: to
6792 all windows, or only to those which specify that they will process the
6795 The mode can be one of the following values:
6797 ========================= ========================================
6798 wx.IDLE_PROCESS_ALL Send idle events to all windows
6799 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6800 the wx.WS_EX_PROCESS_IDLE extra style
6802 ========================= ========================================
6805 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6807 SetMode
= staticmethod(SetMode
)
6808 def GetMode(*args
, **kwargs
):
6812 Static method returning a value specifying how wxWidgets will send
6813 idle events: to all windows, or only to those which specify that they
6814 will process the events.
6816 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6818 GetMode
= staticmethod(GetMode
)
6819 def CanSend(*args
, **kwargs
):
6821 CanSend(Window win) -> bool
6823 Returns ``True`` if it is appropriate to send idle events to this
6826 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6827 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6828 events should be sent to this window now. By default this will always
6829 return ``True`` because the update mode is initially
6830 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6831 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6833 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6835 CanSend
= staticmethod(CanSend
)
6836 _core_
.IdleEvent_swigregister(IdleEvent
)
6838 def IdleEvent_SetMode(*args
, **kwargs
):
6840 IdleEvent_SetMode(int mode)
6842 Static method for specifying how wxWidgets will send idle events: to
6843 all windows, or only to those which specify that they will process the
6846 The mode can be one of the following values:
6848 ========================= ========================================
6849 wx.IDLE_PROCESS_ALL Send idle events to all windows
6850 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6851 the wx.WS_EX_PROCESS_IDLE extra style
6853 ========================= ========================================
6856 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6858 def IdleEvent_GetMode(*args
):
6860 IdleEvent_GetMode() -> int
6862 Static method returning a value specifying how wxWidgets will send
6863 idle events: to all windows, or only to those which specify that they
6864 will process the events.
6866 return _core_
.IdleEvent_GetMode(*args
)
6868 def IdleEvent_CanSend(*args
, **kwargs
):
6870 IdleEvent_CanSend(Window win) -> bool
6872 Returns ``True`` if it is appropriate to send idle events to this
6875 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6876 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6877 events should be sent to this window now. By default this will always
6878 return ``True`` because the update mode is initially
6879 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6880 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6882 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6884 #---------------------------------------------------------------------------
6886 class ClipboardTextEvent(CommandEvent
):
6888 A Clipboard Text event is sent when a window intercepts a text
6889 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6890 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6891 popup menu command, etc. NOTE : under windows these events are *NOT*
6892 generated automatically for a Rich Edit text control.
6894 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6895 __repr__
= _swig_repr
6896 def __init__(self
, *args
, **kwargs
):
6898 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6900 A Clipboard Text event is sent when a window intercepts a text
6901 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6902 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6903 popup menu command, etc. NOTE : under windows these events are *NOT*
6904 generated automatically for a Rich Edit text control.
6906 _core_
.ClipboardTextEvent_swiginit(self
,_core_
.new_ClipboardTextEvent(*args
, **kwargs
))
6907 _core_
.ClipboardTextEvent_swigregister(ClipboardTextEvent
)
6909 #---------------------------------------------------------------------------
6911 class PyEvent(Event
):
6913 wx.PyEvent can be used as a base class for implementing custom event
6914 types in Python. You should derived from this class instead of
6915 `wx.Event` because this class is Python-aware and is able to transport
6916 its Python bits safely through the wxWidgets event system and have
6917 them still be there when the event handler is invoked.
6919 :see: `wx.PyCommandEvent`
6922 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6923 __repr__
= _swig_repr
6924 def __init__(self
, *args
, **kwargs
):
6925 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6926 _core_
.PyEvent_swiginit(self
,_core_
.new_PyEvent(*args
, **kwargs
))
6929 __swig_destroy__
= _core_
.delete_PyEvent
6930 __del__
= lambda self
: None;
6931 def _SetSelf(*args
, **kwargs
):
6932 """_SetSelf(self, PyObject self)"""
6933 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6935 def _GetSelf(*args
, **kwargs
):
6936 """_GetSelf(self) -> PyObject"""
6937 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6939 _core_
.PyEvent_swigregister(PyEvent
)
6941 class PyCommandEvent(CommandEvent
):
6943 wx.PyCommandEvent can be used as a base class for implementing custom
6944 event types in Python, where the event shoudl travel up to parent
6945 windows looking for a handler. You should derived from this class
6946 instead of `wx.CommandEvent` because this class is Python-aware and is
6947 able to transport its Python bits safely through the wxWidgets event
6948 system and have them still be there when the event handler is invoked.
6953 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6954 __repr__
= _swig_repr
6955 def __init__(self
, *args
, **kwargs
):
6956 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6957 _core_
.PyCommandEvent_swiginit(self
,_core_
.new_PyCommandEvent(*args
, **kwargs
))
6960 __swig_destroy__
= _core_
.delete_PyCommandEvent
6961 __del__
= lambda self
: None;
6962 def _SetSelf(*args
, **kwargs
):
6963 """_SetSelf(self, PyObject self)"""
6964 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6966 def _GetSelf(*args
, **kwargs
):
6967 """_GetSelf(self) -> PyObject"""
6968 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6970 _core_
.PyCommandEvent_swigregister(PyCommandEvent
)
6972 class DateEvent(CommandEvent
):
6974 This event class holds information about a date change event and is
6975 used together with `wx.DatePickerCtrl`. It also serves as a base class
6976 for `wx.calendar.CalendarEvent`. Bind these event types with
6979 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6980 __repr__
= _swig_repr
6981 def __init__(self
, *args
, **kwargs
):
6982 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6983 _core_
.DateEvent_swiginit(self
,_core_
.new_DateEvent(*args
, **kwargs
))
6984 def GetDate(*args
, **kwargs
):
6986 GetDate(self) -> DateTime
6990 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6992 def SetDate(*args
, **kwargs
):
6994 SetDate(self, DateTime date)
6996 Sets the date carried by the event, normally only used by the library
6999 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
7001 Date
= property(GetDate
,SetDate
,doc
="See `GetDate` and `SetDate`")
7002 _core_
.DateEvent_swigregister(DateEvent
)
7004 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
7005 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
7007 class EventBlocker(EvtHandler
):
7008 """Helper class to temporarily disable event handling for a window."""
7009 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7010 __repr__
= _swig_repr
7011 def __init__(self
, *args
, **kwargs
):
7013 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7015 Helper class to temporarily disable event handling for a window.
7017 _core_
.EventBlocker_swiginit(self
,_core_
.new_EventBlocker(*args
, **kwargs
))
7018 __swig_destroy__
= _core_
.delete_EventBlocker
7019 __del__
= lambda self
: None;
7020 def Block(*args
, **kwargs
):
7021 """Block(self, EventType type)"""
7022 return _core_
.EventBlocker_Block(*args
, **kwargs
)
7024 _core_
.EventBlocker_swigregister(EventBlocker
)
7026 #---------------------------------------------------------------------------
7028 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
7029 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
7030 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
7031 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
7032 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
7033 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
7034 class PyApp(EvtHandler
):
7036 The ``wx.PyApp`` class is an *implementation detail*, please use the
7037 `wx.App` class (or some other derived class) instead.
7039 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7040 __repr__
= _swig_repr
7041 def __init__(self
, *args
, **kwargs
):
7043 __init__(self) -> PyApp
7045 Create a new application object, starting the bootstrap process.
7047 _core_
.PyApp_swiginit(self
,_core_
.new_PyApp(*args
, **kwargs
))
7048 self
._setOORInfo
(self
, False);PyApp
._setCallbackInfo
(self
, self
, PyApp
)
7050 __swig_destroy__
= _core_
.delete_PyApp
7051 __del__
= lambda self
: None;
7052 def _setCallbackInfo(*args
, **kwargs
):
7053 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
7054 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
7056 def GetAppName(*args
, **kwargs
):
7058 GetAppName(self) -> String
7060 Get the application name.
7062 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
7064 def SetAppName(*args
, **kwargs
):
7066 SetAppName(self, String name)
7068 Set the application name. This value may be used automatically by
7069 `wx.Config` and such.
7071 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
7073 def GetClassName(*args
, **kwargs
):
7075 GetClassName(self) -> String
7077 Get the application's class name.
7079 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
7081 def SetClassName(*args
, **kwargs
):
7083 SetClassName(self, String name)
7085 Set the application's class name. This value may be used for
7086 X-resources if applicable for the platform
7088 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
7090 def GetVendorName(*args
, **kwargs
):
7092 GetVendorName(self) -> String
7094 Get the application's vendor name.
7096 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
7098 def SetVendorName(*args
, **kwargs
):
7100 SetVendorName(self, String name)
7102 Set the application's vendor name. This value may be used
7103 automatically by `wx.Config` and such.
7105 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
7107 def GetTraits(*args
, **kwargs
):
7109 GetTraits(self) -> wxAppTraits
7111 Return (and create if necessary) the app traits object to which we
7112 delegate for everything which either should be configurable by the
7113 user (then he can change the default behaviour simply by overriding
7114 CreateTraits() and returning his own traits object) or which is
7115 GUI/console dependent as then wx.AppTraits allows us to abstract the
7116 differences behind the common facade.
7118 :todo: Add support for overriding CreateAppTraits in wxPython.
7120 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
7122 def ProcessPendingEvents(*args
, **kwargs
):
7124 ProcessPendingEvents(self)
7126 Process all events in the Pending Events list -- it is necessary to
7127 call this function to process posted events. This normally happens
7128 during each event loop iteration.
7130 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
7132 def Yield(*args
, **kwargs
):
7134 Yield(self, bool onlyIfNeeded=False) -> bool
7136 Process all currently pending events right now, instead of waiting
7137 until return to the event loop. It is an error to call ``Yield``
7138 recursively unless the value of ``onlyIfNeeded`` is True.
7140 :warning: This function is dangerous as it can lead to unexpected
7141 reentrancies (i.e. when called from an event handler it may
7142 result in calling the same event handler again), use with
7143 extreme care or, better, don't use at all!
7145 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
7148 return _core_
.PyApp_Yield(*args
, **kwargs
)
7150 def WakeUpIdle(*args
, **kwargs
):
7154 Make sure that idle events are sent again.
7155 :see: `wx.WakeUpIdle`
7157 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
7159 def IsMainLoopRunning(*args
, **kwargs
):
7161 IsMainLoopRunning() -> bool
7163 Returns True if we're running the main loop, i.e. if the events can
7164 currently be dispatched.
7166 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
7168 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
7169 def MainLoop(*args
, **kwargs
):
7171 MainLoop(self) -> int
7173 Execute the main GUI loop, the function doesn't normally return until
7174 all top level windows have been closed and destroyed.
7176 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
7178 def Exit(*args
, **kwargs
):
7182 Exit the main loop thus terminating the application.
7185 return _core_
.PyApp_Exit(*args
, **kwargs
)
7187 def GetLayoutDirection(*args
, **kwargs
):
7189 GetLayoutDirection(self) -> int
7191 Return the layout direction for the current locale.
7193 return _core_
.PyApp_GetLayoutDirection(*args
, **kwargs
)
7195 def ExitMainLoop(*args
, **kwargs
):
7199 Exit the main GUI loop during the next iteration of the main
7200 loop, (i.e. it does not stop the program immediately!)
7202 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
7204 def Pending(*args
, **kwargs
):
7206 Pending(self) -> bool
7208 Returns True if there are unprocessed events in the event queue.
7210 return _core_
.PyApp_Pending(*args
, **kwargs
)
7212 def Dispatch(*args
, **kwargs
):
7214 Dispatch(self) -> bool
7216 Process the first event in the event queue (blocks until an event
7217 appears if there are none currently)
7219 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
7221 def ProcessIdle(*args
, **kwargs
):
7223 ProcessIdle(self) -> bool
7225 Called from the MainLoop when the application becomes idle (there are
7226 no pending events) and sends a `wx.IdleEvent` to all interested
7227 parties. Returns True if more idle events are needed, False if not.
7229 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
7231 def SendIdleEvents(*args
, **kwargs
):
7233 SendIdleEvents(self, Window win, IdleEvent event) -> bool
7235 Send idle event to window and all subwindows. Returns True if more
7236 idle time is requested.
7238 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
7240 def IsActive(*args
, **kwargs
):
7242 IsActive(self) -> bool
7244 Return True if our app has focus.
7246 return _core_
.PyApp_IsActive(*args
, **kwargs
)
7248 def SetTopWindow(*args
, **kwargs
):
7250 SetTopWindow(self, Window win)
7252 Set the *main* top level window
7254 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
7256 def GetTopWindow(*args
, **kwargs
):
7258 GetTopWindow(self) -> Window
7260 Return the *main* top level window (if it hadn't been set previously
7261 with SetTopWindow(), will return just some top level window and, if
7262 there not any, will return None)
7264 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
7266 def SetExitOnFrameDelete(*args
, **kwargs
):
7268 SetExitOnFrameDelete(self, bool flag)
7270 Control the exit behaviour: by default, the program will exit the main
7271 loop (and so, usually, terminate) when the last top-level program
7272 window is deleted. Beware that if you disable this behaviour (with
7273 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7274 explicitly from somewhere.
7276 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
7278 def GetExitOnFrameDelete(*args
, **kwargs
):
7280 GetExitOnFrameDelete(self) -> bool
7282 Get the current exit behaviour setting.
7284 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
7286 def SetUseBestVisual(*args
, **kwargs
):
7288 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
7290 Set whether the app should try to use the best available visual on
7291 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
7293 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
7295 def GetUseBestVisual(*args
, **kwargs
):
7297 GetUseBestVisual(self) -> bool
7299 Get current UseBestVisual setting.
7301 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
7303 def SetPrintMode(*args
, **kwargs
):
7304 """SetPrintMode(self, int mode)"""
7305 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
7307 def GetPrintMode(*args
, **kwargs
):
7308 """GetPrintMode(self) -> int"""
7309 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
7311 def SetAssertMode(*args
, **kwargs
):
7313 SetAssertMode(self, int mode)
7315 Set the OnAssert behaviour for debug and hybrid builds.
7317 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
7319 def GetAssertMode(*args
, **kwargs
):
7321 GetAssertMode(self) -> int
7323 Get the current OnAssert behaviour setting.
7325 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
7327 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7328 """GetMacSupportPCMenuShortcuts() -> bool"""
7329 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7331 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
7332 def GetMacAboutMenuItemId(*args
, **kwargs
):
7333 """GetMacAboutMenuItemId() -> long"""
7334 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
7336 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
7337 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
7338 """GetMacPreferencesMenuItemId() -> long"""
7339 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
7341 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
7342 def GetMacExitMenuItemId(*args
, **kwargs
):
7343 """GetMacExitMenuItemId() -> long"""
7344 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
7346 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
7347 def GetMacHelpMenuTitleName(*args
, **kwargs
):
7348 """GetMacHelpMenuTitleName() -> String"""
7349 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
7351 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
7352 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7353 """SetMacSupportPCMenuShortcuts(bool val)"""
7354 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7356 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
7357 def SetMacAboutMenuItemId(*args
, **kwargs
):
7358 """SetMacAboutMenuItemId(long val)"""
7359 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7361 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
7362 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
7363 """SetMacPreferencesMenuItemId(long val)"""
7364 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7366 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
7367 def SetMacExitMenuItemId(*args
, **kwargs
):
7368 """SetMacExitMenuItemId(long val)"""
7369 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7371 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
7372 def SetMacHelpMenuTitleName(*args
, **kwargs
):
7373 """SetMacHelpMenuTitleName(String val)"""
7374 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7376 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
7377 def _BootstrapApp(*args
, **kwargs
):
7381 For internal use only
7383 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
7385 def GetComCtl32Version(*args
, **kwargs
):
7387 GetComCtl32Version() -> int
7389 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7390 it wasn't found at all. Raises an exception on non-Windows platforms.
7392 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
7394 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
7395 def IsDisplayAvailable(*args
, **kwargs
):
7397 IsDisplayAvailable() -> bool
7399 Tests if it is possible to create a GUI in the current environment.
7400 This will mean different things on the different platforms.
7402 * On X Windows systems this function will return ``False`` if it is
7403 not able to open a connection to the X display, which can happen
7404 if $DISPLAY is not set, or is not set correctly.
7406 * On Mac OS X a ``False`` return value will mean that wx is not
7407 able to access the window manager, which can happen if logged in
7408 remotely or if running from the normal version of python instead
7409 of the framework version, (i.e., pythonw.)
7414 return _core_
.PyApp_IsDisplayAvailable(*args
, **kwargs
)
7416 IsDisplayAvailable
= staticmethod(IsDisplayAvailable
)
7417 AppName
= property(GetAppName
,SetAppName
,doc
="See `GetAppName` and `SetAppName`")
7418 AssertMode
= property(GetAssertMode
,SetAssertMode
,doc
="See `GetAssertMode` and `SetAssertMode`")
7419 ClassName
= property(GetClassName
,SetClassName
,doc
="See `GetClassName` and `SetClassName`")
7420 ExitOnFrameDelete
= property(GetExitOnFrameDelete
,SetExitOnFrameDelete
,doc
="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7421 LayoutDirection
= property(GetLayoutDirection
,doc
="See `GetLayoutDirection`")
7422 PrintMode
= property(GetPrintMode
,SetPrintMode
,doc
="See `GetPrintMode` and `SetPrintMode`")
7423 TopWindow
= property(GetTopWindow
,SetTopWindow
,doc
="See `GetTopWindow` and `SetTopWindow`")
7424 Traits
= property(GetTraits
,doc
="See `GetTraits`")
7425 UseBestVisual
= property(GetUseBestVisual
,SetUseBestVisual
,doc
="See `GetUseBestVisual` and `SetUseBestVisual`")
7426 VendorName
= property(GetVendorName
,SetVendorName
,doc
="See `GetVendorName` and `SetVendorName`")
7427 Active
= property(IsActive
)
7428 _core_
.PyApp_swigregister(PyApp
)
7430 def PyApp_IsMainLoopRunning(*args
):
7432 PyApp_IsMainLoopRunning() -> bool
7434 Returns True if we're running the main loop, i.e. if the events can
7435 currently be dispatched.
7437 return _core_
.PyApp_IsMainLoopRunning(*args
)
7439 def PyApp_GetMacSupportPCMenuShortcuts(*args
):
7440 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7441 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
)
7443 def PyApp_GetMacAboutMenuItemId(*args
):
7444 """PyApp_GetMacAboutMenuItemId() -> long"""
7445 return _core_
.PyApp_GetMacAboutMenuItemId(*args
)
7447 def PyApp_GetMacPreferencesMenuItemId(*args
):
7448 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7449 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
)
7451 def PyApp_GetMacExitMenuItemId(*args
):
7452 """PyApp_GetMacExitMenuItemId() -> long"""
7453 return _core_
.PyApp_GetMacExitMenuItemId(*args
)
7455 def PyApp_GetMacHelpMenuTitleName(*args
):
7456 """PyApp_GetMacHelpMenuTitleName() -> String"""
7457 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
)
7459 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7460 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7461 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7463 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
7464 """PyApp_SetMacAboutMenuItemId(long val)"""
7465 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7467 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
7468 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7469 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7471 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
7472 """PyApp_SetMacExitMenuItemId(long val)"""
7473 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7475 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
7476 """PyApp_SetMacHelpMenuTitleName(String val)"""
7477 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7479 def PyApp_GetComCtl32Version(*args
):
7481 PyApp_GetComCtl32Version() -> int
7483 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7484 it wasn't found at all. Raises an exception on non-Windows platforms.
7486 return _core_
.PyApp_GetComCtl32Version(*args
)
7488 def PyApp_IsDisplayAvailable(*args
):
7490 PyApp_IsDisplayAvailable() -> bool
7492 Tests if it is possible to create a GUI in the current environment.
7493 This will mean different things on the different platforms.
7495 * On X Windows systems this function will return ``False`` if it is
7496 not able to open a connection to the X display, which can happen
7497 if $DISPLAY is not set, or is not set correctly.
7499 * On Mac OS X a ``False`` return value will mean that wx is not
7500 able to access the window manager, which can happen if logged in
7501 remotely or if running from the normal version of python instead
7502 of the framework version, (i.e., pythonw.)
7507 return _core_
.PyApp_IsDisplayAvailable(*args
)
7509 #---------------------------------------------------------------------------
7516 Force an exit of the application. Convenience for wx.GetApp().Exit()
7518 return _core_
.Exit(*args
)
7524 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7526 return _core_
.Yield(*args
)
7528 def YieldIfNeeded(*args
):
7530 YieldIfNeeded() -> bool
7532 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7534 return _core_
.YieldIfNeeded(*args
)
7536 def SafeYield(*args
, **kwargs
):
7538 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7540 This function is similar to `wx.Yield`, except that it disables the
7541 user input to all program windows before calling `wx.Yield` and
7542 re-enables it again afterwards. If ``win`` is not None, this window
7543 will remain enabled, allowing the implementation of some limited user
7546 :Returns: the result of the call to `wx.Yield`.
7548 return _core_
.SafeYield(*args
, **kwargs
)
7550 def WakeUpIdle(*args
):
7554 Cause the message queue to become empty again, so idle events will be
7557 return _core_
.WakeUpIdle(*args
)
7559 def PostEvent(*args
, **kwargs
):
7561 PostEvent(EvtHandler dest, Event event)
7563 Send an event to a window or other wx.EvtHandler to be processed
7566 return _core_
.PostEvent(*args
, **kwargs
)
7568 def App_CleanUp(*args
):
7572 For internal use only, it is used to cleanup after wxWidgets when
7575 return _core_
.App_CleanUp(*args
)
7581 Return a reference to the current wx.App object.
7583 return _core_
.GetApp(*args
)
7585 def SetDefaultPyEncoding(*args
, **kwargs
):
7587 SetDefaultPyEncoding(string encoding)
7589 Sets the encoding that wxPython will use when it needs to convert a
7590 Python string or unicode object to or from a wxString.
7592 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7593 but please be aware that the default encoding within the same locale
7594 may be slightly different on different platforms. For example, please
7595 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7596 between the common latin/roman encodings.
7598 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
7600 def GetDefaultPyEncoding(*args
):
7602 GetDefaultPyEncoding() -> string
7604 Gets the current encoding that wxPython will use when it needs to
7605 convert a Python string or unicode object to or from a wxString.
7607 return _core_
.GetDefaultPyEncoding(*args
)
7608 #----------------------------------------------------------------------
7610 class PyOnDemandOutputWindow
:
7612 A class that can be used for redirecting Python's stdout and
7613 stderr streams. It will do nothing until something is wrriten to
7614 the stream at which point it will create a Frame with a text area
7615 and write the text there.
7617 def __init__(self
, title
= "wxPython: stdout/stderr"):
7620 self
.pos
= wx
.DefaultPosition
7621 self
.size
= (450, 300)
7624 def SetParent(self
, parent
):
7625 """Set the window to be used as the popup Frame's parent."""
7626 self
.parent
= parent
7629 def CreateOutputWindow(self
, st
):
7630 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
7631 style
=wx
.DEFAULT_FRAME_STYLE
)
7632 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
7633 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
7634 self
.text
.AppendText(st
)
7635 self
.frame
.Show(True)
7636 self
.frame
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
7639 def OnCloseWindow(self
, event
):
7640 if self
.frame
is not None:
7641 self
.frame
.Destroy()
7646 # These methods provide the file-like output behaviour.
7647 def write(self
, text
):
7649 Create the output window if needed and write the string to it.
7650 If not called in the context of the gui thread then uses
7651 CallAfter to do the work there.
7653 if self
.frame
is None:
7654 if not wx
.Thread_IsMain():
7655 wx
.CallAfter(self
.CreateOutputWindow
, text
)
7657 self
.CreateOutputWindow(text
)
7659 if not wx
.Thread_IsMain():
7660 wx
.CallAfter(self
.text
.AppendText
, text
)
7662 self
.text
.AppendText(text
)
7666 if self
.frame
is not None:
7667 wx
.CallAfter(self
.frame
.Close
)
7675 #----------------------------------------------------------------------
7677 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
7679 class App(wx
.PyApp
):
7681 The ``wx.App`` class represents the application and is used to:
7683 * bootstrap the wxPython system and initialize the underlying
7685 * set and get application-wide properties
7686 * implement the windowing system main message or event loop,
7687 and to dispatch events to window instances
7690 Every application must have a ``wx.App`` instance, and all
7691 creation of UI objects should be delayed until after the
7692 ``wx.App`` object has been created in order to ensure that the gui
7693 platform and wxWidgets have been fully initialized.
7695 Normally you would derive from this class and implement an
7696 ``OnInit`` method that creates a frame and then calls
7697 ``self.SetTopWindow(frame)``.
7699 :see: `wx.PySimpleApp` for a simpler app class that can be used
7703 outputWindowClass
= PyOnDemandOutputWindow
7705 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7706 useBestVisual
=False, clearSigInt
=True):
7708 Construct a ``wx.App`` object.
7710 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7711 redirected? Defaults to True on Windows and Mac, False
7712 otherwise. If `filename` is None then output will be
7713 redirected to a window that pops up as needed. (You can
7714 control what kind of window is created for the output by
7715 resetting the class variable ``outputWindowClass`` to a
7716 class of your choosing.)
7718 :param filename: The name of a file to redirect output to, if
7721 :param useBestVisual: Should the app try to use the best
7722 available visual provided by the system (only relevant on
7723 systems that have more than one visual.) This parameter
7724 must be used instead of calling `SetUseBestVisual` later
7725 on because it must be set before the underlying GUI
7726 toolkit is initialized.
7728 :param clearSigInt: Should SIGINT be cleared? This allows the
7729 app to terminate upon a Ctrl-C in the console like other
7732 :note: You should override OnInit to do applicaition
7733 initialization to ensure that the system, toolkit and
7734 wxWidgets are fully initialized.
7737 wx
.PyApp
.__init
__(self
)
7739 # make sure we can create a GUI
7740 if not self
.IsDisplayAvailable():
7742 if wx
.Platform
== "__WXMAC__":
7743 msg
= """This program needs access to the screen.
7744 Please run with 'pythonw', not 'python', and only when you are logged
7745 in on the main display of your Mac."""
7747 elif wx
.Platform
== "__WXGTK__":
7748 msg
="Unable to access the X Display, is $DISPLAY set properly?"
7751 msg
= "Unable to create GUI"
7752 # TODO: more description is needed for wxMSW...
7754 raise SystemExit(msg
)
7756 # This has to be done before OnInit
7757 self
.SetUseBestVisual(useBestVisual
)
7759 # Set the default handler for SIGINT. This fixes a problem
7760 # where if Ctrl-C is pressed in the console that started this
7761 # app then it will not appear to do anything, (not even send
7762 # KeyboardInterrupt???) but will later segfault on exit. By
7763 # setting the default handler then the app will exit, as
7764 # expected (depending on platform.)
7768 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7772 # Save and redirect the stdio to a window?
7773 self
.stdioWin
= None
7774 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7776 self
.RedirectStdio(filename
)
7778 # Use Python's install prefix as the default
7779 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7781 # Until the new native control for wxMac is up to par, still use the generic one.
7782 wx
.SystemOptions
.SetOptionInt("mac.listctrl.always_use_generic", 1)
7784 # This finishes the initialization of wxWindows and then calls
7785 # the OnInit that should be present in the derived class
7786 self
._BootstrapApp
()
7789 def OnPreInit(self
):
7791 Things that must be done after _BootstrapApp has done its
7792 thing, but would be nice if they were already done by the time
7793 that OnInit is called.
7795 wx
.StockGDI
._initStockObjects
()
7798 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7799 self
.RestoreStdio() # Just in case the MainLoop was overridden
7803 self
.this
.own(False)
7804 wx
.PyApp
.Destroy(self
)
7806 def SetTopWindow(self
, frame
):
7807 """Set the \"main\" top level window"""
7809 self
.stdioWin
.SetParent(frame
)
7810 wx
.PyApp
.SetTopWindow(self
, frame
)
7814 """Execute the main GUI event loop"""
7815 wx
.PyApp
.MainLoop(self
)
7819 def RedirectStdio(self
, filename
=None):
7820 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7822 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7824 self
.stdioWin
= self
.outputWindowClass()
7825 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7828 def RestoreStdio(self
):
7830 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7835 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7837 Set the title, position and/or size of the output window if
7838 the stdio has been redirected. This should be called before
7839 any output would cause the output window to be created.
7842 if title
is not None:
7843 self
.stdioWin
.title
= title
7845 self
.stdioWin
.pos
= pos
7846 if size
is not None:
7847 self
.stdioWin
.size
= size
7852 # change from wx.PyApp_XX to wx.App_XX
7853 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7854 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7855 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7856 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7857 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7858 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7859 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7860 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7861 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7862 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7863 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7865 #----------------------------------------------------------------------------
7867 class PySimpleApp(wx
.App
):
7869 A simple application class. You can just create one of these and
7870 then then make your top level windows later, and not have to worry
7871 about OnInit. For example::
7873 app = wx.PySimpleApp()
7874 frame = wx.Frame(None, title='Hello World')
7881 def __init__(self
, redirect
=False, filename
=None,
7882 useBestVisual
=False, clearSigInt
=True):
7884 :see: `wx.App.__init__`
7886 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7893 # Is anybody using this one?
7894 class PyWidgetTester(wx
.App
):
7895 def __init__(self
, size
= (250, 100)):
7897 wx
.App
.__init
__(self
, 0)
7900 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7901 self
.SetTopWindow(self
.frame
)
7904 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7905 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7906 self
.frame
.Show(True)
7908 #----------------------------------------------------------------------------
7909 # DO NOT hold any other references to this object. This is how we
7910 # know when to cleanup system resources that wxWidgets is holding. When
7911 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7912 # goes to zero and it calls the wx.App_CleanUp function.
7914 class __wxPyCleanup
:
7916 self
.cleanup
= _core_
.App_CleanUp
7920 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7922 ## # another possible solution, but it gets called too early...
7924 ## atexit.register(_core_.wxApp_CleanUp)
7927 #----------------------------------------------------------------------------
7929 #---------------------------------------------------------------------------
7931 class EventLoop(object):
7932 """Proxy of C++ EventLoop class"""
7933 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7934 __repr__
= _swig_repr
7935 def __init__(self
, *args
, **kwargs
):
7936 """__init__(self) -> EventLoop"""
7937 _core_
.EventLoop_swiginit(self
,_core_
.new_EventLoop(*args
, **kwargs
))
7938 __swig_destroy__
= _core_
.delete_EventLoop
7939 __del__
= lambda self
: None;
7940 def Run(*args
, **kwargs
):
7941 """Run(self) -> int"""
7942 return _core_
.EventLoop_Run(*args
, **kwargs
)
7944 def Exit(*args
, **kwargs
):
7945 """Exit(self, int rc=0)"""
7946 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7948 def Pending(*args
, **kwargs
):
7949 """Pending(self) -> bool"""
7950 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7952 def Dispatch(*args
, **kwargs
):
7953 """Dispatch(self) -> bool"""
7954 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7956 def IsRunning(*args
, **kwargs
):
7957 """IsRunning(self) -> bool"""
7958 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7960 def GetActive(*args
, **kwargs
):
7961 """GetActive() -> EventLoop"""
7962 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7964 GetActive
= staticmethod(GetActive
)
7965 def SetActive(*args
, **kwargs
):
7966 """SetActive(EventLoop loop)"""
7967 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7969 SetActive
= staticmethod(SetActive
)
7970 _core_
.EventLoop_swigregister(EventLoop
)
7972 def EventLoop_GetActive(*args
):
7973 """EventLoop_GetActive() -> EventLoop"""
7974 return _core_
.EventLoop_GetActive(*args
)
7976 def EventLoop_SetActive(*args
, **kwargs
):
7977 """EventLoop_SetActive(EventLoop loop)"""
7978 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7980 class EventLoopActivator(object):
7981 """Proxy of C++ EventLoopActivator class"""
7982 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7983 __repr__
= _swig_repr
7984 def __init__(self
, *args
, **kwargs
):
7985 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7986 _core_
.EventLoopActivator_swiginit(self
,_core_
.new_EventLoopActivator(*args
, **kwargs
))
7987 __swig_destroy__
= _core_
.delete_EventLoopActivator
7988 __del__
= lambda self
: None;
7989 _core_
.EventLoopActivator_swigregister(EventLoopActivator
)
7991 #---------------------------------------------------------------------------
7993 ACCEL_ALT
= _core_
.ACCEL_ALT
7994 ACCEL_CTRL
= _core_
.ACCEL_CTRL
7995 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
7996 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
7997 ACCEL_CMD
= _core_
.ACCEL_CMD
7998 class AcceleratorEntry(object):
8000 A class used to define items in an `wx.AcceleratorTable`. wxPython
8001 programs can choose to use wx.AcceleratorEntry objects, but using a
8002 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
8003 as well. See `__init__` for of the tuple values.
8005 :see: `wx.AcceleratorTable`
8007 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8008 __repr__
= _swig_repr
8009 def __init__(self
, *args
, **kwargs
):
8011 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
8013 Construct a wx.AcceleratorEntry.
8015 _core_
.AcceleratorEntry_swiginit(self
,_core_
.new_AcceleratorEntry(*args
, **kwargs
))
8016 __swig_destroy__
= _core_
.delete_AcceleratorEntry
8017 __del__
= lambda self
: None;
8018 def Set(*args
, **kwargs
):
8020 Set(self, int flags, int keyCode, int cmd)
8022 (Re)set the attributes of a wx.AcceleratorEntry.
8025 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
8027 def Create(*args
, **kwargs
):
8029 Create(String str) -> AcceleratorEntry
8031 Create accelerator corresponding to the specified string, or None if
8032 it coulnd't be parsed.
8034 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
8036 Create
= staticmethod(Create
)
8037 def GetFlags(*args
, **kwargs
):
8039 GetFlags(self) -> int
8041 Get the AcceleratorEntry's flags.
8043 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
8045 def GetKeyCode(*args
, **kwargs
):
8047 GetKeyCode(self) -> int
8049 Get the AcceleratorEntry's keycode.
8051 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
8053 def GetCommand(*args
, **kwargs
):
8055 GetCommand(self) -> int
8057 Get the AcceleratorEntry's command ID.
8059 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
8061 def IsOk(*args
, **kwargs
):
8062 """IsOk(self) -> bool"""
8063 return _core_
.AcceleratorEntry_IsOk(*args
, **kwargs
)
8065 def ToString(*args
, **kwargs
):
8067 ToString(self) -> String
8069 Returns a string representation for the this accelerator. The string
8070 is formatted using the <flags>-<keycode> format where <flags> maybe a
8071 hyphen-separed list of "shift|alt|ctrl"
8074 return _core_
.AcceleratorEntry_ToString(*args
, **kwargs
)
8076 def FromString(*args
, **kwargs
):
8078 FromString(self, String str) -> bool
8080 Returns true if the given string correctly initialized this object.
8082 return _core_
.AcceleratorEntry_FromString(*args
, **kwargs
)
8084 Command
= property(GetCommand
,doc
="See `GetCommand`")
8085 Flags
= property(GetFlags
,doc
="See `GetFlags`")
8086 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
8087 _core_
.AcceleratorEntry_swigregister(AcceleratorEntry
)
8089 def AcceleratorEntry_Create(*args
, **kwargs
):
8091 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8093 Create accelerator corresponding to the specified string, or None if
8094 it coulnd't be parsed.
8096 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
8098 class AcceleratorTable(Object
):
8100 An accelerator table allows the application to specify a table of
8101 keyboard shortcuts for menus or other commands. On Windows, menu or
8102 button commands are supported; on GTK, only menu commands are
8105 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8106 __repr__
= _swig_repr
8107 def __init__(self
, *args
, **kwargs
):
8109 __init__(entries) -> AcceleratorTable
8111 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8112 items or or of 3-tuples (flags, keyCode, cmdID)
8114 :see: `wx.AcceleratorEntry`
8116 _core_
.AcceleratorTable_swiginit(self
,_core_
.new_AcceleratorTable(*args
, **kwargs
))
8117 __swig_destroy__
= _core_
.delete_AcceleratorTable
8118 __del__
= lambda self
: None;
8119 def IsOk(*args
, **kwargs
):
8120 """IsOk(self) -> bool"""
8121 return _core_
.AcceleratorTable_IsOk(*args
, **kwargs
)
8124 _core_
.AcceleratorTable_swigregister(AcceleratorTable
)
8126 def GetAccelFromString(label
):
8127 entry
= AcceleratorEntry()
8128 entry
.FromString(label
)
8131 #---------------------------------------------------------------------------
8133 class VisualAttributes(object):
8134 """struct containing all the visual attributes of a control"""
8135 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8136 __repr__
= _swig_repr
8137 def __init__(self
, *args
, **kwargs
):
8139 __init__(self) -> VisualAttributes
8141 struct containing all the visual attributes of a control
8143 _core_
.VisualAttributes_swiginit(self
,_core_
.new_VisualAttributes(*args
, **kwargs
))
8144 __swig_destroy__
= _core_
.delete_VisualAttributes
8145 __del__
= lambda self
: None;
8146 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
8147 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
8148 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
8149 _core_
.VisualAttributes_swigregister(VisualAttributes
)
8150 NullAcceleratorTable
= cvar
.NullAcceleratorTable
8151 PanelNameStr
= cvar
.PanelNameStr
8153 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
8154 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
8155 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
8156 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
8157 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
8158 class Window(EvtHandler
):
8160 wx.Window is the base class for all windows and represents any visible
8161 object on the screen. All controls, top level windows and so on are
8162 wx.Windows. Sizers and device contexts are not however, as they don't
8163 appear on screen themselves.
8166 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8167 __repr__
= _swig_repr
8168 def __init__(self
, *args
, **kwargs
):
8170 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8171 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
8173 Construct and show a generic Window.
8175 _core_
.Window_swiginit(self
,_core_
.new_Window(*args
, **kwargs
))
8176 self
._setOORInfo
(self
)
8178 def Create(*args
, **kwargs
):
8180 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8181 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
8183 Create the GUI part of the Window for 2-phase creation mode.
8185 return _core_
.Window_Create(*args
, **kwargs
)
8187 def Close(*args
, **kwargs
):
8189 Close(self, bool force=False) -> bool
8191 This function simply generates a EVT_CLOSE event whose handler usually
8192 tries to close the window. It doesn't close the window itself,
8193 however. If force is False (the default) then the window's close
8194 handler will be allowed to veto the destruction of the window.
8196 return _core_
.Window_Close(*args
, **kwargs
)
8198 def Destroy(*args
, **kwargs
):
8200 Destroy(self) -> bool
8202 Destroys the window safely. Frames and dialogs are not destroyed
8203 immediately when this function is called -- they are added to a list
8204 of windows to be deleted on idle time, when all the window's events
8205 have been processed. This prevents problems with events being sent to
8206 non-existent windows.
8208 Returns True if the window has either been successfully deleted, or it
8209 has been added to the list of windows pending real deletion.
8211 args
[0].this
.own(False)
8212 return _core_
.Window_Destroy(*args
, **kwargs
)
8214 def DestroyChildren(*args
, **kwargs
):
8216 DestroyChildren(self) -> bool
8218 Destroys all children of a window. Called automatically by the
8221 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
8223 def IsBeingDeleted(*args
, **kwargs
):
8225 IsBeingDeleted(self) -> bool
8227 Is the window in the process of being deleted?
8229 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
8231 def SetLabel(*args
, **kwargs
):
8233 SetLabel(self, String label)
8235 Set the text which the window shows in its label if applicable.
8237 return _core_
.Window_SetLabel(*args
, **kwargs
)
8239 def GetLabel(*args
, **kwargs
):
8241 GetLabel(self) -> String
8243 Generic way of getting a label from any window, for identification
8244 purposes. The interpretation of this function differs from class to
8245 class. For frames and dialogs, the value returned is the title. For
8246 buttons or static text controls, it is the button text. This function
8247 can be useful for meta-programs such as testing tools or special-needs
8248 access programs)which need to identify windows by name.
8250 return _core_
.Window_GetLabel(*args
, **kwargs
)
8252 def SetName(*args
, **kwargs
):
8254 SetName(self, String name)
8256 Sets the window's name. The window name is used for ressource setting
8257 in X, it is not the same as the window title/label
8259 return _core_
.Window_SetName(*args
, **kwargs
)
8261 def GetName(*args
, **kwargs
):
8263 GetName(self) -> String
8265 Returns the windows name. This name is not guaranteed to be unique;
8266 it is up to the programmer to supply an appropriate name in the window
8267 constructor or via wx.Window.SetName.
8269 return _core_
.Window_GetName(*args
, **kwargs
)
8271 def SetWindowVariant(*args
, **kwargs
):
8273 SetWindowVariant(self, int variant)
8275 Sets the variant of the window/font size to use for this window, if
8276 the platform supports variants, for example, wxMac.
8278 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
8280 def GetWindowVariant(*args
, **kwargs
):
8281 """GetWindowVariant(self) -> int"""
8282 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
8284 def SetId(*args
, **kwargs
):
8286 SetId(self, int winid)
8288 Sets the identifier of the window. Each window has an integer
8289 identifier. If the application has not provided one, an identifier
8290 will be generated. Normally, the identifier should be provided on
8291 creation and should not be modified subsequently.
8293 return _core_
.Window_SetId(*args
, **kwargs
)
8295 def GetId(*args
, **kwargs
):
8299 Returns the identifier of the window. Each window has an integer
8300 identifier. If the application has not provided one (or the default Id
8301 -1 is used) then an unique identifier with a negative value will be
8304 return _core_
.Window_GetId(*args
, **kwargs
)
8306 def NewControlId(*args
, **kwargs
):
8308 NewControlId() -> int
8310 Generate a control id for the controls which were not given one.
8312 return _core_
.Window_NewControlId(*args
, **kwargs
)
8314 NewControlId
= staticmethod(NewControlId
)
8315 def NextControlId(*args
, **kwargs
):
8317 NextControlId(int winid) -> int
8319 Get the id of the control following the one with the given
8322 return _core_
.Window_NextControlId(*args
, **kwargs
)
8324 NextControlId
= staticmethod(NextControlId
)
8325 def PrevControlId(*args
, **kwargs
):
8327 PrevControlId(int winid) -> int
8329 Get the id of the control preceding the one with the given
8332 return _core_
.Window_PrevControlId(*args
, **kwargs
)
8334 PrevControlId
= staticmethod(PrevControlId
)
8335 def GetLayoutDirection(*args
, **kwargs
):
8337 GetLayoutDirection(self) -> int
8339 Get the layout direction (LTR or RTL) for this window. Returns
8340 ``wx.Layout_Default`` if layout direction is not supported.
8342 return _core_
.Window_GetLayoutDirection(*args
, **kwargs
)
8344 def SetLayoutDirection(*args
, **kwargs
):
8346 SetLayoutDirection(self, int dir)
8348 Set the layout direction (LTR or RTL) for this window.
8350 return _core_
.Window_SetLayoutDirection(*args
, **kwargs
)
8352 def AdjustForLayoutDirection(*args
, **kwargs
):
8354 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8356 Mirror coordinates for RTL layout if this window uses it and if the
8357 mirroring is not done automatically like Win32.
8359 return _core_
.Window_AdjustForLayoutDirection(*args
, **kwargs
)
8361 def SetSize(*args
, **kwargs
):
8363 SetSize(self, Size size)
8365 Sets the size of the window in pixels.
8367 return _core_
.Window_SetSize(*args
, **kwargs
)
8369 def SetDimensions(*args
, **kwargs
):
8371 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8373 Sets the position and size of the window in pixels. The sizeFlags
8374 parameter indicates the interpretation of the other params if they are
8377 ======================== ======================================
8378 wx.SIZE_AUTO A -1 indicates that a class-specific
8379 default should be used.
8380 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8381 -1 values are supplied.
8382 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8383 interpreted as real dimensions, not
8385 ======================== ======================================
8388 return _core_
.Window_SetDimensions(*args
, **kwargs
)
8390 def SetRect(*args
, **kwargs
):
8392 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8394 Sets the position and size of the window in pixels using a wx.Rect.
8396 return _core_
.Window_SetRect(*args
, **kwargs
)
8398 def SetSizeWH(*args
, **kwargs
):
8400 SetSizeWH(self, int width, int height)
8402 Sets the size of the window in pixels.
8404 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
8406 def Move(*args
, **kwargs
):
8408 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8410 Moves the window to the given position.
8412 return _core_
.Window_Move(*args
, **kwargs
)
8415 def MoveXY(*args
, **kwargs
):
8417 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8419 Moves the window to the given position.
8421 return _core_
.Window_MoveXY(*args
, **kwargs
)
8423 def SetInitialSize(*args
, **kwargs
):
8425 SetInitialSize(self, Size size=DefaultSize)
8427 A 'Smart' SetSize that will fill in default size components with the
8428 window's *best size* values. Also set's the minsize for use with sizers.
8430 return _core_
.Window_SetInitialSize(*args
, **kwargs
)
8432 SetBestFittingSize
= wx
._deprecated
(SetInitialSize
, 'Use `SetInitialSize`')
8433 def Raise(*args
, **kwargs
):
8437 Raises the window to the top of the window hierarchy. In current
8438 version of wxWidgets this works both for managed and child windows.
8440 return _core_
.Window_Raise(*args
, **kwargs
)
8442 def Lower(*args
, **kwargs
):
8446 Lowers the window to the bottom of the window hierarchy. In current
8447 version of wxWidgets this works both for managed and child windows.
8449 return _core_
.Window_Lower(*args
, **kwargs
)
8451 def SetClientSize(*args
, **kwargs
):
8453 SetClientSize(self, Size size)
8455 This sets the size of the window client area in pixels. Using this
8456 function to size a window tends to be more device-independent than
8457 wx.Window.SetSize, since the application need not worry about what
8458 dimensions the border or title bar have when trying to fit the window
8459 around panel items, for example.
8461 return _core_
.Window_SetClientSize(*args
, **kwargs
)
8463 def SetClientSizeWH(*args
, **kwargs
):
8465 SetClientSizeWH(self, int width, int height)
8467 This sets the size of the window client area in pixels. Using this
8468 function to size a window tends to be more device-independent than
8469 wx.Window.SetSize, since the application need not worry about what
8470 dimensions the border or title bar have when trying to fit the window
8471 around panel items, for example.
8473 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
8475 def SetClientRect(*args
, **kwargs
):
8477 SetClientRect(self, Rect rect)
8479 This sets the size of the window client area in pixels. Using this
8480 function to size a window tends to be more device-independent than
8481 wx.Window.SetSize, since the application need not worry about what
8482 dimensions the border or title bar have when trying to fit the window
8483 around panel items, for example.
8485 return _core_
.Window_SetClientRect(*args
, **kwargs
)
8487 def GetPosition(*args
, **kwargs
):
8489 GetPosition(self) -> Point
8491 Get the window's position. Notice that the position is in client
8492 coordinates for child windows and screen coordinates for the top level
8493 ones, use `GetScreenPosition` if you need screen coordinates for all
8496 return _core_
.Window_GetPosition(*args
, **kwargs
)
8498 def GetPositionTuple(*args
, **kwargs
):
8500 GetPositionTuple() -> (x,y)
8502 Get the window's position. Notice that the position is in client
8503 coordinates for child windows and screen coordinates for the top level
8504 ones, use `GetScreenPosition` if you need screen coordinates for all
8507 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
8509 def GetScreenPosition(*args
, **kwargs
):
8511 GetScreenPosition(self) -> Point
8513 Get the position of the window in screen coordinantes.
8515 return _core_
.Window_GetScreenPosition(*args
, **kwargs
)
8517 def GetScreenPositionTuple(*args
, **kwargs
):
8519 GetScreenPositionTuple() -> (x,y)
8521 Get the position of the window in screen coordinantes.
8523 return _core_
.Window_GetScreenPositionTuple(*args
, **kwargs
)
8525 def GetScreenRect(*args
, **kwargs
):
8527 GetScreenRect(self) -> Rect
8529 Returns the size and position of the window in screen coordinantes as
8532 return _core_
.Window_GetScreenRect(*args
, **kwargs
)
8534 def GetSize(*args
, **kwargs
):
8536 GetSize(self) -> Size
8538 Get the window size.
8540 return _core_
.Window_GetSize(*args
, **kwargs
)
8542 def GetSizeTuple(*args
, **kwargs
):
8544 GetSizeTuple() -> (width, height)
8546 Get the window size.
8548 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
8550 def GetRect(*args
, **kwargs
):
8552 GetRect(self) -> Rect
8554 Returns the size and position of the window as a `wx.Rect` object.
8556 return _core_
.Window_GetRect(*args
, **kwargs
)
8558 def GetClientSize(*args
, **kwargs
):
8560 GetClientSize(self) -> Size
8562 This gets the size of the window's 'client area' in pixels. The client
8563 area is the area which may be drawn on by the programmer, excluding
8564 title bar, border, scrollbars, etc.
8566 return _core_
.Window_GetClientSize(*args
, **kwargs
)
8568 def GetClientSizeTuple(*args
, **kwargs
):
8570 GetClientSizeTuple() -> (width, height)
8572 This gets the size of the window's 'client area' in pixels. The client
8573 area is the area which may be drawn on by the programmer, excluding
8574 title bar, border, scrollbars, etc.
8576 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
8578 def GetClientAreaOrigin(*args
, **kwargs
):
8580 GetClientAreaOrigin(self) -> Point
8582 Get the origin of the client area of the window relative to the
8583 window's top left corner (the client area may be shifted because of
8584 the borders, scrollbars, other decorations...)
8586 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
8588 def GetClientRect(*args
, **kwargs
):
8590 GetClientRect(self) -> Rect
8592 Get the client area position and size as a `wx.Rect` object.
8594 return _core_
.Window_GetClientRect(*args
, **kwargs
)
8596 def GetBestSize(*args
, **kwargs
):
8598 GetBestSize(self) -> Size
8600 This function returns the best acceptable minimal size for the
8601 window, if applicable. For example, for a static text control, it will
8602 be the minimal size such that the control label is not truncated. For
8603 windows containing subwindows (suzh aswx.Panel), the size returned by
8604 this function will be the same as the size the window would have had
8607 return _core_
.Window_GetBestSize(*args
, **kwargs
)
8609 def GetBestSizeTuple(*args
, **kwargs
):
8611 GetBestSizeTuple() -> (width, height)
8613 This function returns the best acceptable minimal size for the
8614 window, if applicable. For example, for a static text control, it will
8615 be the minimal size such that the control label is not truncated. For
8616 windows containing subwindows (suzh aswx.Panel), the size returned by
8617 this function will be the same as the size the window would have had
8620 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
8622 def InvalidateBestSize(*args
, **kwargs
):
8624 InvalidateBestSize(self)
8626 Reset the cached best size value so it will be recalculated the next
8629 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
8631 def CacheBestSize(*args
, **kwargs
):
8633 CacheBestSize(self, Size size)
8635 Cache the best size so it doesn't need to be calculated again, (at least until
8636 some properties of the window change.)
8638 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
8640 def GetEffectiveMinSize(*args
, **kwargs
):
8642 GetEffectiveMinSize(self) -> Size
8644 This function will merge the window's best size into the window's
8645 minimum size, giving priority to the min size components, and returns
8649 return _core_
.Window_GetEffectiveMinSize(*args
, **kwargs
)
8651 GetBestFittingSize
= wx
._deprecated
(GetEffectiveMinSize
, 'Use `GetEffectiveMinSize` instead.')
8652 def GetAdjustedBestSize(self
):
8653 s
= self
.GetBestSize()
8654 return wx
.Size(max(s
.width
, self
.GetMinWidth()),
8655 max(s
.height
, self
.GetMinHeight()))
8656 GetAdjustedBestSize
= wx
._deprecated
(GetAdjustedBestSize
, 'Use `GetEffectiveMinSize` instead.')
8658 def Center(*args
, **kwargs
):
8660 Center(self, int direction=BOTH)
8662 Centers the window. The parameter specifies the direction for
8663 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8664 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8665 on the entire screen and not on its parent window. If it is a
8666 top-level window and has no parent then it will always be centered
8667 relative to the screen.
8669 return _core_
.Window_Center(*args
, **kwargs
)
8672 def CenterOnParent(*args
, **kwargs
):
8674 CenterOnParent(self, int dir=BOTH)
8676 Center with respect to the the parent window
8678 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
8680 CentreOnParent
= CenterOnParent
8681 def Fit(*args
, **kwargs
):
8685 Sizes the window so that it fits around its subwindows. This function
8686 won't do anything if there are no subwindows and will only really work
8687 correctly if sizers are used for the subwindows layout. Also, if the
8688 window has exactly one subwindow it is better (faster and the result
8689 is more precise as Fit adds some margin to account for fuzziness of
8690 its calculations) to call window.SetClientSize(child.GetSize())
8691 instead of calling Fit.
8693 return _core_
.Window_Fit(*args
, **kwargs
)
8695 def FitInside(*args
, **kwargs
):
8699 Similar to Fit, but sizes the interior (virtual) size of a
8700 window. Mainly useful with scrolled windows to reset scrollbars after
8701 sizing changes that do not trigger a size event, and/or scrolled
8702 windows without an interior sizer. This function similarly won't do
8703 anything if there are no subwindows.
8705 return _core_
.Window_FitInside(*args
, **kwargs
)
8707 def SetSizeHints(*args
, **kwargs
):
8709 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8712 Allows specification of minimum and maximum window sizes, and window
8713 size increments. If a pair of values is not set (or set to -1), the
8714 default values will be used. If this function is called, the user
8715 will not be able to size the window outside the given bounds (if it is
8716 a top-level window.) Sizers will also inspect the minimum window size
8717 and will use that value if set when calculating layout.
8719 The resizing increments are only significant under Motif or Xt.
8721 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
8723 def SetSizeHintsSz(*args
, **kwargs
):
8725 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8727 Allows specification of minimum and maximum window sizes, and window
8728 size increments. If a pair of values is not set (or set to -1), the
8729 default values will be used. If this function is called, the user
8730 will not be able to size the window outside the given bounds (if it is
8731 a top-level window.) Sizers will also inspect the minimum window size
8732 and will use that value if set when calculating layout.
8734 The resizing increments are only significant under Motif or Xt.
8736 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
8738 def SetVirtualSizeHints(*args
, **kwargs
):
8740 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8742 Allows specification of minimum and maximum virtual window sizes. If a
8743 pair of values is not set (or set to -1), the default values will be
8744 used. If this function is called, the user will not be able to size
8745 the virtual area of the window outside the given bounds.
8747 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
8749 def SetVirtualSizeHintsSz(*args
, **kwargs
):
8751 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8753 Allows specification of minimum and maximum virtual window sizes. If a
8754 pair of values is not set (or set to -1), the default values will be
8755 used. If this function is called, the user will not be able to size
8756 the virtual area of the window outside the given bounds.
8758 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
8760 def GetMaxSize(*args
, **kwargs
):
8761 """GetMaxSize(self) -> Size"""
8762 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8764 def GetMinSize(*args
, **kwargs
):
8765 """GetMinSize(self) -> Size"""
8766 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8768 def SetMinSize(*args
, **kwargs
):
8770 SetMinSize(self, Size minSize)
8772 A more convenient method than `SetSizeHints` for setting just the
8775 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8777 def SetMaxSize(*args
, **kwargs
):
8779 SetMaxSize(self, Size maxSize)
8781 A more convenient method than `SetSizeHints` for setting just the
8784 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8786 def GetMinWidth(*args
, **kwargs
):
8787 """GetMinWidth(self) -> int"""
8788 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8790 def GetMinHeight(*args
, **kwargs
):
8791 """GetMinHeight(self) -> int"""
8792 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8794 def GetMaxWidth(*args
, **kwargs
):
8795 """GetMaxWidth(self) -> int"""
8796 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8798 def GetMaxHeight(*args
, **kwargs
):
8799 """GetMaxHeight(self) -> int"""
8800 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8802 def SetVirtualSize(*args
, **kwargs
):
8804 SetVirtualSize(self, Size size)
8806 Set the the virtual size of a window in pixels. For most windows this
8807 is just the client area of the window, but for some like scrolled
8808 windows it is more or less independent of the screen window size.
8810 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8812 def SetVirtualSizeWH(*args
, **kwargs
):
8814 SetVirtualSizeWH(self, int w, int h)
8816 Set the the virtual size of a window in pixels. For most windows this
8817 is just the client area of the window, but for some like scrolled
8818 windows it is more or less independent of the screen window size.
8820 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8822 def GetVirtualSize(*args
, **kwargs
):
8824 GetVirtualSize(self) -> Size
8826 Get the the virtual size of the window in pixels. For most windows
8827 this is just the client area of the window, but for some like scrolled
8828 windows it is more or less independent of the screen window size.
8830 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8832 def GetVirtualSizeTuple(*args
, **kwargs
):
8834 GetVirtualSizeTuple() -> (width, height)
8836 Get the the virtual size of the window in pixels. For most windows
8837 this is just the client area of the window, but for some like scrolled
8838 windows it is more or less independent of the screen window size.
8840 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8842 def GetWindowBorderSize(*args
, **kwargs
):
8844 GetWindowBorderSize(self) -> Size
8846 Return the size of the left/right and top/bottom borders.
8848 return _core_
.Window_GetWindowBorderSize(*args
, **kwargs
)
8850 def GetBestVirtualSize(*args
, **kwargs
):
8852 GetBestVirtualSize(self) -> Size
8854 Return the largest of ClientSize and BestSize (as determined by a
8855 sizer, interior children, or other means)
8857 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8859 def Show(*args
, **kwargs
):
8861 Show(self, bool show=True) -> bool
8863 Shows or hides the window. You may need to call Raise for a top level
8864 window if you want to bring it to top, although this is not needed if
8865 Show is called immediately after the frame creation. Returns True if
8866 the window has been shown or hidden or False if nothing was done
8867 because it already was in the requested state.
8869 return _core_
.Window_Show(*args
, **kwargs
)
8871 def Hide(*args
, **kwargs
):
8875 Equivalent to calling Show(False).
8877 return _core_
.Window_Hide(*args
, **kwargs
)
8879 def Enable(*args
, **kwargs
):
8881 Enable(self, bool enable=True) -> bool
8883 Enable or disable the window for user input. Note that when a parent
8884 window is disabled, all of its children are disabled as well and they
8885 are reenabled again when the parent is. Returns true if the window
8886 has been enabled or disabled, false if nothing was done, i.e. if the
8887 window had already been in the specified state.
8889 return _core_
.Window_Enable(*args
, **kwargs
)
8891 def Disable(*args
, **kwargs
):
8893 Disable(self) -> bool
8895 Disables the window, same as Enable(false).
8897 return _core_
.Window_Disable(*args
, **kwargs
)
8899 def IsShown(*args
, **kwargs
):
8901 IsShown(self) -> bool
8903 Returns true if the window is shown, false if it has been hidden.
8905 return _core_
.Window_IsShown(*args
, **kwargs
)
8907 def IsEnabled(*args
, **kwargs
):
8909 IsEnabled(self) -> bool
8911 Returns true if the window is enabled for input, false otherwise.
8912 This method takes into account the enabled state of parent windows up
8913 to the top-level window.
8915 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8917 def IsThisEnabled(*args
, **kwargs
):
8919 IsThisEnabled(self) -> bool
8921 Returns the internal enabled state independent of the parent(s) state,
8922 i.e. the state in which the window would be if all of its parents are
8923 enabled. Use `IsEnabled` to get the effective window state.
8925 return _core_
.Window_IsThisEnabled(*args
, **kwargs
)
8927 def IsShownOnScreen(*args
, **kwargs
):
8929 IsShownOnScreen(self) -> bool
8931 Returns ``True`` if the window is physically visible on the screen,
8932 i.e. it is shown and all its parents up to the toplevel window are
8935 return _core_
.Window_IsShownOnScreen(*args
, **kwargs
)
8937 def SetWindowStyleFlag(*args
, **kwargs
):
8939 SetWindowStyleFlag(self, long style)
8941 Sets the style of the window. Please note that some styles cannot be
8942 changed after the window creation and that Refresh() might need to be
8943 called after changing the others for the change to take place
8946 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8948 def GetWindowStyleFlag(*args
, **kwargs
):
8950 GetWindowStyleFlag(self) -> long
8952 Gets the window style that was passed to the constructor or Create
8955 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8957 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8958 def HasFlag(*args
, **kwargs
):
8960 HasFlag(self, int flag) -> bool
8962 Test if the given style is set for this window.
8964 return _core_
.Window_HasFlag(*args
, **kwargs
)
8966 def IsRetained(*args
, **kwargs
):
8968 IsRetained(self) -> bool
8970 Returns true if the window is retained, false otherwise. Retained
8971 windows are only available on X platforms.
8973 return _core_
.Window_IsRetained(*args
, **kwargs
)
8975 def ToggleWindowStyle(*args
, **kwargs
):
8977 ToggleWindowStyle(self, int flag) -> bool
8979 Turn the flag on if it had been turned off before and vice versa,
8980 returns True if the flag is turned on by this function call.
8982 return _core_
.Window_ToggleWindowStyle(*args
, **kwargs
)
8984 def SetExtraStyle(*args
, **kwargs
):
8986 SetExtraStyle(self, long exStyle)
8988 Sets the extra style bits for the window. Extra styles are the less
8989 often used style bits which can't be set with the constructor or with
8990 SetWindowStyleFlag()
8992 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8994 def GetExtraStyle(*args
, **kwargs
):
8996 GetExtraStyle(self) -> long
8998 Returns the extra style bits for the window.
9000 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
9002 def MakeModal(*args
, **kwargs
):
9004 MakeModal(self, bool modal=True)
9006 Disables all other windows in the application so that the user can
9007 only interact with this window. Passing False will reverse this
9010 return _core_
.Window_MakeModal(*args
, **kwargs
)
9012 def SetThemeEnabled(*args
, **kwargs
):
9014 SetThemeEnabled(self, bool enableTheme)
9016 This function tells a window if it should use the system's "theme"
9017 code to draw the windows' background instead if its own background
9018 drawing code. This will only have an effect on platforms that support
9019 the notion of themes in user defined windows. One such platform is
9020 GTK+ where windows can have (very colourful) backgrounds defined by a
9021 user's selected theme.
9023 Dialogs, notebook pages and the status bar have this flag set to true
9024 by default so that the default look and feel is simulated best.
9026 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
9028 def GetThemeEnabled(*args
, **kwargs
):
9030 GetThemeEnabled(self) -> bool
9032 Return the themeEnabled flag.
9034 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
9036 def SetFocus(*args
, **kwargs
):
9040 Set's the focus to this window, allowing it to receive keyboard input.
9042 return _core_
.Window_SetFocus(*args
, **kwargs
)
9044 def SetFocusFromKbd(*args
, **kwargs
):
9046 SetFocusFromKbd(self)
9048 Set focus to this window as the result of a keyboard action. Normally
9049 only called internally.
9051 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
9053 def FindFocus(*args
, **kwargs
):
9055 FindFocus() -> Window
9057 Returns the window or control that currently has the keyboard focus,
9060 return _core_
.Window_FindFocus(*args
, **kwargs
)
9062 FindFocus
= staticmethod(FindFocus
)
9063 def AcceptsFocus(*args
, **kwargs
):
9065 AcceptsFocus(self) -> bool
9067 Can this window have focus?
9069 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
9071 def CanAcceptFocus(*args
, **kwargs
):
9073 CanAcceptFocus(self) -> bool
9075 Can this window have focus right now?
9077 return _core_
.Window_CanAcceptFocus(*args
, **kwargs
)
9079 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
9081 AcceptsFocusFromKeyboard(self) -> bool
9083 Can this window be given focus by keyboard navigation? if not, the
9084 only way to give it focus (provided it accepts it at all) is to click
9087 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
9089 def CanAcceptFocusFromKeyboard(*args
, **kwargs
):
9091 CanAcceptFocusFromKeyboard(self) -> bool
9093 Can this window be assigned focus from keyboard right now?
9095 return _core_
.Window_CanAcceptFocusFromKeyboard(*args
, **kwargs
)
9097 def NavigateIn(*args
, **kwargs
):
9099 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9101 Navigates inside this window.
9103 return _core_
.Window_NavigateIn(*args
, **kwargs
)
9105 def Navigate(*args
, **kwargs
):
9107 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9109 Does keyboard navigation starting from this window to another. This is
9110 equivalient to self.GetParent().NavigateIn().
9112 return _core_
.Window_Navigate(*args
, **kwargs
)
9114 def MoveAfterInTabOrder(*args
, **kwargs
):
9116 MoveAfterInTabOrder(self, Window win)
9118 Moves this window in the tab navigation order after the specified
9119 sibling window. This means that when the user presses the TAB key on
9120 that other window, the focus switches to this window.
9122 The default tab order is the same as creation order. This function
9123 and `MoveBeforeInTabOrder` allow to change it after creating all the
9127 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
9129 def MoveBeforeInTabOrder(*args
, **kwargs
):
9131 MoveBeforeInTabOrder(self, Window win)
9133 Same as `MoveAfterInTabOrder` except that it inserts this window just
9134 before win instead of putting it right after it.
9136 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
9138 def GetChildren(*args
, **kwargs
):
9140 GetChildren(self) -> PyObject
9142 Returns a list of the window's children. NOTE: Currently this is a
9143 copy of the child window list maintained by the window, so the return
9144 value of this function is only valid as long as the window's children
9147 return _core_
.Window_GetChildren(*args
, **kwargs
)
9149 def GetParent(*args
, **kwargs
):
9151 GetParent(self) -> Window
9153 Returns the parent window of this window, or None if there isn't one.
9155 return _core_
.Window_GetParent(*args
, **kwargs
)
9157 def GetGrandParent(*args
, **kwargs
):
9159 GetGrandParent(self) -> Window
9161 Returns the parent of the parent of this window, or None if there
9164 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
9166 def GetTopLevelParent(*args
, **kwargs
):
9168 GetTopLevelParent(self) -> Window
9170 Returns the first frame or dialog in this window's parental hierarchy.
9172 return _core_
.Window_GetTopLevelParent(*args
, **kwargs
)
9174 def IsTopLevel(*args
, **kwargs
):
9176 IsTopLevel(self) -> bool
9178 Returns true if the given window is a top-level one. Currently all
9179 frames and dialogs are always considered to be top-level windows (even
9180 if they have a parent window).
9182 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
9184 def Reparent(*args
, **kwargs
):
9186 Reparent(self, Window newParent) -> bool
9188 Reparents the window, i.e the window will be removed from its current
9189 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9190 re-inserted into another. Available on Windows and GTK. Returns True
9191 if the parent was changed, False otherwise (error or newParent ==
9194 return _core_
.Window_Reparent(*args
, **kwargs
)
9196 def AddChild(*args
, **kwargs
):
9198 AddChild(self, Window child)
9200 Adds a child window. This is called automatically by window creation
9201 functions so should not be required by the application programmer.
9203 return _core_
.Window_AddChild(*args
, **kwargs
)
9205 def RemoveChild(*args
, **kwargs
):
9207 RemoveChild(self, Window child)
9209 Removes a child window. This is called automatically by window
9210 deletion functions so should not be required by the application
9213 return _core_
.Window_RemoveChild(*args
, **kwargs
)
9215 def SetDoubleBuffered(*args
, **kwargs
):
9217 SetDoubleBuffered(self, bool on)
9219 Currently wxGTK2 only.
9221 return _core_
.Window_SetDoubleBuffered(*args
, **kwargs
)
9223 def FindWindowById(*args
, **kwargs
):
9225 FindWindowById(self, long winid) -> Window
9227 Find a chld of this window by window ID
9229 return _core_
.Window_FindWindowById(*args
, **kwargs
)
9231 def FindWindowByName(*args
, **kwargs
):
9233 FindWindowByName(self, String name) -> Window
9235 Find a child of this window by name
9237 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
9239 def GetEventHandler(*args
, **kwargs
):
9241 GetEventHandler(self) -> EvtHandler
9243 Returns the event handler for this window. By default, the window is
9244 its own event handler.
9246 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
9248 def SetEventHandler(*args
, **kwargs
):
9250 SetEventHandler(self, EvtHandler handler)
9252 Sets the event handler for this window. An event handler is an object
9253 that is capable of processing the events sent to a window. (In other
9254 words, is able to dispatch the events to handler function.) By
9255 default, the window is its own event handler, but an application may
9256 wish to substitute another, for example to allow central
9257 implementation of event-handling for a variety of different window
9260 It is usually better to use `wx.Window.PushEventHandler` since this sets
9261 up a chain of event handlers, where an event not handled by one event
9262 handler is handed off to the next one in the chain.
9264 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
9266 def PushEventHandler(*args
, **kwargs
):
9268 PushEventHandler(self, EvtHandler handler)
9270 Pushes this event handler onto the event handler stack for the window.
9271 An event handler is an object that is capable of processing the events
9272 sent to a window. (In other words, is able to dispatch the events to
9273 handler function.) By default, the window is its own event handler,
9274 but an application may wish to substitute another, for example to
9275 allow central implementation of event-handling for a variety of
9276 different window classes.
9278 wx.Window.PushEventHandler allows an application to set up a chain of
9279 event handlers, where an event not handled by one event handler is
9280 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9281 to remove the event handler. Ownership of the handler is *not* given
9282 to the window, so you should be sure to pop the handler before the
9283 window is destroyed and either let PopEventHandler destroy it, or call
9284 its Destroy method yourself.
9286 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
9288 def PopEventHandler(*args
, **kwargs
):
9290 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
9292 Removes and returns the top-most event handler on the event handler
9293 stack. If deleteHandler is True then the wx.EvtHandler object will be
9294 destroyed after it is popped, and ``None`` will be returned instead.
9296 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
9298 def RemoveEventHandler(*args
, **kwargs
):
9300 RemoveEventHandler(self, EvtHandler handler) -> bool
9302 Find the given handler in the event handler chain and remove (but not
9303 delete) it from the event handler chain, returns True if it was found
9304 and False otherwise (this also results in an assert failure so this
9305 function should only be called when the handler is supposed to be
9308 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
9310 def SetValidator(*args
, **kwargs
):
9312 SetValidator(self, Validator validator)
9314 Deletes the current validator (if any) and sets the window validator,
9315 having called wx.Validator.Clone to create a new validator of this
9318 return _core_
.Window_SetValidator(*args
, **kwargs
)
9320 def GetValidator(*args
, **kwargs
):
9322 GetValidator(self) -> Validator
9324 Returns a pointer to the current validator for the window, or None if
9327 return _core_
.Window_GetValidator(*args
, **kwargs
)
9329 def Validate(*args
, **kwargs
):
9331 Validate(self) -> bool
9333 Validates the current values of the child controls using their
9334 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9335 style flag set, the method will also call Validate() of all child
9336 windows. Returns false if any of the validations failed.
9338 return _core_
.Window_Validate(*args
, **kwargs
)
9340 def TransferDataToWindow(*args
, **kwargs
):
9342 TransferDataToWindow(self) -> bool
9344 Transfers values to child controls from data areas specified by their
9345 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9346 style flag set, the method will also call TransferDataToWindow() of
9349 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
9351 def TransferDataFromWindow(*args
, **kwargs
):
9353 TransferDataFromWindow(self) -> bool
9355 Transfers values from child controls to data areas specified by their
9356 validators. Returns false if a transfer failed. If the window has
9357 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9358 also call TransferDataFromWindow() of all child windows.
9360 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
9362 def InitDialog(*args
, **kwargs
):
9366 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9367 to the dialog via validators.
9369 return _core_
.Window_InitDialog(*args
, **kwargs
)
9371 def SetAcceleratorTable(*args
, **kwargs
):
9373 SetAcceleratorTable(self, AcceleratorTable accel)
9375 Sets the accelerator table for this window.
9377 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
9379 def GetAcceleratorTable(*args
, **kwargs
):
9381 GetAcceleratorTable(self) -> AcceleratorTable
9383 Gets the accelerator table for this window.
9385 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
9387 def RegisterHotKey(*args
, **kwargs
):
9389 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9391 Registers a system wide hotkey. Every time the user presses the hotkey
9392 registered here, this window will receive a hotkey event. It will
9393 receive the event even if the application is in the background and
9394 does not have the input focus because the user is working with some
9395 other application. To bind an event handler function to this hotkey
9396 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9397 hotkey was registered successfully.
9399 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
9401 def UnregisterHotKey(*args
, **kwargs
):
9403 UnregisterHotKey(self, int hotkeyId) -> bool
9405 Unregisters a system wide hotkey.
9407 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
9409 def ConvertDialogPointToPixels(*args
, **kwargs
):
9411 ConvertDialogPointToPixels(self, Point pt) -> Point
9413 Converts a point or size from dialog units to pixels. Dialog units
9414 are used for maintaining a dialog's proportions even if the font
9415 changes. For the x dimension, the dialog units are multiplied by the
9416 average character width and then divided by 4. For the y dimension,
9417 the dialog units are multiplied by the average character height and
9420 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
9422 def ConvertDialogSizeToPixels(*args
, **kwargs
):
9424 ConvertDialogSizeToPixels(self, Size sz) -> Size
9426 Converts a point or size from dialog units to pixels. Dialog units
9427 are used for maintaining a dialog's proportions even if the font
9428 changes. For the x dimension, the dialog units are multiplied by the
9429 average character width and then divided by 4. For the y dimension,
9430 the dialog units are multiplied by the average character height and
9433 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
9435 def DLG_PNT(*args
, **kwargs
):
9437 DLG_PNT(self, Point pt) -> Point
9439 Converts a point or size from dialog units to pixels. Dialog units
9440 are used for maintaining a dialog's proportions even if the font
9441 changes. For the x dimension, the dialog units are multiplied by the
9442 average character width and then divided by 4. For the y dimension,
9443 the dialog units are multiplied by the average character height and
9446 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
9448 def DLG_SZE(*args
, **kwargs
):
9450 DLG_SZE(self, Size sz) -> Size
9452 Converts a point or size from dialog units to pixels. Dialog units
9453 are used for maintaining a dialog's proportions even if the font
9454 changes. For the x dimension, the dialog units are multiplied by the
9455 average character width and then divided by 4. For the y dimension,
9456 the dialog units are multiplied by the average character height and
9459 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
9461 def ConvertPixelPointToDialog(*args
, **kwargs
):
9462 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9463 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
9465 def ConvertPixelSizeToDialog(*args
, **kwargs
):
9466 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9467 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
9469 def WarpPointer(*args
, **kwargs
):
9471 WarpPointer(self, int x, int y)
9473 Moves the pointer to the given position on the window.
9475 NOTE: This function is not supported under Mac because Apple Human
9476 Interface Guidelines forbid moving the mouse cursor programmatically.
9478 return _core_
.Window_WarpPointer(*args
, **kwargs
)
9480 def CaptureMouse(*args
, **kwargs
):
9484 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9485 release the capture.
9487 Note that wxWindows maintains the stack of windows having captured the
9488 mouse and when the mouse is released the capture returns to the window
9489 which had had captured it previously and it is only really released if
9490 there were no previous window. In particular, this means that you must
9491 release the mouse as many times as you capture it, unless the window
9492 receives the `wx.MouseCaptureLostEvent` event.
9494 Any application which captures the mouse in the beginning of some
9495 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9496 operation when it receives the event. The event handler must not
9499 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
9501 def ReleaseMouse(*args
, **kwargs
):
9505 Releases mouse input captured with wx.Window.CaptureMouse.
9507 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
9509 def GetCapture(*args
, **kwargs
):
9511 GetCapture() -> Window
9513 Returns the window which currently captures the mouse or None
9515 return _core_
.Window_GetCapture(*args
, **kwargs
)
9517 GetCapture
= staticmethod(GetCapture
)
9518 def HasCapture(*args
, **kwargs
):
9520 HasCapture(self) -> bool
9522 Returns true if this window has the current mouse capture.
9524 return _core_
.Window_HasCapture(*args
, **kwargs
)
9526 def Refresh(*args
, **kwargs
):
9528 Refresh(self, bool eraseBackground=True, Rect rect=None)
9530 Mark the specified rectangle (or the whole window) as "dirty" so it
9531 will be repainted. Causes an EVT_PAINT event to be generated and sent
9534 return _core_
.Window_Refresh(*args
, **kwargs
)
9536 def RefreshRect(*args
, **kwargs
):
9538 RefreshRect(self, Rect rect, bool eraseBackground=True)
9540 Redraws the contents of the given rectangle: the area inside it will
9541 be repainted. This is the same as Refresh but has a nicer syntax.
9543 return _core_
.Window_RefreshRect(*args
, **kwargs
)
9545 def Update(*args
, **kwargs
):
9549 Calling this method immediately repaints the invalidated area of the
9550 window instead of waiting for the EVT_PAINT event to happen, (normally
9551 this would usually only happen when the flow of control returns to the
9552 event loop.) Notice that this function doesn't refresh the window and
9553 does nothing if the window has been already repainted. Use `Refresh`
9554 first if you want to immediately redraw the window (or some portion of
9555 it) unconditionally.
9557 return _core_
.Window_Update(*args
, **kwargs
)
9559 def ClearBackground(*args
, **kwargs
):
9561 ClearBackground(self)
9563 Clears the window by filling it with the current background
9564 colour. Does not cause an erase background event to be generated.
9566 return _core_
.Window_ClearBackground(*args
, **kwargs
)
9568 def Freeze(*args
, **kwargs
):
9572 Freezes the window or, in other words, prevents any updates from
9573 taking place on screen, the window is not redrawn at all. Thaw must be
9574 called to reenable window redrawing. Calls to Freeze/Thaw may be
9575 nested, with the actual Thaw being delayed until all the nesting has
9578 This method is useful for visual appearance optimization (for example,
9579 it is a good idea to use it before inserting large amount of text into
9580 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9581 for all controls so it is mostly just a hint to wxWindows and not a
9582 mandatory directive.
9584 return _core_
.Window_Freeze(*args
, **kwargs
)
9586 def IsFrozen(*args
, **kwargs
):
9588 IsFrozen(self) -> bool
9590 Returns ``True`` if the window has been frozen and not thawed yet.
9592 :see: `Freeze` and `Thaw`
9594 return _core_
.Window_IsFrozen(*args
, **kwargs
)
9596 def Thaw(*args
, **kwargs
):
9600 Reenables window updating after a previous call to Freeze. Calls to
9601 Freeze/Thaw may be nested, so Thaw must be called the same number of
9602 times that Freeze was before the window will be updated.
9604 return _core_
.Window_Thaw(*args
, **kwargs
)
9606 def PrepareDC(*args
, **kwargs
):
9608 PrepareDC(self, DC dc)
9610 Call this function to prepare the device context for drawing a
9611 scrolled image. It sets the device origin according to the current
9614 return _core_
.Window_PrepareDC(*args
, **kwargs
)
9616 def IsDoubleBuffered(*args
, **kwargs
):
9618 IsDoubleBuffered(self) -> bool
9620 Returns ``True`` if the window contents is double-buffered by the
9621 system, i.e. if any drawing done on the window is really done on a
9622 temporary backing surface and transferred to the screen all at once
9625 return _core_
.Window_IsDoubleBuffered(*args
, **kwargs
)
9627 def GetUpdateRegion(*args
, **kwargs
):
9629 GetUpdateRegion(self) -> Region
9631 Returns the region specifying which parts of the window have been
9632 damaged. Should only be called within an EVT_PAINT handler.
9634 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
9636 def GetUpdateClientRect(*args
, **kwargs
):
9638 GetUpdateClientRect(self) -> Rect
9640 Get the update rectangle region bounding box in client coords.
9642 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
9644 def IsExposed(*args
, **kwargs
):
9646 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9648 Returns true if the given point or rectangle area has been exposed
9649 since the last repaint. Call this in an paint event handler to
9650 optimize redrawing by only redrawing those areas, which have been
9653 return _core_
.Window_IsExposed(*args
, **kwargs
)
9655 def IsExposedPoint(*args
, **kwargs
):
9657 IsExposedPoint(self, Point pt) -> bool
9659 Returns true if the given point or rectangle area has been exposed
9660 since the last repaint. Call this in an paint event handler to
9661 optimize redrawing by only redrawing those areas, which have been
9664 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
9666 def IsExposedRect(*args
, **kwargs
):
9668 IsExposedRect(self, Rect rect) -> bool
9670 Returns true if the given point or rectangle area has been exposed
9671 since the last repaint. Call this in an paint event handler to
9672 optimize redrawing by only redrawing those areas, which have been
9675 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
9677 def GetDefaultAttributes(*args
, **kwargs
):
9679 GetDefaultAttributes(self) -> VisualAttributes
9681 Get the default attributes for an instance of this class. This is
9682 useful if you want to use the same font or colour in your own control
9683 as in a standard control -- which is a much better idea than hard
9684 coding specific colours or fonts which might look completely out of
9685 place on the user's system, especially if it uses themes.
9687 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
9689 def GetClassDefaultAttributes(*args
, **kwargs
):
9691 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9693 Get the default attributes for this class. This is useful if you want
9694 to use the same font or colour in your own control as in a standard
9695 control -- which is a much better idea than hard coding specific
9696 colours or fonts which might look completely out of place on the
9697 user's system, especially if it uses themes.
9699 The variant parameter is only relevant under Mac currently and is
9700 ignore under other platforms. Under Mac, it will change the size of
9701 the returned font. See `wx.Window.SetWindowVariant` for more about
9704 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9706 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
9707 def SetBackgroundColour(*args
, **kwargs
):
9709 SetBackgroundColour(self, Colour colour) -> bool
9711 Sets the background colour of the window. Returns True if the colour
9712 was changed. The background colour is usually painted by the default
9713 EVT_ERASE_BACKGROUND event handler function under Windows and
9714 automatically under GTK. Using `wx.NullColour` will reset the window
9715 to the default background colour.
9717 Note that setting the background colour may not cause an immediate
9718 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9719 calling this function.
9721 Using this function will disable attempts to use themes for this
9722 window, if the system supports them. Use with care since usually the
9723 themes represent the appearance chosen by the user to be used for all
9724 applications on the system.
9726 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
9728 def SetOwnBackgroundColour(*args
, **kwargs
):
9729 """SetOwnBackgroundColour(self, Colour colour)"""
9730 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
9732 def SetForegroundColour(*args
, **kwargs
):
9734 SetForegroundColour(self, Colour colour) -> bool
9736 Sets the foreground colour of the window. Returns True is the colour
9737 was changed. The interpretation of foreground colour is dependent on
9738 the window class; it may be the text colour or other colour, or it may
9741 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
9743 def SetOwnForegroundColour(*args
, **kwargs
):
9744 """SetOwnForegroundColour(self, Colour colour)"""
9745 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
9747 def GetBackgroundColour(*args
, **kwargs
):
9749 GetBackgroundColour(self) -> Colour
9751 Returns the background colour of the window.
9753 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
9755 def GetForegroundColour(*args
, **kwargs
):
9757 GetForegroundColour(self) -> Colour
9759 Returns the foreground colour of the window. The interpretation of
9760 foreground colour is dependent on the window class; it may be the text
9761 colour or other colour, or it may not be used at all.
9763 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
9765 def InheritsBackgroundColour(*args
, **kwargs
):
9766 """InheritsBackgroundColour(self) -> bool"""
9767 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
9769 def UseBgCol(*args
, **kwargs
):
9770 """UseBgCol(self) -> bool"""
9771 return _core_
.Window_UseBgCol(*args
, **kwargs
)
9773 def SetBackgroundStyle(*args
, **kwargs
):
9775 SetBackgroundStyle(self, int style) -> bool
9777 Returns the background style of the window. The background style
9778 indicates how the background of the window is drawn.
9780 ====================== ========================================
9781 wx.BG_STYLE_SYSTEM The background colour or pattern should
9782 be determined by the system
9783 wx.BG_STYLE_COLOUR The background should be a solid colour
9784 wx.BG_STYLE_CUSTOM The background will be implemented by the
9786 ====================== ========================================
9788 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9789 a custom background, such as a tiled bitmap. Currently the style has
9790 no effect on other platforms.
9792 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9794 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
9796 def GetBackgroundStyle(*args
, **kwargs
):
9798 GetBackgroundStyle(self) -> int
9800 Returns the background style of the window.
9802 :see: `SetBackgroundStyle`
9804 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
9806 def HasTransparentBackground(*args
, **kwargs
):
9808 HasTransparentBackground(self) -> bool
9810 Returns True if this window's background is transparent (as, for
9811 example, for `wx.StaticText`) and should show the parent window's
9814 This method is mostly used internally by the library itself and you
9815 normally shouldn't have to call it. You may, however, have to override
9816 it in your custom control classes to ensure that background is painted
9819 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
9821 def SetCursor(*args
, **kwargs
):
9823 SetCursor(self, Cursor cursor) -> bool
9825 Sets the window's cursor. Notice that the window cursor also sets it
9826 for the children of the window implicitly.
9828 The cursor may be wx.NullCursor in which case the window cursor will
9829 be reset back to default.
9831 return _core_
.Window_SetCursor(*args
, **kwargs
)
9833 def GetCursor(*args
, **kwargs
):
9835 GetCursor(self) -> Cursor
9837 Return the cursor associated with this window.
9839 return _core_
.Window_GetCursor(*args
, **kwargs
)
9841 def SetFont(*args
, **kwargs
):
9843 SetFont(self, Font font) -> bool
9845 Sets the font for this window.
9847 return _core_
.Window_SetFont(*args
, **kwargs
)
9849 def SetOwnFont(*args
, **kwargs
):
9850 """SetOwnFont(self, Font font)"""
9851 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9853 def GetFont(*args
, **kwargs
):
9855 GetFont(self) -> Font
9857 Returns the default font used for this window.
9859 return _core_
.Window_GetFont(*args
, **kwargs
)
9861 def SetCaret(*args
, **kwargs
):
9863 SetCaret(self, Caret caret)
9865 Sets the caret associated with the window.
9867 return _core_
.Window_SetCaret(*args
, **kwargs
)
9869 def GetCaret(*args
, **kwargs
):
9871 GetCaret(self) -> Caret
9873 Returns the caret associated with the window.
9875 return _core_
.Window_GetCaret(*args
, **kwargs
)
9877 def GetCharHeight(*args
, **kwargs
):
9879 GetCharHeight(self) -> int
9881 Get the (average) character size for the current font.
9883 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9885 def GetCharWidth(*args
, **kwargs
):
9887 GetCharWidth(self) -> int
9889 Get the (average) character size for the current font.
9891 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9893 def GetTextExtent(*args
, **kwargs
):
9895 GetTextExtent(String string) -> (width, height)
9897 Get the width and height of the text using the current font.
9899 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9901 def GetFullTextExtent(*args
, **kwargs
):
9903 GetFullTextExtent(String string, Font font=None) ->
9904 (width, height, descent, externalLeading)
9906 Get the width, height, decent and leading of the text using the
9907 current or specified font.
9909 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9911 def ClientToScreenXY(*args
, **kwargs
):
9913 ClientToScreenXY(int x, int y) -> (x,y)
9915 Converts to screen coordinates from coordinates relative to this window.
9917 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9919 def ScreenToClientXY(*args
, **kwargs
):
9921 ScreenToClientXY(int x, int y) -> (x,y)
9923 Converts from screen to client window coordinates.
9925 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9927 def ClientToScreen(*args
, **kwargs
):
9929 ClientToScreen(self, Point pt) -> Point
9931 Converts to screen coordinates from coordinates relative to this window.
9933 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9935 def ScreenToClient(*args
, **kwargs
):
9937 ScreenToClient(self, Point pt) -> Point
9939 Converts from screen to client window coordinates.
9941 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9943 def HitTestXY(*args
, **kwargs
):
9945 HitTestXY(self, int x, int y) -> int
9947 Test where the given (in client coords) point lies
9949 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9951 def HitTest(*args
, **kwargs
):
9953 HitTest(self, Point pt) -> int
9955 Test where the given (in client coords) point lies
9957 return _core_
.Window_HitTest(*args
, **kwargs
)
9959 def GetBorder(*args
):
9961 GetBorder(self, long flags) -> int
9962 GetBorder(self) -> int
9964 Get border for the flags of this window
9966 return _core_
.Window_GetBorder(*args
)
9968 def UpdateWindowUI(*args
, **kwargs
):
9970 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9972 This function sends EVT_UPDATE_UI events to the window. The particular
9973 implementation depends on the window; for example a wx.ToolBar will
9974 send an update UI event for each toolbar button, and a wx.Frame will
9975 send an update UI event for each menubar menu item. You can call this
9976 function from your application to ensure that your UI is up-to-date at
9977 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9978 concerned). This may be necessary if you have called
9979 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9980 limit the overhead that wxWindows incurs by sending update UI events
9983 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9985 def PopupMenuXY(*args
, **kwargs
):
9987 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9989 Pops up the given menu at the specified coordinates, relative to this window,
9990 and returns control when the user has dismissed the menu. If a menu item is
9991 selected, the corresponding menu event is generated and will be processed as
9992 usual. If the default position is given then the current position of the
9993 mouse cursor will be used.
9995 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9997 def PopupMenu(*args
, **kwargs
):
9999 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
10001 Pops up the given menu at the specified coordinates, relative to this window,
10002 and returns control when the user has dismissed the menu. If a menu item is
10003 selected, the corresponding menu event is generated and will be processed as
10004 usual. If the default position is given then the current position of the
10005 mouse cursor will be used.
10007 return _core_
.Window_PopupMenu(*args
, **kwargs
)
10009 def HasMultiplePages(*args
, **kwargs
):
10010 """HasMultiplePages(self) -> bool"""
10011 return _core_
.Window_HasMultiplePages(*args
, **kwargs
)
10013 def GetHandle(*args
, **kwargs
):
10015 GetHandle(self) -> long
10017 Returns the platform-specific handle (as a long integer) of the
10018 physical window. Currently on wxMac it returns the handle of the
10019 toplevel parent of the window.
10021 return _core_
.Window_GetHandle(*args
, **kwargs
)
10023 def AssociateHandle(*args
, **kwargs
):
10025 AssociateHandle(self, long handle)
10027 Associate the window with a new native handle
10029 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
10031 def DissociateHandle(*args
, **kwargs
):
10033 DissociateHandle(self)
10035 Dissociate the current native handle from the window
10037 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
10039 def OnPaint(*args
, **kwargs
):
10040 """OnPaint(self, PaintEvent event)"""
10041 return _core_
.Window_OnPaint(*args
, **kwargs
)
10043 def HasScrollbar(*args
, **kwargs
):
10045 HasScrollbar(self, int orient) -> bool
10047 Does the window have the scrollbar for this orientation?
10049 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
10051 def SetScrollbar(*args
, **kwargs
):
10053 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
10056 Sets the scrollbar properties of a built-in scrollbar.
10058 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
10060 def SetScrollPos(*args
, **kwargs
):
10062 SetScrollPos(self, int orientation, int pos, bool refresh=True)
10064 Sets the position of one of the built-in scrollbars.
10066 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
10068 def GetScrollPos(*args
, **kwargs
):
10070 GetScrollPos(self, int orientation) -> int
10072 Returns the built-in scrollbar position.
10074 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
10076 def GetScrollThumb(*args
, **kwargs
):
10078 GetScrollThumb(self, int orientation) -> int
10080 Returns the built-in scrollbar thumb size.
10082 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
10084 def GetScrollRange(*args
, **kwargs
):
10086 GetScrollRange(self, int orientation) -> int
10088 Returns the built-in scrollbar range.
10090 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
10092 def ScrollWindow(*args
, **kwargs
):
10094 ScrollWindow(self, int dx, int dy, Rect rect=None)
10096 Physically scrolls the pixels in the window and move child windows
10097 accordingly. Use this function to optimise your scrolling
10098 implementations, to minimise the area that must be redrawn. Note that
10099 it is rarely required to call this function from a user program.
10101 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
10103 def ScrollLines(*args
, **kwargs
):
10105 ScrollLines(self, int lines) -> bool
10107 If the platform and window class supports it, scrolls the window by
10108 the given number of lines down, if lines is positive, or up if lines
10109 is negative. Returns True if the window was scrolled, False if it was
10110 already on top/bottom and nothing was done.
10112 return _core_
.Window_ScrollLines(*args
, **kwargs
)
10114 def ScrollPages(*args
, **kwargs
):
10116 ScrollPages(self, int pages) -> bool
10118 If the platform and window class supports it, scrolls the window by
10119 the given number of pages down, if pages is positive, or up if pages
10120 is negative. Returns True if the window was scrolled, False if it was
10121 already on top/bottom and nothing was done.
10123 return _core_
.Window_ScrollPages(*args
, **kwargs
)
10125 def LineUp(*args
, **kwargs
):
10127 LineUp(self) -> bool
10129 This is just a wrapper for ScrollLines(-1).
10131 return _core_
.Window_LineUp(*args
, **kwargs
)
10133 def LineDown(*args
, **kwargs
):
10135 LineDown(self) -> bool
10137 This is just a wrapper for ScrollLines(1).
10139 return _core_
.Window_LineDown(*args
, **kwargs
)
10141 def PageUp(*args
, **kwargs
):
10143 PageUp(self) -> bool
10145 This is just a wrapper for ScrollPages(-1).
10147 return _core_
.Window_PageUp(*args
, **kwargs
)
10149 def PageDown(*args
, **kwargs
):
10151 PageDown(self) -> bool
10153 This is just a wrapper for ScrollPages(1).
10155 return _core_
.Window_PageDown(*args
, **kwargs
)
10157 def SetHelpText(*args
, **kwargs
):
10159 SetHelpText(self, String text)
10161 Sets the help text to be used as context-sensitive help for this
10162 window. Note that the text is actually stored by the current
10163 `wx.HelpProvider` implementation, and not in the window object itself.
10165 return _core_
.Window_SetHelpText(*args
, **kwargs
)
10167 def SetHelpTextForId(*args
, **kwargs
):
10169 SetHelpTextForId(self, String text)
10171 Associate this help text with all windows with the same id as this
10174 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
10176 def GetHelpTextAtPoint(*args
, **kwargs
):
10178 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10180 Get the help string associated with the given position in this window.
10182 Notice that pt may be invalid if event origin is keyboard or unknown
10183 and this method should return the global window help text then
10186 return _core_
.Window_GetHelpTextAtPoint(*args
, **kwargs
)
10188 def GetHelpText(*args
, **kwargs
):
10190 GetHelpText(self) -> String
10192 Gets the help text to be used as context-sensitive help for this
10193 window. Note that the text is actually stored by the current
10194 `wx.HelpProvider` implementation, and not in the window object itself.
10196 return _core_
.Window_GetHelpText(*args
, **kwargs
)
10198 def SetToolTipString(*args
, **kwargs
):
10200 SetToolTipString(self, String tip)
10202 Attach a tooltip to the window.
10204 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
10206 def SetToolTip(*args
, **kwargs
):
10208 SetToolTip(self, ToolTip tip)
10210 Attach a tooltip to the window.
10212 return _core_
.Window_SetToolTip(*args
, **kwargs
)
10214 def GetToolTip(*args
, **kwargs
):
10216 GetToolTip(self) -> ToolTip
10218 get the associated tooltip or None if none
10220 return _core_
.Window_GetToolTip(*args
, **kwargs
)
10222 def SetDropTarget(*args
, **kwargs
):
10224 SetDropTarget(self, DropTarget dropTarget)
10226 Associates a drop target with this window. If the window already has
10227 a drop target, it is deleted.
10229 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
10231 def GetDropTarget(*args
, **kwargs
):
10233 GetDropTarget(self) -> DropTarget
10235 Returns the associated drop target, which may be None.
10237 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
10239 def DragAcceptFiles(*args
, **kwargs
):
10241 DragAcceptFiles(self, bool accept)
10243 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10244 Only functional on Windows.
10246 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
10248 def SetConstraints(*args
, **kwargs
):
10250 SetConstraints(self, LayoutConstraints constraints)
10252 Sets the window to have the given layout constraints. If an existing
10253 layout constraints object is already owned by the window, it will be
10254 deleted. Pass None to disassociate and delete the window's current
10257 You must call SetAutoLayout to tell a window to use the constraints
10258 automatically in its default EVT_SIZE handler; otherwise, you must
10259 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10260 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10263 return _core_
.Window_SetConstraints(*args
, **kwargs
)
10265 def GetConstraints(*args
, **kwargs
):
10267 GetConstraints(self) -> LayoutConstraints
10269 Returns a pointer to the window's layout constraints, or None if there
10272 return _core_
.Window_GetConstraints(*args
, **kwargs
)
10274 def SetAutoLayout(*args
, **kwargs
):
10276 SetAutoLayout(self, bool autoLayout)
10278 Determines whether the Layout function will be called automatically
10279 when the window is resized. lease note that this only happens for the
10280 windows usually used to contain children, namely `wx.Panel` and
10281 `wx.TopLevelWindow` (and the classes deriving from them).
10283 This method is called implicitly by `SetSizer` but if you use
10284 `SetConstraints` you should call it manually or otherwise the window
10285 layout won't be correctly updated when its size changes.
10287 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
10289 def GetAutoLayout(*args
, **kwargs
):
10291 GetAutoLayout(self) -> bool
10293 Returns the current autoLayout setting
10295 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
10297 def Layout(*args
, **kwargs
):
10299 Layout(self) -> bool
10301 Invokes the constraint-based layout algorithm or the sizer-based
10302 algorithm for this window. See SetAutoLayout: when auto layout is on,
10303 this function gets called automatically by the default EVT_SIZE
10304 handler when the window is resized.
10306 return _core_
.Window_Layout(*args
, **kwargs
)
10308 def SetSizer(*args
, **kwargs
):
10310 SetSizer(self, Sizer sizer, bool deleteOld=True)
10312 Sets the window to have the given layout sizer. The window will then
10313 own the object, and will take care of its deletion. If an existing
10314 layout sizer object is already owned by the window, it will be deleted
10315 if the deleteOld parameter is true. Note that this function will also
10316 call SetAutoLayout implicitly with a True parameter if the sizer is
10317 non-None, and False otherwise.
10319 return _core_
.Window_SetSizer(*args
, **kwargs
)
10321 def SetSizerAndFit(*args
, **kwargs
):
10323 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
10325 The same as SetSizer, except it also sets the size hints for the
10326 window based on the sizer's minimum size.
10328 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
10330 def GetSizer(*args
, **kwargs
):
10332 GetSizer(self) -> Sizer
10334 Return the sizer associated with the window by a previous call to
10335 SetSizer or None if there isn't one.
10337 return _core_
.Window_GetSizer(*args
, **kwargs
)
10339 def SetContainingSizer(*args
, **kwargs
):
10341 SetContainingSizer(self, Sizer sizer)
10343 This normally does not need to be called by application code. It is
10344 called internally when a window is added to a sizer, and is used so
10345 the window can remove itself from the sizer when it is destroyed.
10347 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
10349 def GetContainingSizer(*args
, **kwargs
):
10351 GetContainingSizer(self) -> Sizer
10353 Return the sizer that this window is a member of, if any, otherwise None.
10355 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
10357 def InheritAttributes(*args
, **kwargs
):
10359 InheritAttributes(self)
10361 This function is (or should be, in case of custom controls) called
10362 during window creation to intelligently set up the window visual
10363 attributes, that is the font and the foreground and background
10366 By 'intelligently' the following is meant: by default, all windows use
10367 their own default attributes. However if some of the parent's
10368 attributes are explicitly changed (that is, using SetFont and not
10369 SetOwnFont) and if the corresponding attribute hadn't been
10370 explicitly set for this window itself, then this window takes the same
10371 value as used by the parent. In addition, if the window overrides
10372 ShouldInheritColours to return false, the colours will not be changed
10373 no matter what and only the font might.
10375 This rather complicated logic is necessary in order to accommodate the
10376 different usage scenarios. The most common one is when all default
10377 attributes are used and in this case, nothing should be inherited as
10378 in modern GUIs different controls use different fonts (and colours)
10379 than their siblings so they can't inherit the same value from the
10380 parent. However it was also deemed desirable to allow to simply change
10381 the attributes of all children at once by just changing the font or
10382 colour of their common parent, hence in this case we do inherit the
10383 parents attributes.
10386 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
10388 def ShouldInheritColours(*args
, **kwargs
):
10390 ShouldInheritColours(self) -> bool
10392 Return true from here to allow the colours of this window to be
10393 changed by InheritAttributes, returning false forbids inheriting them
10394 from the parent window.
10396 The base class version returns false, but this method is overridden in
10397 wxControl where it returns true.
10399 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
10401 def CanSetTransparent(*args
, **kwargs
):
10403 CanSetTransparent(self) -> bool
10405 Returns ``True`` if the platform supports setting the transparency for
10406 this window. Note that this method will err on the side of caution,
10407 so it is possible that this will return ``False`` when it is in fact
10408 possible to set the transparency.
10410 NOTE: On X-windows systems the X server must have the composite
10411 extension loaded, and there must be a composite manager program (such
10412 as xcompmgr) running.
10414 return _core_
.Window_CanSetTransparent(*args
, **kwargs
)
10416 def SetTransparent(*args
, **kwargs
):
10418 SetTransparent(self, byte alpha) -> bool
10420 Attempt to set the transparency of this window to the ``alpha`` value,
10421 returns True on success. The ``alpha`` value is an integer in the
10422 range of 0 to 255, where 0 is fully transparent and 255 is fully
10425 return _core_
.Window_SetTransparent(*args
, **kwargs
)
10427 def PostCreate(self
, pre
):
10429 Phase 3 of the 2-phase create <wink!>
10430 Call this method after precreating the window with the 2-phase create method.
10432 self
.this
= pre
.this
10433 self
.thisown
= pre
.thisown
10435 if hasattr(self
, '_setOORInfo'):
10437 self
._setOORInfo
(self
)
10440 if hasattr(self
, '_setCallbackInfo'):
10442 self
._setCallbackInfo
(self
, pre
.__class
__)
10446 def SendSizeEvent(self
):
10447 self
.GetEventHandler().ProcessEvent(wx
.SizeEvent((-1,-1)))
10449 AcceleratorTable
= property(GetAcceleratorTable
,SetAcceleratorTable
,doc
="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10450 AutoLayout
= property(GetAutoLayout
,SetAutoLayout
,doc
="See `GetAutoLayout` and `SetAutoLayout`")
10451 BackgroundColour
= property(GetBackgroundColour
,SetBackgroundColour
,doc
="See `GetBackgroundColour` and `SetBackgroundColour`")
10452 BackgroundStyle
= property(GetBackgroundStyle
,SetBackgroundStyle
,doc
="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10453 EffectiveMinSize
= property(GetEffectiveMinSize
,doc
="See `GetEffectiveMinSize`")
10454 BestSize
= property(GetBestSize
,doc
="See `GetBestSize`")
10455 BestVirtualSize
= property(GetBestVirtualSize
,doc
="See `GetBestVirtualSize`")
10456 Border
= property(GetBorder
,doc
="See `GetBorder`")
10457 Caret
= property(GetCaret
,SetCaret
,doc
="See `GetCaret` and `SetCaret`")
10458 CharHeight
= property(GetCharHeight
,doc
="See `GetCharHeight`")
10459 CharWidth
= property(GetCharWidth
,doc
="See `GetCharWidth`")
10460 Children
= property(GetChildren
,doc
="See `GetChildren`")
10461 ClientAreaOrigin
= property(GetClientAreaOrigin
,doc
="See `GetClientAreaOrigin`")
10462 ClientRect
= property(GetClientRect
,SetClientRect
,doc
="See `GetClientRect` and `SetClientRect`")
10463 ClientSize
= property(GetClientSize
,SetClientSize
,doc
="See `GetClientSize` and `SetClientSize`")
10464 Constraints
= property(GetConstraints
,SetConstraints
,doc
="See `GetConstraints` and `SetConstraints`")
10465 ContainingSizer
= property(GetContainingSizer
,SetContainingSizer
,doc
="See `GetContainingSizer` and `SetContainingSizer`")
10466 Cursor
= property(GetCursor
,SetCursor
,doc
="See `GetCursor` and `SetCursor`")
10467 DefaultAttributes
= property(GetDefaultAttributes
,doc
="See `GetDefaultAttributes`")
10468 DropTarget
= property(GetDropTarget
,SetDropTarget
,doc
="See `GetDropTarget` and `SetDropTarget`")
10469 EventHandler
= property(GetEventHandler
,SetEventHandler
,doc
="See `GetEventHandler` and `SetEventHandler`")
10470 ExtraStyle
= property(GetExtraStyle
,SetExtraStyle
,doc
="See `GetExtraStyle` and `SetExtraStyle`")
10471 Font
= property(GetFont
,SetFont
,doc
="See `GetFont` and `SetFont`")
10472 ForegroundColour
= property(GetForegroundColour
,SetForegroundColour
,doc
="See `GetForegroundColour` and `SetForegroundColour`")
10473 GrandParent
= property(GetGrandParent
,doc
="See `GetGrandParent`")
10474 TopLevelParent
= property(GetTopLevelParent
,doc
="See `GetTopLevelParent`")
10475 Handle
= property(GetHandle
,doc
="See `GetHandle`")
10476 HelpText
= property(GetHelpText
,SetHelpText
,doc
="See `GetHelpText` and `SetHelpText`")
10477 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
10478 Label
= property(GetLabel
,SetLabel
,doc
="See `GetLabel` and `SetLabel`")
10479 LayoutDirection
= property(GetLayoutDirection
,SetLayoutDirection
,doc
="See `GetLayoutDirection` and `SetLayoutDirection`")
10480 MaxHeight
= property(GetMaxHeight
,doc
="See `GetMaxHeight`")
10481 MaxSize
= property(GetMaxSize
,SetMaxSize
,doc
="See `GetMaxSize` and `SetMaxSize`")
10482 MaxWidth
= property(GetMaxWidth
,doc
="See `GetMaxWidth`")
10483 MinHeight
= property(GetMinHeight
,doc
="See `GetMinHeight`")
10484 MinSize
= property(GetMinSize
,SetMinSize
,doc
="See `GetMinSize` and `SetMinSize`")
10485 MinWidth
= property(GetMinWidth
,doc
="See `GetMinWidth`")
10486 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
10487 Parent
= property(GetParent
,doc
="See `GetParent`")
10488 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
10489 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
10490 ScreenPosition
= property(GetScreenPosition
,doc
="See `GetScreenPosition`")
10491 ScreenRect
= property(GetScreenRect
,doc
="See `GetScreenRect`")
10492 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
10493 Sizer
= property(GetSizer
,SetSizer
,doc
="See `GetSizer` and `SetSizer`")
10494 ThemeEnabled
= property(GetThemeEnabled
,SetThemeEnabled
,doc
="See `GetThemeEnabled` and `SetThemeEnabled`")
10495 ToolTip
= property(GetToolTip
,SetToolTip
,doc
="See `GetToolTip` and `SetToolTip`")
10496 UpdateClientRect
= property(GetUpdateClientRect
,doc
="See `GetUpdateClientRect`")
10497 UpdateRegion
= property(GetUpdateRegion
,doc
="See `GetUpdateRegion`")
10498 Validator
= property(GetValidator
,SetValidator
,doc
="See `GetValidator` and `SetValidator`")
10499 VirtualSize
= property(GetVirtualSize
,SetVirtualSize
,doc
="See `GetVirtualSize` and `SetVirtualSize`")
10500 WindowStyle
= property(GetWindowStyle
,SetWindowStyle
,doc
="See `GetWindowStyle` and `SetWindowStyle`")
10501 WindowStyleFlag
= property(GetWindowStyleFlag
,SetWindowStyleFlag
,doc
="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10502 WindowVariant
= property(GetWindowVariant
,SetWindowVariant
,doc
="See `GetWindowVariant` and `SetWindowVariant`")
10503 Shown
= property(IsShown
,Show
,doc
="See `IsShown` and `Show`")
10504 Enabled
= property(IsEnabled
,Enable
,doc
="See `IsEnabled` and `Enable`")
10505 TopLevel
= property(IsTopLevel
,doc
="See `IsTopLevel`")
10506 _core_
.Window_swigregister(Window
)
10508 def PreWindow(*args
, **kwargs
):
10510 PreWindow() -> Window
10512 Precreate a Window for 2-phase creation.
10514 val
= _core_
.new_PreWindow(*args
, **kwargs
)
10517 def Window_NewControlId(*args
):
10519 Window_NewControlId() -> int
10521 Generate a control id for the controls which were not given one.
10523 return _core_
.Window_NewControlId(*args
)
10525 def Window_NextControlId(*args
, **kwargs
):
10527 Window_NextControlId(int winid) -> int
10529 Get the id of the control following the one with the given
10532 return _core_
.Window_NextControlId(*args
, **kwargs
)
10534 def Window_PrevControlId(*args
, **kwargs
):
10536 Window_PrevControlId(int winid) -> int
10538 Get the id of the control preceding the one with the given
10541 return _core_
.Window_PrevControlId(*args
, **kwargs
)
10543 def Window_FindFocus(*args
):
10545 Window_FindFocus() -> Window
10547 Returns the window or control that currently has the keyboard focus,
10550 return _core_
.Window_FindFocus(*args
)
10552 def Window_GetCapture(*args
):
10554 Window_GetCapture() -> Window
10556 Returns the window which currently captures the mouse or None
10558 return _core_
.Window_GetCapture(*args
)
10560 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
10562 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10564 Get the default attributes for this class. This is useful if you want
10565 to use the same font or colour in your own control as in a standard
10566 control -- which is a much better idea than hard coding specific
10567 colours or fonts which might look completely out of place on the
10568 user's system, especially if it uses themes.
10570 The variant parameter is only relevant under Mac currently and is
10571 ignore under other platforms. Under Mac, it will change the size of
10572 the returned font. See `wx.Window.SetWindowVariant` for more about
10575 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
10577 def DLG_PNT(win
, point_or_x
, y
=None):
10579 Convenience function for converting a Point or (x,y) in
10580 dialog units to pixel units.
10583 return win
.ConvertDialogPointToPixels(point_or_x
)
10585 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
10587 def DLG_SZE(win
, size_width
, height
=None):
10589 Convenience function for converting a Size or (w,h) in
10590 dialog units to pixel units.
10593 return win
.ConvertDialogSizeToPixels(size_width
)
10595 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
10598 def FindWindowById(*args
, **kwargs
):
10600 FindWindowById(long id, Window parent=None) -> Window
10602 Find the first window in the application with the given id. If parent
10603 is None, the search will start from all top-level frames and dialog
10604 boxes; if non-None, the search will be limited to the given window
10605 hierarchy. The search is recursive in both cases.
10607 return _core_
.FindWindowById(*args
, **kwargs
)
10609 def FindWindowByName(*args
, **kwargs
):
10611 FindWindowByName(String name, Window parent=None) -> Window
10613 Find a window by its name (as given in a window constructor or Create
10614 function call). If parent is None, the search will start from all
10615 top-level frames and dialog boxes; if non-None, the search will be
10616 limited to the given window hierarchy. The search is recursive in both
10619 If no window with such name is found, wx.FindWindowByLabel is called.
10621 return _core_
.FindWindowByName(*args
, **kwargs
)
10623 def FindWindowByLabel(*args
, **kwargs
):
10625 FindWindowByLabel(String label, Window parent=None) -> Window
10627 Find a window by its label. Depending on the type of window, the label
10628 may be a window title or panel item label. If parent is None, the
10629 search will start from all top-level frames and dialog boxes; if
10630 non-None, the search will be limited to the given window
10631 hierarchy. The search is recursive in both cases.
10633 return _core_
.FindWindowByLabel(*args
, **kwargs
)
10635 def Window_FromHWND(*args
, **kwargs
):
10636 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10637 return _core_
.Window_FromHWND(*args
, **kwargs
)
10639 def GetTopLevelWindows(*args
):
10641 GetTopLevelWindows() -> PyObject
10643 Returns a list of the the application's top-level windows, (frames,
10644 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10645 by wxWidgets, and so it is only valid as long as no top-level windows
10646 are closed or new top-level windows are created.
10649 return _core_
.GetTopLevelWindows(*args
)
10650 #---------------------------------------------------------------------------
10652 class Validator(EvtHandler
):
10653 """Proxy of C++ Validator class"""
10654 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10655 __repr__
= _swig_repr
10656 def __init__(self
, *args
, **kwargs
):
10657 """__init__(self) -> Validator"""
10658 _core_
.Validator_swiginit(self
,_core_
.new_Validator(*args
, **kwargs
))
10659 self
._setOORInfo
(self
)
10661 def Clone(*args
, **kwargs
):
10662 """Clone(self) -> Validator"""
10663 return _core_
.Validator_Clone(*args
, **kwargs
)
10665 def Validate(*args
, **kwargs
):
10666 """Validate(self, Window parent) -> bool"""
10667 return _core_
.Validator_Validate(*args
, **kwargs
)
10669 def TransferToWindow(*args
, **kwargs
):
10670 """TransferToWindow(self) -> bool"""
10671 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
10673 def TransferFromWindow(*args
, **kwargs
):
10674 """TransferFromWindow(self) -> bool"""
10675 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
10677 def GetWindow(*args
, **kwargs
):
10678 """GetWindow(self) -> Window"""
10679 return _core_
.Validator_GetWindow(*args
, **kwargs
)
10681 def SetWindow(*args
, **kwargs
):
10682 """SetWindow(self, Window window)"""
10683 return _core_
.Validator_SetWindow(*args
, **kwargs
)
10685 def IsSilent(*args
, **kwargs
):
10686 """IsSilent() -> bool"""
10687 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10689 IsSilent
= staticmethod(IsSilent
)
10690 def SetBellOnError(*args
, **kwargs
):
10691 """SetBellOnError(int doIt=True)"""
10692 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10694 SetBellOnError
= staticmethod(SetBellOnError
)
10695 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
10696 _core_
.Validator_swigregister(Validator
)
10698 def Validator_IsSilent(*args
):
10699 """Validator_IsSilent() -> bool"""
10700 return _core_
.Validator_IsSilent(*args
)
10702 def Validator_SetBellOnError(*args
, **kwargs
):
10703 """Validator_SetBellOnError(int doIt=True)"""
10704 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10706 class PyValidator(Validator
):
10707 """Proxy of C++ PyValidator class"""
10708 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10709 __repr__
= _swig_repr
10710 def __init__(self
, *args
, **kwargs
):
10711 """__init__(self) -> PyValidator"""
10712 _core_
.PyValidator_swiginit(self
,_core_
.new_PyValidator(*args
, **kwargs
))
10713 self
._setOORInfo
(self
);PyValidator
._setCallbackInfo
(self
, self
, PyValidator
)
10715 def _setCallbackInfo(*args
, **kwargs
):
10716 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
10717 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
10719 _core_
.PyValidator_swigregister(PyValidator
)
10721 #---------------------------------------------------------------------------
10723 class Menu(EvtHandler
):
10724 """Proxy of C++ Menu class"""
10725 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10726 __repr__
= _swig_repr
10727 def __init__(self
, *args
, **kwargs
):
10728 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10729 _core_
.Menu_swiginit(self
,_core_
.new_Menu(*args
, **kwargs
))
10730 self
._setOORInfo
(self
)
10732 def Append(*args
, **kwargs
):
10734 Append(self, int id, String text=EmptyString, String help=EmptyString,
10735 int kind=ITEM_NORMAL) -> MenuItem
10737 return _core_
.Menu_Append(*args
, **kwargs
)
10739 def AppendSeparator(*args
, **kwargs
):
10740 """AppendSeparator(self) -> MenuItem"""
10741 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
10743 def AppendCheckItem(*args
, **kwargs
):
10744 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10745 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
10747 def AppendRadioItem(*args
, **kwargs
):
10748 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10749 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
10751 def AppendMenu(*args
, **kwargs
):
10752 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10753 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
10755 def AppendSubMenu(*args
, **kwargs
):
10756 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10757 return _core_
.Menu_AppendSubMenu(*args
, **kwargs
)
10759 def AppendItem(*args
, **kwargs
):
10760 """AppendItem(self, MenuItem item) -> MenuItem"""
10761 return _core_
.Menu_AppendItem(*args
, **kwargs
)
10763 def InsertItem(*args
, **kwargs
):
10764 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10765 return _core_
.Menu_InsertItem(*args
, **kwargs
)
10767 def PrependItem(*args
, **kwargs
):
10768 """PrependItem(self, MenuItem item) -> MenuItem"""
10769 return _core_
.Menu_PrependItem(*args
, **kwargs
)
10771 def Break(*args
, **kwargs
):
10773 return _core_
.Menu_Break(*args
, **kwargs
)
10775 def Insert(*args
, **kwargs
):
10777 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10778 int kind=ITEM_NORMAL) -> MenuItem
10780 return _core_
.Menu_Insert(*args
, **kwargs
)
10782 def InsertSeparator(*args
, **kwargs
):
10783 """InsertSeparator(self, size_t pos) -> MenuItem"""
10784 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
10786 def InsertCheckItem(*args
, **kwargs
):
10787 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10788 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
10790 def InsertRadioItem(*args
, **kwargs
):
10791 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10792 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
10794 def InsertMenu(*args
, **kwargs
):
10795 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10796 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
10798 def Prepend(*args
, **kwargs
):
10800 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10801 int kind=ITEM_NORMAL) -> MenuItem
10803 return _core_
.Menu_Prepend(*args
, **kwargs
)
10805 def PrependSeparator(*args
, **kwargs
):
10806 """PrependSeparator(self) -> MenuItem"""
10807 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
10809 def PrependCheckItem(*args
, **kwargs
):
10810 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10811 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
10813 def PrependRadioItem(*args
, **kwargs
):
10814 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10815 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
10817 def PrependMenu(*args
, **kwargs
):
10818 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10819 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
10821 def Remove(*args
, **kwargs
):
10822 """Remove(self, int id) -> MenuItem"""
10823 return _core_
.Menu_Remove(*args
, **kwargs
)
10825 def RemoveItem(self
, item
):
10826 """RemoveItem(self, MenuItem item) -> MenuItem"""
10827 #// The return object is always the parameter, so return that
10828 #// proxy instead of the new one
10829 val
= _core_
.Menu_RemoveItem(self
, item
)
10830 item
.this
.own(val
.this
.own())
10835 def Delete(*args
, **kwargs
):
10836 """Delete(self, int id) -> bool"""
10837 return _core_
.Menu_Delete(*args
, **kwargs
)
10839 def DeleteItem(*args
, **kwargs
):
10840 """DeleteItem(self, MenuItem item) -> bool"""
10841 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
10843 def Destroy(*args
, **kwargs
):
10847 Deletes the C++ object this Python object is a proxy for.
10849 args
[0].this
.own(False)
10850 return _core_
.Menu_Destroy(*args
, **kwargs
)
10852 def DestroyId(*args
, **kwargs
):
10853 """DestroyId(self, int id) -> bool"""
10854 return _core_
.Menu_DestroyId(*args
, **kwargs
)
10856 def DestroyItem(*args
, **kwargs
):
10857 """DestroyItem(self, MenuItem item) -> bool"""
10858 return _core_
.Menu_DestroyItem(*args
, **kwargs
)
10860 def GetMenuItemCount(*args
, **kwargs
):
10861 """GetMenuItemCount(self) -> size_t"""
10862 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
10864 def GetMenuItems(*args
, **kwargs
):
10865 """GetMenuItems(self) -> PyObject"""
10866 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
10868 def FindItem(*args
, **kwargs
):
10869 """FindItem(self, String item) -> int"""
10870 return _core_
.Menu_FindItem(*args
, **kwargs
)
10872 def FindItemById(*args
, **kwargs
):
10873 """FindItemById(self, int id) -> MenuItem"""
10874 return _core_
.Menu_FindItemById(*args
, **kwargs
)
10876 def FindItemByPosition(*args
, **kwargs
):
10877 """FindItemByPosition(self, size_t position) -> MenuItem"""
10878 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
10880 def Enable(*args
, **kwargs
):
10881 """Enable(self, int id, bool enable)"""
10882 return _core_
.Menu_Enable(*args
, **kwargs
)
10884 def IsEnabled(*args
, **kwargs
):
10885 """IsEnabled(self, int id) -> bool"""
10886 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
10888 def Check(*args
, **kwargs
):
10889 """Check(self, int id, bool check)"""
10890 return _core_
.Menu_Check(*args
, **kwargs
)
10892 def IsChecked(*args
, **kwargs
):
10893 """IsChecked(self, int id) -> bool"""
10894 return _core_
.Menu_IsChecked(*args
, **kwargs
)
10896 def SetLabel(*args
, **kwargs
):
10897 """SetLabel(self, int id, String label)"""
10898 return _core_
.Menu_SetLabel(*args
, **kwargs
)
10900 def GetLabel(*args
, **kwargs
):
10901 """GetLabel(self, int id) -> String"""
10902 return _core_
.Menu_GetLabel(*args
, **kwargs
)
10904 def SetHelpString(*args
, **kwargs
):
10905 """SetHelpString(self, int id, String helpString)"""
10906 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
10908 def GetHelpString(*args
, **kwargs
):
10909 """GetHelpString(self, int id) -> String"""
10910 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
10912 def SetTitle(*args
, **kwargs
):
10913 """SetTitle(self, String title)"""
10914 return _core_
.Menu_SetTitle(*args
, **kwargs
)
10916 def GetTitle(*args
, **kwargs
):
10917 """GetTitle(self) -> String"""
10918 return _core_
.Menu_GetTitle(*args
, **kwargs
)
10920 def SetEventHandler(*args
, **kwargs
):
10921 """SetEventHandler(self, EvtHandler handler)"""
10922 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
10924 def GetEventHandler(*args
, **kwargs
):
10925 """GetEventHandler(self) -> EvtHandler"""
10926 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
10928 def SetInvokingWindow(*args
, **kwargs
):
10929 """SetInvokingWindow(self, Window win)"""
10930 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
10932 def GetInvokingWindow(*args
, **kwargs
):
10933 """GetInvokingWindow(self) -> Window"""
10934 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
10936 def GetStyle(*args
, **kwargs
):
10937 """GetStyle(self) -> long"""
10938 return _core_
.Menu_GetStyle(*args
, **kwargs
)
10940 def UpdateUI(*args
, **kwargs
):
10941 """UpdateUI(self, EvtHandler source=None)"""
10942 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
10944 def GetMenuBar(*args
, **kwargs
):
10945 """GetMenuBar(self) -> MenuBar"""
10946 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
10948 def Attach(*args
, **kwargs
):
10949 """Attach(self, wxMenuBarBase menubar)"""
10950 return _core_
.Menu_Attach(*args
, **kwargs
)
10952 def Detach(*args
, **kwargs
):
10954 return _core_
.Menu_Detach(*args
, **kwargs
)
10956 def IsAttached(*args
, **kwargs
):
10957 """IsAttached(self) -> bool"""
10958 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10960 def SetParent(*args
, **kwargs
):
10961 """SetParent(self, Menu parent)"""
10962 return _core_
.Menu_SetParent(*args
, **kwargs
)
10964 def GetParent(*args
, **kwargs
):
10965 """GetParent(self) -> Menu"""
10966 return _core_
.Menu_GetParent(*args
, **kwargs
)
10968 EventHandler
= property(GetEventHandler
,SetEventHandler
,doc
="See `GetEventHandler` and `SetEventHandler`")
10969 HelpString
= property(GetHelpString
,SetHelpString
,doc
="See `GetHelpString` and `SetHelpString`")
10970 InvokingWindow
= property(GetInvokingWindow
,SetInvokingWindow
,doc
="See `GetInvokingWindow` and `SetInvokingWindow`")
10971 MenuBar
= property(GetMenuBar
,doc
="See `GetMenuBar`")
10972 MenuItemCount
= property(GetMenuItemCount
,doc
="See `GetMenuItemCount`")
10973 MenuItems
= property(GetMenuItems
,doc
="See `GetMenuItems`")
10974 Parent
= property(GetParent
,SetParent
,doc
="See `GetParent` and `SetParent`")
10975 Style
= property(GetStyle
,doc
="See `GetStyle`")
10976 Title
= property(GetTitle
,SetTitle
,doc
="See `GetTitle` and `SetTitle`")
10977 _core_
.Menu_swigregister(Menu
)
10978 DefaultValidator
= cvar
.DefaultValidator
10980 #---------------------------------------------------------------------------
10982 class MenuBar(Window
):
10983 """Proxy of C++ MenuBar class"""
10984 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10985 __repr__
= _swig_repr
10986 def __init__(self
, *args
, **kwargs
):
10987 """__init__(self, long style=0) -> MenuBar"""
10988 _core_
.MenuBar_swiginit(self
,_core_
.new_MenuBar(*args
, **kwargs
))
10989 self
._setOORInfo
(self
)
10991 def Append(*args
, **kwargs
):
10992 """Append(self, Menu menu, String title) -> bool"""
10993 return _core_
.MenuBar_Append(*args
, **kwargs
)
10995 def Insert(*args
, **kwargs
):
10996 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10997 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10999 def GetMenuCount(*args
, **kwargs
):
11000 """GetMenuCount(self) -> size_t"""
11001 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
11003 def GetMenu(*args
, **kwargs
):
11004 """GetMenu(self, size_t pos) -> Menu"""
11005 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
11007 def Replace(*args
, **kwargs
):
11008 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
11009 return _core_
.MenuBar_Replace(*args
, **kwargs
)
11011 def Remove(*args
, **kwargs
):
11012 """Remove(self, size_t pos) -> Menu"""
11013 return _core_
.MenuBar_Remove(*args
, **kwargs
)
11015 def EnableTop(*args
, **kwargs
):
11016 """EnableTop(self, size_t pos, bool enable)"""
11017 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
11019 def IsEnabledTop(*args
, **kwargs
):
11020 """IsEnabledTop(self, size_t pos) -> bool"""
11021 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
11023 def SetLabelTop(*args
, **kwargs
):
11024 """SetLabelTop(self, size_t pos, String label)"""
11025 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
11027 def GetLabelTop(*args
, **kwargs
):
11028 """GetLabelTop(self, size_t pos) -> String"""
11029 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
11031 def FindMenuItem(*args
, **kwargs
):
11032 """FindMenuItem(self, String menu, String item) -> int"""
11033 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
11035 def FindItemById(*args
, **kwargs
):
11036 """FindItemById(self, int id) -> MenuItem"""
11037 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
11039 def FindMenu(*args
, **kwargs
):
11040 """FindMenu(self, String title) -> int"""
11041 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
11043 def Enable(*args
, **kwargs
):
11044 """Enable(self, int id, bool enable)"""
11045 return _core_
.MenuBar_Enable(*args
, **kwargs
)
11047 def Check(*args
, **kwargs
):
11048 """Check(self, int id, bool check)"""
11049 return _core_
.MenuBar_Check(*args
, **kwargs
)
11051 def IsChecked(*args
, **kwargs
):
11052 """IsChecked(self, int id) -> bool"""
11053 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
11055 def IsEnabled(*args
, **kwargs
):
11056 """IsEnabled(self, int id) -> bool"""
11057 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
11059 def SetLabel(*args
, **kwargs
):
11060 """SetLabel(self, int id, String label)"""
11061 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
11063 def GetLabel(*args
, **kwargs
):
11064 """GetLabel(self, int id) -> String"""
11065 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
11067 def SetHelpString(*args
, **kwargs
):
11068 """SetHelpString(self, int id, String helpString)"""
11069 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
11071 def GetHelpString(*args
, **kwargs
):
11072 """GetHelpString(self, int id) -> String"""
11073 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
11075 def GetFrame(*args
, **kwargs
):
11076 """GetFrame(self) -> wxFrame"""
11077 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
11079 def IsAttached(*args
, **kwargs
):
11080 """IsAttached(self) -> bool"""
11081 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
11083 def Attach(*args
, **kwargs
):
11084 """Attach(self, wxFrame frame)"""
11085 return _core_
.MenuBar_Attach(*args
, **kwargs
)
11087 def Detach(*args
, **kwargs
):
11089 return _core_
.MenuBar_Detach(*args
, **kwargs
)
11091 def UpdateMenus(*args
, **kwargs
):
11092 """UpdateMenus(self)"""
11093 return _core_
.MenuBar_UpdateMenus(*args
, **kwargs
)
11095 def SetAutoWindowMenu(*args
, **kwargs
):
11096 """SetAutoWindowMenu(bool enable)"""
11097 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
11099 SetAutoWindowMenu
= staticmethod(SetAutoWindowMenu
)
11100 def GetAutoWindowMenu(*args
, **kwargs
):
11101 """GetAutoWindowMenu() -> bool"""
11102 return _core_
.MenuBar_GetAutoWindowMenu(*args
, **kwargs
)
11104 GetAutoWindowMenu
= staticmethod(GetAutoWindowMenu
)
11105 def GetMenus(self
):
11106 """Return a list of (menu, label) items for the menus in the MenuBar. """
11107 return [(self
.GetMenu(i
), self
.GetLabelTop(i
))
11108 for i
in range(self
.GetMenuCount())]
11110 def SetMenus(self
, items
):
11111 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11112 for i
in range(self
.GetMenuCount()-1, -1, -1):
11117 Frame
= property(GetFrame
,doc
="See `GetFrame`")
11118 MenuCount
= property(GetMenuCount
,doc
="See `GetMenuCount`")
11119 Menus
= property(GetMenus
,SetMenus
,doc
="See `GetMenus` and `SetMenus`")
11120 _core_
.MenuBar_swigregister(MenuBar
)
11122 def MenuBar_SetAutoWindowMenu(*args
, **kwargs
):
11123 """MenuBar_SetAutoWindowMenu(bool enable)"""
11124 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
11126 def MenuBar_GetAutoWindowMenu(*args
):
11127 """MenuBar_GetAutoWindowMenu() -> bool"""
11128 return _core_
.MenuBar_GetAutoWindowMenu(*args
)
11130 #---------------------------------------------------------------------------
11132 class MenuItem(Object
):
11133 """Proxy of C++ MenuItem class"""
11134 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11135 __repr__
= _swig_repr
11136 def __init__(self
, *args
, **kwargs
):
11138 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
11139 String help=EmptyString, int kind=ITEM_NORMAL,
11140 Menu subMenu=None) -> MenuItem
11142 _core_
.MenuItem_swiginit(self
,_core_
.new_MenuItem(*args
, **kwargs
))
11143 __swig_destroy__
= _core_
.delete_MenuItem
11144 __del__
= lambda self
: None;
11145 def Destroy(self
): pass
11146 def GetMenu(*args
, **kwargs
):
11147 """GetMenu(self) -> Menu"""
11148 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
11150 def SetMenu(*args
, **kwargs
):
11151 """SetMenu(self, Menu menu)"""
11152 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
11154 def SetId(*args
, **kwargs
):
11155 """SetId(self, int id)"""
11156 return _core_
.MenuItem_SetId(*args
, **kwargs
)
11158 def GetId(*args
, **kwargs
):
11159 """GetId(self) -> int"""
11160 return _core_
.MenuItem_GetId(*args
, **kwargs
)
11162 def IsSeparator(*args
, **kwargs
):
11163 """IsSeparator(self) -> bool"""
11164 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
11166 def SetText(*args
, **kwargs
):
11167 """SetText(self, String str)"""
11168 return _core_
.MenuItem_SetText(*args
, **kwargs
)
11170 def GetLabel(*args
, **kwargs
):
11171 """GetLabel(self) -> String"""
11172 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
11174 def GetText(*args
, **kwargs
):
11175 """GetText(self) -> String"""
11176 return _core_
.MenuItem_GetText(*args
, **kwargs
)
11178 def GetLabelFromText(*args
, **kwargs
):
11179 """GetLabelFromText(String text) -> String"""
11180 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
11182 GetLabelFromText
= staticmethod(GetLabelFromText
)
11183 def GetKind(*args
, **kwargs
):
11184 """GetKind(self) -> int"""
11185 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
11187 def SetKind(*args
, **kwargs
):
11188 """SetKind(self, int kind)"""
11189 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
11191 def SetCheckable(*args
, **kwargs
):
11192 """SetCheckable(self, bool checkable)"""
11193 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
11195 def IsCheckable(*args
, **kwargs
):
11196 """IsCheckable(self) -> bool"""
11197 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
11199 def IsSubMenu(*args
, **kwargs
):
11200 """IsSubMenu(self) -> bool"""
11201 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
11203 def SetSubMenu(*args
, **kwargs
):
11204 """SetSubMenu(self, Menu menu)"""
11205 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
11207 def GetSubMenu(*args
, **kwargs
):
11208 """GetSubMenu(self) -> Menu"""
11209 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
11211 def Enable(*args
, **kwargs
):
11212 """Enable(self, bool enable=True)"""
11213 return _core_
.MenuItem_Enable(*args
, **kwargs
)
11215 def IsEnabled(*args
, **kwargs
):
11216 """IsEnabled(self) -> bool"""
11217 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
11219 def Check(*args
, **kwargs
):
11220 """Check(self, bool check=True)"""
11221 return _core_
.MenuItem_Check(*args
, **kwargs
)
11223 def IsChecked(*args
, **kwargs
):
11224 """IsChecked(self) -> bool"""
11225 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
11227 def Toggle(*args
, **kwargs
):
11229 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
11231 def SetHelp(*args
, **kwargs
):
11232 """SetHelp(self, String str)"""
11233 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
11235 def GetHelp(*args
, **kwargs
):
11236 """GetHelp(self) -> String"""
11237 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
11239 def GetAccel(*args
, **kwargs
):
11240 """GetAccel(self) -> AcceleratorEntry"""
11241 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
11243 def SetAccel(*args
, **kwargs
):
11244 """SetAccel(self, AcceleratorEntry accel)"""
11245 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
11247 def SetBitmap(*args
, **kwargs
):
11248 """SetBitmap(self, Bitmap bitmap)"""
11249 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
11251 def GetBitmap(*args
, **kwargs
):
11252 """GetBitmap(self) -> Bitmap"""
11253 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
11255 def SetFont(*args
, **kwargs
):
11256 """SetFont(self, Font font)"""
11257 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
11259 def GetFont(*args
, **kwargs
):
11260 """GetFont(self) -> Font"""
11261 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
11263 def SetTextColour(*args
, **kwargs
):
11264 """SetTextColour(self, Colour colText)"""
11265 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
11267 def GetTextColour(*args
, **kwargs
):
11268 """GetTextColour(self) -> Colour"""
11269 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
11271 def SetBackgroundColour(*args
, **kwargs
):
11272 """SetBackgroundColour(self, Colour colBack)"""
11273 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
11275 def GetBackgroundColour(*args
, **kwargs
):
11276 """GetBackgroundColour(self) -> Colour"""
11277 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
11279 def SetBitmaps(*args
, **kwargs
):
11280 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11281 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
11283 def SetDisabledBitmap(*args
, **kwargs
):
11284 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11285 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
11287 def GetDisabledBitmap(*args
, **kwargs
):
11288 """GetDisabledBitmap(self) -> Bitmap"""
11289 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
11291 def SetMarginWidth(*args
, **kwargs
):
11292 """SetMarginWidth(self, int nWidth)"""
11293 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
11295 def GetMarginWidth(*args
, **kwargs
):
11296 """GetMarginWidth(self) -> int"""
11297 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
11299 def GetDefaultMarginWidth(*args
, **kwargs
):
11300 """GetDefaultMarginWidth() -> int"""
11301 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
11303 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
11304 def IsOwnerDrawn(*args
, **kwargs
):
11305 """IsOwnerDrawn(self) -> bool"""
11306 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
11308 def SetOwnerDrawn(*args
, **kwargs
):
11309 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11310 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
11312 def ResetOwnerDrawn(*args
, **kwargs
):
11313 """ResetOwnerDrawn(self)"""
11314 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
11316 Accel
= property(GetAccel
,SetAccel
,doc
="See `GetAccel` and `SetAccel`")
11317 BackgroundColour
= property(GetBackgroundColour
,SetBackgroundColour
,doc
="See `GetBackgroundColour` and `SetBackgroundColour`")
11318 Bitmap
= property(GetBitmap
,SetBitmap
,doc
="See `GetBitmap` and `SetBitmap`")
11319 DisabledBitmap
= property(GetDisabledBitmap
,SetDisabledBitmap
,doc
="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11320 Font
= property(GetFont
,SetFont
,doc
="See `GetFont` and `SetFont`")
11321 Help
= property(GetHelp
,SetHelp
,doc
="See `GetHelp` and `SetHelp`")
11322 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
11323 Kind
= property(GetKind
,SetKind
,doc
="See `GetKind` and `SetKind`")
11324 Label
= property(GetLabel
,doc
="See `GetLabel`")
11325 MarginWidth
= property(GetMarginWidth
,SetMarginWidth
,doc
="See `GetMarginWidth` and `SetMarginWidth`")
11326 Menu
= property(GetMenu
,SetMenu
,doc
="See `GetMenu` and `SetMenu`")
11327 SubMenu
= property(GetSubMenu
,SetSubMenu
,doc
="See `GetSubMenu` and `SetSubMenu`")
11328 Text
= property(GetText
,SetText
,doc
="See `GetText` and `SetText`")
11329 TextColour
= property(GetTextColour
,SetTextColour
,doc
="See `GetTextColour` and `SetTextColour`")
11330 _core_
.MenuItem_swigregister(MenuItem
)
11332 def MenuItem_GetLabelFromText(*args
, **kwargs
):
11333 """MenuItem_GetLabelFromText(String text) -> String"""
11334 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
11336 def MenuItem_GetDefaultMarginWidth(*args
):
11337 """MenuItem_GetDefaultMarginWidth() -> int"""
11338 return _core_
.MenuItem_GetDefaultMarginWidth(*args
)
11340 #---------------------------------------------------------------------------
11342 class Control(Window
):
11344 This is the base class for a control or 'widget'.
11346 A control is generally a small window which processes user input
11347 and/or displays one or more item of data.
11349 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11350 __repr__
= _swig_repr
11351 def __init__(self
, *args
, **kwargs
):
11353 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11354 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11355 String name=ControlNameStr) -> Control
11357 Create a Control. Normally you should only call this from a subclass'
11358 __init__ as a plain old wx.Control is not very useful.
11360 _core_
.Control_swiginit(self
,_core_
.new_Control(*args
, **kwargs
))
11361 self
._setOORInfo
(self
)
11363 def Create(*args
, **kwargs
):
11365 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11366 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11367 String name=ControlNameStr) -> bool
11369 Do the 2nd phase and create the GUI control.
11371 return _core_
.Control_Create(*args
, **kwargs
)
11373 def GetAlignment(*args
, **kwargs
):
11375 GetAlignment(self) -> int
11377 Get the control alignment (left/right/centre, top/bottom/centre)
11379 return _core_
.Control_GetAlignment(*args
, **kwargs
)
11381 def GetLabelText(*args
, **kwargs
):
11383 GetLabelText(self) -> String
11385 Get just the text of the label, without mnemonic characters ('&')
11387 return _core_
.Control_GetLabelText(*args
, **kwargs
)
11389 def Command(*args
, **kwargs
):
11391 Command(self, CommandEvent event)
11393 Simulates the effect of the user issuing a command to the item.
11395 :see: `wx.CommandEvent`
11398 return _core_
.Control_Command(*args
, **kwargs
)
11400 def GetClassDefaultAttributes(*args
, **kwargs
):
11402 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11404 Get the default attributes for this class. This is useful if you want
11405 to use the same font or colour in your own control as in a standard
11406 control -- which is a much better idea than hard coding specific
11407 colours or fonts which might look completely out of place on the
11408 user's system, especially if it uses themes.
11410 The variant parameter is only relevant under Mac currently and is
11411 ignore under other platforms. Under Mac, it will change the size of
11412 the returned font. See `wx.Window.SetWindowVariant` for more about
11415 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
11417 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
11418 Alignment
= property(GetAlignment
,doc
="See `GetAlignment`")
11419 LabelText
= property(GetLabelText
,doc
="See `GetLabelText`")
11420 _core_
.Control_swigregister(Control
)
11421 ControlNameStr
= cvar
.ControlNameStr
11423 def PreControl(*args
, **kwargs
):
11425 PreControl() -> Control
11427 Precreate a Control control for 2-phase creation
11429 val
= _core_
.new_PreControl(*args
, **kwargs
)
11432 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
11434 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11436 Get the default attributes for this class. This is useful if you want
11437 to use the same font or colour in your own control as in a standard
11438 control -- which is a much better idea than hard coding specific
11439 colours or fonts which might look completely out of place on the
11440 user's system, especially if it uses themes.
11442 The variant parameter is only relevant under Mac currently and is
11443 ignore under other platforms. Under Mac, it will change the size of
11444 the returned font. See `wx.Window.SetWindowVariant` for more about
11447 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
11449 #---------------------------------------------------------------------------
11451 class ItemContainer(object):
11453 The wx.ItemContainer class defines an interface which is implemented
11454 by all controls which have string subitems, each of which may be
11455 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11456 as `wx.ComboBox` which implements an extended interface deriving from
11459 It defines the methods for accessing the control's items and although
11460 each of the derived classes implements them differently, they still
11461 all conform to the same interface.
11463 The items in a wx.ItemContainer have (non empty) string labels and,
11464 optionally, client data associated with them.
11467 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11468 def __init__(self
): raise AttributeError, "No constructor defined"
11469 __repr__
= _swig_repr
11470 def Append(*args
, **kwargs
):
11472 Append(self, String item, PyObject clientData=None) -> int
11474 Adds the item to the control, associating the given data with the item
11475 if not None. The return value is the index of the newly added item
11476 which may be different from the last one if the control is sorted (e.g.
11477 has wx.LB_SORT or wx.CB_SORT style).
11479 return _core_
.ItemContainer_Append(*args
, **kwargs
)
11481 def AppendItems(*args
, **kwargs
):
11483 AppendItems(self, List strings)
11485 Apend several items at once to the control. Notice that calling this
11486 method may be much faster than appending the items one by one if you
11487 need to add a lot of items.
11489 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
11491 def Insert(*args
, **kwargs
):
11493 Insert(self, String item, int pos, PyObject clientData=None) -> int
11495 Insert an item into the control before the item at the ``pos`` index,
11496 optionally associating some data object with the item.
11498 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
11500 def Clear(*args
, **kwargs
):
11504 Removes all items from the control.
11506 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
11508 def Delete(*args
, **kwargs
):
11510 Delete(self, int n)
11512 Deletes the item at the zero-based index 'n' from the control. Note
11513 that it is an error (signalled by a `wx.PyAssertionError` exception if
11514 enabled) to remove an item with the index negative or greater or equal
11515 than the number of items in the control.
11517 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
11519 def GetClientData(*args
, **kwargs
):
11521 GetClientData(self, int n) -> PyObject
11523 Returns the client data associated with the given item, (if any.)
11525 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
11527 def SetClientData(*args
, **kwargs
):
11529 SetClientData(self, int n, PyObject clientData)
11531 Associate the given client data with the item at position n.
11533 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
11535 def GetCount(*args
, **kwargs
):
11537 GetCount(self) -> int
11539 Returns the number of items in the control.
11541 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
11543 def IsEmpty(*args
, **kwargs
):
11545 IsEmpty(self) -> bool
11547 Returns True if the control is empty or False if it has some items.
11549 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
11551 def GetString(*args
, **kwargs
):
11553 GetString(self, int n) -> String
11555 Returns the label of the item with the given index.
11557 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
11559 def GetStrings(*args
, **kwargs
):
11560 """GetStrings(self) -> wxArrayString"""
11561 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
11563 def SetString(*args
, **kwargs
):
11565 SetString(self, int n, String s)
11567 Sets the label for the given item.
11569 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
11571 def FindString(*args
, **kwargs
):
11573 FindString(self, String s) -> int
11575 Finds an item whose label matches the given string. Returns the
11576 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11579 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
11581 def SetSelection(*args
, **kwargs
):
11583 SetSelection(self, int n)
11585 Sets the item at index 'n' to be the selected item.
11587 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
11589 def GetSelection(*args
, **kwargs
):
11591 GetSelection(self) -> int
11593 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11596 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
11598 def SetStringSelection(*args
, **kwargs
):
11599 """SetStringSelection(self, String s) -> bool"""
11600 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
11602 def GetStringSelection(*args
, **kwargs
):
11604 GetStringSelection(self) -> String
11606 Returns the label of the selected item or an empty string if no item
11609 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
11611 def Select(*args
, **kwargs
):
11613 Select(self, int n)
11615 This is the same as `SetSelection` and exists only because it is
11616 slightly more natural for controls which support multiple selection.
11618 return _core_
.ItemContainer_Select(*args
, **kwargs
)
11620 def GetItems(self
):
11621 """Return a list of the strings in the control"""
11622 return [self
.GetString(i
) for i
in xrange(self
.GetCount())]
11624 def SetItems(self
, items
):
11625 """Clear and set the strings in the control from a list"""
11630 Count
= property(GetCount
,doc
="See `GetCount`")
11631 Items
= property(GetItems
,SetItems
,doc
="See `GetItems` and `SetItems`")
11632 Selection
= property(GetSelection
,SetSelection
,doc
="See `GetSelection` and `SetSelection`")
11633 StringSelection
= property(GetStringSelection
,SetStringSelection
,doc
="See `GetStringSelection` and `SetStringSelection`")
11634 Strings
= property(GetStrings
,doc
="See `GetStrings`")
11635 _core_
.ItemContainer_swigregister(ItemContainer
)
11637 #---------------------------------------------------------------------------
11639 class ControlWithItems(Control
,ItemContainer
):
11641 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11642 wx.Control class, and is used for the base class of various controls
11645 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11646 def __init__(self
): raise AttributeError, "No constructor defined"
11647 __repr__
= _swig_repr
11648 _core_
.ControlWithItems_swigregister(ControlWithItems
)
11650 #---------------------------------------------------------------------------
11652 class SizerFlags(object):
11654 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11655 to specify a lot of flags and parameters which can be unwieldy. This
11656 is where wx.SizerFlags comes in: it allows you to specify all
11657 parameters using the named methods instead. For example, instead of::
11659 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11661 you can now write::
11663 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11665 This is more readable and also allows you to create wx.SizerFlags
11666 objects which can be reused for several sizer items.::
11668 flagsExpand = wx.SizerFlags(1)
11669 flagsExpand.Expand().Border(wx.ALL, 10)
11670 sizer.AddF(ctrl1, flagsExpand)
11671 sizer.AddF(ctrl2, flagsExpand)
11673 Note that by specification, all methods of wx.SizerFlags return the
11674 wx.SizerFlags object itself allowing chaining multiple method calls
11675 like in the examples above.
11677 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11678 __repr__
= _swig_repr
11679 def __init__(self
, *args
, **kwargs
):
11681 __init__(self, int proportion=0) -> SizerFlags
11683 Constructs the flags object with the specified proportion.
11685 _core_
.SizerFlags_swiginit(self
,_core_
.new_SizerFlags(*args
, **kwargs
))
11686 __swig_destroy__
= _core_
.delete_SizerFlags
11687 __del__
= lambda self
: None;
11688 def Proportion(*args
, **kwargs
):
11690 Proportion(self, int proportion) -> SizerFlags
11692 Sets the item's proportion value.
11694 return _core_
.SizerFlags_Proportion(*args
, **kwargs
)
11696 def Align(*args
, **kwargs
):
11698 Align(self, int alignment) -> SizerFlags
11700 Sets the item's alignment
11702 return _core_
.SizerFlags_Align(*args
, **kwargs
)
11704 def Expand(*args
, **kwargs
):
11706 Expand(self) -> SizerFlags
11708 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11709 fill as much space as it is given by the sizer.
11711 return _core_
.SizerFlags_Expand(*args
, **kwargs
)
11713 def Centre(*args
, **kwargs
):
11715 Centre(self) -> SizerFlags
11717 Same as `Center` for those with an alternate dialect of English.
11719 return _core_
.SizerFlags_Centre(*args
, **kwargs
)
11721 def Center(*args
, **kwargs
):
11723 Center(self) -> SizerFlags
11725 Sets the centering alignment flags.
11727 return _core_
.SizerFlags_Center(*args
, **kwargs
)
11729 def Left(*args
, **kwargs
):
11731 Left(self) -> SizerFlags
11733 Aligns the object to the left, a shortcut for calling
11734 Align(wx.ALIGN_LEFT)
11736 return _core_
.SizerFlags_Left(*args
, **kwargs
)
11738 def Right(*args
, **kwargs
):
11740 Right(self) -> SizerFlags
11742 Aligns the object to the right, a shortcut for calling
11743 Align(wx.ALIGN_RIGHT)
11745 return _core_
.SizerFlags_Right(*args
, **kwargs
)
11747 def Top(*args
, **kwargs
):
11749 Top(self) -> SizerFlags
11751 Aligns the object to the top of the available space, a shortcut for
11752 calling Align(wx.ALIGN_TOP)
11754 return _core_
.SizerFlags_Top(*args
, **kwargs
)
11756 def Bottom(*args
, **kwargs
):
11758 Bottom(self) -> SizerFlags
11760 Aligns the object to the bottom of the available space, a shortcut for
11761 calling Align(wx.ALIGN_BOTTOM)
11763 return _core_
.SizerFlags_Bottom(*args
, **kwargs
)
11765 def Shaped(*args
, **kwargs
):
11767 Shaped(self) -> SizerFlags
11769 Sets the wx.SHAPED flag.
11771 return _core_
.SizerFlags_Shaped(*args
, **kwargs
)
11773 def FixedMinSize(*args
, **kwargs
):
11775 FixedMinSize(self) -> SizerFlags
11777 Sets the wx.FIXED_MINSIZE flag.
11779 return _core_
.SizerFlags_FixedMinSize(*args
, **kwargs
)
11781 def Border(*args
, **kwargs
):
11783 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11785 Sets the border of the item in the direction(s) or sides given by the
11786 direction parameter. If the borderInPixels value is not given then
11787 the default border size (see `GetDefaultBorder`) will be used.
11789 return _core_
.SizerFlags_Border(*args
, **kwargs
)
11791 def DoubleBorder(*args
, **kwargs
):
11793 DoubleBorder(self, int direction=ALL) -> SizerFlags
11795 Sets the border in the given direction to twice the default border
11798 return _core_
.SizerFlags_DoubleBorder(*args
, **kwargs
)
11800 def TripleBorder(*args
, **kwargs
):
11802 TripleBorder(self, int direction=ALL) -> SizerFlags
11804 Sets the border in the given direction to three times the default
11807 return _core_
.SizerFlags_TripleBorder(*args
, **kwargs
)
11809 def HorzBorder(*args
, **kwargs
):
11811 HorzBorder(self) -> SizerFlags
11813 Sets the left and right borders to the default border size.
11815 return _core_
.SizerFlags_HorzBorder(*args
, **kwargs
)
11817 def DoubleHorzBorder(*args
, **kwargs
):
11819 DoubleHorzBorder(self) -> SizerFlags
11821 Sets the left and right borders to twice the default border size.
11823 return _core_
.SizerFlags_DoubleHorzBorder(*args
, **kwargs
)
11825 def GetDefaultBorder(*args
, **kwargs
):
11827 GetDefaultBorder() -> int
11829 Returns the default border size used by the other border methods
11831 return _core_
.SizerFlags_GetDefaultBorder(*args
, **kwargs
)
11833 GetDefaultBorder
= staticmethod(GetDefaultBorder
)
11834 def GetProportion(*args
, **kwargs
):
11836 GetProportion(self) -> int
11838 Returns the proportion value to be used in the sizer item.
11840 return _core_
.SizerFlags_GetProportion(*args
, **kwargs
)
11842 def GetFlags(*args
, **kwargs
):
11844 GetFlags(self) -> int
11846 Returns the flags value to be used in the sizer item.
11848 return _core_
.SizerFlags_GetFlags(*args
, **kwargs
)
11850 def GetBorderInPixels(*args
, **kwargs
):
11852 GetBorderInPixels(self) -> int
11854 Returns the border value in pixels to be used in the sizer item.
11856 return _core_
.SizerFlags_GetBorderInPixels(*args
, **kwargs
)
11858 _core_
.SizerFlags_swigregister(SizerFlags
)
11860 def SizerFlags_GetDefaultBorder(*args
):
11862 SizerFlags_GetDefaultBorder() -> int
11864 Returns the default border size used by the other border methods
11866 return _core_
.SizerFlags_GetDefaultBorder(*args
)
11868 class SizerItem(Object
):
11870 The wx.SizerItem class is used to track the position, size and other
11871 attributes of each item managed by a `wx.Sizer`. It is not usually
11872 necessary to use this class because the sizer elements can also be
11873 identified by their positions or window or sizer references but
11874 sometimes it may be more convenient to use wx.SizerItem directly.
11875 Also, custom classes derived from `wx.PySizer` will probably need to
11876 use the collection of wx.SizerItems held by wx.Sizer when calculating
11879 :see: `wx.Sizer`, `wx.GBSizerItem`
11881 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11882 __repr__
= _swig_repr
11883 def __init__(self
, *args
, **kwargs
):
11885 __init__(self) -> SizerItem
11887 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11888 size will need to be set before this item can be used in a Sizer.
11890 You will probably never need to create a wx.SizerItem directly as they
11891 are created automatically when the sizer's Add, Insert or Prepend
11892 methods are called.
11894 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11896 _core_
.SizerItem_swiginit(self
,_core_
.new_SizerItem(*args
, **kwargs
))
11897 __swig_destroy__
= _core_
.delete_SizerItem
11898 __del__
= lambda self
: None;
11899 def DeleteWindows(*args
, **kwargs
):
11901 DeleteWindows(self)
11903 Destroy the window or the windows in a subsizer, depending on the type
11906 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
11908 def DetachSizer(*args
, **kwargs
):
11912 Enable deleting the SizerItem without destroying the contained sizer.
11914 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
11916 def GetSize(*args
, **kwargs
):
11918 GetSize(self) -> Size
11920 Get the current size of the item, as set in the last Layout.
11922 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
11924 def CalcMin(*args
, **kwargs
):
11926 CalcMin(self) -> Size
11928 Calculates the minimum desired size for the item, including any space
11931 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
11933 def SetDimension(*args
, **kwargs
):
11935 SetDimension(self, Point pos, Size size)
11937 Set the position and size of the space allocated for this item by the
11938 sizer, and adjust the position and size of the item (window or
11939 subsizer) to be within that space taking alignment and borders into
11942 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
11944 def GetMinSize(*args
, **kwargs
):
11946 GetMinSize(self) -> Size
11948 Get the minimum size needed for the item.
11950 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
11952 def GetMinSizeWithBorder(*args
, **kwargs
):
11954 GetMinSizeWithBorder(self) -> Size
11956 Get the minimum size needed for the item with space for the borders
11959 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
11961 def SetInitSize(*args
, **kwargs
):
11962 """SetInitSize(self, int x, int y)"""
11963 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
11965 def SetRatioWH(*args
, **kwargs
):
11967 SetRatioWH(self, int width, int height)
11969 Set the ratio item attribute.
11971 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
11973 def SetRatioSize(*args
, **kwargs
):
11975 SetRatioSize(self, Size size)
11977 Set the ratio item attribute.
11979 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
11981 def SetRatio(*args
, **kwargs
):
11983 SetRatio(self, float ratio)
11985 Set the ratio item attribute.
11987 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
11989 def GetRatio(*args
, **kwargs
):
11991 GetRatio(self) -> float
11993 Set the ratio item attribute.
11995 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
11997 def GetRect(*args
, **kwargs
):
11999 GetRect(self) -> Rect
12001 Returns the rectangle that the sizer item should occupy
12003 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
12005 def IsWindow(*args
, **kwargs
):
12007 IsWindow(self) -> bool
12009 Is this sizer item a window?
12011 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
12013 def IsSizer(*args
, **kwargs
):
12015 IsSizer(self) -> bool
12017 Is this sizer item a subsizer?
12019 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
12021 def IsSpacer(*args
, **kwargs
):
12023 IsSpacer(self) -> bool
12025 Is this sizer item a spacer?
12027 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
12029 def SetProportion(*args
, **kwargs
):
12031 SetProportion(self, int proportion)
12033 Set the proportion value for this item.
12035 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
12037 def GetProportion(*args
, **kwargs
):
12039 GetProportion(self) -> int
12041 Get the proportion value for this item.
12043 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
12045 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
12046 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
12047 def SetFlag(*args
, **kwargs
):
12049 SetFlag(self, int flag)
12051 Set the flag value for this item.
12053 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
12055 def GetFlag(*args
, **kwargs
):
12057 GetFlag(self) -> int
12059 Get the flag value for this item.
12061 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
12063 def SetBorder(*args
, **kwargs
):
12065 SetBorder(self, int border)
12067 Set the border value for this item.
12069 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
12071 def GetBorder(*args
, **kwargs
):
12073 GetBorder(self) -> int
12075 Get the border value for this item.
12077 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
12079 def GetWindow(*args
, **kwargs
):
12081 GetWindow(self) -> Window
12083 Get the window (if any) that is managed by this sizer item.
12085 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
12087 def SetWindow(*args
, **kwargs
):
12089 SetWindow(self, Window window)
12091 Set the window to be managed by this sizer item.
12093 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
12095 def GetSizer(*args
, **kwargs
):
12097 GetSizer(self) -> Sizer
12099 Get the subsizer (if any) that is managed by this sizer item.
12101 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
12103 def SetSizer(*args
, **kwargs
):
12105 SetSizer(self, Sizer sizer)
12107 Set the subsizer to be managed by this sizer item.
12109 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
12111 def GetSpacer(*args
, **kwargs
):
12113 GetSpacer(self) -> Size
12115 Get the size of the spacer managed by this sizer item.
12117 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
12119 def SetSpacer(*args
, **kwargs
):
12121 SetSpacer(self, Size size)
12123 Set the size of the spacer to be managed by this sizer item.
12125 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
12127 def Show(*args
, **kwargs
):
12129 Show(self, bool show)
12131 Set the show item attribute, which sizers use to determine if the item
12132 is to be made part of the layout or not. If the item is tracking a
12133 window then it is shown or hidden as needed.
12135 return _core_
.SizerItem_Show(*args
, **kwargs
)
12137 def IsShown(*args
, **kwargs
):
12139 IsShown(self) -> bool
12141 Is the item to be shown in the layout?
12143 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
12145 def GetPosition(*args
, **kwargs
):
12147 GetPosition(self) -> Point
12149 Returns the current position of the item, as set in the last Layout.
12151 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
12153 def GetUserData(*args
, **kwargs
):
12155 GetUserData(self) -> PyObject
12157 Returns the userData associated with this sizer item, or None if there
12160 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
12162 def SetUserData(*args
, **kwargs
):
12164 SetUserData(self, PyObject userData)
12166 Associate a Python object with this sizer item.
12168 return _core_
.SizerItem_SetUserData(*args
, **kwargs
)
12170 Border
= property(GetBorder
,SetBorder
,doc
="See `GetBorder` and `SetBorder`")
12171 Flag
= property(GetFlag
,SetFlag
,doc
="See `GetFlag` and `SetFlag`")
12172 MinSize
= property(GetMinSize
,doc
="See `GetMinSize`")
12173 MinSizeWithBorder
= property(GetMinSizeWithBorder
,doc
="See `GetMinSizeWithBorder`")
12174 Position
= property(GetPosition
,doc
="See `GetPosition`")
12175 Proportion
= property(GetProportion
,SetProportion
,doc
="See `GetProportion` and `SetProportion`")
12176 Ratio
= property(GetRatio
,SetRatio
,doc
="See `GetRatio` and `SetRatio`")
12177 Rect
= property(GetRect
,doc
="See `GetRect`")
12178 Size
= property(GetSize
,doc
="See `GetSize`")
12179 Sizer
= property(GetSizer
,SetSizer
,doc
="See `GetSizer` and `SetSizer`")
12180 Spacer
= property(GetSpacer
,SetSpacer
,doc
="See `GetSpacer` and `SetSpacer`")
12181 UserData
= property(GetUserData
,SetUserData
,doc
="See `GetUserData` and `SetUserData`")
12182 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
12183 _core_
.SizerItem_swigregister(SizerItem
)
12185 def SizerItemWindow(*args
, **kwargs
):
12187 SizerItemWindow(Window window, int proportion, int flag, int border,
12188 PyObject userData=None) -> SizerItem
12190 Constructs a `wx.SizerItem` for tracking a window.
12192 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
12195 def SizerItemSpacer(*args
, **kwargs
):
12197 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
12198 PyObject userData=None) -> SizerItem
12200 Constructs a `wx.SizerItem` for tracking a spacer.
12202 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
12205 def SizerItemSizer(*args
, **kwargs
):
12207 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
12208 PyObject userData=None) -> SizerItem
12210 Constructs a `wx.SizerItem` for tracking a subsizer
12212 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
12215 class Sizer(Object
):
12217 wx.Sizer is the abstract base class used for laying out subwindows in
12218 a window. You cannot use wx.Sizer directly; instead, you will have to
12219 use one of the sizer classes derived from it such as `wx.BoxSizer`,
12220 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12223 The concept implemented by sizers in wxWidgets is closely related to
12224 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12225 toolkit or the Qt toolkit. It is based upon the idea of the individual
12226 subwindows reporting their minimal required size and their ability to
12227 get stretched if the size of the parent window has changed. This will
12228 most often mean that the programmer does not set the original size of
12229 a dialog in the beginning, rather the dialog will assigned a sizer and
12230 this sizer will be queried about the recommended size. The sizer in
12231 turn will query its children, which can be normal windows or contorls,
12232 empty space or other sizers, so that a hierarchy of sizers can be
12233 constructed. Note that wxSizer does not derive from wxWindow and thus
12234 do not interfere with tab ordering and requires very little resources
12235 compared to a real window on screen.
12237 What makes sizers so well fitted for use in wxWidgets is the fact that
12238 every control reports its own minimal size and the algorithm can
12239 handle differences in font sizes or different window (dialog item)
12240 sizes on different platforms without problems. If for example the
12241 standard font as well as the overall design of Mac widgets requires
12242 more space than on Windows, then the initial size of a dialog using a
12243 sizer will automatically be bigger on Mac than on Windows.
12245 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12246 def __init__(self
): raise AttributeError, "No constructor defined"
12247 __repr__
= _swig_repr
12248 __swig_destroy__
= _core_
.delete_Sizer
12249 __del__
= lambda self
: None;
12250 def _setOORInfo(*args
, **kwargs
):
12251 """_setOORInfo(self, PyObject _self)"""
12252 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
12254 def Add(*args
, **kwargs
):
12256 Add(self, item, int proportion=0, int flag=0, int border=0,
12257 PyObject userData=None) -> wx.SizerItem
12259 Appends a child item to the sizer.
12261 return _core_
.Sizer_Add(*args
, **kwargs
)
12263 def AddF(*args
, **kwargs
):
12265 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12267 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12268 setting the various flags, options and borders.
12270 return _core_
.Sizer_AddF(*args
, **kwargs
)
12272 def Insert(*args
, **kwargs
):
12274 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
12275 PyObject userData=None) -> wx.SizerItem
12277 Inserts a new item into the list of items managed by this sizer before
12278 the item at index *before*. See `Add` for a description of the parameters.
12280 return _core_
.Sizer_Insert(*args
, **kwargs
)
12282 def InsertF(*args
, **kwargs
):
12284 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12286 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12287 for setting the various flags, options and borders.
12289 return _core_
.Sizer_InsertF(*args
, **kwargs
)
12291 def Prepend(*args
, **kwargs
):
12293 Prepend(self, item, int proportion=0, int flag=0, int border=0,
12294 PyObject userData=None) -> wx.SizerItem
12296 Adds a new item to the begining of the list of sizer items managed by
12297 this sizer. See `Add` for a description of the parameters.
12299 return _core_
.Sizer_Prepend(*args
, **kwargs
)
12301 def PrependF(*args
, **kwargs
):
12303 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12305 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12306 for setting the various flags, options and borders.
12308 return _core_
.Sizer_PrependF(*args
, **kwargs
)
12310 def Remove(*args
, **kwargs
):
12312 Remove(self, item) -> bool
12314 Removes an item from the sizer and destroys it. This method does not
12315 cause any layout or resizing to take place, call `Layout` to update
12316 the layout on screen after removing a child from the sizer. The
12317 *item* parameter can be either a window, a sizer, or the zero-based
12318 index of an item to remove. Returns True if the child item was found
12321 return _core_
.Sizer_Remove(*args
, **kwargs
)
12323 def Detach(*args
, **kwargs
):
12325 Detach(self, item) -> bool
12327 Detaches an item from the sizer without destroying it. This method
12328 does not cause any layout or resizing to take place, call `Layout` to
12329 do so. The *item* parameter can be either a window, a sizer, or the
12330 zero-based index of the item to be detached. Returns True if the child item
12331 was found and detached.
12333 return _core_
.Sizer_Detach(*args
, **kwargs
)
12335 def GetItem(*args
, **kwargs
):
12337 GetItem(self, item, recursive=False) -> wx.SizerItem
12339 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12340 parameter can be either a window, a sizer, or the zero-based index of
12341 the item to be found.
12343 return _core_
.Sizer_GetItem(*args
, **kwargs
)
12345 def _SetItemMinSize(*args
, **kwargs
):
12346 """_SetItemMinSize(self, PyObject item, Size size)"""
12347 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
12349 def _ReplaceWin(*args
, **kwargs
):
12350 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12351 return _core_
.Sizer__ReplaceWin(*args
, **kwargs
)
12353 def _ReplaceSizer(*args
, **kwargs
):
12354 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12355 return _core_
.Sizer__ReplaceSizer(*args
, **kwargs
)
12357 def _ReplaceItem(*args
, **kwargs
):
12358 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12359 return _core_
.Sizer__ReplaceItem(*args
, **kwargs
)
12361 def Replace(self
, olditem
, item
, recursive
=False):
12363 Detaches the given ``olditem`` from the sizer and replaces it with
12364 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12365 detached child is destroyed only if it is not a window, (because
12366 windows are owned by their parent, not the sizer.) The
12367 ``recursive`` parameter can be used to search for the given
12368 element recursivly in subsizers.
12370 This method does not cause any layout or resizing to take place,
12371 call `Layout` to do so.
12373 Returns ``True`` if the child item was found and removed.
12375 if isinstance(olditem
, wx
.Window
):
12376 return self
._ReplaceWin
(olditem
, item
, recursive
)
12377 elif isinstance(olditem
, wx
.Sizer
):
12378 return self
._ReplaceSizer
(olditem
, item
, recursive
)
12379 elif isinstance(olditem
, int):
12380 return self
._ReplaceItem
(olditem
, item
)
12382 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12384 def SetContainingWindow(*args
, **kwargs
):
12386 SetContainingWindow(self, Window window)
12388 Set (or unset) the window this sizer is used in.
12390 return _core_
.Sizer_SetContainingWindow(*args
, **kwargs
)
12392 def GetContainingWindow(*args
, **kwargs
):
12394 GetContainingWindow(self) -> Window
12396 Get the window this sizer is used in.
12398 return _core_
.Sizer_GetContainingWindow(*args
, **kwargs
)
12400 def SetItemMinSize(self
, item
, *args
):
12402 SetItemMinSize(self, item, Size size)
12404 Sets the minimum size that will be allocated for an item in the sizer.
12405 The *item* parameter can be either a window, a sizer, or the
12406 zero-based index of the item. If a window or sizer is given then it
12407 will be searched for recursivly in subsizers if neccessary.
12410 # for backward compatibility accept separate width,height args too
12411 return self
._SetItemMinSize
(item
, args
)
12413 return self
._SetItemMinSize
(item
, args
[0])
12415 def AddItem(*args
, **kwargs
):
12417 AddItem(self, SizerItem item)
12419 Adds a `wx.SizerItem` to the sizer.
12421 return _core_
.Sizer_AddItem(*args
, **kwargs
)
12423 def InsertItem(*args
, **kwargs
):
12425 InsertItem(self, int index, SizerItem item)
12427 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12429 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
12431 def PrependItem(*args
, **kwargs
):
12433 PrependItem(self, SizerItem item)
12435 Prepends a `wx.SizerItem` to the sizer.
12437 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
12439 def AddMany(self
, items
):
12441 AddMany is a convenience method for adding several items
12442 to a sizer at one time. Simply pass it a list of tuples,
12443 where each tuple consists of the parameters that you
12444 would normally pass to the `Add` method.
12447 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
12451 def AddSpacer(self
, *args
, **kw
):
12452 """AddSpacer(int size) --> SizerItem
12454 Add a spacer that is (size,size) pixels.
12456 if args
and type(args
[0]) == int:
12457 return self
.Add( (args
[0],args
[0] ), 0)
12458 else: # otherwise stay compatible with old AddSpacer
12459 return self
.Add(*args
, **kw
)
12460 def PrependSpacer(self
, *args
, **kw
):
12461 """PrependSpacer(int size) --> SizerItem
12463 Prepend a spacer that is (size, size) pixels."""
12464 if args
and type(args
[0]) == int:
12465 return self
.Prepend( (args
[0],args
[0] ), 0)
12466 else: # otherwise stay compatible with old PrependSpacer
12467 return self
.Prepend(*args
, **kw
)
12468 def InsertSpacer(self
, index
, *args
, **kw
):
12469 """InsertSpacer(int index, int size) --> SizerItem
12471 Insert a spacer at position index that is (size, size) pixels."""
12472 if args
and type(args
[0]) == int:
12473 return self
.Insert( index
, (args
[0],args
[0] ), 0)
12474 else: # otherwise stay compatible with old InsertSpacer
12475 return self
.Insert(index
, *args
, **kw
)
12478 def AddStretchSpacer(self
, prop
=1):
12479 """AddStretchSpacer(int prop=1) --> SizerItem
12481 Add a stretchable spacer."""
12482 return self
.Add((0,0), prop
)
12483 def PrependStretchSpacer(self
, prop
=1):
12484 """PrependStretchSpacer(int prop=1) --> SizerItem
12486 Prepend a stretchable spacer."""
12487 return self
.Prepend((0,0), prop
)
12488 def InsertStretchSpacer(self
, index
, prop
=1):
12489 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12491 Insert a stretchable spacer."""
12492 return self
.Insert(index
, (0,0), prop
)
12495 # for backwards compatibility only, please do not use in new code
12496 def AddWindow(self
, *args
, **kw
):
12497 """Compatibility alias for `Add`."""
12498 return self
.Add(*args
, **kw
)
12499 def AddSizer(self
, *args
, **kw
):
12500 """Compatibility alias for `Add`."""
12501 return self
.Add(*args
, **kw
)
12503 def PrependWindow(self
, *args
, **kw
):
12504 """Compatibility alias for `Prepend`."""
12505 return self
.Prepend(*args
, **kw
)
12506 def PrependSizer(self
, *args
, **kw
):
12507 """Compatibility alias for `Prepend`."""
12508 return self
.Prepend(*args
, **kw
)
12510 def InsertWindow(self
, *args
, **kw
):
12511 """Compatibility alias for `Insert`."""
12512 return self
.Insert(*args
, **kw
)
12513 def InsertSizer(self
, *args
, **kw
):
12514 """Compatibility alias for `Insert`."""
12515 return self
.Insert(*args
, **kw
)
12517 def RemoveWindow(self
, *args
, **kw
):
12518 """Compatibility alias for `Remove`."""
12519 return self
.Remove(*args
, **kw
)
12520 def RemoveSizer(self
, *args
, **kw
):
12521 """Compatibility alias for `Remove`."""
12522 return self
.Remove(*args
, **kw
)
12523 def RemovePos(self
, *args
, **kw
):
12524 """Compatibility alias for `Remove`."""
12525 return self
.Remove(*args
, **kw
)
12528 def SetDimension(*args
, **kwargs
):
12530 SetDimension(self, int x, int y, int width, int height)
12532 Call this to force the sizer to take the given dimension and thus
12533 force the items owned by the sizer to resize themselves according to
12534 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12537 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
12539 def SetMinSize(*args
, **kwargs
):
12541 SetMinSize(self, Size size)
12543 Call this to give the sizer a minimal size. Normally, the sizer will
12544 calculate its minimal size based purely on how much space its children
12545 need. After calling this method `GetMinSize` will return either the
12546 minimal size as requested by its children or the minimal size set
12547 here, depending on which is bigger.
12549 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
12551 def GetSize(*args
, **kwargs
):
12553 GetSize(self) -> Size
12555 Returns the current size of the space managed by the sizer.
12557 return _core_
.Sizer_GetSize(*args
, **kwargs
)
12559 def GetPosition(*args
, **kwargs
):
12561 GetPosition(self) -> Point
12563 Returns the current position of the sizer's managed space.
12565 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
12567 def GetMinSize(*args
, **kwargs
):
12569 GetMinSize(self) -> Size
12571 Returns the minimal size of the sizer. This is either the combined
12572 minimal size of all the children and their borders or the minimal size
12573 set by SetMinSize, depending on which is bigger.
12575 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
12577 def GetSizeTuple(self
):
12578 return self
.GetSize().Get()
12579 def GetPositionTuple(self
):
12580 return self
.GetPosition().Get()
12581 def GetMinSizeTuple(self
):
12582 return self
.GetMinSize().Get()
12584 def RecalcSizes(*args
, **kwargs
):
12588 Using the sizes calculated by `CalcMin` reposition and resize all the
12589 items managed by this sizer. You should not need to call this directly as
12590 it is called by `Layout`.
12592 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
12594 def CalcMin(*args
, **kwargs
):
12596 CalcMin(self) -> Size
12598 This method is where the sizer will do the actual calculation of its
12599 children's minimal sizes. You should not need to call this directly as
12600 it is called by `Layout`.
12602 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
12604 def Layout(*args
, **kwargs
):
12608 This method will force the recalculation and layout of the items
12609 controlled by the sizer using the current space allocated to the
12610 sizer. Normally this is called automatically from the owning window's
12611 EVT_SIZE handler, but it is also useful to call it from user code when
12612 one of the items in a sizer change size, or items are added or
12615 return _core_
.Sizer_Layout(*args
, **kwargs
)
12617 def Fit(*args
, **kwargs
):
12619 Fit(self, Window window) -> Size
12621 Tell the sizer to resize the *window* to match the sizer's minimal
12622 size. This is commonly done in the constructor of the window itself in
12623 order to set its initial size to match the needs of the children as
12624 determined by the sizer. Returns the new size.
12626 For a top level window this is the total window size, not the client size.
12628 return _core_
.Sizer_Fit(*args
, **kwargs
)
12630 def FitInside(*args
, **kwargs
):
12632 FitInside(self, Window window)
12634 Tell the sizer to resize the *virtual size* of the *window* to match the
12635 sizer's minimal size. This will not alter the on screen size of the
12636 window, but may cause the addition/removal/alteration of scrollbars
12637 required to view the virtual area in windows which manage it.
12639 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12642 return _core_
.Sizer_FitInside(*args
, **kwargs
)
12644 def SetSizeHints(*args
, **kwargs
):
12646 SetSizeHints(self, Window window)
12648 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12649 match the sizer's minimal size. This is commonly done in the
12650 constructor of the window itself if the window is resizable (as are
12651 many dialogs under Unix and frames on probably all platforms) in order
12652 to prevent the window from being sized smaller than the minimal size
12653 required by the sizer.
12655 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
12657 def SetVirtualSizeHints(*args
, **kwargs
):
12659 SetVirtualSizeHints(self, Window window)
12661 Tell the sizer to set the minimal size of the window virtual area to
12662 match the sizer's minimal size. For windows with managed scrollbars
12663 this will set them appropriately.
12665 :see: `wx.ScrolledWindow.SetScrollbars`
12668 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
12670 def Clear(*args
, **kwargs
):
12672 Clear(self, bool deleteWindows=False)
12674 Clear all items from the sizer, optionally destroying the window items
12677 return _core_
.Sizer_Clear(*args
, **kwargs
)
12679 def DeleteWindows(*args
, **kwargs
):
12681 DeleteWindows(self)
12683 Destroy all windows managed by the sizer.
12685 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
12687 def GetChildren(*args
, **kwargs
):
12689 GetChildren(self) -> list
12691 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12693 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
12695 def Show(*args
, **kwargs
):
12697 Show(self, item, bool show=True, bool recursive=false) -> bool
12699 Shows or hides an item managed by the sizer. To make a sizer item
12700 disappear or reappear, use Show followed by `Layout`. The *item*
12701 parameter can be either a window, a sizer, or the zero-based index of
12702 the item. Use the recursive parameter to show or hide an item in a
12703 subsizer. Returns True if the item was found.
12705 return _core_
.Sizer_Show(*args
, **kwargs
)
12707 def IsShown(*args
, **kwargs
):
12709 IsShown(self, item)
12711 Determines if the item is currently shown. To make a sizer
12712 item disappear or reappear, use Show followed by `Layout`. The *item*
12713 parameter can be either a window, a sizer, or the zero-based index of
12716 return _core_
.Sizer_IsShown(*args
, **kwargs
)
12718 def Hide(self
, item
, recursive
=False):
12720 A convenience method for `Show` (item, False, recursive).
12722 return self
.Show(item
, False, recursive
)
12724 def ShowItems(*args
, **kwargs
):
12726 ShowItems(self, bool show)
12728 Recursively call `wx.SizerItem.Show` on all sizer items.
12730 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
12732 Children
= property(GetChildren
,doc
="See `GetChildren`")
12733 ContainingWindow
= property(GetContainingWindow
,SetContainingWindow
,doc
="See `GetContainingWindow` and `SetContainingWindow`")
12734 MinSize
= property(GetMinSize
,SetMinSize
,doc
="See `GetMinSize` and `SetMinSize`")
12735 Position
= property(GetPosition
,doc
="See `GetPosition`")
12736 Size
= property(GetSize
,doc
="See `GetSize`")
12737 _core_
.Sizer_swigregister(Sizer
)
12739 class PySizer(Sizer
):
12741 wx.PySizer is a special version of `wx.Sizer` that has been
12742 instrumented to allow the C++ virtual methods to be overloaded in
12743 Python derived classes. You would derive from this class if you are
12744 wanting to implement a custom sizer in Python code. Simply implement
12745 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12748 class MySizer(wx.PySizer):
12749 def __init__(self):
12750 wx.PySizer.__init__(self)
12753 for item in self.GetChildren():
12754 # calculate the total minimum width and height needed
12755 # by all items in the sizer according to this sizer's
12756 # layout algorithm.
12758 return wx.Size(width, height)
12760 def RecalcSizes(self):
12761 # find the space allotted to this sizer
12762 pos = self.GetPosition()
12763 size = self.GetSize()
12764 for item in self.GetChildren():
12765 # Recalculate (if necessary) the position and size of
12766 # each item and then call item.SetDimension to do the
12767 # actual positioning and sizing of the items within the
12768 # space alloted to this sizer.
12770 item.SetDimension(itemPos, itemSize)
12773 When `Layout` is called it first calls `CalcMin` followed by
12774 `RecalcSizes` so you can optimize a bit by saving the results of
12775 `CalcMin` and reusing them in `RecalcSizes`.
12777 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12781 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12782 __repr__
= _swig_repr
12783 def __init__(self
, *args
, **kwargs
):
12785 __init__(self) -> PySizer
12787 Creates a wx.PySizer. Must be called from the __init__ in the derived
12790 _core_
.PySizer_swiginit(self
,_core_
.new_PySizer(*args
, **kwargs
))
12791 self
._setOORInfo
(self
);PySizer
._setCallbackInfo
(self
, self
, PySizer
)
12793 def _setCallbackInfo(*args
, **kwargs
):
12794 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12795 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
12797 _core_
.PySizer_swigregister(PySizer
)
12799 #---------------------------------------------------------------------------
12801 class BoxSizer(Sizer
):
12803 The basic idea behind a box sizer is that windows will most often be
12804 laid out in rather simple basic geometry, typically in a row or a
12805 column or nested hierarchies of either. A wx.BoxSizer will lay out
12806 its items in a simple row or column, depending on the orientation
12807 parameter passed to the constructor.
12809 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12810 __repr__
= _swig_repr
12811 def __init__(self
, *args
, **kwargs
):
12813 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12815 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12816 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12819 _core_
.BoxSizer_swiginit(self
,_core_
.new_BoxSizer(*args
, **kwargs
))
12820 self
._setOORInfo
(self
)
12822 def GetOrientation(*args
, **kwargs
):
12824 GetOrientation(self) -> int
12826 Returns the current orientation of the sizer.
12828 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
12830 def SetOrientation(*args
, **kwargs
):
12832 SetOrientation(self, int orient)
12834 Resets the orientation of the sizer.
12836 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
12838 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
12839 _core_
.BoxSizer_swigregister(BoxSizer
)
12841 #---------------------------------------------------------------------------
12843 class StaticBoxSizer(BoxSizer
):
12845 wx.StaticBoxSizer derives from and functions identically to the
12846 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12847 manages. Note that this static box must be created separately and
12848 passed to the sizer constructor.
12850 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12851 __repr__
= _swig_repr
12852 def __init__(self
, *args
, **kwargs
):
12854 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12856 Constructor. It takes an associated static box and the orientation
12857 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12860 _core_
.StaticBoxSizer_swiginit(self
,_core_
.new_StaticBoxSizer(*args
, **kwargs
))
12861 self
._setOORInfo
(self
)
12863 def GetStaticBox(*args
, **kwargs
):
12865 GetStaticBox(self) -> StaticBox
12867 Returns the static box associated with this sizer.
12869 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
12871 StaticBox
= property(GetStaticBox
,doc
="See `GetStaticBox`")
12872 _core_
.StaticBoxSizer_swigregister(StaticBoxSizer
)
12874 #---------------------------------------------------------------------------
12876 class GridSizer(Sizer
):
12878 A grid sizer is a sizer which lays out its children in a
12879 two-dimensional table with all cells having the same size. In other
12880 words, the width of each cell within the grid is the width of the
12881 widest item added to the sizer and the height of each grid cell is the
12882 height of the tallest item. An optional vertical and/or horizontal
12883 gap between items can also be specified (in pixels.)
12885 Items are placed in the cells of the grid in the order they are added,
12886 in row-major order. In other words, the first row is filled first,
12887 then the second, and so on until all items have been added. (If
12888 neccessary, additional rows will be added as items are added.) If you
12889 need to have greater control over the cells that items are placed in
12890 then use the `wx.GridBagSizer`.
12893 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12894 __repr__
= _swig_repr
12895 def __init__(self
, *args
, **kwargs
):
12897 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12899 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12900 of columns and rows in the sizer - if either of the parameters is
12901 zero, it will be calculated to from the total number of children in
12902 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12903 define extra space between all children.
12905 _core_
.GridSizer_swiginit(self
,_core_
.new_GridSizer(*args
, **kwargs
))
12906 self
._setOORInfo
(self
)
12908 def SetCols(*args
, **kwargs
):
12910 SetCols(self, int cols)
12912 Sets the number of columns in the sizer.
12914 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
12916 def SetRows(*args
, **kwargs
):
12918 SetRows(self, int rows)
12920 Sets the number of rows in the sizer.
12922 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
12924 def SetVGap(*args
, **kwargs
):
12926 SetVGap(self, int gap)
12928 Sets the vertical gap (in pixels) between the cells in the sizer.
12930 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
12932 def SetHGap(*args
, **kwargs
):
12934 SetHGap(self, int gap)
12936 Sets the horizontal gap (in pixels) between cells in the sizer
12938 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
12940 def GetCols(*args
, **kwargs
):
12942 GetCols(self) -> int
12944 Returns the number of columns in the sizer.
12946 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
12948 def GetRows(*args
, **kwargs
):
12950 GetRows(self) -> int
12952 Returns the number of rows in the sizer.
12954 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
12956 def GetVGap(*args
, **kwargs
):
12958 GetVGap(self) -> int
12960 Returns the vertical gap (in pixels) between the cells in the sizer.
12962 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
12964 def GetHGap(*args
, **kwargs
):
12966 GetHGap(self) -> int
12968 Returns the horizontal gap (in pixels) between cells in the sizer.
12970 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
12972 def CalcRowsCols(self
):
12974 CalcRowsCols() -> (rows, cols)
12976 Calculates how many rows and columns will be in the sizer based
12977 on the current number of items and also the rows, cols specified
12978 in the constructor.
12980 nitems
= len(self
.GetChildren())
12981 rows
= self
.GetRows()
12982 cols
= self
.GetCols()
12983 assert rows
!= 0 or cols
!= 0, "Grid sizer must have either rows or columns fixed"
12985 rows
= (nitems
+ cols
- 1) / cols
12987 cols
= (nitems
+ rows
- 1) / rows
12988 return (rows
, cols
)
12990 Cols
= property(GetCols
,SetCols
,doc
="See `GetCols` and `SetCols`")
12991 HGap
= property(GetHGap
,SetHGap
,doc
="See `GetHGap` and `SetHGap`")
12992 Rows
= property(GetRows
,SetRows
,doc
="See `GetRows` and `SetRows`")
12993 VGap
= property(GetVGap
,SetVGap
,doc
="See `GetVGap` and `SetVGap`")
12994 _core_
.GridSizer_swigregister(GridSizer
)
12996 #---------------------------------------------------------------------------
12998 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
12999 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
13000 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
13001 class FlexGridSizer(GridSizer
):
13003 A flex grid sizer is a sizer which lays out its children in a
13004 two-dimensional table with all table cells in one row having the same
13005 height and all cells in one column having the same width, but all
13006 rows or all columns are not necessarily the same height or width as in
13007 the `wx.GridSizer`.
13009 wx.FlexGridSizer can also size items equally in one direction but
13010 unequally ("flexibly") in the other. If the sizer is only flexible
13011 in one direction (this can be changed using `SetFlexibleDirection`), it
13012 needs to be decided how the sizer should grow in the other ("non
13013 flexible") direction in order to fill the available space. The
13014 `SetNonFlexibleGrowMode` method serves this purpose.
13018 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13019 __repr__
= _swig_repr
13020 def __init__(self
, *args
, **kwargs
):
13022 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
13024 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13025 number of columns and rows in the sizer - if either of the parameters
13026 is zero, it will be calculated to from the total number of children in
13027 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13028 define extra space between all children.
13030 _core_
.FlexGridSizer_swiginit(self
,_core_
.new_FlexGridSizer(*args
, **kwargs
))
13031 self
._setOORInfo
(self
)
13033 def AddGrowableRow(*args
, **kwargs
):
13035 AddGrowableRow(self, size_t idx, int proportion=0)
13037 Specifies that row *idx* (starting from zero) should be grown if there
13038 is extra space available to the sizer.
13040 The *proportion* parameter has the same meaning as the stretch factor
13041 for the box sizers except that if all proportions are 0, then all
13042 columns are resized equally (instead of not being resized at all).
13044 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
13046 def RemoveGrowableRow(*args
, **kwargs
):
13048 RemoveGrowableRow(self, size_t idx)
13050 Specifies that row *idx* is no longer growable.
13052 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
13054 def AddGrowableCol(*args
, **kwargs
):
13056 AddGrowableCol(self, size_t idx, int proportion=0)
13058 Specifies that column *idx* (starting from zero) should be grown if
13059 there is extra space available to the sizer.
13061 The *proportion* parameter has the same meaning as the stretch factor
13062 for the box sizers except that if all proportions are 0, then all
13063 columns are resized equally (instead of not being resized at all).
13065 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
13067 def RemoveGrowableCol(*args
, **kwargs
):
13069 RemoveGrowableCol(self, size_t idx)
13071 Specifies that column *idx* is no longer growable.
13073 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
13075 def SetFlexibleDirection(*args
, **kwargs
):
13077 SetFlexibleDirection(self, int direction)
13079 Specifies whether the sizer should flexibly resize its columns, rows,
13080 or both. Argument *direction* can be one of the following values. Any
13081 other value is ignored.
13083 ============== =======================================
13084 wx.VERTICAL Rows are flexibly sized.
13085 wx.HORIZONTAL Columns are flexibly sized.
13086 wx.BOTH Both rows and columns are flexibly sized
13087 (this is the default value).
13088 ============== =======================================
13090 Note that this method does not trigger relayout.
13093 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
13095 def GetFlexibleDirection(*args
, **kwargs
):
13097 GetFlexibleDirection(self) -> int
13099 Returns a value that specifies whether the sizer
13100 flexibly resizes its columns, rows, or both (default).
13102 :see: `SetFlexibleDirection`
13104 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
13106 def SetNonFlexibleGrowMode(*args
, **kwargs
):
13108 SetNonFlexibleGrowMode(self, int mode)
13110 Specifies how the sizer should grow in the non-flexible direction if
13111 there is one (so `SetFlexibleDirection` must have been called
13112 previously). Argument *mode* can be one of the following values:
13114 ========================== =================================================
13115 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13116 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13117 `AddGrowableCol` and `AddGrowableRow`. In this
13118 case equal sizing applies to minimum sizes of
13119 columns or rows (this is the default value).
13120 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13121 the non flexible direction, whether they are
13122 growable or not in the flexbile direction.
13123 ========================== =================================================
13125 Note that this method does not trigger relayout.
13127 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
13129 def GetNonFlexibleGrowMode(*args
, **kwargs
):
13131 GetNonFlexibleGrowMode(self) -> int
13133 Returns the value that specifies how the sizer grows in the
13134 non-flexible direction if there is one.
13136 :see: `SetNonFlexibleGrowMode`
13138 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
13140 def GetRowHeights(*args
, **kwargs
):
13142 GetRowHeights(self) -> list
13144 Returns a list of integers representing the heights of each of the
13147 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
13149 def GetColWidths(*args
, **kwargs
):
13151 GetColWidths(self) -> list
13153 Returns a list of integers representing the widths of each of the
13154 columns in the sizer.
13156 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
13158 ColWidths
= property(GetColWidths
,doc
="See `GetColWidths`")
13159 FlexibleDirection
= property(GetFlexibleDirection
,SetFlexibleDirection
,doc
="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13160 NonFlexibleGrowMode
= property(GetNonFlexibleGrowMode
,SetNonFlexibleGrowMode
,doc
="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13161 RowHeights
= property(GetRowHeights
,doc
="See `GetRowHeights`")
13162 _core_
.FlexGridSizer_swigregister(FlexGridSizer
)
13164 class StdDialogButtonSizer(BoxSizer
):
13166 A special sizer that knows how to order and position standard buttons
13167 in order to conform to the current platform's standards. You simply
13168 need to add each `wx.Button` to the sizer, and be sure to create the
13169 buttons using the standard ID's. Then call `Realize` and the sizer
13170 will take care of the rest.
13173 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13174 __repr__
= _swig_repr
13175 def __init__(self
, *args
, **kwargs
):
13176 """__init__(self) -> StdDialogButtonSizer"""
13177 _core_
.StdDialogButtonSizer_swiginit(self
,_core_
.new_StdDialogButtonSizer(*args
, **kwargs
))
13178 def AddButton(*args
, **kwargs
):
13180 AddButton(self, wxButton button)
13182 Use this to add the buttons to this sizer. Do not use the `Add`
13183 method in the base class.
13185 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
13187 def Realize(*args
, **kwargs
):
13191 This funciton needs to be called after all the buttons have been added
13192 to the sizer. It will reorder them and position them in a platform
13195 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
13197 def SetAffirmativeButton(*args
, **kwargs
):
13198 """SetAffirmativeButton(self, wxButton button)"""
13199 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
13201 def SetNegativeButton(*args
, **kwargs
):
13202 """SetNegativeButton(self, wxButton button)"""
13203 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
13205 def SetCancelButton(*args
, **kwargs
):
13206 """SetCancelButton(self, wxButton button)"""
13207 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
13209 def GetAffirmativeButton(*args
, **kwargs
):
13210 """GetAffirmativeButton(self) -> wxButton"""
13211 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
13213 def GetApplyButton(*args
, **kwargs
):
13214 """GetApplyButton(self) -> wxButton"""
13215 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
13217 def GetNegativeButton(*args
, **kwargs
):
13218 """GetNegativeButton(self) -> wxButton"""
13219 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
13221 def GetCancelButton(*args
, **kwargs
):
13222 """GetCancelButton(self) -> wxButton"""
13223 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
13225 def GetHelpButton(*args
, **kwargs
):
13226 """GetHelpButton(self) -> wxButton"""
13227 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
13229 AffirmativeButton
= property(GetAffirmativeButton
,SetAffirmativeButton
,doc
="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13230 ApplyButton
= property(GetApplyButton
,doc
="See `GetApplyButton`")
13231 CancelButton
= property(GetCancelButton
,SetCancelButton
,doc
="See `GetCancelButton` and `SetCancelButton`")
13232 HelpButton
= property(GetHelpButton
,doc
="See `GetHelpButton`")
13233 NegativeButton
= property(GetNegativeButton
,SetNegativeButton
,doc
="See `GetNegativeButton` and `SetNegativeButton`")
13234 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizer
)
13236 #---------------------------------------------------------------------------
13238 class GBPosition(object):
13240 This class represents the position of an item in a virtual grid of
13241 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13242 typemaps that will automatically convert from a 2-element sequence of
13243 integers to a wx.GBPosition, so you can use the more pythonic
13244 representation of the position nearly transparently in Python code.
13246 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13247 __repr__
= _swig_repr
13248 def __init__(self
, *args
, **kwargs
):
13250 __init__(self, int row=0, int col=0) -> GBPosition
13252 This class represents the position of an item in a virtual grid of
13253 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13254 typemaps that will automatically convert from a 2-element sequence of
13255 integers to a wx.GBPosition, so you can use the more pythonic
13256 representation of the position nearly transparently in Python code.
13258 _core_
.GBPosition_swiginit(self
,_core_
.new_GBPosition(*args
, **kwargs
))
13259 __swig_destroy__
= _core_
.delete_GBPosition
13260 __del__
= lambda self
: None;
13261 def GetRow(*args
, **kwargs
):
13262 """GetRow(self) -> int"""
13263 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
13265 def GetCol(*args
, **kwargs
):
13266 """GetCol(self) -> int"""
13267 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
13269 def SetRow(*args
, **kwargs
):
13270 """SetRow(self, int row)"""
13271 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
13273 def SetCol(*args
, **kwargs
):
13274 """SetCol(self, int col)"""
13275 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
13277 def __eq__(*args
, **kwargs
):
13279 __eq__(self, PyObject other) -> bool
13281 Compare GBPosition for equality.
13283 return _core_
.GBPosition___eq__(*args
, **kwargs
)
13285 def __ne__(*args
, **kwargs
):
13287 __ne__(self, PyObject other) -> bool
13289 Compare GBPosition for inequality.
13291 return _core_
.GBPosition___ne__(*args
, **kwargs
)
13293 def Set(*args
, **kwargs
):
13294 """Set(self, int row=0, int col=0)"""
13295 return _core_
.GBPosition_Set(*args
, **kwargs
)
13297 def Get(*args
, **kwargs
):
13298 """Get(self) -> PyObject"""
13299 return _core_
.GBPosition_Get(*args
, **kwargs
)
13301 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
13302 def __str__(self
): return str(self
.Get())
13303 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
13304 def __len__(self
): return len(self
.Get())
13305 def __getitem__(self
, index
): return self
.Get()[index
]
13306 def __setitem__(self
, index
, val
):
13307 if index
== 0: self
.SetRow(val
)
13308 elif index
== 1: self
.SetCol(val
)
13309 else: raise IndexError
13310 def __nonzero__(self
): return self
.Get() != (0,0)
13311 __safe_for_unpickling__
= True
13312 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
13314 row
= property(GetRow
, SetRow
)
13315 col
= property(GetCol
, SetCol
)
13317 _core_
.GBPosition_swigregister(GBPosition
)
13319 class GBSpan(object):
13321 This class is used to hold the row and column spanning attributes of
13322 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13323 automatically convert from a 2-element sequence of integers to a
13324 wx.GBSpan, so you can use the more pythonic representation of the span
13325 nearly transparently in Python code.
13328 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13329 __repr__
= _swig_repr
13330 def __init__(self
, *args
, **kwargs
):
13332 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
13334 Construct a new wxGBSpan, optionally setting the rowspan and
13335 colspan. The default is (1,1). (Meaning that the item occupies one
13336 cell in each direction.
13338 _core_
.GBSpan_swiginit(self
,_core_
.new_GBSpan(*args
, **kwargs
))
13339 __swig_destroy__
= _core_
.delete_GBSpan
13340 __del__
= lambda self
: None;
13341 def GetRowspan(*args
, **kwargs
):
13342 """GetRowspan(self) -> int"""
13343 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
13345 def GetColspan(*args
, **kwargs
):
13346 """GetColspan(self) -> int"""
13347 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
13349 def SetRowspan(*args
, **kwargs
):
13350 """SetRowspan(self, int rowspan)"""
13351 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
13353 def SetColspan(*args
, **kwargs
):
13354 """SetColspan(self, int colspan)"""
13355 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
13357 def __eq__(*args
, **kwargs
):
13359 __eq__(self, PyObject other) -> bool
13361 Compare wxGBSpan for equality.
13363 return _core_
.GBSpan___eq__(*args
, **kwargs
)
13365 def __ne__(*args
, **kwargs
):
13367 __ne__(self, PyObject other) -> bool
13369 Compare GBSpan for inequality.
13371 return _core_
.GBSpan___ne__(*args
, **kwargs
)
13373 def Set(*args
, **kwargs
):
13374 """Set(self, int rowspan=1, int colspan=1)"""
13375 return _core_
.GBSpan_Set(*args
, **kwargs
)
13377 def Get(*args
, **kwargs
):
13378 """Get(self) -> PyObject"""
13379 return _core_
.GBSpan_Get(*args
, **kwargs
)
13381 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
13382 def __str__(self
): return str(self
.Get())
13383 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
13384 def __len__(self
): return len(self
.Get())
13385 def __getitem__(self
, index
): return self
.Get()[index
]
13386 def __setitem__(self
, index
, val
):
13387 if index
== 0: self
.SetRowspan(val
)
13388 elif index
== 1: self
.SetColspan(val
)
13389 else: raise IndexError
13390 def __nonzero__(self
): return self
.Get() != (0,0)
13391 __safe_for_unpickling__
= True
13392 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
13394 rowspan
= property(GetRowspan
, SetRowspan
)
13395 colspan
= property(GetColspan
, SetColspan
)
13397 _core_
.GBSpan_swigregister(GBSpan
)
13399 class GBSizerItem(SizerItem
):
13401 The wx.GBSizerItem class is used to track the additional data about
13402 items in a `wx.GridBagSizer` such as the item's position in the grid
13403 and how many rows or columns it spans.
13406 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13407 __repr__
= _swig_repr
13408 def __init__(self
, *args
, **kwargs
):
13410 __init__(self) -> GBSizerItem
13412 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13413 size will need to be set, as well as a position and span before this
13414 item can be used in a Sizer.
13416 You will probably never need to create a wx.GBSizerItem directly as they
13417 are created automatically when the sizer's Add method is called.
13419 _core_
.GBSizerItem_swiginit(self
,_core_
.new_GBSizerItem(*args
, **kwargs
))
13420 __swig_destroy__
= _core_
.delete_GBSizerItem
13421 __del__
= lambda self
: None;
13422 def GetPos(*args
, **kwargs
):
13424 GetPos(self) -> GBPosition
13426 Get the grid position of the item
13428 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
13430 def GetPosTuple(self
): return self
.GetPos().Get()
13431 def GetSpan(*args
, **kwargs
):
13433 GetSpan(self) -> GBSpan
13435 Get the row and column spanning of the item
13437 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
13439 def GetSpanTuple(self
): return self
.GetSpan().Get()
13440 def SetPos(*args
, **kwargs
):
13442 SetPos(self, GBPosition pos) -> bool
13444 If the item is already a member of a sizer then first ensure that
13445 there is no other item that would intersect with this one at the new
13446 position, then set the new position. Returns True if the change is
13447 successful and after the next Layout() the item will be moved.
13449 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
13451 def SetSpan(*args
, **kwargs
):
13453 SetSpan(self, GBSpan span) -> bool
13455 If the item is already a member of a sizer then first ensure that
13456 there is no other item that would intersect with this one with its new
13457 spanning size, then set the new spanning. Returns True if the change
13458 is successful and after the next Layout() the item will be resized.
13461 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
13463 def Intersects(*args
, **kwargs
):
13465 Intersects(self, GBSizerItem other) -> bool
13467 Returns True if this item and the other item instersect.
13469 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
13471 def IntersectsPos(*args
, **kwargs
):
13473 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
13475 Returns True if the given pos/span would intersect with this item.
13477 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
13479 def GetEndPos(*args
, **kwargs
):
13481 GetEndPos(self) -> GBPosition
13483 Get the row and column of the endpoint of this item.
13485 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
13487 def GetGBSizer(*args
, **kwargs
):
13489 GetGBSizer(self) -> GridBagSizer
13491 Get the sizer this item is a member of.
13493 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
13495 def SetGBSizer(*args
, **kwargs
):
13497 SetGBSizer(self, GridBagSizer sizer)
13499 Set the sizer this item is a member of.
13501 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
13503 EndPos
= property(GetEndPos
,doc
="See `GetEndPos`")
13504 GBSizer
= property(GetGBSizer
,SetGBSizer
,doc
="See `GetGBSizer` and `SetGBSizer`")
13505 Pos
= property(GetPos
,SetPos
,doc
="See `GetPos` and `SetPos`")
13506 Span
= property(GetSpan
,SetSpan
,doc
="See `GetSpan` and `SetSpan`")
13507 _core_
.GBSizerItem_swigregister(GBSizerItem
)
13508 DefaultSpan
= cvar
.DefaultSpan
13510 def GBSizerItemWindow(*args
, **kwargs
):
13512 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
13513 int border, PyObject userData=None) -> GBSizerItem
13515 Construct a `wx.GBSizerItem` for a window.
13517 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
13520 def GBSizerItemSizer(*args
, **kwargs
):
13522 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
13523 int border, PyObject userData=None) -> GBSizerItem
13525 Construct a `wx.GBSizerItem` for a sizer
13527 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
13530 def GBSizerItemSpacer(*args
, **kwargs
):
13532 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
13533 int flag, int border, PyObject userData=None) -> GBSizerItem
13535 Construct a `wx.GBSizerItem` for a spacer.
13537 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
13540 class GridBagSizer(FlexGridSizer
):
13542 A `wx.Sizer` that can lay out items in a virtual grid like a
13543 `wx.FlexGridSizer` but in this case explicit positioning of the items
13544 is allowed using `wx.GBPosition`, and items can optionally span more
13545 than one row and/or column using `wx.GBSpan`. The total size of the
13546 virtual grid is determined by the largest row and column that items are
13547 positioned at, adjusted for spanning.
13550 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13551 __repr__
= _swig_repr
13552 def __init__(self
, *args
, **kwargs
):
13554 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
13556 Constructor, with optional parameters to specify the gap between the
13559 _core_
.GridBagSizer_swiginit(self
,_core_
.new_GridBagSizer(*args
, **kwargs
))
13560 self
._setOORInfo
(self
)
13562 def Add(*args
, **kwargs
):
13564 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
13565 int border=0, userData=None) -> wx.GBSizerItem
13567 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13568 more than one row or column as specified with *span*. The remaining
13569 args behave similarly to `wx.Sizer.Add`.
13571 Returns True if the item was successfully placed at the given cell
13572 position, False if something was already there.
13575 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
13577 def AddItem(*args
, **kwargs
):
13579 Add(self, GBSizerItem item) -> wx.GBSizerItem
13581 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13582 the item was successfully placed at its given cell position, False if
13583 something was already there.
13585 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
13587 def GetCellSize(*args
, **kwargs
):
13589 GetCellSize(self, int row, int col) -> Size
13591 Get the size of the specified cell, including hgap and
13592 vgap. Only valid after a Layout.
13594 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
13596 def GetEmptyCellSize(*args
, **kwargs
):
13598 GetEmptyCellSize(self) -> Size
13600 Get the size used for cells in the grid with no item.
13602 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
13604 def SetEmptyCellSize(*args
, **kwargs
):
13606 SetEmptyCellSize(self, Size sz)
13608 Set the size used for cells in the grid with no item.
13610 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
13612 def GetItemPosition(*args
):
13614 GetItemPosition(self, item) -> GBPosition
13616 Get the grid position of the specified *item* where *item* is either a
13617 window or subsizer that is a member of this sizer, or a zero-based
13620 return _core_
.GridBagSizer_GetItemPosition(*args
)
13622 def SetItemPosition(*args
):
13624 SetItemPosition(self, item, GBPosition pos) -> bool
13626 Set the grid position of the specified *item* where *item* is either a
13627 window or subsizer that is a member of this sizer, or a zero-based
13628 index of an item. Returns True on success. If the move is not
13629 allowed (because an item is already there) then False is returned.
13632 return _core_
.GridBagSizer_SetItemPosition(*args
)
13634 def GetItemSpan(*args
):
13636 GetItemSpan(self, item) -> GBSpan
13638 Get the row/col spanning of the specified *item* where *item* is
13639 either a window or subsizer that is a member of this sizer, or a
13640 zero-based index of an item.
13642 return _core_
.GridBagSizer_GetItemSpan(*args
)
13644 def SetItemSpan(*args
):
13646 SetItemSpan(self, item, GBSpan span) -> bool
13648 Set the row/col spanning of the specified *item* where *item* is
13649 either a window or subsizer that is a member of this sizer, or a
13650 zero-based index of an item. Returns True on success. If the move is
13651 not allowed (because an item is already there) then False is returned.
13653 return _core_
.GridBagSizer_SetItemSpan(*args
)
13655 def FindItem(*args
):
13657 FindItem(self, item) -> GBSizerItem
13659 Find the sizer item for the given window or subsizer, returns None if
13660 not found. (non-recursive)
13662 return _core_
.GridBagSizer_FindItem(*args
)
13664 def GetItem(self
, item
):
13666 si
= wx
.FlexGridSizer
.GetItem(self
, item
)
13669 if type(item
) is not int:
13670 gbsi
= self
.FindItem(item
)
13671 if gbsi
: return gbsi
13674 def FindItemAtPosition(*args
, **kwargs
):
13676 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13678 Return the sizer item for the given grid cell, or None if there is no
13679 item at that position. (non-recursive)
13681 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
13683 def FindItemAtPoint(*args
, **kwargs
):
13685 FindItemAtPoint(self, Point pt) -> GBSizerItem
13687 Return the sizer item located at the point given in *pt*, or None if
13688 there is no item at that point. The (x,y) coordinates in pt correspond
13689 to the client coordinates of the window using the sizer for
13690 layout. (non-recursive)
13692 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
13694 def CheckForIntersection(*args
, **kwargs
):
13696 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
13698 Look at all items and see if any intersect (or would overlap) the
13699 given *item*. Returns True if so, False if there would be no overlap.
13700 If an *excludeItem* is given then it will not be checked for
13701 intersection, for example it may be the item we are checking the
13705 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
13707 def CheckForIntersectionPos(*args
, **kwargs
):
13709 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13711 Look at all items and see if any intersect (or would overlap) the
13712 given position and span. Returns True if so, False if there would be
13713 no overlap. If an *excludeItem* is given then it will not be checked
13714 for intersection, for example it may be the item we are checking the
13717 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
13719 _core_
.GridBagSizer_swigregister(GridBagSizer
)
13721 #---------------------------------------------------------------------------
13725 Right
= _core_
.Right
13726 Bottom
= _core_
.Bottom
13727 Width
= _core_
.Width
13728 Height
= _core_
.Height
13729 Centre
= _core_
.Centre
13730 Center
= _core_
.Center
13731 CentreX
= _core_
.CentreX
13732 CentreY
= _core_
.CentreY
13733 Unconstrained
= _core_
.Unconstrained
13735 PercentOf
= _core_
.PercentOf
13736 Above
= _core_
.Above
13737 Below
= _core_
.Below
13738 LeftOf
= _core_
.LeftOf
13739 RightOf
= _core_
.RightOf
13740 SameAs
= _core_
.SameAs
13741 Absolute
= _core_
.Absolute
13742 class IndividualLayoutConstraint(Object
):
13744 Objects of this class are stored in the `wx.LayoutConstraints` class as
13745 one of eight possible constraints that a window can be involved in.
13746 You will never need to create an instance of
13747 wx.IndividualLayoutConstraint, rather you should create a
13748 `wx.LayoutConstraints` instance and use the individual contstraints
13751 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13752 def __init__(self
): raise AttributeError, "No constructor defined"
13753 __repr__
= _swig_repr
13754 def Set(*args
, **kwargs
):
13756 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13758 Sets the properties of the constraint. Normally called by one of the
13759 convenience functions such as Above, RightOf, SameAs.
13761 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
13763 def LeftOf(*args
, **kwargs
):
13765 LeftOf(self, Window sibling, int marg=0)
13767 Constrains this edge to be to the left of the given window, with an
13768 optional margin. Implicitly, this is relative to the left edge of the
13771 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
13773 def RightOf(*args
, **kwargs
):
13775 RightOf(self, Window sibling, int marg=0)
13777 Constrains this edge to be to the right of the given window, with an
13778 optional margin. Implicitly, this is relative to the right edge of the
13781 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
13783 def Above(*args
, **kwargs
):
13785 Above(self, Window sibling, int marg=0)
13787 Constrains this edge to be above the given window, with an optional
13788 margin. Implicitly, this is relative to the top edge of the other
13791 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
13793 def Below(*args
, **kwargs
):
13795 Below(self, Window sibling, int marg=0)
13797 Constrains this edge to be below the given window, with an optional
13798 margin. Implicitly, this is relative to the bottom edge of the other
13801 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
13803 def SameAs(*args
, **kwargs
):
13805 SameAs(self, Window otherW, int edge, int marg=0)
13807 Constrains this edge or dimension to be to the same as the edge of the
13808 given window, with an optional margin.
13810 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
13812 def PercentOf(*args
, **kwargs
):
13814 PercentOf(self, Window otherW, int wh, int per)
13816 Constrains this edge or dimension to be to a percentage of the given
13817 window, with an optional margin.
13819 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
13821 def Absolute(*args
, **kwargs
):
13823 Absolute(self, int val)
13825 Constrains this edge or dimension to be the given absolute value.
13827 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
13829 def Unconstrained(*args
, **kwargs
):
13831 Unconstrained(self)
13833 Sets this edge or dimension to be unconstrained, that is, dependent on
13834 other edges and dimensions from which this value can be deduced.
13836 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
13838 def AsIs(*args
, **kwargs
):
13842 Sets this edge or constraint to be whatever the window's value is at
13843 the moment. If either of the width and height constraints are *as is*,
13844 the window will not be resized, but moved instead. This is important
13845 when considering panel items which are intended to have a default
13846 size, such as a button, which may take its size from the size of the
13849 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
13851 def GetOtherWindow(*args
, **kwargs
):
13852 """GetOtherWindow(self) -> Window"""
13853 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
13855 def GetMyEdge(*args
, **kwargs
):
13856 """GetMyEdge(self) -> int"""
13857 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
13859 def SetEdge(*args
, **kwargs
):
13860 """SetEdge(self, int which)"""
13861 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
13863 def SetValue(*args
, **kwargs
):
13864 """SetValue(self, int v)"""
13865 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
13867 def GetMargin(*args
, **kwargs
):
13868 """GetMargin(self) -> int"""
13869 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
13871 def SetMargin(*args
, **kwargs
):
13872 """SetMargin(self, int m)"""
13873 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
13875 def GetValue(*args
, **kwargs
):
13876 """GetValue(self) -> int"""
13877 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
13879 def GetPercent(*args
, **kwargs
):
13880 """GetPercent(self) -> int"""
13881 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
13883 def GetOtherEdge(*args
, **kwargs
):
13884 """GetOtherEdge(self) -> int"""
13885 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
13887 def GetDone(*args
, **kwargs
):
13888 """GetDone(self) -> bool"""
13889 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
13891 def SetDone(*args
, **kwargs
):
13892 """SetDone(self, bool d)"""
13893 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
13895 def GetRelationship(*args
, **kwargs
):
13896 """GetRelationship(self) -> int"""
13897 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
13899 def SetRelationship(*args
, **kwargs
):
13900 """SetRelationship(self, int r)"""
13901 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
13903 def ResetIfWin(*args
, **kwargs
):
13905 ResetIfWin(self, Window otherW) -> bool
13907 Reset constraint if it mentions otherWin
13909 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
13911 def SatisfyConstraint(*args
, **kwargs
):
13913 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13915 Try to satisfy constraint
13917 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
13919 def GetEdge(*args
, **kwargs
):
13921 GetEdge(self, int which, Window thisWin, Window other) -> int
13923 Get the value of this edge or dimension, or if this
13924 is not determinable, -1.
13926 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
13928 Done
= property(GetDone
,SetDone
,doc
="See `GetDone` and `SetDone`")
13929 Margin
= property(GetMargin
,SetMargin
,doc
="See `GetMargin` and `SetMargin`")
13930 MyEdge
= property(GetMyEdge
,doc
="See `GetMyEdge`")
13931 OtherEdge
= property(GetOtherEdge
,doc
="See `GetOtherEdge`")
13932 OtherWindow
= property(GetOtherWindow
,doc
="See `GetOtherWindow`")
13933 Percent
= property(GetPercent
,doc
="See `GetPercent`")
13934 Relationship
= property(GetRelationship
,SetRelationship
,doc
="See `GetRelationship` and `SetRelationship`")
13935 Value
= property(GetValue
,SetValue
,doc
="See `GetValue` and `SetValue`")
13936 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint
)
13938 class LayoutConstraints(Object
):
13940 **Note:** constraints are now deprecated and you should use sizers
13943 Objects of this class can be associated with a window to define its
13944 layout constraints, with respect to siblings or its parent.
13946 The class consists of the following eight constraints of class
13947 wx.IndividualLayoutConstraint, some or all of which should be accessed
13948 directly to set the appropriate constraints.
13950 * left: represents the left hand edge of the window
13951 * right: represents the right hand edge of the window
13952 * top: represents the top edge of the window
13953 * bottom: represents the bottom edge of the window
13954 * width: represents the width of the window
13955 * height: represents the height of the window
13956 * centreX: represents the horizontal centre point of the window
13957 * centreY: represents the vertical centre point of the window
13959 Most constraints are initially set to have the relationship
13960 wxUnconstrained, which means that their values should be calculated by
13961 looking at known constraints. The exceptions are width and height,
13962 which are set to wxAsIs to ensure that if the user does not specify a
13963 constraint, the existing width and height will be used, to be
13964 compatible with panel items which often have take a default size. If
13965 the constraint is ``wx.AsIs``, the dimension will not be changed.
13967 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13970 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13971 __repr__
= _swig_repr
13972 left
= property(_core_
.LayoutConstraints_left_get
)
13973 top
= property(_core_
.LayoutConstraints_top_get
)
13974 right
= property(_core_
.LayoutConstraints_right_get
)
13975 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
13976 width
= property(_core_
.LayoutConstraints_width_get
)
13977 height
= property(_core_
.LayoutConstraints_height_get
)
13978 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
13979 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
13980 def __init__(self
, *args
, **kwargs
):
13981 """__init__(self) -> LayoutConstraints"""
13982 _core_
.LayoutConstraints_swiginit(self
,_core_
.new_LayoutConstraints(*args
, **kwargs
))
13983 __swig_destroy__
= _core_
.delete_LayoutConstraints
13984 __del__
= lambda self
: None;
13985 def SatisfyConstraints(*args
, **kwargs
):
13986 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13987 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
13989 def AreSatisfied(*args
, **kwargs
):
13990 """AreSatisfied(self) -> bool"""
13991 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
13993 _core_
.LayoutConstraints_swigregister(LayoutConstraints
)
13995 #----------------------------------------------------------------------------
13997 # Use Python's bool constants if available, make some if not
14001 __builtins__
.True = 1==1
14002 __builtins__
.False = 1==0
14003 def bool(value
): return not not value
14004 __builtins__
.bool = bool
14008 # workarounds for bad wxRTTI names
14009 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
14010 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
14011 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
14014 #----------------------------------------------------------------------------
14015 # Load version numbers from __version__... Ensure that major and minor
14016 # versions are the same for both wxPython and wxWidgets.
14018 from __version__
import *
14019 __version__
= VERSION_STRING
14021 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
14022 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
14023 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
14025 warnings
.warn("wxPython/wxWidgets release number mismatch")
14029 """Returns a string containing version and port info"""
14030 ctype
= wx
.USE_UNICODE
and 'unicode' or 'ansi'
14031 if wx
.Platform
== '__WXMSW__':
14033 elif wx
.Platform
== '__WXMAC__':
14035 elif wx
.Platform
== '__WXGTK__':
14037 if 'gtk2' in wx
.PlatformInfo
:
14042 return "%s (%s-%s)" % (wx
.VERSION_STRING
, port
, ctype
)
14045 #----------------------------------------------------------------------------
14047 # Set wxPython's default string<-->unicode conversion encoding from
14048 # the locale, but only if Python's default hasn't been changed. (We
14049 # assume that if the user has customized it already then that is the
14050 # encoding we need to use as well.)
14052 # The encoding selected here is used when string or unicode objects
14053 # need to be converted in order to pass them to wxWidgets. Please be
14054 # aware that the default encoding within the same locale may be
14055 # slightly different on different platforms. For example, please see
14056 # http://www.alanwood.net/demos/charsetdiffs.html for differences
14057 # between the common latin/roman encodings.
14059 default
= _sys
.getdefaultencoding()
14060 if default
== 'ascii':
14064 if hasattr(locale
, 'getpreferredencoding'):
14065 default
= locale
.getpreferredencoding()
14067 default
= locale
.getdefaultlocale()[1]
14068 codecs
.lookup(default
)
14069 except (ValueError, LookupError, TypeError):
14070 default
= _sys
.getdefaultencoding()
14074 wx
.SetDefaultPyEncoding(default
)
14077 #----------------------------------------------------------------------------
14079 class PyDeadObjectError(AttributeError):
14082 class _wxPyDeadObject(object):
14084 Instances of wx objects that are OOR capable will have their __class__
14085 changed to this class when the C++ object is deleted. This should help
14086 prevent crashes due to referencing a bogus C++ pointer.
14088 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14089 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14091 def __repr__(self
):
14092 if not hasattr(self
, "_name"):
14093 self
._name
= "[unknown]"
14094 return self
.reprStr
% self
._name
14096 def __getattr__(self
, *args
):
14097 if not hasattr(self
, "_name"):
14098 self
._name
= "[unknown]"
14099 raise PyDeadObjectError(self
.attrStr
% self
._name
)
14101 def __nonzero__(self
):
14106 class PyUnbornObjectError(AttributeError):
14109 class _wxPyUnbornObject(object):
14111 Some stock objects are created when the wx._core module is
14112 imported, but their C++ instance is not created until the wx.App
14113 object is created and initialized. These object instances will
14114 temporarily have their __class__ changed to this class so an
14115 exception will be raised if they are used before the C++ instance
14119 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14120 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
14122 def __repr__(self
):
14123 #if not hasattr(self, "_name"):
14124 # self._name = "[unknown]"
14125 return self
.reprStr
#% self._name
14127 def __getattr__(self
, *args
):
14128 #if not hasattr(self, "_name"):
14129 # self._name = "[unknown]"
14130 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
14132 def __nonzero__(self
):
14136 #----------------------------------------------------------------------------
14138 def CallAfter(callable, *args
, **kw
):
14140 Call the specified function after the current and pending event
14141 handlers have been completed. This is also good for making GUI
14142 method calls from non-GUI threads. Any extra positional or
14143 keyword args are passed on to the callable when it is called.
14145 :see: `wx.CallLater`
14148 assert app
is not None, 'No wx.App created yet'
14150 if not hasattr(app
, "_CallAfterId"):
14151 app
._CallAfterId
= wx
.NewEventType()
14152 app
.Connect(-1, -1, app
._CallAfterId
,
14153 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
14155 evt
.SetEventType(app
._CallAfterId
)
14156 evt
.callable = callable
14159 wx
.PostEvent(app
, evt
)
14161 #----------------------------------------------------------------------------
14166 A convenience class for `wx.Timer`, that calls the given callable
14167 object once after the given amount of milliseconds, passing any
14168 positional or keyword args. The return value of the callable is
14169 availbale after it has been run with the `GetResult` method.
14171 If you don't need to get the return value or restart the timer
14172 then there is no need to hold a reference to this object. It will
14173 hold a reference to itself while the timer is running (the timer
14174 has a reference to self.Notify) but the cycle will be broken when
14175 the timer completes, automatically cleaning up the wx.CallLater
14178 :see: `wx.CallAfter`
14180 def __init__(self
, millis
, callable, *args
, **kwargs
):
14181 self
.millis
= millis
14182 self
.callable = callable
14183 self
.SetArgs(*args
, **kwargs
)
14185 self
.running
= False
14186 self
.hasRun
= False
14195 def Start(self
, millis
=None, *args
, **kwargs
):
14197 (Re)start the timer
14199 self
.hasRun
= False
14200 if millis
is not None:
14201 self
.millis
= millis
14203 self
.SetArgs(*args
, **kwargs
)
14205 self
.timer
= wx
.PyTimer(self
.Notify
)
14206 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
14207 self
.running
= True
14213 Stop and destroy the timer.
14215 if self
.timer
is not None:
14220 def GetInterval(self
):
14221 if self
.timer
is not None:
14222 return self
.timer
.GetInterval()
14227 def IsRunning(self
):
14228 return self
.timer
is not None and self
.timer
.IsRunning()
14231 def SetArgs(self
, *args
, **kwargs
):
14233 (Re)set the args passed to the callable object. This is
14234 useful in conjunction with Restart if you want to schedule a
14235 new call to the same callable object but with different
14239 self
.kwargs
= kwargs
14245 def GetResult(self
):
14250 The timer has expired so call the callable.
14252 if self
.callable and getattr(self
.callable, 'im_self', True):
14254 self
.running
= False
14255 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
14257 if not self
.running
:
14258 # if it wasn't restarted, then cleanup
14259 wx
.CallAfter(self
.Stop
)
14261 Interval
= property(GetInterval
)
14262 Result
= property(GetResult
)
14265 class FutureCall(CallLater
):
14266 """A compatibility alias for `CallLater`."""
14268 #----------------------------------------------------------------------------
14269 # Control which items in this module should be documented by epydoc.
14270 # We allow only classes and functions, which will help reduce the size
14271 # of the docs by filtering out the zillions of constants, EVT objects,
14272 # and etc that don't make much sense by themselves, but are instead
14273 # documented (or will be) as part of the classes/functions/methods
14274 # where they should be used.
14278 A filter for epydoc that only allows non-Ptr classes and
14279 functions, in order to reduce the clutter in the API docs.
14281 def __init__(self
, globals):
14282 self
._globals
= globals
14284 def __call__(self
, name
):
14286 obj
= self
._globals
.get(name
, None)
14288 # only document classes and function
14289 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
14292 # skip other things that are private or will be documented as part of somethign else
14293 if name
.startswith('_') or name
.startswith('EVT') or name
.endswith('_swigregister') or name
.endswith('Ptr') :
14296 # skip functions that are duplicates of static functions in a class
14297 if name
.find('_') != -1:
14298 cls
= self
._globals
.get(name
.split('_')[0], None)
14299 methname
= name
.split('_')[1]
14300 if hasattr(cls
, methname
) and type(getattr(cls
, methname
)) is types
.FunctionType
:
14305 #----------------------------------------------------------------------------
14306 #----------------------------------------------------------------------------
14308 # Import other modules in this package that should show up in the
14309 # "core" wx namespace
14311 from _windows
import *
14312 from _controls
import *
14313 from _misc
import *
14315 #----------------------------------------------------------------------------
14316 #----------------------------------------------------------------------------