1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
6 new_instancemethod
= new
.instancemethod
7 def _swig_setattr_nondynamic(self
,class_type
,name
,value
,static
=1):
8 if (name
== "thisown"): return self
.this
.own(value
)
10 if type(value
).__name
__ == 'PySwigObject':
11 self
.__dict
__[name
] = value
13 method
= class_type
.__swig
_setmethods
__.get(name
,None)
14 if method
: return method(self
,value
)
15 if (not static
) or hasattr(self
,name
):
16 self
.__dict
__[name
] = value
18 raise AttributeError("You cannot add attributes to %s" % self
)
20 def _swig_setattr(self
,class_type
,name
,value
):
21 return _swig_setattr_nondynamic(self
,class_type
,name
,value
,0)
23 def _swig_getattr(self
,class_type
,name
):
24 if (name
== "thisown"): return self
.this
.own()
25 method
= class_type
.__swig
_getmethods
__.get(name
,None)
26 if method
: return method(self
)
27 raise AttributeError,name
30 try: strthis
= "proxy of " + self
.this
.__repr
__()
32 return "<%s.%s; %s >" % (self
.__class
__.__module
__, self
.__class
__.__name
__, strthis
,)
36 _object
= types
.ObjectType
38 except AttributeError:
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self
,name
,value
):
46 if (name
== "thisown"): return self
.this
.own(value
)
47 if hasattr(self
,name
) or (name
== "this"):
50 raise AttributeError("You cannot add attributes to %s" % self
)
54 #// Give a reference to the dictionary of this module to the C++ extension
56 _core_
._wxPySetDictionary
(vars())
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
61 wx
= _sys
.modules
[__name__
]
64 #----------------------------------------------------------------------------
66 def _deprecated(callable, msg
=None):
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
72 msg
= "%s is deprecated" % callable
73 def deprecatedWrapper(*args
, **kwargs
):
75 warnings
.warn(msg
, DeprecationWarning, stacklevel
=2)
76 return callable(*args
, **kwargs
)
77 deprecatedWrapper
.__doc
__ = msg
78 return deprecatedWrapper
81 #----------------------------------------------------------------------------
83 NOT_FOUND
= _core_
.NOT_FOUND
84 VSCROLL
= _core_
.VSCROLL
85 HSCROLL
= _core_
.HSCROLL
86 CAPTION
= _core_
.CAPTION
87 DOUBLE_BORDER
= _core_
.DOUBLE_BORDER
88 SUNKEN_BORDER
= _core_
.SUNKEN_BORDER
89 RAISED_BORDER
= _core_
.RAISED_BORDER
90 BORDER
= _core_
.BORDER
91 SIMPLE_BORDER
= _core_
.SIMPLE_BORDER
92 STATIC_BORDER
= _core_
.STATIC_BORDER
93 TRANSPARENT_WINDOW
= _core_
.TRANSPARENT_WINDOW
94 NO_BORDER
= _core_
.NO_BORDER
95 DEFAULT_CONTROL_BORDER
= _core_
.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE
= _core_
.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL
= _core_
.TAB_TRAVERSAL
98 WANTS_CHARS
= _core_
.WANTS_CHARS
99 POPUP_WINDOW
= _core_
.POPUP_WINDOW
100 CENTER_FRAME
= _core_
.CENTER_FRAME
101 CENTRE_ON_SCREEN
= _core_
.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN
= _core_
.CENTER_ON_SCREEN
103 CLIP_CHILDREN
= _core_
.CLIP_CHILDREN
104 CLIP_SIBLINGS
= _core_
.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK
= _core_
.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB
= _core_
.ALWAYS_SHOW_SB
107 RETAINED
= _core_
.RETAINED
108 BACKINGSTORE
= _core_
.BACKINGSTORE
109 COLOURED
= _core_
.COLOURED
110 FIXED_LENGTH
= _core_
.FIXED_LENGTH
111 LB_NEEDED_SB
= _core_
.LB_NEEDED_SB
112 LB_ALWAYS_SB
= _core_
.LB_ALWAYS_SB
113 LB_SORT
= _core_
.LB_SORT
114 LB_SINGLE
= _core_
.LB_SINGLE
115 LB_MULTIPLE
= _core_
.LB_MULTIPLE
116 LB_EXTENDED
= _core_
.LB_EXTENDED
117 LB_OWNERDRAW
= _core_
.LB_OWNERDRAW
118 LB_HSCROLL
= _core_
.LB_HSCROLL
119 PROCESS_ENTER
= _core_
.PROCESS_ENTER
120 PASSWORD
= _core_
.PASSWORD
121 CB_SIMPLE
= _core_
.CB_SIMPLE
122 CB_DROPDOWN
= _core_
.CB_DROPDOWN
123 CB_SORT
= _core_
.CB_SORT
124 CB_READONLY
= _core_
.CB_READONLY
125 RA_HORIZONTAL
= _core_
.RA_HORIZONTAL
126 RA_VERTICAL
= _core_
.RA_VERTICAL
127 RA_SPECIFY_ROWS
= _core_
.RA_SPECIFY_ROWS
128 RA_SPECIFY_COLS
= _core_
.RA_SPECIFY_COLS
129 RA_USE_CHECKBOX
= _core_
.RA_USE_CHECKBOX
130 RB_GROUP
= _core_
.RB_GROUP
131 RB_SINGLE
= _core_
.RB_SINGLE
132 SB_HORIZONTAL
= _core_
.SB_HORIZONTAL
133 SB_VERTICAL
= _core_
.SB_VERTICAL
134 RB_USE_CHECKBOX
= _core_
.RB_USE_CHECKBOX
135 ST_SIZEGRIP
= _core_
.ST_SIZEGRIP
136 ST_NO_AUTORESIZE
= _core_
.ST_NO_AUTORESIZE
137 ST_DOTS_MIDDLE
= _core_
.ST_DOTS_MIDDLE
138 ST_DOTS_END
= _core_
.ST_DOTS_END
139 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
140 FLOOD_BORDER
= _core_
.FLOOD_BORDER
141 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
142 WINDING_RULE
= _core_
.WINDING_RULE
143 TOOL_TOP
= _core_
.TOOL_TOP
144 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
145 TOOL_LEFT
= _core_
.TOOL_LEFT
146 TOOL_RIGHT
= _core_
.TOOL_RIGHT
148 YES_NO
= _core_
.YES_NO
149 CANCEL
= _core_
.CANCEL
152 NO_DEFAULT
= _core_
.NO_DEFAULT
153 YES_DEFAULT
= _core_
.YES_DEFAULT
154 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
155 ICON_HAND
= _core_
.ICON_HAND
156 ICON_QUESTION
= _core_
.ICON_QUESTION
157 ICON_INFORMATION
= _core_
.ICON_INFORMATION
158 ICON_STOP
= _core_
.ICON_STOP
159 ICON_ASTERISK
= _core_
.ICON_ASTERISK
160 ICON_MASK
= _core_
.ICON_MASK
161 ICON_WARNING
= _core_
.ICON_WARNING
162 ICON_ERROR
= _core_
.ICON_ERROR
163 FORWARD
= _core_
.FORWARD
164 BACKWARD
= _core_
.BACKWARD
169 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
170 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
171 SIZE_AUTO
= _core_
.SIZE_AUTO
172 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
173 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
174 SIZE_FORCE
= _core_
.SIZE_FORCE
175 PORTRAIT
= _core_
.PORTRAIT
176 LANDSCAPE
= _core_
.LANDSCAPE
177 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
178 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
179 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
180 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
181 ID_ANY
= _core_
.ID_ANY
182 ID_SEPARATOR
= _core_
.ID_SEPARATOR
183 ID_NONE
= _core_
.ID_NONE
184 ID_LOWEST
= _core_
.ID_LOWEST
185 ID_OPEN
= _core_
.ID_OPEN
186 ID_CLOSE
= _core_
.ID_CLOSE
187 ID_NEW
= _core_
.ID_NEW
188 ID_SAVE
= _core_
.ID_SAVE
189 ID_SAVEAS
= _core_
.ID_SAVEAS
190 ID_REVERT
= _core_
.ID_REVERT
191 ID_EXIT
= _core_
.ID_EXIT
192 ID_UNDO
= _core_
.ID_UNDO
193 ID_REDO
= _core_
.ID_REDO
194 ID_HELP
= _core_
.ID_HELP
195 ID_PRINT
= _core_
.ID_PRINT
196 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
197 ID_PAGE_SETUP
= _core_
.ID_PAGE_SETUP
198 ID_PREVIEW
= _core_
.ID_PREVIEW
199 ID_ABOUT
= _core_
.ID_ABOUT
200 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
201 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
202 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
203 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
204 ID_HELP_INDEX
= _core_
.ID_HELP_INDEX
205 ID_HELP_SEARCH
= _core_
.ID_HELP_SEARCH
206 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
207 ID_PREFERENCES
= _core_
.ID_PREFERENCES
208 ID_EDIT
= _core_
.ID_EDIT
209 ID_CUT
= _core_
.ID_CUT
210 ID_COPY
= _core_
.ID_COPY
211 ID_PASTE
= _core_
.ID_PASTE
212 ID_CLEAR
= _core_
.ID_CLEAR
213 ID_FIND
= _core_
.ID_FIND
214 ID_DUPLICATE
= _core_
.ID_DUPLICATE
215 ID_SELECTALL
= _core_
.ID_SELECTALL
216 ID_DELETE
= _core_
.ID_DELETE
217 ID_REPLACE
= _core_
.ID_REPLACE
218 ID_REPLACE_ALL
= _core_
.ID_REPLACE_ALL
219 ID_PROPERTIES
= _core_
.ID_PROPERTIES
220 ID_VIEW_DETAILS
= _core_
.ID_VIEW_DETAILS
221 ID_VIEW_LARGEICONS
= _core_
.ID_VIEW_LARGEICONS
222 ID_VIEW_SMALLICONS
= _core_
.ID_VIEW_SMALLICONS
223 ID_VIEW_LIST
= _core_
.ID_VIEW_LIST
224 ID_VIEW_SORTDATE
= _core_
.ID_VIEW_SORTDATE
225 ID_VIEW_SORTNAME
= _core_
.ID_VIEW_SORTNAME
226 ID_VIEW_SORTSIZE
= _core_
.ID_VIEW_SORTSIZE
227 ID_VIEW_SORTTYPE
= _core_
.ID_VIEW_SORTTYPE
228 ID_FILE
= _core_
.ID_FILE
229 ID_FILE1
= _core_
.ID_FILE1
230 ID_FILE2
= _core_
.ID_FILE2
231 ID_FILE3
= _core_
.ID_FILE3
232 ID_FILE4
= _core_
.ID_FILE4
233 ID_FILE5
= _core_
.ID_FILE5
234 ID_FILE6
= _core_
.ID_FILE6
235 ID_FILE7
= _core_
.ID_FILE7
236 ID_FILE8
= _core_
.ID_FILE8
237 ID_FILE9
= _core_
.ID_FILE9
239 ID_CANCEL
= _core_
.ID_CANCEL
240 ID_APPLY
= _core_
.ID_APPLY
241 ID_YES
= _core_
.ID_YES
243 ID_STATIC
= _core_
.ID_STATIC
244 ID_FORWARD
= _core_
.ID_FORWARD
245 ID_BACKWARD
= _core_
.ID_BACKWARD
246 ID_DEFAULT
= _core_
.ID_DEFAULT
247 ID_MORE
= _core_
.ID_MORE
248 ID_SETUP
= _core_
.ID_SETUP
249 ID_RESET
= _core_
.ID_RESET
250 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
251 ID_YESTOALL
= _core_
.ID_YESTOALL
252 ID_NOTOALL
= _core_
.ID_NOTOALL
253 ID_ABORT
= _core_
.ID_ABORT
254 ID_RETRY
= _core_
.ID_RETRY
255 ID_IGNORE
= _core_
.ID_IGNORE
256 ID_ADD
= _core_
.ID_ADD
257 ID_REMOVE
= _core_
.ID_REMOVE
259 ID_DOWN
= _core_
.ID_DOWN
260 ID_HOME
= _core_
.ID_HOME
261 ID_REFRESH
= _core_
.ID_REFRESH
262 ID_STOP
= _core_
.ID_STOP
263 ID_INDEX
= _core_
.ID_INDEX
264 ID_BOLD
= _core_
.ID_BOLD
265 ID_ITALIC
= _core_
.ID_ITALIC
266 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
267 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
268 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
269 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
270 ID_UNDERLINE
= _core_
.ID_UNDERLINE
271 ID_INDENT
= _core_
.ID_INDENT
272 ID_UNINDENT
= _core_
.ID_UNINDENT
273 ID_ZOOM_100
= _core_
.ID_ZOOM_100
274 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
275 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
276 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
277 ID_UNDELETE
= _core_
.ID_UNDELETE
278 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
279 ID_HIGHEST
= _core_
.ID_HIGHEST
280 MENU_TEAROFF
= _core_
.MENU_TEAROFF
281 MB_DOCKABLE
= _core_
.MB_DOCKABLE
282 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
283 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
284 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
285 LI_VERTICAL
= _core_
.LI_VERTICAL
286 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
287 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
288 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
289 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
290 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
291 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
292 MM_TEXT
= _core_
.MM_TEXT
293 MM_LOMETRIC
= _core_
.MM_LOMETRIC
294 MM_HIMETRIC
= _core_
.MM_HIMETRIC
295 MM_LOENGLISH
= _core_
.MM_LOENGLISH
296 MM_HIENGLISH
= _core_
.MM_HIENGLISH
297 MM_TWIPS
= _core_
.MM_TWIPS
298 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
299 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
300 MM_POINTS
= _core_
.MM_POINTS
301 MM_METRIC
= _core_
.MM_METRIC
302 CENTRE
= _core_
.CENTRE
303 CENTER
= _core_
.CENTER
304 HORIZONTAL
= _core_
.HORIZONTAL
305 VERTICAL
= _core_
.VERTICAL
312 BOTTOM
= _core_
.BOTTOM
318 ALIGN_NOT
= _core_
.ALIGN_NOT
319 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
320 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
321 ALIGN_LEFT
= _core_
.ALIGN_LEFT
322 ALIGN_TOP
= _core_
.ALIGN_TOP
323 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
324 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
325 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
326 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
327 ALIGN_CENTER
= _core_
.ALIGN_CENTER
328 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
329 ALIGN_MASK
= _core_
.ALIGN_MASK
330 STRETCH_NOT
= _core_
.STRETCH_NOT
331 SHRINK
= _core_
.SHRINK
333 EXPAND
= _core_
.EXPAND
334 SHAPED
= _core_
.SHAPED
335 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
337 ADJUST_MINSIZE
= _core_
.ADJUST_MINSIZE
338 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
339 BORDER_NONE
= _core_
.BORDER_NONE
340 BORDER_STATIC
= _core_
.BORDER_STATIC
341 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
342 BORDER_RAISED
= _core_
.BORDER_RAISED
343 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
344 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
345 BORDER_MASK
= _core_
.BORDER_MASK
346 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
347 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
348 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
349 DEFAULT
= _core_
.DEFAULT
350 DECORATIVE
= _core_
.DECORATIVE
352 SCRIPT
= _core_
.SCRIPT
354 MODERN
= _core_
.MODERN
355 TELETYPE
= _core_
.TELETYPE
356 VARIABLE
= _core_
.VARIABLE
358 NORMAL
= _core_
.NORMAL
361 ITALIC
= _core_
.ITALIC
365 LONG_DASH
= _core_
.LONG_DASH
366 SHORT_DASH
= _core_
.SHORT_DASH
367 DOT_DASH
= _core_
.DOT_DASH
368 USER_DASH
= _core_
.USER_DASH
369 TRANSPARENT
= _core_
.TRANSPARENT
370 STIPPLE
= _core_
.STIPPLE
371 STIPPLE_MASK
= _core_
.STIPPLE_MASK
372 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
373 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
374 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
375 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
376 CROSS_HATCH
= _core_
.CROSS_HATCH
377 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
378 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
379 JOIN_BEVEL
= _core_
.JOIN_BEVEL
380 JOIN_MITER
= _core_
.JOIN_MITER
381 JOIN_ROUND
= _core_
.JOIN_ROUND
382 CAP_ROUND
= _core_
.CAP_ROUND
383 CAP_PROJECTING
= _core_
.CAP_PROJECTING
384 CAP_BUTT
= _core_
.CAP_BUTT
387 INVERT
= _core_
.INVERT
388 OR_REVERSE
= _core_
.OR_REVERSE
389 AND_REVERSE
= _core_
.AND_REVERSE
392 AND_INVERT
= _core_
.AND_INVERT
396 SRC_INVERT
= _core_
.SRC_INVERT
397 OR_INVERT
= _core_
.OR_INVERT
401 WXK_BACK
= _core_
.WXK_BACK
402 WXK_TAB
= _core_
.WXK_TAB
403 WXK_RETURN
= _core_
.WXK_RETURN
404 WXK_ESCAPE
= _core_
.WXK_ESCAPE
405 WXK_SPACE
= _core_
.WXK_SPACE
406 WXK_DELETE
= _core_
.WXK_DELETE
407 WXK_START
= _core_
.WXK_START
408 WXK_LBUTTON
= _core_
.WXK_LBUTTON
409 WXK_RBUTTON
= _core_
.WXK_RBUTTON
410 WXK_CANCEL
= _core_
.WXK_CANCEL
411 WXK_MBUTTON
= _core_
.WXK_MBUTTON
412 WXK_CLEAR
= _core_
.WXK_CLEAR
413 WXK_SHIFT
= _core_
.WXK_SHIFT
414 WXK_ALT
= _core_
.WXK_ALT
415 WXK_CONTROL
= _core_
.WXK_CONTROL
416 WXK_MENU
= _core_
.WXK_MENU
417 WXK_PAUSE
= _core_
.WXK_PAUSE
418 WXK_CAPITAL
= _core_
.WXK_CAPITAL
419 WXK_PRIOR
= _core_
.WXK_PRIOR
420 WXK_NEXT
= _core_
.WXK_NEXT
421 WXK_END
= _core_
.WXK_END
422 WXK_HOME
= _core_
.WXK_HOME
423 WXK_LEFT
= _core_
.WXK_LEFT
424 WXK_UP
= _core_
.WXK_UP
425 WXK_RIGHT
= _core_
.WXK_RIGHT
426 WXK_DOWN
= _core_
.WXK_DOWN
427 WXK_SELECT
= _core_
.WXK_SELECT
428 WXK_PRINT
= _core_
.WXK_PRINT
429 WXK_EXECUTE
= _core_
.WXK_EXECUTE
430 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
431 WXK_INSERT
= _core_
.WXK_INSERT
432 WXK_HELP
= _core_
.WXK_HELP
433 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
434 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
435 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
436 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
437 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
438 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
439 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
440 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
441 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
442 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
443 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
444 WXK_ADD
= _core_
.WXK_ADD
445 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
446 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
447 WXK_DECIMAL
= _core_
.WXK_DECIMAL
448 WXK_DIVIDE
= _core_
.WXK_DIVIDE
449 WXK_F1
= _core_
.WXK_F1
450 WXK_F2
= _core_
.WXK_F2
451 WXK_F3
= _core_
.WXK_F3
452 WXK_F4
= _core_
.WXK_F4
453 WXK_F5
= _core_
.WXK_F5
454 WXK_F6
= _core_
.WXK_F6
455 WXK_F7
= _core_
.WXK_F7
456 WXK_F8
= _core_
.WXK_F8
457 WXK_F9
= _core_
.WXK_F9
458 WXK_F10
= _core_
.WXK_F10
459 WXK_F11
= _core_
.WXK_F11
460 WXK_F12
= _core_
.WXK_F12
461 WXK_F13
= _core_
.WXK_F13
462 WXK_F14
= _core_
.WXK_F14
463 WXK_F15
= _core_
.WXK_F15
464 WXK_F16
= _core_
.WXK_F16
465 WXK_F17
= _core_
.WXK_F17
466 WXK_F18
= _core_
.WXK_F18
467 WXK_F19
= _core_
.WXK_F19
468 WXK_F20
= _core_
.WXK_F20
469 WXK_F21
= _core_
.WXK_F21
470 WXK_F22
= _core_
.WXK_F22
471 WXK_F23
= _core_
.WXK_F23
472 WXK_F24
= _core_
.WXK_F24
473 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
474 WXK_SCROLL
= _core_
.WXK_SCROLL
475 WXK_PAGEUP
= _core_
.WXK_PAGEUP
476 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
477 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
478 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
479 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
480 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
481 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
482 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
483 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
484 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
485 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
486 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
487 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
488 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
489 WXK_NUMPAD_PRIOR
= _core_
.WXK_NUMPAD_PRIOR
490 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
491 WXK_NUMPAD_NEXT
= _core_
.WXK_NUMPAD_NEXT
492 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
493 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
494 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
495 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
496 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
497 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
498 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
499 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
500 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
501 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
502 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
503 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
504 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
505 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
506 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
507 WXK_COMMAND
= _core_
.WXK_COMMAND
508 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
509 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
510 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
511 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
512 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
513 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
514 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
515 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
516 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
517 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
518 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
519 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
520 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
521 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
522 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
523 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
524 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
525 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
526 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
527 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
528 PAPER_NONE
= _core_
.PAPER_NONE
529 PAPER_LETTER
= _core_
.PAPER_LETTER
530 PAPER_LEGAL
= _core_
.PAPER_LEGAL
531 PAPER_A4
= _core_
.PAPER_A4
532 PAPER_CSHEET
= _core_
.PAPER_CSHEET
533 PAPER_DSHEET
= _core_
.PAPER_DSHEET
534 PAPER_ESHEET
= _core_
.PAPER_ESHEET
535 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
536 PAPER_TABLOID
= _core_
.PAPER_TABLOID
537 PAPER_LEDGER
= _core_
.PAPER_LEDGER
538 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
539 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
540 PAPER_A3
= _core_
.PAPER_A3
541 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
542 PAPER_A5
= _core_
.PAPER_A5
543 PAPER_B4
= _core_
.PAPER_B4
544 PAPER_B5
= _core_
.PAPER_B5
545 PAPER_FOLIO
= _core_
.PAPER_FOLIO
546 PAPER_QUARTO
= _core_
.PAPER_QUARTO
547 PAPER_10X14
= _core_
.PAPER_10X14
548 PAPER_11X17
= _core_
.PAPER_11X17
549 PAPER_NOTE
= _core_
.PAPER_NOTE
550 PAPER_ENV_9
= _core_
.PAPER_ENV_9
551 PAPER_ENV_10
= _core_
.PAPER_ENV_10
552 PAPER_ENV_11
= _core_
.PAPER_ENV_11
553 PAPER_ENV_12
= _core_
.PAPER_ENV_12
554 PAPER_ENV_14
= _core_
.PAPER_ENV_14
555 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
556 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
557 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
558 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
559 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
560 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
561 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
562 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
563 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
564 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
565 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
566 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
567 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
568 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
569 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
570 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
571 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
572 PAPER_9X11
= _core_
.PAPER_9X11
573 PAPER_10X11
= _core_
.PAPER_10X11
574 PAPER_15X11
= _core_
.PAPER_15X11
575 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
576 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
577 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
578 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
579 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
580 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
581 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
582 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
583 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
584 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
585 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
586 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
587 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
588 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
589 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
590 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
591 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
592 PAPER_A2
= _core_
.PAPER_A2
593 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
594 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
595 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
596 PAPER_A6
= _core_
.PAPER_A6
597 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
598 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
599 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
600 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
601 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
602 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
603 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
604 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
605 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
606 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
607 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
608 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
609 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
610 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
611 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
612 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
613 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
614 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
615 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
616 PAPER_12X11
= _core_
.PAPER_12X11
617 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
618 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
619 PAPER_P16K
= _core_
.PAPER_P16K
620 PAPER_P32K
= _core_
.PAPER_P32K
621 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
622 PAPER_PENV_1
= _core_
.PAPER_PENV_1
623 PAPER_PENV_2
= _core_
.PAPER_PENV_2
624 PAPER_PENV_3
= _core_
.PAPER_PENV_3
625 PAPER_PENV_4
= _core_
.PAPER_PENV_4
626 PAPER_PENV_5
= _core_
.PAPER_PENV_5
627 PAPER_PENV_6
= _core_
.PAPER_PENV_6
628 PAPER_PENV_7
= _core_
.PAPER_PENV_7
629 PAPER_PENV_8
= _core_
.PAPER_PENV_8
630 PAPER_PENV_9
= _core_
.PAPER_PENV_9
631 PAPER_PENV_10
= _core_
.PAPER_PENV_10
632 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
633 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
634 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
635 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
636 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
637 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
638 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
639 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
640 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
641 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
642 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
643 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
644 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
645 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
646 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
647 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
648 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
649 ITEM_NORMAL
= _core_
.ITEM_NORMAL
650 ITEM_CHECK
= _core_
.ITEM_CHECK
651 ITEM_RADIO
= _core_
.ITEM_RADIO
652 ITEM_MAX
= _core_
.ITEM_MAX
653 HT_NOWHERE
= _core_
.HT_NOWHERE
654 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
655 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
656 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
657 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
658 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
659 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
660 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
661 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
662 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
663 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
664 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
665 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
666 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
667 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
668 HT_MAX
= _core_
.HT_MAX
669 MOD_NONE
= _core_
.MOD_NONE
670 MOD_ALT
= _core_
.MOD_ALT
671 MOD_CONTROL
= _core_
.MOD_CONTROL
672 MOD_ALTGR
= _core_
.MOD_ALTGR
673 MOD_SHIFT
= _core_
.MOD_SHIFT
674 MOD_META
= _core_
.MOD_META
675 MOD_WIN
= _core_
.MOD_WIN
676 MOD_CMD
= _core_
.MOD_CMD
677 MOD_ALL
= _core_
.MOD_ALL
678 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
679 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
680 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
681 #---------------------------------------------------------------------------
683 class Object(object):
685 The base class for most wx objects, although in wxPython not
686 much functionality is needed nor exposed.
688 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
689 def __init__(self
): raise AttributeError, "No constructor defined"
690 __repr__
= _swig_repr
691 def GetClassName(*args
, **kwargs
):
693 GetClassName(self) -> String
695 Returns the class name of the C++ class using wxRTTI.
697 return _core_
.Object_GetClassName(*args
, **kwargs
)
699 def Destroy(*args
, **kwargs
):
703 Deletes the C++ object this Python object is a proxy for.
705 val
= _core_
.Object_Destroy(*args
, **kwargs
)
709 _core_
.Object_swigregister(Object
)
710 _wxPySetDictionary
= _core_
._wxPySetDictionary
712 EmptyString
= cvar
.EmptyString
714 #---------------------------------------------------------------------------
716 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
717 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
718 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
719 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
720 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
721 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
722 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
723 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
724 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
725 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
726 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
727 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
728 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
729 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
730 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
731 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
732 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
733 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
734 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
735 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
736 CURSOR_NONE
= _core_
.CURSOR_NONE
737 CURSOR_ARROW
= _core_
.CURSOR_ARROW
738 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
739 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
740 CURSOR_CHAR
= _core_
.CURSOR_CHAR
741 CURSOR_CROSS
= _core_
.CURSOR_CROSS
742 CURSOR_HAND
= _core_
.CURSOR_HAND
743 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
744 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
745 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
746 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
747 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
748 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
749 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
750 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
751 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
752 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
753 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
754 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
755 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
756 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
757 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
758 CURSOR_SIZING
= _core_
.CURSOR_SIZING
759 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
760 CURSOR_WAIT
= _core_
.CURSOR_WAIT
761 CURSOR_WATCH
= _core_
.CURSOR_WATCH
762 CURSOR_BLANK
= _core_
.CURSOR_BLANK
763 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
764 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
765 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
766 CURSOR_MAX
= _core_
.CURSOR_MAX
767 #---------------------------------------------------------------------------
771 wx.Size is a useful data structure used to represent the size of
772 something. It simply contains integer width and height
773 properties. In most places in wxPython where a wx.Size is
774 expected a (width, height) tuple can be used instead.
776 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
777 __repr__
= _swig_repr
778 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
779 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
780 x
= width
; y
= height
781 def __init__(self
, *args
, **kwargs
):
783 __init__(self, int w=0, int h=0) -> Size
785 Creates a size object.
787 _core_
.Size_swiginit(self
,_core_
.new_Size(*args
, **kwargs
))
788 __swig_destroy__
= _core_
.delete_Size
789 __del__
= lambda self
: None;
790 def __eq__(*args
, **kwargs
):
792 __eq__(self, PyObject other) -> bool
794 Test for equality of wx.Size objects.
796 return _core_
.Size___eq__(*args
, **kwargs
)
798 def __ne__(*args
, **kwargs
):
800 __ne__(self, PyObject other) -> bool
802 Test for inequality of wx.Size objects.
804 return _core_
.Size___ne__(*args
, **kwargs
)
806 def __add__(*args
, **kwargs
):
808 __add__(self, Size sz) -> Size
810 Add sz's proprties to this and return the result.
812 return _core_
.Size___add__(*args
, **kwargs
)
814 def __sub__(*args
, **kwargs
):
816 __sub__(self, Size sz) -> Size
818 Subtract sz's properties from this and return the result.
820 return _core_
.Size___sub__(*args
, **kwargs
)
822 def IncTo(*args
, **kwargs
):
826 Increments this object so that both of its dimensions are not less
827 than the corresponding dimensions of the size.
829 return _core_
.Size_IncTo(*args
, **kwargs
)
831 def DecTo(*args
, **kwargs
):
835 Decrements this object so that both of its dimensions are not greater
836 than the corresponding dimensions of the size.
838 return _core_
.Size_DecTo(*args
, **kwargs
)
840 def Scale(*args
, **kwargs
):
842 Scale(self, float xscale, float yscale)
844 Scales the dimensions of this object by the given factors.
846 return _core_
.Size_Scale(*args
, **kwargs
)
848 def Set(*args
, **kwargs
):
850 Set(self, int w, int h)
852 Set both width and height.
854 return _core_
.Size_Set(*args
, **kwargs
)
856 def SetWidth(*args
, **kwargs
):
857 """SetWidth(self, int w)"""
858 return _core_
.Size_SetWidth(*args
, **kwargs
)
860 def SetHeight(*args
, **kwargs
):
861 """SetHeight(self, int h)"""
862 return _core_
.Size_SetHeight(*args
, **kwargs
)
864 def GetWidth(*args
, **kwargs
):
865 """GetWidth(self) -> int"""
866 return _core_
.Size_GetWidth(*args
, **kwargs
)
868 def GetHeight(*args
, **kwargs
):
869 """GetHeight(self) -> int"""
870 return _core_
.Size_GetHeight(*args
, **kwargs
)
872 def IsFullySpecified(*args
, **kwargs
):
874 IsFullySpecified(self) -> bool
876 Returns True if both components of the size are non-default values.
878 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
880 def SetDefaults(*args
, **kwargs
):
882 SetDefaults(self, Size size)
884 Combine this size with the other one replacing the default components
885 of this object (i.e. equal to -1) with those of the other.
887 return _core_
.Size_SetDefaults(*args
, **kwargs
)
889 def Get(*args
, **kwargs
):
891 Get() -> (width,height)
893 Returns the width and height properties as a tuple.
895 return _core_
.Size_Get(*args
, **kwargs
)
897 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
898 def __str__(self
): return str(self
.Get())
899 def __repr__(self
): return 'wx.Size'+str(self
.Get())
900 def __len__(self
): return len(self
.Get())
901 def __getitem__(self
, index
): return self
.Get()[index
]
902 def __setitem__(self
, index
, val
):
903 if index
== 0: self
.width
= val
904 elif index
== 1: self
.height
= val
905 else: raise IndexError
906 def __nonzero__(self
): return self
.Get() != (0,0)
907 __safe_for_unpickling__
= True
908 def __reduce__(self
): return (wx
.Size
, self
.Get())
910 _core_
.Size_swigregister(Size
)
912 #---------------------------------------------------------------------------
914 class RealPoint(object):
916 A data structure for representing a point or position with floating
917 point x and y properties. In wxPython most places that expect a
918 wx.RealPoint can also accept a (x,y) tuple.
920 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
921 __repr__
= _swig_repr
922 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
923 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
924 def __init__(self
, *args
, **kwargs
):
926 __init__(self, double x=0.0, double y=0.0) -> RealPoint
928 Create a wx.RealPoint object
930 _core_
.RealPoint_swiginit(self
,_core_
.new_RealPoint(*args
, **kwargs
))
931 __swig_destroy__
= _core_
.delete_RealPoint
932 __del__
= lambda self
: None;
933 def __eq__(*args
, **kwargs
):
935 __eq__(self, PyObject other) -> bool
937 Test for equality of wx.RealPoint objects.
939 return _core_
.RealPoint___eq__(*args
, **kwargs
)
941 def __ne__(*args
, **kwargs
):
943 __ne__(self, PyObject other) -> bool
945 Test for inequality of wx.RealPoint objects.
947 return _core_
.RealPoint___ne__(*args
, **kwargs
)
949 def __add__(*args
, **kwargs
):
951 __add__(self, RealPoint pt) -> RealPoint
953 Add pt's proprties to this and return the result.
955 return _core_
.RealPoint___add__(*args
, **kwargs
)
957 def __sub__(*args
, **kwargs
):
959 __sub__(self, RealPoint pt) -> RealPoint
961 Subtract pt's proprties from this and return the result
963 return _core_
.RealPoint___sub__(*args
, **kwargs
)
965 def Set(*args
, **kwargs
):
967 Set(self, double x, double y)
969 Set both the x and y properties
971 return _core_
.RealPoint_Set(*args
, **kwargs
)
973 def Get(*args
, **kwargs
):
977 Return the x and y properties as a tuple.
979 return _core_
.RealPoint_Get(*args
, **kwargs
)
981 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
982 def __str__(self
): return str(self
.Get())
983 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
984 def __len__(self
): return len(self
.Get())
985 def __getitem__(self
, index
): return self
.Get()[index
]
986 def __setitem__(self
, index
, val
):
987 if index
== 0: self
.x
= val
988 elif index
== 1: self
.y
= val
989 else: raise IndexError
990 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
991 __safe_for_unpickling__
= True
992 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
994 _core_
.RealPoint_swigregister(RealPoint
)
996 #---------------------------------------------------------------------------
1000 A data structure for representing a point or position with integer x
1001 and y properties. Most places in wxPython that expect a wx.Point can
1002 also accept a (x,y) tuple.
1004 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1005 __repr__
= _swig_repr
1006 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1007 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1008 def __init__(self
, *args
, **kwargs
):
1010 __init__(self, int x=0, int y=0) -> Point
1012 Create a wx.Point object
1014 _core_
.Point_swiginit(self
,_core_
.new_Point(*args
, **kwargs
))
1015 __swig_destroy__
= _core_
.delete_Point
1016 __del__
= lambda self
: None;
1017 def __eq__(*args
, **kwargs
):
1019 __eq__(self, PyObject other) -> bool
1021 Test for equality of wx.Point objects.
1023 return _core_
.Point___eq__(*args
, **kwargs
)
1025 def __ne__(*args
, **kwargs
):
1027 __ne__(self, PyObject other) -> bool
1029 Test for inequality of wx.Point objects.
1031 return _core_
.Point___ne__(*args
, **kwargs
)
1033 def __add__(*args
, **kwargs
):
1035 __add__(self, Point pt) -> Point
1037 Add pt's proprties to this and return the result.
1039 return _core_
.Point___add__(*args
, **kwargs
)
1041 def __sub__(*args
, **kwargs
):
1043 __sub__(self, Point pt) -> Point
1045 Subtract pt's proprties from this and return the result
1047 return _core_
.Point___sub__(*args
, **kwargs
)
1049 def __iadd__(*args
, **kwargs
):
1051 __iadd__(self, Point pt) -> Point
1053 Add pt to this object.
1055 return _core_
.Point___iadd__(*args
, **kwargs
)
1057 def __isub__(*args
, **kwargs
):
1059 __isub__(self, Point pt) -> Point
1061 Subtract pt from this object.
1063 return _core_
.Point___isub__(*args
, **kwargs
)
1065 def Set(*args
, **kwargs
):
1067 Set(self, long x, long y)
1069 Set both the x and y properties
1071 return _core_
.Point_Set(*args
, **kwargs
)
1073 def Get(*args
, **kwargs
):
1077 Return the x and y properties as a tuple.
1079 return _core_
.Point_Get(*args
, **kwargs
)
1081 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1082 def __str__(self
): return str(self
.Get())
1083 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1084 def __len__(self
): return len(self
.Get())
1085 def __getitem__(self
, index
): return self
.Get()[index
]
1086 def __setitem__(self
, index
, val
):
1087 if index
== 0: self
.x
= val
1088 elif index
== 1: self
.y
= val
1089 else: raise IndexError
1090 def __nonzero__(self
): return self
.Get() != (0,0)
1091 __safe_for_unpickling__
= True
1092 def __reduce__(self
): return (wx
.Point
, self
.Get())
1094 _core_
.Point_swigregister(Point
)
1096 #---------------------------------------------------------------------------
1100 A class for representing and manipulating rectangles. It has x, y,
1101 width and height properties. In wxPython most palces that expect a
1102 wx.Rect can also accept a (x,y,width,height) tuple.
1104 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1105 __repr__
= _swig_repr
1106 def __init__(self
, *args
, **kwargs
):
1108 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1110 Create a new Rect object.
1112 _core_
.Rect_swiginit(self
,_core_
.new_Rect(*args
, **kwargs
))
1113 __swig_destroy__
= _core_
.delete_Rect
1114 __del__
= lambda self
: None;
1115 def GetX(*args
, **kwargs
):
1116 """GetX(self) -> int"""
1117 return _core_
.Rect_GetX(*args
, **kwargs
)
1119 def SetX(*args
, **kwargs
):
1120 """SetX(self, int x)"""
1121 return _core_
.Rect_SetX(*args
, **kwargs
)
1123 def GetY(*args
, **kwargs
):
1124 """GetY(self) -> int"""
1125 return _core_
.Rect_GetY(*args
, **kwargs
)
1127 def SetY(*args
, **kwargs
):
1128 """SetY(self, int y)"""
1129 return _core_
.Rect_SetY(*args
, **kwargs
)
1131 def GetWidth(*args
, **kwargs
):
1132 """GetWidth(self) -> int"""
1133 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1135 def SetWidth(*args
, **kwargs
):
1136 """SetWidth(self, int w)"""
1137 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1139 def GetHeight(*args
, **kwargs
):
1140 """GetHeight(self) -> int"""
1141 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1143 def SetHeight(*args
, **kwargs
):
1144 """SetHeight(self, int h)"""
1145 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1147 def GetPosition(*args
, **kwargs
):
1148 """GetPosition(self) -> Point"""
1149 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1151 def SetPosition(*args
, **kwargs
):
1152 """SetPosition(self, Point p)"""
1153 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1155 def GetSize(*args
, **kwargs
):
1156 """GetSize(self) -> Size"""
1157 return _core_
.Rect_GetSize(*args
, **kwargs
)
1159 def SetSize(*args
, **kwargs
):
1160 """SetSize(self, Size s)"""
1161 return _core_
.Rect_SetSize(*args
, **kwargs
)
1163 def IsEmpty(*args
, **kwargs
):
1164 """IsEmpty(self) -> bool"""
1165 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1167 def GetTopLeft(*args
, **kwargs
):
1168 """GetTopLeft(self) -> Point"""
1169 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1171 def SetTopLeft(*args
, **kwargs
):
1172 """SetTopLeft(self, Point p)"""
1173 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1175 def GetBottomRight(*args
, **kwargs
):
1176 """GetBottomRight(self) -> Point"""
1177 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1179 def SetBottomRight(*args
, **kwargs
):
1180 """SetBottomRight(self, Point p)"""
1181 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1183 def GetLeft(*args
, **kwargs
):
1184 """GetLeft(self) -> int"""
1185 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1187 def GetTop(*args
, **kwargs
):
1188 """GetTop(self) -> int"""
1189 return _core_
.Rect_GetTop(*args
, **kwargs
)
1191 def GetBottom(*args
, **kwargs
):
1192 """GetBottom(self) -> int"""
1193 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1195 def GetRight(*args
, **kwargs
):
1196 """GetRight(self) -> int"""
1197 return _core_
.Rect_GetRight(*args
, **kwargs
)
1199 def SetLeft(*args
, **kwargs
):
1200 """SetLeft(self, int left)"""
1201 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1203 def SetRight(*args
, **kwargs
):
1204 """SetRight(self, int right)"""
1205 return _core_
.Rect_SetRight(*args
, **kwargs
)
1207 def SetTop(*args
, **kwargs
):
1208 """SetTop(self, int top)"""
1209 return _core_
.Rect_SetTop(*args
, **kwargs
)
1211 def SetBottom(*args
, **kwargs
):
1212 """SetBottom(self, int bottom)"""
1213 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1215 position
= property(GetPosition
, SetPosition
)
1216 size
= property(GetSize
, SetSize
)
1217 left
= property(GetLeft
, SetLeft
)
1218 right
= property(GetRight
, SetRight
)
1219 top
= property(GetTop
, SetTop
)
1220 bottom
= property(GetBottom
, SetBottom
)
1222 def Inflate(*args
, **kwargs
):
1224 Inflate(self, int dx, int dy) -> Rect
1226 Increases the size of the rectangle.
1228 The left border is moved farther left and the right border is moved
1229 farther right by ``dx``. The upper border is moved farther up and the
1230 bottom border is moved farther down by ``dy``. (Note the the width and
1231 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1232 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1233 opposite happens: the rectangle size decreases in the respective
1236 The change is made to the rectangle inplace, if instead you need a
1237 copy that is inflated, preserving the original then make the copy
1240 copy = wx.Rect(*original)
1245 return _core_
.Rect_Inflate(*args
, **kwargs
)
1247 def Deflate(*args
, **kwargs
):
1249 Deflate(self, int dx, int dy) -> Rect
1251 Decrease the rectangle size. This method is the opposite of `Inflate`
1252 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1253 `Inflate` for a full description.
1255 return _core_
.Rect_Deflate(*args
, **kwargs
)
1257 def OffsetXY(*args
, **kwargs
):
1259 OffsetXY(self, int dx, int dy)
1261 Moves the rectangle by the specified offset. If dx is positive, the
1262 rectangle is moved to the right, if dy is positive, it is moved to the
1263 bottom, otherwise it is moved to the left or top respectively.
1265 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1267 def Offset(*args
, **kwargs
):
1269 Offset(self, Point pt)
1271 Same as `OffsetXY` but uses dx,dy from Point
1273 return _core_
.Rect_Offset(*args
, **kwargs
)
1275 def Intersect(*args
, **kwargs
):
1277 Intersect(self, Rect rect) -> Rect
1279 Returns the intersectsion of this rectangle and rect.
1281 return _core_
.Rect_Intersect(*args
, **kwargs
)
1283 def Union(*args
, **kwargs
):
1285 Union(self, Rect rect) -> Rect
1287 Returns the union of this rectangle and rect.
1289 return _core_
.Rect_Union(*args
, **kwargs
)
1291 def __add__(*args
, **kwargs
):
1293 __add__(self, Rect rect) -> Rect
1295 Add the properties of rect to this rectangle and return the result.
1297 return _core_
.Rect___add__(*args
, **kwargs
)
1299 def __iadd__(*args
, **kwargs
):
1301 __iadd__(self, Rect rect) -> Rect
1303 Add the properties of rect to this rectangle, updating this rectangle.
1305 return _core_
.Rect___iadd__(*args
, **kwargs
)
1307 def __eq__(*args
, **kwargs
):
1309 __eq__(self, PyObject other) -> bool
1311 Test for equality of wx.Rect objects.
1313 return _core_
.Rect___eq__(*args
, **kwargs
)
1315 def __ne__(*args
, **kwargs
):
1317 __ne__(self, PyObject other) -> bool
1319 Test for inequality of wx.Rect objects.
1321 return _core_
.Rect___ne__(*args
, **kwargs
)
1323 def InsideXY(*args
, **kwargs
):
1325 InsideXY(self, int x, int y) -> bool
1327 Return True if the point is (not strcitly) inside the rect.
1329 return _core_
.Rect_InsideXY(*args
, **kwargs
)
1331 def Inside(*args
, **kwargs
):
1333 Inside(self, Point pt) -> bool
1335 Return True if the point is (not strcitly) inside the rect.
1337 return _core_
.Rect_Inside(*args
, **kwargs
)
1339 def InsideRect(*args
, **kwargs
):
1341 InsideRect(self, Rect rect) -> bool
1343 Returns ``True`` if the given rectangle is completely inside this
1344 rectangle or touches its boundary.
1346 return _core_
.Rect_InsideRect(*args
, **kwargs
)
1348 def Intersects(*args
, **kwargs
):
1350 Intersects(self, Rect rect) -> bool
1352 Returns True if the rectangles have a non empty intersection.
1354 return _core_
.Rect_Intersects(*args
, **kwargs
)
1356 def CenterIn(*args
, **kwargs
):
1358 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1360 Center this rectangle within the one passed to the method, which is
1361 usually, but not necessarily, the larger one.
1363 return _core_
.Rect_CenterIn(*args
, **kwargs
)
1366 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1367 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1368 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1369 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1370 def Set(*args
, **kwargs
):
1372 Set(self, int x=0, int y=0, int width=0, int height=0)
1374 Set all rectangle properties.
1376 return _core_
.Rect_Set(*args
, **kwargs
)
1378 def Get(*args
, **kwargs
):
1380 Get() -> (x,y,width,height)
1382 Return the rectangle properties as a tuple.
1384 return _core_
.Rect_Get(*args
, **kwargs
)
1386 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1387 def __str__(self
): return str(self
.Get())
1388 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1389 def __len__(self
): return len(self
.Get())
1390 def __getitem__(self
, index
): return self
.Get()[index
]
1391 def __setitem__(self
, index
, val
):
1392 if index
== 0: self
.x
= val
1393 elif index
== 1: self
.y
= val
1394 elif index
== 2: self
.width
= val
1395 elif index
== 3: self
.height
= val
1396 else: raise IndexError
1397 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1398 __safe_for_unpickling__
= True
1399 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1401 _core_
.Rect_swigregister(Rect
)
1403 def RectPP(*args
, **kwargs
):
1405 RectPP(Point topLeft, Point bottomRight) -> Rect
1407 Create a new Rect object from Points representing two corners.
1409 val
= _core_
.new_RectPP(*args
, **kwargs
)
1412 def RectPS(*args
, **kwargs
):
1414 RectPS(Point pos, Size size) -> Rect
1416 Create a new Rect from a position and size.
1418 val
= _core_
.new_RectPS(*args
, **kwargs
)
1421 def RectS(*args
, **kwargs
):
1423 RectS(Size size) -> Rect
1425 Create a new Rect from a size only.
1427 val
= _core_
.new_RectS(*args
, **kwargs
)
1431 def IntersectRect(*args
, **kwargs
):
1433 IntersectRect(Rect r1, Rect r2) -> Rect
1435 Calculate and return the intersection of r1 and r2.
1437 return _core_
.IntersectRect(*args
, **kwargs
)
1438 #---------------------------------------------------------------------------
1440 class Point2D(object):
1442 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1443 with floating point values.
1445 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1446 __repr__
= _swig_repr
1447 def __init__(self
, *args
, **kwargs
):
1449 __init__(self, double x=0.0, double y=0.0) -> Point2D
1451 Create a w.Point2D object.
1453 _core_
.Point2D_swiginit(self
,_core_
.new_Point2D(*args
, **kwargs
))
1454 def GetFloor(*args
, **kwargs
):
1460 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1462 def GetRounded(*args
, **kwargs
):
1464 GetRounded() -> (x,y)
1468 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1470 def GetVectorLength(*args
, **kwargs
):
1471 """GetVectorLength(self) -> double"""
1472 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1474 def GetVectorAngle(*args
, **kwargs
):
1475 """GetVectorAngle(self) -> double"""
1476 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1478 def SetVectorLength(*args
, **kwargs
):
1479 """SetVectorLength(self, double length)"""
1480 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1482 def SetVectorAngle(*args
, **kwargs
):
1483 """SetVectorAngle(self, double degrees)"""
1484 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1486 def SetPolarCoordinates(self
, angle
, length
):
1487 self
.SetVectorLength(length
)
1488 self
.SetVectorAngle(angle
)
1489 def Normalize(self
):
1490 self
.SetVectorLength(1.0)
1492 def GetDistance(*args
, **kwargs
):
1493 """GetDistance(self, Point2D pt) -> double"""
1494 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1496 def GetDistanceSquare(*args
, **kwargs
):
1497 """GetDistanceSquare(self, Point2D pt) -> double"""
1498 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1500 def GetDotProduct(*args
, **kwargs
):
1501 """GetDotProduct(self, Point2D vec) -> double"""
1502 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1504 def GetCrossProduct(*args
, **kwargs
):
1505 """GetCrossProduct(self, Point2D vec) -> double"""
1506 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1508 def __neg__(*args
, **kwargs
):
1510 __neg__(self) -> Point2D
1512 the reflection of this point
1514 return _core_
.Point2D___neg__(*args
, **kwargs
)
1516 def __iadd__(*args
, **kwargs
):
1517 """__iadd__(self, Point2D pt) -> Point2D"""
1518 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1520 def __isub__(*args
, **kwargs
):
1521 """__isub__(self, Point2D pt) -> Point2D"""
1522 return _core_
.Point2D___isub__(*args
, **kwargs
)
1524 def __imul__(*args
, **kwargs
):
1525 """__imul__(self, Point2D pt) -> Point2D"""
1526 return _core_
.Point2D___imul__(*args
, **kwargs
)
1528 def __idiv__(*args
, **kwargs
):
1529 """__idiv__(self, Point2D pt) -> Point2D"""
1530 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1532 def __eq__(*args
, **kwargs
):
1534 __eq__(self, PyObject other) -> bool
1536 Test for equality of wx.Point2D objects.
1538 return _core_
.Point2D___eq__(*args
, **kwargs
)
1540 def __ne__(*args
, **kwargs
):
1542 __ne__(self, PyObject other) -> bool
1544 Test for inequality of wx.Point2D objects.
1546 return _core_
.Point2D___ne__(*args
, **kwargs
)
1548 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1549 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1550 def Set(*args
, **kwargs
):
1551 """Set(self, double x=0, double y=0)"""
1552 return _core_
.Point2D_Set(*args
, **kwargs
)
1554 def Get(*args
, **kwargs
):
1558 Return x and y properties as a tuple.
1560 return _core_
.Point2D_Get(*args
, **kwargs
)
1562 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1563 def __str__(self
): return str(self
.Get())
1564 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1565 def __len__(self
): return len(self
.Get())
1566 def __getitem__(self
, index
): return self
.Get()[index
]
1567 def __setitem__(self
, index
, val
):
1568 if index
== 0: self
.x
= val
1569 elif index
== 1: self
.y
= val
1570 else: raise IndexError
1571 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1572 __safe_for_unpickling__
= True
1573 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1575 _core_
.Point2D_swigregister(Point2D
)
1577 def Point2DCopy(*args
, **kwargs
):
1579 Point2DCopy(Point2D pt) -> Point2D
1581 Create a w.Point2D object.
1583 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1586 def Point2DFromPoint(*args
, **kwargs
):
1588 Point2DFromPoint(Point pt) -> Point2D
1590 Create a w.Point2D object.
1592 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1595 #---------------------------------------------------------------------------
1597 FromStart
= _core_
.FromStart
1598 FromCurrent
= _core_
.FromCurrent
1599 FromEnd
= _core_
.FromEnd
1600 class InputStream(object):
1601 """Proxy of C++ InputStream class"""
1602 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1603 __repr__
= _swig_repr
1604 def __init__(self
, *args
, **kwargs
):
1605 """__init__(self, PyObject p) -> InputStream"""
1606 _core_
.InputStream_swiginit(self
,_core_
.new_InputStream(*args
, **kwargs
))
1607 __swig_destroy__
= _core_
.delete_InputStream
1608 __del__
= lambda self
: None;
1609 def close(*args
, **kwargs
):
1611 return _core_
.InputStream_close(*args
, **kwargs
)
1613 def flush(*args
, **kwargs
):
1615 return _core_
.InputStream_flush(*args
, **kwargs
)
1617 def eof(*args
, **kwargs
):
1618 """eof(self) -> bool"""
1619 return _core_
.InputStream_eof(*args
, **kwargs
)
1621 def read(*args
, **kwargs
):
1622 """read(self, int size=-1) -> PyObject"""
1623 return _core_
.InputStream_read(*args
, **kwargs
)
1625 def readline(*args
, **kwargs
):
1626 """readline(self, int size=-1) -> PyObject"""
1627 return _core_
.InputStream_readline(*args
, **kwargs
)
1629 def readlines(*args
, **kwargs
):
1630 """readlines(self, int sizehint=-1) -> PyObject"""
1631 return _core_
.InputStream_readlines(*args
, **kwargs
)
1633 def seek(*args
, **kwargs
):
1634 """seek(self, int offset, int whence=0)"""
1635 return _core_
.InputStream_seek(*args
, **kwargs
)
1637 def tell(*args
, **kwargs
):
1638 """tell(self) -> int"""
1639 return _core_
.InputStream_tell(*args
, **kwargs
)
1641 def Peek(*args
, **kwargs
):
1642 """Peek(self) -> char"""
1643 return _core_
.InputStream_Peek(*args
, **kwargs
)
1645 def GetC(*args
, **kwargs
):
1646 """GetC(self) -> char"""
1647 return _core_
.InputStream_GetC(*args
, **kwargs
)
1649 def LastRead(*args
, **kwargs
):
1650 """LastRead(self) -> size_t"""
1651 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1653 def CanRead(*args
, **kwargs
):
1654 """CanRead(self) -> bool"""
1655 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1657 def Eof(*args
, **kwargs
):
1658 """Eof(self) -> bool"""
1659 return _core_
.InputStream_Eof(*args
, **kwargs
)
1661 def Ungetch(*args
, **kwargs
):
1662 """Ungetch(self, char c) -> bool"""
1663 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1665 def SeekI(*args
, **kwargs
):
1666 """SeekI(self, long pos, int mode=FromStart) -> long"""
1667 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1669 def TellI(*args
, **kwargs
):
1670 """TellI(self) -> long"""
1671 return _core_
.InputStream_TellI(*args
, **kwargs
)
1673 _core_
.InputStream_swigregister(InputStream
)
1674 DefaultPosition
= cvar
.DefaultPosition
1675 DefaultSize
= cvar
.DefaultSize
1677 class OutputStream(object):
1678 """Proxy of C++ OutputStream class"""
1679 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1680 def __init__(self
): raise AttributeError, "No constructor defined"
1681 __repr__
= _swig_repr
1682 def write(*args
, **kwargs
):
1683 """write(self, PyObject obj)"""
1684 return _core_
.OutputStream_write(*args
, **kwargs
)
1686 def LastWrite(*args
, **kwargs
):
1687 """LastWrite(self) -> size_t"""
1688 return _core_
.OutputStream_LastWrite(*args
, **kwargs
)
1690 _core_
.OutputStream_swigregister(OutputStream
)
1692 #---------------------------------------------------------------------------
1694 class FSFile(Object
):
1695 """Proxy of C++ FSFile class"""
1696 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1697 __repr__
= _swig_repr
1698 def __init__(self
, *args
, **kwargs
):
1700 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1701 DateTime modif) -> FSFile
1703 _core_
.FSFile_swiginit(self
,_core_
.new_FSFile(*args
, **kwargs
))
1704 __swig_destroy__
= _core_
.delete_FSFile
1705 __del__
= lambda self
: None;
1706 def GetStream(*args
, **kwargs
):
1707 """GetStream(self) -> InputStream"""
1708 return _core_
.FSFile_GetStream(*args
, **kwargs
)
1710 def DetachStream(*args
, **kwargs
):
1711 """DetachStream(self)"""
1712 return _core_
.FSFile_DetachStream(*args
, **kwargs
)
1714 def GetMimeType(*args
, **kwargs
):
1715 """GetMimeType(self) -> String"""
1716 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
1718 def GetLocation(*args
, **kwargs
):
1719 """GetLocation(self) -> String"""
1720 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
1722 def GetAnchor(*args
, **kwargs
):
1723 """GetAnchor(self) -> String"""
1724 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
1726 def GetModificationTime(*args
, **kwargs
):
1727 """GetModificationTime(self) -> DateTime"""
1728 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
1730 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
1731 Location
= property(GetLocation
,doc
="See `GetLocation`")
1732 MimeType
= property(GetMimeType
,doc
="See `GetMimeType`")
1733 ModificationTime
= property(GetModificationTime
,doc
="See `GetModificationTime`")
1734 Stream
= property(GetStream
,doc
="See `GetStream`")
1735 _core_
.FSFile_swigregister(FSFile
)
1737 class CPPFileSystemHandler(object):
1738 """Proxy of C++ CPPFileSystemHandler class"""
1739 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1740 def __init__(self
): raise AttributeError, "No constructor defined"
1741 __repr__
= _swig_repr
1742 __swig_destroy__
= _core_
.delete_CPPFileSystemHandler
1743 __del__
= lambda self
: None;
1744 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandler
)
1746 class FileSystemHandler(CPPFileSystemHandler
):
1747 """Proxy of C++ FileSystemHandler class"""
1748 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1749 __repr__
= _swig_repr
1750 def __init__(self
, *args
, **kwargs
):
1751 """__init__(self) -> FileSystemHandler"""
1752 _core_
.FileSystemHandler_swiginit(self
,_core_
.new_FileSystemHandler(*args
, **kwargs
))
1753 self
._setCallbackInfo
(self
, FileSystemHandler
)
1755 def _setCallbackInfo(*args
, **kwargs
):
1756 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1757 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
1759 def CanOpen(*args
, **kwargs
):
1760 """CanOpen(self, String location) -> bool"""
1761 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
1763 def OpenFile(*args
, **kwargs
):
1764 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1765 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
1767 def FindFirst(*args
, **kwargs
):
1768 """FindFirst(self, String spec, int flags=0) -> String"""
1769 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
1771 def FindNext(*args
, **kwargs
):
1772 """FindNext(self) -> String"""
1773 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
1775 def GetProtocol(*args
, **kwargs
):
1776 """GetProtocol(self, String location) -> String"""
1777 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
1779 def GetLeftLocation(*args
, **kwargs
):
1780 """GetLeftLocation(self, String location) -> String"""
1781 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
1783 def GetAnchor(*args
, **kwargs
):
1784 """GetAnchor(self, String location) -> String"""
1785 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
1787 def GetRightLocation(*args
, **kwargs
):
1788 """GetRightLocation(self, String location) -> String"""
1789 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
1791 def GetMimeTypeFromExt(*args
, **kwargs
):
1792 """GetMimeTypeFromExt(self, String location) -> String"""
1793 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
1795 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
1796 LeftLocation
= property(GetLeftLocation
,doc
="See `GetLeftLocation`")
1797 MimeTypeFromExt
= property(GetMimeTypeFromExt
,doc
="See `GetMimeTypeFromExt`")
1798 Protocol
= property(GetProtocol
,doc
="See `GetProtocol`")
1799 RightLocation
= property(GetRightLocation
,doc
="See `GetRightLocation`")
1800 _core_
.FileSystemHandler_swigregister(FileSystemHandler
)
1802 class FileSystem(Object
):
1803 """Proxy of C++ FileSystem class"""
1804 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1805 __repr__
= _swig_repr
1806 def __init__(self
, *args
, **kwargs
):
1807 """__init__(self) -> FileSystem"""
1808 _core_
.FileSystem_swiginit(self
,_core_
.new_FileSystem(*args
, **kwargs
))
1809 __swig_destroy__
= _core_
.delete_FileSystem
1810 __del__
= lambda self
: None;
1811 def ChangePathTo(*args
, **kwargs
):
1812 """ChangePathTo(self, String location, bool is_dir=False)"""
1813 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
1815 def GetPath(*args
, **kwargs
):
1816 """GetPath(self) -> String"""
1817 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
1819 def OpenFile(*args
, **kwargs
):
1820 """OpenFile(self, String location) -> FSFile"""
1821 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
1823 def FindFirst(*args
, **kwargs
):
1824 """FindFirst(self, String spec, int flags=0) -> String"""
1825 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
1827 def FindNext(*args
, **kwargs
):
1828 """FindNext(self) -> String"""
1829 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
1831 def AddHandler(*args
, **kwargs
):
1832 """AddHandler(CPPFileSystemHandler handler)"""
1833 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1835 AddHandler
= staticmethod(AddHandler
)
1836 def RemoveHandler(*args
, **kwargs
):
1837 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1838 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
1840 RemoveHandler
= staticmethod(RemoveHandler
)
1841 def CleanUpHandlers(*args
, **kwargs
):
1842 """CleanUpHandlers()"""
1843 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1845 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
1846 def FileNameToURL(*args
, **kwargs
):
1847 """FileNameToURL(String filename) -> String"""
1848 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1850 FileNameToURL
= staticmethod(FileNameToURL
)
1851 def URLToFileName(*args
, **kwargs
):
1852 """URLToFileName(String url) -> String"""
1853 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1855 URLToFileName
= staticmethod(URLToFileName
)
1856 Path
= property(GetPath
,doc
="See `GetPath`")
1857 _core_
.FileSystem_swigregister(FileSystem
)
1859 def FileSystem_AddHandler(*args
, **kwargs
):
1860 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1861 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1863 def FileSystem_RemoveHandler(*args
, **kwargs
):
1864 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1865 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
1867 def FileSystem_CleanUpHandlers(*args
):
1868 """FileSystem_CleanUpHandlers()"""
1869 return _core_
.FileSystem_CleanUpHandlers(*args
)
1871 def FileSystem_FileNameToURL(*args
, **kwargs
):
1872 """FileSystem_FileNameToURL(String filename) -> String"""
1873 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1875 def FileSystem_URLToFileName(*args
, **kwargs
):
1876 """FileSystem_URLToFileName(String url) -> String"""
1877 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1879 class InternetFSHandler(CPPFileSystemHandler
):
1880 """Proxy of C++ InternetFSHandler class"""
1881 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1882 __repr__
= _swig_repr
1883 def __init__(self
, *args
, **kwargs
):
1884 """__init__(self) -> InternetFSHandler"""
1885 _core_
.InternetFSHandler_swiginit(self
,_core_
.new_InternetFSHandler(*args
, **kwargs
))
1886 def CanOpen(*args
, **kwargs
):
1887 """CanOpen(self, String location) -> bool"""
1888 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
1890 def OpenFile(*args
, **kwargs
):
1891 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1892 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
1894 _core_
.InternetFSHandler_swigregister(InternetFSHandler
)
1896 class ZipFSHandler(CPPFileSystemHandler
):
1897 """Proxy of C++ ZipFSHandler class"""
1898 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1899 __repr__
= _swig_repr
1900 def __init__(self
, *args
, **kwargs
):
1901 """__init__(self) -> ZipFSHandler"""
1902 _core_
.ZipFSHandler_swiginit(self
,_core_
.new_ZipFSHandler(*args
, **kwargs
))
1903 def CanOpen(*args
, **kwargs
):
1904 """CanOpen(self, String location) -> bool"""
1905 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
1907 def OpenFile(*args
, **kwargs
):
1908 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1909 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
1911 def FindFirst(*args
, **kwargs
):
1912 """FindFirst(self, String spec, int flags=0) -> String"""
1913 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
1915 def FindNext(*args
, **kwargs
):
1916 """FindNext(self) -> String"""
1917 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
1919 _core_
.ZipFSHandler_swigregister(ZipFSHandler
)
1922 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
1923 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1924 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
1926 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
1927 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1928 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
1930 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
1931 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1932 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
1933 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
1935 Add 'file' to the memory filesystem. The dataItem parameter can
1936 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1937 arbitrary data. If a bitmap or image is used then the imgType
1938 parameter should specify what kind of image file it should be
1939 written as, wx.BITMAP_TYPE_PNG, etc.
1941 if isinstance(dataItem
, wx
.Image
):
1942 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
1943 elif isinstance(dataItem
, wx
.Bitmap
):
1944 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
1945 elif type(dataItem
) == str:
1946 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
1948 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1950 class MemoryFSHandler(CPPFileSystemHandler
):
1951 """Proxy of C++ MemoryFSHandler class"""
1952 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1953 __repr__
= _swig_repr
1954 def __init__(self
, *args
, **kwargs
):
1955 """__init__(self) -> MemoryFSHandler"""
1956 _core_
.MemoryFSHandler_swiginit(self
,_core_
.new_MemoryFSHandler(*args
, **kwargs
))
1957 def RemoveFile(*args
, **kwargs
):
1958 """RemoveFile(String filename)"""
1959 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1961 RemoveFile
= staticmethod(RemoveFile
)
1962 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
1963 def CanOpen(*args
, **kwargs
):
1964 """CanOpen(self, String location) -> bool"""
1965 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
1967 def OpenFile(*args
, **kwargs
):
1968 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1969 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
1971 def FindFirst(*args
, **kwargs
):
1972 """FindFirst(self, String spec, int flags=0) -> String"""
1973 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
1975 def FindNext(*args
, **kwargs
):
1976 """FindNext(self) -> String"""
1977 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
1979 _core_
.MemoryFSHandler_swigregister(MemoryFSHandler
)
1981 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
1982 """MemoryFSHandler_RemoveFile(String filename)"""
1983 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1985 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
1986 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
1987 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
1988 #---------------------------------------------------------------------------
1990 class ImageHandler(Object
):
1992 This is the base class for implementing image file loading/saving, and
1993 image creation from data. It is used within `wx.Image` and is not
1994 normally seen by the application.
1996 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1997 def __init__(self
): raise AttributeError, "No constructor defined"
1998 __repr__
= _swig_repr
1999 def GetName(*args
, **kwargs
):
2000 """GetName(self) -> String"""
2001 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
2003 def GetExtension(*args
, **kwargs
):
2004 """GetExtension(self) -> String"""
2005 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
2007 def GetType(*args
, **kwargs
):
2008 """GetType(self) -> long"""
2009 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2011 def GetMimeType(*args
, **kwargs
):
2012 """GetMimeType(self) -> String"""
2013 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2015 def CanRead(*args
, **kwargs
):
2016 """CanRead(self, String name) -> bool"""
2017 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2019 def CanReadStream(*args
, **kwargs
):
2020 """CanReadStream(self, InputStream stream) -> bool"""
2021 return _core_
.ImageHandler_CanReadStream(*args
, **kwargs
)
2023 def SetName(*args
, **kwargs
):
2024 """SetName(self, String name)"""
2025 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2027 def SetExtension(*args
, **kwargs
):
2028 """SetExtension(self, String extension)"""
2029 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2031 def SetType(*args
, **kwargs
):
2032 """SetType(self, long type)"""
2033 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2035 def SetMimeType(*args
, **kwargs
):
2036 """SetMimeType(self, String mimetype)"""
2037 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2039 Extension
= property(GetExtension
,SetExtension
,doc
="See `GetExtension` and `SetExtension`")
2040 MimeType
= property(GetMimeType
,SetMimeType
,doc
="See `GetMimeType` and `SetMimeType`")
2041 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
2042 Type
= property(GetType
,SetType
,doc
="See `GetType` and `SetType`")
2043 _core_
.ImageHandler_swigregister(ImageHandler
)
2045 class PyImageHandler(ImageHandler
):
2047 This is the base class for implementing image file loading/saving, and
2048 image creation from data, all written in Python. To create a custom
2049 image handler derive a new class from wx.PyImageHandler and provide
2050 the following methods::
2052 def DoCanRead(self, stream) --> bool
2053 '''Check if this handler can read the image on the stream'''
2055 def LoadFile(self, image, stream, verbose, index) --> bool
2056 '''Load image data from the stream and load it into image.'''
2058 def SaveFile(self, image, stream, verbose) --> bool
2059 '''Save the iamge data in image to the stream using
2060 this handler's image file format.'''
2062 def GetImageCount(self, stream) --> int
2063 '''If this image format can hold more than one image,
2064 how many does the image on the stream have?'''
2066 To activate your handler create an instance of it and pass it to
2067 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2068 `SetExtension` from your constructor.
2071 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2072 __repr__
= _swig_repr
2073 def __init__(self
, *args
, **kwargs
):
2075 __init__(self) -> PyImageHandler
2077 This is the base class for implementing image file loading/saving, and
2078 image creation from data, all written in Python. To create a custom
2079 image handler derive a new class from wx.PyImageHandler and provide
2080 the following methods::
2082 def DoCanRead(self, stream) --> bool
2083 '''Check if this handler can read the image on the stream'''
2085 def LoadFile(self, image, stream, verbose, index) --> bool
2086 '''Load image data from the stream and load it into image.'''
2088 def SaveFile(self, image, stream, verbose) --> bool
2089 '''Save the iamge data in image to the stream using
2090 this handler's image file format.'''
2092 def GetImageCount(self, stream) --> int
2093 '''If this image format can hold more than one image,
2094 how many does the image on the stream have?'''
2096 To activate your handler create an instance of it and pass it to
2097 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2098 `SetExtension` from your constructor.
2101 _core_
.PyImageHandler_swiginit(self
,_core_
.new_PyImageHandler(*args
, **kwargs
))
2104 def _SetSelf(*args
, **kwargs
):
2105 """_SetSelf(self, PyObject self)"""
2106 return _core_
.PyImageHandler__SetSelf(*args
, **kwargs
)
2108 _core_
.PyImageHandler_swigregister(PyImageHandler
)
2110 class ImageHistogram(object):
2111 """Proxy of C++ ImageHistogram class"""
2112 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2113 __repr__
= _swig_repr
2114 def __init__(self
, *args
, **kwargs
):
2115 """__init__(self) -> ImageHistogram"""
2116 _core_
.ImageHistogram_swiginit(self
,_core_
.new_ImageHistogram(*args
, **kwargs
))
2117 def MakeKey(*args
, **kwargs
):
2119 MakeKey(byte r, byte g, byte b) -> unsigned long
2121 Get the key in the histogram for the given RGB values
2123 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2125 MakeKey
= staticmethod(MakeKey
)
2126 def FindFirstUnusedColour(*args
, **kwargs
):
2128 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2130 Find first colour that is not used in the image and has higher RGB
2131 values than startR, startG, startB. Returns a tuple consisting of a
2132 success flag and rgb values.
2134 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2136 def GetCount(*args
, **kwargs
):
2138 GetCount(self, unsigned long key) -> unsigned long
2140 Returns the pixel count for the given key. Use `MakeKey` to create a
2141 key value from a RGB tripple.
2143 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2145 def GetCountRGB(*args
, **kwargs
):
2147 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2149 Returns the pixel count for the given RGB values.
2151 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2153 def GetCountColour(*args
, **kwargs
):
2155 GetCountColour(self, Colour colour) -> unsigned long
2157 Returns the pixel count for the given `wx.Colour` value.
2159 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2161 _core_
.ImageHistogram_swigregister(ImageHistogram
)
2163 def ImageHistogram_MakeKey(*args
, **kwargs
):
2165 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2167 Get the key in the histogram for the given RGB values
2169 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2171 class Image_RGBValue(object):
2173 An object that contains values for red, green and blue which represent
2174 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2175 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2178 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2179 __repr__
= _swig_repr
2180 def __init__(self
, *args
, **kwargs
):
2182 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2186 _core_
.Image_RGBValue_swiginit(self
,_core_
.new_Image_RGBValue(*args
, **kwargs
))
2187 red
= property(_core_
.Image_RGBValue_red_get
, _core_
.Image_RGBValue_red_set
)
2188 green
= property(_core_
.Image_RGBValue_green_get
, _core_
.Image_RGBValue_green_set
)
2189 blue
= property(_core_
.Image_RGBValue_blue_get
, _core_
.Image_RGBValue_blue_set
)
2190 _core_
.Image_RGBValue_swigregister(Image_RGBValue
)
2192 class Image_HSVValue(object):
2194 An object that contains values for hue, saturation and value which
2195 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2196 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2199 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2200 __repr__
= _swig_repr
2201 def __init__(self
, *args
, **kwargs
):
2203 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2207 _core_
.Image_HSVValue_swiginit(self
,_core_
.new_Image_HSVValue(*args
, **kwargs
))
2208 hue
= property(_core_
.Image_HSVValue_hue_get
, _core_
.Image_HSVValue_hue_set
)
2209 saturation
= property(_core_
.Image_HSVValue_saturation_get
, _core_
.Image_HSVValue_saturation_set
)
2210 value
= property(_core_
.Image_HSVValue_value_get
, _core_
.Image_HSVValue_value_set
)
2211 _core_
.Image_HSVValue_swigregister(Image_HSVValue
)
2213 class Image(Object
):
2215 A platform-independent image class. An image can be created from
2216 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2217 variety of formats. Functions are available to set and get image
2218 bits, so it can be used for basic image manipulation.
2220 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2221 platform-specific `wx.Bitmap` object must be created from it using the
2222 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2223 device context, using `wx.DC.DrawBitmap`.
2225 One colour value of the image may be used as a mask colour which will
2226 lead to the automatic creation of a `wx.Mask` object associated to the
2229 wx.Image supports alpha channel data, that is in addition to a byte
2230 for the red, green and blue colour components for each pixel it also
2231 stores a byte representing the pixel opacity. An alpha value of 0
2232 corresponds to a transparent pixel (null opacity) while a value of 255
2233 means that the pixel is 100% opaque.
2235 Unlike RGB data, not all images have an alpha channel and before using
2236 `GetAlpha` you should check if this image contains an alpha channel
2237 with `HasAlpha`. Note that currently only images loaded from PNG files
2238 with transparency information will have an alpha channel.
2240 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2241 __repr__
= _swig_repr
2242 def __init__(self
, *args
, **kwargs
):
2244 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2246 Loads an image from a file.
2248 _core_
.Image_swiginit(self
,_core_
.new_Image(*args
, **kwargs
))
2249 __swig_destroy__
= _core_
.delete_Image
2250 __del__
= lambda self
: None;
2251 def Create(*args
, **kwargs
):
2253 Create(self, int width, int height, bool clear=True)
2255 Creates a fresh image. If clear is ``True``, the new image will be
2256 initialized to black. Otherwise, the image data will be uninitialized.
2258 return _core_
.Image_Create(*args
, **kwargs
)
2260 def Destroy(*args
, **kwargs
):
2264 Destroys the image data.
2266 val
= _core_
.Image_Destroy(*args
, **kwargs
)
2270 def Scale(*args
, **kwargs
):
2272 Scale(self, int width, int height) -> Image
2274 Returns a scaled version of the image. This is also useful for scaling
2275 bitmaps in general as the only other way to scale bitmaps is to blit a
2276 `wx.MemoryDC` into another `wx.MemoryDC`.
2278 return _core_
.Image_Scale(*args
, **kwargs
)
2280 def ShrinkBy(*args
, **kwargs
):
2282 ShrinkBy(self, int xFactor, int yFactor) -> Image
2284 Return a version of the image scaled smaller by the given factors.
2286 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2288 def Rescale(*args
, **kwargs
):
2290 Rescale(self, int width, int height) -> Image
2292 Changes the size of the image in-place by scaling it: after a call to
2293 this function, the image will have the given width and height.
2295 Returns the (modified) image itself.
2297 return _core_
.Image_Rescale(*args
, **kwargs
)
2299 def Resize(*args
, **kwargs
):
2301 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2303 Changes the size of the image in-place without scaling it, by adding
2304 either a border with the given colour or cropping as necessary. The
2305 image is pasted into a new image with the given size and background
2306 colour at the position pos relative to the upper left of the new
2307 image. If red = green = blue = -1 then use either the current mask
2308 colour if set or find, use, and set a suitable mask colour for any
2309 newly exposed areas.
2311 Returns the (modified) image itself.
2313 return _core_
.Image_Resize(*args
, **kwargs
)
2315 def SetRGB(*args
, **kwargs
):
2317 SetRGB(self, int x, int y, byte r, byte g, byte b)
2319 Sets the pixel at the given coordinate. This routine performs
2320 bounds-checks for the coordinate so it can be considered a safe way to
2321 manipulate the data, but in some cases this might be too slow so that
2322 the data will have to be set directly. In that case you will have to
2323 get access to the image data using the `GetData` method.
2325 return _core_
.Image_SetRGB(*args
, **kwargs
)
2327 def SetRGBRect(*args
, **kwargs
):
2329 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2331 Sets the colour of the pixels within the given rectangle. This routine
2332 performs bounds-checks for the rectangle so it can be considered a
2333 safe way to manipulate the data.
2335 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2337 def GetRed(*args
, **kwargs
):
2339 GetRed(self, int x, int y) -> byte
2341 Returns the red intensity at the given coordinate.
2343 return _core_
.Image_GetRed(*args
, **kwargs
)
2345 def GetGreen(*args
, **kwargs
):
2347 GetGreen(self, int x, int y) -> byte
2349 Returns the green intensity at the given coordinate.
2351 return _core_
.Image_GetGreen(*args
, **kwargs
)
2353 def GetBlue(*args
, **kwargs
):
2355 GetBlue(self, int x, int y) -> byte
2357 Returns the blue intensity at the given coordinate.
2359 return _core_
.Image_GetBlue(*args
, **kwargs
)
2361 def SetAlpha(*args
, **kwargs
):
2363 SetAlpha(self, int x, int y, byte alpha)
2365 Sets the alpha value for the given pixel. This function should only be
2366 called if the image has alpha channel data, use `HasAlpha` to check
2369 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2371 def GetAlpha(*args
, **kwargs
):
2373 GetAlpha(self, int x, int y) -> byte
2375 Returns the alpha value for the given pixel. This function may only be
2376 called for the images with alpha channel, use `HasAlpha` to check for
2379 The returned value is the *opacity* of the image, i.e. the value of 0
2380 corresponds to the fully transparent pixels while the value of 255 to
2381 the fully opaque pixels.
2383 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2385 def HasAlpha(*args
, **kwargs
):
2387 HasAlpha(self) -> bool
2389 Returns true if this image has alpha channel, false otherwise.
2391 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2393 def InitAlpha(*args
, **kwargs
):
2397 Initializes the image alpha channel data. It is an error to call it if
2398 the image already has alpha data. If it doesn't, alpha data will be by
2399 default initialized to all pixels being fully opaque. But if the image
2400 has a a mask colour, all mask pixels will be completely transparent.
2402 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2404 def IsTransparent(*args
, **kwargs
):
2406 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2408 Returns ``True`` if this pixel is masked or has an alpha value less
2409 than the spcified threshold.
2411 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2413 def FindFirstUnusedColour(*args
, **kwargs
):
2415 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2417 Find first colour that is not used in the image and has higher RGB
2418 values than startR, startG, startB. Returns a tuple consisting of a
2419 success flag and rgb values.
2421 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2423 def ConvertAlphaToMask(*args
, **kwargs
):
2425 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2427 If the image has alpha channel, this method converts it to mask. All
2428 pixels with alpha value less than ``threshold`` are replaced with the
2429 mask colour and the alpha channel is removed. The mask colour is
2430 chosen automatically using `FindFirstUnusedColour`.
2432 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2435 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2437 def ConvertColourToAlpha(*args
, **kwargs
):
2439 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2441 This method converts an image where the original alpha information is
2442 only available as a shades of a colour (actually shades of grey)
2443 typically when you draw anti-aliased text into a bitmap. The DC
2444 drawing routines draw grey values on the black background although
2445 they actually mean to draw white with differnt alpha values. This
2446 method reverses it, assuming a black (!) background and white text.
2447 The method will then fill up the whole image with the colour given.
2449 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2451 def SetMaskFromImage(*args
, **kwargs
):
2453 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2455 Sets the image's mask so that the pixels that have RGB value of
2456 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2457 by first finding an unused colour in the image, setting this colour as
2458 the mask colour and then using this colour to draw all pixels in the
2459 image who corresponding pixel in mask has given RGB value.
2461 Returns ``False`` if ``mask`` does not have same dimensions as the
2462 image or if there is no unused colour left. Returns ``True`` if the
2463 mask was successfully applied.
2465 Note that this method involves computing the histogram, which is
2466 computationally intensive operation.
2468 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2470 def CanRead(*args
, **kwargs
):
2472 CanRead(String filename) -> bool
2474 Returns True if the image handlers can read this file.
2476 return _core_
.Image_CanRead(*args
, **kwargs
)
2478 CanRead
= staticmethod(CanRead
)
2479 def GetImageCount(*args
, **kwargs
):
2481 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2483 If the image file contains more than one image and the image handler
2484 is capable of retrieving these individually, this function will return
2485 the number of available images.
2487 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2489 GetImageCount
= staticmethod(GetImageCount
)
2490 def LoadFile(*args
, **kwargs
):
2492 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2494 Loads an image from a file. If no handler type is provided, the
2495 library will try to autodetect the format.
2497 return _core_
.Image_LoadFile(*args
, **kwargs
)
2499 def LoadMimeFile(*args
, **kwargs
):
2501 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2503 Loads an image from a file, specifying the image type with a MIME type
2506 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2508 def SaveFile(*args
, **kwargs
):
2510 SaveFile(self, String name, int type) -> bool
2512 Saves an image in the named file.
2514 return _core_
.Image_SaveFile(*args
, **kwargs
)
2516 def SaveMimeFile(*args
, **kwargs
):
2518 SaveMimeFile(self, String name, String mimetype) -> bool
2520 Saves an image in the named file.
2522 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2524 def CanReadStream(*args
, **kwargs
):
2526 CanReadStream(InputStream stream) -> bool
2528 Returns True if the image handlers can read an image file from the
2529 data currently on the input stream, or a readable Python file-like
2532 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2534 CanReadStream
= staticmethod(CanReadStream
)
2535 def LoadStream(*args
, **kwargs
):
2537 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2539 Loads an image from an input stream or a readable Python file-like
2540 object. If no handler type is provided, the library will try to
2541 autodetect the format.
2543 return _core_
.Image_LoadStream(*args
, **kwargs
)
2545 def LoadMimeStream(*args
, **kwargs
):
2547 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2549 Loads an image from an input stream or a readable Python file-like
2550 object, using a MIME type string to specify the image file format.
2552 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2554 def Ok(*args
, **kwargs
):
2558 Returns true if image data is present.
2560 return _core_
.Image_Ok(*args
, **kwargs
)
2562 def GetWidth(*args
, **kwargs
):
2564 GetWidth(self) -> int
2566 Gets the width of the image in pixels.
2568 return _core_
.Image_GetWidth(*args
, **kwargs
)
2570 def GetHeight(*args
, **kwargs
):
2572 GetHeight(self) -> int
2574 Gets the height of the image in pixels.
2576 return _core_
.Image_GetHeight(*args
, **kwargs
)
2578 def GetSize(*args
, **kwargs
):
2580 GetSize(self) -> Size
2582 Returns the size of the image in pixels.
2584 return _core_
.Image_GetSize(*args
, **kwargs
)
2586 def GetSubImage(*args
, **kwargs
):
2588 GetSubImage(self, Rect rect) -> Image
2590 Returns a sub image of the current one as long as the rect belongs
2591 entirely to the image.
2593 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2595 def Size(*args
, **kwargs
):
2597 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2599 Returns a resized version of this image without scaling it by adding
2600 either a border with the given colour or cropping as necessary. The
2601 image is pasted into a new image with the given size and background
2602 colour at the position ``pos`` relative to the upper left of the new
2603 image. If red = green = blue = -1 then use either the current mask
2604 colour if set or find, use, and set a suitable mask colour for any
2605 newly exposed areas.
2607 return _core_
.Image_Size(*args
, **kwargs
)
2609 def Copy(*args
, **kwargs
):
2613 Returns an identical copy of the image.
2615 return _core_
.Image_Copy(*args
, **kwargs
)
2617 def Paste(*args
, **kwargs
):
2619 Paste(self, Image image, int x, int y)
2621 Pastes ``image`` into this instance and takes care of the mask colour
2622 and any out of bounds problems.
2624 return _core_
.Image_Paste(*args
, **kwargs
)
2626 def GetData(*args
, **kwargs
):
2628 GetData(self) -> PyObject
2630 Returns a string containing a copy of the RGB bytes of the image.
2632 return _core_
.Image_GetData(*args
, **kwargs
)
2634 def SetData(*args
, **kwargs
):
2636 SetData(self, buffer data)
2638 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2639 either a string or a buffer object holding the data and the length of
2640 the data must be width*height*3.
2642 return _core_
.Image_SetData(*args
, **kwargs
)
2644 def GetDataBuffer(*args
, **kwargs
):
2646 GetDataBuffer(self) -> PyObject
2648 Returns a writable Python buffer object that is pointing at the RGB
2649 image data buffer inside the wx.Image. You need to ensure that you do
2650 not use this buffer object after the image has been destroyed.
2652 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
2654 def SetDataBuffer(*args
, **kwargs
):
2656 SetDataBuffer(self, buffer data)
2658 Sets the internal image data pointer to point at a Python buffer
2659 object. This can save making an extra copy of the data but you must
2660 ensure that the buffer object lives longer than the wx.Image does.
2662 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
2664 def GetAlphaData(*args
, **kwargs
):
2666 GetAlphaData(self) -> PyObject
2668 Returns a string containing a copy of the alpha bytes of the image.
2670 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
2672 def SetAlphaData(*args
, **kwargs
):
2674 SetAlphaData(self, buffer alpha)
2676 Resets the Image's alpha data from a buffer of bytes. Accepts either
2677 a string or a buffer object holding the data and the length of the
2678 data must be width*height.
2680 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
2682 def GetAlphaBuffer(*args
, **kwargs
):
2684 GetAlphaBuffer(self) -> PyObject
2686 Returns a writable Python buffer object that is pointing at the Alpha
2687 data buffer inside the wx.Image. You need to ensure that you do not
2688 use this buffer object after the image has been destroyed.
2690 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
2692 def SetAlphaBuffer(*args
, **kwargs
):
2694 SetAlphaBuffer(self, buffer alpha)
2696 Sets the internal image alpha pointer to point at a Python buffer
2697 object. This can save making an extra copy of the data but you must
2698 ensure that the buffer object lives as long as the wx.Image does.
2700 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
2702 def SetMaskColour(*args
, **kwargs
):
2704 SetMaskColour(self, byte r, byte g, byte b)
2706 Sets the mask colour for this image (and tells the image to use the
2709 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
2711 def GetOrFindMaskColour(*args
, **kwargs
):
2713 GetOrFindMaskColour() -> (r,g,b)
2715 Get the current mask colour or find a suitable colour.
2717 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
2719 def GetMaskRed(*args
, **kwargs
):
2721 GetMaskRed(self) -> byte
2723 Gets the red component of the mask colour.
2725 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
2727 def GetMaskGreen(*args
, **kwargs
):
2729 GetMaskGreen(self) -> byte
2731 Gets the green component of the mask colour.
2733 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
2735 def GetMaskBlue(*args
, **kwargs
):
2737 GetMaskBlue(self) -> byte
2739 Gets the blue component of the mask colour.
2741 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
2743 def SetMask(*args
, **kwargs
):
2745 SetMask(self, bool mask=True)
2747 Specifies whether there is a mask or not. The area of the mask is
2748 determined by the current mask colour.
2750 return _core_
.Image_SetMask(*args
, **kwargs
)
2752 def HasMask(*args
, **kwargs
):
2754 HasMask(self) -> bool
2756 Returns ``True`` if there is a mask active, ``False`` otherwise.
2758 return _core_
.Image_HasMask(*args
, **kwargs
)
2760 def Rotate(*args
, **kwargs
):
2762 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2763 Point offset_after_rotation=None) -> Image
2765 Rotates the image about the given point, by ``angle`` radians. Passing
2766 ``True`` to ``interpolating`` results in better image quality, but is
2767 slower. If the image has a mask, then the mask colour is used for the
2768 uncovered pixels in the rotated image background. Otherwise, black
2769 will be used as the fill colour.
2771 Returns the rotated image, leaving this image intact.
2773 return _core_
.Image_Rotate(*args
, **kwargs
)
2775 def Rotate90(*args
, **kwargs
):
2777 Rotate90(self, bool clockwise=True) -> Image
2779 Returns a copy of the image rotated 90 degrees in the direction
2780 indicated by ``clockwise``.
2782 return _core_
.Image_Rotate90(*args
, **kwargs
)
2784 def Mirror(*args
, **kwargs
):
2786 Mirror(self, bool horizontally=True) -> Image
2788 Returns a mirrored copy of the image. The parameter ``horizontally``
2789 indicates the orientation.
2791 return _core_
.Image_Mirror(*args
, **kwargs
)
2793 def Replace(*args
, **kwargs
):
2795 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2797 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2800 return _core_
.Image_Replace(*args
, **kwargs
)
2802 def ConvertToGreyscale(*args
, **kwargs
):
2804 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2806 Convert to greyscale image. Uses the luminance component (Y) of the
2807 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2808 defaults to ITU-T BT.601
2810 return _core_
.Image_ConvertToGreyscale(*args
, **kwargs
)
2812 def ConvertToMono(*args
, **kwargs
):
2814 ConvertToMono(self, byte r, byte g, byte b) -> Image
2816 Returns monochromatic version of the image. The returned image has
2817 white colour where the original has ``(r,g,b)`` colour and black
2818 colour everywhere else.
2820 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
2822 def SetOption(*args
, **kwargs
):
2824 SetOption(self, String name, String value)
2826 Sets an image handler defined option. For example, when saving as a
2827 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2828 number between 0 and 100 (0 is terrible, 100 is very good).
2830 return _core_
.Image_SetOption(*args
, **kwargs
)
2832 def SetOptionInt(*args
, **kwargs
):
2834 SetOptionInt(self, String name, int value)
2836 Sets an image option as an integer.
2838 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
2840 def GetOption(*args
, **kwargs
):
2842 GetOption(self, String name) -> String
2844 Gets the value of an image handler option.
2846 return _core_
.Image_GetOption(*args
, **kwargs
)
2848 def GetOptionInt(*args
, **kwargs
):
2850 GetOptionInt(self, String name) -> int
2852 Gets the value of an image handler option as an integer. If the given
2853 option is not present, the function returns 0.
2855 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
2857 def HasOption(*args
, **kwargs
):
2859 HasOption(self, String name) -> bool
2861 Returns true if the given option is present.
2863 return _core_
.Image_HasOption(*args
, **kwargs
)
2865 def CountColours(*args
, **kwargs
):
2866 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2867 return _core_
.Image_CountColours(*args
, **kwargs
)
2869 def ComputeHistogram(*args
, **kwargs
):
2870 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2871 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
2873 def AddHandler(*args
, **kwargs
):
2874 """AddHandler(ImageHandler handler)"""
2875 return _core_
.Image_AddHandler(*args
, **kwargs
)
2877 AddHandler
= staticmethod(AddHandler
)
2878 def InsertHandler(*args
, **kwargs
):
2879 """InsertHandler(ImageHandler handler)"""
2880 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2882 InsertHandler
= staticmethod(InsertHandler
)
2883 def RemoveHandler(*args
, **kwargs
):
2884 """RemoveHandler(String name) -> bool"""
2885 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2887 RemoveHandler
= staticmethod(RemoveHandler
)
2888 def GetHandlers(*args
, **kwargs
):
2889 """GetHandlers() -> PyObject"""
2890 return _core_
.Image_GetHandlers(*args
, **kwargs
)
2892 GetHandlers
= staticmethod(GetHandlers
)
2893 def GetImageExtWildcard(*args
, **kwargs
):
2895 GetImageExtWildcard() -> String
2897 Iterates all registered wxImageHandler objects, and returns a string
2898 containing file extension masks suitable for passing to file open/save
2901 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2903 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
2904 def ConvertToBitmap(*args
, **kwargs
):
2905 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2906 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
2908 def ConvertToMonoBitmap(*args
, **kwargs
):
2909 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2910 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
2912 def RotateHue(*args
, **kwargs
):
2914 RotateHue(self, double angle)
2916 Rotates the hue of each pixel of the image. Hue is a double in the
2917 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2919 return _core_
.Image_RotateHue(*args
, **kwargs
)
2921 def RGBtoHSV(*args
, **kwargs
):
2923 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2925 Converts a color in RGB color space to HSV color space.
2927 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
2929 RGBtoHSV
= staticmethod(RGBtoHSV
)
2930 def HSVtoRGB(*args
, **kwargs
):
2932 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2934 Converts a color in HSV color space to RGB color space.
2936 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
2938 HSVtoRGB
= staticmethod(HSVtoRGB
)
2939 def __nonzero__(self
): return self
.Ok()
2940 AlphaBuffer
= property(GetAlphaBuffer
,SetAlphaBuffer
,doc
="See `GetAlphaBuffer` and `SetAlphaBuffer`")
2941 AlphaData
= property(GetAlphaData
,SetAlphaData
,doc
="See `GetAlphaData` and `SetAlphaData`")
2942 Data
= property(GetData
,SetData
,doc
="See `GetData` and `SetData`")
2943 DataBuffer
= property(GetDataBuffer
,SetDataBuffer
,doc
="See `GetDataBuffer` and `SetDataBuffer`")
2944 Height
= property(GetHeight
,doc
="See `GetHeight`")
2945 MaskBlue
= property(GetMaskBlue
,doc
="See `GetMaskBlue`")
2946 MaskGreen
= property(GetMaskGreen
,doc
="See `GetMaskGreen`")
2947 MaskRed
= property(GetMaskRed
,doc
="See `GetMaskRed`")
2948 Size
= property(GetSize
,doc
="See `GetSize`")
2949 Width
= property(GetWidth
,doc
="See `GetWidth`")
2950 _core_
.Image_swigregister(Image
)
2952 def ImageFromMime(*args
, **kwargs
):
2954 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2956 Loads an image from a file, using a MIME type string (such as
2957 'image/jpeg') to specify image type.
2959 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
2962 def ImageFromStream(*args
, **kwargs
):
2964 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2966 Loads an image from an input stream, or any readable Python file-like
2969 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
2972 def ImageFromStreamMime(*args
, **kwargs
):
2974 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2976 Loads an image from an input stream, or any readable Python file-like
2977 object, specifying the image format with a MIME type string.
2979 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
2982 def EmptyImage(*args
, **kwargs
):
2984 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2986 Construct an empty image of a given size, optionally setting all
2989 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
2992 def ImageFromBitmap(*args
, **kwargs
):
2994 ImageFromBitmap(Bitmap bitmap) -> Image
2996 Construct an Image from a `wx.Bitmap`.
2998 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
3001 def ImageFromData(*args
, **kwargs
):
3003 ImageFromData(int width, int height, buffer data) -> Image
3005 Construct an Image from a buffer of RGB bytes. Accepts either a
3006 string or a buffer object holding the data and the length of the data
3007 must be width*height*3.
3009 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
3012 def ImageFromDataWithAlpha(*args
, **kwargs
):
3014 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3016 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3017 Accepts either a string or a buffer object holding the data and the
3018 length of the data must be width*height*3 bytes, and the length of the
3019 alpha data must be width*height bytes.
3021 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
3024 def Image_CanRead(*args
, **kwargs
):
3026 Image_CanRead(String filename) -> bool
3028 Returns True if the image handlers can read this file.
3030 return _core_
.Image_CanRead(*args
, **kwargs
)
3032 def Image_GetImageCount(*args
, **kwargs
):
3034 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3036 If the image file contains more than one image and the image handler
3037 is capable of retrieving these individually, this function will return
3038 the number of available images.
3040 return _core_
.Image_GetImageCount(*args
, **kwargs
)
3042 def Image_CanReadStream(*args
, **kwargs
):
3044 Image_CanReadStream(InputStream stream) -> bool
3046 Returns True if the image handlers can read an image file from the
3047 data currently on the input stream, or a readable Python file-like
3050 return _core_
.Image_CanReadStream(*args
, **kwargs
)
3052 def Image_AddHandler(*args
, **kwargs
):
3053 """Image_AddHandler(ImageHandler handler)"""
3054 return _core_
.Image_AddHandler(*args
, **kwargs
)
3056 def Image_InsertHandler(*args
, **kwargs
):
3057 """Image_InsertHandler(ImageHandler handler)"""
3058 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3060 def Image_RemoveHandler(*args
, **kwargs
):
3061 """Image_RemoveHandler(String name) -> bool"""
3062 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3064 def Image_GetHandlers(*args
):
3065 """Image_GetHandlers() -> PyObject"""
3066 return _core_
.Image_GetHandlers(*args
)
3068 def Image_GetImageExtWildcard(*args
):
3070 Image_GetImageExtWildcard() -> String
3072 Iterates all registered wxImageHandler objects, and returns a string
3073 containing file extension masks suitable for passing to file open/save
3076 return _core_
.Image_GetImageExtWildcard(*args
)
3078 def Image_RGBtoHSV(*args
, **kwargs
):
3080 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3082 Converts a color in RGB color space to HSV color space.
3084 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3086 def Image_HSVtoRGB(*args
, **kwargs
):
3088 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3090 Converts a color in HSV color space to RGB color space.
3092 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3095 def _ImageFromBuffer(*args
, **kwargs
):
3096 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3097 return _core_
._ImageFromBuffer
(*args
, **kwargs
)
3098 def ImageFromBuffer(width
, height
, dataBuffer
, alphaBuffer
=None):
3100 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3101 parameter must be a Python object that implements the buffer interface,
3102 such as a string, array, etc. The dataBuffer object is expected to
3103 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3104 object can optionally be supplied for the image's alpha channel data, and
3105 it is expected to be width*height bytes long.
3107 The wx.Image will be created with its data and alpha pointers initialized
3108 to the memory address pointed to by the buffer objects, thus saving the
3109 time needed to copy the image data from the buffer object to the wx.Image.
3110 While this has advantages, it also has the shoot-yourself-in-the-foot
3111 risks associated with sharing a C pointer between two objects.
3113 To help alleviate the risk a reference to the data and alpha buffer
3114 objects are kept with the wx.Image, so that they won't get deleted until
3115 after the wx.Image is deleted. However please be aware that it is not
3116 guaranteed that an object won't move its memory buffer to a new location
3117 when it needs to resize its contents. If that happens then the wx.Image
3118 will end up referring to an invalid memory location and could cause the
3119 application to crash. Therefore care should be taken to not manipulate
3120 the objects used for the data and alpha buffers in a way that would cause
3121 them to change size.
3123 image
= _core_
._ImageFromBuffer
(width
, height
, dataBuffer
, alphaBuffer
)
3124 image
._buffer
= dataBuffer
3125 image
._alpha
= alphaBuffer
3128 def InitAllImageHandlers():
3130 The former functionality of InitAllImageHanders is now done internal to
3131 the _core_ extension module and so this function has become a simple NOP.
3135 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3136 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3137 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3138 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3139 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3140 BMP_24BPP
= _core_
.BMP_24BPP
3141 BMP_8BPP
= _core_
.BMP_8BPP
3142 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3143 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3144 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3145 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3146 BMP_4BPP
= _core_
.BMP_4BPP
3147 BMP_1BPP
= _core_
.BMP_1BPP
3148 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3149 class BMPHandler(ImageHandler
):
3150 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3151 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3152 __repr__
= _swig_repr
3153 def __init__(self
, *args
, **kwargs
):
3155 __init__(self) -> BMPHandler
3157 A `wx.ImageHandler` for \*.bmp bitmap files.
3159 _core_
.BMPHandler_swiginit(self
,_core_
.new_BMPHandler(*args
, **kwargs
))
3160 _core_
.BMPHandler_swigregister(BMPHandler
)
3161 NullImage
= cvar
.NullImage
3162 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3163 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3164 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3165 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3166 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3167 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3168 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3169 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3170 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3171 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3172 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3173 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3174 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3175 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3176 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3178 class ICOHandler(BMPHandler
):
3179 """A `wx.ImageHandler` for \*.ico icon files."""
3180 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3181 __repr__
= _swig_repr
3182 def __init__(self
, *args
, **kwargs
):
3184 __init__(self) -> ICOHandler
3186 A `wx.ImageHandler` for \*.ico icon files.
3188 _core_
.ICOHandler_swiginit(self
,_core_
.new_ICOHandler(*args
, **kwargs
))
3189 _core_
.ICOHandler_swigregister(ICOHandler
)
3191 class CURHandler(ICOHandler
):
3192 """A `wx.ImageHandler` for \*.cur cursor files."""
3193 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3194 __repr__
= _swig_repr
3195 def __init__(self
, *args
, **kwargs
):
3197 __init__(self) -> CURHandler
3199 A `wx.ImageHandler` for \*.cur cursor files.
3201 _core_
.CURHandler_swiginit(self
,_core_
.new_CURHandler(*args
, **kwargs
))
3202 _core_
.CURHandler_swigregister(CURHandler
)
3204 class ANIHandler(CURHandler
):
3205 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3206 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3207 __repr__
= _swig_repr
3208 def __init__(self
, *args
, **kwargs
):
3210 __init__(self) -> ANIHandler
3212 A `wx.ImageHandler` for \*.ani animated cursor files.
3214 _core_
.ANIHandler_swiginit(self
,_core_
.new_ANIHandler(*args
, **kwargs
))
3215 _core_
.ANIHandler_swigregister(ANIHandler
)
3217 class PNGHandler(ImageHandler
):
3218 """A `wx.ImageHandler` for PNG image files."""
3219 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3220 __repr__
= _swig_repr
3221 def __init__(self
, *args
, **kwargs
):
3223 __init__(self) -> PNGHandler
3225 A `wx.ImageHandler` for PNG image files.
3227 _core_
.PNGHandler_swiginit(self
,_core_
.new_PNGHandler(*args
, **kwargs
))
3228 _core_
.PNGHandler_swigregister(PNGHandler
)
3230 class GIFHandler(ImageHandler
):
3231 """A `wx.ImageHandler` for GIF image files."""
3232 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3233 __repr__
= _swig_repr
3234 def __init__(self
, *args
, **kwargs
):
3236 __init__(self) -> GIFHandler
3238 A `wx.ImageHandler` for GIF image files.
3240 _core_
.GIFHandler_swiginit(self
,_core_
.new_GIFHandler(*args
, **kwargs
))
3241 _core_
.GIFHandler_swigregister(GIFHandler
)
3243 class PCXHandler(ImageHandler
):
3244 """A `wx.ImageHandler` for PCX imager files."""
3245 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3246 __repr__
= _swig_repr
3247 def __init__(self
, *args
, **kwargs
):
3249 __init__(self) -> PCXHandler
3251 A `wx.ImageHandler` for PCX imager files.
3253 _core_
.PCXHandler_swiginit(self
,_core_
.new_PCXHandler(*args
, **kwargs
))
3254 _core_
.PCXHandler_swigregister(PCXHandler
)
3256 class JPEGHandler(ImageHandler
):
3257 """A `wx.ImageHandler` for JPEG/JPG image files."""
3258 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3259 __repr__
= _swig_repr
3260 def __init__(self
, *args
, **kwargs
):
3262 __init__(self) -> JPEGHandler
3264 A `wx.ImageHandler` for JPEG/JPG image files.
3266 _core_
.JPEGHandler_swiginit(self
,_core_
.new_JPEGHandler(*args
, **kwargs
))
3267 _core_
.JPEGHandler_swigregister(JPEGHandler
)
3269 class PNMHandler(ImageHandler
):
3270 """A `wx.ImageHandler` for PNM image files."""
3271 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3272 __repr__
= _swig_repr
3273 def __init__(self
, *args
, **kwargs
):
3275 __init__(self) -> PNMHandler
3277 A `wx.ImageHandler` for PNM image files.
3279 _core_
.PNMHandler_swiginit(self
,_core_
.new_PNMHandler(*args
, **kwargs
))
3280 _core_
.PNMHandler_swigregister(PNMHandler
)
3282 class XPMHandler(ImageHandler
):
3283 """A `wx.ImageHandler` for XPM image."""
3284 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3285 __repr__
= _swig_repr
3286 def __init__(self
, *args
, **kwargs
):
3288 __init__(self) -> XPMHandler
3290 A `wx.ImageHandler` for XPM image.
3292 _core_
.XPMHandler_swiginit(self
,_core_
.new_XPMHandler(*args
, **kwargs
))
3293 _core_
.XPMHandler_swigregister(XPMHandler
)
3295 class TIFFHandler(ImageHandler
):
3296 """A `wx.ImageHandler` for TIFF image files."""
3297 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3298 __repr__
= _swig_repr
3299 def __init__(self
, *args
, **kwargs
):
3301 __init__(self) -> TIFFHandler
3303 A `wx.ImageHandler` for TIFF image files.
3305 _core_
.TIFFHandler_swiginit(self
,_core_
.new_TIFFHandler(*args
, **kwargs
))
3306 _core_
.TIFFHandler_swigregister(TIFFHandler
)
3308 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3309 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3310 class Quantize(object):
3311 """Performs quantization, or colour reduction, on a wxImage."""
3312 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3313 def __init__(self
): raise AttributeError, "No constructor defined"
3314 __repr__
= _swig_repr
3315 def Quantize(*args
, **kwargs
):
3317 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3319 Reduce the colours in the source image and put the result into the
3320 destination image, setting the palette in the destination if
3321 needed. Both images may be the same, to overwrite the source image.
3323 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3325 Quantize
= staticmethod(Quantize
)
3326 _core_
.Quantize_swigregister(Quantize
)
3328 def Quantize_Quantize(*args
, **kwargs
):
3330 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3332 Reduce the colours in the source image and put the result into the
3333 destination image, setting the palette in the destination if
3334 needed. Both images may be the same, to overwrite the source image.
3336 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3338 #---------------------------------------------------------------------------
3340 class EvtHandler(Object
):
3341 """Proxy of C++ EvtHandler class"""
3342 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3343 __repr__
= _swig_repr
3344 def __init__(self
, *args
, **kwargs
):
3345 """__init__(self) -> EvtHandler"""
3346 _core_
.EvtHandler_swiginit(self
,_core_
.new_EvtHandler(*args
, **kwargs
))
3347 def GetNextHandler(*args
, **kwargs
):
3348 """GetNextHandler(self) -> EvtHandler"""
3349 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3351 def GetPreviousHandler(*args
, **kwargs
):
3352 """GetPreviousHandler(self) -> EvtHandler"""
3353 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3355 def SetNextHandler(*args
, **kwargs
):
3356 """SetNextHandler(self, EvtHandler handler)"""
3357 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3359 def SetPreviousHandler(*args
, **kwargs
):
3360 """SetPreviousHandler(self, EvtHandler handler)"""
3361 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3363 def GetEvtHandlerEnabled(*args
, **kwargs
):
3364 """GetEvtHandlerEnabled(self) -> bool"""
3365 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3367 def SetEvtHandlerEnabled(*args
, **kwargs
):
3368 """SetEvtHandlerEnabled(self, bool enabled)"""
3369 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3371 def ProcessEvent(*args
, **kwargs
):
3372 """ProcessEvent(self, Event event) -> bool"""
3373 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3375 def AddPendingEvent(*args
, **kwargs
):
3376 """AddPendingEvent(self, Event event)"""
3377 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3379 def ProcessPendingEvents(*args
, **kwargs
):
3380 """ProcessPendingEvents(self)"""
3381 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3383 def Connect(*args
, **kwargs
):
3384 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3385 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3387 def Disconnect(*args
, **kwargs
):
3388 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3389 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3391 def _setOORInfo(*args
, **kwargs
):
3392 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3393 val
= _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3397 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3399 Bind an event to an event handler.
3401 :param event: One of the EVT_* objects that specifies the
3402 type of event to bind,
3404 :param handler: A callable object to be invoked when the
3405 event is delivered to self. Pass None to
3406 disconnect an event handler.
3408 :param source: Sometimes the event originates from a
3409 different window than self, but you still
3410 want to catch it in self. (For example, a
3411 button event delivered to a frame.) By
3412 passing the source of the event, the event
3413 handling system is able to differentiate
3414 between the same event type from different
3417 :param id: Used to spcify the event source by ID instead
3420 :param id2: Used when it is desirable to bind a handler
3421 to a range of IDs, such as with EVT_MENU_RANGE.
3423 if source
is not None:
3425 event
.Bind(self
, id, id2
, handler
)
3427 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3429 Disconencts the event handler binding for event from self.
3430 Returns True if successful.
3432 if source
is not None:
3434 return event
.Unbind(self
, id, id2
)
3436 EvtHandlerEnabled
= property(GetEvtHandlerEnabled
,SetEvtHandlerEnabled
,doc
="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3437 NextHandler
= property(GetNextHandler
,SetNextHandler
,doc
="See `GetNextHandler` and `SetNextHandler`")
3438 PreviousHandler
= property(GetPreviousHandler
,SetPreviousHandler
,doc
="See `GetPreviousHandler` and `SetPreviousHandler`")
3439 _core_
.EvtHandler_swigregister(EvtHandler
)
3441 #---------------------------------------------------------------------------
3443 class PyEventBinder(object):
3445 Instances of this class are used to bind specific events to event
3448 def __init__(self
, evtType
, expectedIDs
=0):
3449 if expectedIDs
not in [0, 1, 2]:
3450 raise ValueError, "Invalid number of expectedIDs"
3451 self
.expectedIDs
= expectedIDs
3453 if type(evtType
) == list or type(evtType
) == tuple:
3454 self
.evtType
= evtType
3456 self
.evtType
= [evtType
]
3459 def Bind(self
, target
, id1
, id2
, function
):
3460 """Bind this set of event types to target."""
3461 for et
in self
.evtType
:
3462 target
.Connect(id1
, id2
, et
, function
)
3465 def Unbind(self
, target
, id1
, id2
):
3466 """Remove an event binding."""
3468 for et
in self
.evtType
:
3469 success
+= target
.Disconnect(id1
, id2
, et
)
3473 def __call__(self
, *args
):
3475 For backwards compatibility with the old EVT_* functions.
3476 Should be called with either (window, func), (window, ID,
3477 func) or (window, ID1, ID2, func) parameters depending on the
3480 assert len(args
) == 2 + self
.expectedIDs
3484 if self
.expectedIDs
== 0:
3486 elif self
.expectedIDs
== 1:
3489 elif self
.expectedIDs
== 2:
3494 raise ValueError, "Unexpected number of IDs"
3496 self
.Bind(target
, id1
, id2
, func
)
3499 # These two are square pegs that don't fit the PyEventBinder hole...
3500 def EVT_COMMAND(win
, id, cmd
, func
):
3501 win
.Connect(id, -1, cmd
, func
)
3502 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3503 win
.Connect(id1
, id2
, cmd
, func
)
3506 #---------------------------------------------------------------------------
3508 #---------------------------------------------------------------------------
3510 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3511 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3513 def NewEventType(*args
):
3514 """NewEventType() -> EventType"""
3515 return _core_
.NewEventType(*args
)
3516 wxEVT_NULL
= _core_
.wxEVT_NULL
3517 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3518 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3519 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3520 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3521 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3522 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3523 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3524 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3525 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3526 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3527 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3528 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3529 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3530 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3531 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3532 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3533 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3534 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3535 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3536 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3537 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3538 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3539 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3540 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3541 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3542 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3543 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3544 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3545 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3546 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3547 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3548 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3549 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3550 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3551 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3552 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3553 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3554 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3555 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3556 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3557 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3558 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3559 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3560 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3561 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3562 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3563 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3564 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3565 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3566 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3567 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3568 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3569 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3570 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3571 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3572 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3573 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3574 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3575 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3576 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3577 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3578 wxEVT_SCROLL_CHANGED
= _core_
.wxEVT_SCROLL_CHANGED
3579 wxEVT_SCROLL_ENDSCROLL
= wxEVT_SCROLL_CHANGED
3580 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3581 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3582 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3583 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3584 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3585 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3586 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3587 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3588 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3589 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3590 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3591 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3592 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3593 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3594 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3595 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3596 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3597 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3598 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3599 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3600 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3601 wxEVT_MOUSE_CAPTURE_LOST
= _core_
.wxEVT_MOUSE_CAPTURE_LOST
3602 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3603 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3604 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3605 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3606 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3607 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3608 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3609 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3610 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3611 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3612 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3613 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3614 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3615 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
3616 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
3617 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
3618 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
3619 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
3620 wxEVT_IDLE
= _core_
.wxEVT_IDLE
3621 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
3622 wxEVT_SIZING
= _core_
.wxEVT_SIZING
3623 wxEVT_MOVING
= _core_
.wxEVT_MOVING
3624 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
3625 wxEVT_COMMAND_TEXT_COPY
= _core_
.wxEVT_COMMAND_TEXT_COPY
3626 wxEVT_COMMAND_TEXT_CUT
= _core_
.wxEVT_COMMAND_TEXT_CUT
3627 wxEVT_COMMAND_TEXT_PASTE
= _core_
.wxEVT_COMMAND_TEXT_PASTE
3628 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
3629 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
3630 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
3631 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
3632 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
3633 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
3634 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
3636 # Create some event binders
3637 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
3638 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
3639 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
3640 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
3641 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
3642 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3643 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3644 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
3645 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
3646 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
3647 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
3648 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
3649 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
3650 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
3651 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
3652 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
3653 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
3654 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
3655 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
3656 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
3657 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
3658 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
3659 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
3660 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
3661 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
3662 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3663 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3664 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
3665 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
3666 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
3667 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
3668 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
3669 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
3670 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
3671 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
3672 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
3673 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
3674 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
3675 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
3676 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
3677 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
3678 EVT_MOUSE_CAPTURE_LOST
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST
)
3680 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
3681 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
3682 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
3683 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
3684 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
3685 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
3686 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
3687 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
3688 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
3689 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
3690 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
3691 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
3692 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
3694 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
3702 wxEVT_MIDDLE_DCLICK
,
3710 # Scrolling from wxWindow (sent to wxScrolledWindow)
3711 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
3712 wxEVT_SCROLLWIN_BOTTOM
,
3713 wxEVT_SCROLLWIN_LINEUP
,
3714 wxEVT_SCROLLWIN_LINEDOWN
,
3715 wxEVT_SCROLLWIN_PAGEUP
,
3716 wxEVT_SCROLLWIN_PAGEDOWN
,
3717 wxEVT_SCROLLWIN_THUMBTRACK
,
3718 wxEVT_SCROLLWIN_THUMBRELEASE
,
3721 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
3722 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
3723 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
3724 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
3725 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
3726 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
3727 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
3728 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
3730 # Scrolling from wx.Slider and wx.ScrollBar
3731 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3732 wxEVT_SCROLL_BOTTOM
,
3733 wxEVT_SCROLL_LINEUP
,
3734 wxEVT_SCROLL_LINEDOWN
,
3735 wxEVT_SCROLL_PAGEUP
,
3736 wxEVT_SCROLL_PAGEDOWN
,
3737 wxEVT_SCROLL_THUMBTRACK
,
3738 wxEVT_SCROLL_THUMBRELEASE
,
3739 wxEVT_SCROLL_CHANGED
,
3742 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
3743 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
3744 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
3745 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
3746 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
3747 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
3748 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
3749 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
3750 EVT_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
)
3751 EVT_SCROLL_ENDSCROLL
= EVT_SCROLL_CHANGED
3753 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3754 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3755 wxEVT_SCROLL_BOTTOM
,
3756 wxEVT_SCROLL_LINEUP
,
3757 wxEVT_SCROLL_LINEDOWN
,
3758 wxEVT_SCROLL_PAGEUP
,
3759 wxEVT_SCROLL_PAGEDOWN
,
3760 wxEVT_SCROLL_THUMBTRACK
,
3761 wxEVT_SCROLL_THUMBRELEASE
,
3762 wxEVT_SCROLL_CHANGED
,
3765 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
3766 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
3767 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
3768 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
3769 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
3770 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
3771 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
3772 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
3773 EVT_COMMAND_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
, 1)
3774 EVT_COMMAND_SCROLL_ENDSCROLL
= EVT_COMMAND_SCROLL_CHANGED
3776 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
3777 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
3778 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
3779 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
3780 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
3781 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
3782 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
3783 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
3784 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
3785 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
3787 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
3788 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
3789 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
3790 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
3791 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
3792 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
3793 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
3794 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
3795 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
3798 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
3799 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
3800 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
3801 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
3802 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
3803 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
3804 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
3806 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
3808 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
3809 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
3811 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
3813 EVT_TEXT_CUT
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_CUT
)
3814 EVT_TEXT_COPY
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_COPY
)
3815 EVT_TEXT_PASTE
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE
)
3818 #---------------------------------------------------------------------------
3820 class Event(Object
):
3822 An event is a structure holding information about an event passed to a
3823 callback or member function. wx.Event is an abstract base class for
3826 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3827 def __init__(self
): raise AttributeError, "No constructor defined"
3828 __repr__
= _swig_repr
3829 __swig_destroy__
= _core_
.delete_Event
3830 __del__
= lambda self
: None;
3831 def SetEventType(*args
, **kwargs
):
3833 SetEventType(self, EventType typ)
3835 Sets the specific type of the event.
3837 return _core_
.Event_SetEventType(*args
, **kwargs
)
3839 def GetEventType(*args
, **kwargs
):
3841 GetEventType(self) -> EventType
3843 Returns the identifier of the given event type, such as
3844 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3846 return _core_
.Event_GetEventType(*args
, **kwargs
)
3848 def GetEventObject(*args
, **kwargs
):
3850 GetEventObject(self) -> Object
3852 Returns the object (usually a window) associated with the event, if
3855 return _core_
.Event_GetEventObject(*args
, **kwargs
)
3857 def SetEventObject(*args
, **kwargs
):
3859 SetEventObject(self, Object obj)
3861 Sets the originating object, or in other words, obj is normally the
3862 object that is sending the event.
3864 return _core_
.Event_SetEventObject(*args
, **kwargs
)
3866 def GetTimestamp(*args
, **kwargs
):
3867 """GetTimestamp(self) -> long"""
3868 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
3870 def SetTimestamp(*args
, **kwargs
):
3871 """SetTimestamp(self, long ts=0)"""
3872 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
3874 def GetId(*args
, **kwargs
):
3878 Returns the identifier associated with this event, such as a button
3881 return _core_
.Event_GetId(*args
, **kwargs
)
3883 def SetId(*args
, **kwargs
):
3887 Set's the ID for the event. This is usually the ID of the window that
3888 is sending the event, but it can also be a command id from a menu
3891 return _core_
.Event_SetId(*args
, **kwargs
)
3893 def IsCommandEvent(*args
, **kwargs
):
3895 IsCommandEvent(self) -> bool
3897 Returns true if the event is or is derived from `wx.CommandEvent` else
3898 it returns false. Note: Exists only for optimization purposes.
3900 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
3902 def Skip(*args
, **kwargs
):
3904 Skip(self, bool skip=True)
3906 Called by an event handler, it controls whether additional event
3907 handlers bound to this event will be called after the current event
3908 handler returns. Skip(false) (the default setting) will prevent
3909 additional event handlers from being called and control will be
3910 returned to the sender of the event immediately after the current
3911 handler has finished. Skip(True) will cause the event processing
3912 system to continue searching for a handler function for this event.
3915 return _core_
.Event_Skip(*args
, **kwargs
)
3917 def GetSkipped(*args
, **kwargs
):
3919 GetSkipped(self) -> bool
3921 Returns true if the event handler should be skipped, false otherwise.
3924 return _core_
.Event_GetSkipped(*args
, **kwargs
)
3926 def ShouldPropagate(*args
, **kwargs
):
3928 ShouldPropagate(self) -> bool
3930 Test if this event should be propagated to the parent window or not,
3931 i.e. if the propagation level is currently greater than 0.
3933 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
3935 def StopPropagation(*args
, **kwargs
):
3937 StopPropagation(self) -> int
3939 Stop the event from propagating to its parent window. Returns the old
3940 propagation level value which may be later passed to
3941 `ResumePropagation` to allow propagating the event again.
3943 return _core_
.Event_StopPropagation(*args
, **kwargs
)
3945 def ResumePropagation(*args
, **kwargs
):
3947 ResumePropagation(self, int propagationLevel)
3949 Resume the event propagation by restoring the propagation level. (For
3950 example, you can use the value returned by an earlier call to
3954 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
3956 def Clone(*args
, **kwargs
):
3957 """Clone(self) -> Event"""
3958 return _core_
.Event_Clone(*args
, **kwargs
)
3960 EventObject
= property(GetEventObject
,SetEventObject
,doc
="See `GetEventObject` and `SetEventObject`")
3961 EventType
= property(GetEventType
,SetEventType
,doc
="See `GetEventType` and `SetEventType`")
3962 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
3963 Skipped
= property(GetSkipped
,doc
="See `GetSkipped`")
3964 Timestamp
= property(GetTimestamp
,SetTimestamp
,doc
="See `GetTimestamp` and `SetTimestamp`")
3965 _core_
.Event_swigregister(Event
)
3967 #---------------------------------------------------------------------------
3969 class PropagationDisabler(object):
3971 Helper class to temporarily change an event not to propagate. Simply
3972 create an instance of this class and then whe it is destroyed the
3973 propogation of the event will be restored.
3975 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3976 __repr__
= _swig_repr
3977 def __init__(self
, *args
, **kwargs
):
3979 __init__(self, Event event) -> PropagationDisabler
3981 Helper class to temporarily change an event not to propagate. Simply
3982 create an instance of this class and then whe it is destroyed the
3983 propogation of the event will be restored.
3985 _core_
.PropagationDisabler_swiginit(self
,_core_
.new_PropagationDisabler(*args
, **kwargs
))
3986 __swig_destroy__
= _core_
.delete_PropagationDisabler
3987 __del__
= lambda self
: None;
3988 _core_
.PropagationDisabler_swigregister(PropagationDisabler
)
3990 class PropagateOnce(object):
3992 A helper class that will temporarily lower propagation level of an
3993 event. Simply create an instance of this class and then whe it is
3994 destroyed the propogation of the event will be restored.
3996 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3997 __repr__
= _swig_repr
3998 def __init__(self
, *args
, **kwargs
):
4000 __init__(self, Event event) -> PropagateOnce
4002 A helper class that will temporarily lower propagation level of an
4003 event. Simply create an instance of this class and then whe it is
4004 destroyed the propogation of the event will be restored.
4006 _core_
.PropagateOnce_swiginit(self
,_core_
.new_PropagateOnce(*args
, **kwargs
))
4007 __swig_destroy__
= _core_
.delete_PropagateOnce
4008 __del__
= lambda self
: None;
4009 _core_
.PropagateOnce_swigregister(PropagateOnce
)
4011 #---------------------------------------------------------------------------
4013 class CommandEvent(Event
):
4015 This event class contains information about command events, which
4016 originate from a variety of simple controls, as well as menus and
4019 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4020 __repr__
= _swig_repr
4021 def __init__(self
, *args
, **kwargs
):
4023 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4025 This event class contains information about command events, which
4026 originate from a variety of simple controls, as well as menus and
4029 _core_
.CommandEvent_swiginit(self
,_core_
.new_CommandEvent(*args
, **kwargs
))
4030 def GetSelection(*args
, **kwargs
):
4032 GetSelection(self) -> int
4034 Returns item index for a listbox or choice selection event (not valid
4037 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
4039 def SetString(*args
, **kwargs
):
4040 """SetString(self, String s)"""
4041 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
4043 def GetString(*args
, **kwargs
):
4045 GetString(self) -> String
4047 Returns item string for a listbox or choice selection event (not valid
4050 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
4052 def IsChecked(*args
, **kwargs
):
4054 IsChecked(self) -> bool
4056 This method can be used with checkbox and menu events: for the
4057 checkboxes, the method returns true for a selection event and false
4058 for a deselection one. For the menu events, this method indicates if
4059 the menu item just has become checked or unchecked (and thus only
4060 makes sense for checkable menu items).
4062 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
4065 def IsSelection(*args
, **kwargs
):
4067 IsSelection(self) -> bool
4069 For a listbox or similar event, returns true if it is a selection,
4070 false if it is a deselection.
4072 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4074 def SetExtraLong(*args
, **kwargs
):
4075 """SetExtraLong(self, long extraLong)"""
4076 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4078 def GetExtraLong(*args
, **kwargs
):
4080 GetExtraLong(self) -> long
4082 Returns extra information dependant on the event objects type. If the
4083 event comes from a listbox selection, it is a boolean determining
4084 whether the event was a selection (true) or a deselection (false). A
4085 listbox deselection only occurs for multiple-selection boxes, and in
4086 this case the index and string values are indeterminate and the
4087 listbox must be examined by the application.
4089 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4091 def SetInt(*args
, **kwargs
):
4092 """SetInt(self, int i)"""
4093 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4095 def GetInt(*args
, **kwargs
):
4099 Returns the integer identifier corresponding to a listbox, choice or
4100 radiobox selection (only if the event was a selection, not a
4101 deselection), or a boolean value representing the value of a checkbox.
4103 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4105 def GetClientData(*args
, **kwargs
):
4107 GetClientData(self) -> PyObject
4109 Returns the client data object for a listbox or choice selection event, (if any.)
4111 return _core_
.CommandEvent_GetClientData(*args
, **kwargs
)
4113 def SetClientData(*args
, **kwargs
):
4115 SetClientData(self, PyObject clientData)
4117 Associate the given client data with the item at position n.
4119 return _core_
.CommandEvent_SetClientData(*args
, **kwargs
)
4121 GetClientObject
= GetClientData
4122 SetClientObject
= SetClientData
4124 def Clone(*args
, **kwargs
):
4125 """Clone(self) -> Event"""
4126 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4128 ClientData
= property(GetClientData
,SetClientData
,doc
="See `GetClientData` and `SetClientData`")
4129 ClientObject
= property(GetClientObject
,SetClientObject
,doc
="See `GetClientObject` and `SetClientObject`")
4130 ExtraLong
= property(GetExtraLong
,SetExtraLong
,doc
="See `GetExtraLong` and `SetExtraLong`")
4131 Int
= property(GetInt
,SetInt
,doc
="See `GetInt` and `SetInt`")
4132 Selection
= property(GetSelection
,doc
="See `GetSelection`")
4133 String
= property(GetString
,SetString
,doc
="See `GetString` and `SetString`")
4134 _core_
.CommandEvent_swigregister(CommandEvent
)
4136 #---------------------------------------------------------------------------
4138 class NotifyEvent(CommandEvent
):
4140 An instance of this class (or one of its derived classes) is sent from
4141 a control when the control's state is being changed and the control
4142 allows that change to be prevented from happening. The event handler
4143 can call `Veto` or `Allow` to tell the control what to do.
4145 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4146 __repr__
= _swig_repr
4147 def __init__(self
, *args
, **kwargs
):
4149 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4151 An instance of this class (or one of its derived classes) is sent from
4152 a control when the control's state is being changed and the control
4153 allows that change to be prevented from happening. The event handler
4154 can call `Veto` or `Allow` to tell the control what to do.
4156 _core_
.NotifyEvent_swiginit(self
,_core_
.new_NotifyEvent(*args
, **kwargs
))
4157 def Veto(*args
, **kwargs
):
4161 Prevents the change announced by this event from happening.
4163 It is in general a good idea to notify the user about the reasons for
4164 vetoing the change because otherwise the applications behaviour (which
4165 just refuses to do what the user wants) might be quite surprising.
4167 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4169 def Allow(*args
, **kwargs
):
4173 This is the opposite of `Veto`: it explicitly allows the event to be
4174 processed. For most events it is not necessary to call this method as
4175 the events are allowed anyhow but some are forbidden by default (this
4176 will be mentioned in the corresponding event description).
4178 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4180 def IsAllowed(*args
, **kwargs
):
4182 IsAllowed(self) -> bool
4184 Returns true if the change is allowed (`Veto` hasn't been called) or
4185 false otherwise (if it was).
4187 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4189 _core_
.NotifyEvent_swigregister(NotifyEvent
)
4191 #---------------------------------------------------------------------------
4193 class ScrollEvent(CommandEvent
):
4195 A scroll event holds information about events sent from stand-alone
4196 scrollbars and sliders. Note that scrolled windows do not send
4197 instnaces of this event class, but send the `wx.ScrollWinEvent`
4200 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4201 __repr__
= _swig_repr
4202 def __init__(self
, *args
, **kwargs
):
4204 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4205 int orient=0) -> ScrollEvent
4207 _core_
.ScrollEvent_swiginit(self
,_core_
.new_ScrollEvent(*args
, **kwargs
))
4208 def GetOrientation(*args
, **kwargs
):
4210 GetOrientation(self) -> int
4212 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4215 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4217 def GetPosition(*args
, **kwargs
):
4219 GetPosition(self) -> int
4221 Returns the position of the scrollbar.
4223 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4225 def SetOrientation(*args
, **kwargs
):
4226 """SetOrientation(self, int orient)"""
4227 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4229 def SetPosition(*args
, **kwargs
):
4230 """SetPosition(self, int pos)"""
4231 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4233 _core_
.ScrollEvent_swigregister(ScrollEvent
)
4235 #---------------------------------------------------------------------------
4237 class ScrollWinEvent(Event
):
4239 A wx.ScrollWinEvent holds information about scrolling and is sent from
4242 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4243 __repr__
= _swig_repr
4244 def __init__(self
, *args
, **kwargs
):
4246 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4248 A wx.ScrollWinEvent holds information about scrolling and is sent from
4251 _core_
.ScrollWinEvent_swiginit(self
,_core_
.new_ScrollWinEvent(*args
, **kwargs
))
4252 def GetOrientation(*args
, **kwargs
):
4254 GetOrientation(self) -> int
4256 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4259 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4261 def GetPosition(*args
, **kwargs
):
4263 GetPosition(self) -> int
4265 Returns the position of the scrollbar for the thumb track and release
4266 events. Note that this field can't be used for the other events, you
4267 need to query the window itself for the current position in that case.
4269 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4271 def SetOrientation(*args
, **kwargs
):
4272 """SetOrientation(self, int orient)"""
4273 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4275 def SetPosition(*args
, **kwargs
):
4276 """SetPosition(self, int pos)"""
4277 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4279 _core_
.ScrollWinEvent_swigregister(ScrollWinEvent
)
4281 #---------------------------------------------------------------------------
4283 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4284 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4285 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4286 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4287 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4288 class MouseEvent(Event
):
4290 This event class contains information about the events generated by
4291 the mouse: they include mouse buttons press and release events and
4294 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4295 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4296 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4297 a middle button so a portable application should avoid relying on the
4300 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4301 the former returns true when the event corresponds to the left mouse
4302 button click while the latter returns true if the left mouse button is
4303 currently being pressed. For example, when the user is dragging the
4304 mouse you can use `LeftIsDown` to test whether the left mouse button
4305 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4306 `LeftIsDown` will also return true in wxWidgets whatever the
4307 underlying GUI behaviour is (which is platform-dependent). The same
4308 applies, of course, to other mouse buttons as well.
4310 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4311 __repr__
= _swig_repr
4312 def __init__(self
, *args
, **kwargs
):
4314 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4316 Constructs a wx.MouseEvent. Valid event types are:
4318 * wxEVT_ENTER_WINDOW
4319 * wxEVT_LEAVE_WINDOW
4325 * wxEVT_MIDDLE_DCLICK
4328 * wxEVT_RIGHT_DCLICK
4332 _core_
.MouseEvent_swiginit(self
,_core_
.new_MouseEvent(*args
, **kwargs
))
4333 def IsButton(*args
, **kwargs
):
4335 IsButton(self) -> bool
4337 Returns true if the event was a mouse button event (not necessarily a
4338 button down event - that may be tested using `ButtonDown`).
4340 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4342 def ButtonDown(*args
, **kwargs
):
4344 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4346 If the argument is omitted, this returns true if the event was any
4347 mouse button down event. Otherwise the argument specifies which
4348 button-down event shold be checked for (see `Button` for the possible
4351 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4353 def ButtonDClick(*args
, **kwargs
):
4355 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4357 If the argument is omitted, this returns true if the event was any
4358 mouse double click event. Otherwise the argument specifies which
4359 double click event to check for (see `Button` for the possible
4362 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4364 def ButtonUp(*args
, **kwargs
):
4366 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4368 If the argument is omitted, this returns true if the event was any
4369 mouse button up event. Otherwise the argument specifies which button
4370 up event to check for (see `Button` for the possible values).
4372 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4374 def Button(*args
, **kwargs
):
4376 Button(self, int button) -> bool
4378 Returns true if the identified mouse button is changing state. Valid
4379 values of button are:
4381 ==================== =====================================
4382 wx.MOUSE_BTN_LEFT check if left button was pressed
4383 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4384 wx.MOUSE_BTN_RIGHT check if right button was pressed
4385 wx.MOUSE_BTN_ANY check if any button was pressed
4386 ==================== =====================================
4389 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4391 def ButtonIsDown(*args
, **kwargs
):
4392 """ButtonIsDown(self, int but) -> bool"""
4393 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4395 def GetButton(*args
, **kwargs
):
4397 GetButton(self) -> int
4399 Returns the mouse button which generated this event or
4400 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4401 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4402 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4403 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4404 right buttons respectively.
4406 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4408 def ControlDown(*args
, **kwargs
):
4410 ControlDown(self) -> bool
4412 Returns true if the control key was down at the time of the event.
4414 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4416 def MetaDown(*args
, **kwargs
):
4418 MetaDown(self) -> bool
4420 Returns true if the Meta key was down at the time of the event.
4422 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4424 def AltDown(*args
, **kwargs
):
4426 AltDown(self) -> bool
4428 Returns true if the Alt key was down at the time of the event.
4430 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4432 def ShiftDown(*args
, **kwargs
):
4434 ShiftDown(self) -> bool
4436 Returns true if the Shift key was down at the time of the event.
4438 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4440 def CmdDown(*args
, **kwargs
):
4442 CmdDown(self) -> bool
4444 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4445 platforms but the special "Apple" (a.k.a as "Command") key on
4446 Macs. It often makes sense to use it instead of, say, `ControlDown`
4447 because Cmd key is used for the same thing under Mac as Ctrl
4448 elsewhere. The Ctrl key still exists, it's just not used for this
4449 purpose. So for non-Mac platforms this is the same as `ControlDown`
4450 and Macs this is the same as `MetaDown`.
4452 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4454 def LeftDown(*args
, **kwargs
):
4456 LeftDown(self) -> bool
4458 Returns true if the left mouse button state changed to down.
4460 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4462 def MiddleDown(*args
, **kwargs
):
4464 MiddleDown(self) -> bool
4466 Returns true if the middle mouse button state changed to down.
4468 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4470 def RightDown(*args
, **kwargs
):
4472 RightDown(self) -> bool
4474 Returns true if the right mouse button state changed to down.
4476 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4478 def LeftUp(*args
, **kwargs
):
4480 LeftUp(self) -> bool
4482 Returns true if the left mouse button state changed to up.
4484 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4486 def MiddleUp(*args
, **kwargs
):
4488 MiddleUp(self) -> bool
4490 Returns true if the middle mouse button state changed to up.
4492 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4494 def RightUp(*args
, **kwargs
):
4496 RightUp(self) -> bool
4498 Returns true if the right mouse button state changed to up.
4500 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4502 def LeftDClick(*args
, **kwargs
):
4504 LeftDClick(self) -> bool
4506 Returns true if the event was a left button double click.
4508 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4510 def MiddleDClick(*args
, **kwargs
):
4512 MiddleDClick(self) -> bool
4514 Returns true if the event was a middle button double click.
4516 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4518 def RightDClick(*args
, **kwargs
):
4520 RightDClick(self) -> bool
4522 Returns true if the event was a right button double click.
4524 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4526 def LeftIsDown(*args
, **kwargs
):
4528 LeftIsDown(self) -> bool
4530 Returns true if the left mouse button is currently down, independent
4531 of the current event type.
4533 Please notice that it is not the same as LeftDown which returns true
4534 if the left mouse button was just pressed. Rather, it describes the
4535 state of the mouse button before the event happened.
4537 This event is usually used in the mouse event handlers which process
4538 "move mouse" messages to determine whether the user is (still)
4541 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4543 def MiddleIsDown(*args
, **kwargs
):
4545 MiddleIsDown(self) -> bool
4547 Returns true if the middle mouse button is currently down, independent
4548 of the current event type.
4550 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4552 def RightIsDown(*args
, **kwargs
):
4554 RightIsDown(self) -> bool
4556 Returns true if the right mouse button is currently down, independent
4557 of the current event type.
4559 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4561 def Dragging(*args
, **kwargs
):
4563 Dragging(self) -> bool
4565 Returns true if this was a dragging event (motion while a button is
4568 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4570 def Moving(*args
, **kwargs
):
4572 Moving(self) -> bool
4574 Returns true if this was a motion event and no mouse buttons were
4575 pressed. If any mouse button is held pressed, then this method returns
4576 false and Dragging returns true.
4578 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4580 def Entering(*args
, **kwargs
):
4582 Entering(self) -> bool
4584 Returns true if the mouse was entering the window.
4586 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4588 def Leaving(*args
, **kwargs
):
4590 Leaving(self) -> bool
4592 Returns true if the mouse was leaving the window.
4594 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4596 def GetPosition(*args
, **kwargs
):
4598 GetPosition(self) -> Point
4600 Returns the pixel position of the mouse in window coordinates when the
4603 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4605 def GetPositionTuple(*args
, **kwargs
):
4607 GetPositionTuple() -> (x,y)
4609 Returns the pixel position of the mouse in window coordinates when the
4612 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
4614 def GetLogicalPosition(*args
, **kwargs
):
4616 GetLogicalPosition(self, DC dc) -> Point
4618 Returns the logical mouse position in pixels (i.e. translated
4619 according to the translation set for the DC, which usually indicates
4620 that the window has been scrolled).
4622 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
4624 def GetX(*args
, **kwargs
):
4628 Returns X coordinate of the physical mouse event position.
4630 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
4632 def GetY(*args
, **kwargs
):
4636 Returns Y coordinate of the physical mouse event position.
4638 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
4640 def GetWheelRotation(*args
, **kwargs
):
4642 GetWheelRotation(self) -> int
4644 Get wheel rotation, positive or negative indicates direction of
4645 rotation. Current devices all send an event when rotation is equal to
4646 +/-WheelDelta, but this allows for finer resolution devices to be
4647 created in the future. Because of this you shouldn't assume that one
4648 event is equal to 1 line or whatever, but you should be able to either
4649 do partial line scrolling or wait until +/-WheelDelta rotation values
4650 have been accumulated before scrolling.
4652 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
4654 def GetWheelDelta(*args
, **kwargs
):
4656 GetWheelDelta(self) -> int
4658 Get wheel delta, normally 120. This is the threshold for action to be
4659 taken, and one such action (for example, scrolling one increment)
4660 should occur for each delta.
4662 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
4664 def GetLinesPerAction(*args
, **kwargs
):
4666 GetLinesPerAction(self) -> int
4668 Returns the configured number of lines (or whatever) to be scrolled
4669 per wheel action. Defaults to three.
4671 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
4673 def IsPageScroll(*args
, **kwargs
):
4675 IsPageScroll(self) -> bool
4677 Returns true if the system has been setup to do page scrolling with
4678 the mouse wheel instead of line scrolling.
4680 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
4682 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
4683 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
4684 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
4685 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
4686 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
4687 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
4688 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
4689 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
4690 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
4691 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
4692 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
4693 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
4694 _core_
.MouseEvent_swigregister(MouseEvent
)
4696 #---------------------------------------------------------------------------
4698 class SetCursorEvent(Event
):
4700 A SetCursorEvent is generated when the mouse cursor is about to be set
4701 as a result of mouse motion. This event gives the application the
4702 chance to perform specific mouse cursor processing based on the
4703 current position of the mouse within the window. Use the `SetCursor`
4704 method to specify the cursor you want to be displayed.
4706 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4707 __repr__
= _swig_repr
4708 def __init__(self
, *args
, **kwargs
):
4710 __init__(self, int x=0, int y=0) -> SetCursorEvent
4712 Construct a new `wx.SetCursorEvent`.
4714 _core_
.SetCursorEvent_swiginit(self
,_core_
.new_SetCursorEvent(*args
, **kwargs
))
4715 def GetX(*args
, **kwargs
):
4719 Returns the X coordinate of the mouse in client coordinates.
4721 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
4723 def GetY(*args
, **kwargs
):
4727 Returns the Y coordinate of the mouse in client coordinates.
4729 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
4731 def SetCursor(*args
, **kwargs
):
4733 SetCursor(self, Cursor cursor)
4735 Sets the cursor associated with this event.
4737 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
4739 def GetCursor(*args
, **kwargs
):
4741 GetCursor(self) -> Cursor
4743 Returns a reference to the cursor specified by this event.
4745 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
4747 def HasCursor(*args
, **kwargs
):
4749 HasCursor(self) -> bool
4751 Returns true if the cursor specified by this event is a valid cursor.
4753 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
4755 _core_
.SetCursorEvent_swigregister(SetCursorEvent
)
4757 #---------------------------------------------------------------------------
4759 class KeyEvent(Event
):
4761 This event class contains information about keypress and character
4762 events. These events are only sent to the widget that currently has
4765 Notice that there are three different kinds of keyboard events in
4766 wxWidgets: key down and up events and char events. The difference
4767 between the first two is clear - the first corresponds to a key press
4768 and the second to a key release - otherwise they are identical. Just
4769 note that if the key is maintained in a pressed state you will
4770 typically get a lot of (automatically generated) down events but only
4771 one up so it is wrong to assume that there is one up event
4772 corresponding to each down one.
4774 Both key events provide untranslated key codes while the char event
4775 carries the translated one. The untranslated code for alphanumeric
4776 keys is always an upper case value. For the other keys it is one of
4777 WXK_XXX values from the keycodes table. The translated key is, in
4778 general, the character the user expects to appear as the result of the
4779 key combination when typing the text into a text entry zone, for
4782 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4783 and the standard US keyboard): when the 'A' key is pressed, the key
4784 down event key code is equal to ASCII A == 65. But the char event key
4785 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4786 'A' keys simultaneously , the key code in key down event will still be
4787 just 'A' while the char event key code parameter will now be 'A' as
4790 Although in this simple case it is clear that the correct key code
4791 could be found in the key down event handler by checking the value
4792 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4793 as for non alphanumeric keys or non-US keyboard layouts the
4794 translation is keyboard-layout dependent and can only be done properly
4795 by the system itself.
4797 Another kind of translation is done when the control key is pressed:
4798 for example, for CTRL-A key press the key down event still carries the
4799 same key code 'A' as usual but the char event will have key code of 1,
4800 the ASCII value of this key combination.
4802 You may discover how the other keys on your system behave
4803 interactively by running the KeyEvents sample in the wxPython demo and
4804 pressing some keys while the blue box at the top has the keyboard
4807 **Note**: If a key down event is caught and the event handler does not
4808 call event.Skip() then the coresponding char event will not
4809 happen. This is by design and enables the programs that handle both
4810 types of events to be a bit simpler.
4812 **Note for Windows programmers**: The key and char events in wxWidgets
4813 are similar to but slightly different from Windows WM_KEYDOWN and
4814 WM_CHAR events. In particular, Alt-x combination will generate a char
4815 event in wxWidgets (unless it is used as an accelerator).
4817 **Tip**: be sure to call event.Skip() for events that you don't
4818 process in key event function, otherwise menu shortcuts may cease to
4822 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4823 __repr__
= _swig_repr
4824 def __init__(self
, *args
, **kwargs
):
4826 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4828 Construct a new `wx.KeyEvent`. Valid event types are:
4831 _core_
.KeyEvent_swiginit(self
,_core_
.new_KeyEvent(*args
, **kwargs
))
4832 def GetModifiers(*args
, **kwargs
):
4834 GetModifiers(self) -> int
4836 Returns a bitmask of the current modifier settings. Can be used to
4837 check if the key event has exactly the given modifiers without having
4838 to explicitly check that the other modifiers are not down. For
4841 if event.GetModifers() == wx.MOD_CONTROL:
4845 return _core_
.KeyEvent_GetModifiers(*args
, **kwargs
)
4847 def ControlDown(*args
, **kwargs
):
4849 ControlDown(self) -> bool
4851 Returns ``True`` if the Control key was down at the time of the event.
4853 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
4855 def MetaDown(*args
, **kwargs
):
4857 MetaDown(self) -> bool
4859 Returns ``True`` if the Meta key was down at the time of the event.
4861 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
4863 def AltDown(*args
, **kwargs
):
4865 AltDown(self) -> bool
4867 Returns ``True`` if the Alt key was down at the time of the event.
4869 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
4871 def ShiftDown(*args
, **kwargs
):
4873 ShiftDown(self) -> bool
4875 Returns ``True`` if the Shift key was down at the time of the event.
4877 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
4879 def CmdDown(*args
, **kwargs
):
4881 CmdDown(self) -> bool
4883 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4884 platforms but the special "Apple" (a.k.a as "Command") key on
4885 Macs. It makes often sense to use it instead of, say, `ControlDown`
4886 because Cmd key is used for the same thing under Mac as Ctrl
4887 elsewhere. The Ctrl still exists, it's just not used for this
4888 purpose. So for non-Mac platforms this is the same as `ControlDown`
4889 and Macs this is the same as `MetaDown`.
4891 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
4893 def HasModifiers(*args
, **kwargs
):
4895 HasModifiers(self) -> bool
4897 Returns true if either CTRL or ALT keys was down at the time of the
4898 key event. Note that this function does not take into account neither
4899 SHIFT nor META key states (the reason for ignoring the latter is that
4900 it is common for NUMLOCK key to be configured as META under X but the
4901 key presses even while NUMLOCK is on should be still processed
4904 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
4906 def GetKeyCode(*args
, **kwargs
):
4908 GetKeyCode(self) -> int
4910 Returns the virtual key code. ASCII events return normal ASCII values,
4911 while non-ASCII events return values such as WXK_LEFT for the left
4912 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4915 Note that in Unicode build, the returned value is meaningful only if
4916 the user entered a character that can be represented in current
4917 locale's default charset. You can obtain the corresponding Unicode
4918 character using `GetUnicodeKey`.
4920 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
4922 def GetUnicodeKey(*args
, **kwargs
):
4924 GetUnicodeKey(self) -> int
4926 Returns the Unicode character corresponding to this key event. This
4927 function is only meaningfule in a Unicode build of wxPython.
4929 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
4931 GetUniChar
= GetUnicodeKey
4932 def SetUnicodeKey(*args
, **kwargs
):
4934 SetUnicodeKey(self, int uniChar)
4936 Set the Unicode value of the key event, but only if this is a Unicode
4939 return _core_
.KeyEvent_SetUnicodeKey(*args
, **kwargs
)
4941 def GetRawKeyCode(*args
, **kwargs
):
4943 GetRawKeyCode(self) -> unsigned int
4945 Returns the raw key code for this event. This is a platform-dependent
4946 scan code which should only be used in advanced
4947 applications. Currently the raw key codes are not supported by all
4950 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
4952 def GetRawKeyFlags(*args
, **kwargs
):
4954 GetRawKeyFlags(self) -> unsigned int
4956 Returns the low level key flags for this event. The flags are
4957 platform-dependent and should only be used in advanced applications.
4958 Currently the raw key flags are not supported by all ports.
4960 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
4962 def GetPosition(*args
, **kwargs
):
4964 GetPosition(self) -> Point
4966 Find the position of the event, if applicable.
4968 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
4970 def GetPositionTuple(*args
, **kwargs
):
4972 GetPositionTuple() -> (x,y)
4974 Find the position of the event, if applicable.
4976 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
4978 def GetX(*args
, **kwargs
):
4982 Returns the X position (in client coordinates) of the event, if
4985 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
4987 def GetY(*args
, **kwargs
):
4991 Returns the Y position (in client coordinates) of the event, if
4994 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
4996 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
4997 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
4998 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
4999 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
5000 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
5001 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
5002 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
5003 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
5004 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
5005 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
5006 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
5007 Modifiers
= property(GetModifiers
,doc
="See `GetModifiers`")
5008 Position
= property(GetPosition
,doc
="See `GetPosition`")
5009 RawKeyCode
= property(GetRawKeyCode
,doc
="See `GetRawKeyCode`")
5010 RawKeyFlags
= property(GetRawKeyFlags
,doc
="See `GetRawKeyFlags`")
5011 UnicodeKey
= property(GetUnicodeKey
,SetUnicodeKey
,doc
="See `GetUnicodeKey` and `SetUnicodeKey`")
5012 X
= property(GetX
,doc
="See `GetX`")
5013 Y
= property(GetY
,doc
="See `GetY`")
5014 _core_
.KeyEvent_swigregister(KeyEvent
)
5016 #---------------------------------------------------------------------------
5018 class SizeEvent(Event
):
5020 A size event holds information about size change events. The EVT_SIZE
5021 handler function will be called when the window it is bound to has
5024 Note that the size passed is of the whole window: call
5025 `wx.Window.GetClientSize` for the area which may be used by the
5028 When a window is resized, usually only a small part of the window is
5029 damaged and and that area is all that is in the update region for the
5030 next paint event. However, if your drawing depends on the size of the
5031 window, you may need to clear the DC explicitly and repaint the whole
5032 window. In which case, you may need to call `wx.Window.Refresh` to
5033 invalidate the entire window.
5036 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5037 __repr__
= _swig_repr
5038 def __init__(self
, *args
, **kwargs
):
5040 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5042 Construct a new ``wx.SizeEvent``.
5044 _core_
.SizeEvent_swiginit(self
,_core_
.new_SizeEvent(*args
, **kwargs
))
5045 def GetSize(*args
, **kwargs
):
5047 GetSize(self) -> Size
5049 Returns the entire size of the window generating the size change
5052 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
5054 def GetRect(*args
, **kwargs
):
5055 """GetRect(self) -> Rect"""
5056 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
5058 def SetRect(*args
, **kwargs
):
5059 """SetRect(self, Rect rect)"""
5060 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
5062 def SetSize(*args
, **kwargs
):
5063 """SetSize(self, Size size)"""
5064 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
5066 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
5067 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
5068 _core_
.SizeEvent_swigregister(SizeEvent
)
5070 #---------------------------------------------------------------------------
5072 class MoveEvent(Event
):
5074 This event object is sent for EVT_MOVE event bindings when a window is
5075 moved to a new position.
5077 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5078 __repr__
= _swig_repr
5079 def __init__(self
, *args
, **kwargs
):
5081 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5085 _core_
.MoveEvent_swiginit(self
,_core_
.new_MoveEvent(*args
, **kwargs
))
5086 def GetPosition(*args
, **kwargs
):
5088 GetPosition(self) -> Point
5090 Returns the position of the window generating the move change event.
5092 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
5094 def GetRect(*args
, **kwargs
):
5095 """GetRect(self) -> Rect"""
5096 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
5098 def SetRect(*args
, **kwargs
):
5099 """SetRect(self, Rect rect)"""
5100 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
5102 def SetPosition(*args
, **kwargs
):
5103 """SetPosition(self, Point pos)"""
5104 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
5106 m_pos
= property(GetPosition
, SetPosition
)
5107 m_rect
= property(GetRect
, SetRect
)
5109 _core_
.MoveEvent_swigregister(MoveEvent
)
5111 #---------------------------------------------------------------------------
5113 class PaintEvent(Event
):
5115 A paint event is sent when a window's contents needs to be repainted.
5116 Note that in an EVT_PAINT handler the application must *always* create
5117 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5118 Windows assumes that the window has not been painted yet and will send
5119 the event again, causing endless refreshes.
5121 You can optimize painting by retrieving the rectangles that have been
5122 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5123 and only repainting these rectangles. The rectangles are in terms of
5124 the client area, and are unscrolled, so you will need to do some
5125 calculations using the current view position to obtain logical,
5129 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5130 __repr__
= _swig_repr
5131 def __init__(self
, *args
, **kwargs
):
5132 """__init__(self, int Id=0) -> PaintEvent"""
5133 _core_
.PaintEvent_swiginit(self
,_core_
.new_PaintEvent(*args
, **kwargs
))
5134 _core_
.PaintEvent_swigregister(PaintEvent
)
5136 class NcPaintEvent(Event
):
5137 """Proxy of C++ NcPaintEvent class"""
5138 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5139 __repr__
= _swig_repr
5140 def __init__(self
, *args
, **kwargs
):
5141 """__init__(self, int winid=0) -> NcPaintEvent"""
5142 _core_
.NcPaintEvent_swiginit(self
,_core_
.new_NcPaintEvent(*args
, **kwargs
))
5143 _core_
.NcPaintEvent_swigregister(NcPaintEvent
)
5145 #---------------------------------------------------------------------------
5147 class EraseEvent(Event
):
5149 An erase event is sent whenever the background of a window needs to be
5150 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5151 binder. On some platforms, such as GTK+, this event is simulated
5152 (simply generated just before the paint event) and may cause flicker.
5154 To paint a custom background use the `GetDC` method and use the returned
5155 device context if it is not ``None``, otherwise create a temporary
5156 `wx.ClientDC` and draw on that.
5159 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5160 __repr__
= _swig_repr
5161 def __init__(self
, *args
, **kwargs
):
5163 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5167 _core_
.EraseEvent_swiginit(self
,_core_
.new_EraseEvent(*args
, **kwargs
))
5168 def GetDC(*args
, **kwargs
):
5172 Returns the device context the event handler should draw upon. If
5173 ``None`` is returned then create a temporary `wx.ClientDC` and use
5176 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5178 DC
= property(GetDC
,doc
="See `GetDC`")
5179 _core_
.EraseEvent_swigregister(EraseEvent
)
5181 #---------------------------------------------------------------------------
5183 class FocusEvent(Event
):
5185 A focus event is sent when a window's focus changes. The window losing
5186 focus receives an EVT_KILL_FOCUS event while the window gaining it
5187 gets an EVT_SET_FOCUS event.
5189 Notice that the set focus event happens both when the user gives focus
5190 to the window (whether using the mouse or keyboard) and when it is
5191 done from the program itself using `wx.Window.SetFocus`.
5194 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5195 __repr__
= _swig_repr
5196 def __init__(self
, *args
, **kwargs
):
5198 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5202 _core_
.FocusEvent_swiginit(self
,_core_
.new_FocusEvent(*args
, **kwargs
))
5203 def GetWindow(*args
, **kwargs
):
5205 GetWindow(self) -> Window
5207 Returns the other window associated with this event, that is the
5208 window which had the focus before for the EVT_SET_FOCUS event and the
5209 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5211 Warning: the window returned may be None!
5213 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5215 def SetWindow(*args
, **kwargs
):
5216 """SetWindow(self, Window win)"""
5217 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5219 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
5220 _core_
.FocusEvent_swigregister(FocusEvent
)
5222 #---------------------------------------------------------------------------
5224 class ChildFocusEvent(CommandEvent
):
5226 wx.ChildFocusEvent notifies the parent that a child has received the
5227 focus. Unlike `wx.FocusEvent` it is propagated up the window
5230 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5231 __repr__
= _swig_repr
5232 def __init__(self
, *args
, **kwargs
):
5234 __init__(self, Window win=None) -> ChildFocusEvent
5238 _core_
.ChildFocusEvent_swiginit(self
,_core_
.new_ChildFocusEvent(*args
, **kwargs
))
5239 def GetWindow(*args
, **kwargs
):
5241 GetWindow(self) -> Window
5243 The window which has just received the focus.
5245 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5247 Window
= property(GetWindow
,doc
="See `GetWindow`")
5248 _core_
.ChildFocusEvent_swigregister(ChildFocusEvent
)
5250 #---------------------------------------------------------------------------
5252 class ActivateEvent(Event
):
5254 An activate event is sent when a top-level window or the entire
5255 application is being activated or deactivated.
5257 A top-level window (a dialog or frame) receives an activate event when
5258 is being activated or deactivated. This is indicated visually by the
5259 title bar changing colour, and a subwindow gaining the keyboard focus.
5260 An application is activated or deactivated when one of its frames
5261 becomes activated, or a frame becomes inactivate resulting in all
5262 application frames being inactive.
5264 Please note that usually you should call event.Skip() in your handlers
5265 for these events so the default handlers will still be called, as not
5266 doing so can result in strange effects.
5269 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5270 __repr__
= _swig_repr
5271 def __init__(self
, *args
, **kwargs
):
5273 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5277 _core_
.ActivateEvent_swiginit(self
,_core_
.new_ActivateEvent(*args
, **kwargs
))
5278 def GetActive(*args
, **kwargs
):
5280 GetActive(self) -> bool
5282 Returns true if the application or window is being activated, false
5285 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5287 Active
= property(GetActive
,doc
="See `GetActive`")
5288 _core_
.ActivateEvent_swigregister(ActivateEvent
)
5290 #---------------------------------------------------------------------------
5292 class InitDialogEvent(Event
):
5294 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5295 any window when `wx.Window.InitDialog` is called. Handlers for this
5296 event can transfer data to the window, or anything else that should be
5297 done before the user begins editing the form. The default handler
5298 calls `wx.Window.TransferDataToWindow`.
5300 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5301 __repr__
= _swig_repr
5302 def __init__(self
, *args
, **kwargs
):
5304 __init__(self, int Id=0) -> InitDialogEvent
5308 _core_
.InitDialogEvent_swiginit(self
,_core_
.new_InitDialogEvent(*args
, **kwargs
))
5309 _core_
.InitDialogEvent_swigregister(InitDialogEvent
)
5311 #---------------------------------------------------------------------------
5313 class MenuEvent(Event
):
5315 This class is used for a variety of menu-related events. Note that
5316 these do not include menu command events, which are handled by sending
5317 `wx.CommandEvent` objects.
5319 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5320 text in the first field of the status bar.
5322 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5323 __repr__
= _swig_repr
5324 def __init__(self
, *args
, **kwargs
):
5326 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5330 _core_
.MenuEvent_swiginit(self
,_core_
.new_MenuEvent(*args
, **kwargs
))
5331 def GetMenuId(*args
, **kwargs
):
5333 GetMenuId(self) -> int
5335 Returns the menu identifier associated with the event. This method
5336 should be only used with the HIGHLIGHT events.
5338 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5340 def IsPopup(*args
, **kwargs
):
5342 IsPopup(self) -> bool
5344 Returns ``True`` if the menu which is being opened or closed is a
5345 popup menu, ``False`` if it is a normal one. This method should only
5346 be used with the OPEN and CLOSE events.
5348 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5350 def GetMenu(*args
, **kwargs
):
5352 GetMenu(self) -> Menu
5354 Returns the menu which is being opened or closed. This method should
5355 only be used with the OPEN and CLOSE events.
5357 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5359 _core_
.MenuEvent_swigregister(MenuEvent
)
5361 #---------------------------------------------------------------------------
5363 class CloseEvent(Event
):
5365 This event class contains information about window and session close
5368 The handler function for EVT_CLOSE is called when the user has tried
5369 to close a a frame or dialog box using the window manager controls or
5370 the system menu. It can also be invoked by the application itself
5371 programmatically, for example by calling the `wx.Window.Close`
5374 You should check whether the application is forcing the deletion of
5375 the window using `CanVeto`. If it returns ``False``, you must destroy
5376 the window using `wx.Window.Destroy`. If the return value is ``True``,
5377 it is up to you whether you respond by destroying the window or not.
5378 For example you may wish to display a message dialog prompting to save
5379 files or to cancel the close.
5381 If you don't destroy the window, you should call `Veto` to let the
5382 calling code know that you did not destroy the window. This allows the
5383 `wx.Window.Close` function to return ``True`` or ``False`` depending
5384 on whether the close instruction was honored or not.
5386 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5387 __repr__
= _swig_repr
5388 def __init__(self
, *args
, **kwargs
):
5390 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5394 _core_
.CloseEvent_swiginit(self
,_core_
.new_CloseEvent(*args
, **kwargs
))
5395 def SetLoggingOff(*args
, **kwargs
):
5397 SetLoggingOff(self, bool logOff)
5399 Sets the 'logging off' flag.
5401 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5403 def GetLoggingOff(*args
, **kwargs
):
5405 GetLoggingOff(self) -> bool
5407 Returns ``True`` if the user is logging off or ``False`` if the
5408 system is shutting down. This method can only be called for end
5409 session and query end session events, it doesn't make sense for close
5412 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5414 def Veto(*args
, **kwargs
):
5416 Veto(self, bool veto=True)
5418 Call this from your event handler to veto a system shutdown or to
5419 signal to the calling application that a window close did not happen.
5421 You can only veto a shutdown or close if `CanVeto` returns true.
5423 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5425 def GetVeto(*args
, **kwargs
):
5426 """GetVeto(self) -> bool"""
5427 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5429 def SetCanVeto(*args
, **kwargs
):
5431 SetCanVeto(self, bool canVeto)
5433 Sets the 'can veto' flag.
5435 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5437 def CanVeto(*args
, **kwargs
):
5439 CanVeto(self) -> bool
5441 Returns true if you can veto a system shutdown or a window close
5442 event. Vetoing a window close event is not possible if the calling
5443 code wishes to force the application to exit, and so this function
5444 must be called to check this.
5446 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5448 LoggingOff
= property(GetLoggingOff
,SetLoggingOff
,doc
="See `GetLoggingOff` and `SetLoggingOff`")
5449 _core_
.CloseEvent_swigregister(CloseEvent
)
5451 #---------------------------------------------------------------------------
5453 class ShowEvent(Event
):
5454 """An EVT_SHOW event is sent when a window is shown or hidden."""
5455 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5456 __repr__
= _swig_repr
5457 def __init__(self
, *args
, **kwargs
):
5459 __init__(self, int winid=0, bool show=False) -> ShowEvent
5461 An EVT_SHOW event is sent when a window is shown or hidden.
5463 _core_
.ShowEvent_swiginit(self
,_core_
.new_ShowEvent(*args
, **kwargs
))
5464 def SetShow(*args
, **kwargs
):
5465 """SetShow(self, bool show)"""
5466 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5468 def GetShow(*args
, **kwargs
):
5469 """GetShow(self) -> bool"""
5470 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5472 _core_
.ShowEvent_swigregister(ShowEvent
)
5474 #---------------------------------------------------------------------------
5476 class IconizeEvent(Event
):
5478 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5481 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5482 __repr__
= _swig_repr
5483 def __init__(self
, *args
, **kwargs
):
5485 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5487 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5490 _core_
.IconizeEvent_swiginit(self
,_core_
.new_IconizeEvent(*args
, **kwargs
))
5491 def Iconized(*args
, **kwargs
):
5493 Iconized(self) -> bool
5495 Returns ``True`` if the frame has been iconized, ``False`` if it has
5498 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5500 _core_
.IconizeEvent_swigregister(IconizeEvent
)
5502 #---------------------------------------------------------------------------
5504 class MaximizeEvent(Event
):
5505 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5506 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5507 __repr__
= _swig_repr
5508 def __init__(self
, *args
, **kwargs
):
5510 __init__(self, int id=0) -> MaximizeEvent
5512 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5514 _core_
.MaximizeEvent_swiginit(self
,_core_
.new_MaximizeEvent(*args
, **kwargs
))
5515 _core_
.MaximizeEvent_swigregister(MaximizeEvent
)
5517 #---------------------------------------------------------------------------
5519 class DropFilesEvent(Event
):
5521 This class is used for drop files events, that is, when files have
5522 been dropped onto the window. This functionality is only available
5523 under Windows. The window must have previously been enabled for
5524 dropping by calling `wx.Window.DragAcceptFiles`.
5526 Important note: this is a separate implementation to the more general
5527 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5528 implementation uses the older, Windows message-based approach of
5531 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5535 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5536 def __init__(self
): raise AttributeError, "No constructor defined"
5537 __repr__
= _swig_repr
5538 def GetPosition(*args
, **kwargs
):
5540 GetPosition(self) -> Point
5542 Returns the position at which the files were dropped.
5544 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5546 def GetNumberOfFiles(*args
, **kwargs
):
5548 GetNumberOfFiles(self) -> int
5550 Returns the number of files dropped.
5552 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5554 def GetFiles(*args
, **kwargs
):
5556 GetFiles(self) -> PyObject
5558 Returns a list of the filenames that were dropped.
5560 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5562 Files
= property(GetFiles
,doc
="See `GetFiles`")
5563 NumberOfFiles
= property(GetNumberOfFiles
,doc
="See `GetNumberOfFiles`")
5564 Position
= property(GetPosition
,doc
="See `GetPosition`")
5565 _core_
.DropFilesEvent_swigregister(DropFilesEvent
)
5567 #---------------------------------------------------------------------------
5569 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5570 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5571 class UpdateUIEvent(CommandEvent
):
5573 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5574 wxWidgets to give an application the chance to update various user
5577 Without update UI events, an application has to work hard to
5578 check/uncheck, enable/disable, and set the text for elements such as
5579 menu items and toolbar buttons. The code for doing this has to be
5580 mixed up with the code that is invoked when an action is invoked for a
5581 menu item or button.
5583 With update UI events, you define an event handler to look at the
5584 state of the application and change UI elements accordingly. wxWidgets
5585 will call your handler functions in idle time, so you don't have to
5586 worry where to call this code. In addition to being a clearer and more
5587 declarative method, it also means you don't have to worry whether
5588 you're updating a toolbar or menubar identifier. The same handler can
5589 update a menu item and toolbar button, if the ID values are the same.
5591 Instead of directly manipulating the menu or button, you call
5592 functions in the event object, such as `Check`. wxWidgets will
5593 determine whether such a call has been made, and which UI element to
5596 These events will work for popup menus as well as menubars. Just
5597 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5598 any UI events for the window that owns the menu.
5600 If you find that the overhead of UI update processing is affecting
5601 your application, you can do one or both of the following:
5603 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5604 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5605 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5606 receive update events. No other windows will receive update
5609 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5610 value to set the delay between updates. You may need to call
5611 `wx.Window.UpdateWindowUI` at critical points, for example when
5612 a dialog is about to be shown, in case the user sees a slight
5613 delay before windows are updated.
5615 Note that although events are sent in idle time, defining a EVT_IDLE
5616 handler for a window does not affect this because the events are sent
5617 from an internal idle handler.
5619 wxWidgets tries to optimize update events on some platforms. On
5620 Windows and GTK+, events for menubar items are only sent when the menu
5621 is about to be shown, and not in idle time.
5624 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5625 __repr__
= _swig_repr
5626 def __init__(self
, *args
, **kwargs
):
5628 __init__(self, int commandId=0) -> UpdateUIEvent
5632 _core_
.UpdateUIEvent_swiginit(self
,_core_
.new_UpdateUIEvent(*args
, **kwargs
))
5633 def GetChecked(*args
, **kwargs
):
5635 GetChecked(self) -> bool
5637 Returns ``True`` if the UI element should be checked.
5639 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
5641 def GetEnabled(*args
, **kwargs
):
5643 GetEnabled(self) -> bool
5645 Returns ``True`` if the UI element should be enabled.
5647 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
5649 def GetShown(*args
, **kwargs
):
5651 GetShown(self) -> bool
5653 Returns ``True`` if the UI element should be shown.
5655 return _core_
.UpdateUIEvent_GetShown(*args
, **kwargs
)
5657 def GetText(*args
, **kwargs
):
5659 GetText(self) -> String
5661 Returns the text that should be set for the UI element.
5663 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
5665 def GetSetText(*args
, **kwargs
):
5667 GetSetText(self) -> bool
5669 Returns ``True`` if the application has called `SetText`. For
5670 wxWidgets internal use only.
5672 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
5674 def GetSetChecked(*args
, **kwargs
):
5676 GetSetChecked(self) -> bool
5678 Returns ``True`` if the application has called `Check`. For wxWidgets
5681 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
5683 def GetSetEnabled(*args
, **kwargs
):
5685 GetSetEnabled(self) -> bool
5687 Returns ``True`` if the application has called `Enable`. For wxWidgets
5690 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
5692 def GetSetShown(*args
, **kwargs
):
5694 GetSetShown(self) -> bool
5696 Returns ``True`` if the application has called `Show`. For wxWidgets
5699 return _core_
.UpdateUIEvent_GetSetShown(*args
, **kwargs
)
5701 def Check(*args
, **kwargs
):
5703 Check(self, bool check)
5705 Check or uncheck the UI element.
5707 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
5709 def Enable(*args
, **kwargs
):
5711 Enable(self, bool enable)
5713 Enable or disable the UI element.
5715 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
5717 def Show(*args
, **kwargs
):
5719 Show(self, bool show)
5721 Show or hide the UI element.
5723 return _core_
.UpdateUIEvent_Show(*args
, **kwargs
)
5725 def SetText(*args
, **kwargs
):
5727 SetText(self, String text)
5729 Sets the text for this UI element.
5731 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
5733 def SetUpdateInterval(*args
, **kwargs
):
5735 SetUpdateInterval(long updateInterval)
5737 Sets the interval between updates in milliseconds. Set to -1 to
5738 disable updates, or to 0 to update as frequently as possible. The
5741 Use this to reduce the overhead of UI update events if your
5742 application has a lot of windows. If you set the value to -1 or
5743 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5744 at appropriate points in your application, such as when a dialog is
5747 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5749 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
5750 def GetUpdateInterval(*args
, **kwargs
):
5752 GetUpdateInterval() -> long
5754 Returns the current interval between updates in milliseconds. -1
5755 disables updates, 0 updates as frequently as possible.
5757 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5759 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
5760 def CanUpdate(*args
, **kwargs
):
5762 CanUpdate(Window win) -> bool
5764 Returns ``True`` if it is appropriate to update (send UI update events
5767 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5768 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5769 events were last sent in idle time, and the update interval, to
5770 determine whether events should be sent to this window now. By default
5771 this will always return true because the update mode is initially
5772 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5773 events will be sent as often as possible. You can reduce the frequency
5774 that events are sent by changing the mode and/or setting an update
5778 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5780 CanUpdate
= staticmethod(CanUpdate
)
5781 def ResetUpdateTime(*args
, **kwargs
):
5785 Used internally to reset the last-updated time to the current time. It
5786 is assumed that update events are normally sent in idle time, so this
5787 is called at the end of idle processing.
5789 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5791 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
5792 def SetMode(*args
, **kwargs
):
5796 Specify how wxWidgets will send update events: to all windows, or only
5797 to those which specify that they will process the events.
5799 The mode may be one of the following values:
5801 ============================= ==========================================
5802 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5803 is the default setting.
5804 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5805 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5807 ============================= ==========================================
5810 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5812 SetMode
= staticmethod(SetMode
)
5813 def GetMode(*args
, **kwargs
):
5817 Returns a value specifying how wxWidgets will send update events: to
5818 all windows, or only to those which specify that they will process the
5821 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5823 GetMode
= staticmethod(GetMode
)
5824 _core_
.UpdateUIEvent_swigregister(UpdateUIEvent
)
5826 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
5828 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5830 Sets the interval between updates in milliseconds. Set to -1 to
5831 disable updates, or to 0 to update as frequently as possible. The
5834 Use this to reduce the overhead of UI update events if your
5835 application has a lot of windows. If you set the value to -1 or
5836 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5837 at appropriate points in your application, such as when a dialog is
5840 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5842 def UpdateUIEvent_GetUpdateInterval(*args
):
5844 UpdateUIEvent_GetUpdateInterval() -> long
5846 Returns the current interval between updates in milliseconds. -1
5847 disables updates, 0 updates as frequently as possible.
5849 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
)
5851 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
5853 UpdateUIEvent_CanUpdate(Window win) -> bool
5855 Returns ``True`` if it is appropriate to update (send UI update events
5858 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5859 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5860 events were last sent in idle time, and the update interval, to
5861 determine whether events should be sent to this window now. By default
5862 this will always return true because the update mode is initially
5863 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5864 events will be sent as often as possible. You can reduce the frequency
5865 that events are sent by changing the mode and/or setting an update
5869 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5871 def UpdateUIEvent_ResetUpdateTime(*args
):
5873 UpdateUIEvent_ResetUpdateTime()
5875 Used internally to reset the last-updated time to the current time. It
5876 is assumed that update events are normally sent in idle time, so this
5877 is called at the end of idle processing.
5879 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
)
5881 def UpdateUIEvent_SetMode(*args
, **kwargs
):
5883 UpdateUIEvent_SetMode(int mode)
5885 Specify how wxWidgets will send update events: to all windows, or only
5886 to those which specify that they will process the events.
5888 The mode may be one of the following values:
5890 ============================= ==========================================
5891 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5892 is the default setting.
5893 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5894 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5896 ============================= ==========================================
5899 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5901 def UpdateUIEvent_GetMode(*args
):
5903 UpdateUIEvent_GetMode() -> int
5905 Returns a value specifying how wxWidgets will send update events: to
5906 all windows, or only to those which specify that they will process the
5909 return _core_
.UpdateUIEvent_GetMode(*args
)
5911 #---------------------------------------------------------------------------
5913 class SysColourChangedEvent(Event
):
5915 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5916 when the user changes the colour settings using the control
5917 panel. This is only applicable under Windows.
5919 The default event handler for this event propagates the event to child
5920 windows, since Windows only sends the events to top-level windows. If
5921 intercepting this event for a top-level window, remember to call
5922 `Skip` so the the base class handler will still be executed, or to
5923 pass the event on to the window's children explicitly.
5926 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5927 __repr__
= _swig_repr
5928 def __init__(self
, *args
, **kwargs
):
5930 __init__(self) -> SysColourChangedEvent
5934 _core_
.SysColourChangedEvent_swiginit(self
,_core_
.new_SysColourChangedEvent(*args
, **kwargs
))
5935 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEvent
)
5937 #---------------------------------------------------------------------------
5939 class MouseCaptureChangedEvent(Event
):
5941 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5942 a window that loses its mouse capture. This is called even if
5943 `wx.Window.ReleaseMouse` was called by the application code. Handling
5944 this event allows an application to cater for unexpected capture
5945 releases which might otherwise confuse mouse handling code.
5947 This event is implemented under Windows only.
5949 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5950 __repr__
= _swig_repr
5951 def __init__(self
, *args
, **kwargs
):
5953 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5957 _core_
.MouseCaptureChangedEvent_swiginit(self
,_core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
))
5958 def GetCapturedWindow(*args
, **kwargs
):
5960 GetCapturedWindow(self) -> Window
5962 Returns the window that gained the capture, or ``None`` if it was a
5963 non-wxWidgets window.
5965 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
5967 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent
)
5969 #---------------------------------------------------------------------------
5971 class MouseCaptureLostEvent(Event
):
5973 A mouse capture lost event is sent to a window that obtained mouse
5974 capture, which was subsequently loss due to "external" event, for
5975 example when a dialog box is shown or if another application captures
5978 If this happens, this event is sent to all windows that are on the
5979 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5980 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5981 if the capture changes because of a call to CaptureMouse or
5984 This event is currently emitted under Windows only.
5987 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5988 __repr__
= _swig_repr
5989 def __init__(self
, *args
, **kwargs
):
5991 __init__(self, int winid=0) -> MouseCaptureLostEvent
5993 A mouse capture lost event is sent to a window that obtained mouse
5994 capture, which was subsequently loss due to "external" event, for
5995 example when a dialog box is shown or if another application captures
5998 If this happens, this event is sent to all windows that are on the
5999 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6000 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6001 if the capture changes because of a call to CaptureMouse or
6004 This event is currently emitted under Windows only.
6007 _core_
.MouseCaptureLostEvent_swiginit(self
,_core_
.new_MouseCaptureLostEvent(*args
, **kwargs
))
6008 _core_
.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent
)
6010 #---------------------------------------------------------------------------
6012 class DisplayChangedEvent(Event
):
6014 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6015 resolution has changed.
6017 This event is implemented under Windows only.
6019 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6020 __repr__
= _swig_repr
6021 def __init__(self
, *args
, **kwargs
):
6022 """__init__(self) -> DisplayChangedEvent"""
6023 _core_
.DisplayChangedEvent_swiginit(self
,_core_
.new_DisplayChangedEvent(*args
, **kwargs
))
6024 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEvent
)
6026 #---------------------------------------------------------------------------
6028 class PaletteChangedEvent(Event
):
6030 An EVT_PALETTE_CHANGED event is sent when the system palette has
6031 changed, thereby giving each window a chance to redo their own to
6034 This event is implemented under Windows only.
6036 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6037 __repr__
= _swig_repr
6038 def __init__(self
, *args
, **kwargs
):
6040 __init__(self, int id=0) -> PaletteChangedEvent
6042 An EVT_PALETTE_CHANGED event is sent when the system palette has
6043 changed, thereby giving each window a chance to redo their own to
6046 This event is implemented under Windows only.
6048 _core_
.PaletteChangedEvent_swiginit(self
,_core_
.new_PaletteChangedEvent(*args
, **kwargs
))
6049 def SetChangedWindow(*args
, **kwargs
):
6050 """SetChangedWindow(self, Window win)"""
6051 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
6053 def GetChangedWindow(*args
, **kwargs
):
6054 """GetChangedWindow(self) -> Window"""
6055 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
6057 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEvent
)
6059 #---------------------------------------------------------------------------
6061 class QueryNewPaletteEvent(Event
):
6063 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6064 focus and should re-do its palette.
6066 This event is implemented under Windows only.
6068 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6069 __repr__
= _swig_repr
6070 def __init__(self
, *args
, **kwargs
):
6072 __init__(self, int winid=0) -> QueryNewPaletteEvent
6076 _core_
.QueryNewPaletteEvent_swiginit(self
,_core_
.new_QueryNewPaletteEvent(*args
, **kwargs
))
6077 def SetPaletteRealized(*args
, **kwargs
):
6079 SetPaletteRealized(self, bool realized)
6081 App should set this if it changes the palette.
6083 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
6085 def GetPaletteRealized(*args
, **kwargs
):
6086 """GetPaletteRealized(self) -> bool"""
6087 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
6089 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent
)
6091 #---------------------------------------------------------------------------
6093 class NavigationKeyEvent(Event
):
6095 EVT_NAVIGATION_KEY events are used to control moving the focus between
6096 widgets, otherwise known as tab-traversal. You woudl normally not
6097 catch navigation events in applications as there are already
6098 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6099 it useful to send navigation events in certain situations to change
6100 the focus in certain ways, although it's probably easier to just call
6101 `wx.Window.Navigate`.
6103 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6104 __repr__
= _swig_repr
6105 def __init__(self
, *args
, **kwargs
):
6106 """__init__(self) -> NavigationKeyEvent"""
6107 _core_
.NavigationKeyEvent_swiginit(self
,_core_
.new_NavigationKeyEvent(*args
, **kwargs
))
6108 def GetDirection(*args
, **kwargs
):
6110 GetDirection(self) -> bool
6112 Returns ``True`` if the direction is forward, ``False`` otherwise.
6114 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
6116 def SetDirection(*args
, **kwargs
):
6118 SetDirection(self, bool forward)
6120 Specify the direction that the navigation should take. Usually the
6121 difference between using Tab and Shift-Tab.
6123 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
6125 def IsWindowChange(*args
, **kwargs
):
6127 IsWindowChange(self) -> bool
6129 Returns ``True`` if window change is allowed.
6131 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
6133 def SetWindowChange(*args
, **kwargs
):
6135 SetWindowChange(self, bool ischange)
6137 Specify if the navigation should be able to change parent windows.
6138 For example, changing notebook pages, etc. This is usually implemented
6139 by using Control-Tab.
6141 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
6143 def IsFromTab(*args
, **kwargs
):
6145 IsFromTab(self) -> bool
6147 Returns ``True`` if the navigation event is originated from the Tab
6150 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
6152 def SetFromTab(*args
, **kwargs
):
6154 SetFromTab(self, bool bIs)
6156 Set to true under MSW if the event was generated using the tab key.
6157 This is required for proper navogation over radio buttons.
6159 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
6161 def SetFlags(*args
, **kwargs
):
6163 SetFlags(self, long flags)
6165 Set the navigation flags to a combination of the following:
6167 * wx.NavigationKeyEvent.IsBackward
6168 * wx.NavigationKeyEvent.IsForward
6169 * wx.NavigationKeyEvent.WinChange
6170 * wx.NavigationKeyEvent.FromTab
6173 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6175 def GetCurrentFocus(*args
, **kwargs
):
6177 GetCurrentFocus(self) -> Window
6179 Returns the child window which currenty has the focus. May be
6182 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6184 def SetCurrentFocus(*args
, **kwargs
):
6186 SetCurrentFocus(self, Window win)
6188 Set the window that has the focus.
6190 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6192 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6193 IsForward
= _core_
.NavigationKeyEvent_IsForward
6194 WinChange
= _core_
.NavigationKeyEvent_WinChange
6195 FromTab
= _core_
.NavigationKeyEvent_FromTab
6196 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEvent
)
6198 #---------------------------------------------------------------------------
6200 class WindowCreateEvent(CommandEvent
):
6202 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6203 underlying GUI object) exists.
6205 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6206 __repr__
= _swig_repr
6207 def __init__(self
, *args
, **kwargs
):
6209 __init__(self, Window win=None) -> WindowCreateEvent
6211 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6212 underlying GUI object) exists.
6214 _core_
.WindowCreateEvent_swiginit(self
,_core_
.new_WindowCreateEvent(*args
, **kwargs
))
6215 def GetWindow(*args
, **kwargs
):
6217 GetWindow(self) -> Window
6219 Returns the window that this event refers to.
6221 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6223 _core_
.WindowCreateEvent_swigregister(WindowCreateEvent
)
6225 class WindowDestroyEvent(CommandEvent
):
6227 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6228 when the GUI window is destroyed.
6230 When a class derived from `wx.Window` is destroyed its destructor will
6231 have already run by the time this event is sent. Therefore this event
6232 will not usually be received at all by the window itself. Since it is
6233 received after the destructor has run, an object should not try to
6234 handle its own wx.WindowDestroyEvent, but it can be used to get
6235 notification of the destruction of another window.
6237 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6238 __repr__
= _swig_repr
6239 def __init__(self
, *args
, **kwargs
):
6241 __init__(self, Window win=None) -> WindowDestroyEvent
6243 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6244 when the GUI window is destroyed.
6246 When a class derived from `wx.Window` is destroyed its destructor will
6247 have already run by the time this event is sent. Therefore this event
6248 will not usually be received at all by the window itself. Since it is
6249 received after the destructor has run, an object should not try to
6250 handle its own wx.WindowDestroyEvent, but it can be used to get
6251 notification of the destruction of another window.
6253 _core_
.WindowDestroyEvent_swiginit(self
,_core_
.new_WindowDestroyEvent(*args
, **kwargs
))
6254 def GetWindow(*args
, **kwargs
):
6256 GetWindow(self) -> Window
6258 Returns the window that this event refers to.
6260 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6262 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEvent
)
6264 #---------------------------------------------------------------------------
6266 class ContextMenuEvent(CommandEvent
):
6268 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6269 give the application a chance to show a context (popup) menu.
6271 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6272 __repr__
= _swig_repr
6273 def __init__(self
, *args
, **kwargs
):
6275 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6279 _core_
.ContextMenuEvent_swiginit(self
,_core_
.new_ContextMenuEvent(*args
, **kwargs
))
6280 def GetPosition(*args
, **kwargs
):
6282 GetPosition(self) -> Point
6284 Returns the position (in screen coordinants) at which the menu should
6287 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6289 def SetPosition(*args
, **kwargs
):
6291 SetPosition(self, Point pos)
6293 Sets the position at which the menu should be shown.
6295 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6297 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
6298 _core_
.ContextMenuEvent_swigregister(ContextMenuEvent
)
6300 #---------------------------------------------------------------------------
6302 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6303 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6304 class IdleEvent(Event
):
6306 This class is used for EVT_IDLE events, which are generated and sent
6307 when the application *becomes* idle. In other words, the when the
6308 event queue becomes empty then idle events are sent to all windows (by
6309 default) and as long as none of them call `RequestMore` then there are
6310 no more idle events until after the system event queue has some normal
6311 events and then becomes empty again.
6313 By default, idle events are sent to all windows. If this is causing a
6314 significant overhead in your application, you can call
6315 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6316 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6317 which should receive idle events. Then idle events will only be sent
6318 to those windows and not to any others.
6320 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6321 __repr__
= _swig_repr
6322 def __init__(self
, *args
, **kwargs
):
6324 __init__(self) -> IdleEvent
6328 _core_
.IdleEvent_swiginit(self
,_core_
.new_IdleEvent(*args
, **kwargs
))
6329 def RequestMore(*args
, **kwargs
):
6331 RequestMore(self, bool needMore=True)
6333 Tells wxWidgets that more processing is required. This function can be
6334 called by an EVT_IDLE handler for a window to indicate that the
6335 application should forward the EVT_IDLE event once more to the
6336 application windows. If no window calls this function during its
6337 EVT_IDLE handler, then the application will remain in a passive event
6338 loop until a new event is posted to the application by the windowing
6341 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6343 def MoreRequested(*args
, **kwargs
):
6345 MoreRequested(self) -> bool
6347 Returns ``True`` if the OnIdle function processing this event
6348 requested more processing time.
6350 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6352 def SetMode(*args
, **kwargs
):
6356 Static method for specifying how wxWidgets will send idle events: to
6357 all windows, or only to those which specify that they will process the
6360 The mode can be one of the following values:
6362 ========================= ========================================
6363 wx.IDLE_PROCESS_ALL Send idle events to all windows
6364 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6365 the wx.WS_EX_PROCESS_IDLE extra style
6367 ========================= ========================================
6370 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6372 SetMode
= staticmethod(SetMode
)
6373 def GetMode(*args
, **kwargs
):
6377 Static method returning a value specifying how wxWidgets will send
6378 idle events: to all windows, or only to those which specify that they
6379 will process the events.
6381 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6383 GetMode
= staticmethod(GetMode
)
6384 def CanSend(*args
, **kwargs
):
6386 CanSend(Window win) -> bool
6388 Returns ``True`` if it is appropriate to send idle events to this
6391 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6392 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6393 events should be sent to this window now. By default this will always
6394 return ``True`` because the update mode is initially
6395 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6396 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6398 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6400 CanSend
= staticmethod(CanSend
)
6401 _core_
.IdleEvent_swigregister(IdleEvent
)
6403 def IdleEvent_SetMode(*args
, **kwargs
):
6405 IdleEvent_SetMode(int mode)
6407 Static method for specifying how wxWidgets will send idle events: to
6408 all windows, or only to those which specify that they will process the
6411 The mode can be one of the following values:
6413 ========================= ========================================
6414 wx.IDLE_PROCESS_ALL Send idle events to all windows
6415 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6416 the wx.WS_EX_PROCESS_IDLE extra style
6418 ========================= ========================================
6421 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6423 def IdleEvent_GetMode(*args
):
6425 IdleEvent_GetMode() -> int
6427 Static method returning a value specifying how wxWidgets will send
6428 idle events: to all windows, or only to those which specify that they
6429 will process the events.
6431 return _core_
.IdleEvent_GetMode(*args
)
6433 def IdleEvent_CanSend(*args
, **kwargs
):
6435 IdleEvent_CanSend(Window win) -> bool
6437 Returns ``True`` if it is appropriate to send idle events to this
6440 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6441 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6442 events should be sent to this window now. By default this will always
6443 return ``True`` because the update mode is initially
6444 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6445 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6447 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6449 #---------------------------------------------------------------------------
6451 class ClipboardTextEvent(CommandEvent
):
6453 A Clipboard Text event is sent when a window intercepts a text
6454 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6455 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6456 popup menu command, etc. NOTE : under windows these events are *NOT*
6457 generated automatically for a Rich Edit text control.
6459 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6460 __repr__
= _swig_repr
6461 def __init__(self
, *args
, **kwargs
):
6463 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6465 A Clipboard Text event is sent when a window intercepts a text
6466 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6467 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6468 popup menu command, etc. NOTE : under windows these events are *NOT*
6469 generated automatically for a Rich Edit text control.
6471 _core_
.ClipboardTextEvent_swiginit(self
,_core_
.new_ClipboardTextEvent(*args
, **kwargs
))
6472 _core_
.ClipboardTextEvent_swigregister(ClipboardTextEvent
)
6474 #---------------------------------------------------------------------------
6476 class PyEvent(Event
):
6478 wx.PyEvent can be used as a base class for implementing custom event
6479 types in Python. You should derived from this class instead of
6480 `wx.Event` because this class is Python-aware and is able to transport
6481 its Python bits safely through the wxWidgets event system and have
6482 them still be there when the event handler is invoked.
6484 :see: `wx.PyCommandEvent`
6487 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6488 __repr__
= _swig_repr
6489 def __init__(self
, *args
, **kwargs
):
6490 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6491 _core_
.PyEvent_swiginit(self
,_core_
.new_PyEvent(*args
, **kwargs
))
6494 __swig_destroy__
= _core_
.delete_PyEvent
6495 __del__
= lambda self
: None;
6496 def _SetSelf(*args
, **kwargs
):
6497 """_SetSelf(self, PyObject self)"""
6498 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6500 def _GetSelf(*args
, **kwargs
):
6501 """_GetSelf(self) -> PyObject"""
6502 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6504 _core_
.PyEvent_swigregister(PyEvent
)
6506 class PyCommandEvent(CommandEvent
):
6508 wx.PyCommandEvent can be used as a base class for implementing custom
6509 event types in Python, where the event shoudl travel up to parent
6510 windows looking for a handler. You should derived from this class
6511 instead of `wx.CommandEvent` because this class is Python-aware and is
6512 able to transport its Python bits safely through the wxWidgets event
6513 system and have them still be there when the event handler is invoked.
6518 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6519 __repr__
= _swig_repr
6520 def __init__(self
, *args
, **kwargs
):
6521 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6522 _core_
.PyCommandEvent_swiginit(self
,_core_
.new_PyCommandEvent(*args
, **kwargs
))
6525 __swig_destroy__
= _core_
.delete_PyCommandEvent
6526 __del__
= lambda self
: None;
6527 def _SetSelf(*args
, **kwargs
):
6528 """_SetSelf(self, PyObject self)"""
6529 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6531 def _GetSelf(*args
, **kwargs
):
6532 """_GetSelf(self) -> PyObject"""
6533 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6535 _core_
.PyCommandEvent_swigregister(PyCommandEvent
)
6537 class DateEvent(CommandEvent
):
6539 This event class holds information about a date change event and is
6540 used together with `wx.DatePickerCtrl`. It also serves as a base class
6541 for `wx.calendar.CalendarEvent`. Bind these event types with
6544 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6545 __repr__
= _swig_repr
6546 def __init__(self
, *args
, **kwargs
):
6547 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6548 _core_
.DateEvent_swiginit(self
,_core_
.new_DateEvent(*args
, **kwargs
))
6549 def GetDate(*args
, **kwargs
):
6551 GetDate(self) -> DateTime
6555 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6557 def SetDate(*args
, **kwargs
):
6559 SetDate(self, DateTime date)
6561 Sets the date carried by the event, normally only used by the library
6564 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
6566 Date
= property(GetDate
,SetDate
,doc
="See `GetDate` and `SetDate`")
6567 _core_
.DateEvent_swigregister(DateEvent
)
6569 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
6570 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
6572 #---------------------------------------------------------------------------
6574 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
6575 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
6576 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
6577 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
6578 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
6579 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
6580 class PyApp(EvtHandler
):
6582 The ``wx.PyApp`` class is an *implementation detail*, please use the
6583 `wx.App` class (or some other derived class) instead.
6585 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6586 __repr__
= _swig_repr
6587 def __init__(self
, *args
, **kwargs
):
6589 __init__(self) -> PyApp
6591 Create a new application object, starting the bootstrap process.
6593 _core_
.PyApp_swiginit(self
,_core_
.new_PyApp(*args
, **kwargs
))
6594 self
._setCallbackInfo
(self
, PyApp
, False)
6595 self
._setOORInfo
(self
, False)
6597 __swig_destroy__
= _core_
.delete_PyApp
6598 __del__
= lambda self
: None;
6599 def _setCallbackInfo(*args
, **kwargs
):
6600 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6601 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
6603 def GetAppName(*args
, **kwargs
):
6605 GetAppName(self) -> String
6607 Get the application name.
6609 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
6611 def SetAppName(*args
, **kwargs
):
6613 SetAppName(self, String name)
6615 Set the application name. This value may be used automatically by
6616 `wx.Config` and such.
6618 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
6620 def GetClassName(*args
, **kwargs
):
6622 GetClassName(self) -> String
6624 Get the application's class name.
6626 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
6628 def SetClassName(*args
, **kwargs
):
6630 SetClassName(self, String name)
6632 Set the application's class name. This value may be used for
6633 X-resources if applicable for the platform
6635 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
6637 def GetVendorName(*args
, **kwargs
):
6639 GetVendorName(self) -> String
6641 Get the application's vendor name.
6643 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
6645 def SetVendorName(*args
, **kwargs
):
6647 SetVendorName(self, String name)
6649 Set the application's vendor name. This value may be used
6650 automatically by `wx.Config` and such.
6652 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
6654 def GetTraits(*args
, **kwargs
):
6656 GetTraits(self) -> wxAppTraits
6658 Return (and create if necessary) the app traits object to which we
6659 delegate for everything which either should be configurable by the
6660 user (then he can change the default behaviour simply by overriding
6661 CreateTraits() and returning his own traits object) or which is
6662 GUI/console dependent as then wx.AppTraits allows us to abstract the
6663 differences behind the common facade.
6665 :todo: Add support for overriding CreateAppTraits in wxPython.
6667 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
6669 def ProcessPendingEvents(*args
, **kwargs
):
6671 ProcessPendingEvents(self)
6673 Process all events in the Pending Events list -- it is necessary to
6674 call this function to process posted events. This normally happens
6675 during each event loop iteration.
6677 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
6679 def Yield(*args
, **kwargs
):
6681 Yield(self, bool onlyIfNeeded=False) -> bool
6683 Process all currently pending events right now, instead of waiting
6684 until return to the event loop. It is an error to call ``Yield``
6685 recursively unless the value of ``onlyIfNeeded`` is True.
6687 :warning: This function is dangerous as it can lead to unexpected
6688 reentrancies (i.e. when called from an event handler it may
6689 result in calling the same event handler again), use with
6690 extreme care or, better, don't use at all!
6692 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6695 return _core_
.PyApp_Yield(*args
, **kwargs
)
6697 def WakeUpIdle(*args
, **kwargs
):
6701 Make sure that idle events are sent again.
6702 :see: `wx.WakeUpIdle`
6704 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
6706 def IsMainLoopRunning(*args
, **kwargs
):
6708 IsMainLoopRunning() -> bool
6710 Returns True if we're running the main loop, i.e. if the events can
6711 currently be dispatched.
6713 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
6715 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
6716 def MainLoop(*args
, **kwargs
):
6718 MainLoop(self) -> int
6720 Execute the main GUI loop, the function doesn't normally return until
6721 all top level windows have been closed and destroyed.
6723 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
6725 def Exit(*args
, **kwargs
):
6729 Exit the main loop thus terminating the application.
6732 return _core_
.PyApp_Exit(*args
, **kwargs
)
6734 def GetLayoutDirection(*args
, **kwargs
):
6736 GetLayoutDirection(self) -> wxLayoutDirection
6738 Return the layout direction for the current locale.
6740 return _core_
.PyApp_GetLayoutDirection(*args
, **kwargs
)
6742 def ExitMainLoop(*args
, **kwargs
):
6746 Exit the main GUI loop during the next iteration of the main
6747 loop, (i.e. it does not stop the program immediately!)
6749 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
6751 def Pending(*args
, **kwargs
):
6753 Pending(self) -> bool
6755 Returns True if there are unprocessed events in the event queue.
6757 return _core_
.PyApp_Pending(*args
, **kwargs
)
6759 def Dispatch(*args
, **kwargs
):
6761 Dispatch(self) -> bool
6763 Process the first event in the event queue (blocks until an event
6764 appears if there are none currently)
6766 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
6768 def ProcessIdle(*args
, **kwargs
):
6770 ProcessIdle(self) -> bool
6772 Called from the MainLoop when the application becomes idle (there are
6773 no pending events) and sends a `wx.IdleEvent` to all interested
6774 parties. Returns True if more idle events are needed, False if not.
6776 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
6778 def SendIdleEvents(*args
, **kwargs
):
6780 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6782 Send idle event to window and all subwindows. Returns True if more
6783 idle time is requested.
6785 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
6787 def IsActive(*args
, **kwargs
):
6789 IsActive(self) -> bool
6791 Return True if our app has focus.
6793 return _core_
.PyApp_IsActive(*args
, **kwargs
)
6795 def SetTopWindow(*args
, **kwargs
):
6797 SetTopWindow(self, Window win)
6799 Set the *main* top level window
6801 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
6803 def GetTopWindow(*args
, **kwargs
):
6805 GetTopWindow(self) -> Window
6807 Return the *main* top level window (if it hadn't been set previously
6808 with SetTopWindow(), will return just some top level window and, if
6809 there not any, will return None)
6811 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
6813 def SetExitOnFrameDelete(*args
, **kwargs
):
6815 SetExitOnFrameDelete(self, bool flag)
6817 Control the exit behaviour: by default, the program will exit the main
6818 loop (and so, usually, terminate) when the last top-level program
6819 window is deleted. Beware that if you disable this behaviour (with
6820 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6821 explicitly from somewhere.
6823 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
6825 def GetExitOnFrameDelete(*args
, **kwargs
):
6827 GetExitOnFrameDelete(self) -> bool
6829 Get the current exit behaviour setting.
6831 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
6833 def SetUseBestVisual(*args
, **kwargs
):
6835 SetUseBestVisual(self, bool flag)
6837 Set whether the app should try to use the best available visual on
6838 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6840 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
6842 def GetUseBestVisual(*args
, **kwargs
):
6844 GetUseBestVisual(self) -> bool
6846 Get current UseBestVisual setting.
6848 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
6850 def SetPrintMode(*args
, **kwargs
):
6851 """SetPrintMode(self, int mode)"""
6852 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
6854 def GetPrintMode(*args
, **kwargs
):
6855 """GetPrintMode(self) -> int"""
6856 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
6858 def SetAssertMode(*args
, **kwargs
):
6860 SetAssertMode(self, int mode)
6862 Set the OnAssert behaviour for debug and hybrid builds.
6864 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
6866 def GetAssertMode(*args
, **kwargs
):
6868 GetAssertMode(self) -> int
6870 Get the current OnAssert behaviour setting.
6872 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
6874 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6875 """GetMacSupportPCMenuShortcuts() -> bool"""
6876 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6878 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
6879 def GetMacAboutMenuItemId(*args
, **kwargs
):
6880 """GetMacAboutMenuItemId() -> long"""
6881 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
6883 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
6884 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
6885 """GetMacPreferencesMenuItemId() -> long"""
6886 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
6888 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
6889 def GetMacExitMenuItemId(*args
, **kwargs
):
6890 """GetMacExitMenuItemId() -> long"""
6891 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
6893 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
6894 def GetMacHelpMenuTitleName(*args
, **kwargs
):
6895 """GetMacHelpMenuTitleName() -> String"""
6896 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
6898 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
6899 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6900 """SetMacSupportPCMenuShortcuts(bool val)"""
6901 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6903 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
6904 def SetMacAboutMenuItemId(*args
, **kwargs
):
6905 """SetMacAboutMenuItemId(long val)"""
6906 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6908 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
6909 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
6910 """SetMacPreferencesMenuItemId(long val)"""
6911 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6913 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
6914 def SetMacExitMenuItemId(*args
, **kwargs
):
6915 """SetMacExitMenuItemId(long val)"""
6916 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6918 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
6919 def SetMacHelpMenuTitleName(*args
, **kwargs
):
6920 """SetMacHelpMenuTitleName(String val)"""
6921 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6923 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
6924 def _BootstrapApp(*args
, **kwargs
):
6928 For internal use only
6930 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
6932 def GetComCtl32Version(*args
, **kwargs
):
6934 GetComCtl32Version() -> int
6936 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6937 it wasn't found at all. Raises an exception on non-Windows platforms.
6939 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
6941 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
6942 def DisplayAvailable(*args
, **kwargs
):
6944 DisplayAvailable() -> bool
6946 Tests if it is possible to create a GUI in the current environment.
6947 This will mean different things on the different platforms.
6949 * On X Windows systems this function will return ``False`` if it is
6950 not able to open a connection to the X display, which can happen
6951 if $DISPLAY is not set, or is not set correctly.
6953 * On Mac OS X a ``False`` return value will mean that wx is not
6954 able to access the window manager, which can happen if logged in
6955 remotely or if running from the normal version of python instead
6956 of the framework version, (i.e., pythonw.)
6961 return _core_
.PyApp_DisplayAvailable(*args
, **kwargs
)
6963 DisplayAvailable
= staticmethod(DisplayAvailable
)
6964 _core_
.PyApp_swigregister(PyApp
)
6966 def PyApp_IsMainLoopRunning(*args
):
6968 PyApp_IsMainLoopRunning() -> bool
6970 Returns True if we're running the main loop, i.e. if the events can
6971 currently be dispatched.
6973 return _core_
.PyApp_IsMainLoopRunning(*args
)
6975 def PyApp_GetMacSupportPCMenuShortcuts(*args
):
6976 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6977 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
)
6979 def PyApp_GetMacAboutMenuItemId(*args
):
6980 """PyApp_GetMacAboutMenuItemId() -> long"""
6981 return _core_
.PyApp_GetMacAboutMenuItemId(*args
)
6983 def PyApp_GetMacPreferencesMenuItemId(*args
):
6984 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6985 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
)
6987 def PyApp_GetMacExitMenuItemId(*args
):
6988 """PyApp_GetMacExitMenuItemId() -> long"""
6989 return _core_
.PyApp_GetMacExitMenuItemId(*args
)
6991 def PyApp_GetMacHelpMenuTitleName(*args
):
6992 """PyApp_GetMacHelpMenuTitleName() -> String"""
6993 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
)
6995 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6996 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6997 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6999 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
7000 """PyApp_SetMacAboutMenuItemId(long val)"""
7001 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7003 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
7004 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7005 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7007 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
7008 """PyApp_SetMacExitMenuItemId(long val)"""
7009 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7011 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
7012 """PyApp_SetMacHelpMenuTitleName(String val)"""
7013 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7015 def PyApp_GetComCtl32Version(*args
):
7017 PyApp_GetComCtl32Version() -> int
7019 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7020 it wasn't found at all. Raises an exception on non-Windows platforms.
7022 return _core_
.PyApp_GetComCtl32Version(*args
)
7024 def PyApp_DisplayAvailable(*args
):
7026 PyApp_DisplayAvailable() -> bool
7028 Tests if it is possible to create a GUI in the current environment.
7029 This will mean different things on the different platforms.
7031 * On X Windows systems this function will return ``False`` if it is
7032 not able to open a connection to the X display, which can happen
7033 if $DISPLAY is not set, or is not set correctly.
7035 * On Mac OS X a ``False`` return value will mean that wx is not
7036 able to access the window manager, which can happen if logged in
7037 remotely or if running from the normal version of python instead
7038 of the framework version, (i.e., pythonw.)
7043 return _core_
.PyApp_DisplayAvailable(*args
)
7045 #---------------------------------------------------------------------------
7052 Force an exit of the application. Convenience for wx.GetApp().Exit()
7054 return _core_
.Exit(*args
)
7060 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7062 return _core_
.Yield(*args
)
7064 def YieldIfNeeded(*args
):
7066 YieldIfNeeded() -> bool
7068 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7070 return _core_
.YieldIfNeeded(*args
)
7072 def SafeYield(*args
, **kwargs
):
7074 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7076 This function is similar to `wx.Yield`, except that it disables the
7077 user input to all program windows before calling `wx.Yield` and
7078 re-enables it again afterwards. If ``win`` is not None, this window
7079 will remain enabled, allowing the implementation of some limited user
7082 :Returns: the result of the call to `wx.Yield`.
7084 return _core_
.SafeYield(*args
, **kwargs
)
7086 def WakeUpIdle(*args
):
7090 Cause the message queue to become empty again, so idle events will be
7093 return _core_
.WakeUpIdle(*args
)
7095 def PostEvent(*args
, **kwargs
):
7097 PostEvent(EvtHandler dest, Event event)
7099 Send an event to a window or other wx.EvtHandler to be processed
7102 return _core_
.PostEvent(*args
, **kwargs
)
7104 def App_CleanUp(*args
):
7108 For internal use only, it is used to cleanup after wxWidgets when
7111 return _core_
.App_CleanUp(*args
)
7117 Return a reference to the current wx.App object.
7119 return _core_
.GetApp(*args
)
7121 def SetDefaultPyEncoding(*args
, **kwargs
):
7123 SetDefaultPyEncoding(string encoding)
7125 Sets the encoding that wxPython will use when it needs to convert a
7126 Python string or unicode object to or from a wxString.
7128 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7129 but please be aware that the default encoding within the same locale
7130 may be slightly different on different platforms. For example, please
7131 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7132 between the common latin/roman encodings.
7134 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
7136 def GetDefaultPyEncoding(*args
):
7138 GetDefaultPyEncoding() -> string
7140 Gets the current encoding that wxPython will use when it needs to
7141 convert a Python string or unicode object to or from a wxString.
7143 return _core_
.GetDefaultPyEncoding(*args
)
7144 #----------------------------------------------------------------------
7146 class PyOnDemandOutputWindow
:
7148 A class that can be used for redirecting Python's stdout and
7149 stderr streams. It will do nothing until something is wrriten to
7150 the stream at which point it will create a Frame with a text area
7151 and write the text there.
7153 def __init__(self
, title
= "wxPython: stdout/stderr"):
7156 self
.pos
= wx
.DefaultPosition
7157 self
.size
= (450, 300)
7160 def SetParent(self
, parent
):
7161 """Set the window to be used as the popup Frame's parent."""
7162 self
.parent
= parent
7165 def CreateOutputWindow(self
, st
):
7166 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
7167 style
=wx
.DEFAULT_FRAME_STYLE
)
7168 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
7169 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
7170 self
.text
.AppendText(st
)
7171 self
.frame
.Show(True)
7172 self
.frame
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
7175 def OnCloseWindow(self
, event
):
7176 if self
.frame
is not None:
7177 self
.frame
.Destroy()
7182 # These methods provide the file-like output behaviour.
7183 def write(self
, text
):
7185 Create the output window if needed and write the string to it.
7186 If not called in the context of the gui thread then uses
7187 CallAfter to do the work there.
7189 if self
.frame
is None:
7190 if not wx
.Thread_IsMain():
7191 wx
.CallAfter(self
.CreateOutputWindow
, text
)
7193 self
.CreateOutputWindow(text
)
7195 if not wx
.Thread_IsMain():
7196 wx
.CallAfter(self
.text
.AppendText
, text
)
7198 self
.text
.AppendText(text
)
7202 if self
.frame
is not None:
7203 wx
.CallAfter(self
.frame
.Close
)
7211 #----------------------------------------------------------------------
7213 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
7215 class App(wx
.PyApp
):
7217 The ``wx.App`` class represents the application and is used to:
7219 * bootstrap the wxPython system and initialize the underlying
7221 * set and get application-wide properties
7222 * implement the windowing system main message or event loop,
7223 and to dispatch events to window instances
7226 Every application must have a ``wx.App`` instance, and all
7227 creation of UI objects should be delayed until after the
7228 ``wx.App`` object has been created in order to ensure that the gui
7229 platform and wxWidgets have been fully initialized.
7231 Normally you would derive from this class and implement an
7232 ``OnInit`` method that creates a frame and then calls
7233 ``self.SetTopWindow(frame)``.
7235 :see: `wx.PySimpleApp` for a simpler app class that can be used
7239 outputWindowClass
= PyOnDemandOutputWindow
7241 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7242 useBestVisual
=False, clearSigInt
=True):
7244 Construct a ``wx.App`` object.
7246 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7247 redirected? Defaults to True on Windows and Mac, False
7248 otherwise. If `filename` is None then output will be
7249 redirected to a window that pops up as needed. (You can
7250 control what kind of window is created for the output by
7251 resetting the class variable ``outputWindowClass`` to a
7252 class of your choosing.)
7254 :param filename: The name of a file to redirect output to, if
7257 :param useBestVisual: Should the app try to use the best
7258 available visual provided by the system (only relevant on
7259 systems that have more than one visual.) This parameter
7260 must be used instead of calling `SetUseBestVisual` later
7261 on because it must be set before the underlying GUI
7262 toolkit is initialized.
7264 :param clearSigInt: Should SIGINT be cleared? This allows the
7265 app to terminate upon a Ctrl-C in the console like other
7268 :note: You should override OnInit to do applicaition
7269 initialization to ensure that the system, toolkit and
7270 wxWidgets are fully initialized.
7273 wx
.PyApp
.__init
__(self
)
7275 # make sure we can create a GUI
7276 if not self
.DisplayAvailable():
7278 if wx
.Platform
== "__WXMAC__":
7279 msg
= """This program needs access to the screen.
7280 Please run with 'pythonw', not 'python', and only when you are logged
7281 in on the main display of your Mac."""
7283 elif wx
.Platform
== "__WXGTK__":
7284 msg
="Unable to access the X Display, is $DISPLAY set properly?"
7287 msg
= "Unable to create GUI"
7288 # TODO: more description is needed for wxMSW...
7290 raise SystemExit(msg
)
7292 # This has to be done before OnInit
7293 self
.SetUseBestVisual(useBestVisual
)
7295 # Set the default handler for SIGINT. This fixes a problem
7296 # where if Ctrl-C is pressed in the console that started this
7297 # app then it will not appear to do anything, (not even send
7298 # KeyboardInterrupt???) but will later segfault on exit. By
7299 # setting the default handler then the app will exit, as
7300 # expected (depending on platform.)
7304 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7308 # Save and redirect the stdio to a window?
7309 self
.stdioWin
= None
7310 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7312 self
.RedirectStdio(filename
)
7314 # Use Python's install prefix as the default
7315 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7317 # This finishes the initialization of wxWindows and then calls
7318 # the OnInit that should be present in the derived class
7319 self
._BootstrapApp
()
7322 def OnPreInit(self
):
7324 Things that must be done after _BootstrapApp has done its
7325 thing, but would be nice if they were already done by the time
7326 that OnInit is called.
7328 wx
.StockGDI
._initStockObjects
()
7331 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7332 self
.RestoreStdio() # Just in case the MainLoop was overridden
7336 wx
.PyApp
.Destroy(self
)
7339 def SetTopWindow(self
, frame
):
7340 """Set the \"main\" top level window"""
7342 self
.stdioWin
.SetParent(frame
)
7343 wx
.PyApp
.SetTopWindow(self
, frame
)
7347 """Execute the main GUI event loop"""
7348 wx
.PyApp
.MainLoop(self
)
7352 def RedirectStdio(self
, filename
=None):
7353 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7355 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7357 self
.stdioWin
= self
.outputWindowClass()
7358 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7361 def RestoreStdio(self
):
7363 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7368 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7370 Set the title, position and/or size of the output window if
7371 the stdio has been redirected. This should be called before
7372 any output would cause the output window to be created.
7375 if title
is not None:
7376 self
.stdioWin
.title
= title
7378 self
.stdioWin
.pos
= pos
7379 if size
is not None:
7380 self
.stdioWin
.size
= size
7385 # change from wx.PyApp_XX to wx.App_XX
7386 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7387 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7388 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7389 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7390 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7391 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7392 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7393 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7394 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7395 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7396 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7398 #----------------------------------------------------------------------------
7400 class PySimpleApp(wx
.App
):
7402 A simple application class. You can just create one of these and
7403 then then make your top level windows later, and not have to worry
7404 about OnInit. For example::
7406 app = wx.PySimpleApp()
7407 frame = wx.Frame(None, title='Hello World')
7414 def __init__(self
, redirect
=False, filename
=None,
7415 useBestVisual
=False, clearSigInt
=True):
7417 :see: `wx.App.__init__`
7419 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7426 # Is anybody using this one?
7427 class PyWidgetTester(wx
.App
):
7428 def __init__(self
, size
= (250, 100)):
7430 wx
.App
.__init
__(self
, 0)
7433 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7434 self
.SetTopWindow(self
.frame
)
7437 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7438 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7439 self
.frame
.Show(True)
7441 #----------------------------------------------------------------------------
7442 # DO NOT hold any other references to this object. This is how we
7443 # know when to cleanup system resources that wxWidgets is holding. When
7444 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7445 # goes to zero and it calls the wx.App_CleanUp function.
7447 class __wxPyCleanup
:
7449 self
.cleanup
= _core_
.App_CleanUp
7453 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7455 ## # another possible solution, but it gets called too early...
7457 ## atexit.register(_core_.wxApp_CleanUp)
7460 #----------------------------------------------------------------------------
7462 #---------------------------------------------------------------------------
7464 class EventLoop(object):
7465 """Proxy of C++ EventLoop class"""
7466 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7467 __repr__
= _swig_repr
7468 def __init__(self
, *args
, **kwargs
):
7469 """__init__(self) -> EventLoop"""
7470 _core_
.EventLoop_swiginit(self
,_core_
.new_EventLoop(*args
, **kwargs
))
7471 __swig_destroy__
= _core_
.delete_EventLoop
7472 __del__
= lambda self
: None;
7473 def Run(*args
, **kwargs
):
7474 """Run(self) -> int"""
7475 return _core_
.EventLoop_Run(*args
, **kwargs
)
7477 def Exit(*args
, **kwargs
):
7478 """Exit(self, int rc=0)"""
7479 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7481 def Pending(*args
, **kwargs
):
7482 """Pending(self) -> bool"""
7483 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7485 def Dispatch(*args
, **kwargs
):
7486 """Dispatch(self) -> bool"""
7487 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7489 def IsRunning(*args
, **kwargs
):
7490 """IsRunning(self) -> bool"""
7491 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7493 def GetActive(*args
, **kwargs
):
7494 """GetActive() -> EventLoop"""
7495 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7497 GetActive
= staticmethod(GetActive
)
7498 def SetActive(*args
, **kwargs
):
7499 """SetActive(EventLoop loop)"""
7500 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7502 SetActive
= staticmethod(SetActive
)
7503 _core_
.EventLoop_swigregister(EventLoop
)
7505 def EventLoop_GetActive(*args
):
7506 """EventLoop_GetActive() -> EventLoop"""
7507 return _core_
.EventLoop_GetActive(*args
)
7509 def EventLoop_SetActive(*args
, **kwargs
):
7510 """EventLoop_SetActive(EventLoop loop)"""
7511 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7513 class EventLoopActivator(object):
7514 """Proxy of C++ EventLoopActivator class"""
7515 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7516 __repr__
= _swig_repr
7517 def __init__(self
, *args
, **kwargs
):
7518 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7519 _core_
.EventLoopActivator_swiginit(self
,_core_
.new_EventLoopActivator(*args
, **kwargs
))
7520 __swig_destroy__
= _core_
.delete_EventLoopActivator
7521 __del__
= lambda self
: None;
7522 _core_
.EventLoopActivator_swigregister(EventLoopActivator
)
7524 #---------------------------------------------------------------------------
7526 ACCEL_ALT
= _core_
.ACCEL_ALT
7527 ACCEL_CTRL
= _core_
.ACCEL_CTRL
7528 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
7529 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
7530 ACCEL_CMD
= _core_
.ACCEL_CMD
7531 class AcceleratorEntry(object):
7533 A class used to define items in an `wx.AcceleratorTable`. wxPython
7534 programs can choose to use wx.AcceleratorEntry objects, but using a
7535 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7536 as well. See `__init__` for of the tuple values.
7538 :see: `wx.AcceleratorTable`
7540 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7541 __repr__
= _swig_repr
7542 def __init__(self
, *args
, **kwargs
):
7544 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7546 Construct a wx.AcceleratorEntry.
7548 _core_
.AcceleratorEntry_swiginit(self
,_core_
.new_AcceleratorEntry(*args
, **kwargs
))
7549 __swig_destroy__
= _core_
.delete_AcceleratorEntry
7550 __del__
= lambda self
: None;
7551 def Set(*args
, **kwargs
):
7553 Set(self, int flags, int keyCode, int cmd)
7555 (Re)set the attributes of a wx.AcceleratorEntry.
7558 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
7560 def Create(*args
, **kwargs
):
7562 Create(String str) -> AcceleratorEntry
7564 Create accelerator corresponding to the specified string, or None if
7565 it coulnd't be parsed.
7567 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
7569 Create
= staticmethod(Create
)
7570 def GetFlags(*args
, **kwargs
):
7572 GetFlags(self) -> int
7574 Get the AcceleratorEntry's flags.
7576 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
7578 def GetKeyCode(*args
, **kwargs
):
7580 GetKeyCode(self) -> int
7582 Get the AcceleratorEntry's keycode.
7584 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
7586 def GetCommand(*args
, **kwargs
):
7588 GetCommand(self) -> int
7590 Get the AcceleratorEntry's command ID.
7592 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
7594 def IsOk(*args
, **kwargs
):
7595 """IsOk(self) -> bool"""
7596 return _core_
.AcceleratorEntry_IsOk(*args
, **kwargs
)
7598 def ToString(*args
, **kwargs
):
7600 ToString(self) -> String
7602 Returns a string representation for the this accelerator. The string
7603 is formatted using the <flags>-<keycode> format where <flags> maybe a
7604 hyphen-separed list of "shift|alt|ctrl"
7607 return _core_
.AcceleratorEntry_ToString(*args
, **kwargs
)
7609 def FromString(*args
, **kwargs
):
7611 FromString(self, String str) -> bool
7613 Returns true if the given string correctly initialized this object.
7615 return _core_
.AcceleratorEntry_FromString(*args
, **kwargs
)
7617 Command
= property(GetCommand
,doc
="See `GetCommand`")
7618 Flags
= property(GetFlags
,doc
="See `GetFlags`")
7619 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
7620 _core_
.AcceleratorEntry_swigregister(AcceleratorEntry
)
7622 def AcceleratorEntry_Create(*args
, **kwargs
):
7624 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7626 Create accelerator corresponding to the specified string, or None if
7627 it coulnd't be parsed.
7629 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
7631 class AcceleratorTable(Object
):
7633 An accelerator table allows the application to specify a table of
7634 keyboard shortcuts for menus or other commands. On Windows, menu or
7635 button commands are supported; on GTK, only menu commands are
7638 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7639 __repr__
= _swig_repr
7640 def __init__(self
, *args
, **kwargs
):
7642 __init__(entries) -> AcceleratorTable
7644 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7645 items or or of 3-tuples (flags, keyCode, cmdID)
7647 :see: `wx.AcceleratorEntry`
7649 _core_
.AcceleratorTable_swiginit(self
,_core_
.new_AcceleratorTable(*args
, **kwargs
))
7650 __swig_destroy__
= _core_
.delete_AcceleratorTable
7651 __del__
= lambda self
: None;
7652 def Ok(*args
, **kwargs
):
7653 """Ok(self) -> bool"""
7654 return _core_
.AcceleratorTable_Ok(*args
, **kwargs
)
7656 _core_
.AcceleratorTable_swigregister(AcceleratorTable
)
7659 def GetAccelFromString(*args
, **kwargs
):
7660 """GetAccelFromString(String label) -> AcceleratorEntry"""
7661 return _core_
.GetAccelFromString(*args
, **kwargs
)
7662 #---------------------------------------------------------------------------
7664 class VisualAttributes(object):
7665 """struct containing all the visual attributes of a control"""
7666 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7667 __repr__
= _swig_repr
7668 def __init__(self
, *args
, **kwargs
):
7670 __init__(self) -> VisualAttributes
7672 struct containing all the visual attributes of a control
7674 _core_
.VisualAttributes_swiginit(self
,_core_
.new_VisualAttributes(*args
, **kwargs
))
7675 __swig_destroy__
= _core_
.delete_VisualAttributes
7676 __del__
= lambda self
: None;
7677 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
7678 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
7679 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
7680 _core_
.VisualAttributes_swigregister(VisualAttributes
)
7681 NullAcceleratorTable
= cvar
.NullAcceleratorTable
7682 PanelNameStr
= cvar
.PanelNameStr
7684 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
7685 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
7686 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
7687 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
7688 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
7689 class Window(EvtHandler
):
7691 wx.Window is the base class for all windows and represents any visible
7692 object on the screen. All controls, top level windows and so on are
7693 wx.Windows. Sizers and device contexts are not however, as they don't
7694 appear on screen themselves.
7697 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7698 __repr__
= _swig_repr
7699 def __init__(self
, *args
, **kwargs
):
7701 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7702 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7704 Construct and show a generic Window.
7706 _core_
.Window_swiginit(self
,_core_
.new_Window(*args
, **kwargs
))
7707 self
._setOORInfo
(self
)
7709 def Create(*args
, **kwargs
):
7711 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7712 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7714 Create the GUI part of the Window for 2-phase creation mode.
7716 return _core_
.Window_Create(*args
, **kwargs
)
7718 def Close(*args
, **kwargs
):
7720 Close(self, bool force=False) -> bool
7722 This function simply generates a EVT_CLOSE event whose handler usually
7723 tries to close the window. It doesn't close the window itself,
7724 however. If force is False (the default) then the window's close
7725 handler will be allowed to veto the destruction of the window.
7727 return _core_
.Window_Close(*args
, **kwargs
)
7729 def Destroy(*args
, **kwargs
):
7731 Destroy(self) -> bool
7733 Destroys the window safely. Frames and dialogs are not destroyed
7734 immediately when this function is called -- they are added to a list
7735 of windows to be deleted on idle time, when all the window's events
7736 have been processed. This prevents problems with events being sent to
7737 non-existent windows.
7739 Returns True if the window has either been successfully deleted, or it
7740 has been added to the list of windows pending real deletion.
7742 val
= _core_
.Window_Destroy(*args
, **kwargs
)
7746 def DestroyChildren(*args
, **kwargs
):
7748 DestroyChildren(self) -> bool
7750 Destroys all children of a window. Called automatically by the
7753 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
7755 def IsBeingDeleted(*args
, **kwargs
):
7757 IsBeingDeleted(self) -> bool
7759 Is the window in the process of being deleted?
7761 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
7763 def SetLabel(*args
, **kwargs
):
7765 SetLabel(self, String label)
7767 Set the text which the window shows in its label if applicable.
7769 return _core_
.Window_SetLabel(*args
, **kwargs
)
7771 def GetLabel(*args
, **kwargs
):
7773 GetLabel(self) -> String
7775 Generic way of getting a label from any window, for identification
7776 purposes. The interpretation of this function differs from class to
7777 class. For frames and dialogs, the value returned is the title. For
7778 buttons or static text controls, it is the button text. This function
7779 can be useful for meta-programs such as testing tools or special-needs
7780 access programs)which need to identify windows by name.
7782 return _core_
.Window_GetLabel(*args
, **kwargs
)
7784 def SetName(*args
, **kwargs
):
7786 SetName(self, String name)
7788 Sets the window's name. The window name is used for ressource setting
7789 in X, it is not the same as the window title/label
7791 return _core_
.Window_SetName(*args
, **kwargs
)
7793 def GetName(*args
, **kwargs
):
7795 GetName(self) -> String
7797 Returns the windows name. This name is not guaranteed to be unique;
7798 it is up to the programmer to supply an appropriate name in the window
7799 constructor or via wx.Window.SetName.
7801 return _core_
.Window_GetName(*args
, **kwargs
)
7803 def SetWindowVariant(*args
, **kwargs
):
7805 SetWindowVariant(self, int variant)
7807 Sets the variant of the window/font size to use for this window, if
7808 the platform supports variants, for example, wxMac.
7810 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
7812 def GetWindowVariant(*args
, **kwargs
):
7813 """GetWindowVariant(self) -> int"""
7814 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
7816 def SetId(*args
, **kwargs
):
7818 SetId(self, int winid)
7820 Sets the identifier of the window. Each window has an integer
7821 identifier. If the application has not provided one, an identifier
7822 will be generated. Normally, the identifier should be provided on
7823 creation and should not be modified subsequently.
7825 return _core_
.Window_SetId(*args
, **kwargs
)
7827 def GetId(*args
, **kwargs
):
7831 Returns the identifier of the window. Each window has an integer
7832 identifier. If the application has not provided one (or the default Id
7833 -1 is used) then an unique identifier with a negative value will be
7836 return _core_
.Window_GetId(*args
, **kwargs
)
7838 def NewControlId(*args
, **kwargs
):
7840 NewControlId() -> int
7842 Generate a control id for the controls which were not given one.
7844 return _core_
.Window_NewControlId(*args
, **kwargs
)
7846 NewControlId
= staticmethod(NewControlId
)
7847 def NextControlId(*args
, **kwargs
):
7849 NextControlId(int winid) -> int
7851 Get the id of the control following the one with the given
7854 return _core_
.Window_NextControlId(*args
, **kwargs
)
7856 NextControlId
= staticmethod(NextControlId
)
7857 def PrevControlId(*args
, **kwargs
):
7859 PrevControlId(int winid) -> int
7861 Get the id of the control preceding the one with the given
7864 return _core_
.Window_PrevControlId(*args
, **kwargs
)
7866 PrevControlId
= staticmethod(PrevControlId
)
7867 def GetLayoutDirection(*args
, **kwargs
):
7869 GetLayoutDirection(self) -> wxLayoutDirection
7871 Get the layout direction (LTR or RTL) for this window. Returns
7872 ``wx.Layout_Default`` if layout direction is not supported.
7874 return _core_
.Window_GetLayoutDirection(*args
, **kwargs
)
7876 def SetLayoutDirection(*args
, **kwargs
):
7878 SetLayoutDirection(self, wxLayoutDirection dir)
7880 Set the layout direction (LTR or RTL) for this window.
7882 return _core_
.Window_SetLayoutDirection(*args
, **kwargs
)
7884 def AdjustForLayoutDirection(*args
, **kwargs
):
7886 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
7888 Mirror coordinates for RTL layout if this window uses it and if the
7889 mirroring is not done automatically like Win32.
7891 return _core_
.Window_AdjustForLayoutDirection(*args
, **kwargs
)
7893 def SetSize(*args
, **kwargs
):
7895 SetSize(self, Size size)
7897 Sets the size of the window in pixels.
7899 return _core_
.Window_SetSize(*args
, **kwargs
)
7901 def SetDimensions(*args
, **kwargs
):
7903 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7905 Sets the position and size of the window in pixels. The sizeFlags
7906 parameter indicates the interpretation of the other params if they are
7909 ======================== ======================================
7910 wx.SIZE_AUTO A -1 indicates that a class-specific
7911 default should be used.
7912 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7913 -1 values are supplied.
7914 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7915 interpreted as real dimensions, not
7917 ======================== ======================================
7920 return _core_
.Window_SetDimensions(*args
, **kwargs
)
7922 def SetRect(*args
, **kwargs
):
7924 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7926 Sets the position and size of the window in pixels using a wx.Rect.
7928 return _core_
.Window_SetRect(*args
, **kwargs
)
7930 def SetSizeWH(*args
, **kwargs
):
7932 SetSizeWH(self, int width, int height)
7934 Sets the size of the window in pixels.
7936 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
7938 def Move(*args
, **kwargs
):
7940 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7942 Moves the window to the given position.
7944 return _core_
.Window_Move(*args
, **kwargs
)
7947 def MoveXY(*args
, **kwargs
):
7949 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7951 Moves the window to the given position.
7953 return _core_
.Window_MoveXY(*args
, **kwargs
)
7955 def SetBestFittingSize(*args
, **kwargs
):
7957 SetBestFittingSize(self, Size size=DefaultSize)
7959 A 'Smart' SetSize that will fill in default size components with the
7960 window's *best size* values. Also set's the minsize for use with sizers.
7962 return _core_
.Window_SetBestFittingSize(*args
, **kwargs
)
7964 def Raise(*args
, **kwargs
):
7968 Raises the window to the top of the window hierarchy. In current
7969 version of wxWidgets this works both for manage and child windows.
7971 return _core_
.Window_Raise(*args
, **kwargs
)
7973 def Lower(*args
, **kwargs
):
7977 Lowers the window to the bottom of the window hierarchy. In current
7978 version of wxWidgets this works both for manage and child windows.
7980 return _core_
.Window_Lower(*args
, **kwargs
)
7982 def SetClientSize(*args
, **kwargs
):
7984 SetClientSize(self, Size size)
7986 This sets the size of the window client area in pixels. Using this
7987 function to size a window tends to be more device-independent than
7988 wx.Window.SetSize, since the application need not worry about what
7989 dimensions the border or title bar have when trying to fit the window
7990 around panel items, for example.
7992 return _core_
.Window_SetClientSize(*args
, **kwargs
)
7994 def SetClientSizeWH(*args
, **kwargs
):
7996 SetClientSizeWH(self, int width, int height)
7998 This sets the size of the window client area in pixels. Using this
7999 function to size a window tends to be more device-independent than
8000 wx.Window.SetSize, since the application need not worry about what
8001 dimensions the border or title bar have when trying to fit the window
8002 around panel items, for example.
8004 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
8006 def SetClientRect(*args
, **kwargs
):
8008 SetClientRect(self, Rect rect)
8010 This sets the size of the window client area in pixels. Using this
8011 function to size a window tends to be more device-independent than
8012 wx.Window.SetSize, since the application need not worry about what
8013 dimensions the border or title bar have when trying to fit the window
8014 around panel items, for example.
8016 return _core_
.Window_SetClientRect(*args
, **kwargs
)
8018 def GetPosition(*args
, **kwargs
):
8020 GetPosition(self) -> Point
8022 Get the window's position. Notice that the position is in client
8023 coordinates for child windows and screen coordinates for the top level
8024 ones, use `GetScreenPosition` if you need screen coordinates for all
8027 return _core_
.Window_GetPosition(*args
, **kwargs
)
8029 def GetPositionTuple(*args
, **kwargs
):
8031 GetPositionTuple() -> (x,y)
8033 Get the window's position. Notice that the position is in client
8034 coordinates for child windows and screen coordinates for the top level
8035 ones, use `GetScreenPosition` if you need screen coordinates for all
8038 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
8040 def GetScreenPosition(*args
, **kwargs
):
8042 GetScreenPosition(self) -> Point
8044 Get the position of the window in screen coordinantes.
8046 return _core_
.Window_GetScreenPosition(*args
, **kwargs
)
8048 def GetScreenPositionTuple(*args
, **kwargs
):
8050 GetScreenPositionTuple() -> (x,y)
8052 Get the position of the window in screen coordinantes.
8054 return _core_
.Window_GetScreenPositionTuple(*args
, **kwargs
)
8056 def GetScreenRect(*args
, **kwargs
):
8058 GetScreenRect(self) -> Rect
8060 Returns the size and position of the window in screen coordinantes as
8063 return _core_
.Window_GetScreenRect(*args
, **kwargs
)
8065 def GetSize(*args
, **kwargs
):
8067 GetSize(self) -> Size
8069 Get the window size.
8071 return _core_
.Window_GetSize(*args
, **kwargs
)
8073 def GetSizeTuple(*args
, **kwargs
):
8075 GetSizeTuple() -> (width, height)
8077 Get the window size.
8079 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
8081 def GetRect(*args
, **kwargs
):
8083 GetRect(self) -> Rect
8085 Returns the size and position of the window as a `wx.Rect` object.
8087 return _core_
.Window_GetRect(*args
, **kwargs
)
8089 def GetClientSize(*args
, **kwargs
):
8091 GetClientSize(self) -> Size
8093 This gets the size of the window's 'client area' in pixels. The client
8094 area is the area which may be drawn on by the programmer, excluding
8095 title bar, border, scrollbars, etc.
8097 return _core_
.Window_GetClientSize(*args
, **kwargs
)
8099 def GetClientSizeTuple(*args
, **kwargs
):
8101 GetClientSizeTuple() -> (width, height)
8103 This gets the size of the window's 'client area' in pixels. The client
8104 area is the area which may be drawn on by the programmer, excluding
8105 title bar, border, scrollbars, etc.
8107 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
8109 def GetClientAreaOrigin(*args
, **kwargs
):
8111 GetClientAreaOrigin(self) -> Point
8113 Get the origin of the client area of the window relative to the
8114 window's top left corner (the client area may be shifted because of
8115 the borders, scrollbars, other decorations...)
8117 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
8119 def GetClientRect(*args
, **kwargs
):
8121 GetClientRect(self) -> Rect
8123 Get the client area position and size as a `wx.Rect` object.
8125 return _core_
.Window_GetClientRect(*args
, **kwargs
)
8127 def GetBestSize(*args
, **kwargs
):
8129 GetBestSize(self) -> Size
8131 This function returns the best acceptable minimal size for the
8132 window, if applicable. For example, for a static text control, it will
8133 be the minimal size such that the control label is not truncated. For
8134 windows containing subwindows (suzh aswx.Panel), the size returned by
8135 this function will be the same as the size the window would have had
8138 return _core_
.Window_GetBestSize(*args
, **kwargs
)
8140 def GetBestSizeTuple(*args
, **kwargs
):
8142 GetBestSizeTuple() -> (width, height)
8144 This function returns the best acceptable minimal size for the
8145 window, if applicable. For example, for a static text control, it will
8146 be the minimal size such that the control label is not truncated. For
8147 windows containing subwindows (suzh aswx.Panel), the size returned by
8148 this function will be the same as the size the window would have had
8151 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
8153 def InvalidateBestSize(*args
, **kwargs
):
8155 InvalidateBestSize(self)
8157 Reset the cached best size value so it will be recalculated the next
8160 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
8162 def CacheBestSize(*args
, **kwargs
):
8164 CacheBestSize(self, Size size)
8166 Cache the best size so it doesn't need to be calculated again, (at least until
8167 some properties of the window change.)
8169 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
8171 def GetBestFittingSize(*args
, **kwargs
):
8173 GetBestFittingSize(self) -> Size
8175 This function will merge the window's best size into the window's
8176 minimum size, giving priority to the min size components, and returns
8180 return _core_
.Window_GetBestFittingSize(*args
, **kwargs
)
8182 def GetAdjustedBestSize(*args
, **kwargs
):
8184 GetAdjustedBestSize(self) -> Size
8186 This method is similar to GetBestSize, except in one
8187 thing. GetBestSize should return the minimum untruncated size of the
8188 window, while this method will return the largest of BestSize and any
8189 user specified minimum size. ie. it is the minimum size the window
8190 should currently be drawn at, not the minimal size it can possibly
8193 return _core_
.Window_GetAdjustedBestSize(*args
, **kwargs
)
8195 def Center(*args
, **kwargs
):
8197 Center(self, int direction=BOTH)
8199 Centers the window. The parameter specifies the direction for
8200 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8201 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8202 on the entire screen and not on its parent window. If it is a
8203 top-level window and has no parent then it will always be centered
8204 relative to the screen.
8206 return _core_
.Window_Center(*args
, **kwargs
)
8209 def CenterOnParent(*args
, **kwargs
):
8211 CenterOnParent(self, int dir=BOTH)
8213 Center with respect to the the parent window
8215 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
8217 CentreOnParent
= CenterOnParent
8218 def Fit(*args
, **kwargs
):
8222 Sizes the window so that it fits around its subwindows. This function
8223 won't do anything if there are no subwindows and will only really work
8224 correctly if sizers are used for the subwindows layout. Also, if the
8225 window has exactly one subwindow it is better (faster and the result
8226 is more precise as Fit adds some margin to account for fuzziness of
8227 its calculations) to call window.SetClientSize(child.GetSize())
8228 instead of calling Fit.
8230 return _core_
.Window_Fit(*args
, **kwargs
)
8232 def FitInside(*args
, **kwargs
):
8236 Similar to Fit, but sizes the interior (virtual) size of a
8237 window. Mainly useful with scrolled windows to reset scrollbars after
8238 sizing changes that do not trigger a size event, and/or scrolled
8239 windows without an interior sizer. This function similarly won't do
8240 anything if there are no subwindows.
8242 return _core_
.Window_FitInside(*args
, **kwargs
)
8244 def SetSizeHints(*args
, **kwargs
):
8246 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8249 Allows specification of minimum and maximum window sizes, and window
8250 size increments. If a pair of values is not set (or set to -1), the
8251 default values will be used. If this function is called, the user
8252 will not be able to size the window outside the given bounds (if it is
8253 a top-level window.) Sizers will also inspect the minimum window size
8254 and will use that value if set when calculating layout.
8256 The resizing increments are only significant under Motif or Xt.
8258 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
8260 def SetSizeHintsSz(*args
, **kwargs
):
8262 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8264 Allows specification of minimum and maximum window sizes, and window
8265 size increments. If a pair of values is not set (or set to -1), the
8266 default values will be used. If this function is called, the user
8267 will not be able to size the window outside the given bounds (if it is
8268 a top-level window.) Sizers will also inspect the minimum window size
8269 and will use that value if set when calculating layout.
8271 The resizing increments are only significant under Motif or Xt.
8273 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
8275 def SetVirtualSizeHints(*args
, **kwargs
):
8277 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8279 Allows specification of minimum and maximum virtual window sizes. If a
8280 pair of values is not set (or set to -1), the default values will be
8281 used. If this function is called, the user will not be able to size
8282 the virtual area of the window outside the given bounds.
8284 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
8286 def SetVirtualSizeHintsSz(*args
, **kwargs
):
8288 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8290 Allows specification of minimum and maximum virtual window sizes. If a
8291 pair of values is not set (or set to -1), the default values will be
8292 used. If this function is called, the user will not be able to size
8293 the virtual area of the window outside the given bounds.
8295 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
8297 def GetMaxSize(*args
, **kwargs
):
8298 """GetMaxSize(self) -> Size"""
8299 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8301 def GetMinSize(*args
, **kwargs
):
8302 """GetMinSize(self) -> Size"""
8303 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8305 def SetMinSize(*args
, **kwargs
):
8307 SetMinSize(self, Size minSize)
8309 A more convenient method than `SetSizeHints` for setting just the
8312 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8314 def SetMaxSize(*args
, **kwargs
):
8316 SetMaxSize(self, Size maxSize)
8318 A more convenient method than `SetSizeHints` for setting just the
8321 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8323 def GetMinWidth(*args
, **kwargs
):
8324 """GetMinWidth(self) -> int"""
8325 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8327 def GetMinHeight(*args
, **kwargs
):
8328 """GetMinHeight(self) -> int"""
8329 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8331 def GetMaxWidth(*args
, **kwargs
):
8332 """GetMaxWidth(self) -> int"""
8333 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8335 def GetMaxHeight(*args
, **kwargs
):
8336 """GetMaxHeight(self) -> int"""
8337 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8339 def SetVirtualSize(*args
, **kwargs
):
8341 SetVirtualSize(self, Size size)
8343 Set the the virtual size of a window in pixels. For most windows this
8344 is just the client area of the window, but for some like scrolled
8345 windows it is more or less independent of the screen window size.
8347 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8349 def SetVirtualSizeWH(*args
, **kwargs
):
8351 SetVirtualSizeWH(self, int w, int h)
8353 Set the the virtual size of a window in pixels. For most windows this
8354 is just the client area of the window, but for some like scrolled
8355 windows it is more or less independent of the screen window size.
8357 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8359 def GetVirtualSize(*args
, **kwargs
):
8361 GetVirtualSize(self) -> Size
8363 Get the the virtual size of the window in pixels. For most windows
8364 this is just the client area of the window, but for some like scrolled
8365 windows it is more or less independent of the screen window size.
8367 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8369 def GetVirtualSizeTuple(*args
, **kwargs
):
8371 GetVirtualSizeTuple() -> (width, height)
8373 Get the the virtual size of the window in pixels. For most windows
8374 this is just the client area of the window, but for some like scrolled
8375 windows it is more or less independent of the screen window size.
8377 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8379 def GetBestVirtualSize(*args
, **kwargs
):
8381 GetBestVirtualSize(self) -> Size
8383 Return the largest of ClientSize and BestSize (as determined by a
8384 sizer, interior children, or other means)
8386 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8388 def Show(*args
, **kwargs
):
8390 Show(self, bool show=True) -> bool
8392 Shows or hides the window. You may need to call Raise for a top level
8393 window if you want to bring it to top, although this is not needed if
8394 Show is called immediately after the frame creation. Returns True if
8395 the window has been shown or hidden or False if nothing was done
8396 because it already was in the requested state.
8398 return _core_
.Window_Show(*args
, **kwargs
)
8400 def Hide(*args
, **kwargs
):
8404 Equivalent to calling Show(False).
8406 return _core_
.Window_Hide(*args
, **kwargs
)
8408 def Enable(*args
, **kwargs
):
8410 Enable(self, bool enable=True) -> bool
8412 Enable or disable the window for user input. Note that when a parent
8413 window is disabled, all of its children are disabled as well and they
8414 are reenabled again when the parent is. Returns true if the window
8415 has been enabled or disabled, false if nothing was done, i.e. if the
8416 window had already been in the specified state.
8418 return _core_
.Window_Enable(*args
, **kwargs
)
8420 def Disable(*args
, **kwargs
):
8422 Disable(self) -> bool
8424 Disables the window, same as Enable(false).
8426 return _core_
.Window_Disable(*args
, **kwargs
)
8428 def IsShown(*args
, **kwargs
):
8430 IsShown(self) -> bool
8432 Returns true if the window is shown, false if it has been hidden.
8434 return _core_
.Window_IsShown(*args
, **kwargs
)
8436 def IsEnabled(*args
, **kwargs
):
8438 IsEnabled(self) -> bool
8440 Returns true if the window is enabled for input, false otherwise.
8442 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8444 def SetWindowStyleFlag(*args
, **kwargs
):
8446 SetWindowStyleFlag(self, long style)
8448 Sets the style of the window. Please note that some styles cannot be
8449 changed after the window creation and that Refresh() might need to be
8450 called after changing the others for the change to take place
8453 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8455 def GetWindowStyleFlag(*args
, **kwargs
):
8457 GetWindowStyleFlag(self) -> long
8459 Gets the window style that was passed to the constructor or Create
8462 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8464 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8465 def HasFlag(*args
, **kwargs
):
8467 HasFlag(self, int flag) -> bool
8469 Test if the given style is set for this window.
8471 return _core_
.Window_HasFlag(*args
, **kwargs
)
8473 def IsRetained(*args
, **kwargs
):
8475 IsRetained(self) -> bool
8477 Returns true if the window is retained, false otherwise. Retained
8478 windows are only available on X platforms.
8480 return _core_
.Window_IsRetained(*args
, **kwargs
)
8482 def SetExtraStyle(*args
, **kwargs
):
8484 SetExtraStyle(self, long exStyle)
8486 Sets the extra style bits for the window. Extra styles are the less
8487 often used style bits which can't be set with the constructor or with
8488 SetWindowStyleFlag()
8490 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8492 def GetExtraStyle(*args
, **kwargs
):
8494 GetExtraStyle(self) -> long
8496 Returns the extra style bits for the window.
8498 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
8500 def MakeModal(*args
, **kwargs
):
8502 MakeModal(self, bool modal=True)
8504 Disables all other windows in the application so that the user can
8505 only interact with this window. Passing False will reverse this
8508 return _core_
.Window_MakeModal(*args
, **kwargs
)
8510 def SetThemeEnabled(*args
, **kwargs
):
8512 SetThemeEnabled(self, bool enableTheme)
8514 This function tells a window if it should use the system's "theme"
8515 code to draw the windows' background instead if its own background
8516 drawing code. This will only have an effect on platforms that support
8517 the notion of themes in user defined windows. One such platform is
8518 GTK+ where windows can have (very colourful) backgrounds defined by a
8519 user's selected theme.
8521 Dialogs, notebook pages and the status bar have this flag set to true
8522 by default so that the default look and feel is simulated best.
8524 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
8526 def GetThemeEnabled(*args
, **kwargs
):
8528 GetThemeEnabled(self) -> bool
8530 Return the themeEnabled flag.
8532 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
8534 def SetFocus(*args
, **kwargs
):
8538 Set's the focus to this window, allowing it to receive keyboard input.
8540 return _core_
.Window_SetFocus(*args
, **kwargs
)
8542 def SetFocusFromKbd(*args
, **kwargs
):
8544 SetFocusFromKbd(self)
8546 Set focus to this window as the result of a keyboard action. Normally
8547 only called internally.
8549 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
8551 def FindFocus(*args
, **kwargs
):
8553 FindFocus() -> Window
8555 Returns the window or control that currently has the keyboard focus,
8558 return _core_
.Window_FindFocus(*args
, **kwargs
)
8560 FindFocus
= staticmethod(FindFocus
)
8561 def AcceptsFocus(*args
, **kwargs
):
8563 AcceptsFocus(self) -> bool
8565 Can this window have focus?
8567 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
8569 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
8571 AcceptsFocusFromKeyboard(self) -> bool
8573 Can this window be given focus by keyboard navigation? if not, the
8574 only way to give it focus (provided it accepts it at all) is to click
8577 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
8579 def Navigate(*args
, **kwargs
):
8581 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8583 Does keyboard navigation from this window to another, by sending a
8584 `wx.NavigationKeyEvent`.
8586 return _core_
.Window_Navigate(*args
, **kwargs
)
8588 def MoveAfterInTabOrder(*args
, **kwargs
):
8590 MoveAfterInTabOrder(self, Window win)
8592 Moves this window in the tab navigation order after the specified
8593 sibling window. This means that when the user presses the TAB key on
8594 that other window, the focus switches to this window.
8596 The default tab order is the same as creation order. This function
8597 and `MoveBeforeInTabOrder` allow to change it after creating all the
8601 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
8603 def MoveBeforeInTabOrder(*args
, **kwargs
):
8605 MoveBeforeInTabOrder(self, Window win)
8607 Same as `MoveAfterInTabOrder` except that it inserts this window just
8608 before win instead of putting it right after it.
8610 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
8612 def GetChildren(*args
, **kwargs
):
8614 GetChildren(self) -> PyObject
8616 Returns a list of the window's children. NOTE: Currently this is a
8617 copy of the child window list maintained by the window, so the return
8618 value of this function is only valid as long as the window's children
8621 return _core_
.Window_GetChildren(*args
, **kwargs
)
8623 def GetParent(*args
, **kwargs
):
8625 GetParent(self) -> Window
8627 Returns the parent window of this window, or None if there isn't one.
8629 return _core_
.Window_GetParent(*args
, **kwargs
)
8631 def GetGrandParent(*args
, **kwargs
):
8633 GetGrandParent(self) -> Window
8635 Returns the parent of the parent of this window, or None if there
8638 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
8640 def IsTopLevel(*args
, **kwargs
):
8642 IsTopLevel(self) -> bool
8644 Returns true if the given window is a top-level one. Currently all
8645 frames and dialogs are always considered to be top-level windows (even
8646 if they have a parent window).
8648 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
8650 def Reparent(*args
, **kwargs
):
8652 Reparent(self, Window newParent) -> bool
8654 Reparents the window, i.e the window will be removed from its current
8655 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8656 re-inserted into another. Available on Windows and GTK. Returns True
8657 if the parent was changed, False otherwise (error or newParent ==
8660 return _core_
.Window_Reparent(*args
, **kwargs
)
8662 def AddChild(*args
, **kwargs
):
8664 AddChild(self, Window child)
8666 Adds a child window. This is called automatically by window creation
8667 functions so should not be required by the application programmer.
8669 return _core_
.Window_AddChild(*args
, **kwargs
)
8671 def RemoveChild(*args
, **kwargs
):
8673 RemoveChild(self, Window child)
8675 Removes a child window. This is called automatically by window
8676 deletion functions so should not be required by the application
8679 return _core_
.Window_RemoveChild(*args
, **kwargs
)
8681 def SetDoubleBuffered(*args
, **kwargs
):
8683 SetDoubleBuffered(self, bool on)
8685 Currently wxGTK2 only.
8687 return _core_
.Window_SetDoubleBuffered(*args
, **kwargs
)
8689 def FindWindowById(*args
, **kwargs
):
8691 FindWindowById(self, long winid) -> Window
8693 Find a chld of this window by window ID
8695 return _core_
.Window_FindWindowById(*args
, **kwargs
)
8697 def FindWindowByName(*args
, **kwargs
):
8699 FindWindowByName(self, String name) -> Window
8701 Find a child of this window by name
8703 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
8705 def GetEventHandler(*args
, **kwargs
):
8707 GetEventHandler(self) -> EvtHandler
8709 Returns the event handler for this window. By default, the window is
8710 its own event handler.
8712 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
8714 def SetEventHandler(*args
, **kwargs
):
8716 SetEventHandler(self, EvtHandler handler)
8718 Sets the event handler for this window. An event handler is an object
8719 that is capable of processing the events sent to a window. By default,
8720 the window is its own event handler, but an application may wish to
8721 substitute another, for example to allow central implementation of
8722 event-handling for a variety of different window classes.
8724 It is usually better to use `wx.Window.PushEventHandler` since this sets
8725 up a chain of event handlers, where an event not handled by one event
8726 handler is handed to the next one in the chain.
8728 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
8730 def PushEventHandler(*args
, **kwargs
):
8732 PushEventHandler(self, EvtHandler handler)
8734 Pushes this event handler onto the event handler stack for the window.
8735 An event handler is an object that is capable of processing the events
8736 sent to a window. By default, the window is its own event handler, but
8737 an application may wish to substitute another, for example to allow
8738 central implementation of event-handling for a variety of different
8741 wx.Window.PushEventHandler allows an application to set up a chain of
8742 event handlers, where an event not handled by one event handler is
8743 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8744 remove the event handler.
8746 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
8748 def PopEventHandler(*args
, **kwargs
):
8750 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8752 Removes and returns the top-most event handler on the event handler
8753 stack. If deleteHandler is True then the wx.EvtHandler object will be
8754 destroyed after it is popped.
8756 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
8758 def RemoveEventHandler(*args
, **kwargs
):
8760 RemoveEventHandler(self, EvtHandler handler) -> bool
8762 Find the given handler in the event handler chain and remove (but not
8763 delete) it from the event handler chain, return True if it was found
8764 and False otherwise (this also results in an assert failure so this
8765 function should only be called when the handler is supposed to be
8768 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
8770 def SetValidator(*args
, **kwargs
):
8772 SetValidator(self, Validator validator)
8774 Deletes the current validator (if any) and sets the window validator,
8775 having called wx.Validator.Clone to create a new validator of this
8778 return _core_
.Window_SetValidator(*args
, **kwargs
)
8780 def GetValidator(*args
, **kwargs
):
8782 GetValidator(self) -> Validator
8784 Returns a pointer to the current validator for the window, or None if
8787 return _core_
.Window_GetValidator(*args
, **kwargs
)
8789 def Validate(*args
, **kwargs
):
8791 Validate(self) -> bool
8793 Validates the current values of the child controls using their
8794 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8795 style flag set, the method will also call Validate() of all child
8796 windows. Returns false if any of the validations failed.
8798 return _core_
.Window_Validate(*args
, **kwargs
)
8800 def TransferDataToWindow(*args
, **kwargs
):
8802 TransferDataToWindow(self) -> bool
8804 Transfers values to child controls from data areas specified by their
8805 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8806 style flag set, the method will also call TransferDataToWindow() of
8809 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
8811 def TransferDataFromWindow(*args
, **kwargs
):
8813 TransferDataFromWindow(self) -> bool
8815 Transfers values from child controls to data areas specified by their
8816 validators. Returns false if a transfer failed. If the window has
8817 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8818 also call TransferDataFromWindow() of all child windows.
8820 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
8822 def InitDialog(*args
, **kwargs
):
8826 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8827 to the dialog via validators.
8829 return _core_
.Window_InitDialog(*args
, **kwargs
)
8831 def SetAcceleratorTable(*args
, **kwargs
):
8833 SetAcceleratorTable(self, AcceleratorTable accel)
8835 Sets the accelerator table for this window.
8837 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
8839 def GetAcceleratorTable(*args
, **kwargs
):
8841 GetAcceleratorTable(self) -> AcceleratorTable
8843 Gets the accelerator table for this window.
8845 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
8847 def RegisterHotKey(*args
, **kwargs
):
8849 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8851 Registers a system wide hotkey. Every time the user presses the hotkey
8852 registered here, this window will receive a hotkey event. It will
8853 receive the event even if the application is in the background and
8854 does not have the input focus because the user is working with some
8855 other application. To bind an event handler function to this hotkey
8856 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8857 hotkey was registered successfully.
8859 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
8861 def UnregisterHotKey(*args
, **kwargs
):
8863 UnregisterHotKey(self, int hotkeyId) -> bool
8865 Unregisters a system wide hotkey.
8867 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
8869 def ConvertDialogPointToPixels(*args
, **kwargs
):
8871 ConvertDialogPointToPixels(self, Point pt) -> Point
8873 Converts a point or size from dialog units to pixels. Dialog units
8874 are used for maintaining a dialog's proportions even if the font
8875 changes. For the x dimension, the dialog units are multiplied by the
8876 average character width and then divided by 4. For the y dimension,
8877 the dialog units are multiplied by the average character height and
8880 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
8882 def ConvertDialogSizeToPixels(*args
, **kwargs
):
8884 ConvertDialogSizeToPixels(self, Size sz) -> Size
8886 Converts a point or size from dialog units to pixels. Dialog units
8887 are used for maintaining a dialog's proportions even if the font
8888 changes. For the x dimension, the dialog units are multiplied by the
8889 average character width and then divided by 4. For the y dimension,
8890 the dialog units are multiplied by the average character height and
8893 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
8895 def DLG_PNT(*args
, **kwargs
):
8897 DLG_PNT(self, Point pt) -> Point
8899 Converts a point or size from dialog units to pixels. Dialog units
8900 are used for maintaining a dialog's proportions even if the font
8901 changes. For the x dimension, the dialog units are multiplied by the
8902 average character width and then divided by 4. For the y dimension,
8903 the dialog units are multiplied by the average character height and
8906 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
8908 def DLG_SZE(*args
, **kwargs
):
8910 DLG_SZE(self, Size sz) -> Size
8912 Converts a point or size from dialog units to pixels. Dialog units
8913 are used for maintaining a dialog's proportions even if the font
8914 changes. For the x dimension, the dialog units are multiplied by the
8915 average character width and then divided by 4. For the y dimension,
8916 the dialog units are multiplied by the average character height and
8919 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
8921 def ConvertPixelPointToDialog(*args
, **kwargs
):
8922 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8923 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
8925 def ConvertPixelSizeToDialog(*args
, **kwargs
):
8926 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8927 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
8929 def WarpPointer(*args
, **kwargs
):
8931 WarpPointer(self, int x, int y)
8933 Moves the pointer to the given position on the window.
8935 NOTE: This function is not supported under Mac because Apple Human
8936 Interface Guidelines forbid moving the mouse cursor programmatically.
8938 return _core_
.Window_WarpPointer(*args
, **kwargs
)
8940 def CaptureMouse(*args
, **kwargs
):
8944 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8945 release the capture.
8947 Note that wxWindows maintains the stack of windows having captured the
8948 mouse and when the mouse is released the capture returns to the window
8949 which had had captured it previously and it is only really released if
8950 there were no previous window. In particular, this means that you must
8951 release the mouse as many times as you capture it, unless the window
8952 receives the `wx.MouseCaptureLostEvent` event.
8954 Any application which captures the mouse in the beginning of some
8955 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8956 operation when it receives the event. The event handler must not
8959 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
8961 def ReleaseMouse(*args
, **kwargs
):
8965 Releases mouse input captured with wx.Window.CaptureMouse.
8967 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
8969 def GetCapture(*args
, **kwargs
):
8971 GetCapture() -> Window
8973 Returns the window which currently captures the mouse or None
8975 return _core_
.Window_GetCapture(*args
, **kwargs
)
8977 GetCapture
= staticmethod(GetCapture
)
8978 def HasCapture(*args
, **kwargs
):
8980 HasCapture(self) -> bool
8982 Returns true if this window has the current mouse capture.
8984 return _core_
.Window_HasCapture(*args
, **kwargs
)
8986 def Refresh(*args
, **kwargs
):
8988 Refresh(self, bool eraseBackground=True, Rect rect=None)
8990 Mark the specified rectangle (or the whole window) as "dirty" so it
8991 will be repainted. Causes an EVT_PAINT event to be generated and sent
8994 return _core_
.Window_Refresh(*args
, **kwargs
)
8996 def RefreshRect(*args
, **kwargs
):
8998 RefreshRect(self, Rect rect, bool eraseBackground=True)
9000 Redraws the contents of the given rectangle: the area inside it will
9001 be repainted. This is the same as Refresh but has a nicer syntax.
9003 return _core_
.Window_RefreshRect(*args
, **kwargs
)
9005 def Update(*args
, **kwargs
):
9009 Calling this method immediately repaints the invalidated area of the
9010 window instead of waiting for the EVT_PAINT event to happen, (normally
9011 this would usually only happen when the flow of control returns to the
9012 event loop.) Notice that this function doesn't refresh the window and
9013 does nothing if the window has been already repainted. Use Refresh
9014 first if you want to immediately redraw the window (or some portion of
9015 it) unconditionally.
9017 return _core_
.Window_Update(*args
, **kwargs
)
9019 def ClearBackground(*args
, **kwargs
):
9021 ClearBackground(self)
9023 Clears the window by filling it with the current background
9024 colour. Does not cause an erase background event to be generated.
9026 return _core_
.Window_ClearBackground(*args
, **kwargs
)
9028 def Freeze(*args
, **kwargs
):
9032 Freezes the window or, in other words, prevents any updates from
9033 taking place on screen, the window is not redrawn at all. Thaw must be
9034 called to reenable window redrawing. Calls to Freeze/Thaw may be
9035 nested, with the actual Thaw being delayed until all the nesting has
9038 This method is useful for visual appearance optimization (for example,
9039 it is a good idea to use it before inserting large amount of text into
9040 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9041 for all controls so it is mostly just a hint to wxWindows and not a
9042 mandatory directive.
9044 return _core_
.Window_Freeze(*args
, **kwargs
)
9046 def Thaw(*args
, **kwargs
):
9050 Reenables window updating after a previous call to Freeze. Calls to
9051 Freeze/Thaw may be nested, so Thaw must be called the same number of
9052 times that Freeze was before the window will be updated.
9054 return _core_
.Window_Thaw(*args
, **kwargs
)
9056 def PrepareDC(*args
, **kwargs
):
9058 PrepareDC(self, DC dc)
9060 Call this function to prepare the device context for drawing a
9061 scrolled image. It sets the device origin according to the current
9064 return _core_
.Window_PrepareDC(*args
, **kwargs
)
9066 def GetUpdateRegion(*args
, **kwargs
):
9068 GetUpdateRegion(self) -> Region
9070 Returns the region specifying which parts of the window have been
9071 damaged. Should only be called within an EVT_PAINT handler.
9073 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
9075 def GetUpdateClientRect(*args
, **kwargs
):
9077 GetUpdateClientRect(self) -> Rect
9079 Get the update rectangle region bounding box in client coords.
9081 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
9083 def IsExposed(*args
, **kwargs
):
9085 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9087 Returns true if the given point or rectangle area has been exposed
9088 since the last repaint. Call this in an paint event handler to
9089 optimize redrawing by only redrawing those areas, which have been
9092 return _core_
.Window_IsExposed(*args
, **kwargs
)
9094 def IsExposedPoint(*args
, **kwargs
):
9096 IsExposedPoint(self, Point pt) -> bool
9098 Returns true if the given point or rectangle area has been exposed
9099 since the last repaint. Call this in an paint event handler to
9100 optimize redrawing by only redrawing those areas, which have been
9103 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
9105 def IsExposedRect(*args
, **kwargs
):
9107 IsExposedRect(self, Rect rect) -> bool
9109 Returns true if the given point or rectangle area has been exposed
9110 since the last repaint. Call this in an paint event handler to
9111 optimize redrawing by only redrawing those areas, which have been
9114 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
9116 def GetDefaultAttributes(*args
, **kwargs
):
9118 GetDefaultAttributes(self) -> VisualAttributes
9120 Get the default attributes for an instance of this class. This is
9121 useful if you want to use the same font or colour in your own control
9122 as in a standard control -- which is a much better idea than hard
9123 coding specific colours or fonts which might look completely out of
9124 place on the user's system, especially if it uses themes.
9126 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
9128 def GetClassDefaultAttributes(*args
, **kwargs
):
9130 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9132 Get the default attributes for this class. This is useful if you want
9133 to use the same font or colour in your own control as in a standard
9134 control -- which is a much better idea than hard coding specific
9135 colours or fonts which might look completely out of place on the
9136 user's system, especially if it uses themes.
9138 The variant parameter is only relevant under Mac currently and is
9139 ignore under other platforms. Under Mac, it will change the size of
9140 the returned font. See `wx.Window.SetWindowVariant` for more about
9143 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9145 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
9146 def SetBackgroundColour(*args
, **kwargs
):
9148 SetBackgroundColour(self, Colour colour) -> bool
9150 Sets the background colour of the window. Returns True if the colour
9151 was changed. The background colour is usually painted by the default
9152 EVT_ERASE_BACKGROUND event handler function under Windows and
9153 automatically under GTK. Using `wx.NullColour` will reset the window
9154 to the default background colour.
9156 Note that setting the background colour may not cause an immediate
9157 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9158 calling this function.
9160 Using this function will disable attempts to use themes for this
9161 window, if the system supports them. Use with care since usually the
9162 themes represent the appearance chosen by the user to be used for all
9163 applications on the system.
9165 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
9167 def SetOwnBackgroundColour(*args
, **kwargs
):
9168 """SetOwnBackgroundColour(self, Colour colour)"""
9169 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
9171 def SetForegroundColour(*args
, **kwargs
):
9173 SetForegroundColour(self, Colour colour) -> bool
9175 Sets the foreground colour of the window. Returns True is the colour
9176 was changed. The interpretation of foreground colour is dependent on
9177 the window class; it may be the text colour or other colour, or it may
9180 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
9182 def SetOwnForegroundColour(*args
, **kwargs
):
9183 """SetOwnForegroundColour(self, Colour colour)"""
9184 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
9186 def GetBackgroundColour(*args
, **kwargs
):
9188 GetBackgroundColour(self) -> Colour
9190 Returns the background colour of the window.
9192 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
9194 def GetForegroundColour(*args
, **kwargs
):
9196 GetForegroundColour(self) -> Colour
9198 Returns the foreground colour of the window. The interpretation of
9199 foreground colour is dependent on the window class; it may be the text
9200 colour or other colour, or it may not be used at all.
9202 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
9204 def InheritsBackgroundColour(*args
, **kwargs
):
9205 """InheritsBackgroundColour(self) -> bool"""
9206 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
9208 def UseBgCol(*args
, **kwargs
):
9209 """UseBgCol(self) -> bool"""
9210 return _core_
.Window_UseBgCol(*args
, **kwargs
)
9212 def SetBackgroundStyle(*args
, **kwargs
):
9214 SetBackgroundStyle(self, int style) -> bool
9216 Returns the background style of the window. The background style
9217 indicates how the background of the window is drawn.
9219 ====================== ========================================
9220 wx.BG_STYLE_SYSTEM The background colour or pattern should
9221 be determined by the system
9222 wx.BG_STYLE_COLOUR The background should be a solid colour
9223 wx.BG_STYLE_CUSTOM The background will be implemented by the
9225 ====================== ========================================
9227 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9228 a custom background, such as a tiled bitmap. Currently the style has
9229 no effect on other platforms.
9231 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9233 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
9235 def GetBackgroundStyle(*args
, **kwargs
):
9237 GetBackgroundStyle(self) -> int
9239 Returns the background style of the window.
9241 :see: `SetBackgroundStyle`
9243 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
9245 def HasTransparentBackground(*args
, **kwargs
):
9247 HasTransparentBackground(self) -> bool
9249 Returns True if this window's background is transparent (as, for
9250 example, for `wx.StaticText`) and should show the parent window's
9253 This method is mostly used internally by the library itself and you
9254 normally shouldn't have to call it. You may, however, have to override
9255 it in your custom control classes to ensure that background is painted
9258 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
9260 def SetCursor(*args
, **kwargs
):
9262 SetCursor(self, Cursor cursor) -> bool
9264 Sets the window's cursor. Notice that the window cursor also sets it
9265 for the children of the window implicitly.
9267 The cursor may be wx.NullCursor in which case the window cursor will
9268 be reset back to default.
9270 return _core_
.Window_SetCursor(*args
, **kwargs
)
9272 def GetCursor(*args
, **kwargs
):
9274 GetCursor(self) -> Cursor
9276 Return the cursor associated with this window.
9278 return _core_
.Window_GetCursor(*args
, **kwargs
)
9280 def SetFont(*args
, **kwargs
):
9282 SetFont(self, Font font) -> bool
9284 Sets the font for this window.
9286 return _core_
.Window_SetFont(*args
, **kwargs
)
9288 def SetOwnFont(*args
, **kwargs
):
9289 """SetOwnFont(self, Font font)"""
9290 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9292 def GetFont(*args
, **kwargs
):
9294 GetFont(self) -> Font
9296 Returns the default font used for this window.
9298 return _core_
.Window_GetFont(*args
, **kwargs
)
9300 def SetCaret(*args
, **kwargs
):
9302 SetCaret(self, Caret caret)
9304 Sets the caret associated with the window.
9306 return _core_
.Window_SetCaret(*args
, **kwargs
)
9308 def GetCaret(*args
, **kwargs
):
9310 GetCaret(self) -> Caret
9312 Returns the caret associated with the window.
9314 return _core_
.Window_GetCaret(*args
, **kwargs
)
9316 def GetCharHeight(*args
, **kwargs
):
9318 GetCharHeight(self) -> int
9320 Get the (average) character size for the current font.
9322 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9324 def GetCharWidth(*args
, **kwargs
):
9326 GetCharWidth(self) -> int
9328 Get the (average) character size for the current font.
9330 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9332 def GetTextExtent(*args
, **kwargs
):
9334 GetTextExtent(String string) -> (width, height)
9336 Get the width and height of the text using the current font.
9338 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9340 def GetFullTextExtent(*args
, **kwargs
):
9342 GetFullTextExtent(String string, Font font=None) ->
9343 (width, height, descent, externalLeading)
9345 Get the width, height, decent and leading of the text using the
9346 current or specified font.
9348 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9350 def ClientToScreenXY(*args
, **kwargs
):
9352 ClientToScreenXY(int x, int y) -> (x,y)
9354 Converts to screen coordinates from coordinates relative to this window.
9356 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9358 def ScreenToClientXY(*args
, **kwargs
):
9360 ScreenToClientXY(int x, int y) -> (x,y)
9362 Converts from screen to client window coordinates.
9364 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9366 def ClientToScreen(*args
, **kwargs
):
9368 ClientToScreen(self, Point pt) -> Point
9370 Converts to screen coordinates from coordinates relative to this window.
9372 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9374 def ScreenToClient(*args
, **kwargs
):
9376 ScreenToClient(self, Point pt) -> Point
9378 Converts from screen to client window coordinates.
9380 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9382 def HitTestXY(*args
, **kwargs
):
9384 HitTestXY(self, int x, int y) -> int
9386 Test where the given (in client coords) point lies
9388 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9390 def HitTest(*args
, **kwargs
):
9392 HitTest(self, Point pt) -> int
9394 Test where the given (in client coords) point lies
9396 return _core_
.Window_HitTest(*args
, **kwargs
)
9398 def GetBorder(*args
):
9400 GetBorder(self, long flags) -> int
9401 GetBorder(self) -> int
9403 Get border for the flags of this window
9405 return _core_
.Window_GetBorder(*args
)
9407 def UpdateWindowUI(*args
, **kwargs
):
9409 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9411 This function sends EVT_UPDATE_UI events to the window. The particular
9412 implementation depends on the window; for example a wx.ToolBar will
9413 send an update UI event for each toolbar button, and a wx.Frame will
9414 send an update UI event for each menubar menu item. You can call this
9415 function from your application to ensure that your UI is up-to-date at
9416 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9417 concerned). This may be necessary if you have called
9418 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9419 limit the overhead that wxWindows incurs by sending update UI events
9422 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9424 def PopupMenuXY(*args
, **kwargs
):
9426 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9428 Pops up the given menu at the specified coordinates, relative to this window,
9429 and returns control when the user has dismissed the menu. If a menu item is
9430 selected, the corresponding menu event is generated and will be processed as
9431 usual. If the default position is given then the current position of the
9432 mouse cursor will be used.
9434 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9436 def PopupMenu(*args
, **kwargs
):
9438 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9440 Pops up the given menu at the specified coordinates, relative to this window,
9441 and returns control when the user has dismissed the menu. If a menu item is
9442 selected, the corresponding menu event is generated and will be processed as
9443 usual. If the default position is given then the current position of the
9444 mouse cursor will be used.
9446 return _core_
.Window_PopupMenu(*args
, **kwargs
)
9448 def HasMultiplePages(*args
, **kwargs
):
9449 """HasMultiplePages(self) -> bool"""
9450 return _core_
.Window_HasMultiplePages(*args
, **kwargs
)
9452 def GetHandle(*args
, **kwargs
):
9454 GetHandle(self) -> long
9456 Returns the platform-specific handle (as a long integer) of the
9457 physical window. Currently on wxMac it returns the handle of the
9458 toplevel parent of the window.
9460 return _core_
.Window_GetHandle(*args
, **kwargs
)
9462 def AssociateHandle(*args
, **kwargs
):
9464 AssociateHandle(self, long handle)
9466 Associate the window with a new native handle
9468 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
9470 def DissociateHandle(*args
, **kwargs
):
9472 DissociateHandle(self)
9474 Dissociate the current native handle from the window
9476 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
9478 def OnPaint(*args
, **kwargs
):
9479 """OnPaint(self, PaintEvent event)"""
9480 return _core_
.Window_OnPaint(*args
, **kwargs
)
9482 def HasScrollbar(*args
, **kwargs
):
9484 HasScrollbar(self, int orient) -> bool
9486 Does the window have the scrollbar for this orientation?
9488 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
9490 def SetScrollbar(*args
, **kwargs
):
9492 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9495 Sets the scrollbar properties of a built-in scrollbar.
9497 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
9499 def SetScrollPos(*args
, **kwargs
):
9501 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9503 Sets the position of one of the built-in scrollbars.
9505 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
9507 def GetScrollPos(*args
, **kwargs
):
9509 GetScrollPos(self, int orientation) -> int
9511 Returns the built-in scrollbar position.
9513 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
9515 def GetScrollThumb(*args
, **kwargs
):
9517 GetScrollThumb(self, int orientation) -> int
9519 Returns the built-in scrollbar thumb size.
9521 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
9523 def GetScrollRange(*args
, **kwargs
):
9525 GetScrollRange(self, int orientation) -> int
9527 Returns the built-in scrollbar range.
9529 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
9531 def ScrollWindow(*args
, **kwargs
):
9533 ScrollWindow(self, int dx, int dy, Rect rect=None)
9535 Physically scrolls the pixels in the window and move child windows
9536 accordingly. Use this function to optimise your scrolling
9537 implementations, to minimise the area that must be redrawn. Note that
9538 it is rarely required to call this function from a user program.
9540 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
9542 def ScrollLines(*args
, **kwargs
):
9544 ScrollLines(self, int lines) -> bool
9546 If the platform and window class supports it, scrolls the window by
9547 the given number of lines down, if lines is positive, or up if lines
9548 is negative. Returns True if the window was scrolled, False if it was
9549 already on top/bottom and nothing was done.
9551 return _core_
.Window_ScrollLines(*args
, **kwargs
)
9553 def ScrollPages(*args
, **kwargs
):
9555 ScrollPages(self, int pages) -> bool
9557 If the platform and window class supports it, scrolls the window by
9558 the given number of pages down, if pages is positive, or up if pages
9559 is negative. Returns True if the window was scrolled, False if it was
9560 already on top/bottom and nothing was done.
9562 return _core_
.Window_ScrollPages(*args
, **kwargs
)
9564 def LineUp(*args
, **kwargs
):
9566 LineUp(self) -> bool
9568 This is just a wrapper for ScrollLines(-1).
9570 return _core_
.Window_LineUp(*args
, **kwargs
)
9572 def LineDown(*args
, **kwargs
):
9574 LineDown(self) -> bool
9576 This is just a wrapper for ScrollLines(1).
9578 return _core_
.Window_LineDown(*args
, **kwargs
)
9580 def PageUp(*args
, **kwargs
):
9582 PageUp(self) -> bool
9584 This is just a wrapper for ScrollPages(-1).
9586 return _core_
.Window_PageUp(*args
, **kwargs
)
9588 def PageDown(*args
, **kwargs
):
9590 PageDown(self) -> bool
9592 This is just a wrapper for ScrollPages(1).
9594 return _core_
.Window_PageDown(*args
, **kwargs
)
9596 def SetHelpText(*args
, **kwargs
):
9598 SetHelpText(self, String text)
9600 Sets the help text to be used as context-sensitive help for this
9601 window. Note that the text is actually stored by the current
9602 `wx.HelpProvider` implementation, and not in the window object itself.
9604 return _core_
.Window_SetHelpText(*args
, **kwargs
)
9606 def SetHelpTextForId(*args
, **kwargs
):
9608 SetHelpTextForId(self, String text)
9610 Associate this help text with all windows with the same id as this
9613 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
9615 def GetHelpTextAtPoint(*args
, **kwargs
):
9617 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9619 Get the help string associated with the given position in this window.
9621 Notice that pt may be invalid if event origin is keyboard or unknown
9622 and this method should return the global window help text then
9625 return _core_
.Window_GetHelpTextAtPoint(*args
, **kwargs
)
9627 def GetHelpText(*args
, **kwargs
):
9629 GetHelpText(self) -> String
9631 Gets the help text to be used as context-sensitive help for this
9632 window. Note that the text is actually stored by the current
9633 `wx.HelpProvider` implementation, and not in the window object itself.
9635 return _core_
.Window_GetHelpText(*args
, **kwargs
)
9637 def SetToolTipString(*args
, **kwargs
):
9639 SetToolTipString(self, String tip)
9641 Attach a tooltip to the window.
9643 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
9645 def SetToolTip(*args
, **kwargs
):
9647 SetToolTip(self, ToolTip tip)
9649 Attach a tooltip to the window.
9651 return _core_
.Window_SetToolTip(*args
, **kwargs
)
9653 def GetToolTip(*args
, **kwargs
):
9655 GetToolTip(self) -> ToolTip
9657 get the associated tooltip or None if none
9659 return _core_
.Window_GetToolTip(*args
, **kwargs
)
9661 def SetDropTarget(*args
, **kwargs
):
9663 SetDropTarget(self, DropTarget dropTarget)
9665 Associates a drop target with this window. If the window already has
9666 a drop target, it is deleted.
9668 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
9670 def GetDropTarget(*args
, **kwargs
):
9672 GetDropTarget(self) -> DropTarget
9674 Returns the associated drop target, which may be None.
9676 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
9678 def DragAcceptFiles(*args
, **kwargs
):
9680 DragAcceptFiles(self, bool accept)
9682 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9683 Only functional on Windows.
9685 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
9687 def SetConstraints(*args
, **kwargs
):
9689 SetConstraints(self, LayoutConstraints constraints)
9691 Sets the window to have the given layout constraints. If an existing
9692 layout constraints object is already owned by the window, it will be
9693 deleted. Pass None to disassociate and delete the window's current
9696 You must call SetAutoLayout to tell a window to use the constraints
9697 automatically in its default EVT_SIZE handler; otherwise, you must
9698 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9699 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9702 return _core_
.Window_SetConstraints(*args
, **kwargs
)
9704 def GetConstraints(*args
, **kwargs
):
9706 GetConstraints(self) -> LayoutConstraints
9708 Returns a pointer to the window's layout constraints, or None if there
9711 return _core_
.Window_GetConstraints(*args
, **kwargs
)
9713 def SetAutoLayout(*args
, **kwargs
):
9715 SetAutoLayout(self, bool autoLayout)
9717 Determines whether the Layout function will be called automatically
9718 when the window is resized. lease note that this only happens for the
9719 windows usually used to contain children, namely `wx.Panel` and
9720 `wx.TopLevelWindow` (and the classes deriving from them).
9722 This method is called implicitly by `SetSizer` but if you use
9723 `SetConstraints` you should call it manually or otherwise the window
9724 layout won't be correctly updated when its size changes.
9726 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
9728 def GetAutoLayout(*args
, **kwargs
):
9730 GetAutoLayout(self) -> bool
9732 Returns the current autoLayout setting
9734 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
9736 def Layout(*args
, **kwargs
):
9738 Layout(self) -> bool
9740 Invokes the constraint-based layout algorithm or the sizer-based
9741 algorithm for this window. See SetAutoLayout: when auto layout is on,
9742 this function gets called automatically by the default EVT_SIZE
9743 handler when the window is resized.
9745 return _core_
.Window_Layout(*args
, **kwargs
)
9747 def SetSizer(*args
, **kwargs
):
9749 SetSizer(self, Sizer sizer, bool deleteOld=True)
9751 Sets the window to have the given layout sizer. The window will then
9752 own the object, and will take care of its deletion. If an existing
9753 layout sizer object is already owned by the window, it will be deleted
9754 if the deleteOld parameter is true. Note that this function will also
9755 call SetAutoLayout implicitly with a True parameter if the sizer is
9756 non-None, and False otherwise.
9758 return _core_
.Window_SetSizer(*args
, **kwargs
)
9760 def SetSizerAndFit(*args
, **kwargs
):
9762 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9764 The same as SetSizer, except it also sets the size hints for the
9765 window based on the sizer's minimum size.
9767 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
9769 def GetSizer(*args
, **kwargs
):
9771 GetSizer(self) -> Sizer
9773 Return the sizer associated with the window by a previous call to
9774 SetSizer or None if there isn't one.
9776 return _core_
.Window_GetSizer(*args
, **kwargs
)
9778 def SetContainingSizer(*args
, **kwargs
):
9780 SetContainingSizer(self, Sizer sizer)
9782 This normally does not need to be called by application code. It is
9783 called internally when a window is added to a sizer, and is used so
9784 the window can remove itself from the sizer when it is destroyed.
9786 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
9788 def GetContainingSizer(*args
, **kwargs
):
9790 GetContainingSizer(self) -> Sizer
9792 Return the sizer that this window is a member of, if any, otherwise None.
9794 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
9796 def InheritAttributes(*args
, **kwargs
):
9798 InheritAttributes(self)
9800 This function is (or should be, in case of custom controls) called
9801 during window creation to intelligently set up the window visual
9802 attributes, that is the font and the foreground and background
9805 By 'intelligently' the following is meant: by default, all windows use
9806 their own default attributes. However if some of the parent's
9807 attributes are explicitly changed (that is, using SetFont and not
9808 SetOwnFont) and if the corresponding attribute hadn't been
9809 explicitly set for this window itself, then this window takes the same
9810 value as used by the parent. In addition, if the window overrides
9811 ShouldInheritColours to return false, the colours will not be changed
9812 no matter what and only the font might.
9814 This rather complicated logic is necessary in order to accommodate the
9815 different usage scenarios. The most common one is when all default
9816 attributes are used and in this case, nothing should be inherited as
9817 in modern GUIs different controls use different fonts (and colours)
9818 than their siblings so they can't inherit the same value from the
9819 parent. However it was also deemed desirable to allow to simply change
9820 the attributes of all children at once by just changing the font or
9821 colour of their common parent, hence in this case we do inherit the
9825 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
9827 def ShouldInheritColours(*args
, **kwargs
):
9829 ShouldInheritColours(self) -> bool
9831 Return true from here to allow the colours of this window to be
9832 changed by InheritAttributes, returning false forbids inheriting them
9833 from the parent window.
9835 The base class version returns false, but this method is overridden in
9836 wxControl where it returns true.
9838 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
9840 def CanSetTransparent(*args
, **kwargs
):
9842 CanSetTransparent(self) -> bool
9844 Returns ``True`` if the platform supports setting the transparency for
9845 this window. Note that this method will err on the side of caution,
9846 so it is possible that this will return ``False`` when it is in fact
9847 possible to set the transparency.
9849 NOTE: On X-windows systems the X server must have the composite
9850 extension loaded, and there must be a composite manager program (such
9851 as xcompmgr) running.
9853 return _core_
.Window_CanSetTransparent(*args
, **kwargs
)
9855 def SetTransparent(*args
, **kwargs
):
9857 SetTransparent(self, byte alpha) -> bool
9859 Attempt to set the transparency of this window to the ``alpha`` value,
9860 returns True on success. The ``alpha`` value is an integer in the
9861 range of 0 to 255, where 0 is fully transparent and 255 is fully
9864 return _core_
.Window_SetTransparent(*args
, **kwargs
)
9866 def PostCreate(self
, pre
):
9868 Phase 3 of the 2-phase create <wink!>
9869 Call this method after precreating the window with the 2-phase create method.
9871 self
.this
= pre
.this
9872 self
.thisown
= pre
.thisown
9874 if hasattr(self
, '_setOORInfo'):
9875 self
._setOORInfo
(self
)
9876 if hasattr(self
, '_setCallbackInfo'):
9877 self
._setCallbackInfo
(self
, self
.__class
__)
9879 def SendSizeEvent(self
):
9880 self
.GetEventHandler().ProcessEvent(wx
.SizeEvent((-1,-1)))
9882 AcceleratorTable
= property(GetAcceleratorTable
,SetAcceleratorTable
,doc
="See `GetAcceleratorTable` and `SetAcceleratorTable`")
9883 AdjustedBestSize
= property(GetAdjustedBestSize
,doc
="See `GetAdjustedBestSize`")
9884 AutoLayout
= property(GetAutoLayout
,SetAutoLayout
,doc
="See `GetAutoLayout` and `SetAutoLayout`")
9885 BackgroundColour
= property(GetBackgroundColour
,SetBackgroundColour
,doc
="See `GetBackgroundColour` and `SetBackgroundColour`")
9886 BackgroundStyle
= property(GetBackgroundStyle
,SetBackgroundStyle
,doc
="See `GetBackgroundStyle` and `SetBackgroundStyle`")
9887 BestFittingSize
= property(GetBestFittingSize
,SetBestFittingSize
,doc
="See `GetBestFittingSize` and `SetBestFittingSize`")
9888 BestSize
= property(GetBestSize
,doc
="See `GetBestSize`")
9889 BestVirtualSize
= property(GetBestVirtualSize
,doc
="See `GetBestVirtualSize`")
9890 Border
= property(GetBorder
,doc
="See `GetBorder`")
9891 Caret
= property(GetCaret
,SetCaret
,doc
="See `GetCaret` and `SetCaret`")
9892 CharHeight
= property(GetCharHeight
,doc
="See `GetCharHeight`")
9893 CharWidth
= property(GetCharWidth
,doc
="See `GetCharWidth`")
9894 Children
= property(GetChildren
,doc
="See `GetChildren`")
9895 ClientAreaOrigin
= property(GetClientAreaOrigin
,doc
="See `GetClientAreaOrigin`")
9896 ClientRect
= property(GetClientRect
,SetClientRect
,doc
="See `GetClientRect` and `SetClientRect`")
9897 ClientSize
= property(GetClientSize
,SetClientSize
,doc
="See `GetClientSize` and `SetClientSize`")
9898 Constraints
= property(GetConstraints
,SetConstraints
,doc
="See `GetConstraints` and `SetConstraints`")
9899 ContainingSizer
= property(GetContainingSizer
,SetContainingSizer
,doc
="See `GetContainingSizer` and `SetContainingSizer`")
9900 Cursor
= property(GetCursor
,SetCursor
,doc
="See `GetCursor` and `SetCursor`")
9901 DefaultAttributes
= property(GetDefaultAttributes
,doc
="See `GetDefaultAttributes`")
9902 DropTarget
= property(GetDropTarget
,SetDropTarget
,doc
="See `GetDropTarget` and `SetDropTarget`")
9903 EventHandler
= property(GetEventHandler
,SetEventHandler
,doc
="See `GetEventHandler` and `SetEventHandler`")
9904 ExtraStyle
= property(GetExtraStyle
,SetExtraStyle
,doc
="See `GetExtraStyle` and `SetExtraStyle`")
9905 Font
= property(GetFont
,SetFont
,doc
="See `GetFont` and `SetFont`")
9906 ForegroundColour
= property(GetForegroundColour
,SetForegroundColour
,doc
="See `GetForegroundColour` and `SetForegroundColour`")
9907 GrandParent
= property(GetGrandParent
,doc
="See `GetGrandParent`")
9908 Handle
= property(GetHandle
,doc
="See `GetHandle`")
9909 HelpText
= property(GetHelpText
,SetHelpText
,doc
="See `GetHelpText` and `SetHelpText`")
9910 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
9911 Label
= property(GetLabel
,SetLabel
,doc
="See `GetLabel` and `SetLabel`")
9912 MaxHeight
= property(GetMaxHeight
,doc
="See `GetMaxHeight`")
9913 MaxSize
= property(GetMaxSize
,SetMaxSize
,doc
="See `GetMaxSize` and `SetMaxSize`")
9914 MaxWidth
= property(GetMaxWidth
,doc
="See `GetMaxWidth`")
9915 MinHeight
= property(GetMinHeight
,doc
="See `GetMinHeight`")
9916 MinSize
= property(GetMinSize
,SetMinSize
,doc
="See `GetMinSize` and `SetMinSize`")
9917 MinWidth
= property(GetMinWidth
,doc
="See `GetMinWidth`")
9918 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
9919 Parent
= property(GetParent
,doc
="See `GetParent`")
9920 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
9921 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
9922 ScreenPosition
= property(GetScreenPosition
,doc
="See `GetScreenPosition`")
9923 ScreenRect
= property(GetScreenRect
,doc
="See `GetScreenRect`")
9924 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
9925 Sizer
= property(GetSizer
,SetSizer
,doc
="See `GetSizer` and `SetSizer`")
9926 ThemeEnabled
= property(GetThemeEnabled
,SetThemeEnabled
,doc
="See `GetThemeEnabled` and `SetThemeEnabled`")
9927 ToolTip
= property(GetToolTip
,SetToolTip
,doc
="See `GetToolTip` and `SetToolTip`")
9928 UpdateClientRect
= property(GetUpdateClientRect
,doc
="See `GetUpdateClientRect`")
9929 UpdateRegion
= property(GetUpdateRegion
,doc
="See `GetUpdateRegion`")
9930 Validator
= property(GetValidator
,SetValidator
,doc
="See `GetValidator` and `SetValidator`")
9931 VirtualSize
= property(GetVirtualSize
,SetVirtualSize
,doc
="See `GetVirtualSize` and `SetVirtualSize`")
9932 WindowStyle
= property(GetWindowStyle
,SetWindowStyle
,doc
="See `GetWindowStyle` and `SetWindowStyle`")
9933 WindowStyleFlag
= property(GetWindowStyleFlag
,SetWindowStyleFlag
,doc
="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
9934 WindowVariant
= property(GetWindowVariant
,SetWindowVariant
,doc
="See `GetWindowVariant` and `SetWindowVariant`")
9935 Shown
= property(IsShown
,Show
,doc
="See `IsShown` and `Show`")
9936 Enabled
= property(IsEnabled
,Enable
,doc
="See `IsEnabled` and `Enable`")
9937 TopLevel
= property(IsTopLevel
,doc
="See `IsTopLevel`")
9938 _core_
.Window_swigregister(Window
)
9940 def PreWindow(*args
, **kwargs
):
9942 PreWindow() -> Window
9944 Precreate a Window for 2-phase creation.
9946 val
= _core_
.new_PreWindow(*args
, **kwargs
)
9949 def Window_NewControlId(*args
):
9951 Window_NewControlId() -> int
9953 Generate a control id for the controls which were not given one.
9955 return _core_
.Window_NewControlId(*args
)
9957 def Window_NextControlId(*args
, **kwargs
):
9959 Window_NextControlId(int winid) -> int
9961 Get the id of the control following the one with the given
9964 return _core_
.Window_NextControlId(*args
, **kwargs
)
9966 def Window_PrevControlId(*args
, **kwargs
):
9968 Window_PrevControlId(int winid) -> int
9970 Get the id of the control preceding the one with the given
9973 return _core_
.Window_PrevControlId(*args
, **kwargs
)
9975 def Window_FindFocus(*args
):
9977 Window_FindFocus() -> Window
9979 Returns the window or control that currently has the keyboard focus,
9982 return _core_
.Window_FindFocus(*args
)
9984 def Window_GetCapture(*args
):
9986 Window_GetCapture() -> Window
9988 Returns the window which currently captures the mouse or None
9990 return _core_
.Window_GetCapture(*args
)
9992 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
9994 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9996 Get the default attributes for this class. This is useful if you want
9997 to use the same font or colour in your own control as in a standard
9998 control -- which is a much better idea than hard coding specific
9999 colours or fonts which might look completely out of place on the
10000 user's system, especially if it uses themes.
10002 The variant parameter is only relevant under Mac currently and is
10003 ignore under other platforms. Under Mac, it will change the size of
10004 the returned font. See `wx.Window.SetWindowVariant` for more about
10007 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
10009 def DLG_PNT(win
, point_or_x
, y
=None):
10011 Convenience function for converting a Point or (x,y) in
10012 dialog units to pixel units.
10015 return win
.ConvertDialogPointToPixels(point_or_x
)
10017 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
10019 def DLG_SZE(win
, size_width
, height
=None):
10021 Convenience function for converting a Size or (w,h) in
10022 dialog units to pixel units.
10025 return win
.ConvertDialogSizeToPixels(size_width
)
10027 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
10030 def FindWindowById(*args
, **kwargs
):
10032 FindWindowById(long id, Window parent=None) -> Window
10034 Find the first window in the application with the given id. If parent
10035 is None, the search will start from all top-level frames and dialog
10036 boxes; if non-None, the search will be limited to the given window
10037 hierarchy. The search is recursive in both cases.
10039 return _core_
.FindWindowById(*args
, **kwargs
)
10041 def FindWindowByName(*args
, **kwargs
):
10043 FindWindowByName(String name, Window parent=None) -> Window
10045 Find a window by its name (as given in a window constructor or Create
10046 function call). If parent is None, the search will start from all
10047 top-level frames and dialog boxes; if non-None, the search will be
10048 limited to the given window hierarchy. The search is recursive in both
10051 If no window with such name is found, wx.FindWindowByLabel is called.
10053 return _core_
.FindWindowByName(*args
, **kwargs
)
10055 def FindWindowByLabel(*args
, **kwargs
):
10057 FindWindowByLabel(String label, Window parent=None) -> Window
10059 Find a window by its label. Depending on the type of window, the label
10060 may be a window title or panel item label. If parent is None, the
10061 search will start from all top-level frames and dialog boxes; if
10062 non-None, the search will be limited to the given window
10063 hierarchy. The search is recursive in both cases.
10065 return _core_
.FindWindowByLabel(*args
, **kwargs
)
10067 def Window_FromHWND(*args
, **kwargs
):
10068 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10069 return _core_
.Window_FromHWND(*args
, **kwargs
)
10071 def GetTopLevelWindows(*args
):
10073 GetTopLevelWindows() -> PyObject
10075 Returns a list of the the application's top-level windows, (frames,
10076 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10077 by wxWidgets, and so it is only valid as long as no top-level windows
10078 are closed or new top-level windows are created.
10081 return _core_
.GetTopLevelWindows(*args
)
10082 #---------------------------------------------------------------------------
10084 class Validator(EvtHandler
):
10085 """Proxy of C++ Validator class"""
10086 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10087 __repr__
= _swig_repr
10088 def __init__(self
, *args
, **kwargs
):
10089 """__init__(self) -> Validator"""
10090 _core_
.Validator_swiginit(self
,_core_
.new_Validator(*args
, **kwargs
))
10091 self
._setOORInfo
(self
)
10093 def Clone(*args
, **kwargs
):
10094 """Clone(self) -> Validator"""
10095 return _core_
.Validator_Clone(*args
, **kwargs
)
10097 def Validate(*args
, **kwargs
):
10098 """Validate(self, Window parent) -> bool"""
10099 return _core_
.Validator_Validate(*args
, **kwargs
)
10101 def TransferToWindow(*args
, **kwargs
):
10102 """TransferToWindow(self) -> bool"""
10103 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
10105 def TransferFromWindow(*args
, **kwargs
):
10106 """TransferFromWindow(self) -> bool"""
10107 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
10109 def GetWindow(*args
, **kwargs
):
10110 """GetWindow(self) -> Window"""
10111 return _core_
.Validator_GetWindow(*args
, **kwargs
)
10113 def SetWindow(*args
, **kwargs
):
10114 """SetWindow(self, Window window)"""
10115 return _core_
.Validator_SetWindow(*args
, **kwargs
)
10117 def IsSilent(*args
, **kwargs
):
10118 """IsSilent() -> bool"""
10119 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10121 IsSilent
= staticmethod(IsSilent
)
10122 def SetBellOnError(*args
, **kwargs
):
10123 """SetBellOnError(int doIt=True)"""
10124 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10126 SetBellOnError
= staticmethod(SetBellOnError
)
10127 _core_
.Validator_swigregister(Validator
)
10129 def Validator_IsSilent(*args
):
10130 """Validator_IsSilent() -> bool"""
10131 return _core_
.Validator_IsSilent(*args
)
10133 def Validator_SetBellOnError(*args
, **kwargs
):
10134 """Validator_SetBellOnError(int doIt=True)"""
10135 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10137 class PyValidator(Validator
):
10138 """Proxy of C++ PyValidator class"""
10139 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10140 __repr__
= _swig_repr
10141 def __init__(self
, *args
, **kwargs
):
10142 """__init__(self) -> PyValidator"""
10143 _core_
.PyValidator_swiginit(self
,_core_
.new_PyValidator(*args
, **kwargs
))
10145 self
._setCallbackInfo
(self
, PyValidator
, 1)
10146 self
._setOORInfo
(self
)
10148 def _setCallbackInfo(*args
, **kwargs
):
10149 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10150 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
10152 _core_
.PyValidator_swigregister(PyValidator
)
10154 #---------------------------------------------------------------------------
10156 class Menu(EvtHandler
):
10157 """Proxy of C++ Menu class"""
10158 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10159 __repr__
= _swig_repr
10160 def __init__(self
, *args
, **kwargs
):
10161 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10162 _core_
.Menu_swiginit(self
,_core_
.new_Menu(*args
, **kwargs
))
10163 self
._setOORInfo
(self
)
10165 def Append(*args
, **kwargs
):
10167 Append(self, int id, String text=EmptyString, String help=EmptyString,
10168 int kind=ITEM_NORMAL) -> MenuItem
10170 return _core_
.Menu_Append(*args
, **kwargs
)
10172 def AppendSeparator(*args
, **kwargs
):
10173 """AppendSeparator(self) -> MenuItem"""
10174 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
10176 def AppendCheckItem(*args
, **kwargs
):
10177 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10178 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
10180 def AppendRadioItem(*args
, **kwargs
):
10181 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10182 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
10184 def AppendMenu(*args
, **kwargs
):
10185 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10186 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
10188 def AppendSubMenu(*args
, **kwargs
):
10189 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10190 return _core_
.Menu_AppendSubMenu(*args
, **kwargs
)
10192 def AppendItem(*args
, **kwargs
):
10193 """AppendItem(self, MenuItem item) -> MenuItem"""
10194 return _core_
.Menu_AppendItem(*args
, **kwargs
)
10196 def InsertItem(*args
, **kwargs
):
10197 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10198 return _core_
.Menu_InsertItem(*args
, **kwargs
)
10200 def PrependItem(*args
, **kwargs
):
10201 """PrependItem(self, MenuItem item) -> MenuItem"""
10202 return _core_
.Menu_PrependItem(*args
, **kwargs
)
10204 def Break(*args
, **kwargs
):
10206 return _core_
.Menu_Break(*args
, **kwargs
)
10208 def Insert(*args
, **kwargs
):
10210 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10211 int kind=ITEM_NORMAL) -> MenuItem
10213 return _core_
.Menu_Insert(*args
, **kwargs
)
10215 def InsertSeparator(*args
, **kwargs
):
10216 """InsertSeparator(self, size_t pos) -> MenuItem"""
10217 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
10219 def InsertCheckItem(*args
, **kwargs
):
10220 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10221 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
10223 def InsertRadioItem(*args
, **kwargs
):
10224 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10225 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
10227 def InsertMenu(*args
, **kwargs
):
10228 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10229 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
10231 def Prepend(*args
, **kwargs
):
10233 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10234 int kind=ITEM_NORMAL) -> MenuItem
10236 return _core_
.Menu_Prepend(*args
, **kwargs
)
10238 def PrependSeparator(*args
, **kwargs
):
10239 """PrependSeparator(self) -> MenuItem"""
10240 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
10242 def PrependCheckItem(*args
, **kwargs
):
10243 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10244 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
10246 def PrependRadioItem(*args
, **kwargs
):
10247 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10248 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
10250 def PrependMenu(*args
, **kwargs
):
10251 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10252 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
10254 def Remove(*args
, **kwargs
):
10255 """Remove(self, int id) -> MenuItem"""
10256 return _core_
.Menu_Remove(*args
, **kwargs
)
10258 def RemoveItem(*args
, **kwargs
):
10259 """RemoveItem(self, MenuItem item) -> MenuItem"""
10260 return _core_
.Menu_RemoveItem(*args
, **kwargs
)
10262 def Delete(*args
, **kwargs
):
10263 """Delete(self, int id) -> bool"""
10264 return _core_
.Menu_Delete(*args
, **kwargs
)
10266 def DeleteItem(*args
, **kwargs
):
10267 """DeleteItem(self, MenuItem item) -> bool"""
10268 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
10270 def Destroy(*args
, **kwargs
):
10274 Deletes the C++ object this Python object is a proxy for.
10276 val
= _core_
.Menu_Destroy(*args
, **kwargs
)
10277 args
[0].thisown
= 0
10280 def DestroyId(*args
, **kwargs
):
10282 DestroyId(self, int id) -> bool
10284 Deletes the C++ object this Python object is a proxy for.
10286 val
= _core_
.Menu_DestroyId(*args
, **kwargs
)
10287 args
[0].thisown
= 0
10290 def DestroyItem(*args
, **kwargs
):
10292 DestroyItem(self, MenuItem item) -> bool
10294 Deletes the C++ object this Python object is a proxy for.
10296 val
= _core_
.Menu_DestroyItem(*args
, **kwargs
)
10297 args
[0].thisown
= 0
10300 def GetMenuItemCount(*args
, **kwargs
):
10301 """GetMenuItemCount(self) -> size_t"""
10302 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
10304 def GetMenuItems(*args
, **kwargs
):
10305 """GetMenuItems(self) -> PyObject"""
10306 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
10308 def FindItem(*args
, **kwargs
):
10309 """FindItem(self, String item) -> int"""
10310 return _core_
.Menu_FindItem(*args
, **kwargs
)
10312 def FindItemById(*args
, **kwargs
):
10313 """FindItemById(self, int id) -> MenuItem"""
10314 return _core_
.Menu_FindItemById(*args
, **kwargs
)
10316 def FindItemByPosition(*args
, **kwargs
):
10317 """FindItemByPosition(self, size_t position) -> MenuItem"""
10318 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
10320 def Enable(*args
, **kwargs
):
10321 """Enable(self, int id, bool enable)"""
10322 return _core_
.Menu_Enable(*args
, **kwargs
)
10324 def IsEnabled(*args
, **kwargs
):
10325 """IsEnabled(self, int id) -> bool"""
10326 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
10328 def Check(*args
, **kwargs
):
10329 """Check(self, int id, bool check)"""
10330 return _core_
.Menu_Check(*args
, **kwargs
)
10332 def IsChecked(*args
, **kwargs
):
10333 """IsChecked(self, int id) -> bool"""
10334 return _core_
.Menu_IsChecked(*args
, **kwargs
)
10336 def SetLabel(*args
, **kwargs
):
10337 """SetLabel(self, int id, String label)"""
10338 return _core_
.Menu_SetLabel(*args
, **kwargs
)
10340 def GetLabel(*args
, **kwargs
):
10341 """GetLabel(self, int id) -> String"""
10342 return _core_
.Menu_GetLabel(*args
, **kwargs
)
10344 def SetHelpString(*args
, **kwargs
):
10345 """SetHelpString(self, int id, String helpString)"""
10346 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
10348 def GetHelpString(*args
, **kwargs
):
10349 """GetHelpString(self, int id) -> String"""
10350 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
10352 def SetTitle(*args
, **kwargs
):
10353 """SetTitle(self, String title)"""
10354 return _core_
.Menu_SetTitle(*args
, **kwargs
)
10356 def GetTitle(*args
, **kwargs
):
10357 """GetTitle(self) -> String"""
10358 return _core_
.Menu_GetTitle(*args
, **kwargs
)
10360 def SetEventHandler(*args
, **kwargs
):
10361 """SetEventHandler(self, EvtHandler handler)"""
10362 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
10364 def GetEventHandler(*args
, **kwargs
):
10365 """GetEventHandler(self) -> EvtHandler"""
10366 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
10368 def SetInvokingWindow(*args
, **kwargs
):
10369 """SetInvokingWindow(self, Window win)"""
10370 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
10372 def GetInvokingWindow(*args
, **kwargs
):
10373 """GetInvokingWindow(self) -> Window"""
10374 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
10376 def GetStyle(*args
, **kwargs
):
10377 """GetStyle(self) -> long"""
10378 return _core_
.Menu_GetStyle(*args
, **kwargs
)
10380 def UpdateUI(*args
, **kwargs
):
10381 """UpdateUI(self, EvtHandler source=None)"""
10382 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
10384 def GetMenuBar(*args
, **kwargs
):
10385 """GetMenuBar(self) -> MenuBar"""
10386 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
10388 def Attach(*args
, **kwargs
):
10389 """Attach(self, wxMenuBarBase menubar)"""
10390 return _core_
.Menu_Attach(*args
, **kwargs
)
10392 def Detach(*args
, **kwargs
):
10394 return _core_
.Menu_Detach(*args
, **kwargs
)
10396 def IsAttached(*args
, **kwargs
):
10397 """IsAttached(self) -> bool"""
10398 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10400 def SetParent(*args
, **kwargs
):
10401 """SetParent(self, Menu parent)"""
10402 return _core_
.Menu_SetParent(*args
, **kwargs
)
10404 def GetParent(*args
, **kwargs
):
10405 """GetParent(self) -> Menu"""
10406 return _core_
.Menu_GetParent(*args
, **kwargs
)
10408 _core_
.Menu_swigregister(Menu
)
10409 DefaultValidator
= cvar
.DefaultValidator
10411 #---------------------------------------------------------------------------
10413 class MenuBar(Window
):
10414 """Proxy of C++ MenuBar class"""
10415 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10416 __repr__
= _swig_repr
10417 def __init__(self
, *args
, **kwargs
):
10418 """__init__(self, long style=0) -> MenuBar"""
10419 _core_
.MenuBar_swiginit(self
,_core_
.new_MenuBar(*args
, **kwargs
))
10420 self
._setOORInfo
(self
)
10422 def Append(*args
, **kwargs
):
10423 """Append(self, Menu menu, String title) -> bool"""
10424 return _core_
.MenuBar_Append(*args
, **kwargs
)
10426 def Insert(*args
, **kwargs
):
10427 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10428 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10430 def GetMenuCount(*args
, **kwargs
):
10431 """GetMenuCount(self) -> size_t"""
10432 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
10434 def GetMenu(*args
, **kwargs
):
10435 """GetMenu(self, size_t pos) -> Menu"""
10436 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
10438 def Replace(*args
, **kwargs
):
10439 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10440 return _core_
.MenuBar_Replace(*args
, **kwargs
)
10442 def Remove(*args
, **kwargs
):
10443 """Remove(self, size_t pos) -> Menu"""
10444 return _core_
.MenuBar_Remove(*args
, **kwargs
)
10446 def EnableTop(*args
, **kwargs
):
10447 """EnableTop(self, size_t pos, bool enable)"""
10448 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
10450 def IsEnabledTop(*args
, **kwargs
):
10451 """IsEnabledTop(self, size_t pos) -> bool"""
10452 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
10454 def SetLabelTop(*args
, **kwargs
):
10455 """SetLabelTop(self, size_t pos, String label)"""
10456 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
10458 def GetLabelTop(*args
, **kwargs
):
10459 """GetLabelTop(self, size_t pos) -> String"""
10460 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
10462 def FindMenuItem(*args
, **kwargs
):
10463 """FindMenuItem(self, String menu, String item) -> int"""
10464 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
10466 def FindItemById(*args
, **kwargs
):
10467 """FindItemById(self, int id) -> MenuItem"""
10468 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
10470 def FindMenu(*args
, **kwargs
):
10471 """FindMenu(self, String title) -> int"""
10472 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
10474 def Enable(*args
, **kwargs
):
10475 """Enable(self, int id, bool enable)"""
10476 return _core_
.MenuBar_Enable(*args
, **kwargs
)
10478 def Check(*args
, **kwargs
):
10479 """Check(self, int id, bool check)"""
10480 return _core_
.MenuBar_Check(*args
, **kwargs
)
10482 def IsChecked(*args
, **kwargs
):
10483 """IsChecked(self, int id) -> bool"""
10484 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
10486 def IsEnabled(*args
, **kwargs
):
10487 """IsEnabled(self, int id) -> bool"""
10488 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
10490 def SetLabel(*args
, **kwargs
):
10491 """SetLabel(self, int id, String label)"""
10492 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
10494 def GetLabel(*args
, **kwargs
):
10495 """GetLabel(self, int id) -> String"""
10496 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
10498 def SetHelpString(*args
, **kwargs
):
10499 """SetHelpString(self, int id, String helpString)"""
10500 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
10502 def GetHelpString(*args
, **kwargs
):
10503 """GetHelpString(self, int id) -> String"""
10504 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
10506 def GetFrame(*args
, **kwargs
):
10507 """GetFrame(self) -> wxFrame"""
10508 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
10510 def IsAttached(*args
, **kwargs
):
10511 """IsAttached(self) -> bool"""
10512 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
10514 def Attach(*args
, **kwargs
):
10515 """Attach(self, wxFrame frame)"""
10516 return _core_
.MenuBar_Attach(*args
, **kwargs
)
10518 def Detach(*args
, **kwargs
):
10520 return _core_
.MenuBar_Detach(*args
, **kwargs
)
10522 def UpdateMenus(*args
, **kwargs
):
10523 """UpdateMenus(self)"""
10524 return _core_
.MenuBar_UpdateMenus(*args
, **kwargs
)
10526 def SetAutoWindowMenu(*args
, **kwargs
):
10527 """SetAutoWindowMenu(bool enable)"""
10528 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10530 SetAutoWindowMenu
= staticmethod(SetAutoWindowMenu
)
10531 def GetAutoWindowMenu(*args
, **kwargs
):
10532 """GetAutoWindowMenu() -> bool"""
10533 return _core_
.MenuBar_GetAutoWindowMenu(*args
, **kwargs
)
10535 GetAutoWindowMenu
= staticmethod(GetAutoWindowMenu
)
10536 def GetMenus(self
):
10537 """Return a list of (menu, label) items for the menus in the MenuBar. """
10538 return [(self
.GetMenu(i
), self
.GetLabelTop(i
))
10539 for i
in range(self
.GetMenuCount())]
10541 def SetMenus(self
, items
):
10542 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10543 for i
in range(self
.GetMenuCount()-1, -1, -1):
10548 Menus
= property(GetMenus
,SetMenus
)
10549 _core_
.MenuBar_swigregister(MenuBar
)
10551 def MenuBar_SetAutoWindowMenu(*args
, **kwargs
):
10552 """MenuBar_SetAutoWindowMenu(bool enable)"""
10553 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10555 def MenuBar_GetAutoWindowMenu(*args
):
10556 """MenuBar_GetAutoWindowMenu() -> bool"""
10557 return _core_
.MenuBar_GetAutoWindowMenu(*args
)
10559 #---------------------------------------------------------------------------
10561 class MenuItem(Object
):
10562 """Proxy of C++ MenuItem class"""
10563 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10564 __repr__
= _swig_repr
10565 def __init__(self
, *args
, **kwargs
):
10567 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10568 String help=EmptyString, int kind=ITEM_NORMAL,
10569 Menu subMenu=None) -> MenuItem
10571 _core_
.MenuItem_swiginit(self
,_core_
.new_MenuItem(*args
, **kwargs
))
10572 __swig_destroy__
= _core_
.delete_MenuItem
10573 __del__
= lambda self
: None;
10574 def GetMenu(*args
, **kwargs
):
10575 """GetMenu(self) -> Menu"""
10576 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
10578 def SetMenu(*args
, **kwargs
):
10579 """SetMenu(self, Menu menu)"""
10580 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
10582 def SetId(*args
, **kwargs
):
10583 """SetId(self, int id)"""
10584 return _core_
.MenuItem_SetId(*args
, **kwargs
)
10586 def GetId(*args
, **kwargs
):
10587 """GetId(self) -> int"""
10588 return _core_
.MenuItem_GetId(*args
, **kwargs
)
10590 def IsSeparator(*args
, **kwargs
):
10591 """IsSeparator(self) -> bool"""
10592 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
10594 def SetText(*args
, **kwargs
):
10595 """SetText(self, String str)"""
10596 return _core_
.MenuItem_SetText(*args
, **kwargs
)
10598 def GetLabel(*args
, **kwargs
):
10599 """GetLabel(self) -> String"""
10600 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
10602 def GetText(*args
, **kwargs
):
10603 """GetText(self) -> String"""
10604 return _core_
.MenuItem_GetText(*args
, **kwargs
)
10606 def GetLabelFromText(*args
, **kwargs
):
10607 """GetLabelFromText(String text) -> String"""
10608 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10610 GetLabelFromText
= staticmethod(GetLabelFromText
)
10611 def GetKind(*args
, **kwargs
):
10612 """GetKind(self) -> int"""
10613 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
10615 def SetKind(*args
, **kwargs
):
10616 """SetKind(self, int kind)"""
10617 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
10619 def SetCheckable(*args
, **kwargs
):
10620 """SetCheckable(self, bool checkable)"""
10621 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
10623 def IsCheckable(*args
, **kwargs
):
10624 """IsCheckable(self) -> bool"""
10625 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
10627 def IsSubMenu(*args
, **kwargs
):
10628 """IsSubMenu(self) -> bool"""
10629 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
10631 def SetSubMenu(*args
, **kwargs
):
10632 """SetSubMenu(self, Menu menu)"""
10633 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
10635 def GetSubMenu(*args
, **kwargs
):
10636 """GetSubMenu(self) -> Menu"""
10637 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
10639 def Enable(*args
, **kwargs
):
10640 """Enable(self, bool enable=True)"""
10641 return _core_
.MenuItem_Enable(*args
, **kwargs
)
10643 def IsEnabled(*args
, **kwargs
):
10644 """IsEnabled(self) -> bool"""
10645 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
10647 def Check(*args
, **kwargs
):
10648 """Check(self, bool check=True)"""
10649 return _core_
.MenuItem_Check(*args
, **kwargs
)
10651 def IsChecked(*args
, **kwargs
):
10652 """IsChecked(self) -> bool"""
10653 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
10655 def Toggle(*args
, **kwargs
):
10657 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
10659 def SetHelp(*args
, **kwargs
):
10660 """SetHelp(self, String str)"""
10661 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
10663 def GetHelp(*args
, **kwargs
):
10664 """GetHelp(self) -> String"""
10665 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
10667 def GetAccel(*args
, **kwargs
):
10668 """GetAccel(self) -> AcceleratorEntry"""
10669 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
10671 def SetAccel(*args
, **kwargs
):
10672 """SetAccel(self, AcceleratorEntry accel)"""
10673 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
10675 def SetBitmap(*args
, **kwargs
):
10676 """SetBitmap(self, Bitmap bitmap)"""
10677 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
10679 def GetBitmap(*args
, **kwargs
):
10680 """GetBitmap(self) -> Bitmap"""
10681 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
10683 def SetFont(*args
, **kwargs
):
10684 """SetFont(self, Font font)"""
10685 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
10687 def GetFont(*args
, **kwargs
):
10688 """GetFont(self) -> Font"""
10689 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
10691 def SetTextColour(*args
, **kwargs
):
10692 """SetTextColour(self, Colour colText)"""
10693 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
10695 def GetTextColour(*args
, **kwargs
):
10696 """GetTextColour(self) -> Colour"""
10697 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
10699 def SetBackgroundColour(*args
, **kwargs
):
10700 """SetBackgroundColour(self, Colour colBack)"""
10701 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
10703 def GetBackgroundColour(*args
, **kwargs
):
10704 """GetBackgroundColour(self) -> Colour"""
10705 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
10707 def SetBitmaps(*args
, **kwargs
):
10708 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10709 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
10711 def SetDisabledBitmap(*args
, **kwargs
):
10712 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10713 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
10715 def GetDisabledBitmap(*args
, **kwargs
):
10716 """GetDisabledBitmap(self) -> Bitmap"""
10717 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
10719 def SetMarginWidth(*args
, **kwargs
):
10720 """SetMarginWidth(self, int nWidth)"""
10721 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
10723 def GetMarginWidth(*args
, **kwargs
):
10724 """GetMarginWidth(self) -> int"""
10725 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
10727 def GetDefaultMarginWidth(*args
, **kwargs
):
10728 """GetDefaultMarginWidth() -> int"""
10729 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10731 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
10732 def IsOwnerDrawn(*args
, **kwargs
):
10733 """IsOwnerDrawn(self) -> bool"""
10734 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
10736 def SetOwnerDrawn(*args
, **kwargs
):
10737 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10738 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
10740 def ResetOwnerDrawn(*args
, **kwargs
):
10741 """ResetOwnerDrawn(self)"""
10742 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
10744 _core_
.MenuItem_swigregister(MenuItem
)
10746 def MenuItem_GetLabelFromText(*args
, **kwargs
):
10747 """MenuItem_GetLabelFromText(String text) -> String"""
10748 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10750 def MenuItem_GetDefaultMarginWidth(*args
):
10751 """MenuItem_GetDefaultMarginWidth() -> int"""
10752 return _core_
.MenuItem_GetDefaultMarginWidth(*args
)
10754 #---------------------------------------------------------------------------
10756 class Control(Window
):
10758 This is the base class for a control or 'widget'.
10760 A control is generally a small window which processes user input
10761 and/or displays one or more item of data.
10763 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10764 __repr__
= _swig_repr
10765 def __init__(self
, *args
, **kwargs
):
10767 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10768 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10769 String name=ControlNameStr) -> Control
10771 Create a Control. Normally you should only call this from a subclass'
10772 __init__ as a plain old wx.Control is not very useful.
10774 _core_
.Control_swiginit(self
,_core_
.new_Control(*args
, **kwargs
))
10775 self
._setOORInfo
(self
)
10777 def Create(*args
, **kwargs
):
10779 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10780 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10781 String name=ControlNameStr) -> bool
10783 Do the 2nd phase and create the GUI control.
10785 return _core_
.Control_Create(*args
, **kwargs
)
10787 def GetAlignment(*args
, **kwargs
):
10789 GetAlignment(self) -> int
10791 Get the control alignment (left/right/centre, top/bottom/centre)
10793 return _core_
.Control_GetAlignment(*args
, **kwargs
)
10795 def GetLabelText(*args
, **kwargs
):
10797 GetLabelText(self) -> String
10799 Get just the text of the label, without mnemonic characters ('&')
10801 return _core_
.Control_GetLabelText(*args
, **kwargs
)
10803 def Command(*args
, **kwargs
):
10805 Command(self, CommandEvent event)
10807 Simulates the effect of the user issuing a command to the item.
10809 :see: `wx.CommandEvent`
10812 return _core_
.Control_Command(*args
, **kwargs
)
10814 def GetLabel(*args
, **kwargs
):
10816 GetLabel(self) -> String
10818 Return a control's text.
10820 return _core_
.Control_GetLabel(*args
, **kwargs
)
10822 def GetClassDefaultAttributes(*args
, **kwargs
):
10824 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10826 Get the default attributes for this class. This is useful if you want
10827 to use the same font or colour in your own control as in a standard
10828 control -- which is a much better idea than hard coding specific
10829 colours or fonts which might look completely out of place on the
10830 user's system, especially if it uses themes.
10832 The variant parameter is only relevant under Mac currently and is
10833 ignore under other platforms. Under Mac, it will change the size of
10834 the returned font. See `wx.Window.SetWindowVariant` for more about
10837 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10839 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
10840 Alignment
= property(GetAlignment
,doc
="See `GetAlignment`")
10841 Label
= property(GetLabel
,doc
="See `GetLabel`")
10842 LabelText
= property(GetLabelText
,doc
="See `GetLabelText`")
10843 _core_
.Control_swigregister(Control
)
10844 ControlNameStr
= cvar
.ControlNameStr
10846 def PreControl(*args
, **kwargs
):
10848 PreControl() -> Control
10850 Precreate a Control control for 2-phase creation
10852 val
= _core_
.new_PreControl(*args
, **kwargs
)
10855 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
10857 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10859 Get the default attributes for this class. This is useful if you want
10860 to use the same font or colour in your own control as in a standard
10861 control -- which is a much better idea than hard coding specific
10862 colours or fonts which might look completely out of place on the
10863 user's system, especially if it uses themes.
10865 The variant parameter is only relevant under Mac currently and is
10866 ignore under other platforms. Under Mac, it will change the size of
10867 the returned font. See `wx.Window.SetWindowVariant` for more about
10870 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10872 #---------------------------------------------------------------------------
10874 class ItemContainer(object):
10876 The wx.ItemContainer class defines an interface which is implemented
10877 by all controls which have string subitems, each of which may be
10878 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10879 as `wx.ComboBox` which implements an extended interface deriving from
10882 It defines the methods for accessing the control's items and although
10883 each of the derived classes implements them differently, they still
10884 all conform to the same interface.
10886 The items in a wx.ItemContainer have (non empty) string labels and,
10887 optionally, client data associated with them.
10890 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10891 def __init__(self
): raise AttributeError, "No constructor defined"
10892 __repr__
= _swig_repr
10893 def Append(*args
, **kwargs
):
10895 Append(self, String item, PyObject clientData=None) -> int
10897 Adds the item to the control, associating the given data with the item
10898 if not None. The return value is the index of the newly added item
10899 which may be different from the last one if the control is sorted (e.g.
10900 has wx.LB_SORT or wx.CB_SORT style).
10902 return _core_
.ItemContainer_Append(*args
, **kwargs
)
10904 def AppendItems(*args
, **kwargs
):
10906 AppendItems(self, List strings)
10908 Apend several items at once to the control. Notice that calling this
10909 method may be much faster than appending the items one by one if you
10910 need to add a lot of items.
10912 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
10914 def Insert(*args
, **kwargs
):
10916 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10918 Insert an item into the control before the item at the ``pos`` index,
10919 optionally associating some data object with the item.
10921 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
10923 def Clear(*args
, **kwargs
):
10927 Removes all items from the control.
10929 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
10931 def Delete(*args
, **kwargs
):
10933 Delete(self, unsigned int n)
10935 Deletes the item at the zero-based index 'n' from the control. Note
10936 that it is an error (signalled by a `wx.PyAssertionError` exception if
10937 enabled) to remove an item with the index negative or greater or equal
10938 than the number of items in the control.
10940 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
10942 def GetClientData(*args
, **kwargs
):
10944 GetClientData(self, unsigned int n) -> PyObject
10946 Returns the client data associated with the given item, (if any.)
10948 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
10950 def SetClientData(*args
, **kwargs
):
10952 SetClientData(self, unsigned int n, PyObject clientData)
10954 Associate the given client data with the item at position n.
10956 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
10958 def GetCount(*args
, **kwargs
):
10960 GetCount(self) -> unsigned int
10962 Returns the number of items in the control.
10964 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
10966 def IsEmpty(*args
, **kwargs
):
10968 IsEmpty(self) -> bool
10970 Returns True if the control is empty or False if it has some items.
10972 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
10974 def GetString(*args
, **kwargs
):
10976 GetString(self, unsigned int n) -> String
10978 Returns the label of the item with the given index.
10980 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
10982 def GetStrings(*args
, **kwargs
):
10983 """GetStrings(self) -> wxArrayString"""
10984 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
10986 def SetString(*args
, **kwargs
):
10988 SetString(self, unsigned int n, String s)
10990 Sets the label for the given item.
10992 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
10994 def FindString(*args
, **kwargs
):
10996 FindString(self, String s) -> int
10998 Finds an item whose label matches the given string. Returns the
10999 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11002 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
11004 def SetSelection(*args
, **kwargs
):
11006 SetSelection(self, int n)
11008 Sets the item at index 'n' to be the selected item.
11010 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
11012 def GetSelection(*args
, **kwargs
):
11014 GetSelection(self) -> int
11016 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11019 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
11021 def SetStringSelection(*args
, **kwargs
):
11022 """SetStringSelection(self, String s) -> bool"""
11023 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
11025 def GetStringSelection(*args
, **kwargs
):
11027 GetStringSelection(self) -> String
11029 Returns the label of the selected item or an empty string if no item
11032 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
11034 def Select(*args
, **kwargs
):
11036 Select(self, int n)
11038 This is the same as `SetSelection` and exists only because it is
11039 slightly more natural for controls which support multiple selection.
11041 return _core_
.ItemContainer_Select(*args
, **kwargs
)
11043 def GetItems(self
):
11044 """Return a list of the strings in the control"""
11045 return [self
.GetString(i
) for i
in xrange(self
.GetCount())]
11047 def SetItems(self
, items
):
11048 """Clear and set the strings in the control from a list"""
11053 Count
= property(GetCount
,doc
="See `GetCount`")
11054 Items
= property(GetItems
,SetItems
,doc
="See `GetItems` and `SetItems`")
11055 Selection
= property(GetSelection
,SetSelection
,doc
="See `GetSelection` and `SetSelection`")
11056 StringSelection
= property(GetStringSelection
,SetStringSelection
,doc
="See `GetStringSelection` and `SetStringSelection`")
11057 Strings
= property(GetStrings
,doc
="See `GetStrings`")
11058 _core_
.ItemContainer_swigregister(ItemContainer
)
11060 #---------------------------------------------------------------------------
11062 class ControlWithItems(Control
,ItemContainer
):
11064 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11065 wx.Control class, and is used for the base class of various controls
11068 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11069 def __init__(self
): raise AttributeError, "No constructor defined"
11070 __repr__
= _swig_repr
11071 _core_
.ControlWithItems_swigregister(ControlWithItems
)
11073 #---------------------------------------------------------------------------
11075 class SizerItem(Object
):
11077 The wx.SizerItem class is used to track the position, size and other
11078 attributes of each item managed by a `wx.Sizer`. It is not usually
11079 necessary to use this class because the sizer elements can also be
11080 identified by their positions or window or sizer references but
11081 sometimes it may be more convenient to use wx.SizerItem directly.
11082 Also, custom classes derived from `wx.PySizer` will probably need to
11083 use the collection of wx.SizerItems held by wx.Sizer when calculating
11086 :see: `wx.Sizer`, `wx.GBSizerItem`
11088 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11089 __repr__
= _swig_repr
11090 def __init__(self
, *args
, **kwargs
):
11092 __init__(self) -> SizerItem
11094 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11095 size will need to be set before this item can be used in a Sizer.
11097 You will probably never need to create a wx.SizerItem directly as they
11098 are created automatically when the sizer's Add, Insert or Prepend
11099 methods are called.
11101 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11103 _core_
.SizerItem_swiginit(self
,_core_
.new_SizerItem(*args
, **kwargs
))
11104 __swig_destroy__
= _core_
.delete_SizerItem
11105 __del__
= lambda self
: None;
11106 def DeleteWindows(*args
, **kwargs
):
11108 DeleteWindows(self)
11110 Destroy the window or the windows in a subsizer, depending on the type
11113 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
11115 def DetachSizer(*args
, **kwargs
):
11119 Enable deleting the SizerItem without destroying the contained sizer.
11121 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
11123 def GetSize(*args
, **kwargs
):
11125 GetSize(self) -> Size
11127 Get the current size of the item, as set in the last Layout.
11129 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
11131 def CalcMin(*args
, **kwargs
):
11133 CalcMin(self) -> Size
11135 Calculates the minimum desired size for the item, including any space
11138 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
11140 def SetDimension(*args
, **kwargs
):
11142 SetDimension(self, Point pos, Size size)
11144 Set the position and size of the space allocated for this item by the
11145 sizer, and adjust the position and size of the item (window or
11146 subsizer) to be within that space taking alignment and borders into
11149 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
11151 def GetMinSize(*args
, **kwargs
):
11153 GetMinSize(self) -> Size
11155 Get the minimum size needed for the item.
11157 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
11159 def GetMinSizeWithBorder(*args
, **kwargs
):
11161 GetMinSizeWithBorder(self) -> Size
11163 Get the minimum size needed for the item with space for the borders
11166 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
11168 def SetInitSize(*args
, **kwargs
):
11169 """SetInitSize(self, int x, int y)"""
11170 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
11172 def SetRatioWH(*args
, **kwargs
):
11174 SetRatioWH(self, int width, int height)
11176 Set the ratio item attribute.
11178 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
11180 def SetRatioSize(*args
, **kwargs
):
11182 SetRatioSize(self, Size size)
11184 Set the ratio item attribute.
11186 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
11188 def SetRatio(*args
, **kwargs
):
11190 SetRatio(self, float ratio)
11192 Set the ratio item attribute.
11194 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
11196 def GetRatio(*args
, **kwargs
):
11198 GetRatio(self) -> float
11200 Set the ratio item attribute.
11202 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
11204 def GetRect(*args
, **kwargs
):
11206 GetRect(self) -> Rect
11208 Returns the rectangle that the sizer item should occupy
11210 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
11212 def IsWindow(*args
, **kwargs
):
11214 IsWindow(self) -> bool
11216 Is this sizer item a window?
11218 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
11220 def IsSizer(*args
, **kwargs
):
11222 IsSizer(self) -> bool
11224 Is this sizer item a subsizer?
11226 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
11228 def IsSpacer(*args
, **kwargs
):
11230 IsSpacer(self) -> bool
11232 Is this sizer item a spacer?
11234 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
11236 def SetProportion(*args
, **kwargs
):
11238 SetProportion(self, int proportion)
11240 Set the proportion value for this item.
11242 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
11244 def GetProportion(*args
, **kwargs
):
11246 GetProportion(self) -> int
11248 Get the proportion value for this item.
11250 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
11252 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
11253 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
11254 def SetFlag(*args
, **kwargs
):
11256 SetFlag(self, int flag)
11258 Set the flag value for this item.
11260 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
11262 def GetFlag(*args
, **kwargs
):
11264 GetFlag(self) -> int
11266 Get the flag value for this item.
11268 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
11270 def SetBorder(*args
, **kwargs
):
11272 SetBorder(self, int border)
11274 Set the border value for this item.
11276 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
11278 def GetBorder(*args
, **kwargs
):
11280 GetBorder(self) -> int
11282 Get the border value for this item.
11284 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
11286 def GetWindow(*args
, **kwargs
):
11288 GetWindow(self) -> Window
11290 Get the window (if any) that is managed by this sizer item.
11292 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
11294 def SetWindow(*args
, **kwargs
):
11296 SetWindow(self, Window window)
11298 Set the window to be managed by this sizer item.
11300 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
11302 def GetSizer(*args
, **kwargs
):
11304 GetSizer(self) -> Sizer
11306 Get the subsizer (if any) that is managed by this sizer item.
11308 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
11310 def SetSizer(*args
, **kwargs
):
11312 SetSizer(self, Sizer sizer)
11314 Set the subsizer to be managed by this sizer item.
11316 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
11318 def GetSpacer(*args
, **kwargs
):
11320 GetSpacer(self) -> Size
11322 Get the size of the spacer managed by this sizer item.
11324 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
11326 def SetSpacer(*args
, **kwargs
):
11328 SetSpacer(self, Size size)
11330 Set the size of the spacer to be managed by this sizer item.
11332 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
11334 def Show(*args
, **kwargs
):
11336 Show(self, bool show)
11338 Set the show item attribute, which sizers use to determine if the item
11339 is to be made part of the layout or not. If the item is tracking a
11340 window then it is shown or hidden as needed.
11342 return _core_
.SizerItem_Show(*args
, **kwargs
)
11344 def IsShown(*args
, **kwargs
):
11346 IsShown(self) -> bool
11348 Is the item to be shown in the layout?
11350 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
11352 def GetPosition(*args
, **kwargs
):
11354 GetPosition(self) -> Point
11356 Returns the current position of the item, as set in the last Layout.
11358 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
11360 def GetUserData(*args
, **kwargs
):
11362 GetUserData(self) -> PyObject
11364 Returns the userData associated with this sizer item, or None if there
11367 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
11369 def SetUserData(*args
, **kwargs
):
11371 SetUserData(self, PyObject userData)
11373 Associate a Python object with this sizer item.
11375 return _core_
.SizerItem_SetUserData(*args
, **kwargs
)
11377 _core_
.SizerItem_swigregister(SizerItem
)
11379 def SizerItemWindow(*args
, **kwargs
):
11381 SizerItemWindow(Window window, int proportion, int flag, int border,
11382 PyObject userData=None) -> SizerItem
11384 Constructs a `wx.SizerItem` for tracking a window.
11386 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
11389 def SizerItemSpacer(*args
, **kwargs
):
11391 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11392 PyObject userData=None) -> SizerItem
11394 Constructs a `wx.SizerItem` for tracking a spacer.
11396 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
11399 def SizerItemSizer(*args
, **kwargs
):
11401 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11402 PyObject userData=None) -> SizerItem
11404 Constructs a `wx.SizerItem` for tracking a subsizer
11406 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
11409 class Sizer(Object
):
11411 wx.Sizer is the abstract base class used for laying out subwindows in
11412 a window. You cannot use wx.Sizer directly; instead, you will have to
11413 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11414 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11417 The concept implemented by sizers in wxWidgets is closely related to
11418 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11419 toolkit or the Qt toolkit. It is based upon the idea of the individual
11420 subwindows reporting their minimal required size and their ability to
11421 get stretched if the size of the parent window has changed. This will
11422 most often mean that the programmer does not set the original size of
11423 a dialog in the beginning, rather the dialog will assigned a sizer and
11424 this sizer will be queried about the recommended size. The sizer in
11425 turn will query its children, which can be normal windows or contorls,
11426 empty space or other sizers, so that a hierarchy of sizers can be
11427 constructed. Note that wxSizer does not derive from wxWindow and thus
11428 do not interfere with tab ordering and requires very little resources
11429 compared to a real window on screen.
11431 What makes sizers so well fitted for use in wxWidgets is the fact that
11432 every control reports its own minimal size and the algorithm can
11433 handle differences in font sizes or different window (dialog item)
11434 sizes on different platforms without problems. If for example the
11435 standard font as well as the overall design of Mac widgets requires
11436 more space than on Windows, then the initial size of a dialog using a
11437 sizer will automatically be bigger on Mac than on Windows.
11439 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11440 def __init__(self
): raise AttributeError, "No constructor defined"
11441 __repr__
= _swig_repr
11442 __swig_destroy__
= _core_
.delete_Sizer
11443 __del__
= lambda self
: None;
11444 def _setOORInfo(*args
, **kwargs
):
11445 """_setOORInfo(self, PyObject _self)"""
11446 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
11448 def Add(*args
, **kwargs
):
11450 Add(self, item, int proportion=0, int flag=0, int border=0,
11451 PyObject userData=None) -> wx.SizerItem
11453 Appends a child item to the sizer.
11455 return _core_
.Sizer_Add(*args
, **kwargs
)
11457 def Insert(*args
, **kwargs
):
11459 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11460 PyObject userData=None) -> wx.SizerItem
11462 Inserts a new item into the list of items managed by this sizer before
11463 the item at index *before*. See `Add` for a description of the parameters.
11465 return _core_
.Sizer_Insert(*args
, **kwargs
)
11467 def Prepend(*args
, **kwargs
):
11469 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11470 PyObject userData=None) -> wx.SizerItem
11472 Adds a new item to the begining of the list of sizer items managed by
11473 this sizer. See `Add` for a description of the parameters.
11475 return _core_
.Sizer_Prepend(*args
, **kwargs
)
11477 def Remove(*args
, **kwargs
):
11479 Remove(self, item) -> bool
11481 Removes an item from the sizer and destroys it. This method does not
11482 cause any layout or resizing to take place, call `Layout` to update
11483 the layout on screen after removing a child from the sizer. The
11484 *item* parameter can be either a window, a sizer, or the zero-based
11485 index of an item to remove. Returns True if the child item was found
11488 return _core_
.Sizer_Remove(*args
, **kwargs
)
11490 def Detach(*args
, **kwargs
):
11492 Detach(self, item) -> bool
11494 Detaches an item from the sizer without destroying it. This method
11495 does not cause any layout or resizing to take place, call `Layout` to
11496 do so. The *item* parameter can be either a window, a sizer, or the
11497 zero-based index of the item to be detached. Returns True if the child item
11498 was found and detached.
11500 return _core_
.Sizer_Detach(*args
, **kwargs
)
11502 def GetItem(*args
, **kwargs
):
11504 GetItem(self, item) -> wx.SizerItem
11506 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11507 parameter can be either a window, a sizer, or the zero-based index of
11508 the item to be found.
11510 return _core_
.Sizer_GetItem(*args
, **kwargs
)
11512 def _SetItemMinSize(*args
, **kwargs
):
11513 """_SetItemMinSize(self, PyObject item, Size size)"""
11514 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
11516 def _ReplaceWin(*args
, **kwargs
):
11517 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11518 return _core_
.Sizer__ReplaceWin(*args
, **kwargs
)
11520 def _ReplaceSizer(*args
, **kwargs
):
11521 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11522 return _core_
.Sizer__ReplaceSizer(*args
, **kwargs
)
11524 def _ReplaceItem(*args
, **kwargs
):
11525 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11526 return _core_
.Sizer__ReplaceItem(*args
, **kwargs
)
11528 def Replace(self
, olditem
, item
, recursive
=False):
11530 Detaches the given ``olditem`` from the sizer and replaces it with
11531 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11532 detached child is destroyed only if it is not a window, (because
11533 windows are owned by their parent, not the sizer.) The
11534 ``recursive`` parameter can be used to search for the given
11535 element recursivly in subsizers.
11537 This method does not cause any layout or resizing to take place,
11538 call `Layout` to do so.
11540 Returns ``True`` if the child item was found and removed.
11542 if isinstance(olditem
, wx
.Window
):
11543 return self
._ReplaceWin
(olditem
, item
, recursive
)
11544 elif isinstnace(olditem
, wx
.Sizer
):
11545 return self
._ReplaceSizer
(olditem
, item
, recursive
)
11546 elif isinstnace(olditem
, int):
11547 return self
._ReplaceItem
(olditem
, item
)
11549 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11551 def SetContainingWindow(*args
, **kwargs
):
11553 SetContainingWindow(self, Window window)
11555 Set (or unset) the window this sizer is used in.
11557 return _core_
.Sizer_SetContainingWindow(*args
, **kwargs
)
11559 def GetContainingWindow(*args
, **kwargs
):
11561 GetContainingWindow(self) -> Window
11563 Get the window this sizer is used in.
11565 return _core_
.Sizer_GetContainingWindow(*args
, **kwargs
)
11567 def SetItemMinSize(self
, item
, *args
):
11569 SetItemMinSize(self, item, Size size)
11571 Sets the minimum size that will be allocated for an item in the sizer.
11572 The *item* parameter can be either a window, a sizer, or the
11573 zero-based index of the item. If a window or sizer is given then it
11574 will be searched for recursivly in subsizers if neccessary.
11577 # for backward compatibility accept separate width,height args too
11578 return self
._SetItemMinSize
(item
, args
)
11580 return self
._SetItemMinSize
(item
, args
[0])
11582 def AddItem(*args
, **kwargs
):
11584 AddItem(self, SizerItem item)
11586 Adds a `wx.SizerItem` to the sizer.
11588 return _core_
.Sizer_AddItem(*args
, **kwargs
)
11590 def InsertItem(*args
, **kwargs
):
11592 InsertItem(self, int index, SizerItem item)
11594 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11596 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
11598 def PrependItem(*args
, **kwargs
):
11600 PrependItem(self, SizerItem item)
11602 Prepends a `wx.SizerItem` to the sizer.
11604 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
11606 def AddMany(self
, items
):
11608 AddMany is a convenience method for adding several items
11609 to a sizer at one time. Simply pass it a list of tuples,
11610 where each tuple consists of the parameters that you
11611 would normally pass to the `Add` method.
11614 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
11618 def AddSpacer(self
, *args
, **kw
):
11619 """AddSpacer(int size) --> SizerItem
11621 Add a spacer that is (size,size) pixels.
11623 if args
and type(args
[0]) == int:
11624 return self
.Add( (args
[0],args
[0] ), 0)
11625 else: # otherwise stay compatible with old AddSpacer
11626 return self
.Add(*args
, **kw
)
11627 def PrependSpacer(self
, *args
, **kw
):
11628 """PrependSpacer(int size) --> SizerItem
11630 Prepend a spacer that is (size, size) pixels."""
11631 if args
and type(args
[0]) == int:
11632 return self
.Prepend( (args
[0],args
[0] ), 0)
11633 else: # otherwise stay compatible with old PrependSpacer
11634 return self
.Prepend(*args
, **kw
)
11635 def InsertSpacer(self
, index
, *args
, **kw
):
11636 """InsertSpacer(int index, int size) --> SizerItem
11638 Insert a spacer at position index that is (size, size) pixels."""
11639 if args
and type(args
[0]) == int:
11640 return self
.Insert( index
, (args
[0],args
[0] ), 0)
11641 else: # otherwise stay compatible with old InsertSpacer
11642 return self
.Insert(index
, *args
, **kw
)
11645 def AddStretchSpacer(self
, prop
=1):
11646 """AddStretchSpacer(int prop=1) --> SizerItem
11648 Add a stretchable spacer."""
11649 return self
.Add((0,0), prop
)
11650 def PrependStretchSpacer(self
, prop
=1):
11651 """PrependStretchSpacer(int prop=1) --> SizerItem
11653 Prepend a stretchable spacer."""
11654 return self
.Prepend((0,0), prop
)
11655 def InsertStretchSpacer(self
, index
, prop
=1):
11656 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11658 Insert a stretchable spacer."""
11659 return self
.Insert(index
, (0,0), prop
)
11662 # for backwards compatibility only, please do not use in new code
11663 def AddWindow(self
, *args
, **kw
):
11664 """Compatibility alias for `Add`."""
11665 return self
.Add(*args
, **kw
)
11666 def AddSizer(self
, *args
, **kw
):
11667 """Compatibility alias for `Add`."""
11668 return self
.Add(*args
, **kw
)
11670 def PrependWindow(self
, *args
, **kw
):
11671 """Compatibility alias for `Prepend`."""
11672 return self
.Prepend(*args
, **kw
)
11673 def PrependSizer(self
, *args
, **kw
):
11674 """Compatibility alias for `Prepend`."""
11675 return self
.Prepend(*args
, **kw
)
11677 def InsertWindow(self
, *args
, **kw
):
11678 """Compatibility alias for `Insert`."""
11679 return self
.Insert(*args
, **kw
)
11680 def InsertSizer(self
, *args
, **kw
):
11681 """Compatibility alias for `Insert`."""
11682 return self
.Insert(*args
, **kw
)
11684 def RemoveWindow(self
, *args
, **kw
):
11685 """Compatibility alias for `Remove`."""
11686 return self
.Remove(*args
, **kw
)
11687 def RemoveSizer(self
, *args
, **kw
):
11688 """Compatibility alias for `Remove`."""
11689 return self
.Remove(*args
, **kw
)
11690 def RemovePos(self
, *args
, **kw
):
11691 """Compatibility alias for `Remove`."""
11692 return self
.Remove(*args
, **kw
)
11695 def SetDimension(*args
, **kwargs
):
11697 SetDimension(self, int x, int y, int width, int height)
11699 Call this to force the sizer to take the given dimension and thus
11700 force the items owned by the sizer to resize themselves according to
11701 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11704 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
11706 def SetMinSize(*args
, **kwargs
):
11708 SetMinSize(self, Size size)
11710 Call this to give the sizer a minimal size. Normally, the sizer will
11711 calculate its minimal size based purely on how much space its children
11712 need. After calling this method `GetMinSize` will return either the
11713 minimal size as requested by its children or the minimal size set
11714 here, depending on which is bigger.
11716 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
11718 def GetSize(*args
, **kwargs
):
11720 GetSize(self) -> Size
11722 Returns the current size of the space managed by the sizer.
11724 return _core_
.Sizer_GetSize(*args
, **kwargs
)
11726 def GetPosition(*args
, **kwargs
):
11728 GetPosition(self) -> Point
11730 Returns the current position of the sizer's managed space.
11732 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
11734 def GetMinSize(*args
, **kwargs
):
11736 GetMinSize(self) -> Size
11738 Returns the minimal size of the sizer. This is either the combined
11739 minimal size of all the children and their borders or the minimal size
11740 set by SetMinSize, depending on which is bigger.
11742 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
11744 def GetSizeTuple(self
):
11745 return self
.GetSize().Get()
11746 def GetPositionTuple(self
):
11747 return self
.GetPosition().Get()
11748 def GetMinSizeTuple(self
):
11749 return self
.GetMinSize().Get()
11751 def RecalcSizes(*args
, **kwargs
):
11755 Using the sizes calculated by `CalcMin` reposition and resize all the
11756 items managed by this sizer. You should not need to call this directly as
11757 it is called by `Layout`.
11759 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
11761 def CalcMin(*args
, **kwargs
):
11763 CalcMin(self) -> Size
11765 This method is where the sizer will do the actual calculation of its
11766 children's minimal sizes. You should not need to call this directly as
11767 it is called by `Layout`.
11769 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
11771 def Layout(*args
, **kwargs
):
11775 This method will force the recalculation and layout of the items
11776 controlled by the sizer using the current space allocated to the
11777 sizer. Normally this is called automatically from the owning window's
11778 EVT_SIZE handler, but it is also useful to call it from user code when
11779 one of the items in a sizer change size, or items are added or
11782 return _core_
.Sizer_Layout(*args
, **kwargs
)
11784 def Fit(*args
, **kwargs
):
11786 Fit(self, Window window) -> Size
11788 Tell the sizer to resize the *window* to match the sizer's minimal
11789 size. This is commonly done in the constructor of the window itself in
11790 order to set its initial size to match the needs of the children as
11791 determined by the sizer. Returns the new size.
11793 For a top level window this is the total window size, not the client size.
11795 return _core_
.Sizer_Fit(*args
, **kwargs
)
11797 def FitInside(*args
, **kwargs
):
11799 FitInside(self, Window window)
11801 Tell the sizer to resize the *virtual size* of the *window* to match the
11802 sizer's minimal size. This will not alter the on screen size of the
11803 window, but may cause the addition/removal/alteration of scrollbars
11804 required to view the virtual area in windows which manage it.
11806 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11809 return _core_
.Sizer_FitInside(*args
, **kwargs
)
11811 def SetSizeHints(*args
, **kwargs
):
11813 SetSizeHints(self, Window window)
11815 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11816 match the sizer's minimal size. This is commonly done in the
11817 constructor of the window itself if the window is resizable (as are
11818 many dialogs under Unix and frames on probably all platforms) in order
11819 to prevent the window from being sized smaller than the minimal size
11820 required by the sizer.
11822 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
11824 def SetVirtualSizeHints(*args
, **kwargs
):
11826 SetVirtualSizeHints(self, Window window)
11828 Tell the sizer to set the minimal size of the window virtual area to
11829 match the sizer's minimal size. For windows with managed scrollbars
11830 this will set them appropriately.
11832 :see: `wx.ScrolledWindow.SetScrollbars`
11835 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
11837 def Clear(*args
, **kwargs
):
11839 Clear(self, bool deleteWindows=False)
11841 Clear all items from the sizer, optionally destroying the window items
11844 return _core_
.Sizer_Clear(*args
, **kwargs
)
11846 def DeleteWindows(*args
, **kwargs
):
11848 DeleteWindows(self)
11850 Destroy all windows managed by the sizer.
11852 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
11854 def GetChildren(*args
, **kwargs
):
11856 GetChildren(self) -> list
11858 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11860 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
11862 def Show(*args
, **kwargs
):
11864 Show(self, item, bool show=True, bool recursive=false) -> bool
11866 Shows or hides an item managed by the sizer. To make a sizer item
11867 disappear or reappear, use Show followed by `Layout`. The *item*
11868 parameter can be either a window, a sizer, or the zero-based index of
11869 the item. Use the recursive parameter to show or hide an item in a
11870 subsizer. Returns True if the item was found.
11872 return _core_
.Sizer_Show(*args
, **kwargs
)
11874 def IsShown(*args
, **kwargs
):
11876 IsShown(self, item)
11878 Determines if the item is currently shown. To make a sizer
11879 item disappear or reappear, use Show followed by `Layout`. The *item*
11880 parameter can be either a window, a sizer, or the zero-based index of
11883 return _core_
.Sizer_IsShown(*args
, **kwargs
)
11885 def Hide(self
, item
, recursive
=False):
11887 A convenience method for `Show` (item, False, recursive).
11889 return self
.Show(item
, False, recursive
)
11891 def ShowItems(*args
, **kwargs
):
11893 ShowItems(self, bool show)
11895 Recursively call `wx.SizerItem.Show` on all sizer items.
11897 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
11899 _core_
.Sizer_swigregister(Sizer
)
11901 class PySizer(Sizer
):
11903 wx.PySizer is a special version of `wx.Sizer` that has been
11904 instrumented to allow the C++ virtual methods to be overloaded in
11905 Python derived classes. You would derive from this class if you are
11906 wanting to implement a custom sizer in Python code. Simply implement
11907 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11910 class MySizer(wx.PySizer):
11911 def __init__(self):
11912 wx.PySizer.__init__(self)
11915 for item in self.GetChildren():
11916 # calculate the total minimum width and height needed
11917 # by all items in the sizer according to this sizer's
11918 # layout algorithm.
11920 return wx.Size(width, height)
11922 def RecalcSizes(self):
11923 # find the space allotted to this sizer
11924 pos = self.GetPosition()
11925 size = self.GetSize()
11926 for item in self.GetChildren():
11927 # Recalculate (if necessary) the position and size of
11928 # each item and then call item.SetDimension to do the
11929 # actual positioning and sizing of the items within the
11930 # space alloted to this sizer.
11932 item.SetDimension(itemPos, itemSize)
11935 When `Layout` is called it first calls `CalcMin` followed by
11936 `RecalcSizes` so you can optimize a bit by saving the results of
11937 `CalcMin` and reusing them in `RecalcSizes`.
11939 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11943 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11944 __repr__
= _swig_repr
11945 def __init__(self
, *args
, **kwargs
):
11947 __init__(self) -> PySizer
11949 Creates a wx.PySizer. Must be called from the __init__ in the derived
11952 _core_
.PySizer_swiginit(self
,_core_
.new_PySizer(*args
, **kwargs
))
11953 self
._setCallbackInfo
(self
, PySizer
);self
._setOORInfo
(self
)
11955 def _setCallbackInfo(*args
, **kwargs
):
11956 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11957 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
11959 _core_
.PySizer_swigregister(PySizer
)
11961 #---------------------------------------------------------------------------
11963 class BoxSizer(Sizer
):
11965 The basic idea behind a box sizer is that windows will most often be
11966 laid out in rather simple basic geometry, typically in a row or a
11967 column or nested hierarchies of either. A wx.BoxSizer will lay out
11968 its items in a simple row or column, depending on the orientation
11969 parameter passed to the constructor.
11971 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11972 __repr__
= _swig_repr
11973 def __init__(self
, *args
, **kwargs
):
11975 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11977 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11978 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11981 _core_
.BoxSizer_swiginit(self
,_core_
.new_BoxSizer(*args
, **kwargs
))
11982 self
._setOORInfo
(self
)
11984 def GetOrientation(*args
, **kwargs
):
11986 GetOrientation(self) -> int
11988 Returns the current orientation of the sizer.
11990 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
11992 def SetOrientation(*args
, **kwargs
):
11994 SetOrientation(self, int orient)
11996 Resets the orientation of the sizer.
11998 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
12000 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
12001 _core_
.BoxSizer_swigregister(BoxSizer
)
12003 #---------------------------------------------------------------------------
12005 class StaticBoxSizer(BoxSizer
):
12007 wx.StaticBoxSizer derives from and functions identically to the
12008 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12009 manages. Note that this static box must be created separately and
12010 passed to the sizer constructor.
12012 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12013 __repr__
= _swig_repr
12014 def __init__(self
, *args
, **kwargs
):
12016 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12018 Constructor. It takes an associated static box and the orientation
12019 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12022 _core_
.StaticBoxSizer_swiginit(self
,_core_
.new_StaticBoxSizer(*args
, **kwargs
))
12023 self
._setOORInfo
(self
)
12025 def GetStaticBox(*args
, **kwargs
):
12027 GetStaticBox(self) -> StaticBox
12029 Returns the static box associated with this sizer.
12031 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
12033 _core_
.StaticBoxSizer_swigregister(StaticBoxSizer
)
12035 #---------------------------------------------------------------------------
12037 class GridSizer(Sizer
):
12039 A grid sizer is a sizer which lays out its children in a
12040 two-dimensional table with all cells having the same size. In other
12041 words, the width of each cell within the grid is the width of the
12042 widest item added to the sizer and the height of each grid cell is the
12043 height of the tallest item. An optional vertical and/or horizontal
12044 gap between items can also be specified (in pixels.)
12046 Items are placed in the cells of the grid in the order they are added,
12047 in row-major order. In other words, the first row is filled first,
12048 then the second, and so on until all items have been added. (If
12049 neccessary, additional rows will be added as items are added.) If you
12050 need to have greater control over the cells that items are placed in
12051 then use the `wx.GridBagSizer`.
12054 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12055 __repr__
= _swig_repr
12056 def __init__(self
, *args
, **kwargs
):
12058 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12060 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12061 of columns and rows in the sizer - if either of the parameters is
12062 zero, it will be calculated to from the total number of children in
12063 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12064 define extra space between all children.
12066 _core_
.GridSizer_swiginit(self
,_core_
.new_GridSizer(*args
, **kwargs
))
12067 self
._setOORInfo
(self
)
12069 def SetCols(*args
, **kwargs
):
12071 SetCols(self, int cols)
12073 Sets the number of columns in the sizer.
12075 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
12077 def SetRows(*args
, **kwargs
):
12079 SetRows(self, int rows)
12081 Sets the number of rows in the sizer.
12083 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
12085 def SetVGap(*args
, **kwargs
):
12087 SetVGap(self, int gap)
12089 Sets the vertical gap (in pixels) between the cells in the sizer.
12091 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
12093 def SetHGap(*args
, **kwargs
):
12095 SetHGap(self, int gap)
12097 Sets the horizontal gap (in pixels) between cells in the sizer
12099 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
12101 def GetCols(*args
, **kwargs
):
12103 GetCols(self) -> int
12105 Returns the number of columns in the sizer.
12107 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
12109 def GetRows(*args
, **kwargs
):
12111 GetRows(self) -> int
12113 Returns the number of rows in the sizer.
12115 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
12117 def GetVGap(*args
, **kwargs
):
12119 GetVGap(self) -> int
12121 Returns the vertical gap (in pixels) between the cells in the sizer.
12123 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
12125 def GetHGap(*args
, **kwargs
):
12127 GetHGap(self) -> int
12129 Returns the horizontal gap (in pixels) between cells in the sizer.
12131 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
12133 def CalcRowsCols(self
):
12135 CalcRowsCols() -> (rows, cols)
12137 Calculates how many rows and columns will be in the sizer based
12138 on the current number of items and also the rows, cols specified
12139 in the constructor.
12141 nitems
= len(self
.GetChildren())
12142 rows
= self
.GetRows()
12143 cols
= self
.GetCols()
12144 assert rows
!= 0 or cols
!= 0, "Grid sizer must have either rows or columns fixed"
12146 rows
= (nitems
+ cols
- 1) / cols
12148 cols
= (nitems
+ rows
- 1) / rows
12149 return (rows
, cols
)
12151 Cols
= property(GetCols
,SetCols
,doc
="See `GetCols` and `SetCols`")
12152 HGap
= property(GetHGap
,SetHGap
,doc
="See `GetHGap` and `SetHGap`")
12153 Rows
= property(GetRows
,SetRows
,doc
="See `GetRows` and `SetRows`")
12154 VGap
= property(GetVGap
,SetVGap
,doc
="See `GetVGap` and `SetVGap`")
12155 _core_
.GridSizer_swigregister(GridSizer
)
12157 #---------------------------------------------------------------------------
12159 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
12160 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
12161 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
12162 class FlexGridSizer(GridSizer
):
12164 A flex grid sizer is a sizer which lays out its children in a
12165 two-dimensional table with all table cells in one row having the same
12166 height and all cells in one column having the same width, but all
12167 rows or all columns are not necessarily the same height or width as in
12168 the `wx.GridSizer`.
12170 wx.FlexGridSizer can also size items equally in one direction but
12171 unequally ("flexibly") in the other. If the sizer is only flexible
12172 in one direction (this can be changed using `SetFlexibleDirection`), it
12173 needs to be decided how the sizer should grow in the other ("non
12174 flexible") direction in order to fill the available space. The
12175 `SetNonFlexibleGrowMode` method serves this purpose.
12179 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12180 __repr__
= _swig_repr
12181 def __init__(self
, *args
, **kwargs
):
12183 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12185 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12186 number of columns and rows in the sizer - if either of the parameters
12187 is zero, it will be calculated to from the total number of children in
12188 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12189 define extra space between all children.
12191 _core_
.FlexGridSizer_swiginit(self
,_core_
.new_FlexGridSizer(*args
, **kwargs
))
12192 self
._setOORInfo
(self
)
12194 def AddGrowableRow(*args
, **kwargs
):
12196 AddGrowableRow(self, size_t idx, int proportion=0)
12198 Specifies that row *idx* (starting from zero) should be grown if there
12199 is extra space available to the sizer.
12201 The *proportion* parameter has the same meaning as the stretch factor
12202 for the box sizers except that if all proportions are 0, then all
12203 columns are resized equally (instead of not being resized at all).
12205 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
12207 def RemoveGrowableRow(*args
, **kwargs
):
12209 RemoveGrowableRow(self, size_t idx)
12211 Specifies that row *idx* is no longer growable.
12213 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
12215 def AddGrowableCol(*args
, **kwargs
):
12217 AddGrowableCol(self, size_t idx, int proportion=0)
12219 Specifies that column *idx* (starting from zero) should be grown if
12220 there is extra space available to the sizer.
12222 The *proportion* parameter has the same meaning as the stretch factor
12223 for the box sizers except that if all proportions are 0, then all
12224 columns are resized equally (instead of not being resized at all).
12226 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
12228 def RemoveGrowableCol(*args
, **kwargs
):
12230 RemoveGrowableCol(self, size_t idx)
12232 Specifies that column *idx* is no longer growable.
12234 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
12236 def SetFlexibleDirection(*args
, **kwargs
):
12238 SetFlexibleDirection(self, int direction)
12240 Specifies whether the sizer should flexibly resize its columns, rows,
12241 or both. Argument *direction* can be one of the following values. Any
12242 other value is ignored.
12244 ============== =======================================
12245 wx.VERTICAL Rows are flexibly sized.
12246 wx.HORIZONTAL Columns are flexibly sized.
12247 wx.BOTH Both rows and columns are flexibly sized
12248 (this is the default value).
12249 ============== =======================================
12251 Note that this method does not trigger relayout.
12254 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
12256 def GetFlexibleDirection(*args
, **kwargs
):
12258 GetFlexibleDirection(self) -> int
12260 Returns a value that specifies whether the sizer
12261 flexibly resizes its columns, rows, or both (default).
12263 :see: `SetFlexibleDirection`
12265 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
12267 def SetNonFlexibleGrowMode(*args
, **kwargs
):
12269 SetNonFlexibleGrowMode(self, int mode)
12271 Specifies how the sizer should grow in the non-flexible direction if
12272 there is one (so `SetFlexibleDirection` must have been called
12273 previously). Argument *mode* can be one of the following values:
12275 ========================== =================================================
12276 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12277 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12278 `AddGrowableCol` and `AddGrowableRow`. In this
12279 case equal sizing applies to minimum sizes of
12280 columns or rows (this is the default value).
12281 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12282 the non flexible direction, whether they are
12283 growable or not in the flexbile direction.
12284 ========================== =================================================
12286 Note that this method does not trigger relayout.
12288 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
12290 def GetNonFlexibleGrowMode(*args
, **kwargs
):
12292 GetNonFlexibleGrowMode(self) -> int
12294 Returns the value that specifies how the sizer grows in the
12295 non-flexible direction if there is one.
12297 :see: `SetNonFlexibleGrowMode`
12299 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
12301 def GetRowHeights(*args
, **kwargs
):
12303 GetRowHeights(self) -> list
12305 Returns a list of integers representing the heights of each of the
12308 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
12310 def GetColWidths(*args
, **kwargs
):
12312 GetColWidths(self) -> list
12314 Returns a list of integers representing the widths of each of the
12315 columns in the sizer.
12317 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
12319 ColWidths
= property(GetColWidths
,doc
="See `GetColWidths`")
12320 FlexibleDirection
= property(GetFlexibleDirection
,SetFlexibleDirection
,doc
="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12321 NonFlexibleGrowMode
= property(GetNonFlexibleGrowMode
,SetNonFlexibleGrowMode
,doc
="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12322 RowHeights
= property(GetRowHeights
,doc
="See `GetRowHeights`")
12323 _core_
.FlexGridSizer_swigregister(FlexGridSizer
)
12325 class StdDialogButtonSizer(BoxSizer
):
12327 A special sizer that knows how to order and position standard buttons
12328 in order to conform to the current platform's standards. You simply
12329 need to add each `wx.Button` to the sizer, and be sure to create the
12330 buttons using the standard ID's. Then call `Realize` and the sizer
12331 will take care of the rest.
12334 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12335 __repr__
= _swig_repr
12336 def __init__(self
, *args
, **kwargs
):
12337 """__init__(self) -> StdDialogButtonSizer"""
12338 _core_
.StdDialogButtonSizer_swiginit(self
,_core_
.new_StdDialogButtonSizer(*args
, **kwargs
))
12339 def AddButton(*args
, **kwargs
):
12341 AddButton(self, wxButton button)
12343 Use this to add the buttons to this sizer. Do not use the `Add`
12344 method in the base class.
12346 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
12348 def Realize(*args
, **kwargs
):
12352 This funciton needs to be called after all the buttons have been added
12353 to the sizer. It will reorder them and position them in a platform
12356 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
12358 def SetAffirmativeButton(*args
, **kwargs
):
12359 """SetAffirmativeButton(self, wxButton button)"""
12360 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
12362 def SetNegativeButton(*args
, **kwargs
):
12363 """SetNegativeButton(self, wxButton button)"""
12364 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
12366 def SetCancelButton(*args
, **kwargs
):
12367 """SetCancelButton(self, wxButton button)"""
12368 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
12370 def GetAffirmativeButton(*args
, **kwargs
):
12371 """GetAffirmativeButton(self) -> wxButton"""
12372 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
12374 def GetApplyButton(*args
, **kwargs
):
12375 """GetApplyButton(self) -> wxButton"""
12376 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
12378 def GetNegativeButton(*args
, **kwargs
):
12379 """GetNegativeButton(self) -> wxButton"""
12380 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
12382 def GetCancelButton(*args
, **kwargs
):
12383 """GetCancelButton(self) -> wxButton"""
12384 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
12386 def GetHelpButton(*args
, **kwargs
):
12387 """GetHelpButton(self) -> wxButton"""
12388 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
12390 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizer
)
12392 #---------------------------------------------------------------------------
12394 class GBPosition(object):
12396 This class represents the position of an item in a virtual grid of
12397 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12398 typemaps that will automatically convert from a 2-element sequence of
12399 integers to a wx.GBPosition, so you can use the more pythonic
12400 representation of the position nearly transparently in Python code.
12402 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12403 __repr__
= _swig_repr
12404 def __init__(self
, *args
, **kwargs
):
12406 __init__(self, int row=0, int col=0) -> GBPosition
12408 This class represents the position of an item in a virtual grid of
12409 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12410 typemaps that will automatically convert from a 2-element sequence of
12411 integers to a wx.GBPosition, so you can use the more pythonic
12412 representation of the position nearly transparently in Python code.
12414 _core_
.GBPosition_swiginit(self
,_core_
.new_GBPosition(*args
, **kwargs
))
12415 __swig_destroy__
= _core_
.delete_GBPosition
12416 __del__
= lambda self
: None;
12417 def GetRow(*args
, **kwargs
):
12418 """GetRow(self) -> int"""
12419 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
12421 def GetCol(*args
, **kwargs
):
12422 """GetCol(self) -> int"""
12423 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
12425 def SetRow(*args
, **kwargs
):
12426 """SetRow(self, int row)"""
12427 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
12429 def SetCol(*args
, **kwargs
):
12430 """SetCol(self, int col)"""
12431 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
12433 def __eq__(*args
, **kwargs
):
12435 __eq__(self, PyObject other) -> bool
12437 Compare GBPosition for equality.
12439 return _core_
.GBPosition___eq__(*args
, **kwargs
)
12441 def __ne__(*args
, **kwargs
):
12443 __ne__(self, PyObject other) -> bool
12445 Compare GBPosition for inequality.
12447 return _core_
.GBPosition___ne__(*args
, **kwargs
)
12449 def Set(*args
, **kwargs
):
12450 """Set(self, int row=0, int col=0)"""
12451 return _core_
.GBPosition_Set(*args
, **kwargs
)
12453 def Get(*args
, **kwargs
):
12454 """Get(self) -> PyObject"""
12455 return _core_
.GBPosition_Get(*args
, **kwargs
)
12457 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12458 def __str__(self
): return str(self
.Get())
12459 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
12460 def __len__(self
): return len(self
.Get())
12461 def __getitem__(self
, index
): return self
.Get()[index
]
12462 def __setitem__(self
, index
, val
):
12463 if index
== 0: self
.SetRow(val
)
12464 elif index
== 1: self
.SetCol(val
)
12465 else: raise IndexError
12466 def __nonzero__(self
): return self
.Get() != (0,0)
12467 __safe_for_unpickling__
= True
12468 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
12470 row
= property(GetRow
, SetRow
)
12471 col
= property(GetCol
, SetCol
)
12473 _core_
.GBPosition_swigregister(GBPosition
)
12475 class GBSpan(object):
12477 This class is used to hold the row and column spanning attributes of
12478 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12479 automatically convert from a 2-element sequence of integers to a
12480 wx.GBSpan, so you can use the more pythonic representation of the span
12481 nearly transparently in Python code.
12484 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12485 __repr__
= _swig_repr
12486 def __init__(self
, *args
, **kwargs
):
12488 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12490 Construct a new wxGBSpan, optionally setting the rowspan and
12491 colspan. The default is (1,1). (Meaning that the item occupies one
12492 cell in each direction.
12494 _core_
.GBSpan_swiginit(self
,_core_
.new_GBSpan(*args
, **kwargs
))
12495 __swig_destroy__
= _core_
.delete_GBSpan
12496 __del__
= lambda self
: None;
12497 def GetRowspan(*args
, **kwargs
):
12498 """GetRowspan(self) -> int"""
12499 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
12501 def GetColspan(*args
, **kwargs
):
12502 """GetColspan(self) -> int"""
12503 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
12505 def SetRowspan(*args
, **kwargs
):
12506 """SetRowspan(self, int rowspan)"""
12507 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
12509 def SetColspan(*args
, **kwargs
):
12510 """SetColspan(self, int colspan)"""
12511 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
12513 def __eq__(*args
, **kwargs
):
12515 __eq__(self, PyObject other) -> bool
12517 Compare wxGBSpan for equality.
12519 return _core_
.GBSpan___eq__(*args
, **kwargs
)
12521 def __ne__(*args
, **kwargs
):
12523 __ne__(self, PyObject other) -> bool
12525 Compare GBSpan for inequality.
12527 return _core_
.GBSpan___ne__(*args
, **kwargs
)
12529 def Set(*args
, **kwargs
):
12530 """Set(self, int rowspan=1, int colspan=1)"""
12531 return _core_
.GBSpan_Set(*args
, **kwargs
)
12533 def Get(*args
, **kwargs
):
12534 """Get(self) -> PyObject"""
12535 return _core_
.GBSpan_Get(*args
, **kwargs
)
12537 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12538 def __str__(self
): return str(self
.Get())
12539 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
12540 def __len__(self
): return len(self
.Get())
12541 def __getitem__(self
, index
): return self
.Get()[index
]
12542 def __setitem__(self
, index
, val
):
12543 if index
== 0: self
.SetRowspan(val
)
12544 elif index
== 1: self
.SetColspan(val
)
12545 else: raise IndexError
12546 def __nonzero__(self
): return self
.Get() != (0,0)
12547 __safe_for_unpickling__
= True
12548 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
12550 rowspan
= property(GetRowspan
, SetRowspan
)
12551 colspan
= property(GetColspan
, SetColspan
)
12553 _core_
.GBSpan_swigregister(GBSpan
)
12555 class GBSizerItem(SizerItem
):
12557 The wx.GBSizerItem class is used to track the additional data about
12558 items in a `wx.GridBagSizer` such as the item's position in the grid
12559 and how many rows or columns it spans.
12562 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12563 __repr__
= _swig_repr
12564 def __init__(self
, *args
, **kwargs
):
12566 __init__(self) -> GBSizerItem
12568 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12569 size will need to be set, as well as a position and span before this
12570 item can be used in a Sizer.
12572 You will probably never need to create a wx.GBSizerItem directly as they
12573 are created automatically when the sizer's Add method is called.
12575 _core_
.GBSizerItem_swiginit(self
,_core_
.new_GBSizerItem(*args
, **kwargs
))
12576 __swig_destroy__
= _core_
.delete_GBSizerItem
12577 __del__
= lambda self
: None;
12578 def GetPos(*args
, **kwargs
):
12580 GetPos(self) -> GBPosition
12582 Get the grid position of the item
12584 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
12586 def GetPosTuple(self
): return self
.GetPos().Get()
12587 def GetSpan(*args
, **kwargs
):
12589 GetSpan(self) -> GBSpan
12591 Get the row and column spanning of the item
12593 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
12595 def GetSpanTuple(self
): return self
.GetSpan().Get()
12596 def SetPos(*args
, **kwargs
):
12598 SetPos(self, GBPosition pos) -> bool
12600 If the item is already a member of a sizer then first ensure that
12601 there is no other item that would intersect with this one at the new
12602 position, then set the new position. Returns True if the change is
12603 successful and after the next Layout() the item will be moved.
12605 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
12607 def SetSpan(*args
, **kwargs
):
12609 SetSpan(self, GBSpan span) -> bool
12611 If the item is already a member of a sizer then first ensure that
12612 there is no other item that would intersect with this one with its new
12613 spanning size, then set the new spanning. Returns True if the change
12614 is successful and after the next Layout() the item will be resized.
12617 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
12619 def Intersects(*args
, **kwargs
):
12621 Intersects(self, GBSizerItem other) -> bool
12623 Returns True if this item and the other item instersect.
12625 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
12627 def IntersectsPos(*args
, **kwargs
):
12629 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12631 Returns True if the given pos/span would intersect with this item.
12633 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
12635 def GetEndPos(*args
, **kwargs
):
12637 GetEndPos(self) -> GBPosition
12639 Get the row and column of the endpoint of this item.
12641 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
12643 def GetGBSizer(*args
, **kwargs
):
12645 GetGBSizer(self) -> GridBagSizer
12647 Get the sizer this item is a member of.
12649 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
12651 def SetGBSizer(*args
, **kwargs
):
12653 SetGBSizer(self, GridBagSizer sizer)
12655 Set the sizer this item is a member of.
12657 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
12659 EndPos
= property(GetEndPos
,doc
="See `GetEndPos`")
12660 GBSizer
= property(GetGBSizer
,SetGBSizer
,doc
="See `GetGBSizer` and `SetGBSizer`")
12661 Pos
= property(GetPos
,SetPos
,doc
="See `GetPos` and `SetPos`")
12662 Span
= property(GetSpan
,SetSpan
,doc
="See `GetSpan` and `SetSpan`")
12663 _core_
.GBSizerItem_swigregister(GBSizerItem
)
12664 DefaultSpan
= cvar
.DefaultSpan
12666 def GBSizerItemWindow(*args
, **kwargs
):
12668 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12669 int border, PyObject userData=None) -> GBSizerItem
12671 Construct a `wx.GBSizerItem` for a window.
12673 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
12676 def GBSizerItemSizer(*args
, **kwargs
):
12678 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12679 int border, PyObject userData=None) -> GBSizerItem
12681 Construct a `wx.GBSizerItem` for a sizer
12683 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
12686 def GBSizerItemSpacer(*args
, **kwargs
):
12688 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12689 int flag, int border, PyObject userData=None) -> GBSizerItem
12691 Construct a `wx.GBSizerItem` for a spacer.
12693 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
12696 class GridBagSizer(FlexGridSizer
):
12698 A `wx.Sizer` that can lay out items in a virtual grid like a
12699 `wx.FlexGridSizer` but in this case explicit positioning of the items
12700 is allowed using `wx.GBPosition`, and items can optionally span more
12701 than one row and/or column using `wx.GBSpan`. The total size of the
12702 virtual grid is determined by the largest row and column that items are
12703 positioned at, adjusted for spanning.
12706 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12707 __repr__
= _swig_repr
12708 def __init__(self
, *args
, **kwargs
):
12710 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12712 Constructor, with optional parameters to specify the gap between the
12715 _core_
.GridBagSizer_swiginit(self
,_core_
.new_GridBagSizer(*args
, **kwargs
))
12716 self
._setOORInfo
(self
)
12718 def Add(*args
, **kwargs
):
12720 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12721 int border=0, userData=None) -> wx.GBSizerItem
12723 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12724 more than one row or column as specified with *span*. The remaining
12725 args behave similarly to `wx.Sizer.Add`.
12727 Returns True if the item was successfully placed at the given cell
12728 position, False if something was already there.
12731 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
12733 def AddItem(*args
, **kwargs
):
12735 Add(self, GBSizerItem item) -> wx.GBSizerItem
12737 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12738 the item was successfully placed at its given cell position, False if
12739 something was already there.
12741 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
12743 def GetCellSize(*args
, **kwargs
):
12745 GetCellSize(self, int row, int col) -> Size
12747 Get the size of the specified cell, including hgap and
12748 vgap. Only valid after a Layout.
12750 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
12752 def GetEmptyCellSize(*args
, **kwargs
):
12754 GetEmptyCellSize(self) -> Size
12756 Get the size used for cells in the grid with no item.
12758 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
12760 def SetEmptyCellSize(*args
, **kwargs
):
12762 SetEmptyCellSize(self, Size sz)
12764 Set the size used for cells in the grid with no item.
12766 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
12768 def GetItemPosition(*args
):
12770 GetItemPosition(self, item) -> GBPosition
12772 Get the grid position of the specified *item* where *item* is either a
12773 window or subsizer that is a member of this sizer, or a zero-based
12776 return _core_
.GridBagSizer_GetItemPosition(*args
)
12778 def SetItemPosition(*args
):
12780 SetItemPosition(self, item, GBPosition pos) -> bool
12782 Set the grid position of the specified *item* where *item* is either a
12783 window or subsizer that is a member of this sizer, or a zero-based
12784 index of an item. Returns True on success. If the move is not
12785 allowed (because an item is already there) then False is returned.
12788 return _core_
.GridBagSizer_SetItemPosition(*args
)
12790 def GetItemSpan(*args
):
12792 GetItemSpan(self, item) -> GBSpan
12794 Get the row/col spanning of the specified *item* where *item* is
12795 either a window or subsizer that is a member of this sizer, or a
12796 zero-based index of an item.
12798 return _core_
.GridBagSizer_GetItemSpan(*args
)
12800 def SetItemSpan(*args
):
12802 SetItemSpan(self, item, GBSpan span) -> bool
12804 Set the row/col spanning of the specified *item* where *item* is
12805 either a window or subsizer that is a member of this sizer, or a
12806 zero-based index of an item. Returns True on success. If the move is
12807 not allowed (because an item is already there) then False is returned.
12809 return _core_
.GridBagSizer_SetItemSpan(*args
)
12811 def FindItem(*args
):
12813 FindItem(self, item) -> GBSizerItem
12815 Find the sizer item for the given window or subsizer, returns None if
12816 not found. (non-recursive)
12818 return _core_
.GridBagSizer_FindItem(*args
)
12820 def FindItemAtPosition(*args
, **kwargs
):
12822 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12824 Return the sizer item for the given grid cell, or None if there is no
12825 item at that position. (non-recursive)
12827 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
12829 def FindItemAtPoint(*args
, **kwargs
):
12831 FindItemAtPoint(self, Point pt) -> GBSizerItem
12833 Return the sizer item located at the point given in *pt*, or None if
12834 there is no item at that point. The (x,y) coordinates in pt correspond
12835 to the client coordinates of the window using the sizer for
12836 layout. (non-recursive)
12838 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
12840 def CheckForIntersection(*args
, **kwargs
):
12842 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12844 Look at all items and see if any intersect (or would overlap) the
12845 given *item*. Returns True if so, False if there would be no overlap.
12846 If an *excludeItem* is given then it will not be checked for
12847 intersection, for example it may be the item we are checking the
12851 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
12853 def CheckForIntersectionPos(*args
, **kwargs
):
12855 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12857 Look at all items and see if any intersect (or would overlap) the
12858 given position and span. Returns True if so, False if there would be
12859 no overlap. If an *excludeItem* is given then it will not be checked
12860 for intersection, for example it may be the item we are checking the
12863 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
12865 _core_
.GridBagSizer_swigregister(GridBagSizer
)
12867 #---------------------------------------------------------------------------
12871 Right
= _core_
.Right
12872 Bottom
= _core_
.Bottom
12873 Width
= _core_
.Width
12874 Height
= _core_
.Height
12875 Centre
= _core_
.Centre
12876 Center
= _core_
.Center
12877 CentreX
= _core_
.CentreX
12878 CentreY
= _core_
.CentreY
12879 Unconstrained
= _core_
.Unconstrained
12881 PercentOf
= _core_
.PercentOf
12882 Above
= _core_
.Above
12883 Below
= _core_
.Below
12884 LeftOf
= _core_
.LeftOf
12885 RightOf
= _core_
.RightOf
12886 SameAs
= _core_
.SameAs
12887 Absolute
= _core_
.Absolute
12888 class IndividualLayoutConstraint(Object
):
12890 Objects of this class are stored in the `wx.LayoutConstraints` class as
12891 one of eight possible constraints that a window can be involved in.
12892 You will never need to create an instance of
12893 wx.IndividualLayoutConstraint, rather you should create a
12894 `wx.LayoutConstraints` instance and use the individual contstraints
12897 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12898 def __init__(self
): raise AttributeError, "No constructor defined"
12899 __repr__
= _swig_repr
12900 def Set(*args
, **kwargs
):
12902 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12904 Sets the properties of the constraint. Normally called by one of the
12905 convenience functions such as Above, RightOf, SameAs.
12907 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
12909 def LeftOf(*args
, **kwargs
):
12911 LeftOf(self, Window sibling, int marg=0)
12913 Constrains this edge to be to the left of the given window, with an
12914 optional margin. Implicitly, this is relative to the left edge of the
12917 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
12919 def RightOf(*args
, **kwargs
):
12921 RightOf(self, Window sibling, int marg=0)
12923 Constrains this edge to be to the right of the given window, with an
12924 optional margin. Implicitly, this is relative to the right edge of the
12927 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
12929 def Above(*args
, **kwargs
):
12931 Above(self, Window sibling, int marg=0)
12933 Constrains this edge to be above the given window, with an optional
12934 margin. Implicitly, this is relative to the top edge of the other
12937 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
12939 def Below(*args
, **kwargs
):
12941 Below(self, Window sibling, int marg=0)
12943 Constrains this edge to be below the given window, with an optional
12944 margin. Implicitly, this is relative to the bottom edge of the other
12947 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
12949 def SameAs(*args
, **kwargs
):
12951 SameAs(self, Window otherW, int edge, int marg=0)
12953 Constrains this edge or dimension to be to the same as the edge of the
12954 given window, with an optional margin.
12956 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
12958 def PercentOf(*args
, **kwargs
):
12960 PercentOf(self, Window otherW, int wh, int per)
12962 Constrains this edge or dimension to be to a percentage of the given
12963 window, with an optional margin.
12965 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
12967 def Absolute(*args
, **kwargs
):
12969 Absolute(self, int val)
12971 Constrains this edge or dimension to be the given absolute value.
12973 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
12975 def Unconstrained(*args
, **kwargs
):
12977 Unconstrained(self)
12979 Sets this edge or dimension to be unconstrained, that is, dependent on
12980 other edges and dimensions from which this value can be deduced.
12982 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
12984 def AsIs(*args
, **kwargs
):
12988 Sets this edge or constraint to be whatever the window's value is at
12989 the moment. If either of the width and height constraints are *as is*,
12990 the window will not be resized, but moved instead. This is important
12991 when considering panel items which are intended to have a default
12992 size, such as a button, which may take its size from the size of the
12995 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
12997 def GetOtherWindow(*args
, **kwargs
):
12998 """GetOtherWindow(self) -> Window"""
12999 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
13001 def GetMyEdge(*args
, **kwargs
):
13002 """GetMyEdge(self) -> int"""
13003 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
13005 def SetEdge(*args
, **kwargs
):
13006 """SetEdge(self, int which)"""
13007 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
13009 def SetValue(*args
, **kwargs
):
13010 """SetValue(self, int v)"""
13011 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
13013 def GetMargin(*args
, **kwargs
):
13014 """GetMargin(self) -> int"""
13015 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
13017 def SetMargin(*args
, **kwargs
):
13018 """SetMargin(self, int m)"""
13019 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
13021 def GetValue(*args
, **kwargs
):
13022 """GetValue(self) -> int"""
13023 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
13025 def GetPercent(*args
, **kwargs
):
13026 """GetPercent(self) -> int"""
13027 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
13029 def GetOtherEdge(*args
, **kwargs
):
13030 """GetOtherEdge(self) -> int"""
13031 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
13033 def GetDone(*args
, **kwargs
):
13034 """GetDone(self) -> bool"""
13035 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
13037 def SetDone(*args
, **kwargs
):
13038 """SetDone(self, bool d)"""
13039 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
13041 def GetRelationship(*args
, **kwargs
):
13042 """GetRelationship(self) -> int"""
13043 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
13045 def SetRelationship(*args
, **kwargs
):
13046 """SetRelationship(self, int r)"""
13047 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
13049 def ResetIfWin(*args
, **kwargs
):
13051 ResetIfWin(self, Window otherW) -> bool
13053 Reset constraint if it mentions otherWin
13055 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
13057 def SatisfyConstraint(*args
, **kwargs
):
13059 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13061 Try to satisfy constraint
13063 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
13065 def GetEdge(*args
, **kwargs
):
13067 GetEdge(self, int which, Window thisWin, Window other) -> int
13069 Get the value of this edge or dimension, or if this
13070 is not determinable, -1.
13072 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
13074 Done
= property(GetDone
,SetDone
,doc
="See `GetDone` and `SetDone`")
13075 Margin
= property(GetMargin
,SetMargin
,doc
="See `GetMargin` and `SetMargin`")
13076 MyEdge
= property(GetMyEdge
,doc
="See `GetMyEdge`")
13077 OtherEdge
= property(GetOtherEdge
,doc
="See `GetOtherEdge`")
13078 OtherWindow
= property(GetOtherWindow
,doc
="See `GetOtherWindow`")
13079 Percent
= property(GetPercent
,doc
="See `GetPercent`")
13080 Relationship
= property(GetRelationship
,SetRelationship
,doc
="See `GetRelationship` and `SetRelationship`")
13081 Value
= property(GetValue
,SetValue
,doc
="See `GetValue` and `SetValue`")
13082 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint
)
13084 class LayoutConstraints(Object
):
13086 **Note:** constraints are now deprecated and you should use sizers
13089 Objects of this class can be associated with a window to define its
13090 layout constraints, with respect to siblings or its parent.
13092 The class consists of the following eight constraints of class
13093 wx.IndividualLayoutConstraint, some or all of which should be accessed
13094 directly to set the appropriate constraints.
13096 * left: represents the left hand edge of the window
13097 * right: represents the right hand edge of the window
13098 * top: represents the top edge of the window
13099 * bottom: represents the bottom edge of the window
13100 * width: represents the width of the window
13101 * height: represents the height of the window
13102 * centreX: represents the horizontal centre point of the window
13103 * centreY: represents the vertical centre point of the window
13105 Most constraints are initially set to have the relationship
13106 wxUnconstrained, which means that their values should be calculated by
13107 looking at known constraints. The exceptions are width and height,
13108 which are set to wxAsIs to ensure that if the user does not specify a
13109 constraint, the existing width and height will be used, to be
13110 compatible with panel items which often have take a default size. If
13111 the constraint is ``wx.AsIs``, the dimension will not be changed.
13113 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13116 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13117 __repr__
= _swig_repr
13118 left
= property(_core_
.LayoutConstraints_left_get
)
13119 top
= property(_core_
.LayoutConstraints_top_get
)
13120 right
= property(_core_
.LayoutConstraints_right_get
)
13121 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
13122 width
= property(_core_
.LayoutConstraints_width_get
)
13123 height
= property(_core_
.LayoutConstraints_height_get
)
13124 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
13125 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
13126 def __init__(self
, *args
, **kwargs
):
13127 """__init__(self) -> LayoutConstraints"""
13128 _core_
.LayoutConstraints_swiginit(self
,_core_
.new_LayoutConstraints(*args
, **kwargs
))
13129 __swig_destroy__
= _core_
.delete_LayoutConstraints
13130 __del__
= lambda self
: None;
13131 def SatisfyConstraints(*args
, **kwargs
):
13132 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13133 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
13135 def AreSatisfied(*args
, **kwargs
):
13136 """AreSatisfied(self) -> bool"""
13137 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
13139 _core_
.LayoutConstraints_swigregister(LayoutConstraints
)
13141 #----------------------------------------------------------------------------
13143 # Use Python's bool constants if available, make some if not
13147 __builtins__
.True = 1==1
13148 __builtins__
.False = 1==0
13149 def bool(value
): return not not value
13150 __builtins__
.bool = bool
13154 # workarounds for bad wxRTTI names
13155 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
13156 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
13157 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
13160 #----------------------------------------------------------------------------
13161 # Load version numbers from __version__... Ensure that major and minor
13162 # versions are the same for both wxPython and wxWidgets.
13164 from __version__
import *
13165 __version__
= VERSION_STRING
13167 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
13168 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
13169 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
13171 warnings
.warn("wxPython/wxWidgets release number mismatch")
13173 #----------------------------------------------------------------------------
13175 # Set wxPython's default string<-->unicode conversion encoding from
13176 # the locale, but only if Python's default hasn't been changed. (We
13177 # assume that if the user has customized it already then that is the
13178 # encoding we need to use as well.)
13180 # The encoding selected here is used when string or unicode objects
13181 # need to be converted in order to pass them to wxWidgets. Please be
13182 # aware that the default encoding within the same locale may be
13183 # slightly different on different platforms. For example, please see
13184 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13185 # between the common latin/roman encodings.
13187 default
= _sys
.getdefaultencoding()
13188 if default
== 'ascii':
13192 default
= locale
.getdefaultlocale()[1]
13193 codecs
.lookup(default
)
13194 except (ValueError, LookupError, TypeError):
13195 default
= _sys
.getdefaultencoding()
13199 wx
.SetDefaultPyEncoding(default
)
13202 #----------------------------------------------------------------------------
13204 class PyDeadObjectError(AttributeError):
13207 class _wxPyDeadObject(object):
13209 Instances of wx objects that are OOR capable will have their __class__
13210 changed to this class when the C++ object is deleted. This should help
13211 prevent crashes due to referencing a bogus C++ pointer.
13213 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13214 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13216 def __repr__(self
):
13217 if not hasattr(self
, "_name"):
13218 self
._name
= "[unknown]"
13219 return self
.reprStr
% self
._name
13221 def __getattr__(self
, *args
):
13222 if not hasattr(self
, "_name"):
13223 self
._name
= "[unknown]"
13224 raise PyDeadObjectError(self
.attrStr
% self
._name
)
13226 def __nonzero__(self
):
13231 class PyUnbornObjectError(AttributeError):
13234 class _wxPyUnbornObject(object):
13236 Some stock objects are created when the wx._core module is
13237 imported, but their C++ instance is not created until the wx.App
13238 object is created and initialized. These object instances will
13239 temporarily have their __class__ changed to this class so an
13240 exception will be raised if they are used before the C++ instance
13244 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13245 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
13247 def __repr__(self
):
13248 #if not hasattr(self, "_name"):
13249 # self._name = "[unknown]"
13250 return self
.reprStr
#% self._name
13252 def __getattr__(self
, *args
):
13253 #if not hasattr(self, "_name"):
13254 # self._name = "[unknown]"
13255 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
13257 def __nonzero__(self
):
13261 #----------------------------------------------------------------------------
13263 def CallAfter(callable, *args
, **kw
):
13265 Call the specified function after the current and pending event
13266 handlers have been completed. This is also good for making GUI
13267 method calls from non-GUI threads. Any extra positional or
13268 keyword args are passed on to the callable when it is called.
13270 :see: `wx.FutureCall`
13273 assert app
is not None, 'No wx.App created yet'
13275 if not hasattr(app
, "_CallAfterId"):
13276 app
._CallAfterId
= wx
.NewEventType()
13277 app
.Connect(-1, -1, app
._CallAfterId
,
13278 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
13280 evt
.SetEventType(app
._CallAfterId
)
13281 evt
.callable = callable
13284 wx
.PostEvent(app
, evt
)
13286 #----------------------------------------------------------------------------
13291 A convenience class for `wx.Timer`, that calls the given callable
13292 object once after the given amount of milliseconds, passing any
13293 positional or keyword args. The return value of the callable is
13294 availbale after it has been run with the `GetResult` method.
13296 If you don't need to get the return value or restart the timer
13297 then there is no need to hold a reference to this object. It will
13298 hold a reference to itself while the timer is running (the timer
13299 has a reference to self.Notify) but the cycle will be broken when
13300 the timer completes, automatically cleaning up the wx.FutureCall
13303 :see: `wx.CallAfter`
13305 def __init__(self
, millis
, callable, *args
, **kwargs
):
13306 self
.millis
= millis
13307 self
.callable = callable
13308 self
.SetArgs(*args
, **kwargs
)
13310 self
.running
= False
13311 self
.hasRun
= False
13320 def Start(self
, millis
=None, *args
, **kwargs
):
13322 (Re)start the timer
13324 self
.hasRun
= False
13325 if millis
is not None:
13326 self
.millis
= millis
13328 self
.SetArgs(*args
, **kwargs
)
13330 self
.timer
= wx
.PyTimer(self
.Notify
)
13331 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
13332 self
.running
= True
13338 Stop and destroy the timer.
13340 if self
.timer
is not None:
13345 def GetInterval(self
):
13346 if self
.timer
is not None:
13347 return self
.timer
.GetInterval()
13352 def IsRunning(self
):
13353 return self
.timer
is not None and self
.timer
.IsRunning()
13356 def SetArgs(self
, *args
, **kwargs
):
13358 (Re)set the args passed to the callable object. This is
13359 useful in conjunction with Restart if you want to schedule a
13360 new call to the same callable object but with different
13364 self
.kwargs
= kwargs
13370 def GetResult(self
):
13375 The timer has expired so call the callable.
13377 if self
.callable and getattr(self
.callable, 'im_self', True):
13379 self
.running
= False
13380 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
13382 if not self
.running
:
13383 # if it wasn't restarted, then cleanup
13384 wx
.CallAfter(self
.Stop
)
13386 Interval
= property(GetInterval
)
13387 Result
= property(GetResult
)
13390 #----------------------------------------------------------------------------
13391 # Control which items in this module should be documented by epydoc.
13392 # We allow only classes and functions, which will help reduce the size
13393 # of the docs by filtering out the zillions of constants, EVT objects,
13394 # and etc that don't make much sense by themselves, but are instead
13395 # documented (or will be) as part of the classes/functions/methods
13396 # where they should be used.
13400 A filter for epydoc that only allows non-Ptr classes and
13401 functions, in order to reduce the clutter in the API docs.
13403 def __init__(self
, globals):
13404 self
._globals
= globals
13406 def __call__(self
, name
):
13408 obj
= self
._globals
.get(name
, None)
13410 # only document classes and function
13411 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
13414 # skip other things that are private or will be documented as part of somethign else
13415 if name
.startswith('_') or name
.startswith('EVT') or name
.endswith('_swigregister') or name
.endswith('Ptr') :
13418 # skip functions that are duplicates of static functions in a class
13419 if name
.find('_') != -1:
13420 cls
= self
._globals
.get(name
.split('_')[0], None)
13421 methname
= name
.split('_')[1]
13422 if hasattr(cls
, methname
) and type(getattr(cls
, methname
)) is types
.FunctionType
:
13427 #----------------------------------------------------------------------------
13428 #----------------------------------------------------------------------------
13430 # Import other modules in this package that should show up in the
13431 # "core" wx namespace
13433 from _windows
import *
13434 from _controls
import *
13435 from _misc
import *
13437 #----------------------------------------------------------------------------
13438 #----------------------------------------------------------------------------