1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
6 new_instancemethod
= new
.instancemethod
7 def _swig_setattr_nondynamic(self
,class_type
,name
,value
,static
=1):
8 if (name
== "thisown"): return self
.this
.own(value
)
10 if type(value
).__name
__ == 'PySwigObject':
11 self
.__dict
__[name
] = value
13 method
= class_type
.__swig
_setmethods
__.get(name
,None)
14 if method
: return method(self
,value
)
15 if (not static
) or hasattr(self
,name
):
16 self
.__dict
__[name
] = value
18 raise AttributeError("You cannot add attributes to %s" % self
)
20 def _swig_setattr(self
,class_type
,name
,value
):
21 return _swig_setattr_nondynamic(self
,class_type
,name
,value
,0)
23 def _swig_getattr(self
,class_type
,name
):
24 if (name
== "thisown"): return self
.this
.own()
25 method
= class_type
.__swig
_getmethods
__.get(name
,None)
26 if method
: return method(self
)
27 raise AttributeError,name
30 try: strthis
= "proxy of " + self
.this
.__repr
__()
32 return "<%s.%s; %s >" % (self
.__class
__.__module
__, self
.__class
__.__name
__, strthis
,)
36 _object
= types
.ObjectType
38 except AttributeError:
44 def _swig_setattr_nondynamic_method(set):
45 def set_attr(self
,name
,value
):
46 if (name
== "thisown"): return self
.this
.own(value
)
47 if hasattr(self
,name
) or (name
== "this"):
50 raise AttributeError("You cannot add attributes to %s" % self
)
54 #// Give a reference to the dictionary of this module to the C++ extension
56 _core_
._wxPySetDictionary
(vars())
58 #// A little trick to make 'wx' be a reference to this module so wx.Names can
61 wx
= _sys
.modules
[__name__
]
64 #----------------------------------------------------------------------------
66 def _deprecated(callable, msg
=None):
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
72 msg
= "%s is deprecated" % callable
73 def deprecatedWrapper(*args
, **kwargs
):
75 warnings
.warn(msg
, DeprecationWarning, stacklevel
=2)
76 return callable(*args
, **kwargs
)
77 deprecatedWrapper
.__doc
__ = msg
78 return deprecatedWrapper
81 #----------------------------------------------------------------------------
83 NOT_FOUND
= _core_
.NOT_FOUND
84 VSCROLL
= _core_
.VSCROLL
85 HSCROLL
= _core_
.HSCROLL
86 CAPTION
= _core_
.CAPTION
87 DOUBLE_BORDER
= _core_
.DOUBLE_BORDER
88 SUNKEN_BORDER
= _core_
.SUNKEN_BORDER
89 RAISED_BORDER
= _core_
.RAISED_BORDER
90 BORDER
= _core_
.BORDER
91 SIMPLE_BORDER
= _core_
.SIMPLE_BORDER
92 STATIC_BORDER
= _core_
.STATIC_BORDER
93 TRANSPARENT_WINDOW
= _core_
.TRANSPARENT_WINDOW
94 NO_BORDER
= _core_
.NO_BORDER
95 DEFAULT_CONTROL_BORDER
= _core_
.DEFAULT_CONTROL_BORDER
96 DEFAULT_STATUSBAR_STYLE
= _core_
.DEFAULT_STATUSBAR_STYLE
97 TAB_TRAVERSAL
= _core_
.TAB_TRAVERSAL
98 WANTS_CHARS
= _core_
.WANTS_CHARS
99 POPUP_WINDOW
= _core_
.POPUP_WINDOW
100 CENTER_FRAME
= _core_
.CENTER_FRAME
101 CENTRE_ON_SCREEN
= _core_
.CENTRE_ON_SCREEN
102 CENTER_ON_SCREEN
= _core_
.CENTER_ON_SCREEN
103 CLIP_CHILDREN
= _core_
.CLIP_CHILDREN
104 CLIP_SIBLINGS
= _core_
.CLIP_SIBLINGS
105 WINDOW_STYLE_MASK
= _core_
.WINDOW_STYLE_MASK
106 ALWAYS_SHOW_SB
= _core_
.ALWAYS_SHOW_SB
107 RETAINED
= _core_
.RETAINED
108 BACKINGSTORE
= _core_
.BACKINGSTORE
109 COLOURED
= _core_
.COLOURED
110 FIXED_LENGTH
= _core_
.FIXED_LENGTH
111 LB_NEEDED_SB
= _core_
.LB_NEEDED_SB
112 LB_ALWAYS_SB
= _core_
.LB_ALWAYS_SB
113 LB_SORT
= _core_
.LB_SORT
114 LB_SINGLE
= _core_
.LB_SINGLE
115 LB_MULTIPLE
= _core_
.LB_MULTIPLE
116 LB_EXTENDED
= _core_
.LB_EXTENDED
117 LB_OWNERDRAW
= _core_
.LB_OWNERDRAW
118 LB_HSCROLL
= _core_
.LB_HSCROLL
119 CB_SIMPLE
= _core_
.CB_SIMPLE
120 CB_DROPDOWN
= _core_
.CB_DROPDOWN
121 CB_SORT
= _core_
.CB_SORT
122 CB_READONLY
= _core_
.CB_READONLY
123 RA_HORIZONTAL
= _core_
.RA_HORIZONTAL
124 RA_VERTICAL
= _core_
.RA_VERTICAL
125 RA_SPECIFY_ROWS
= _core_
.RA_SPECIFY_ROWS
126 RA_SPECIFY_COLS
= _core_
.RA_SPECIFY_COLS
127 RA_USE_CHECKBOX
= _core_
.RA_USE_CHECKBOX
128 RB_GROUP
= _core_
.RB_GROUP
129 RB_SINGLE
= _core_
.RB_SINGLE
130 SB_HORIZONTAL
= _core_
.SB_HORIZONTAL
131 SB_VERTICAL
= _core_
.SB_VERTICAL
132 RB_USE_CHECKBOX
= _core_
.RB_USE_CHECKBOX
133 ST_SIZEGRIP
= _core_
.ST_SIZEGRIP
134 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
135 FLOOD_BORDER
= _core_
.FLOOD_BORDER
136 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
137 WINDING_RULE
= _core_
.WINDING_RULE
138 TOOL_TOP
= _core_
.TOOL_TOP
139 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
140 TOOL_LEFT
= _core_
.TOOL_LEFT
141 TOOL_RIGHT
= _core_
.TOOL_RIGHT
143 YES_NO
= _core_
.YES_NO
144 CANCEL
= _core_
.CANCEL
147 NO_DEFAULT
= _core_
.NO_DEFAULT
148 YES_DEFAULT
= _core_
.YES_DEFAULT
149 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
150 ICON_HAND
= _core_
.ICON_HAND
151 ICON_QUESTION
= _core_
.ICON_QUESTION
152 ICON_INFORMATION
= _core_
.ICON_INFORMATION
153 ICON_STOP
= _core_
.ICON_STOP
154 ICON_ASTERISK
= _core_
.ICON_ASTERISK
155 ICON_MASK
= _core_
.ICON_MASK
156 ICON_WARNING
= _core_
.ICON_WARNING
157 ICON_ERROR
= _core_
.ICON_ERROR
158 FORWARD
= _core_
.FORWARD
159 BACKWARD
= _core_
.BACKWARD
164 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
165 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
166 SIZE_AUTO
= _core_
.SIZE_AUTO
167 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
168 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
169 SIZE_FORCE
= _core_
.SIZE_FORCE
170 PORTRAIT
= _core_
.PORTRAIT
171 LANDSCAPE
= _core_
.LANDSCAPE
172 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
173 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
174 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
175 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
176 ID_ANY
= _core_
.ID_ANY
177 ID_SEPARATOR
= _core_
.ID_SEPARATOR
178 ID_NONE
= _core_
.ID_NONE
179 ID_LOWEST
= _core_
.ID_LOWEST
180 ID_OPEN
= _core_
.ID_OPEN
181 ID_CLOSE
= _core_
.ID_CLOSE
182 ID_NEW
= _core_
.ID_NEW
183 ID_SAVE
= _core_
.ID_SAVE
184 ID_SAVEAS
= _core_
.ID_SAVEAS
185 ID_REVERT
= _core_
.ID_REVERT
186 ID_EXIT
= _core_
.ID_EXIT
187 ID_UNDO
= _core_
.ID_UNDO
188 ID_REDO
= _core_
.ID_REDO
189 ID_HELP
= _core_
.ID_HELP
190 ID_PRINT
= _core_
.ID_PRINT
191 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
192 ID_PAGE_SETUP
= _core_
.ID_PAGE_SETUP
193 ID_PREVIEW
= _core_
.ID_PREVIEW
194 ID_ABOUT
= _core_
.ID_ABOUT
195 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
196 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
197 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
198 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
199 ID_HELP_INDEX
= _core_
.ID_HELP_INDEX
200 ID_HELP_SEARCH
= _core_
.ID_HELP_SEARCH
201 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
202 ID_PREFERENCES
= _core_
.ID_PREFERENCES
203 ID_EDIT
= _core_
.ID_EDIT
204 ID_CUT
= _core_
.ID_CUT
205 ID_COPY
= _core_
.ID_COPY
206 ID_PASTE
= _core_
.ID_PASTE
207 ID_CLEAR
= _core_
.ID_CLEAR
208 ID_FIND
= _core_
.ID_FIND
209 ID_DUPLICATE
= _core_
.ID_DUPLICATE
210 ID_SELECTALL
= _core_
.ID_SELECTALL
211 ID_DELETE
= _core_
.ID_DELETE
212 ID_REPLACE
= _core_
.ID_REPLACE
213 ID_REPLACE_ALL
= _core_
.ID_REPLACE_ALL
214 ID_PROPERTIES
= _core_
.ID_PROPERTIES
215 ID_VIEW_DETAILS
= _core_
.ID_VIEW_DETAILS
216 ID_VIEW_LARGEICONS
= _core_
.ID_VIEW_LARGEICONS
217 ID_VIEW_SMALLICONS
= _core_
.ID_VIEW_SMALLICONS
218 ID_VIEW_LIST
= _core_
.ID_VIEW_LIST
219 ID_VIEW_SORTDATE
= _core_
.ID_VIEW_SORTDATE
220 ID_VIEW_SORTNAME
= _core_
.ID_VIEW_SORTNAME
221 ID_VIEW_SORTSIZE
= _core_
.ID_VIEW_SORTSIZE
222 ID_VIEW_SORTTYPE
= _core_
.ID_VIEW_SORTTYPE
223 ID_FILE
= _core_
.ID_FILE
224 ID_FILE1
= _core_
.ID_FILE1
225 ID_FILE2
= _core_
.ID_FILE2
226 ID_FILE3
= _core_
.ID_FILE3
227 ID_FILE4
= _core_
.ID_FILE4
228 ID_FILE5
= _core_
.ID_FILE5
229 ID_FILE6
= _core_
.ID_FILE6
230 ID_FILE7
= _core_
.ID_FILE7
231 ID_FILE8
= _core_
.ID_FILE8
232 ID_FILE9
= _core_
.ID_FILE9
234 ID_CANCEL
= _core_
.ID_CANCEL
235 ID_APPLY
= _core_
.ID_APPLY
236 ID_YES
= _core_
.ID_YES
238 ID_STATIC
= _core_
.ID_STATIC
239 ID_FORWARD
= _core_
.ID_FORWARD
240 ID_BACKWARD
= _core_
.ID_BACKWARD
241 ID_DEFAULT
= _core_
.ID_DEFAULT
242 ID_MORE
= _core_
.ID_MORE
243 ID_SETUP
= _core_
.ID_SETUP
244 ID_RESET
= _core_
.ID_RESET
245 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
246 ID_YESTOALL
= _core_
.ID_YESTOALL
247 ID_NOTOALL
= _core_
.ID_NOTOALL
248 ID_ABORT
= _core_
.ID_ABORT
249 ID_RETRY
= _core_
.ID_RETRY
250 ID_IGNORE
= _core_
.ID_IGNORE
251 ID_ADD
= _core_
.ID_ADD
252 ID_REMOVE
= _core_
.ID_REMOVE
254 ID_DOWN
= _core_
.ID_DOWN
255 ID_HOME
= _core_
.ID_HOME
256 ID_REFRESH
= _core_
.ID_REFRESH
257 ID_STOP
= _core_
.ID_STOP
258 ID_INDEX
= _core_
.ID_INDEX
259 ID_BOLD
= _core_
.ID_BOLD
260 ID_ITALIC
= _core_
.ID_ITALIC
261 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
262 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
263 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
264 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
265 ID_UNDERLINE
= _core_
.ID_UNDERLINE
266 ID_INDENT
= _core_
.ID_INDENT
267 ID_UNINDENT
= _core_
.ID_UNINDENT
268 ID_ZOOM_100
= _core_
.ID_ZOOM_100
269 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
270 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
271 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
272 ID_UNDELETE
= _core_
.ID_UNDELETE
273 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
274 ID_HIGHEST
= _core_
.ID_HIGHEST
275 MENU_TEAROFF
= _core_
.MENU_TEAROFF
276 MB_DOCKABLE
= _core_
.MB_DOCKABLE
277 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
278 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
279 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
280 LI_VERTICAL
= _core_
.LI_VERTICAL
281 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
282 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
283 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
284 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
285 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
286 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
287 MM_TEXT
= _core_
.MM_TEXT
288 MM_LOMETRIC
= _core_
.MM_LOMETRIC
289 MM_HIMETRIC
= _core_
.MM_HIMETRIC
290 MM_LOENGLISH
= _core_
.MM_LOENGLISH
291 MM_HIENGLISH
= _core_
.MM_HIENGLISH
292 MM_TWIPS
= _core_
.MM_TWIPS
293 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
294 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
295 MM_POINTS
= _core_
.MM_POINTS
296 MM_METRIC
= _core_
.MM_METRIC
297 CENTRE
= _core_
.CENTRE
298 CENTER
= _core_
.CENTER
299 HORIZONTAL
= _core_
.HORIZONTAL
300 VERTICAL
= _core_
.VERTICAL
307 BOTTOM
= _core_
.BOTTOM
313 ALIGN_NOT
= _core_
.ALIGN_NOT
314 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
315 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
316 ALIGN_LEFT
= _core_
.ALIGN_LEFT
317 ALIGN_TOP
= _core_
.ALIGN_TOP
318 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
319 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
320 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
321 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
322 ALIGN_CENTER
= _core_
.ALIGN_CENTER
323 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
324 ALIGN_MASK
= _core_
.ALIGN_MASK
325 STRETCH_NOT
= _core_
.STRETCH_NOT
326 SHRINK
= _core_
.SHRINK
328 EXPAND
= _core_
.EXPAND
329 SHAPED
= _core_
.SHAPED
330 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
333 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
334 BORDER_NONE
= _core_
.BORDER_NONE
335 BORDER_STATIC
= _core_
.BORDER_STATIC
336 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
337 BORDER_RAISED
= _core_
.BORDER_RAISED
338 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
339 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
340 BORDER_MASK
= _core_
.BORDER_MASK
341 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
342 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
343 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
344 DEFAULT
= _core_
.DEFAULT
345 DECORATIVE
= _core_
.DECORATIVE
347 SCRIPT
= _core_
.SCRIPT
349 MODERN
= _core_
.MODERN
350 TELETYPE
= _core_
.TELETYPE
351 VARIABLE
= _core_
.VARIABLE
353 NORMAL
= _core_
.NORMAL
356 ITALIC
= _core_
.ITALIC
360 LONG_DASH
= _core_
.LONG_DASH
361 SHORT_DASH
= _core_
.SHORT_DASH
362 DOT_DASH
= _core_
.DOT_DASH
363 USER_DASH
= _core_
.USER_DASH
364 TRANSPARENT
= _core_
.TRANSPARENT
365 STIPPLE
= _core_
.STIPPLE
366 STIPPLE_MASK
= _core_
.STIPPLE_MASK
367 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
368 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
369 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
370 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
371 CROSS_HATCH
= _core_
.CROSS_HATCH
372 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
373 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
374 JOIN_BEVEL
= _core_
.JOIN_BEVEL
375 JOIN_MITER
= _core_
.JOIN_MITER
376 JOIN_ROUND
= _core_
.JOIN_ROUND
377 CAP_ROUND
= _core_
.CAP_ROUND
378 CAP_PROJECTING
= _core_
.CAP_PROJECTING
379 CAP_BUTT
= _core_
.CAP_BUTT
382 INVERT
= _core_
.INVERT
383 OR_REVERSE
= _core_
.OR_REVERSE
384 AND_REVERSE
= _core_
.AND_REVERSE
387 AND_INVERT
= _core_
.AND_INVERT
391 SRC_INVERT
= _core_
.SRC_INVERT
392 OR_INVERT
= _core_
.OR_INVERT
396 WXK_BACK
= _core_
.WXK_BACK
397 WXK_TAB
= _core_
.WXK_TAB
398 WXK_RETURN
= _core_
.WXK_RETURN
399 WXK_ESCAPE
= _core_
.WXK_ESCAPE
400 WXK_SPACE
= _core_
.WXK_SPACE
401 WXK_DELETE
= _core_
.WXK_DELETE
402 WXK_START
= _core_
.WXK_START
403 WXK_LBUTTON
= _core_
.WXK_LBUTTON
404 WXK_RBUTTON
= _core_
.WXK_RBUTTON
405 WXK_CANCEL
= _core_
.WXK_CANCEL
406 WXK_MBUTTON
= _core_
.WXK_MBUTTON
407 WXK_CLEAR
= _core_
.WXK_CLEAR
408 WXK_SHIFT
= _core_
.WXK_SHIFT
409 WXK_ALT
= _core_
.WXK_ALT
410 WXK_CONTROL
= _core_
.WXK_CONTROL
411 WXK_MENU
= _core_
.WXK_MENU
412 WXK_PAUSE
= _core_
.WXK_PAUSE
413 WXK_CAPITAL
= _core_
.WXK_CAPITAL
414 WXK_END
= _core_
.WXK_END
415 WXK_HOME
= _core_
.WXK_HOME
416 WXK_LEFT
= _core_
.WXK_LEFT
417 WXK_UP
= _core_
.WXK_UP
418 WXK_RIGHT
= _core_
.WXK_RIGHT
419 WXK_DOWN
= _core_
.WXK_DOWN
420 WXK_SELECT
= _core_
.WXK_SELECT
421 WXK_PRINT
= _core_
.WXK_PRINT
422 WXK_EXECUTE
= _core_
.WXK_EXECUTE
423 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
424 WXK_INSERT
= _core_
.WXK_INSERT
425 WXK_HELP
= _core_
.WXK_HELP
426 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
427 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
428 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
429 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
430 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
431 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
432 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
433 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
434 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
435 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
436 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
437 WXK_ADD
= _core_
.WXK_ADD
438 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
439 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
440 WXK_DECIMAL
= _core_
.WXK_DECIMAL
441 WXK_DIVIDE
= _core_
.WXK_DIVIDE
442 WXK_F1
= _core_
.WXK_F1
443 WXK_F2
= _core_
.WXK_F2
444 WXK_F3
= _core_
.WXK_F3
445 WXK_F4
= _core_
.WXK_F4
446 WXK_F5
= _core_
.WXK_F5
447 WXK_F6
= _core_
.WXK_F6
448 WXK_F7
= _core_
.WXK_F7
449 WXK_F8
= _core_
.WXK_F8
450 WXK_F9
= _core_
.WXK_F9
451 WXK_F10
= _core_
.WXK_F10
452 WXK_F11
= _core_
.WXK_F11
453 WXK_F12
= _core_
.WXK_F12
454 WXK_F13
= _core_
.WXK_F13
455 WXK_F14
= _core_
.WXK_F14
456 WXK_F15
= _core_
.WXK_F15
457 WXK_F16
= _core_
.WXK_F16
458 WXK_F17
= _core_
.WXK_F17
459 WXK_F18
= _core_
.WXK_F18
460 WXK_F19
= _core_
.WXK_F19
461 WXK_F20
= _core_
.WXK_F20
462 WXK_F21
= _core_
.WXK_F21
463 WXK_F22
= _core_
.WXK_F22
464 WXK_F23
= _core_
.WXK_F23
465 WXK_F24
= _core_
.WXK_F24
466 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
467 WXK_SCROLL
= _core_
.WXK_SCROLL
468 WXK_PAGEUP
= _core_
.WXK_PAGEUP
469 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
470 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
471 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
472 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
473 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
474 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
475 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
476 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
477 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
478 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
479 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
480 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
481 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
482 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
483 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
484 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
485 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
486 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
487 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
488 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
489 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
490 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
491 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
492 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
493 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
494 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
495 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
496 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
497 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
498 WXK_COMMAND
= _core_
.WXK_COMMAND
499 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
500 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
501 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
502 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
503 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
504 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
505 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
506 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
507 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
508 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
509 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
510 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
511 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
512 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
513 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
514 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
515 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
516 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
517 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
518 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
519 WXK_PRIOR
= WXK_PAGEUP
520 WXK_NEXT
= WXK_PAGEDOWN
521 WXK_NUMPAD_PRIOR
= WXK_NUMPAD_PAGEUP
522 WXK_NUMPAD_NEXT
= WXK_NUMPAD_PAGEDOWN
524 PAPER_NONE
= _core_
.PAPER_NONE
525 PAPER_LETTER
= _core_
.PAPER_LETTER
526 PAPER_LEGAL
= _core_
.PAPER_LEGAL
527 PAPER_A4
= _core_
.PAPER_A4
528 PAPER_CSHEET
= _core_
.PAPER_CSHEET
529 PAPER_DSHEET
= _core_
.PAPER_DSHEET
530 PAPER_ESHEET
= _core_
.PAPER_ESHEET
531 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
532 PAPER_TABLOID
= _core_
.PAPER_TABLOID
533 PAPER_LEDGER
= _core_
.PAPER_LEDGER
534 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
535 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
536 PAPER_A3
= _core_
.PAPER_A3
537 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
538 PAPER_A5
= _core_
.PAPER_A5
539 PAPER_B4
= _core_
.PAPER_B4
540 PAPER_B5
= _core_
.PAPER_B5
541 PAPER_FOLIO
= _core_
.PAPER_FOLIO
542 PAPER_QUARTO
= _core_
.PAPER_QUARTO
543 PAPER_10X14
= _core_
.PAPER_10X14
544 PAPER_11X17
= _core_
.PAPER_11X17
545 PAPER_NOTE
= _core_
.PAPER_NOTE
546 PAPER_ENV_9
= _core_
.PAPER_ENV_9
547 PAPER_ENV_10
= _core_
.PAPER_ENV_10
548 PAPER_ENV_11
= _core_
.PAPER_ENV_11
549 PAPER_ENV_12
= _core_
.PAPER_ENV_12
550 PAPER_ENV_14
= _core_
.PAPER_ENV_14
551 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
552 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
553 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
554 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
555 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
556 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
557 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
558 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
559 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
560 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
561 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
562 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
563 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
564 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
565 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
566 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
567 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
568 PAPER_9X11
= _core_
.PAPER_9X11
569 PAPER_10X11
= _core_
.PAPER_10X11
570 PAPER_15X11
= _core_
.PAPER_15X11
571 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
572 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
573 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
574 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
575 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
576 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
577 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
578 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
579 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
580 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
581 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
582 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
583 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
584 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
585 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
586 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
587 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
588 PAPER_A2
= _core_
.PAPER_A2
589 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
590 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
591 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
592 PAPER_A6
= _core_
.PAPER_A6
593 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
594 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
595 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
596 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
597 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
598 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
599 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
600 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
601 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
602 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
603 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
604 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
605 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
606 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
607 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
608 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
609 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
610 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
611 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
612 PAPER_12X11
= _core_
.PAPER_12X11
613 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
614 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
615 PAPER_P16K
= _core_
.PAPER_P16K
616 PAPER_P32K
= _core_
.PAPER_P32K
617 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
618 PAPER_PENV_1
= _core_
.PAPER_PENV_1
619 PAPER_PENV_2
= _core_
.PAPER_PENV_2
620 PAPER_PENV_3
= _core_
.PAPER_PENV_3
621 PAPER_PENV_4
= _core_
.PAPER_PENV_4
622 PAPER_PENV_5
= _core_
.PAPER_PENV_5
623 PAPER_PENV_6
= _core_
.PAPER_PENV_6
624 PAPER_PENV_7
= _core_
.PAPER_PENV_7
625 PAPER_PENV_8
= _core_
.PAPER_PENV_8
626 PAPER_PENV_9
= _core_
.PAPER_PENV_9
627 PAPER_PENV_10
= _core_
.PAPER_PENV_10
628 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
629 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
630 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
631 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
632 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
633 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
634 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
635 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
636 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
637 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
638 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
639 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
640 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
641 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
642 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
643 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
644 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
645 ITEM_NORMAL
= _core_
.ITEM_NORMAL
646 ITEM_CHECK
= _core_
.ITEM_CHECK
647 ITEM_RADIO
= _core_
.ITEM_RADIO
648 ITEM_MAX
= _core_
.ITEM_MAX
649 HT_NOWHERE
= _core_
.HT_NOWHERE
650 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
651 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
652 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
653 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
654 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
655 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
656 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
657 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
658 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
659 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
660 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
661 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
662 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
663 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
664 HT_MAX
= _core_
.HT_MAX
665 MOD_NONE
= _core_
.MOD_NONE
666 MOD_ALT
= _core_
.MOD_ALT
667 MOD_CONTROL
= _core_
.MOD_CONTROL
668 MOD_ALTGR
= _core_
.MOD_ALTGR
669 MOD_SHIFT
= _core_
.MOD_SHIFT
670 MOD_META
= _core_
.MOD_META
671 MOD_WIN
= _core_
.MOD_WIN
672 MOD_CMD
= _core_
.MOD_CMD
673 MOD_ALL
= _core_
.MOD_ALL
674 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
675 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
676 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
677 Layout_Default
= _core_
.Layout_Default
678 Layout_LeftToRight
= _core_
.Layout_LeftToRight
679 Layout_RightToLeft
= _core_
.Layout_RightToLeft
680 #---------------------------------------------------------------------------
682 class Object(object):
684 The base class for most wx objects, although in wxPython not
685 much functionality is needed nor exposed.
687 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
688 def __init__(self
): raise AttributeError, "No constructor defined"
689 __repr__
= _swig_repr
690 def GetClassName(*args
, **kwargs
):
692 GetClassName(self) -> String
694 Returns the class name of the C++ class using wxRTTI.
696 return _core_
.Object_GetClassName(*args
, **kwargs
)
698 def Destroy(*args
, **kwargs
):
702 Deletes the C++ object this Python object is a proxy for.
704 args
[0].this
.own(False)
705 return _core_
.Object_Destroy(*args
, **kwargs
)
707 def IsSameAs(*args
, **kwargs
):
709 IsSameAs(self, Object p) -> bool
711 For wx.Objects that use C++ reference counting internally, this method
712 can be used to determine if two objects are referencing the same data
715 return _core_
.Object_IsSameAs(*args
, **kwargs
)
717 ClassName
= property(GetClassName
,doc
="See `GetClassName`")
718 _core_
.Object_swigregister(Object
)
719 _wxPySetDictionary
= _core_
._wxPySetDictionary
721 EmptyString
= cvar
.EmptyString
723 #---------------------------------------------------------------------------
725 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
726 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
727 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
728 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
729 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
730 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
731 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
732 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
733 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
734 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
735 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
736 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
737 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
738 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
739 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
740 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
741 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
742 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
743 BITMAP_TYPE_TGA
= _core_
.BITMAP_TYPE_TGA
744 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
745 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
746 CURSOR_NONE
= _core_
.CURSOR_NONE
747 CURSOR_ARROW
= _core_
.CURSOR_ARROW
748 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
749 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
750 CURSOR_CHAR
= _core_
.CURSOR_CHAR
751 CURSOR_CROSS
= _core_
.CURSOR_CROSS
752 CURSOR_HAND
= _core_
.CURSOR_HAND
753 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
754 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
755 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
756 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
757 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
758 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
759 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
760 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
761 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
762 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
763 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
764 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
765 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
766 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
767 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
768 CURSOR_SIZING
= _core_
.CURSOR_SIZING
769 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
770 CURSOR_WAIT
= _core_
.CURSOR_WAIT
771 CURSOR_WATCH
= _core_
.CURSOR_WATCH
772 CURSOR_BLANK
= _core_
.CURSOR_BLANK
773 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
774 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
775 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
776 CURSOR_MAX
= _core_
.CURSOR_MAX
777 #---------------------------------------------------------------------------
781 wx.Size is a useful data structure used to represent the size of
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
784 expected a (width, height) tuple can be used instead.
786 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
787 __repr__
= _swig_repr
788 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
789 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
790 x
= width
; y
= height
791 def __init__(self
, *args
, **kwargs
):
793 __init__(self, int w=0, int h=0) -> Size
795 Creates a size object.
797 _core_
.Size_swiginit(self
,_core_
.new_Size(*args
, **kwargs
))
798 __swig_destroy__
= _core_
.delete_Size
799 __del__
= lambda self
: None;
800 def __eq__(*args
, **kwargs
):
802 __eq__(self, PyObject other) -> bool
804 Test for equality of wx.Size objects.
806 return _core_
.Size___eq__(*args
, **kwargs
)
808 def __ne__(*args
, **kwargs
):
810 __ne__(self, PyObject other) -> bool
812 Test for inequality of wx.Size objects.
814 return _core_
.Size___ne__(*args
, **kwargs
)
816 def __add__(*args
, **kwargs
):
818 __add__(self, Size sz) -> Size
820 Add sz's proprties to this and return the result.
822 return _core_
.Size___add__(*args
, **kwargs
)
824 def __sub__(*args
, **kwargs
):
826 __sub__(self, Size sz) -> Size
828 Subtract sz's properties from this and return the result.
830 return _core_
.Size___sub__(*args
, **kwargs
)
832 def IncTo(*args
, **kwargs
):
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
839 return _core_
.Size_IncTo(*args
, **kwargs
)
841 def DecTo(*args
, **kwargs
):
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
848 return _core_
.Size_DecTo(*args
, **kwargs
)
850 def IncBy(*args
, **kwargs
):
851 """IncBy(self, int dx, int dy)"""
852 return _core_
.Size_IncBy(*args
, **kwargs
)
854 def DecBy(*args
, **kwargs
):
855 """DecBy(self, int dx, int dy)"""
856 return _core_
.Size_DecBy(*args
, **kwargs
)
858 def Scale(*args
, **kwargs
):
860 Scale(self, float xscale, float yscale)
862 Scales the dimensions of this object by the given factors.
864 return _core_
.Size_Scale(*args
, **kwargs
)
866 def Set(*args
, **kwargs
):
868 Set(self, int w, int h)
870 Set both width and height.
872 return _core_
.Size_Set(*args
, **kwargs
)
874 def SetWidth(*args
, **kwargs
):
875 """SetWidth(self, int w)"""
876 return _core_
.Size_SetWidth(*args
, **kwargs
)
878 def SetHeight(*args
, **kwargs
):
879 """SetHeight(self, int h)"""
880 return _core_
.Size_SetHeight(*args
, **kwargs
)
882 def GetWidth(*args
, **kwargs
):
883 """GetWidth(self) -> int"""
884 return _core_
.Size_GetWidth(*args
, **kwargs
)
886 def GetHeight(*args
, **kwargs
):
887 """GetHeight(self) -> int"""
888 return _core_
.Size_GetHeight(*args
, **kwargs
)
890 def IsFullySpecified(*args
, **kwargs
):
892 IsFullySpecified(self) -> bool
894 Returns True if both components of the size are non-default values.
896 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
898 def SetDefaults(*args
, **kwargs
):
900 SetDefaults(self, Size size)
902 Combine this size with the other one replacing the default components
903 of this object (i.e. equal to -1) with those of the other.
905 return _core_
.Size_SetDefaults(*args
, **kwargs
)
907 def Get(*args
, **kwargs
):
909 Get() -> (width,height)
911 Returns the width and height properties as a tuple.
913 return _core_
.Size_Get(*args
, **kwargs
)
915 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
916 def __str__(self
): return str(self
.Get())
917 def __repr__(self
): return 'wx.Size'+str(self
.Get())
918 def __len__(self
): return len(self
.Get())
919 def __getitem__(self
, index
): return self
.Get()[index
]
920 def __setitem__(self
, index
, val
):
921 if index
== 0: self
.width
= val
922 elif index
== 1: self
.height
= val
923 else: raise IndexError
924 def __nonzero__(self
): return self
.Get() != (0,0)
925 __safe_for_unpickling__
= True
926 def __reduce__(self
): return (wx
.Size
, self
.Get())
928 _core_
.Size_swigregister(Size
)
930 #---------------------------------------------------------------------------
932 class RealPoint(object):
934 A data structure for representing a point or position with floating
935 point x and y properties. In wxPython most places that expect a
936 wx.RealPoint can also accept a (x,y) tuple.
938 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
939 __repr__
= _swig_repr
940 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
941 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
942 def __init__(self
, *args
, **kwargs
):
944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
946 Create a wx.RealPoint object
948 _core_
.RealPoint_swiginit(self
,_core_
.new_RealPoint(*args
, **kwargs
))
949 __swig_destroy__
= _core_
.delete_RealPoint
950 __del__
= lambda self
: None;
951 def __eq__(*args
, **kwargs
):
953 __eq__(self, PyObject other) -> bool
955 Test for equality of wx.RealPoint objects.
957 return _core_
.RealPoint___eq__(*args
, **kwargs
)
959 def __ne__(*args
, **kwargs
):
961 __ne__(self, PyObject other) -> bool
963 Test for inequality of wx.RealPoint objects.
965 return _core_
.RealPoint___ne__(*args
, **kwargs
)
967 def __add__(*args
, **kwargs
):
969 __add__(self, RealPoint pt) -> RealPoint
971 Add pt's proprties to this and return the result.
973 return _core_
.RealPoint___add__(*args
, **kwargs
)
975 def __sub__(*args
, **kwargs
):
977 __sub__(self, RealPoint pt) -> RealPoint
979 Subtract pt's proprties from this and return the result
981 return _core_
.RealPoint___sub__(*args
, **kwargs
)
983 def Set(*args
, **kwargs
):
985 Set(self, double x, double y)
987 Set both the x and y properties
989 return _core_
.RealPoint_Set(*args
, **kwargs
)
991 def Get(*args
, **kwargs
):
995 Return the x and y properties as a tuple.
997 return _core_
.RealPoint_Get(*args
, **kwargs
)
999 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1000 def __str__(self
): return str(self
.Get())
1001 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
1002 def __len__(self
): return len(self
.Get())
1003 def __getitem__(self
, index
): return self
.Get()[index
]
1004 def __setitem__(self
, index
, val
):
1005 if index
== 0: self
.x
= val
1006 elif index
== 1: self
.y
= val
1007 else: raise IndexError
1008 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1009 __safe_for_unpickling__
= True
1010 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
1012 _core_
.RealPoint_swigregister(RealPoint
)
1014 #---------------------------------------------------------------------------
1016 class Point(object):
1018 A data structure for representing a point or position with integer x
1019 and y properties. Most places in wxPython that expect a wx.Point can
1020 also accept a (x,y) tuple.
1022 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1023 __repr__
= _swig_repr
1024 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1025 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1026 def __init__(self
, *args
, **kwargs
):
1028 __init__(self, int x=0, int y=0) -> Point
1030 Create a wx.Point object
1032 _core_
.Point_swiginit(self
,_core_
.new_Point(*args
, **kwargs
))
1033 __swig_destroy__
= _core_
.delete_Point
1034 __del__
= lambda self
: None;
1035 def __eq__(*args
, **kwargs
):
1037 __eq__(self, PyObject other) -> bool
1039 Test for equality of wx.Point objects.
1041 return _core_
.Point___eq__(*args
, **kwargs
)
1043 def __ne__(*args
, **kwargs
):
1045 __ne__(self, PyObject other) -> bool
1047 Test for inequality of wx.Point objects.
1049 return _core_
.Point___ne__(*args
, **kwargs
)
1051 def __add__(*args
, **kwargs
):
1053 __add__(self, Point pt) -> Point
1055 Add pt's proprties to this and return the result.
1057 return _core_
.Point___add__(*args
, **kwargs
)
1059 def __sub__(*args
, **kwargs
):
1061 __sub__(self, Point pt) -> Point
1063 Subtract pt's proprties from this and return the result
1065 return _core_
.Point___sub__(*args
, **kwargs
)
1067 def __iadd__(*args
, **kwargs
):
1069 __iadd__(self, Point pt) -> Point
1071 Add pt to this object.
1073 return _core_
.Point___iadd__(*args
, **kwargs
)
1075 def __isub__(*args
, **kwargs
):
1077 __isub__(self, Point pt) -> Point
1079 Subtract pt from this object.
1081 return _core_
.Point___isub__(*args
, **kwargs
)
1083 def Set(*args
, **kwargs
):
1085 Set(self, long x, long y)
1087 Set both the x and y properties
1089 return _core_
.Point_Set(*args
, **kwargs
)
1091 def Get(*args
, **kwargs
):
1095 Return the x and y properties as a tuple.
1097 return _core_
.Point_Get(*args
, **kwargs
)
1099 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1100 def __str__(self
): return str(self
.Get())
1101 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1102 def __len__(self
): return len(self
.Get())
1103 def __getitem__(self
, index
): return self
.Get()[index
]
1104 def __setitem__(self
, index
, val
):
1105 if index
== 0: self
.x
= val
1106 elif index
== 1: self
.y
= val
1107 else: raise IndexError
1108 def __nonzero__(self
): return self
.Get() != (0,0)
1109 __safe_for_unpickling__
= True
1110 def __reduce__(self
): return (wx
.Point
, self
.Get())
1112 _core_
.Point_swigregister(Point
)
1114 #---------------------------------------------------------------------------
1118 A class for representing and manipulating rectangles. It has x, y,
1119 width and height properties. In wxPython most palces that expect a
1120 wx.Rect can also accept a (x,y,width,height) tuple.
1122 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1123 __repr__
= _swig_repr
1124 def __init__(self
, *args
, **kwargs
):
1126 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1128 Create a new Rect object.
1130 _core_
.Rect_swiginit(self
,_core_
.new_Rect(*args
, **kwargs
))
1131 __swig_destroy__
= _core_
.delete_Rect
1132 __del__
= lambda self
: None;
1133 def GetX(*args
, **kwargs
):
1134 """GetX(self) -> int"""
1135 return _core_
.Rect_GetX(*args
, **kwargs
)
1137 def SetX(*args
, **kwargs
):
1138 """SetX(self, int x)"""
1139 return _core_
.Rect_SetX(*args
, **kwargs
)
1141 def GetY(*args
, **kwargs
):
1142 """GetY(self) -> int"""
1143 return _core_
.Rect_GetY(*args
, **kwargs
)
1145 def SetY(*args
, **kwargs
):
1146 """SetY(self, int y)"""
1147 return _core_
.Rect_SetY(*args
, **kwargs
)
1149 def GetWidth(*args
, **kwargs
):
1150 """GetWidth(self) -> int"""
1151 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1153 def SetWidth(*args
, **kwargs
):
1154 """SetWidth(self, int w)"""
1155 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1157 def GetHeight(*args
, **kwargs
):
1158 """GetHeight(self) -> int"""
1159 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1161 def SetHeight(*args
, **kwargs
):
1162 """SetHeight(self, int h)"""
1163 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1165 def GetPosition(*args
, **kwargs
):
1166 """GetPosition(self) -> Point"""
1167 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1169 def SetPosition(*args
, **kwargs
):
1170 """SetPosition(self, Point p)"""
1171 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1173 def GetSize(*args
, **kwargs
):
1174 """GetSize(self) -> Size"""
1175 return _core_
.Rect_GetSize(*args
, **kwargs
)
1177 def SetSize(*args
, **kwargs
):
1178 """SetSize(self, Size s)"""
1179 return _core_
.Rect_SetSize(*args
, **kwargs
)
1181 def IsEmpty(*args
, **kwargs
):
1182 """IsEmpty(self) -> bool"""
1183 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1185 def GetTopLeft(*args
, **kwargs
):
1186 """GetTopLeft(self) -> Point"""
1187 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1189 def SetTopLeft(*args
, **kwargs
):
1190 """SetTopLeft(self, Point p)"""
1191 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1193 def GetBottomRight(*args
, **kwargs
):
1194 """GetBottomRight(self) -> Point"""
1195 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1197 def SetBottomRight(*args
, **kwargs
):
1198 """SetBottomRight(self, Point p)"""
1199 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1201 def GetTopRight(*args
, **kwargs
):
1202 """GetTopRight(self) -> Point"""
1203 return _core_
.Rect_GetTopRight(*args
, **kwargs
)
1205 def SetTopRight(*args
, **kwargs
):
1206 """SetTopRight(self, Point p)"""
1207 return _core_
.Rect_SetTopRight(*args
, **kwargs
)
1209 def GetBottomLeft(*args
, **kwargs
):
1210 """GetBottomLeft(self) -> Point"""
1211 return _core_
.Rect_GetBottomLeft(*args
, **kwargs
)
1213 def SetBottomLeft(*args
, **kwargs
):
1214 """SetBottomLeft(self, Point p)"""
1215 return _core_
.Rect_SetBottomLeft(*args
, **kwargs
)
1217 def GetLeft(*args
, **kwargs
):
1218 """GetLeft(self) -> int"""
1219 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1221 def GetTop(*args
, **kwargs
):
1222 """GetTop(self) -> int"""
1223 return _core_
.Rect_GetTop(*args
, **kwargs
)
1225 def GetBottom(*args
, **kwargs
):
1226 """GetBottom(self) -> int"""
1227 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1229 def GetRight(*args
, **kwargs
):
1230 """GetRight(self) -> int"""
1231 return _core_
.Rect_GetRight(*args
, **kwargs
)
1233 def SetLeft(*args
, **kwargs
):
1234 """SetLeft(self, int left)"""
1235 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1237 def SetRight(*args
, **kwargs
):
1238 """SetRight(self, int right)"""
1239 return _core_
.Rect_SetRight(*args
, **kwargs
)
1241 def SetTop(*args
, **kwargs
):
1242 """SetTop(self, int top)"""
1243 return _core_
.Rect_SetTop(*args
, **kwargs
)
1245 def SetBottom(*args
, **kwargs
):
1246 """SetBottom(self, int bottom)"""
1247 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1249 position
= property(GetPosition
, SetPosition
)
1250 size
= property(GetSize
, SetSize
)
1251 left
= property(GetLeft
, SetLeft
)
1252 right
= property(GetRight
, SetRight
)
1253 top
= property(GetTop
, SetTop
)
1254 bottom
= property(GetBottom
, SetBottom
)
1256 def Inflate(*args
, **kwargs
):
1258 Inflate(self, int dx, int dy) -> Rect
1260 Increases the size of the rectangle.
1262 The left border is moved farther left and the right border is moved
1263 farther right by ``dx``. The upper border is moved farther up and the
1264 bottom border is moved farther down by ``dy``. (Note the the width and
1265 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1266 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1267 opposite happens: the rectangle size decreases in the respective
1270 The change is made to the rectangle inplace, if instead you need a
1271 copy that is inflated, preserving the original then make the copy
1274 copy = wx.Rect(*original)
1279 return _core_
.Rect_Inflate(*args
, **kwargs
)
1281 def Deflate(*args
, **kwargs
):
1283 Deflate(self, int dx, int dy) -> Rect
1285 Decrease the rectangle size. This method is the opposite of `Inflate`
1286 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1287 `Inflate` for a full description.
1289 return _core_
.Rect_Deflate(*args
, **kwargs
)
1291 def OffsetXY(*args
, **kwargs
):
1293 OffsetXY(self, int dx, int dy)
1295 Moves the rectangle by the specified offset. If dx is positive, the
1296 rectangle is moved to the right, if dy is positive, it is moved to the
1297 bottom, otherwise it is moved to the left or top respectively.
1299 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1301 def Offset(*args
, **kwargs
):
1303 Offset(self, Point pt)
1305 Same as `OffsetXY` but uses dx,dy from Point
1307 return _core_
.Rect_Offset(*args
, **kwargs
)
1309 def Intersect(*args
, **kwargs
):
1311 Intersect(self, Rect rect) -> Rect
1313 Returns the intersectsion of this rectangle and rect.
1315 return _core_
.Rect_Intersect(*args
, **kwargs
)
1317 def Union(*args
, **kwargs
):
1319 Union(self, Rect rect) -> Rect
1321 Returns the union of this rectangle and rect.
1323 return _core_
.Rect_Union(*args
, **kwargs
)
1325 def __add__(*args
, **kwargs
):
1327 __add__(self, Rect rect) -> Rect
1329 Add the properties of rect to this rectangle and return the result.
1331 return _core_
.Rect___add__(*args
, **kwargs
)
1333 def __iadd__(*args
, **kwargs
):
1335 __iadd__(self, Rect rect) -> Rect
1337 Add the properties of rect to this rectangle, updating this rectangle.
1339 return _core_
.Rect___iadd__(*args
, **kwargs
)
1341 def __eq__(*args
, **kwargs
):
1343 __eq__(self, PyObject other) -> bool
1345 Test for equality of wx.Rect objects.
1347 return _core_
.Rect___eq__(*args
, **kwargs
)
1349 def __ne__(*args
, **kwargs
):
1351 __ne__(self, PyObject other) -> bool
1353 Test for inequality of wx.Rect objects.
1355 return _core_
.Rect___ne__(*args
, **kwargs
)
1357 def ContainsXY(*args
, **kwargs
):
1359 ContainsXY(self, int x, int y) -> bool
1361 Return True if the point is inside the rect.
1363 return _core_
.Rect_ContainsXY(*args
, **kwargs
)
1365 def Contains(*args
, **kwargs
):
1367 Contains(self, Point pt) -> bool
1369 Return True if the point is inside the rect.
1371 return _core_
.Rect_Contains(*args
, **kwargs
)
1373 def ContainsRect(*args
, **kwargs
):
1375 ContainsRect(self, Rect rect) -> bool
1377 Returns ``True`` if the given rectangle is completely inside this
1378 rectangle or touches its boundary.
1380 return _core_
.Rect_ContainsRect(*args
, **kwargs
)
1382 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1383 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1384 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1386 InsideXY
= ContainsXY
1387 InsideRect
= ContainsRect
1389 def Intersects(*args
, **kwargs
):
1391 Intersects(self, Rect rect) -> bool
1393 Returns True if the rectangles have a non empty intersection.
1395 return _core_
.Rect_Intersects(*args
, **kwargs
)
1397 def CenterIn(*args
, **kwargs
):
1399 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1401 Center this rectangle within the one passed to the method, which is
1402 usually, but not necessarily, the larger one.
1404 return _core_
.Rect_CenterIn(*args
, **kwargs
)
1407 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1408 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1409 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1410 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1411 def Set(*args
, **kwargs
):
1413 Set(self, int x=0, int y=0, int width=0, int height=0)
1415 Set all rectangle properties.
1417 return _core_
.Rect_Set(*args
, **kwargs
)
1419 def Get(*args
, **kwargs
):
1421 Get() -> (x,y,width,height)
1423 Return the rectangle properties as a tuple.
1425 return _core_
.Rect_Get(*args
, **kwargs
)
1427 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1428 def __str__(self
): return str(self
.Get())
1429 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1430 def __len__(self
): return len(self
.Get())
1431 def __getitem__(self
, index
): return self
.Get()[index
]
1432 def __setitem__(self
, index
, val
):
1433 if index
== 0: self
.x
= val
1434 elif index
== 1: self
.y
= val
1435 elif index
== 2: self
.width
= val
1436 elif index
== 3: self
.height
= val
1437 else: raise IndexError
1438 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1439 __safe_for_unpickling__
= True
1440 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1442 Bottom
= property(GetBottom
,SetBottom
,doc
="See `GetBottom` and `SetBottom`")
1443 BottomRight
= property(GetBottomRight
,SetBottomRight
,doc
="See `GetBottomRight` and `SetBottomRight`")
1444 BottomLeft
= property(GetBottomLeft
,SetBottomLeft
,doc
="See `GetBottomLeft` and `SetBottomLeft`")
1445 Height
= property(GetHeight
,SetHeight
,doc
="See `GetHeight` and `SetHeight`")
1446 Left
= property(GetLeft
,SetLeft
,doc
="See `GetLeft` and `SetLeft`")
1447 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
1448 Right
= property(GetRight
,SetRight
,doc
="See `GetRight` and `SetRight`")
1449 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
1450 Top
= property(GetTop
,SetTop
,doc
="See `GetTop` and `SetTop`")
1451 TopLeft
= property(GetTopLeft
,SetTopLeft
,doc
="See `GetTopLeft` and `SetTopLeft`")
1452 TopRight
= property(GetTopRight
,SetTopRight
,doc
="See `GetTopRight` and `SetTopRight`")
1453 Width
= property(GetWidth
,SetWidth
,doc
="See `GetWidth` and `SetWidth`")
1454 X
= property(GetX
,SetX
,doc
="See `GetX` and `SetX`")
1455 Y
= property(GetY
,SetY
,doc
="See `GetY` and `SetY`")
1456 Empty
= property(IsEmpty
,doc
="See `IsEmpty`")
1457 _core_
.Rect_swigregister(Rect
)
1459 def RectPP(*args
, **kwargs
):
1461 RectPP(Point topLeft, Point bottomRight) -> Rect
1463 Create a new Rect object from Points representing two corners.
1465 val
= _core_
.new_RectPP(*args
, **kwargs
)
1468 def RectPS(*args
, **kwargs
):
1470 RectPS(Point pos, Size size) -> Rect
1472 Create a new Rect from a position and size.
1474 val
= _core_
.new_RectPS(*args
, **kwargs
)
1477 def RectS(*args
, **kwargs
):
1479 RectS(Size size) -> Rect
1481 Create a new Rect from a size only.
1483 val
= _core_
.new_RectS(*args
, **kwargs
)
1487 def IntersectRect(*args
, **kwargs
):
1489 IntersectRect(Rect r1, Rect r2) -> Rect
1491 Calculate and return the intersection of r1 and r2.
1493 return _core_
.IntersectRect(*args
, **kwargs
)
1494 #---------------------------------------------------------------------------
1496 class Point2D(object):
1498 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1499 with floating point values.
1501 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1502 __repr__
= _swig_repr
1503 def __init__(self
, *args
, **kwargs
):
1505 __init__(self, double x=0.0, double y=0.0) -> Point2D
1507 Create a w.Point2D object.
1509 _core_
.Point2D_swiginit(self
,_core_
.new_Point2D(*args
, **kwargs
))
1510 __swig_destroy__
= _core_
.delete_Point2D
1511 __del__
= lambda self
: None;
1512 def GetFloor(*args
, **kwargs
):
1518 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1520 def GetRounded(*args
, **kwargs
):
1522 GetRounded() -> (x,y)
1526 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1528 def GetVectorLength(*args
, **kwargs
):
1529 """GetVectorLength(self) -> double"""
1530 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1532 def GetVectorAngle(*args
, **kwargs
):
1533 """GetVectorAngle(self) -> double"""
1534 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1536 def SetVectorLength(*args
, **kwargs
):
1537 """SetVectorLength(self, double length)"""
1538 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1540 def SetVectorAngle(*args
, **kwargs
):
1541 """SetVectorAngle(self, double degrees)"""
1542 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1544 def SetPolarCoordinates(self
, angle
, length
):
1545 self
.SetVectorLength(length
)
1546 self
.SetVectorAngle(angle
)
1547 def Normalize(self
):
1548 self
.SetVectorLength(1.0)
1550 def GetDistance(*args
, **kwargs
):
1551 """GetDistance(self, Point2D pt) -> double"""
1552 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1554 def GetDistanceSquare(*args
, **kwargs
):
1555 """GetDistanceSquare(self, Point2D pt) -> double"""
1556 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1558 def GetDotProduct(*args
, **kwargs
):
1559 """GetDotProduct(self, Point2D vec) -> double"""
1560 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1562 def GetCrossProduct(*args
, **kwargs
):
1563 """GetCrossProduct(self, Point2D vec) -> double"""
1564 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1566 def __neg__(*args
, **kwargs
):
1568 __neg__(self) -> Point2D
1570 the reflection of this point
1572 return _core_
.Point2D___neg__(*args
, **kwargs
)
1574 def __iadd__(*args
, **kwargs
):
1575 """__iadd__(self, Point2D pt) -> Point2D"""
1576 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1578 def __isub__(*args
, **kwargs
):
1579 """__isub__(self, Point2D pt) -> Point2D"""
1580 return _core_
.Point2D___isub__(*args
, **kwargs
)
1582 def __imul__(*args
, **kwargs
):
1583 """__imul__(self, Point2D pt) -> Point2D"""
1584 return _core_
.Point2D___imul__(*args
, **kwargs
)
1586 def __idiv__(*args
, **kwargs
):
1587 """__idiv__(self, Point2D pt) -> Point2D"""
1588 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1590 def __eq__(*args
, **kwargs
):
1592 __eq__(self, PyObject other) -> bool
1594 Test for equality of wx.Point2D objects.
1596 return _core_
.Point2D___eq__(*args
, **kwargs
)
1598 def __ne__(*args
, **kwargs
):
1600 __ne__(self, PyObject other) -> bool
1602 Test for inequality of wx.Point2D objects.
1604 return _core_
.Point2D___ne__(*args
, **kwargs
)
1606 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1607 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1608 def Set(*args
, **kwargs
):
1609 """Set(self, double x=0, double y=0)"""
1610 return _core_
.Point2D_Set(*args
, **kwargs
)
1612 def Get(*args
, **kwargs
):
1616 Return x and y properties as a tuple.
1618 return _core_
.Point2D_Get(*args
, **kwargs
)
1620 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1621 def __str__(self
): return str(self
.Get())
1622 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1623 def __len__(self
): return len(self
.Get())
1624 def __getitem__(self
, index
): return self
.Get()[index
]
1625 def __setitem__(self
, index
, val
):
1626 if index
== 0: self
.x
= val
1627 elif index
== 1: self
.y
= val
1628 else: raise IndexError
1629 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1630 __safe_for_unpickling__
= True
1631 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1633 Floor
= property(GetFloor
,doc
="See `GetFloor`")
1634 Rounded
= property(GetRounded
,doc
="See `GetRounded`")
1635 VectorAngle
= property(GetVectorAngle
,SetVectorAngle
,doc
="See `GetVectorAngle` and `SetVectorAngle`")
1636 VectorLength
= property(GetVectorLength
,SetVectorLength
,doc
="See `GetVectorLength` and `SetVectorLength`")
1637 _core_
.Point2D_swigregister(Point2D
)
1639 def Point2DCopy(*args
, **kwargs
):
1641 Point2DCopy(Point2D pt) -> Point2D
1643 Create a w.Point2D object.
1645 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1648 def Point2DFromPoint(*args
, **kwargs
):
1650 Point2DFromPoint(Point pt) -> Point2D
1652 Create a w.Point2D object.
1654 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1657 #---------------------------------------------------------------------------
1659 Inside
= _core_
.Inside
1660 OutLeft
= _core_
.OutLeft
1661 OutRight
= _core_
.OutRight
1662 OutTop
= _core_
.OutTop
1663 OutBottom
= _core_
.OutBottom
1664 class Rect2D(object):
1666 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1667 with floating point component values.
1669 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1670 __repr__
= _swig_repr
1671 def __init__(self
, *args
, **kwargs
):
1673 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1675 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1676 with floating point component values.
1678 _core_
.Rect2D_swiginit(self
,_core_
.new_Rect2D(*args
, **kwargs
))
1679 __swig_destroy__
= _core_
.delete_Rect2D
1680 __del__
= lambda self
: None;
1681 def GetPosition(*args
, **kwargs
):
1682 """GetPosition(self) -> Point2D"""
1683 return _core_
.Rect2D_GetPosition(*args
, **kwargs
)
1685 def GetSize(*args
, **kwargs
):
1686 """GetSize(self) -> Size"""
1687 return _core_
.Rect2D_GetSize(*args
, **kwargs
)
1689 def GetLeft(*args
, **kwargs
):
1690 """GetLeft(self) -> wxDouble"""
1691 return _core_
.Rect2D_GetLeft(*args
, **kwargs
)
1693 def SetLeft(*args
, **kwargs
):
1694 """SetLeft(self, wxDouble n)"""
1695 return _core_
.Rect2D_SetLeft(*args
, **kwargs
)
1697 def MoveLeftTo(*args
, **kwargs
):
1698 """MoveLeftTo(self, wxDouble n)"""
1699 return _core_
.Rect2D_MoveLeftTo(*args
, **kwargs
)
1701 def GetTop(*args
, **kwargs
):
1702 """GetTop(self) -> wxDouble"""
1703 return _core_
.Rect2D_GetTop(*args
, **kwargs
)
1705 def SetTop(*args
, **kwargs
):
1706 """SetTop(self, wxDouble n)"""
1707 return _core_
.Rect2D_SetTop(*args
, **kwargs
)
1709 def MoveTopTo(*args
, **kwargs
):
1710 """MoveTopTo(self, wxDouble n)"""
1711 return _core_
.Rect2D_MoveTopTo(*args
, **kwargs
)
1713 def GetBottom(*args
, **kwargs
):
1714 """GetBottom(self) -> wxDouble"""
1715 return _core_
.Rect2D_GetBottom(*args
, **kwargs
)
1717 def SetBottom(*args
, **kwargs
):
1718 """SetBottom(self, wxDouble n)"""
1719 return _core_
.Rect2D_SetBottom(*args
, **kwargs
)
1721 def MoveBottomTo(*args
, **kwargs
):
1722 """MoveBottomTo(self, wxDouble n)"""
1723 return _core_
.Rect2D_MoveBottomTo(*args
, **kwargs
)
1725 def GetRight(*args
, **kwargs
):
1726 """GetRight(self) -> wxDouble"""
1727 return _core_
.Rect2D_GetRight(*args
, **kwargs
)
1729 def SetRight(*args
, **kwargs
):
1730 """SetRight(self, wxDouble n)"""
1731 return _core_
.Rect2D_SetRight(*args
, **kwargs
)
1733 def MoveRightTo(*args
, **kwargs
):
1734 """MoveRightTo(self, wxDouble n)"""
1735 return _core_
.Rect2D_MoveRightTo(*args
, **kwargs
)
1737 def GetLeftTop(*args
, **kwargs
):
1738 """GetLeftTop(self) -> Point2D"""
1739 return _core_
.Rect2D_GetLeftTop(*args
, **kwargs
)
1741 def SetLeftTop(*args
, **kwargs
):
1742 """SetLeftTop(self, Point2D pt)"""
1743 return _core_
.Rect2D_SetLeftTop(*args
, **kwargs
)
1745 def MoveLeftTopTo(*args
, **kwargs
):
1746 """MoveLeftTopTo(self, Point2D pt)"""
1747 return _core_
.Rect2D_MoveLeftTopTo(*args
, **kwargs
)
1749 def GetLeftBottom(*args
, **kwargs
):
1750 """GetLeftBottom(self) -> Point2D"""
1751 return _core_
.Rect2D_GetLeftBottom(*args
, **kwargs
)
1753 def SetLeftBottom(*args
, **kwargs
):
1754 """SetLeftBottom(self, Point2D pt)"""
1755 return _core_
.Rect2D_SetLeftBottom(*args
, **kwargs
)
1757 def MoveLeftBottomTo(*args
, **kwargs
):
1758 """MoveLeftBottomTo(self, Point2D pt)"""
1759 return _core_
.Rect2D_MoveLeftBottomTo(*args
, **kwargs
)
1761 def GetRightTop(*args
, **kwargs
):
1762 """GetRightTop(self) -> Point2D"""
1763 return _core_
.Rect2D_GetRightTop(*args
, **kwargs
)
1765 def SetRightTop(*args
, **kwargs
):
1766 """SetRightTop(self, Point2D pt)"""
1767 return _core_
.Rect2D_SetRightTop(*args
, **kwargs
)
1769 def MoveRightTopTo(*args
, **kwargs
):
1770 """MoveRightTopTo(self, Point2D pt)"""
1771 return _core_
.Rect2D_MoveRightTopTo(*args
, **kwargs
)
1773 def GetRightBottom(*args
, **kwargs
):
1774 """GetRightBottom(self) -> Point2D"""
1775 return _core_
.Rect2D_GetRightBottom(*args
, **kwargs
)
1777 def SetRightBottom(*args
, **kwargs
):
1778 """SetRightBottom(self, Point2D pt)"""
1779 return _core_
.Rect2D_SetRightBottom(*args
, **kwargs
)
1781 def MoveRightBottomTo(*args
, **kwargs
):
1782 """MoveRightBottomTo(self, Point2D pt)"""
1783 return _core_
.Rect2D_MoveRightBottomTo(*args
, **kwargs
)
1785 def GetCentre(*args
, **kwargs
):
1786 """GetCentre(self) -> Point2D"""
1787 return _core_
.Rect2D_GetCentre(*args
, **kwargs
)
1789 def SetCentre(*args
, **kwargs
):
1790 """SetCentre(self, Point2D pt)"""
1791 return _core_
.Rect2D_SetCentre(*args
, **kwargs
)
1793 def MoveCentreTo(*args
, **kwargs
):
1794 """MoveCentreTo(self, Point2D pt)"""
1795 return _core_
.Rect2D_MoveCentreTo(*args
, **kwargs
)
1797 def GetOutcode(*args
, **kwargs
):
1798 """GetOutcode(self, Point2D pt) -> int"""
1799 return _core_
.Rect2D_GetOutcode(*args
, **kwargs
)
1801 def Contains(*args
, **kwargs
):
1802 """Contains(self, Point2D pt) -> bool"""
1803 return _core_
.Rect2D_Contains(*args
, **kwargs
)
1805 def ContainsRect(*args
, **kwargs
):
1806 """ContainsRect(self, Rect2D rect) -> bool"""
1807 return _core_
.Rect2D_ContainsRect(*args
, **kwargs
)
1809 def IsEmpty(*args
, **kwargs
):
1810 """IsEmpty(self) -> bool"""
1811 return _core_
.Rect2D_IsEmpty(*args
, **kwargs
)
1813 def HaveEqualSize(*args
, **kwargs
):
1814 """HaveEqualSize(self, Rect2D rect) -> bool"""
1815 return _core_
.Rect2D_HaveEqualSize(*args
, **kwargs
)
1819 Inset(self, wxDouble x, wxDouble y)
1820 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1822 return _core_
.Rect2D_Inset(*args
)
1824 def Offset(*args
, **kwargs
):
1825 """Offset(self, Point2D pt)"""
1826 return _core_
.Rect2D_Offset(*args
, **kwargs
)
1828 def ConstrainTo(*args
, **kwargs
):
1829 """ConstrainTo(self, Rect2D rect)"""
1830 return _core_
.Rect2D_ConstrainTo(*args
, **kwargs
)
1832 def Interpolate(*args
, **kwargs
):
1833 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1834 return _core_
.Rect2D_Interpolate(*args
, **kwargs
)
1836 def Intersect(*args
, **kwargs
):
1837 """Intersect(self, Rect2D otherRect)"""
1838 return _core_
.Rect2D_Intersect(*args
, **kwargs
)
1840 def CreateIntersection(*args
, **kwargs
):
1841 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1842 return _core_
.Rect2D_CreateIntersection(*args
, **kwargs
)
1844 def Intersects(*args
, **kwargs
):
1845 """Intersects(self, Rect2D rect) -> bool"""
1846 return _core_
.Rect2D_Intersects(*args
, **kwargs
)
1848 def Union(*args
, **kwargs
):
1849 """Union(self, Rect2D otherRect)"""
1850 return _core_
.Rect2D_Union(*args
, **kwargs
)
1852 def CreateUnion(*args
, **kwargs
):
1853 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1854 return _core_
.Rect2D_CreateUnion(*args
, **kwargs
)
1858 Scale(self, wxDouble f)
1859 Scale(self, int num, int denum)
1861 return _core_
.Rect2D_Scale(*args
)
1863 def __eq__(*args
, **kwargs
):
1865 __eq__(self, PyObject other) -> bool
1867 Test for equality of wx.Rect2D objects.
1869 return _core_
.Rect2D___eq__(*args
, **kwargs
)
1871 def __ne__(*args
, **kwargs
):
1873 __ne__(self, PyObject other) -> bool
1875 Test for inequality of wx.Rect2D objects.
1877 return _core_
.Rect2D___ne__(*args
, **kwargs
)
1879 x
= property(_core_
.Rect2D_x_get
, _core_
.Rect2D_x_set
)
1880 y
= property(_core_
.Rect2D_y_get
, _core_
.Rect2D_y_set
)
1881 width
= property(_core_
.Rect2D_width_get
, _core_
.Rect2D_width_set
)
1882 height
= property(_core_
.Rect2D_height_get
, _core_
.Rect2D_height_set
)
1883 def Set(*args
, **kwargs
):
1884 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1885 return _core_
.Rect2D_Set(*args
, **kwargs
)
1887 def Get(*args
, **kwargs
):
1889 Get() -> (x,y, width, height)
1891 Return x, y, width and height y properties as a tuple.
1893 return _core_
.Rect2D_Get(*args
, **kwargs
)
1895 def __str__(self
): return str(self
.Get())
1896 def __repr__(self
): return 'wx.Rect2D'+str(self
.Get())
1897 def __len__(self
): return len(self
.Get())
1898 def __getitem__(self
, index
): return self
.Get()[index
]
1899 def __setitem__(self
, index
, val
):
1900 if index
== 0: self
.x
= val
1901 elif index
== 1: self
.y
= val
1902 elif index
== 2: self
.width
= val
1903 elif index
== 3: self
.height
= val
1904 else: raise IndexError
1905 def __nonzero__(self
): return self
.Get() != (0.0, 0.0, 0.0, 0.0)
1906 __safe_for_unpickling__
= True
1907 def __reduce__(self
): return (wx
.Rect2D
, self
.Get())
1909 _core_
.Rect2D_swigregister(Rect2D
)
1911 class Position(object):
1912 """Proxy of C++ Position class"""
1913 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1914 __repr__
= _swig_repr
1915 def __init__(self
, *args
, **kwargs
):
1916 """__init__(self, int row=0, int col=0) -> Position"""
1917 _core_
.Position_swiginit(self
,_core_
.new_Position(*args
, **kwargs
))
1918 __swig_destroy__
= _core_
.delete_Position
1919 __del__
= lambda self
: None;
1920 def GetRow(*args
, **kwargs
):
1921 """GetRow(self) -> int"""
1922 return _core_
.Position_GetRow(*args
, **kwargs
)
1924 def GetColumn(*args
, **kwargs
):
1925 """GetColumn(self) -> int"""
1926 return _core_
.Position_GetColumn(*args
, **kwargs
)
1928 def GetCol(*args
, **kwargs
):
1929 """GetCol(self) -> int"""
1930 return _core_
.Position_GetCol(*args
, **kwargs
)
1932 def SetRow(*args
, **kwargs
):
1933 """SetRow(self, int row)"""
1934 return _core_
.Position_SetRow(*args
, **kwargs
)
1936 def SetColumn(*args
, **kwargs
):
1937 """SetColumn(self, int column)"""
1938 return _core_
.Position_SetColumn(*args
, **kwargs
)
1940 def SetCol(*args
, **kwargs
):
1941 """SetCol(self, int column)"""
1942 return _core_
.Position_SetCol(*args
, **kwargs
)
1944 def __eq__(*args
, **kwargs
):
1946 __eq__(self, PyObject other) -> bool
1948 Test for equality of wx.Position objects.
1950 return _core_
.Position___eq__(*args
, **kwargs
)
1952 def __ne__(*args
, **kwargs
):
1954 __ne__(self, PyObject other) -> bool
1956 Test for inequality of wx.Position objects.
1958 return _core_
.Position___ne__(*args
, **kwargs
)
1962 __add__(self, Position p) -> Position
1963 __add__(self, Size s) -> Position
1965 return _core_
.Position___add__(*args
)
1969 __sub__(self, Position p) -> Position
1970 __sub__(self, Size s) -> Position
1972 return _core_
.Position___sub__(*args
)
1974 row
= property(GetRow
,SetRow
)
1975 col
= property(GetCol
,SetCol
)
1976 _core_
.Position_swigregister(Position
)
1978 #---------------------------------------------------------------------------
1980 FromStart
= _core_
.FromStart
1981 FromCurrent
= _core_
.FromCurrent
1982 FromEnd
= _core_
.FromEnd
1983 class InputStream(object):
1984 """Proxy of C++ InputStream class"""
1985 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1986 __repr__
= _swig_repr
1987 def __init__(self
, *args
, **kwargs
):
1988 """__init__(self, PyObject p) -> InputStream"""
1989 _core_
.InputStream_swiginit(self
,_core_
.new_InputStream(*args
, **kwargs
))
1990 __swig_destroy__
= _core_
.delete_InputStream
1991 __del__
= lambda self
: None;
1992 def close(*args
, **kwargs
):
1994 return _core_
.InputStream_close(*args
, **kwargs
)
1996 def flush(*args
, **kwargs
):
1998 return _core_
.InputStream_flush(*args
, **kwargs
)
2000 def eof(*args
, **kwargs
):
2001 """eof(self) -> bool"""
2002 return _core_
.InputStream_eof(*args
, **kwargs
)
2004 def read(*args
, **kwargs
):
2005 """read(self, int size=-1) -> PyObject"""
2006 return _core_
.InputStream_read(*args
, **kwargs
)
2008 def readline(*args
, **kwargs
):
2009 """readline(self, int size=-1) -> PyObject"""
2010 return _core_
.InputStream_readline(*args
, **kwargs
)
2012 def readlines(*args
, **kwargs
):
2013 """readlines(self, int sizehint=-1) -> PyObject"""
2014 return _core_
.InputStream_readlines(*args
, **kwargs
)
2016 def seek(*args
, **kwargs
):
2017 """seek(self, int offset, int whence=0)"""
2018 return _core_
.InputStream_seek(*args
, **kwargs
)
2020 def tell(*args
, **kwargs
):
2021 """tell(self) -> int"""
2022 return _core_
.InputStream_tell(*args
, **kwargs
)
2024 def Peek(*args
, **kwargs
):
2025 """Peek(self) -> char"""
2026 return _core_
.InputStream_Peek(*args
, **kwargs
)
2028 def GetC(*args
, **kwargs
):
2029 """GetC(self) -> char"""
2030 return _core_
.InputStream_GetC(*args
, **kwargs
)
2032 def LastRead(*args
, **kwargs
):
2033 """LastRead(self) -> size_t"""
2034 return _core_
.InputStream_LastRead(*args
, **kwargs
)
2036 def CanRead(*args
, **kwargs
):
2037 """CanRead(self) -> bool"""
2038 return _core_
.InputStream_CanRead(*args
, **kwargs
)
2040 def Eof(*args
, **kwargs
):
2041 """Eof(self) -> bool"""
2042 return _core_
.InputStream_Eof(*args
, **kwargs
)
2044 def Ungetch(*args
, **kwargs
):
2045 """Ungetch(self, char c) -> bool"""
2046 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
2048 def SeekI(*args
, **kwargs
):
2049 """SeekI(self, long pos, int mode=FromStart) -> long"""
2050 return _core_
.InputStream_SeekI(*args
, **kwargs
)
2052 def TellI(*args
, **kwargs
):
2053 """TellI(self) -> long"""
2054 return _core_
.InputStream_TellI(*args
, **kwargs
)
2056 _core_
.InputStream_swigregister(InputStream
)
2057 DefaultPosition
= cvar
.DefaultPosition
2058 DefaultSize
= cvar
.DefaultSize
2060 class OutputStream(object):
2061 """Proxy of C++ OutputStream class"""
2062 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2063 def __init__(self
): raise AttributeError, "No constructor defined"
2064 __repr__
= _swig_repr
2065 def write(*args
, **kwargs
):
2066 """write(self, PyObject obj)"""
2067 return _core_
.OutputStream_write(*args
, **kwargs
)
2069 def LastWrite(*args
, **kwargs
):
2070 """LastWrite(self) -> size_t"""
2071 return _core_
.OutputStream_LastWrite(*args
, **kwargs
)
2073 _core_
.OutputStream_swigregister(OutputStream
)
2075 #---------------------------------------------------------------------------
2077 class FSFile(Object
):
2078 """Proxy of C++ FSFile class"""
2079 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2080 __repr__
= _swig_repr
2081 def __init__(self
, *args
, **kwargs
):
2083 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
2084 DateTime modif) -> FSFile
2086 _core_
.FSFile_swiginit(self
,_core_
.new_FSFile(*args
, **kwargs
))
2087 __swig_destroy__
= _core_
.delete_FSFile
2088 __del__
= lambda self
: None;
2089 def GetStream(*args
, **kwargs
):
2090 """GetStream(self) -> InputStream"""
2091 return _core_
.FSFile_GetStream(*args
, **kwargs
)
2093 def DetachStream(*args
, **kwargs
):
2094 """DetachStream(self)"""
2095 return _core_
.FSFile_DetachStream(*args
, **kwargs
)
2097 def GetMimeType(*args
, **kwargs
):
2098 """GetMimeType(self) -> String"""
2099 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
2101 def GetLocation(*args
, **kwargs
):
2102 """GetLocation(self) -> String"""
2103 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
2105 def GetAnchor(*args
, **kwargs
):
2106 """GetAnchor(self) -> String"""
2107 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
2109 def GetModificationTime(*args
, **kwargs
):
2110 """GetModificationTime(self) -> DateTime"""
2111 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
2113 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
2114 Location
= property(GetLocation
,doc
="See `GetLocation`")
2115 MimeType
= property(GetMimeType
,doc
="See `GetMimeType`")
2116 ModificationTime
= property(GetModificationTime
,doc
="See `GetModificationTime`")
2117 Stream
= property(GetStream
,doc
="See `GetStream`")
2118 _core_
.FSFile_swigregister(FSFile
)
2120 class CPPFileSystemHandler(object):
2121 """Proxy of C++ CPPFileSystemHandler class"""
2122 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2123 def __init__(self
): raise AttributeError, "No constructor defined"
2124 __repr__
= _swig_repr
2125 __swig_destroy__
= _core_
.delete_CPPFileSystemHandler
2126 __del__
= lambda self
: None;
2127 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandler
)
2129 class FileSystemHandler(CPPFileSystemHandler
):
2130 """Proxy of C++ FileSystemHandler class"""
2131 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2132 __repr__
= _swig_repr
2133 def __init__(self
, *args
, **kwargs
):
2134 """__init__(self) -> FileSystemHandler"""
2135 _core_
.FileSystemHandler_swiginit(self
,_core_
.new_FileSystemHandler(*args
, **kwargs
))
2136 FileSystemHandler
._setCallbackInfo
(self
, self
, FileSystemHandler
)
2138 def _setCallbackInfo(*args
, **kwargs
):
2139 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
2140 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
2142 def CanOpen(*args
, **kwargs
):
2143 """CanOpen(self, String location) -> bool"""
2144 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
2146 def OpenFile(*args
, **kwargs
):
2147 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2148 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
2150 def FindFirst(*args
, **kwargs
):
2151 """FindFirst(self, String spec, int flags=0) -> String"""
2152 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
2154 def FindNext(*args
, **kwargs
):
2155 """FindNext(self) -> String"""
2156 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
2158 def GetProtocol(*args
, **kwargs
):
2159 """GetProtocol(self, String location) -> String"""
2160 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
2162 def GetLeftLocation(*args
, **kwargs
):
2163 """GetLeftLocation(self, String location) -> String"""
2164 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
2166 def GetAnchor(*args
, **kwargs
):
2167 """GetAnchor(self, String location) -> String"""
2168 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
2170 def GetRightLocation(*args
, **kwargs
):
2171 """GetRightLocation(self, String location) -> String"""
2172 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
2174 def GetMimeTypeFromExt(*args
, **kwargs
):
2175 """GetMimeTypeFromExt(self, String location) -> String"""
2176 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
2178 Anchor
= property(GetAnchor
,doc
="See `GetAnchor`")
2179 LeftLocation
= property(GetLeftLocation
,doc
="See `GetLeftLocation`")
2180 MimeTypeFromExt
= property(GetMimeTypeFromExt
,doc
="See `GetMimeTypeFromExt`")
2181 Protocol
= property(GetProtocol
,doc
="See `GetProtocol`")
2182 RightLocation
= property(GetRightLocation
,doc
="See `GetRightLocation`")
2183 _core_
.FileSystemHandler_swigregister(FileSystemHandler
)
2185 class FileSystem(Object
):
2186 """Proxy of C++ FileSystem class"""
2187 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2188 __repr__
= _swig_repr
2189 def __init__(self
, *args
, **kwargs
):
2190 """__init__(self) -> FileSystem"""
2191 _core_
.FileSystem_swiginit(self
,_core_
.new_FileSystem(*args
, **kwargs
))
2192 __swig_destroy__
= _core_
.delete_FileSystem
2193 __del__
= lambda self
: None;
2194 def ChangePathTo(*args
, **kwargs
):
2195 """ChangePathTo(self, String location, bool is_dir=False)"""
2196 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
2198 def GetPath(*args
, **kwargs
):
2199 """GetPath(self) -> String"""
2200 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
2202 def OpenFile(*args
, **kwargs
):
2203 """OpenFile(self, String location) -> FSFile"""
2204 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
2206 def FindFirst(*args
, **kwargs
):
2207 """FindFirst(self, String spec, int flags=0) -> String"""
2208 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
2210 def FindNext(*args
, **kwargs
):
2211 """FindNext(self) -> String"""
2212 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
2214 def AddHandler(*args
, **kwargs
):
2215 """AddHandler(CPPFileSystemHandler handler)"""
2216 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
2218 AddHandler
= staticmethod(AddHandler
)
2219 def RemoveHandler(*args
, **kwargs
):
2220 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2221 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
2223 RemoveHandler
= staticmethod(RemoveHandler
)
2224 def CleanUpHandlers(*args
, **kwargs
):
2225 """CleanUpHandlers()"""
2226 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
2228 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
2229 def FileNameToURL(*args
, **kwargs
):
2230 """FileNameToURL(String filename) -> String"""
2231 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
2233 FileNameToURL
= staticmethod(FileNameToURL
)
2234 def URLToFileName(*args
, **kwargs
):
2235 """URLToFileName(String url) -> String"""
2236 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
2238 URLToFileName
= staticmethod(URLToFileName
)
2239 Path
= property(GetPath
,doc
="See `GetPath`")
2240 _core_
.FileSystem_swigregister(FileSystem
)
2242 def FileSystem_AddHandler(*args
, **kwargs
):
2243 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2244 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
2246 def FileSystem_RemoveHandler(*args
, **kwargs
):
2247 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2248 return _core_
.FileSystem_RemoveHandler(*args
, **kwargs
)
2250 def FileSystem_CleanUpHandlers(*args
):
2251 """FileSystem_CleanUpHandlers()"""
2252 return _core_
.FileSystem_CleanUpHandlers(*args
)
2254 def FileSystem_FileNameToURL(*args
, **kwargs
):
2255 """FileSystem_FileNameToURL(String filename) -> String"""
2256 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
2258 def FileSystem_URLToFileName(*args
, **kwargs
):
2259 """FileSystem_URLToFileName(String url) -> String"""
2260 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
2262 class InternetFSHandler(CPPFileSystemHandler
):
2263 """Proxy of C++ InternetFSHandler class"""
2264 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2265 __repr__
= _swig_repr
2266 def __init__(self
, *args
, **kwargs
):
2267 """__init__(self) -> InternetFSHandler"""
2268 _core_
.InternetFSHandler_swiginit(self
,_core_
.new_InternetFSHandler(*args
, **kwargs
))
2269 def CanOpen(*args
, **kwargs
):
2270 """CanOpen(self, String location) -> bool"""
2271 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
2273 def OpenFile(*args
, **kwargs
):
2274 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2275 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
2277 _core_
.InternetFSHandler_swigregister(InternetFSHandler
)
2279 class ZipFSHandler(CPPFileSystemHandler
):
2280 """Proxy of C++ ZipFSHandler class"""
2281 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2282 __repr__
= _swig_repr
2283 def __init__(self
, *args
, **kwargs
):
2284 """__init__(self) -> ZipFSHandler"""
2285 _core_
.ZipFSHandler_swiginit(self
,_core_
.new_ZipFSHandler(*args
, **kwargs
))
2286 def CanOpen(*args
, **kwargs
):
2287 """CanOpen(self, String location) -> bool"""
2288 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
2290 def OpenFile(*args
, **kwargs
):
2291 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2292 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
2294 def FindFirst(*args
, **kwargs
):
2295 """FindFirst(self, String spec, int flags=0) -> String"""
2296 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
2298 def FindNext(*args
, **kwargs
):
2299 """FindNext(self) -> String"""
2300 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
2302 _core_
.ZipFSHandler_swigregister(ZipFSHandler
)
2305 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
2306 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2307 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
2309 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
2310 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2311 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
2313 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
2314 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2315 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
2316 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
2318 Add 'file' to the memory filesystem. The dataItem parameter can
2319 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2320 arbitrary data. If a bitmap or image is used then the imgType
2321 parameter should specify what kind of image file it should be
2322 written as, wx.BITMAP_TYPE_PNG, etc.
2324 if isinstance(dataItem
, wx
.Image
):
2325 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
2326 elif isinstance(dataItem
, wx
.Bitmap
):
2327 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
2328 elif type(dataItem
) == str:
2329 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
2331 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
2333 class MemoryFSHandler(CPPFileSystemHandler
):
2334 """Proxy of C++ MemoryFSHandler class"""
2335 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2336 __repr__
= _swig_repr
2337 def __init__(self
, *args
, **kwargs
):
2338 """__init__(self) -> MemoryFSHandler"""
2339 _core_
.MemoryFSHandler_swiginit(self
,_core_
.new_MemoryFSHandler(*args
, **kwargs
))
2340 def RemoveFile(*args
, **kwargs
):
2341 """RemoveFile(String filename)"""
2342 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2344 RemoveFile
= staticmethod(RemoveFile
)
2345 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
2346 def CanOpen(*args
, **kwargs
):
2347 """CanOpen(self, String location) -> bool"""
2348 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
2350 def OpenFile(*args
, **kwargs
):
2351 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2352 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
2354 def FindFirst(*args
, **kwargs
):
2355 """FindFirst(self, String spec, int flags=0) -> String"""
2356 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
2358 def FindNext(*args
, **kwargs
):
2359 """FindNext(self) -> String"""
2360 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
2362 _core_
.MemoryFSHandler_swigregister(MemoryFSHandler
)
2364 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
2365 """MemoryFSHandler_RemoveFile(String filename)"""
2366 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2368 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
2369 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
2370 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
2371 IMAGE_QUALITY_NORMAL
= _core_
.IMAGE_QUALITY_NORMAL
2372 IMAGE_QUALITY_HIGH
= _core_
.IMAGE_QUALITY_HIGH
2373 #---------------------------------------------------------------------------
2375 class ImageHandler(Object
):
2377 This is the base class for implementing image file loading/saving, and
2378 image creation from data. It is used within `wx.Image` and is not
2379 normally seen by the application.
2381 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2382 def __init__(self
): raise AttributeError, "No constructor defined"
2383 __repr__
= _swig_repr
2384 def GetName(*args
, **kwargs
):
2385 """GetName(self) -> String"""
2386 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
2388 def GetExtension(*args
, **kwargs
):
2389 """GetExtension(self) -> String"""
2390 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
2392 def GetType(*args
, **kwargs
):
2393 """GetType(self) -> long"""
2394 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2396 def GetMimeType(*args
, **kwargs
):
2397 """GetMimeType(self) -> String"""
2398 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2400 def CanRead(*args
, **kwargs
):
2401 """CanRead(self, String name) -> bool"""
2402 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2404 def CanReadStream(*args
, **kwargs
):
2405 """CanReadStream(self, InputStream stream) -> bool"""
2406 return _core_
.ImageHandler_CanReadStream(*args
, **kwargs
)
2408 def SetName(*args
, **kwargs
):
2409 """SetName(self, String name)"""
2410 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2412 def SetExtension(*args
, **kwargs
):
2413 """SetExtension(self, String extension)"""
2414 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2416 def SetType(*args
, **kwargs
):
2417 """SetType(self, long type)"""
2418 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2420 def SetMimeType(*args
, **kwargs
):
2421 """SetMimeType(self, String mimetype)"""
2422 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2424 Extension
= property(GetExtension
,SetExtension
,doc
="See `GetExtension` and `SetExtension`")
2425 MimeType
= property(GetMimeType
,SetMimeType
,doc
="See `GetMimeType` and `SetMimeType`")
2426 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
2427 Type
= property(GetType
,SetType
,doc
="See `GetType` and `SetType`")
2428 _core_
.ImageHandler_swigregister(ImageHandler
)
2430 class PyImageHandler(ImageHandler
):
2432 This is the base class for implementing image file loading/saving, and
2433 image creation from data, all written in Python. To create a custom
2434 image handler derive a new class from wx.PyImageHandler and provide
2435 the following methods::
2437 def DoCanRead(self, stream) --> bool
2438 '''Check if this handler can read the image on the stream'''
2440 def LoadFile(self, image, stream, verbose, index) --> bool
2441 '''Load image data from the stream and load it into image.'''
2443 def SaveFile(self, image, stream, verbose) --> bool
2444 '''Save the iamge data in image to the stream using
2445 this handler's image file format.'''
2447 def GetImageCount(self, stream) --> int
2448 '''If this image format can hold more than one image,
2449 how many does the image on the stream have?'''
2451 To activate your handler create an instance of it and pass it to
2452 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2453 `SetExtension` from your constructor.
2456 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2457 __repr__
= _swig_repr
2458 def __init__(self
, *args
, **kwargs
):
2460 __init__(self) -> PyImageHandler
2462 This is the base class for implementing image file loading/saving, and
2463 image creation from data, all written in Python. To create a custom
2464 image handler derive a new class from wx.PyImageHandler and provide
2465 the following methods::
2467 def DoCanRead(self, stream) --> bool
2468 '''Check if this handler can read the image on the stream'''
2470 def LoadFile(self, image, stream, verbose, index) --> bool
2471 '''Load image data from the stream and load it into image.'''
2473 def SaveFile(self, image, stream, verbose) --> bool
2474 '''Save the iamge data in image to the stream using
2475 this handler's image file format.'''
2477 def GetImageCount(self, stream) --> int
2478 '''If this image format can hold more than one image,
2479 how many does the image on the stream have?'''
2481 To activate your handler create an instance of it and pass it to
2482 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2483 `SetExtension` from your constructor.
2486 _core_
.PyImageHandler_swiginit(self
,_core_
.new_PyImageHandler(*args
, **kwargs
))
2489 def _SetSelf(*args
, **kwargs
):
2490 """_SetSelf(self, PyObject self)"""
2491 return _core_
.PyImageHandler__SetSelf(*args
, **kwargs
)
2493 _core_
.PyImageHandler_swigregister(PyImageHandler
)
2495 class ImageHistogram(object):
2496 """Proxy of C++ ImageHistogram class"""
2497 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2498 __repr__
= _swig_repr
2499 def __init__(self
, *args
, **kwargs
):
2500 """__init__(self) -> ImageHistogram"""
2501 _core_
.ImageHistogram_swiginit(self
,_core_
.new_ImageHistogram(*args
, **kwargs
))
2502 def MakeKey(*args
, **kwargs
):
2504 MakeKey(byte r, byte g, byte b) -> unsigned long
2506 Get the key in the histogram for the given RGB values
2508 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2510 MakeKey
= staticmethod(MakeKey
)
2511 def FindFirstUnusedColour(*args
, **kwargs
):
2513 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2515 Find first colour that is not used in the image and has higher RGB
2516 values than startR, startG, startB. Returns a tuple consisting of a
2517 success flag and rgb values.
2519 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2521 def GetCount(*args
, **kwargs
):
2523 GetCount(self, unsigned long key) -> unsigned long
2525 Returns the pixel count for the given key. Use `MakeKey` to create a
2526 key value from a RGB tripple.
2528 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2530 def GetCountRGB(*args
, **kwargs
):
2532 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2534 Returns the pixel count for the given RGB values.
2536 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2538 def GetCountColour(*args
, **kwargs
):
2540 GetCountColour(self, Colour colour) -> unsigned long
2542 Returns the pixel count for the given `wx.Colour` value.
2544 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2546 _core_
.ImageHistogram_swigregister(ImageHistogram
)
2548 def ImageHistogram_MakeKey(*args
, **kwargs
):
2550 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2552 Get the key in the histogram for the given RGB values
2554 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2556 class Image_RGBValue(object):
2558 An object that contains values for red, green and blue which represent
2559 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2560 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2563 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2564 __repr__
= _swig_repr
2565 def __init__(self
, *args
, **kwargs
):
2567 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2571 _core_
.Image_RGBValue_swiginit(self
,_core_
.new_Image_RGBValue(*args
, **kwargs
))
2572 red
= property(_core_
.Image_RGBValue_red_get
, _core_
.Image_RGBValue_red_set
)
2573 green
= property(_core_
.Image_RGBValue_green_get
, _core_
.Image_RGBValue_green_set
)
2574 blue
= property(_core_
.Image_RGBValue_blue_get
, _core_
.Image_RGBValue_blue_set
)
2575 _core_
.Image_RGBValue_swigregister(Image_RGBValue
)
2577 class Image_HSVValue(object):
2579 An object that contains values for hue, saturation and value which
2580 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2581 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2584 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2585 __repr__
= _swig_repr
2586 def __init__(self
, *args
, **kwargs
):
2588 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2592 _core_
.Image_HSVValue_swiginit(self
,_core_
.new_Image_HSVValue(*args
, **kwargs
))
2593 hue
= property(_core_
.Image_HSVValue_hue_get
, _core_
.Image_HSVValue_hue_set
)
2594 saturation
= property(_core_
.Image_HSVValue_saturation_get
, _core_
.Image_HSVValue_saturation_set
)
2595 value
= property(_core_
.Image_HSVValue_value_get
, _core_
.Image_HSVValue_value_set
)
2596 _core_
.Image_HSVValue_swigregister(Image_HSVValue
)
2598 class Image(Object
):
2600 A platform-independent image class. An image can be created from
2601 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2602 variety of formats. Functions are available to set and get image
2603 bits, so it can be used for basic image manipulation.
2605 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2606 platform-specific `wx.Bitmap` object must be created from it using the
2607 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2608 device context, using `wx.DC.DrawBitmap`.
2610 One colour value of the image may be used as a mask colour which will
2611 lead to the automatic creation of a `wx.Mask` object associated to the
2614 wx.Image supports alpha channel data, that is in addition to a byte
2615 for the red, green and blue colour components for each pixel it also
2616 stores a byte representing the pixel opacity. An alpha value of 0
2617 corresponds to a transparent pixel (null opacity) while a value of 255
2618 means that the pixel is 100% opaque.
2620 Unlike RGB data, not all images have an alpha channel and before using
2621 `GetAlpha` you should check if this image contains an alpha channel
2622 with `HasAlpha`. Note that currently only images loaded from PNG files
2623 with transparency information will have an alpha channel.
2625 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2626 __repr__
= _swig_repr
2627 def __init__(self
, *args
, **kwargs
):
2629 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2631 Loads an image from a file.
2633 _core_
.Image_swiginit(self
,_core_
.new_Image(*args
, **kwargs
))
2634 __swig_destroy__
= _core_
.delete_Image
2635 __del__
= lambda self
: None;
2636 def Create(*args
, **kwargs
):
2638 Create(self, int width, int height, bool clear=True)
2640 Creates a fresh image. If clear is ``True``, the new image will be
2641 initialized to black. Otherwise, the image data will be uninitialized.
2643 return _core_
.Image_Create(*args
, **kwargs
)
2645 def Destroy(*args
, **kwargs
):
2649 Destroys the image data.
2651 args
[0].this
.own(False)
2652 return _core_
.Image_Destroy(*args
, **kwargs
)
2654 def Scale(*args
, **kwargs
):
2656 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2658 Returns a scaled version of the image. This is also useful for scaling
2659 bitmaps in general as the only other way to scale bitmaps is to blit a
2660 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2661 specifies what method to use for resampling the image. It can be
2662 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2663 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2664 bicubic and box averaging resampling methods for upsampling and
2665 downsampling respectively.
2667 return _core_
.Image_Scale(*args
, **kwargs
)
2669 def ResampleBox(*args
, **kwargs
):
2670 """ResampleBox(self, int width, int height) -> Image"""
2671 return _core_
.Image_ResampleBox(*args
, **kwargs
)
2673 def ResampleBicubic(*args
, **kwargs
):
2674 """ResampleBicubic(self, int width, int height) -> Image"""
2675 return _core_
.Image_ResampleBicubic(*args
, **kwargs
)
2677 def Blur(*args
, **kwargs
):
2679 Blur(self, int radius) -> Image
2681 Blurs the image in both horizontal and vertical directions by the
2682 specified pixel ``radius``. This should not be used when using a
2683 single mask colour for transparency.
2685 return _core_
.Image_Blur(*args
, **kwargs
)
2687 def BlurHorizontal(*args
, **kwargs
):
2689 BlurHorizontal(self, int radius) -> Image
2691 Blurs the image in the horizontal direction only. This should not be
2692 used when using a single mask colour for transparency.
2695 return _core_
.Image_BlurHorizontal(*args
, **kwargs
)
2697 def BlurVertical(*args
, **kwargs
):
2699 BlurVertical(self, int radius) -> Image
2701 Blurs the image in the vertical direction only. This should not be
2702 used when using a single mask colour for transparency.
2704 return _core_
.Image_BlurVertical(*args
, **kwargs
)
2706 def ShrinkBy(*args
, **kwargs
):
2708 ShrinkBy(self, int xFactor, int yFactor) -> Image
2710 Return a version of the image scaled smaller by the given factors.
2712 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2714 def Rescale(*args
, **kwargs
):
2716 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
2718 Changes the size of the image in-place by scaling it: after a call to
2719 this function, the image will have the given width and height.
2721 Returns the (modified) image itself.
2723 return _core_
.Image_Rescale(*args
, **kwargs
)
2725 def Resize(*args
, **kwargs
):
2727 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2729 Changes the size of the image in-place without scaling it, by adding
2730 either a border with the given colour or cropping as necessary. The
2731 image is pasted into a new image with the given size and background
2732 colour at the position pos relative to the upper left of the new
2733 image. If red = green = blue = -1 then use either the current mask
2734 colour if set or find, use, and set a suitable mask colour for any
2735 newly exposed areas.
2737 Returns the (modified) image itself.
2739 return _core_
.Image_Resize(*args
, **kwargs
)
2741 def SetRGB(*args
, **kwargs
):
2743 SetRGB(self, int x, int y, byte r, byte g, byte b)
2745 Sets the pixel at the given coordinate. This routine performs
2746 bounds-checks for the coordinate so it can be considered a safe way to
2747 manipulate the data, but in some cases this might be too slow so that
2748 the data will have to be set directly. In that case you will have to
2749 get access to the image data using the `GetData` method.
2751 return _core_
.Image_SetRGB(*args
, **kwargs
)
2753 def SetRGBRect(*args
, **kwargs
):
2755 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2757 Sets the colour of the pixels within the given rectangle. This routine
2758 performs bounds-checks for the rectangle so it can be considered a
2759 safe way to manipulate the data.
2761 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2763 def GetRed(*args
, **kwargs
):
2765 GetRed(self, int x, int y) -> byte
2767 Returns the red intensity at the given coordinate.
2769 return _core_
.Image_GetRed(*args
, **kwargs
)
2771 def GetGreen(*args
, **kwargs
):
2773 GetGreen(self, int x, int y) -> byte
2775 Returns the green intensity at the given coordinate.
2777 return _core_
.Image_GetGreen(*args
, **kwargs
)
2779 def GetBlue(*args
, **kwargs
):
2781 GetBlue(self, int x, int y) -> byte
2783 Returns the blue intensity at the given coordinate.
2785 return _core_
.Image_GetBlue(*args
, **kwargs
)
2787 def SetAlpha(*args
, **kwargs
):
2789 SetAlpha(self, int x, int y, byte alpha)
2791 Sets the alpha value for the given pixel. This function should only be
2792 called if the image has alpha channel data, use `HasAlpha` to check
2795 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2797 def GetAlpha(*args
, **kwargs
):
2799 GetAlpha(self, int x, int y) -> byte
2801 Returns the alpha value for the given pixel. This function may only be
2802 called for the images with alpha channel, use `HasAlpha` to check for
2805 The returned value is the *opacity* of the image, i.e. the value of 0
2806 corresponds to the fully transparent pixels while the value of 255 to
2807 the fully opaque pixels.
2809 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2811 def HasAlpha(*args
, **kwargs
):
2813 HasAlpha(self) -> bool
2815 Returns true if this image has alpha channel, false otherwise.
2817 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2819 def InitAlpha(*args
, **kwargs
):
2823 Initializes the image alpha channel data. It is an error to call it if
2824 the image already has alpha data. If it doesn't, alpha data will be by
2825 default initialized to all pixels being fully opaque. But if the image
2826 has a a mask colour, all mask pixels will be completely transparent.
2828 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2830 def IsTransparent(*args
, **kwargs
):
2832 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2834 Returns ``True`` if this pixel is masked or has an alpha value less
2835 than the spcified threshold.
2837 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2839 def FindFirstUnusedColour(*args
, **kwargs
):
2841 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2843 Find first colour that is not used in the image and has higher RGB
2844 values than startR, startG, startB. Returns a tuple consisting of a
2845 success flag and rgb values.
2847 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2849 def ConvertAlphaToMask(*args
, **kwargs
):
2851 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2853 If the image has alpha channel, this method converts it to mask. All
2854 pixels with alpha value less than ``threshold`` are replaced with the
2855 mask colour and the alpha channel is removed. The mask colour is
2856 chosen automatically using `FindFirstUnusedColour`.
2858 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2861 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2863 def ConvertColourToAlpha(*args
, **kwargs
):
2865 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2867 This method converts an image where the original alpha information is
2868 only available as a shades of a colour (actually shades of grey)
2869 typically when you draw anti-aliased text into a bitmap. The DC
2870 drawing routines draw grey values on the black background although
2871 they actually mean to draw white with differnt alpha values. This
2872 method reverses it, assuming a black (!) background and white text.
2873 The method will then fill up the whole image with the colour given.
2875 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2877 def SetMaskFromImage(*args
, **kwargs
):
2879 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2881 Sets the image's mask so that the pixels that have RGB value of
2882 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2883 by first finding an unused colour in the image, setting this colour as
2884 the mask colour and then using this colour to draw all pixels in the
2885 image who corresponding pixel in mask has given RGB value.
2887 Returns ``False`` if ``mask`` does not have same dimensions as the
2888 image or if there is no unused colour left. Returns ``True`` if the
2889 mask was successfully applied.
2891 Note that this method involves computing the histogram, which is
2892 computationally intensive operation.
2894 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2896 def CanRead(*args
, **kwargs
):
2898 CanRead(String filename) -> bool
2900 Returns True if the image handlers can read this file.
2902 return _core_
.Image_CanRead(*args
, **kwargs
)
2904 CanRead
= staticmethod(CanRead
)
2905 def GetImageCount(*args
, **kwargs
):
2907 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2909 If the image file contains more than one image and the image handler
2910 is capable of retrieving these individually, this function will return
2911 the number of available images.
2913 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2915 GetImageCount
= staticmethod(GetImageCount
)
2916 def LoadFile(*args
, **kwargs
):
2918 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2920 Loads an image from a file. If no handler type is provided, the
2921 library will try to autodetect the format.
2923 return _core_
.Image_LoadFile(*args
, **kwargs
)
2925 def LoadMimeFile(*args
, **kwargs
):
2927 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2929 Loads an image from a file, specifying the image type with a MIME type
2932 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2934 def SaveFile(*args
, **kwargs
):
2936 SaveFile(self, String name, int type) -> bool
2938 Saves an image in the named file.
2940 return _core_
.Image_SaveFile(*args
, **kwargs
)
2942 def SaveMimeFile(*args
, **kwargs
):
2944 SaveMimeFile(self, String name, String mimetype) -> bool
2946 Saves an image in the named file.
2948 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2950 def CanReadStream(*args
, **kwargs
):
2952 CanReadStream(InputStream stream) -> bool
2954 Returns True if the image handlers can read an image file from the
2955 data currently on the input stream, or a readable Python file-like
2958 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2960 CanReadStream
= staticmethod(CanReadStream
)
2961 def LoadStream(*args
, **kwargs
):
2963 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2965 Loads an image from an input stream or a readable Python file-like
2966 object. If no handler type is provided, the library will try to
2967 autodetect the format.
2969 return _core_
.Image_LoadStream(*args
, **kwargs
)
2971 def LoadMimeStream(*args
, **kwargs
):
2973 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2975 Loads an image from an input stream or a readable Python file-like
2976 object, using a MIME type string to specify the image file format.
2978 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2980 def IsOk(*args
, **kwargs
):
2984 Returns true if image data is present.
2986 return _core_
.Image_IsOk(*args
, **kwargs
)
2989 def GetWidth(*args
, **kwargs
):
2991 GetWidth(self) -> int
2993 Gets the width of the image in pixels.
2995 return _core_
.Image_GetWidth(*args
, **kwargs
)
2997 def GetHeight(*args
, **kwargs
):
2999 GetHeight(self) -> int
3001 Gets the height of the image in pixels.
3003 return _core_
.Image_GetHeight(*args
, **kwargs
)
3005 def GetSize(*args
, **kwargs
):
3007 GetSize(self) -> Size
3009 Returns the size of the image in pixels.
3011 return _core_
.Image_GetSize(*args
, **kwargs
)
3013 def GetSubImage(*args
, **kwargs
):
3015 GetSubImage(self, Rect rect) -> Image
3017 Returns a sub image of the current one as long as the rect belongs
3018 entirely to the image.
3020 return _core_
.Image_GetSubImage(*args
, **kwargs
)
3022 def Size(*args
, **kwargs
):
3024 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
3026 Returns a resized version of this image without scaling it by adding
3027 either a border with the given colour or cropping as necessary. The
3028 image is pasted into a new image with the given size and background
3029 colour at the position ``pos`` relative to the upper left of the new
3030 image. If red = green = blue = -1 then use either the current mask
3031 colour if set or find, use, and set a suitable mask colour for any
3032 newly exposed areas.
3034 return _core_
.Image_Size(*args
, **kwargs
)
3036 def Copy(*args
, **kwargs
):
3040 Returns an identical copy of the image.
3042 return _core_
.Image_Copy(*args
, **kwargs
)
3044 def Paste(*args
, **kwargs
):
3046 Paste(self, Image image, int x, int y)
3048 Pastes ``image`` into this instance and takes care of the mask colour
3049 and any out of bounds problems.
3051 return _core_
.Image_Paste(*args
, **kwargs
)
3053 def GetData(*args
, **kwargs
):
3055 GetData(self) -> PyObject
3057 Returns a string containing a copy of the RGB bytes of the image.
3059 return _core_
.Image_GetData(*args
, **kwargs
)
3061 def SetData(*args
, **kwargs
):
3063 SetData(self, buffer data)
3065 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
3066 either a string or a buffer object holding the data and the length of
3067 the data must be width*height*3.
3069 return _core_
.Image_SetData(*args
, **kwargs
)
3071 def GetDataBuffer(*args
, **kwargs
):
3073 GetDataBuffer(self) -> PyObject
3075 Returns a writable Python buffer object that is pointing at the RGB
3076 image data buffer inside the wx.Image. You need to ensure that you do
3077 not use this buffer object after the image has been destroyed.
3079 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
3081 def SetDataBuffer(*args
, **kwargs
):
3083 SetDataBuffer(self, buffer data)
3085 Sets the internal image data pointer to point at a Python buffer
3086 object. This can save making an extra copy of the data but you must
3087 ensure that the buffer object lives longer than the wx.Image does.
3089 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
3091 def GetAlphaData(*args
, **kwargs
):
3093 GetAlphaData(self) -> PyObject
3095 Returns a string containing a copy of the alpha bytes of the image.
3097 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
3099 def SetAlphaData(*args
, **kwargs
):
3101 SetAlphaData(self, buffer alpha)
3103 Resets the Image's alpha data from a buffer of bytes. Accepts either
3104 a string or a buffer object holding the data and the length of the
3105 data must be width*height.
3107 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
3109 def GetAlphaBuffer(*args
, **kwargs
):
3111 GetAlphaBuffer(self) -> PyObject
3113 Returns a writable Python buffer object that is pointing at the Alpha
3114 data buffer inside the wx.Image. You need to ensure that you do not
3115 use this buffer object after the image has been destroyed.
3117 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
3119 def SetAlphaBuffer(*args
, **kwargs
):
3121 SetAlphaBuffer(self, buffer alpha)
3123 Sets the internal image alpha pointer to point at a Python buffer
3124 object. This can save making an extra copy of the data but you must
3125 ensure that the buffer object lives as long as the wx.Image does.
3127 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
3129 def SetMaskColour(*args
, **kwargs
):
3131 SetMaskColour(self, byte r, byte g, byte b)
3133 Sets the mask colour for this image (and tells the image to use the
3136 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
3138 def GetOrFindMaskColour(*args
, **kwargs
):
3140 GetOrFindMaskColour() -> (r,g,b)
3142 Get the current mask colour or find a suitable colour.
3144 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
3146 def GetMaskRed(*args
, **kwargs
):
3148 GetMaskRed(self) -> byte
3150 Gets the red component of the mask colour.
3152 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
3154 def GetMaskGreen(*args
, **kwargs
):
3156 GetMaskGreen(self) -> byte
3158 Gets the green component of the mask colour.
3160 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
3162 def GetMaskBlue(*args
, **kwargs
):
3164 GetMaskBlue(self) -> byte
3166 Gets the blue component of the mask colour.
3168 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
3170 def SetMask(*args
, **kwargs
):
3172 SetMask(self, bool mask=True)
3174 Specifies whether there is a mask or not. The area of the mask is
3175 determined by the current mask colour.
3177 return _core_
.Image_SetMask(*args
, **kwargs
)
3179 def HasMask(*args
, **kwargs
):
3181 HasMask(self) -> bool
3183 Returns ``True`` if there is a mask active, ``False`` otherwise.
3185 return _core_
.Image_HasMask(*args
, **kwargs
)
3187 def Rotate(*args
, **kwargs
):
3189 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
3190 Point offset_after_rotation=None) -> Image
3192 Rotates the image about the given point, by ``angle`` radians. Passing
3193 ``True`` to ``interpolating`` results in better image quality, but is
3194 slower. If the image has a mask, then the mask colour is used for the
3195 uncovered pixels in the rotated image background. Otherwise, black
3196 will be used as the fill colour.
3198 Returns the rotated image, leaving this image intact.
3200 return _core_
.Image_Rotate(*args
, **kwargs
)
3202 def Rotate90(*args
, **kwargs
):
3204 Rotate90(self, bool clockwise=True) -> Image
3206 Returns a copy of the image rotated 90 degrees in the direction
3207 indicated by ``clockwise``.
3209 return _core_
.Image_Rotate90(*args
, **kwargs
)
3211 def Mirror(*args
, **kwargs
):
3213 Mirror(self, bool horizontally=True) -> Image
3215 Returns a mirrored copy of the image. The parameter ``horizontally``
3216 indicates the orientation.
3218 return _core_
.Image_Mirror(*args
, **kwargs
)
3220 def Replace(*args
, **kwargs
):
3222 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3224 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3227 return _core_
.Image_Replace(*args
, **kwargs
)
3229 def ConvertToGreyscale(*args
, **kwargs
):
3231 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3233 Convert to greyscale image. Uses the luminance component (Y) of the
3234 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3235 defaults to ITU-T BT.601
3237 return _core_
.Image_ConvertToGreyscale(*args
, **kwargs
)
3239 def ConvertToMono(*args
, **kwargs
):
3241 ConvertToMono(self, byte r, byte g, byte b) -> Image
3243 Returns monochromatic version of the image. The returned image has
3244 white colour where the original has ``(r,g,b)`` colour and black
3245 colour everywhere else.
3247 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
3249 def SetOption(*args
, **kwargs
):
3251 SetOption(self, String name, String value)
3253 Sets an image handler defined option. For example, when saving as a
3254 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3255 number between 0 and 100 (0 is terrible, 100 is very good).
3257 return _core_
.Image_SetOption(*args
, **kwargs
)
3259 def SetOptionInt(*args
, **kwargs
):
3261 SetOptionInt(self, String name, int value)
3263 Sets an image option as an integer.
3265 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
3267 def GetOption(*args
, **kwargs
):
3269 GetOption(self, String name) -> String
3271 Gets the value of an image handler option.
3273 return _core_
.Image_GetOption(*args
, **kwargs
)
3275 def GetOptionInt(*args
, **kwargs
):
3277 GetOptionInt(self, String name) -> int
3279 Gets the value of an image handler option as an integer. If the given
3280 option is not present, the function returns 0.
3282 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
3284 def HasOption(*args
, **kwargs
):
3286 HasOption(self, String name) -> bool
3288 Returns true if the given option is present.
3290 return _core_
.Image_HasOption(*args
, **kwargs
)
3292 def CountColours(*args
, **kwargs
):
3293 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
3294 return _core_
.Image_CountColours(*args
, **kwargs
)
3296 def ComputeHistogram(*args
, **kwargs
):
3297 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3298 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
3300 def AddHandler(*args
, **kwargs
):
3301 """AddHandler(ImageHandler handler)"""
3302 return _core_
.Image_AddHandler(*args
, **kwargs
)
3304 AddHandler
= staticmethod(AddHandler
)
3305 def InsertHandler(*args
, **kwargs
):
3306 """InsertHandler(ImageHandler handler)"""
3307 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3309 InsertHandler
= staticmethod(InsertHandler
)
3310 def RemoveHandler(*args
, **kwargs
):
3311 """RemoveHandler(String name) -> bool"""
3312 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3314 RemoveHandler
= staticmethod(RemoveHandler
)
3315 def GetHandlers(*args
, **kwargs
):
3316 """GetHandlers() -> PyObject"""
3317 return _core_
.Image_GetHandlers(*args
, **kwargs
)
3319 GetHandlers
= staticmethod(GetHandlers
)
3320 def GetImageExtWildcard(*args
, **kwargs
):
3322 GetImageExtWildcard() -> String
3324 Iterates all registered wxImageHandler objects, and returns a string
3325 containing file extension masks suitable for passing to file open/save
3328 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
3330 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
3331 def ConvertToBitmap(*args
, **kwargs
):
3332 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3333 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
3335 def ConvertToMonoBitmap(*args
, **kwargs
):
3336 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
3337 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
3339 def RotateHue(*args
, **kwargs
):
3341 RotateHue(self, double angle)
3343 Rotates the hue of each pixel of the image. Hue is a double in the
3344 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3346 return _core_
.Image_RotateHue(*args
, **kwargs
)
3348 def RGBtoHSV(*args
, **kwargs
):
3350 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3352 Converts a color in RGB color space to HSV color space.
3354 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3356 RGBtoHSV
= staticmethod(RGBtoHSV
)
3357 def HSVtoRGB(*args
, **kwargs
):
3359 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3361 Converts a color in HSV color space to RGB color space.
3363 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3365 HSVtoRGB
= staticmethod(HSVtoRGB
)
3366 def __nonzero__(self
): return self
.IsOk()
3367 AlphaBuffer
= property(GetAlphaBuffer
,SetAlphaBuffer
,doc
="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3368 AlphaData
= property(GetAlphaData
,SetAlphaData
,doc
="See `GetAlphaData` and `SetAlphaData`")
3369 Data
= property(GetData
,SetData
,doc
="See `GetData` and `SetData`")
3370 DataBuffer
= property(GetDataBuffer
,SetDataBuffer
,doc
="See `GetDataBuffer` and `SetDataBuffer`")
3371 Height
= property(GetHeight
,doc
="See `GetHeight`")
3372 MaskBlue
= property(GetMaskBlue
,doc
="See `GetMaskBlue`")
3373 MaskGreen
= property(GetMaskGreen
,doc
="See `GetMaskGreen`")
3374 MaskRed
= property(GetMaskRed
,doc
="See `GetMaskRed`")
3375 Width
= property(GetWidth
,doc
="See `GetWidth`")
3376 _core_
.Image_swigregister(Image
)
3378 def ImageFromMime(*args
, **kwargs
):
3380 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3382 Loads an image from a file, using a MIME type string (such as
3383 'image/jpeg') to specify image type.
3385 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
3388 def ImageFromStream(*args
, **kwargs
):
3390 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3392 Loads an image from an input stream, or any readable Python file-like
3395 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
3398 def ImageFromStreamMime(*args
, **kwargs
):
3400 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3402 Loads an image from an input stream, or any readable Python file-like
3403 object, specifying the image format with a MIME type string.
3405 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
3408 def EmptyImage(*args
, **kwargs
):
3410 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3412 Construct an empty image of a given size, optionally setting all
3415 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
3418 def ImageFromBitmap(*args
, **kwargs
):
3420 ImageFromBitmap(Bitmap bitmap) -> Image
3422 Construct an Image from a `wx.Bitmap`.
3424 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
3427 def ImageFromData(*args
, **kwargs
):
3429 ImageFromData(int width, int height, buffer data) -> Image
3431 Construct an Image from a buffer of RGB bytes. Accepts either a
3432 string or a buffer object holding the data and the length of the data
3433 must be width*height*3.
3435 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
3438 def ImageFromDataWithAlpha(*args
, **kwargs
):
3440 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3442 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3443 Accepts either a string or a buffer object holding the data and the
3444 length of the data must be width*height*3 bytes, and the length of the
3445 alpha data must be width*height bytes.
3447 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
3450 def Image_CanRead(*args
, **kwargs
):
3452 Image_CanRead(String filename) -> bool
3454 Returns True if the image handlers can read this file.
3456 return _core_
.Image_CanRead(*args
, **kwargs
)
3458 def Image_GetImageCount(*args
, **kwargs
):
3460 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3462 If the image file contains more than one image and the image handler
3463 is capable of retrieving these individually, this function will return
3464 the number of available images.
3466 return _core_
.Image_GetImageCount(*args
, **kwargs
)
3468 def Image_CanReadStream(*args
, **kwargs
):
3470 Image_CanReadStream(InputStream stream) -> bool
3472 Returns True if the image handlers can read an image file from the
3473 data currently on the input stream, or a readable Python file-like
3476 return _core_
.Image_CanReadStream(*args
, **kwargs
)
3478 def Image_AddHandler(*args
, **kwargs
):
3479 """Image_AddHandler(ImageHandler handler)"""
3480 return _core_
.Image_AddHandler(*args
, **kwargs
)
3482 def Image_InsertHandler(*args
, **kwargs
):
3483 """Image_InsertHandler(ImageHandler handler)"""
3484 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3486 def Image_RemoveHandler(*args
, **kwargs
):
3487 """Image_RemoveHandler(String name) -> bool"""
3488 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3490 def Image_GetHandlers(*args
):
3491 """Image_GetHandlers() -> PyObject"""
3492 return _core_
.Image_GetHandlers(*args
)
3494 def Image_GetImageExtWildcard(*args
):
3496 Image_GetImageExtWildcard() -> String
3498 Iterates all registered wxImageHandler objects, and returns a string
3499 containing file extension masks suitable for passing to file open/save
3502 return _core_
.Image_GetImageExtWildcard(*args
)
3504 def Image_RGBtoHSV(*args
, **kwargs
):
3506 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3508 Converts a color in RGB color space to HSV color space.
3510 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3512 def Image_HSVtoRGB(*args
, **kwargs
):
3514 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3516 Converts a color in HSV color space to RGB color space.
3518 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3521 def _ImageFromBuffer(*args
, **kwargs
):
3522 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3523 return _core_
._ImageFromBuffer
(*args
, **kwargs
)
3524 def ImageFromBuffer(width
, height
, dataBuffer
, alphaBuffer
=None):
3526 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
3527 parameter must be a Python object that implements the buffer interface,
3528 such as a string, array, etc. The dataBuffer object is expected to
3529 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3530 object can optionally be supplied for the image's alpha channel data, and
3531 it is expected to be width*height bytes long.
3533 The wx.Image will be created with its data and alpha pointers initialized
3534 to the memory address pointed to by the buffer objects, thus saving the
3535 time needed to copy the image data from the buffer object to the wx.Image.
3536 While this has advantages, it also has the shoot-yourself-in-the-foot
3537 risks associated with sharing a C pointer between two objects.
3539 To help alleviate the risk a reference to the data and alpha buffer
3540 objects are kept with the wx.Image, so that they won't get deleted until
3541 after the wx.Image is deleted. However please be aware that it is not
3542 guaranteed that an object won't move its memory buffer to a new location
3543 when it needs to resize its contents. If that happens then the wx.Image
3544 will end up referring to an invalid memory location and could cause the
3545 application to crash. Therefore care should be taken to not manipulate
3546 the objects used for the data and alpha buffers in a way that would cause
3547 them to change size.
3549 image
= _core_
._ImageFromBuffer
(width
, height
, dataBuffer
, alphaBuffer
)
3550 image
._buffer
= dataBuffer
3551 image
._alpha
= alphaBuffer
3554 def InitAllImageHandlers():
3556 The former functionality of InitAllImageHanders is now done internal to
3557 the _core_ extension module and so this function has become a simple NOP.
3561 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3562 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3563 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3564 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3565 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3566 BMP_24BPP
= _core_
.BMP_24BPP
3567 BMP_8BPP
= _core_
.BMP_8BPP
3568 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3569 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3570 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3571 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3572 BMP_4BPP
= _core_
.BMP_4BPP
3573 BMP_1BPP
= _core_
.BMP_1BPP
3574 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3575 class BMPHandler(ImageHandler
):
3576 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3577 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3578 __repr__
= _swig_repr
3579 def __init__(self
, *args
, **kwargs
):
3581 __init__(self) -> BMPHandler
3583 A `wx.ImageHandler` for \*.bmp bitmap files.
3585 _core_
.BMPHandler_swiginit(self
,_core_
.new_BMPHandler(*args
, **kwargs
))
3586 _core_
.BMPHandler_swigregister(BMPHandler
)
3587 NullImage
= cvar
.NullImage
3588 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3589 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3590 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3591 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3592 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3593 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3594 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3595 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3596 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3597 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3598 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3599 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3600 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3601 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3602 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3604 class ICOHandler(BMPHandler
):
3605 """A `wx.ImageHandler` for \*.ico icon files."""
3606 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3607 __repr__
= _swig_repr
3608 def __init__(self
, *args
, **kwargs
):
3610 __init__(self) -> ICOHandler
3612 A `wx.ImageHandler` for \*.ico icon files.
3614 _core_
.ICOHandler_swiginit(self
,_core_
.new_ICOHandler(*args
, **kwargs
))
3615 _core_
.ICOHandler_swigregister(ICOHandler
)
3617 class CURHandler(ICOHandler
):
3618 """A `wx.ImageHandler` for \*.cur cursor files."""
3619 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3620 __repr__
= _swig_repr
3621 def __init__(self
, *args
, **kwargs
):
3623 __init__(self) -> CURHandler
3625 A `wx.ImageHandler` for \*.cur cursor files.
3627 _core_
.CURHandler_swiginit(self
,_core_
.new_CURHandler(*args
, **kwargs
))
3628 _core_
.CURHandler_swigregister(CURHandler
)
3630 class ANIHandler(CURHandler
):
3631 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3632 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3633 __repr__
= _swig_repr
3634 def __init__(self
, *args
, **kwargs
):
3636 __init__(self) -> ANIHandler
3638 A `wx.ImageHandler` for \*.ani animated cursor files.
3640 _core_
.ANIHandler_swiginit(self
,_core_
.new_ANIHandler(*args
, **kwargs
))
3641 _core_
.ANIHandler_swigregister(ANIHandler
)
3643 class PNGHandler(ImageHandler
):
3644 """A `wx.ImageHandler` for PNG image files."""
3645 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3646 __repr__
= _swig_repr
3647 def __init__(self
, *args
, **kwargs
):
3649 __init__(self) -> PNGHandler
3651 A `wx.ImageHandler` for PNG image files.
3653 _core_
.PNGHandler_swiginit(self
,_core_
.new_PNGHandler(*args
, **kwargs
))
3654 _core_
.PNGHandler_swigregister(PNGHandler
)
3656 class GIFHandler(ImageHandler
):
3657 """A `wx.ImageHandler` for GIF image files."""
3658 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3659 __repr__
= _swig_repr
3660 def __init__(self
, *args
, **kwargs
):
3662 __init__(self) -> GIFHandler
3664 A `wx.ImageHandler` for GIF image files.
3666 _core_
.GIFHandler_swiginit(self
,_core_
.new_GIFHandler(*args
, **kwargs
))
3667 _core_
.GIFHandler_swigregister(GIFHandler
)
3669 class PCXHandler(ImageHandler
):
3670 """A `wx.ImageHandler` for PCX imager files."""
3671 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3672 __repr__
= _swig_repr
3673 def __init__(self
, *args
, **kwargs
):
3675 __init__(self) -> PCXHandler
3677 A `wx.ImageHandler` for PCX imager files.
3679 _core_
.PCXHandler_swiginit(self
,_core_
.new_PCXHandler(*args
, **kwargs
))
3680 _core_
.PCXHandler_swigregister(PCXHandler
)
3682 class JPEGHandler(ImageHandler
):
3683 """A `wx.ImageHandler` for JPEG/JPG image files."""
3684 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3685 __repr__
= _swig_repr
3686 def __init__(self
, *args
, **kwargs
):
3688 __init__(self) -> JPEGHandler
3690 A `wx.ImageHandler` for JPEG/JPG image files.
3692 _core_
.JPEGHandler_swiginit(self
,_core_
.new_JPEGHandler(*args
, **kwargs
))
3693 _core_
.JPEGHandler_swigregister(JPEGHandler
)
3695 class PNMHandler(ImageHandler
):
3696 """A `wx.ImageHandler` for PNM image files."""
3697 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3698 __repr__
= _swig_repr
3699 def __init__(self
, *args
, **kwargs
):
3701 __init__(self) -> PNMHandler
3703 A `wx.ImageHandler` for PNM image files.
3705 _core_
.PNMHandler_swiginit(self
,_core_
.new_PNMHandler(*args
, **kwargs
))
3706 _core_
.PNMHandler_swigregister(PNMHandler
)
3708 class XPMHandler(ImageHandler
):
3709 """A `wx.ImageHandler` for XPM image."""
3710 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3711 __repr__
= _swig_repr
3712 def __init__(self
, *args
, **kwargs
):
3714 __init__(self) -> XPMHandler
3716 A `wx.ImageHandler` for XPM image.
3718 _core_
.XPMHandler_swiginit(self
,_core_
.new_XPMHandler(*args
, **kwargs
))
3719 _core_
.XPMHandler_swigregister(XPMHandler
)
3721 class TIFFHandler(ImageHandler
):
3722 """A `wx.ImageHandler` for TIFF image files."""
3723 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3724 __repr__
= _swig_repr
3725 def __init__(self
, *args
, **kwargs
):
3727 __init__(self) -> TIFFHandler
3729 A `wx.ImageHandler` for TIFF image files.
3731 _core_
.TIFFHandler_swiginit(self
,_core_
.new_TIFFHandler(*args
, **kwargs
))
3732 _core_
.TIFFHandler_swigregister(TIFFHandler
)
3734 class TGAHandler(ImageHandler
):
3735 """A `wx.ImageHandler` for TGA image files."""
3736 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3737 __repr__
= _swig_repr
3738 def __init__(self
, *args
, **kwargs
):
3740 __init__(self) -> TGAHandler
3742 A `wx.ImageHandler` for TGA image files.
3744 _core_
.TGAHandler_swiginit(self
,_core_
.new_TGAHandler(*args
, **kwargs
))
3745 _core_
.TGAHandler_swigregister(TGAHandler
)
3747 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3748 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3749 class Quantize(object):
3750 """Performs quantization, or colour reduction, on a wxImage."""
3751 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3752 def __init__(self
): raise AttributeError, "No constructor defined"
3753 __repr__
= _swig_repr
3754 def Quantize(*args
, **kwargs
):
3756 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3758 Reduce the colours in the source image and put the result into the
3759 destination image, setting the palette in the destination if
3760 needed. Both images may be the same, to overwrite the source image.
3762 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3764 Quantize
= staticmethod(Quantize
)
3765 _core_
.Quantize_swigregister(Quantize
)
3767 def Quantize_Quantize(*args
, **kwargs
):
3769 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3771 Reduce the colours in the source image and put the result into the
3772 destination image, setting the palette in the destination if
3773 needed. Both images may be the same, to overwrite the source image.
3775 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3777 #---------------------------------------------------------------------------
3779 class EvtHandler(Object
):
3780 """Proxy of C++ EvtHandler class"""
3781 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3782 __repr__
= _swig_repr
3783 def __init__(self
, *args
, **kwargs
):
3784 """__init__(self) -> EvtHandler"""
3785 _core_
.EvtHandler_swiginit(self
,_core_
.new_EvtHandler(*args
, **kwargs
))
3786 self
._setOORInfo
(self
)
3788 def GetNextHandler(*args
, **kwargs
):
3789 """GetNextHandler(self) -> EvtHandler"""
3790 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3792 def GetPreviousHandler(*args
, **kwargs
):
3793 """GetPreviousHandler(self) -> EvtHandler"""
3794 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3796 def SetNextHandler(*args
, **kwargs
):
3797 """SetNextHandler(self, EvtHandler handler)"""
3798 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3800 def SetPreviousHandler(*args
, **kwargs
):
3801 """SetPreviousHandler(self, EvtHandler handler)"""
3802 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3804 def GetEvtHandlerEnabled(*args
, **kwargs
):
3805 """GetEvtHandlerEnabled(self) -> bool"""
3806 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3808 def SetEvtHandlerEnabled(*args
, **kwargs
):
3809 """SetEvtHandlerEnabled(self, bool enabled)"""
3810 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3812 def ProcessEvent(*args
, **kwargs
):
3813 """ProcessEvent(self, Event event) -> bool"""
3814 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3816 def AddPendingEvent(*args
, **kwargs
):
3817 """AddPendingEvent(self, Event event)"""
3818 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3820 def ProcessPendingEvents(*args
, **kwargs
):
3821 """ProcessPendingEvents(self)"""
3822 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3824 def Connect(*args
, **kwargs
):
3825 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3826 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3828 def Disconnect(*args
, **kwargs
):
3829 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3830 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3832 def _setOORInfo(*args
, **kwargs
):
3833 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3834 val
= _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3835 args
[0].this
.own(False)
3838 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3840 Bind an event to an event handler.
3842 :param event: One of the EVT_* objects that specifies the
3843 type of event to bind,
3845 :param handler: A callable object to be invoked when the
3846 event is delivered to self. Pass None to
3847 disconnect an event handler.
3849 :param source: Sometimes the event originates from a
3850 different window than self, but you still
3851 want to catch it in self. (For example, a
3852 button event delivered to a frame.) By
3853 passing the source of the event, the event
3854 handling system is able to differentiate
3855 between the same event type from different
3858 :param id: Used to spcify the event source by ID instead
3861 :param id2: Used when it is desirable to bind a handler
3862 to a range of IDs, such as with EVT_MENU_RANGE.
3864 if source
is not None:
3866 event
.Bind(self
, id, id2
, handler
)
3868 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3870 Disconencts the event handler binding for event from self.
3871 Returns True if successful.
3873 if source
is not None:
3875 return event
.Unbind(self
, id, id2
)
3877 EvtHandlerEnabled
= property(GetEvtHandlerEnabled
,SetEvtHandlerEnabled
,doc
="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3878 NextHandler
= property(GetNextHandler
,SetNextHandler
,doc
="See `GetNextHandler` and `SetNextHandler`")
3879 PreviousHandler
= property(GetPreviousHandler
,SetPreviousHandler
,doc
="See `GetPreviousHandler` and `SetPreviousHandler`")
3880 _core_
.EvtHandler_swigregister(EvtHandler
)
3882 #---------------------------------------------------------------------------
3884 class PyEventBinder(object):
3886 Instances of this class are used to bind specific events to event
3889 def __init__(self
, evtType
, expectedIDs
=0):
3890 if expectedIDs
not in [0, 1, 2]:
3891 raise ValueError, "Invalid number of expectedIDs"
3892 self
.expectedIDs
= expectedIDs
3894 if type(evtType
) == list or type(evtType
) == tuple:
3895 self
.evtType
= evtType
3897 self
.evtType
= [evtType
]
3900 def Bind(self
, target
, id1
, id2
, function
):
3901 """Bind this set of event types to target."""
3902 for et
in self
.evtType
:
3903 target
.Connect(id1
, id2
, et
, function
)
3906 def Unbind(self
, target
, id1
, id2
):
3907 """Remove an event binding."""
3909 for et
in self
.evtType
:
3910 success
+= target
.Disconnect(id1
, id2
, et
)
3913 def _getEvtType(self
):
3915 Make it easy to get to the default wxEventType typeID for this
3918 return self
.evtType
[0]
3920 typeId
= property(_getEvtType
)
3923 def __call__(self
, *args
):
3925 For backwards compatibility with the old EVT_* functions.
3926 Should be called with either (window, func), (window, ID,
3927 func) or (window, ID1, ID2, func) parameters depending on the
3930 assert len(args
) == 2 + self
.expectedIDs
3934 if self
.expectedIDs
== 0:
3936 elif self
.expectedIDs
== 1:
3939 elif self
.expectedIDs
== 2:
3944 raise ValueError, "Unexpected number of IDs"
3946 self
.Bind(target
, id1
, id2
, func
)
3949 # These two are square pegs that don't fit the PyEventBinder hole...
3950 def EVT_COMMAND(win
, id, cmd
, func
):
3951 win
.Connect(id, -1, cmd
, func
)
3952 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3953 win
.Connect(id1
, id2
, cmd
, func
)
3956 #---------------------------------------------------------------------------
3958 #---------------------------------------------------------------------------
3960 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3961 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3963 def NewEventType(*args
):
3964 """NewEventType() -> EventType"""
3965 return _core_
.NewEventType(*args
)
3966 wxEVT_ANY
= _core_
.wxEVT_ANY
3967 wxEVT_NULL
= _core_
.wxEVT_NULL
3968 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3969 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3970 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3971 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3972 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3973 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3974 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3975 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3976 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3977 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3978 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3979 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3980 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3981 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3982 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3983 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3984 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3985 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3986 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3987 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3988 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3989 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3990 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3991 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3992 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3993 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3994 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3995 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3996 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3997 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3998 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3999 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
4000 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
4001 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
4002 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
4003 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
4004 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
4005 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
4006 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
4007 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
4008 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
4009 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
4010 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
4011 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
4012 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
4013 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
4014 wxEVT_CHAR
= _core_
.wxEVT_CHAR
4015 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
4016 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
4017 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
4018 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
4019 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
4020 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
4021 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
4022 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
4023 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
4024 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
4025 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
4026 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
4027 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
4028 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
4029 wxEVT_SCROLL_CHANGED
= _core_
.wxEVT_SCROLL_CHANGED
4030 wxEVT_SCROLL_ENDSCROLL
= wxEVT_SCROLL_CHANGED
4031 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
4032 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
4033 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
4034 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
4035 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
4036 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
4037 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
4038 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
4039 wxEVT_SIZE
= _core_
.wxEVT_SIZE
4040 wxEVT_MOVE
= _core_
.wxEVT_MOVE
4041 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
4042 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
4043 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
4044 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
4045 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
4046 wxEVT_CREATE
= _core_
.wxEVT_CREATE
4047 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
4048 wxEVT_SHOW
= _core_
.wxEVT_SHOW
4049 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
4050 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
4051 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
4052 wxEVT_MOUSE_CAPTURE_LOST
= _core_
.wxEVT_MOUSE_CAPTURE_LOST
4053 wxEVT_PAINT
= _core_
.wxEVT_PAINT
4054 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
4055 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
4056 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
4057 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
4058 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
4059 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
4060 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
4061 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
4062 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
4063 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
4064 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
4065 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
4066 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
4067 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
4068 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
4069 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
4070 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
4071 wxEVT_IDLE
= _core_
.wxEVT_IDLE
4072 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
4073 wxEVT_SIZING
= _core_
.wxEVT_SIZING
4074 wxEVT_MOVING
= _core_
.wxEVT_MOVING
4075 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
4076 wxEVT_COMMAND_TEXT_COPY
= _core_
.wxEVT_COMMAND_TEXT_COPY
4077 wxEVT_COMMAND_TEXT_CUT
= _core_
.wxEVT_COMMAND_TEXT_CUT
4078 wxEVT_COMMAND_TEXT_PASTE
= _core_
.wxEVT_COMMAND_TEXT_PASTE
4079 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
4080 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
4081 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
4082 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
4083 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
4084 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
4085 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
4087 # Create some event binders
4088 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
4089 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
4090 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
4091 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
4092 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
4093 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
4094 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
4095 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
4096 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
4097 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
4098 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
4099 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
4100 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
4101 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
4102 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
4103 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
4104 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
4105 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
4106 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
4107 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
4108 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
4109 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
4110 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
4111 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
4112 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
4113 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
4114 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
4115 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
4116 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
4117 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
4118 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
4119 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
4120 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
4121 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
4122 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
4123 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
4124 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
4125 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
4126 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
4127 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
4128 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
4129 EVT_MOUSE_CAPTURE_LOST
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST
)
4131 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
4132 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
4133 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
4134 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
4135 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
4136 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
4137 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
4138 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
4139 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
4140 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
4141 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
4142 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
4143 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
4145 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
4153 wxEVT_MIDDLE_DCLICK
,
4161 # Scrolling from wxWindow (sent to wxScrolledWindow)
4162 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
4163 wxEVT_SCROLLWIN_BOTTOM
,
4164 wxEVT_SCROLLWIN_LINEUP
,
4165 wxEVT_SCROLLWIN_LINEDOWN
,
4166 wxEVT_SCROLLWIN_PAGEUP
,
4167 wxEVT_SCROLLWIN_PAGEDOWN
,
4168 wxEVT_SCROLLWIN_THUMBTRACK
,
4169 wxEVT_SCROLLWIN_THUMBRELEASE
,
4172 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
4173 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
4174 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
4175 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
4176 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
4177 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
4178 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
4179 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
4181 # Scrolling from wx.Slider and wx.ScrollBar
4182 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
4183 wxEVT_SCROLL_BOTTOM
,
4184 wxEVT_SCROLL_LINEUP
,
4185 wxEVT_SCROLL_LINEDOWN
,
4186 wxEVT_SCROLL_PAGEUP
,
4187 wxEVT_SCROLL_PAGEDOWN
,
4188 wxEVT_SCROLL_THUMBTRACK
,
4189 wxEVT_SCROLL_THUMBRELEASE
,
4190 wxEVT_SCROLL_CHANGED
,
4193 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
4194 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
4195 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
4196 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
4197 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
4198 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
4199 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
4200 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
4201 EVT_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
)
4202 EVT_SCROLL_ENDSCROLL
= EVT_SCROLL_CHANGED
4204 # Scrolling from wx.Slider and wx.ScrollBar, with an id
4205 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
4206 wxEVT_SCROLL_BOTTOM
,
4207 wxEVT_SCROLL_LINEUP
,
4208 wxEVT_SCROLL_LINEDOWN
,
4209 wxEVT_SCROLL_PAGEUP
,
4210 wxEVT_SCROLL_PAGEDOWN
,
4211 wxEVT_SCROLL_THUMBTRACK
,
4212 wxEVT_SCROLL_THUMBRELEASE
,
4213 wxEVT_SCROLL_CHANGED
,
4216 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
4217 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
4218 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
4219 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
4220 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
4221 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
4222 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
4223 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
4224 EVT_COMMAND_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
, 1)
4225 EVT_COMMAND_SCROLL_ENDSCROLL
= EVT_COMMAND_SCROLL_CHANGED
4227 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
4228 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
4229 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
4230 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
4231 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
4232 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
4233 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
4234 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
4235 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
4236 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
4238 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
4239 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
4240 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
4241 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
4242 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
4243 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
4244 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
4245 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
4246 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
4249 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
4250 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
4251 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
4252 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
4253 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
4254 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
4255 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
4257 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
4259 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
4260 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
4262 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
4264 EVT_TEXT_CUT
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_CUT
)
4265 EVT_TEXT_COPY
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_COPY
)
4266 EVT_TEXT_PASTE
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE
)
4269 #---------------------------------------------------------------------------
4271 class Event(Object
):
4273 An event is a structure holding information about an event passed to a
4274 callback or member function. wx.Event is an abstract base class for
4277 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4278 def __init__(self
): raise AttributeError, "No constructor defined"
4279 __repr__
= _swig_repr
4280 __swig_destroy__
= _core_
.delete_Event
4281 __del__
= lambda self
: None;
4282 def SetEventType(*args
, **kwargs
):
4284 SetEventType(self, EventType typ)
4286 Sets the specific type of the event.
4288 return _core_
.Event_SetEventType(*args
, **kwargs
)
4290 def GetEventType(*args
, **kwargs
):
4292 GetEventType(self) -> EventType
4294 Returns the identifier of the given event type, such as
4295 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4297 return _core_
.Event_GetEventType(*args
, **kwargs
)
4299 def GetEventObject(*args
, **kwargs
):
4301 GetEventObject(self) -> Object
4303 Returns the object (usually a window) associated with the event, if
4306 return _core_
.Event_GetEventObject(*args
, **kwargs
)
4308 def SetEventObject(*args
, **kwargs
):
4310 SetEventObject(self, Object obj)
4312 Sets the originating object, or in other words, obj is normally the
4313 object that is sending the event.
4315 return _core_
.Event_SetEventObject(*args
, **kwargs
)
4317 def GetTimestamp(*args
, **kwargs
):
4318 """GetTimestamp(self) -> long"""
4319 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
4321 def SetTimestamp(*args
, **kwargs
):
4322 """SetTimestamp(self, long ts=0)"""
4323 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
4325 def GetId(*args
, **kwargs
):
4329 Returns the identifier associated with this event, such as a button
4332 return _core_
.Event_GetId(*args
, **kwargs
)
4334 def SetId(*args
, **kwargs
):
4338 Set's the ID for the event. This is usually the ID of the window that
4339 is sending the event, but it can also be a command id from a menu
4342 return _core_
.Event_SetId(*args
, **kwargs
)
4344 def IsCommandEvent(*args
, **kwargs
):
4346 IsCommandEvent(self) -> bool
4348 Returns true if the event is or is derived from `wx.CommandEvent` else
4349 it returns false. Note: Exists only for optimization purposes.
4351 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
4353 def Skip(*args
, **kwargs
):
4355 Skip(self, bool skip=True)
4357 This method can be used inside an event handler to control whether
4358 further event handlers bound to this event will be called after the
4359 current one returns. Without Skip() (or equivalently if Skip(False) is
4360 used), the event will not be processed any more. If Skip(True) is
4361 called, the event processing system continues searching for a further
4362 handler function for this event, even though it has been processed
4363 already in the current handler.
4365 return _core_
.Event_Skip(*args
, **kwargs
)
4367 def GetSkipped(*args
, **kwargs
):
4369 GetSkipped(self) -> bool
4371 Returns true if the event handler should be skipped, false otherwise.
4374 return _core_
.Event_GetSkipped(*args
, **kwargs
)
4376 def ShouldPropagate(*args
, **kwargs
):
4378 ShouldPropagate(self) -> bool
4380 Test if this event should be propagated to the parent window or not,
4381 i.e. if the propagation level is currently greater than 0.
4383 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
4385 def StopPropagation(*args
, **kwargs
):
4387 StopPropagation(self) -> int
4389 Stop the event from propagating to its parent window. Returns the old
4390 propagation level value which may be later passed to
4391 `ResumePropagation` to allow propagating the event again.
4393 return _core_
.Event_StopPropagation(*args
, **kwargs
)
4395 def ResumePropagation(*args
, **kwargs
):
4397 ResumePropagation(self, int propagationLevel)
4399 Resume the event propagation by restoring the propagation level. (For
4400 example, you can use the value returned by an earlier call to
4404 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
4406 def Clone(*args
, **kwargs
):
4407 """Clone(self) -> Event"""
4408 return _core_
.Event_Clone(*args
, **kwargs
)
4410 EventObject
= property(GetEventObject
,SetEventObject
,doc
="See `GetEventObject` and `SetEventObject`")
4411 EventType
= property(GetEventType
,SetEventType
,doc
="See `GetEventType` and `SetEventType`")
4412 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
4413 Skipped
= property(GetSkipped
,doc
="See `GetSkipped`")
4414 Timestamp
= property(GetTimestamp
,SetTimestamp
,doc
="See `GetTimestamp` and `SetTimestamp`")
4415 _core_
.Event_swigregister(Event
)
4417 #---------------------------------------------------------------------------
4419 class PropagationDisabler(object):
4421 Helper class to temporarily change an event not to propagate. Simply
4422 create an instance of this class and then whe it is destroyed the
4423 propogation of the event will be restored.
4425 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4426 __repr__
= _swig_repr
4427 def __init__(self
, *args
, **kwargs
):
4429 __init__(self, Event event) -> PropagationDisabler
4431 Helper class to temporarily change an event not to propagate. Simply
4432 create an instance of this class and then whe it is destroyed the
4433 propogation of the event will be restored.
4435 _core_
.PropagationDisabler_swiginit(self
,_core_
.new_PropagationDisabler(*args
, **kwargs
))
4436 __swig_destroy__
= _core_
.delete_PropagationDisabler
4437 __del__
= lambda self
: None;
4438 _core_
.PropagationDisabler_swigregister(PropagationDisabler
)
4440 class PropagateOnce(object):
4442 A helper class that will temporarily lower propagation level of an
4443 event. Simply create an instance of this class and then whe it is
4444 destroyed the propogation of the event will be restored.
4446 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4447 __repr__
= _swig_repr
4448 def __init__(self
, *args
, **kwargs
):
4450 __init__(self, Event event) -> PropagateOnce
4452 A helper class that will temporarily lower propagation level of an
4453 event. Simply create an instance of this class and then whe it is
4454 destroyed the propogation of the event will be restored.
4456 _core_
.PropagateOnce_swiginit(self
,_core_
.new_PropagateOnce(*args
, **kwargs
))
4457 __swig_destroy__
= _core_
.delete_PropagateOnce
4458 __del__
= lambda self
: None;
4459 _core_
.PropagateOnce_swigregister(PropagateOnce
)
4461 #---------------------------------------------------------------------------
4463 class CommandEvent(Event
):
4465 This event class contains information about command events, which
4466 originate from a variety of simple controls, as well as menus and
4469 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4470 __repr__
= _swig_repr
4471 def __init__(self
, *args
, **kwargs
):
4473 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4475 This event class contains information about command events, which
4476 originate from a variety of simple controls, as well as menus and
4479 _core_
.CommandEvent_swiginit(self
,_core_
.new_CommandEvent(*args
, **kwargs
))
4480 def GetSelection(*args
, **kwargs
):
4482 GetSelection(self) -> int
4484 Returns item index for a listbox or choice selection event (not valid
4487 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
4489 def SetString(*args
, **kwargs
):
4490 """SetString(self, String s)"""
4491 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
4493 def GetString(*args
, **kwargs
):
4495 GetString(self) -> String
4497 Returns item string for a listbox or choice selection event (not valid
4500 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
4502 def IsChecked(*args
, **kwargs
):
4504 IsChecked(self) -> bool
4506 This method can be used with checkbox and menu events: for the
4507 checkboxes, the method returns true for a selection event and false
4508 for a deselection one. For the menu events, this method indicates if
4509 the menu item just has become checked or unchecked (and thus only
4510 makes sense for checkable menu items).
4512 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
4515 def IsSelection(*args
, **kwargs
):
4517 IsSelection(self) -> bool
4519 For a listbox or similar event, returns true if it is a selection,
4520 false if it is a deselection.
4522 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4524 def SetExtraLong(*args
, **kwargs
):
4525 """SetExtraLong(self, long extraLong)"""
4526 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4528 def GetExtraLong(*args
, **kwargs
):
4530 GetExtraLong(self) -> long
4532 Returns extra information dependant on the event objects type. If the
4533 event comes from a listbox selection, it is a boolean determining
4534 whether the event was a selection (true) or a deselection (false). A
4535 listbox deselection only occurs for multiple-selection boxes, and in
4536 this case the index and string values are indeterminate and the
4537 listbox must be examined by the application.
4539 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4541 def SetInt(*args
, **kwargs
):
4542 """SetInt(self, int i)"""
4543 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4545 def GetInt(*args
, **kwargs
):
4549 Returns the integer identifier corresponding to a listbox, choice or
4550 radiobox selection (only if the event was a selection, not a
4551 deselection), or a boolean value representing the value of a checkbox.
4553 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4555 def GetClientData(*args
, **kwargs
):
4557 GetClientData(self) -> PyObject
4559 Returns the client data object for a listbox or choice selection event, (if any.)
4561 return _core_
.CommandEvent_GetClientData(*args
, **kwargs
)
4563 def SetClientData(*args
, **kwargs
):
4565 SetClientData(self, PyObject clientData)
4567 Associate the given client data with the item at position n.
4569 return _core_
.CommandEvent_SetClientData(*args
, **kwargs
)
4571 GetClientObject
= GetClientData
4572 SetClientObject
= SetClientData
4574 def Clone(*args
, **kwargs
):
4575 """Clone(self) -> Event"""
4576 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4578 ClientData
= property(GetClientData
,SetClientData
,doc
="See `GetClientData` and `SetClientData`")
4579 ClientObject
= property(GetClientObject
,SetClientObject
,doc
="See `GetClientObject` and `SetClientObject`")
4580 ExtraLong
= property(GetExtraLong
,SetExtraLong
,doc
="See `GetExtraLong` and `SetExtraLong`")
4581 Int
= property(GetInt
,SetInt
,doc
="See `GetInt` and `SetInt`")
4582 Selection
= property(GetSelection
,doc
="See `GetSelection`")
4583 String
= property(GetString
,SetString
,doc
="See `GetString` and `SetString`")
4584 _core_
.CommandEvent_swigregister(CommandEvent
)
4586 #---------------------------------------------------------------------------
4588 class NotifyEvent(CommandEvent
):
4590 An instance of this class (or one of its derived classes) is sent from
4591 a control when the control's state is being changed and the control
4592 allows that change to be prevented from happening. The event handler
4593 can call `Veto` or `Allow` to tell the control what to do.
4595 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4596 __repr__
= _swig_repr
4597 def __init__(self
, *args
, **kwargs
):
4599 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4601 An instance of this class (or one of its derived classes) is sent from
4602 a control when the control's state is being changed and the control
4603 allows that change to be prevented from happening. The event handler
4604 can call `Veto` or `Allow` to tell the control what to do.
4606 _core_
.NotifyEvent_swiginit(self
,_core_
.new_NotifyEvent(*args
, **kwargs
))
4607 def Veto(*args
, **kwargs
):
4611 Prevents the change announced by this event from happening.
4613 It is in general a good idea to notify the user about the reasons for
4614 vetoing the change because otherwise the applications behaviour (which
4615 just refuses to do what the user wants) might be quite surprising.
4617 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4619 def Allow(*args
, **kwargs
):
4623 This is the opposite of `Veto`: it explicitly allows the event to be
4624 processed. For most events it is not necessary to call this method as
4625 the events are allowed anyhow but some are forbidden by default (this
4626 will be mentioned in the corresponding event description).
4628 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4630 def IsAllowed(*args
, **kwargs
):
4632 IsAllowed(self) -> bool
4634 Returns true if the change is allowed (`Veto` hasn't been called) or
4635 false otherwise (if it was).
4637 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4639 _core_
.NotifyEvent_swigregister(NotifyEvent
)
4641 #---------------------------------------------------------------------------
4643 class ScrollEvent(CommandEvent
):
4645 A scroll event holds information about events sent from stand-alone
4646 scrollbars and sliders. Note that scrolled windows do not send
4647 instances of this event class, but send the `wx.ScrollWinEvent`
4650 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4651 __repr__
= _swig_repr
4652 def __init__(self
, *args
, **kwargs
):
4654 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4655 int orient=0) -> ScrollEvent
4657 _core_
.ScrollEvent_swiginit(self
,_core_
.new_ScrollEvent(*args
, **kwargs
))
4658 def GetOrientation(*args
, **kwargs
):
4660 GetOrientation(self) -> int
4662 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4665 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4667 def GetPosition(*args
, **kwargs
):
4669 GetPosition(self) -> int
4671 Returns the position of the scrollbar.
4673 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4675 def SetOrientation(*args
, **kwargs
):
4676 """SetOrientation(self, int orient)"""
4677 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4679 def SetPosition(*args
, **kwargs
):
4680 """SetPosition(self, int pos)"""
4681 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4683 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
4684 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
4685 _core_
.ScrollEvent_swigregister(ScrollEvent
)
4687 #---------------------------------------------------------------------------
4689 class ScrollWinEvent(Event
):
4691 A wx.ScrollWinEvent holds information about scrolling and is sent from
4694 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4695 __repr__
= _swig_repr
4696 def __init__(self
, *args
, **kwargs
):
4698 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4700 A wx.ScrollWinEvent holds information about scrolling and is sent from
4703 _core_
.ScrollWinEvent_swiginit(self
,_core_
.new_ScrollWinEvent(*args
, **kwargs
))
4704 def GetOrientation(*args
, **kwargs
):
4706 GetOrientation(self) -> int
4708 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4711 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4713 def GetPosition(*args
, **kwargs
):
4715 GetPosition(self) -> int
4717 Returns the position of the scrollbar for the thumb track and release
4718 events. Note that this field can't be used for the other events, you
4719 need to query the window itself for the current position in that case.
4721 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4723 def SetOrientation(*args
, **kwargs
):
4724 """SetOrientation(self, int orient)"""
4725 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4727 def SetPosition(*args
, **kwargs
):
4728 """SetPosition(self, int pos)"""
4729 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4731 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
4732 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
4733 _core_
.ScrollWinEvent_swigregister(ScrollWinEvent
)
4735 #---------------------------------------------------------------------------
4737 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4738 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4739 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4740 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4741 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4742 class MouseEvent(Event
):
4744 This event class contains information about the events generated by
4745 the mouse: they include mouse buttons press and release events and
4748 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4749 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4750 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4751 a middle button so a portable application should avoid relying on the
4754 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4755 the former returns true when the event corresponds to the left mouse
4756 button click while the latter returns true if the left mouse button is
4757 currently being pressed. For example, when the user is dragging the
4758 mouse you can use `LeftIsDown` to test whether the left mouse button
4759 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4760 `LeftIsDown` will also return true in wxWidgets whatever the
4761 underlying GUI behaviour is (which is platform-dependent). The same
4762 applies, of course, to other mouse buttons as well.
4764 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4765 __repr__
= _swig_repr
4766 def __init__(self
, *args
, **kwargs
):
4768 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4770 Constructs a wx.MouseEvent. Valid event types are:
4772 * wxEVT_ENTER_WINDOW
4773 * wxEVT_LEAVE_WINDOW
4779 * wxEVT_MIDDLE_DCLICK
4782 * wxEVT_RIGHT_DCLICK
4786 _core_
.MouseEvent_swiginit(self
,_core_
.new_MouseEvent(*args
, **kwargs
))
4787 def IsButton(*args
, **kwargs
):
4789 IsButton(self) -> bool
4791 Returns true if the event was a mouse button event (not necessarily a
4792 button down event - that may be tested using `ButtonDown`).
4794 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4796 def ButtonDown(*args
, **kwargs
):
4798 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4800 If the argument is omitted, this returns true if the event was any
4801 mouse button down event. Otherwise the argument specifies which
4802 button-down event shold be checked for (see `Button` for the possible
4805 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4807 def ButtonDClick(*args
, **kwargs
):
4809 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4811 If the argument is omitted, this returns true if the event was any
4812 mouse double click event. Otherwise the argument specifies which
4813 double click event to check for (see `Button` for the possible
4816 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4818 def ButtonUp(*args
, **kwargs
):
4820 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4822 If the argument is omitted, this returns true if the event was any
4823 mouse button up event. Otherwise the argument specifies which button
4824 up event to check for (see `Button` for the possible values).
4826 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4828 def Button(*args
, **kwargs
):
4830 Button(self, int button) -> bool
4832 Returns true if the identified mouse button is changing state. Valid
4833 values of button are:
4835 ==================== =====================================
4836 wx.MOUSE_BTN_LEFT check if left button was pressed
4837 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4838 wx.MOUSE_BTN_RIGHT check if right button was pressed
4839 wx.MOUSE_BTN_ANY check if any button was pressed
4840 ==================== =====================================
4843 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4845 def ButtonIsDown(*args
, **kwargs
):
4846 """ButtonIsDown(self, int but) -> bool"""
4847 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4849 def GetButton(*args
, **kwargs
):
4851 GetButton(self) -> int
4853 Returns the mouse button which generated this event or
4854 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4855 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4856 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4857 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4858 right buttons respectively.
4860 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4862 def ControlDown(*args
, **kwargs
):
4864 ControlDown(self) -> bool
4866 Returns true if the control key was down at the time of the event.
4868 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4870 def MetaDown(*args
, **kwargs
):
4872 MetaDown(self) -> bool
4874 Returns true if the Meta key was down at the time of the event.
4876 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4878 def AltDown(*args
, **kwargs
):
4880 AltDown(self) -> bool
4882 Returns true if the Alt key was down at the time of the event.
4884 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4886 def ShiftDown(*args
, **kwargs
):
4888 ShiftDown(self) -> bool
4890 Returns true if the Shift key was down at the time of the event.
4892 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4894 def CmdDown(*args
, **kwargs
):
4896 CmdDown(self) -> bool
4898 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4899 platforms but the special "Apple" (a.k.a as "Command") key on
4900 Macs. It often makes sense to use it instead of, say, `ControlDown`
4901 because Cmd key is used for the same thing under Mac as Ctrl
4902 elsewhere. The Ctrl key still exists, it's just not used for this
4903 purpose. So for non-Mac platforms this is the same as `ControlDown`
4904 and Macs this is the same as `MetaDown`.
4906 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4908 def LeftDown(*args
, **kwargs
):
4910 LeftDown(self) -> bool
4912 Returns true if the left mouse button state changed to down.
4914 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4916 def MiddleDown(*args
, **kwargs
):
4918 MiddleDown(self) -> bool
4920 Returns true if the middle mouse button state changed to down.
4922 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4924 def RightDown(*args
, **kwargs
):
4926 RightDown(self) -> bool
4928 Returns true if the right mouse button state changed to down.
4930 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4932 def LeftUp(*args
, **kwargs
):
4934 LeftUp(self) -> bool
4936 Returns true if the left mouse button state changed to up.
4938 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4940 def MiddleUp(*args
, **kwargs
):
4942 MiddleUp(self) -> bool
4944 Returns true if the middle mouse button state changed to up.
4946 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4948 def RightUp(*args
, **kwargs
):
4950 RightUp(self) -> bool
4952 Returns true if the right mouse button state changed to up.
4954 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4956 def LeftDClick(*args
, **kwargs
):
4958 LeftDClick(self) -> bool
4960 Returns true if the event was a left button double click.
4962 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4964 def MiddleDClick(*args
, **kwargs
):
4966 MiddleDClick(self) -> bool
4968 Returns true if the event was a middle button double click.
4970 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4972 def RightDClick(*args
, **kwargs
):
4974 RightDClick(self) -> bool
4976 Returns true if the event was a right button double click.
4978 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4980 def LeftIsDown(*args
, **kwargs
):
4982 LeftIsDown(self) -> bool
4984 Returns true if the left mouse button is currently down, independent
4985 of the current event type.
4987 Please notice that it is not the same as LeftDown which returns true
4988 if the left mouse button was just pressed. Rather, it describes the
4989 state of the mouse button before the event happened.
4991 This event is usually used in the mouse event handlers which process
4992 "move mouse" messages to determine whether the user is (still)
4995 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4997 def MiddleIsDown(*args
, **kwargs
):
4999 MiddleIsDown(self) -> bool
5001 Returns true if the middle mouse button is currently down, independent
5002 of the current event type.
5004 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
5006 def RightIsDown(*args
, **kwargs
):
5008 RightIsDown(self) -> bool
5010 Returns true if the right mouse button is currently down, independent
5011 of the current event type.
5013 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
5015 def Dragging(*args
, **kwargs
):
5017 Dragging(self) -> bool
5019 Returns true if this was a dragging event (motion while a button is
5022 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
5024 def Moving(*args
, **kwargs
):
5026 Moving(self) -> bool
5028 Returns true if this was a motion event and no mouse buttons were
5029 pressed. If any mouse button is held pressed, then this method returns
5030 false and Dragging returns true.
5032 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
5034 def Entering(*args
, **kwargs
):
5036 Entering(self) -> bool
5038 Returns true if the mouse was entering the window.
5040 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
5042 def Leaving(*args
, **kwargs
):
5044 Leaving(self) -> bool
5046 Returns true if the mouse was leaving the window.
5048 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
5050 def GetPosition(*args
, **kwargs
):
5052 GetPosition(self) -> Point
5054 Returns the pixel position of the mouse in window coordinates when the
5057 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
5059 def GetPositionTuple(*args
, **kwargs
):
5061 GetPositionTuple() -> (x,y)
5063 Returns the pixel position of the mouse in window coordinates when the
5066 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
5068 def GetLogicalPosition(*args
, **kwargs
):
5070 GetLogicalPosition(self, DC dc) -> Point
5072 Returns the logical mouse position in pixels (i.e. translated
5073 according to the translation set for the DC, which usually indicates
5074 that the window has been scrolled).
5076 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
5078 def GetX(*args
, **kwargs
):
5082 Returns X coordinate of the physical mouse event position.
5084 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
5086 def GetY(*args
, **kwargs
):
5090 Returns Y coordinate of the physical mouse event position.
5092 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
5094 def GetWheelRotation(*args
, **kwargs
):
5096 GetWheelRotation(self) -> int
5098 Get wheel rotation, positive or negative indicates direction of
5099 rotation. Current devices all send an event when rotation is equal to
5100 +/-WheelDelta, but this allows for finer resolution devices to be
5101 created in the future. Because of this you shouldn't assume that one
5102 event is equal to 1 line or whatever, but you should be able to either
5103 do partial line scrolling or wait until +/-WheelDelta rotation values
5104 have been accumulated before scrolling.
5106 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
5108 def GetWheelDelta(*args
, **kwargs
):
5110 GetWheelDelta(self) -> int
5112 Get wheel delta, normally 120. This is the threshold for action to be
5113 taken, and one such action (for example, scrolling one increment)
5114 should occur for each delta.
5116 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
5118 def GetWheelAxis(*args
, **kwargs
):
5120 GetWheelAxis(self) -> int
5122 Gets the axis the wheel operation concerns, 0 being the y axis as on
5123 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5124 or horizontal trackpad scrolling.
5126 return _core_
.MouseEvent_GetWheelAxis(*args
, **kwargs
)
5128 def GetLinesPerAction(*args
, **kwargs
):
5130 GetLinesPerAction(self) -> int
5132 Returns the configured number of lines (or whatever) to be scrolled
5133 per wheel action. Defaults to three.
5135 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
5137 def IsPageScroll(*args
, **kwargs
):
5139 IsPageScroll(self) -> bool
5141 Returns true if the system has been setup to do page scrolling with
5142 the mouse wheel instead of line scrolling.
5144 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
5146 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
5147 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
5148 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
5149 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
5150 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
5151 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
5152 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
5153 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
5154 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
5155 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
5156 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
5157 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
5158 Button
= property(GetButton
,doc
="See `GetButton`")
5159 LinesPerAction
= property(GetLinesPerAction
,doc
="See `GetLinesPerAction`")
5160 LogicalPosition
= property(GetLogicalPosition
,doc
="See `GetLogicalPosition`")
5161 Position
= property(GetPosition
,doc
="See `GetPosition`")
5162 WheelDelta
= property(GetWheelDelta
,doc
="See `GetWheelDelta`")
5163 WheelRotation
= property(GetWheelRotation
,doc
="See `GetWheelRotation`")
5164 X
= property(GetX
,doc
="See `GetX`")
5165 Y
= property(GetY
,doc
="See `GetY`")
5166 _core_
.MouseEvent_swigregister(MouseEvent
)
5168 #---------------------------------------------------------------------------
5170 class SetCursorEvent(Event
):
5172 A SetCursorEvent is generated when the mouse cursor is about to be set
5173 as a result of mouse motion. This event gives the application the
5174 chance to perform specific mouse cursor processing based on the
5175 current position of the mouse within the window. Use the `SetCursor`
5176 method to specify the cursor you want to be displayed.
5178 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5179 __repr__
= _swig_repr
5180 def __init__(self
, *args
, **kwargs
):
5182 __init__(self, int x=0, int y=0) -> SetCursorEvent
5184 Construct a new `wx.SetCursorEvent`.
5186 _core_
.SetCursorEvent_swiginit(self
,_core_
.new_SetCursorEvent(*args
, **kwargs
))
5187 def GetX(*args
, **kwargs
):
5191 Returns the X coordinate of the mouse in client coordinates.
5193 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
5195 def GetY(*args
, **kwargs
):
5199 Returns the Y coordinate of the mouse in client coordinates.
5201 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
5203 def SetCursor(*args
, **kwargs
):
5205 SetCursor(self, Cursor cursor)
5207 Sets the cursor associated with this event.
5209 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
5211 def GetCursor(*args
, **kwargs
):
5213 GetCursor(self) -> Cursor
5215 Returns a reference to the cursor specified by this event.
5217 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
5219 def HasCursor(*args
, **kwargs
):
5221 HasCursor(self) -> bool
5223 Returns true if the cursor specified by this event is a valid cursor.
5225 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
5227 Cursor
= property(GetCursor
,SetCursor
,doc
="See `GetCursor` and `SetCursor`")
5228 X
= property(GetX
,doc
="See `GetX`")
5229 Y
= property(GetY
,doc
="See `GetY`")
5230 _core_
.SetCursorEvent_swigregister(SetCursorEvent
)
5232 #---------------------------------------------------------------------------
5234 class KeyEvent(Event
):
5236 This event class contains information about keypress and character
5237 events. These events are only sent to the widget that currently has
5240 Notice that there are three different kinds of keyboard events in
5241 wxWidgets: key down and up events and char events. The difference
5242 between the first two is clear - the first corresponds to a key press
5243 and the second to a key release - otherwise they are identical. Just
5244 note that if the key is maintained in a pressed state you will
5245 typically get a lot of (automatically generated) down events but only
5246 one up so it is wrong to assume that there is one up event
5247 corresponding to each down one.
5249 Both key events provide untranslated key codes while the char event
5250 carries the translated one. The untranslated code for alphanumeric
5251 keys is always an upper case value. For the other keys it is one of
5252 WXK_XXX values from the keycodes table. The translated key is, in
5253 general, the character the user expects to appear as the result of the
5254 key combination when typing the text into a text entry zone, for
5257 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5258 and the standard US keyboard): when the 'A' key is pressed, the key
5259 down event key code is equal to ASCII A == 65. But the char event key
5260 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5261 'A' keys simultaneously , the key code in key down event will still be
5262 just 'A' while the char event key code parameter will now be 'A' as
5265 Although in this simple case it is clear that the correct key code
5266 could be found in the key down event handler by checking the value
5267 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5268 as for non alphanumeric keys or non-US keyboard layouts the
5269 translation is keyboard-layout dependent and can only be done properly
5270 by the system itself.
5272 Another kind of translation is done when the control key is pressed:
5273 for example, for CTRL-A key press the key down event still carries the
5274 same key code 'A' as usual but the char event will have key code of 1,
5275 the ASCII value of this key combination.
5277 You may discover how the other keys on your system behave
5278 interactively by running the KeyEvents sample in the wxPython demo and
5279 pressing some keys while the blue box at the top has the keyboard
5282 **Note**: If a key down event is caught and the event handler does not
5283 call event.Skip() then the coresponding char event will not
5284 happen. This is by design and enables the programs that handle both
5285 types of events to be a bit simpler.
5287 **Note for Windows programmers**: The key and char events in wxWidgets
5288 are similar to but slightly different from Windows WM_KEYDOWN and
5289 WM_CHAR events. In particular, Alt-x combination will generate a char
5290 event in wxWidgets (unless it is used as an accelerator).
5292 **Tip**: be sure to call event.Skip() for events that you don't
5293 process in key event function, otherwise menu shortcuts may cease to
5297 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5298 __repr__
= _swig_repr
5299 def __init__(self
, *args
, **kwargs
):
5301 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5303 Construct a new `wx.KeyEvent`. Valid event types are:
5306 _core_
.KeyEvent_swiginit(self
,_core_
.new_KeyEvent(*args
, **kwargs
))
5307 def GetModifiers(*args
, **kwargs
):
5309 GetModifiers(self) -> int
5311 Returns a bitmask of the current modifier settings. Can be used to
5312 check if the key event has exactly the given modifiers without having
5313 to explicitly check that the other modifiers are not down. For
5316 if event.GetModifers() == wx.MOD_CONTROL:
5320 return _core_
.KeyEvent_GetModifiers(*args
, **kwargs
)
5322 def ControlDown(*args
, **kwargs
):
5324 ControlDown(self) -> bool
5326 Returns ``True`` if the Control key was down at the time of the event.
5328 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
5330 def MetaDown(*args
, **kwargs
):
5332 MetaDown(self) -> bool
5334 Returns ``True`` if the Meta key was down at the time of the event.
5336 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
5338 def AltDown(*args
, **kwargs
):
5340 AltDown(self) -> bool
5342 Returns ``True`` if the Alt key was down at the time of the event.
5344 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
5346 def ShiftDown(*args
, **kwargs
):
5348 ShiftDown(self) -> bool
5350 Returns ``True`` if the Shift key was down at the time of the event.
5352 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
5354 def CmdDown(*args
, **kwargs
):
5356 CmdDown(self) -> bool
5358 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5359 platforms but the special "Apple" (a.k.a as "Command") key on
5360 Macs. It makes often sense to use it instead of, say, `ControlDown`
5361 because Cmd key is used for the same thing under Mac as Ctrl
5362 elsewhere. The Ctrl still exists, it's just not used for this
5363 purpose. So for non-Mac platforms this is the same as `ControlDown`
5364 and Macs this is the same as `MetaDown`.
5366 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
5368 def HasModifiers(*args
, **kwargs
):
5370 HasModifiers(self) -> bool
5372 Returns true if either CTRL or ALT keys was down at the time of the
5373 key event. Note that this function does not take into account neither
5374 SHIFT nor META key states (the reason for ignoring the latter is that
5375 it is common for NUMLOCK key to be configured as META under X but the
5376 key presses even while NUMLOCK is on should be still processed
5379 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
5381 def GetKeyCode(*args
, **kwargs
):
5383 GetKeyCode(self) -> int
5385 Returns the virtual key code. ASCII events return normal ASCII values,
5386 while non-ASCII events return values such as WXK_LEFT for the left
5387 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5390 Note that in Unicode build, the returned value is meaningful only if
5391 the user entered a character that can be represented in current
5392 locale's default charset. You can obtain the corresponding Unicode
5393 character using `GetUnicodeKey`.
5395 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
5397 def GetUnicodeKey(*args
, **kwargs
):
5399 GetUnicodeKey(self) -> int
5401 Returns the Unicode character corresponding to this key event. This
5402 function is only meaningfule in a Unicode build of wxPython.
5404 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
5406 GetUniChar
= GetUnicodeKey
5407 def SetUnicodeKey(*args
, **kwargs
):
5409 SetUnicodeKey(self, int uniChar)
5411 Set the Unicode value of the key event, but only if this is a Unicode
5414 return _core_
.KeyEvent_SetUnicodeKey(*args
, **kwargs
)
5416 def GetRawKeyCode(*args
, **kwargs
):
5418 GetRawKeyCode(self) -> unsigned int
5420 Returns the raw key code for this event. This is a platform-dependent
5421 scan code which should only be used in advanced
5422 applications. Currently the raw key codes are not supported by all
5425 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
5427 def GetRawKeyFlags(*args
, **kwargs
):
5429 GetRawKeyFlags(self) -> unsigned int
5431 Returns the low level key flags for this event. The flags are
5432 platform-dependent and should only be used in advanced applications.
5433 Currently the raw key flags are not supported by all ports.
5435 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
5437 def GetPosition(*args
, **kwargs
):
5439 GetPosition(self) -> Point
5441 Find the position of the event, if applicable.
5443 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
5445 def GetPositionTuple(*args
, **kwargs
):
5447 GetPositionTuple() -> (x,y)
5449 Find the position of the event, if applicable.
5451 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
5453 def GetX(*args
, **kwargs
):
5457 Returns the X position (in client coordinates) of the event, if
5460 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
5462 def GetY(*args
, **kwargs
):
5466 Returns the Y position (in client coordinates) of the event, if
5469 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
5471 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
5472 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
5473 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
5474 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
5475 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
5476 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
5477 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
5478 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
5479 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
5480 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
5481 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
5482 Modifiers
= property(GetModifiers
,doc
="See `GetModifiers`")
5483 Position
= property(GetPosition
,doc
="See `GetPosition`")
5484 RawKeyCode
= property(GetRawKeyCode
,doc
="See `GetRawKeyCode`")
5485 RawKeyFlags
= property(GetRawKeyFlags
,doc
="See `GetRawKeyFlags`")
5486 UnicodeKey
= property(GetUnicodeKey
,SetUnicodeKey
,doc
="See `GetUnicodeKey` and `SetUnicodeKey`")
5487 X
= property(GetX
,doc
="See `GetX`")
5488 Y
= property(GetY
,doc
="See `GetY`")
5489 _core_
.KeyEvent_swigregister(KeyEvent
)
5491 #---------------------------------------------------------------------------
5493 class SizeEvent(Event
):
5495 A size event holds information about size change events. The EVT_SIZE
5496 handler function will be called when the window it is bound to has
5499 Note that the size passed is of the whole window: call
5500 `wx.Window.GetClientSize` for the area which may be used by the
5503 When a window is resized, usually only a small part of the window is
5504 damaged and and that area is all that is in the update region for the
5505 next paint event. However, if your drawing depends on the size of the
5506 window, you may need to clear the DC explicitly and repaint the whole
5507 window. In which case, you may need to call `wx.Window.Refresh` to
5508 invalidate the entire window.
5511 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5512 __repr__
= _swig_repr
5513 def __init__(self
, *args
, **kwargs
):
5515 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5517 Construct a new ``wx.SizeEvent``.
5519 _core_
.SizeEvent_swiginit(self
,_core_
.new_SizeEvent(*args
, **kwargs
))
5520 def GetSize(*args
, **kwargs
):
5522 GetSize(self) -> Size
5524 Returns the entire size of the window generating the size change
5527 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
5529 def GetRect(*args
, **kwargs
):
5530 """GetRect(self) -> Rect"""
5531 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
5533 def SetRect(*args
, **kwargs
):
5534 """SetRect(self, Rect rect)"""
5535 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
5537 def SetSize(*args
, **kwargs
):
5538 """SetSize(self, Size size)"""
5539 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
5541 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
5542 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
5543 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
5544 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
5545 _core_
.SizeEvent_swigregister(SizeEvent
)
5547 #---------------------------------------------------------------------------
5549 class MoveEvent(Event
):
5551 This event object is sent for EVT_MOVE event bindings when a window is
5552 moved to a new position.
5554 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5555 __repr__
= _swig_repr
5556 def __init__(self
, *args
, **kwargs
):
5558 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5562 _core_
.MoveEvent_swiginit(self
,_core_
.new_MoveEvent(*args
, **kwargs
))
5563 def GetPosition(*args
, **kwargs
):
5565 GetPosition(self) -> Point
5567 Returns the position of the window generating the move change event.
5569 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
5571 def GetRect(*args
, **kwargs
):
5572 """GetRect(self) -> Rect"""
5573 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
5575 def SetRect(*args
, **kwargs
):
5576 """SetRect(self, Rect rect)"""
5577 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
5579 def SetPosition(*args
, **kwargs
):
5580 """SetPosition(self, Point pos)"""
5581 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
5583 m_pos
= property(GetPosition
, SetPosition
)
5584 m_rect
= property(GetRect
, SetRect
)
5586 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
5587 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
5588 _core_
.MoveEvent_swigregister(MoveEvent
)
5590 #---------------------------------------------------------------------------
5592 class PaintEvent(Event
):
5594 A paint event is sent when a window's contents needs to be repainted.
5595 Note that in an EVT_PAINT handler the application must *always* create
5596 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5597 Windows assumes that the window has not been painted yet and will send
5598 the event again, causing endless refreshes.
5600 You can optimize painting by retrieving the rectangles that have been
5601 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5602 and only repainting these rectangles. The rectangles are in terms of
5603 the client area, and are unscrolled, so you will need to do some
5604 calculations using the current view position to obtain logical,
5608 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5609 __repr__
= _swig_repr
5610 def __init__(self
, *args
, **kwargs
):
5611 """__init__(self, int Id=0) -> PaintEvent"""
5612 _core_
.PaintEvent_swiginit(self
,_core_
.new_PaintEvent(*args
, **kwargs
))
5613 _core_
.PaintEvent_swigregister(PaintEvent
)
5615 class NcPaintEvent(Event
):
5616 """Proxy of C++ NcPaintEvent class"""
5617 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5618 __repr__
= _swig_repr
5619 def __init__(self
, *args
, **kwargs
):
5620 """__init__(self, int winid=0) -> NcPaintEvent"""
5621 _core_
.NcPaintEvent_swiginit(self
,_core_
.new_NcPaintEvent(*args
, **kwargs
))
5622 _core_
.NcPaintEvent_swigregister(NcPaintEvent
)
5624 #---------------------------------------------------------------------------
5626 class EraseEvent(Event
):
5628 An erase event is sent whenever the background of a window needs to be
5629 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5630 binder. On some platforms, such as GTK+, this event is simulated
5631 (simply generated just before the paint event) and may cause flicker.
5633 To paint a custom background use the `GetDC` method and use the returned
5634 device context if it is not ``None``, otherwise create a temporary
5635 `wx.ClientDC` and draw on that.
5638 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5639 __repr__
= _swig_repr
5640 def __init__(self
, *args
, **kwargs
):
5642 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5646 _core_
.EraseEvent_swiginit(self
,_core_
.new_EraseEvent(*args
, **kwargs
))
5647 def GetDC(*args
, **kwargs
):
5651 Returns the device context the event handler should draw upon. If
5652 ``None`` is returned then create a temporary `wx.ClientDC` and use
5655 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5657 DC
= property(GetDC
,doc
="See `GetDC`")
5658 _core_
.EraseEvent_swigregister(EraseEvent
)
5660 #---------------------------------------------------------------------------
5662 class FocusEvent(Event
):
5664 A focus event is sent when a window's focus changes. The window losing
5665 focus receives an EVT_KILL_FOCUS event while the window gaining it
5666 gets an EVT_SET_FOCUS event.
5668 Notice that the set focus event happens both when the user gives focus
5669 to the window (whether using the mouse or keyboard) and when it is
5670 done from the program itself using `wx.Window.SetFocus`.
5673 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5674 __repr__
= _swig_repr
5675 def __init__(self
, *args
, **kwargs
):
5677 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5681 _core_
.FocusEvent_swiginit(self
,_core_
.new_FocusEvent(*args
, **kwargs
))
5682 def GetWindow(*args
, **kwargs
):
5684 GetWindow(self) -> Window
5686 Returns the other window associated with this event, that is the
5687 window which had the focus before for the EVT_SET_FOCUS event and the
5688 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5690 Warning: the window returned may be None!
5692 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5694 def SetWindow(*args
, **kwargs
):
5695 """SetWindow(self, Window win)"""
5696 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5698 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
5699 _core_
.FocusEvent_swigregister(FocusEvent
)
5701 #---------------------------------------------------------------------------
5703 class ChildFocusEvent(CommandEvent
):
5705 A child focus event is sent to a (parent-)window when one of its child
5706 windows gains focus, so that the window could restore the focus back
5707 to its corresponding child if it loses it now and regains later.
5709 Notice that child window is the direct child of the window receiving
5710 the event, and so may not be the actual widget recieving focus if it
5711 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5712 to get the widget that is actually receiving focus.
5714 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5715 __repr__
= _swig_repr
5716 def __init__(self
, *args
, **kwargs
):
5718 __init__(self, Window win=None) -> ChildFocusEvent
5722 _core_
.ChildFocusEvent_swiginit(self
,_core_
.new_ChildFocusEvent(*args
, **kwargs
))
5723 def GetWindow(*args
, **kwargs
):
5725 GetWindow(self) -> Window
5727 The window, or (grand)parent of the window which has just received the
5730 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5732 Window
= property(GetWindow
,doc
="See `GetWindow`")
5733 _core_
.ChildFocusEvent_swigregister(ChildFocusEvent
)
5735 #---------------------------------------------------------------------------
5737 class ActivateEvent(Event
):
5739 An activate event is sent when a top-level window or the entire
5740 application is being activated or deactivated.
5742 A top-level window (a dialog or frame) receives an activate event when
5743 is being activated or deactivated. This is indicated visually by the
5744 title bar changing colour, and a subwindow gaining the keyboard focus.
5745 An application is activated or deactivated when one of its frames
5746 becomes activated, or a frame becomes inactivate resulting in all
5747 application frames being inactive.
5749 Please note that usually you should call event.Skip() in your handlers
5750 for these events so the default handlers will still be called, as not
5751 doing so can result in strange effects.
5754 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5755 __repr__
= _swig_repr
5756 def __init__(self
, *args
, **kwargs
):
5758 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5762 _core_
.ActivateEvent_swiginit(self
,_core_
.new_ActivateEvent(*args
, **kwargs
))
5763 def GetActive(*args
, **kwargs
):
5765 GetActive(self) -> bool
5767 Returns true if the application or window is being activated, false
5770 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5772 Active
= property(GetActive
,doc
="See `GetActive`")
5773 _core_
.ActivateEvent_swigregister(ActivateEvent
)
5775 #---------------------------------------------------------------------------
5777 class InitDialogEvent(Event
):
5779 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5780 any window when `wx.Window.InitDialog` is called. Handlers for this
5781 event can transfer data to the window, or anything else that should be
5782 done before the user begins editing the form. The default handler
5783 calls `wx.Window.TransferDataToWindow`.
5785 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5786 __repr__
= _swig_repr
5787 def __init__(self
, *args
, **kwargs
):
5789 __init__(self, int Id=0) -> InitDialogEvent
5793 _core_
.InitDialogEvent_swiginit(self
,_core_
.new_InitDialogEvent(*args
, **kwargs
))
5794 _core_
.InitDialogEvent_swigregister(InitDialogEvent
)
5796 #---------------------------------------------------------------------------
5798 class MenuEvent(Event
):
5800 This class is used for a variety of menu-related events. Note that
5801 these do not include menu command events, which are handled by sending
5802 `wx.CommandEvent` objects.
5804 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5805 text in the first field of the status bar.
5807 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5808 __repr__
= _swig_repr
5809 def __init__(self
, *args
, **kwargs
):
5811 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5815 _core_
.MenuEvent_swiginit(self
,_core_
.new_MenuEvent(*args
, **kwargs
))
5816 def GetMenuId(*args
, **kwargs
):
5818 GetMenuId(self) -> int
5820 Returns the menu identifier associated with the event. This method
5821 should be only used with the HIGHLIGHT events.
5823 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5825 def IsPopup(*args
, **kwargs
):
5827 IsPopup(self) -> bool
5829 Returns ``True`` if the menu which is being opened or closed is a
5830 popup menu, ``False`` if it is a normal one. This method should only
5831 be used with the OPEN and CLOSE events.
5833 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5835 def GetMenu(*args
, **kwargs
):
5837 GetMenu(self) -> Menu
5839 Returns the menu which is being opened or closed. This method should
5840 only be used with the OPEN and CLOSE events.
5842 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5844 Menu
= property(GetMenu
,doc
="See `GetMenu`")
5845 MenuId
= property(GetMenuId
,doc
="See `GetMenuId`")
5846 _core_
.MenuEvent_swigregister(MenuEvent
)
5848 #---------------------------------------------------------------------------
5850 class CloseEvent(Event
):
5852 This event class contains information about window and session close
5855 The handler function for EVT_CLOSE is called when the user has tried
5856 to close a a frame or dialog box using the window manager controls or
5857 the system menu. It can also be invoked by the application itself
5858 programmatically, for example by calling the `wx.Window.Close`
5861 You should check whether the application is forcing the deletion of
5862 the window using `CanVeto`. If it returns ``False``, you must destroy
5863 the window using `wx.Window.Destroy`. If the return value is ``True``,
5864 it is up to you whether you respond by destroying the window or not.
5865 For example you may wish to display a message dialog prompting to save
5866 files or to cancel the close.
5868 If you don't destroy the window, you should call `Veto` to let the
5869 calling code know that you did not destroy the window. This allows the
5870 `wx.Window.Close` function to return ``True`` or ``False`` depending
5871 on whether the close instruction was honored or not.
5873 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5874 __repr__
= _swig_repr
5875 def __init__(self
, *args
, **kwargs
):
5877 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5881 _core_
.CloseEvent_swiginit(self
,_core_
.new_CloseEvent(*args
, **kwargs
))
5882 def SetLoggingOff(*args
, **kwargs
):
5884 SetLoggingOff(self, bool logOff)
5886 Sets the 'logging off' flag.
5888 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5890 def GetLoggingOff(*args
, **kwargs
):
5892 GetLoggingOff(self) -> bool
5894 Returns ``True`` if the user is logging off or ``False`` if the
5895 system is shutting down. This method can only be called for end
5896 session and query end session events, it doesn't make sense for close
5899 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5901 def Veto(*args
, **kwargs
):
5903 Veto(self, bool veto=True)
5905 Call this from your event handler to veto a system shutdown or to
5906 signal to the calling application that a window close did not happen.
5908 You can only veto a shutdown or close if `CanVeto` returns true.
5910 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5912 def GetVeto(*args
, **kwargs
):
5913 """GetVeto(self) -> bool"""
5914 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5916 def SetCanVeto(*args
, **kwargs
):
5918 SetCanVeto(self, bool canVeto)
5920 Sets the 'can veto' flag.
5922 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5924 def CanVeto(*args
, **kwargs
):
5926 CanVeto(self) -> bool
5928 Returns true if you can veto a system shutdown or a window close
5929 event. Vetoing a window close event is not possible if the calling
5930 code wishes to force the application to exit, and so this function
5931 must be called to check this.
5933 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5935 LoggingOff
= property(GetLoggingOff
,SetLoggingOff
,doc
="See `GetLoggingOff` and `SetLoggingOff`")
5936 _core_
.CloseEvent_swigregister(CloseEvent
)
5938 #---------------------------------------------------------------------------
5940 class ShowEvent(Event
):
5941 """An EVT_SHOW event is sent when a window is shown or hidden."""
5942 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5943 __repr__
= _swig_repr
5944 def __init__(self
, *args
, **kwargs
):
5946 __init__(self, int winid=0, bool show=False) -> ShowEvent
5948 An EVT_SHOW event is sent when a window is shown or hidden.
5950 _core_
.ShowEvent_swiginit(self
,_core_
.new_ShowEvent(*args
, **kwargs
))
5951 def SetShow(*args
, **kwargs
):
5952 """SetShow(self, bool show)"""
5953 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5955 def GetShow(*args
, **kwargs
):
5956 """GetShow(self) -> bool"""
5957 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5959 Show
= property(GetShow
,SetShow
,doc
="See `GetShow` and `SetShow`")
5960 _core_
.ShowEvent_swigregister(ShowEvent
)
5962 #---------------------------------------------------------------------------
5964 class IconizeEvent(Event
):
5966 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5969 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5970 __repr__
= _swig_repr
5971 def __init__(self
, *args
, **kwargs
):
5973 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5975 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5978 _core_
.IconizeEvent_swiginit(self
,_core_
.new_IconizeEvent(*args
, **kwargs
))
5979 def Iconized(*args
, **kwargs
):
5981 Iconized(self) -> bool
5983 Returns ``True`` if the frame has been iconized, ``False`` if it has
5986 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5988 _core_
.IconizeEvent_swigregister(IconizeEvent
)
5990 #---------------------------------------------------------------------------
5992 class MaximizeEvent(Event
):
5993 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5994 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5995 __repr__
= _swig_repr
5996 def __init__(self
, *args
, **kwargs
):
5998 __init__(self, int id=0) -> MaximizeEvent
6000 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
6002 _core_
.MaximizeEvent_swiginit(self
,_core_
.new_MaximizeEvent(*args
, **kwargs
))
6003 _core_
.MaximizeEvent_swigregister(MaximizeEvent
)
6005 #---------------------------------------------------------------------------
6007 class DropFilesEvent(Event
):
6009 This class is used for drop files events, that is, when files have
6010 been dropped onto the window. This functionality is only available
6011 under Windows. The window must have previously been enabled for
6012 dropping by calling `wx.Window.DragAcceptFiles`.
6014 Important note: this is a separate implementation to the more general
6015 drag and drop implementation using `wx.FileDropTarget`, and etc. This
6016 implementation uses the older, Windows message-based approach of
6019 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
6023 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6024 def __init__(self
): raise AttributeError, "No constructor defined"
6025 __repr__
= _swig_repr
6026 def GetPosition(*args
, **kwargs
):
6028 GetPosition(self) -> Point
6030 Returns the position at which the files were dropped.
6032 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
6034 def GetNumberOfFiles(*args
, **kwargs
):
6036 GetNumberOfFiles(self) -> int
6038 Returns the number of files dropped.
6040 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
6042 def GetFiles(*args
, **kwargs
):
6044 GetFiles(self) -> PyObject
6046 Returns a list of the filenames that were dropped.
6048 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
6050 Files
= property(GetFiles
,doc
="See `GetFiles`")
6051 NumberOfFiles
= property(GetNumberOfFiles
,doc
="See `GetNumberOfFiles`")
6052 Position
= property(GetPosition
,doc
="See `GetPosition`")
6053 _core_
.DropFilesEvent_swigregister(DropFilesEvent
)
6055 #---------------------------------------------------------------------------
6057 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
6058 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
6059 class UpdateUIEvent(CommandEvent
):
6061 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
6062 wxWidgets to give an application the chance to update various user
6065 Without update UI events, an application has to work hard to
6066 check/uncheck, enable/disable, and set the text for elements such as
6067 menu items and toolbar buttons. The code for doing this has to be
6068 mixed up with the code that is invoked when an action is invoked for a
6069 menu item or button.
6071 With update UI events, you define an event handler to look at the
6072 state of the application and change UI elements accordingly. wxWidgets
6073 will call your handler functions in idle time, so you don't have to
6074 worry where to call this code. In addition to being a clearer and more
6075 declarative method, it also means you don't have to worry whether
6076 you're updating a toolbar or menubar identifier. The same handler can
6077 update a menu item and toolbar button, if the ID values are the same.
6079 Instead of directly manipulating the menu or button, you call
6080 functions in the event object, such as `Check`. wxWidgets will
6081 determine whether such a call has been made, and which UI element to
6084 These events will work for popup menus as well as menubars. Just
6085 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6086 any UI events for the window that owns the menu.
6088 If you find that the overhead of UI update processing is affecting
6089 your application, you can do one or both of the following:
6091 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6092 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6093 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6094 receive update events. No other windows will receive update
6097 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6098 value to set the delay between updates. You may need to call
6099 `wx.Window.UpdateWindowUI` at critical points, for example when
6100 a dialog is about to be shown, in case the user sees a slight
6101 delay before windows are updated.
6103 Note that although events are sent in idle time, defining a EVT_IDLE
6104 handler for a window does not affect this because the events are sent
6105 from an internal idle handler.
6107 wxWidgets tries to optimize update events on some platforms. On
6108 Windows and GTK+, events for menubar items are only sent when the menu
6109 is about to be shown, and not in idle time.
6112 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6113 __repr__
= _swig_repr
6114 def __init__(self
, *args
, **kwargs
):
6116 __init__(self, int commandId=0) -> UpdateUIEvent
6120 _core_
.UpdateUIEvent_swiginit(self
,_core_
.new_UpdateUIEvent(*args
, **kwargs
))
6121 def GetChecked(*args
, **kwargs
):
6123 GetChecked(self) -> bool
6125 Returns ``True`` if the UI element should be checked.
6127 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
6129 def GetEnabled(*args
, **kwargs
):
6131 GetEnabled(self) -> bool
6133 Returns ``True`` if the UI element should be enabled.
6135 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
6137 def GetShown(*args
, **kwargs
):
6139 GetShown(self) -> bool
6141 Returns ``True`` if the UI element should be shown.
6143 return _core_
.UpdateUIEvent_GetShown(*args
, **kwargs
)
6145 def GetText(*args
, **kwargs
):
6147 GetText(self) -> String
6149 Returns the text that should be set for the UI element.
6151 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
6153 def GetSetText(*args
, **kwargs
):
6155 GetSetText(self) -> bool
6157 Returns ``True`` if the application has called `SetText`. For
6158 wxWidgets internal use only.
6160 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
6162 def GetSetChecked(*args
, **kwargs
):
6164 GetSetChecked(self) -> bool
6166 Returns ``True`` if the application has called `Check`. For wxWidgets
6169 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
6171 def GetSetEnabled(*args
, **kwargs
):
6173 GetSetEnabled(self) -> bool
6175 Returns ``True`` if the application has called `Enable`. For wxWidgets
6178 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
6180 def GetSetShown(*args
, **kwargs
):
6182 GetSetShown(self) -> bool
6184 Returns ``True`` if the application has called `Show`. For wxWidgets
6187 return _core_
.UpdateUIEvent_GetSetShown(*args
, **kwargs
)
6189 def Check(*args
, **kwargs
):
6191 Check(self, bool check)
6193 Check or uncheck the UI element.
6195 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
6197 def Enable(*args
, **kwargs
):
6199 Enable(self, bool enable)
6201 Enable or disable the UI element.
6203 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
6205 def Show(*args
, **kwargs
):
6207 Show(self, bool show)
6209 Show or hide the UI element.
6211 return _core_
.UpdateUIEvent_Show(*args
, **kwargs
)
6213 def SetText(*args
, **kwargs
):
6215 SetText(self, String text)
6217 Sets the text for this UI element.
6219 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
6221 def SetUpdateInterval(*args
, **kwargs
):
6223 SetUpdateInterval(long updateInterval)
6225 Sets the interval between updates in milliseconds. Set to -1 to
6226 disable updates, or to 0 to update as frequently as possible. The
6229 Use this to reduce the overhead of UI update events if your
6230 application has a lot of windows. If you set the value to -1 or
6231 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6232 at appropriate points in your application, such as when a dialog is
6235 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
6237 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
6238 def GetUpdateInterval(*args
, **kwargs
):
6240 GetUpdateInterval() -> long
6242 Returns the current interval between updates in milliseconds. -1
6243 disables updates, 0 updates as frequently as possible.
6245 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
6247 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
6248 def CanUpdate(*args
, **kwargs
):
6250 CanUpdate(Window win) -> bool
6252 Returns ``True`` if it is appropriate to update (send UI update events
6255 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6256 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6257 events were last sent in idle time, and the update interval, to
6258 determine whether events should be sent to this window now. By default
6259 this will always return true because the update mode is initially
6260 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6261 events will be sent as often as possible. You can reduce the frequency
6262 that events are sent by changing the mode and/or setting an update
6266 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
6268 CanUpdate
= staticmethod(CanUpdate
)
6269 def ResetUpdateTime(*args
, **kwargs
):
6273 Used internally to reset the last-updated time to the current time. It
6274 is assumed that update events are normally sent in idle time, so this
6275 is called at the end of idle processing.
6277 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
6279 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
6280 def SetMode(*args
, **kwargs
):
6284 Specify how wxWidgets will send update events: to all windows, or only
6285 to those which specify that they will process the events.
6287 The mode may be one of the following values:
6289 ============================= ==========================================
6290 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6291 is the default setting.
6292 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6293 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6295 ============================= ==========================================
6298 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
6300 SetMode
= staticmethod(SetMode
)
6301 def GetMode(*args
, **kwargs
):
6305 Returns a value specifying how wxWidgets will send update events: to
6306 all windows, or only to those which specify that they will process the
6309 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
6311 GetMode
= staticmethod(GetMode
)
6312 Checked
= property(GetChecked
,Check
,doc
="See `GetChecked`")
6313 Enabled
= property(GetEnabled
,Enable
,doc
="See `GetEnabled`")
6314 Shown
= property(GetShown
,Show
,doc
="See `GetShown`")
6315 Text
= property(GetText
,SetText
,doc
="See `GetText` and `SetText`")
6316 _core_
.UpdateUIEvent_swigregister(UpdateUIEvent
)
6318 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
6320 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6322 Sets the interval between updates in milliseconds. Set to -1 to
6323 disable updates, or to 0 to update as frequently as possible. The
6326 Use this to reduce the overhead of UI update events if your
6327 application has a lot of windows. If you set the value to -1 or
6328 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6329 at appropriate points in your application, such as when a dialog is
6332 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
6334 def UpdateUIEvent_GetUpdateInterval(*args
):
6336 UpdateUIEvent_GetUpdateInterval() -> long
6338 Returns the current interval between updates in milliseconds. -1
6339 disables updates, 0 updates as frequently as possible.
6341 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
)
6343 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
6345 UpdateUIEvent_CanUpdate(Window win) -> bool
6347 Returns ``True`` if it is appropriate to update (send UI update events
6350 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6351 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6352 events were last sent in idle time, and the update interval, to
6353 determine whether events should be sent to this window now. By default
6354 this will always return true because the update mode is initially
6355 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6356 events will be sent as often as possible. You can reduce the frequency
6357 that events are sent by changing the mode and/or setting an update
6361 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
6363 def UpdateUIEvent_ResetUpdateTime(*args
):
6365 UpdateUIEvent_ResetUpdateTime()
6367 Used internally to reset the last-updated time to the current time. It
6368 is assumed that update events are normally sent in idle time, so this
6369 is called at the end of idle processing.
6371 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
)
6373 def UpdateUIEvent_SetMode(*args
, **kwargs
):
6375 UpdateUIEvent_SetMode(int mode)
6377 Specify how wxWidgets will send update events: to all windows, or only
6378 to those which specify that they will process the events.
6380 The mode may be one of the following values:
6382 ============================= ==========================================
6383 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6384 is the default setting.
6385 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6386 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6388 ============================= ==========================================
6391 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
6393 def UpdateUIEvent_GetMode(*args
):
6395 UpdateUIEvent_GetMode() -> int
6397 Returns a value specifying how wxWidgets will send update events: to
6398 all windows, or only to those which specify that they will process the
6401 return _core_
.UpdateUIEvent_GetMode(*args
)
6403 #---------------------------------------------------------------------------
6405 class SysColourChangedEvent(Event
):
6407 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6408 when the user changes the colour settings using the control
6409 panel. This is only applicable under Windows.
6411 The default event handler for this event propagates the event to child
6412 windows, since Windows only sends the events to top-level windows. If
6413 intercepting this event for a top-level window, remember to call
6414 `Skip` so the the base class handler will still be executed, or to
6415 pass the event on to the window's children explicitly.
6418 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6419 __repr__
= _swig_repr
6420 def __init__(self
, *args
, **kwargs
):
6422 __init__(self) -> SysColourChangedEvent
6426 _core_
.SysColourChangedEvent_swiginit(self
,_core_
.new_SysColourChangedEvent(*args
, **kwargs
))
6427 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEvent
)
6429 #---------------------------------------------------------------------------
6431 class MouseCaptureChangedEvent(Event
):
6433 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6434 a window that loses its mouse capture. This is called even if
6435 `wx.Window.ReleaseMouse` was called by the application code. Handling
6436 this event allows an application to cater for unexpected capture
6437 releases which might otherwise confuse mouse handling code.
6439 This event is implemented under Windows only.
6441 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6442 __repr__
= _swig_repr
6443 def __init__(self
, *args
, **kwargs
):
6445 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6449 _core_
.MouseCaptureChangedEvent_swiginit(self
,_core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
))
6450 def GetCapturedWindow(*args
, **kwargs
):
6452 GetCapturedWindow(self) -> Window
6454 Returns the window that gained the capture, or ``None`` if it was a
6455 non-wxWidgets window.
6457 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
6459 CapturedWindow
= property(GetCapturedWindow
,doc
="See `GetCapturedWindow`")
6460 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent
)
6462 #---------------------------------------------------------------------------
6464 class MouseCaptureLostEvent(Event
):
6466 A mouse capture lost event is sent to a window that obtained mouse
6467 capture, which was subsequently loss due to "external" event, for
6468 example when a dialog box is shown or if another application captures
6471 If this happens, this event is sent to all windows that are on the
6472 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6473 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6474 if the capture changes because of a call to CaptureMouse or
6477 This event is currently emitted under Windows only.
6480 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6481 __repr__
= _swig_repr
6482 def __init__(self
, *args
, **kwargs
):
6484 __init__(self, int winid=0) -> MouseCaptureLostEvent
6486 A mouse capture lost event is sent to a window that obtained mouse
6487 capture, which was subsequently loss due to "external" event, for
6488 example when a dialog box is shown or if another application captures
6491 If this happens, this event is sent to all windows that are on the
6492 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6493 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6494 if the capture changes because of a call to CaptureMouse or
6497 This event is currently emitted under Windows only.
6500 _core_
.MouseCaptureLostEvent_swiginit(self
,_core_
.new_MouseCaptureLostEvent(*args
, **kwargs
))
6501 _core_
.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent
)
6503 #---------------------------------------------------------------------------
6505 class DisplayChangedEvent(Event
):
6507 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6508 resolution has changed.
6510 This event is implemented under Windows only.
6512 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6513 __repr__
= _swig_repr
6514 def __init__(self
, *args
, **kwargs
):
6515 """__init__(self) -> DisplayChangedEvent"""
6516 _core_
.DisplayChangedEvent_swiginit(self
,_core_
.new_DisplayChangedEvent(*args
, **kwargs
))
6517 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEvent
)
6519 #---------------------------------------------------------------------------
6521 class PaletteChangedEvent(Event
):
6523 An EVT_PALETTE_CHANGED event is sent when the system palette has
6524 changed, thereby giving each window a chance to redo their own to
6527 This event is implemented under Windows only.
6529 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6530 __repr__
= _swig_repr
6531 def __init__(self
, *args
, **kwargs
):
6533 __init__(self, int id=0) -> PaletteChangedEvent
6535 An EVT_PALETTE_CHANGED event is sent when the system palette has
6536 changed, thereby giving each window a chance to redo their own to
6539 This event is implemented under Windows only.
6541 _core_
.PaletteChangedEvent_swiginit(self
,_core_
.new_PaletteChangedEvent(*args
, **kwargs
))
6542 def SetChangedWindow(*args
, **kwargs
):
6543 """SetChangedWindow(self, Window win)"""
6544 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
6546 def GetChangedWindow(*args
, **kwargs
):
6547 """GetChangedWindow(self) -> Window"""
6548 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
6550 ChangedWindow
= property(GetChangedWindow
,SetChangedWindow
,doc
="See `GetChangedWindow` and `SetChangedWindow`")
6551 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEvent
)
6553 #---------------------------------------------------------------------------
6555 class QueryNewPaletteEvent(Event
):
6557 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6558 focus and should re-do its palette.
6560 This event is implemented under Windows only.
6562 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6563 __repr__
= _swig_repr
6564 def __init__(self
, *args
, **kwargs
):
6566 __init__(self, int winid=0) -> QueryNewPaletteEvent
6570 _core_
.QueryNewPaletteEvent_swiginit(self
,_core_
.new_QueryNewPaletteEvent(*args
, **kwargs
))
6571 def SetPaletteRealized(*args
, **kwargs
):
6573 SetPaletteRealized(self, bool realized)
6575 App should set this if it changes the palette.
6577 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
6579 def GetPaletteRealized(*args
, **kwargs
):
6580 """GetPaletteRealized(self) -> bool"""
6581 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
6583 PaletteRealized
= property(GetPaletteRealized
,SetPaletteRealized
,doc
="See `GetPaletteRealized` and `SetPaletteRealized`")
6584 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent
)
6586 #---------------------------------------------------------------------------
6588 class NavigationKeyEvent(Event
):
6590 EVT_NAVIGATION_KEY events are used to control moving the focus between
6591 widgets, otherwise known as tab-traversal. You woudl normally not
6592 catch navigation events in applications as there are already
6593 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6594 it useful to send navigation events in certain situations to change
6595 the focus in certain ways, although it's probably easier to just call
6596 `wx.Window.Navigate`.
6598 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6599 __repr__
= _swig_repr
6600 def __init__(self
, *args
, **kwargs
):
6601 """__init__(self) -> NavigationKeyEvent"""
6602 _core_
.NavigationKeyEvent_swiginit(self
,_core_
.new_NavigationKeyEvent(*args
, **kwargs
))
6603 def GetDirection(*args
, **kwargs
):
6605 GetDirection(self) -> bool
6607 Returns ``True`` if the direction is forward, ``False`` otherwise.
6609 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
6611 def SetDirection(*args
, **kwargs
):
6613 SetDirection(self, bool forward)
6615 Specify the direction that the navigation should take. Usually the
6616 difference between using Tab and Shift-Tab.
6618 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
6620 def IsWindowChange(*args
, **kwargs
):
6622 IsWindowChange(self) -> bool
6624 Returns ``True`` if window change is allowed.
6626 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
6628 def SetWindowChange(*args
, **kwargs
):
6630 SetWindowChange(self, bool ischange)
6632 Specify if the navigation should be able to change parent windows.
6633 For example, changing notebook pages, etc. This is usually implemented
6634 by using Control-Tab.
6636 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
6638 def IsFromTab(*args
, **kwargs
):
6640 IsFromTab(self) -> bool
6642 Returns ``True`` if the navigation event is originated from the Tab
6645 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
6647 def SetFromTab(*args
, **kwargs
):
6649 SetFromTab(self, bool bIs)
6651 Set to true under MSW if the event was generated using the tab key.
6652 This is required for proper navogation over radio buttons.
6654 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
6656 def SetFlags(*args
, **kwargs
):
6658 SetFlags(self, long flags)
6660 Set the navigation flags to a combination of the following:
6662 * wx.NavigationKeyEvent.IsBackward
6663 * wx.NavigationKeyEvent.IsForward
6664 * wx.NavigationKeyEvent.WinChange
6665 * wx.NavigationKeyEvent.FromTab
6668 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6670 def GetCurrentFocus(*args
, **kwargs
):
6672 GetCurrentFocus(self) -> Window
6674 Returns the child window which currenty has the focus. May be
6677 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6679 def SetCurrentFocus(*args
, **kwargs
):
6681 SetCurrentFocus(self, Window win)
6683 Set the window that has the focus.
6685 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6687 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6688 IsForward
= _core_
.NavigationKeyEvent_IsForward
6689 WinChange
= _core_
.NavigationKeyEvent_WinChange
6690 FromTab
= _core_
.NavigationKeyEvent_FromTab
6691 CurrentFocus
= property(GetCurrentFocus
,SetCurrentFocus
,doc
="See `GetCurrentFocus` and `SetCurrentFocus`")
6692 Direction
= property(GetDirection
,SetDirection
,doc
="See `GetDirection` and `SetDirection`")
6693 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEvent
)
6695 #---------------------------------------------------------------------------
6697 class WindowCreateEvent(CommandEvent
):
6699 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6700 underlying GUI object) exists.
6702 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6703 __repr__
= _swig_repr
6704 def __init__(self
, *args
, **kwargs
):
6706 __init__(self, Window win=None) -> WindowCreateEvent
6708 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6709 underlying GUI object) exists.
6711 _core_
.WindowCreateEvent_swiginit(self
,_core_
.new_WindowCreateEvent(*args
, **kwargs
))
6712 def GetWindow(*args
, **kwargs
):
6714 GetWindow(self) -> Window
6716 Returns the window that this event refers to.
6718 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6720 Window
= property(GetWindow
,doc
="See `GetWindow`")
6721 _core_
.WindowCreateEvent_swigregister(WindowCreateEvent
)
6723 class WindowDestroyEvent(CommandEvent
):
6725 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6726 when the GUI window is destroyed.
6728 When a class derived from `wx.Window` is destroyed its destructor will
6729 have already run by the time this event is sent. Therefore this event
6730 will not usually be received at all by the window itself. Since it is
6731 received after the destructor has run, an object should not try to
6732 handle its own wx.WindowDestroyEvent, but it can be used to get
6733 notification of the destruction of another window.
6735 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6736 __repr__
= _swig_repr
6737 def __init__(self
, *args
, **kwargs
):
6739 __init__(self, Window win=None) -> WindowDestroyEvent
6741 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6742 when the GUI window is destroyed.
6744 When a class derived from `wx.Window` is destroyed its destructor will
6745 have already run by the time this event is sent. Therefore this event
6746 will not usually be received at all by the window itself. Since it is
6747 received after the destructor has run, an object should not try to
6748 handle its own wx.WindowDestroyEvent, but it can be used to get
6749 notification of the destruction of another window.
6751 _core_
.WindowDestroyEvent_swiginit(self
,_core_
.new_WindowDestroyEvent(*args
, **kwargs
))
6752 def GetWindow(*args
, **kwargs
):
6754 GetWindow(self) -> Window
6756 Returns the window that this event refers to.
6758 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6760 Window
= property(GetWindow
,doc
="See `GetWindow`")
6761 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEvent
)
6763 #---------------------------------------------------------------------------
6765 class ContextMenuEvent(CommandEvent
):
6767 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6768 give the application a chance to show a context (popup) menu.
6770 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6771 __repr__
= _swig_repr
6772 def __init__(self
, *args
, **kwargs
):
6774 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6778 _core_
.ContextMenuEvent_swiginit(self
,_core_
.new_ContextMenuEvent(*args
, **kwargs
))
6779 def GetPosition(*args
, **kwargs
):
6781 GetPosition(self) -> Point
6783 Returns the position (in screen coordinants) at which the menu should
6786 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6788 def SetPosition(*args
, **kwargs
):
6790 SetPosition(self, Point pos)
6792 Sets the position at which the menu should be shown.
6794 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6796 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
6797 _core_
.ContextMenuEvent_swigregister(ContextMenuEvent
)
6799 #---------------------------------------------------------------------------
6801 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6802 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6803 class IdleEvent(Event
):
6805 This class is used for EVT_IDLE events, which are generated and sent
6806 when the application *becomes* idle. In other words, the when the
6807 event queue becomes empty then idle events are sent to all windows (by
6808 default) and as long as none of them call `RequestMore` then there are
6809 no more idle events until after the system event queue has some normal
6810 events and then becomes empty again.
6812 By default, idle events are sent to all windows. If this is causing a
6813 significant overhead in your application, you can call
6814 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6815 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6816 which should receive idle events. Then idle events will only be sent
6817 to those windows and not to any others.
6819 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6820 __repr__
= _swig_repr
6821 def __init__(self
, *args
, **kwargs
):
6823 __init__(self) -> IdleEvent
6827 _core_
.IdleEvent_swiginit(self
,_core_
.new_IdleEvent(*args
, **kwargs
))
6828 def RequestMore(*args
, **kwargs
):
6830 RequestMore(self, bool needMore=True)
6832 Tells wxWidgets that more processing is required. This function can be
6833 called by an EVT_IDLE handler for a window to indicate that the
6834 application should forward the EVT_IDLE event once more to the
6835 application windows. If no window calls this function during its
6836 EVT_IDLE handler, then the application will remain in a passive event
6837 loop until a new event is posted to the application by the windowing
6840 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6842 def MoreRequested(*args
, **kwargs
):
6844 MoreRequested(self) -> bool
6846 Returns ``True`` if the OnIdle function processing this event
6847 requested more processing time.
6849 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6851 def SetMode(*args
, **kwargs
):
6855 Static method for specifying how wxWidgets will send idle events: to
6856 all windows, or only to those which specify that they will process the
6859 The mode can be one of the following values:
6861 ========================= ========================================
6862 wx.IDLE_PROCESS_ALL Send idle events to all windows
6863 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6864 the wx.WS_EX_PROCESS_IDLE extra style
6866 ========================= ========================================
6869 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6871 SetMode
= staticmethod(SetMode
)
6872 def GetMode(*args
, **kwargs
):
6876 Static method returning a value specifying how wxWidgets will send
6877 idle events: to all windows, or only to those which specify that they
6878 will process the events.
6880 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6882 GetMode
= staticmethod(GetMode
)
6883 def CanSend(*args
, **kwargs
):
6885 CanSend(Window win) -> bool
6887 Returns ``True`` if it is appropriate to send idle events to this
6890 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6891 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6892 events should be sent to this window now. By default this will always
6893 return ``True`` because the update mode is initially
6894 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6895 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6897 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6899 CanSend
= staticmethod(CanSend
)
6900 _core_
.IdleEvent_swigregister(IdleEvent
)
6902 def IdleEvent_SetMode(*args
, **kwargs
):
6904 IdleEvent_SetMode(int mode)
6906 Static method for specifying how wxWidgets will send idle events: to
6907 all windows, or only to those which specify that they will process the
6910 The mode can be one of the following values:
6912 ========================= ========================================
6913 wx.IDLE_PROCESS_ALL Send idle events to all windows
6914 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6915 the wx.WS_EX_PROCESS_IDLE extra style
6917 ========================= ========================================
6920 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6922 def IdleEvent_GetMode(*args
):
6924 IdleEvent_GetMode() -> int
6926 Static method returning a value specifying how wxWidgets will send
6927 idle events: to all windows, or only to those which specify that they
6928 will process the events.
6930 return _core_
.IdleEvent_GetMode(*args
)
6932 def IdleEvent_CanSend(*args
, **kwargs
):
6934 IdleEvent_CanSend(Window win) -> bool
6936 Returns ``True`` if it is appropriate to send idle events to this
6939 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6940 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6941 events should be sent to this window now. By default this will always
6942 return ``True`` because the update mode is initially
6943 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6944 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6946 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6948 #---------------------------------------------------------------------------
6950 class ClipboardTextEvent(CommandEvent
):
6952 A Clipboard Text event is sent when a window intercepts a text
6953 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6954 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6955 popup menu command, etc. NOTE : under windows these events are *NOT*
6956 generated automatically for a Rich Edit text control.
6958 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6959 __repr__
= _swig_repr
6960 def __init__(self
, *args
, **kwargs
):
6962 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6964 A Clipboard Text event is sent when a window intercepts a text
6965 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6966 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6967 popup menu command, etc. NOTE : under windows these events are *NOT*
6968 generated automatically for a Rich Edit text control.
6970 _core_
.ClipboardTextEvent_swiginit(self
,_core_
.new_ClipboardTextEvent(*args
, **kwargs
))
6971 _core_
.ClipboardTextEvent_swigregister(ClipboardTextEvent
)
6973 #---------------------------------------------------------------------------
6975 class PyEvent(Event
):
6977 wx.PyEvent can be used as a base class for implementing custom event
6978 types in Python. You should derived from this class instead of
6979 `wx.Event` because this class is Python-aware and is able to transport
6980 its Python bits safely through the wxWidgets event system and have
6981 them still be there when the event handler is invoked.
6983 :see: `wx.PyCommandEvent`
6986 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6987 __repr__
= _swig_repr
6988 def __init__(self
, *args
, **kwargs
):
6989 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6990 _core_
.PyEvent_swiginit(self
,_core_
.new_PyEvent(*args
, **kwargs
))
6993 __swig_destroy__
= _core_
.delete_PyEvent
6994 __del__
= lambda self
: None;
6995 def _SetSelf(*args
, **kwargs
):
6996 """_SetSelf(self, PyObject self)"""
6997 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6999 def _GetSelf(*args
, **kwargs
):
7000 """_GetSelf(self) -> PyObject"""
7001 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
7003 _core_
.PyEvent_swigregister(PyEvent
)
7005 class PyCommandEvent(CommandEvent
):
7007 wx.PyCommandEvent can be used as a base class for implementing custom
7008 event types in Python, where the event shoudl travel up to parent
7009 windows looking for a handler. You should derived from this class
7010 instead of `wx.CommandEvent` because this class is Python-aware and is
7011 able to transport its Python bits safely through the wxWidgets event
7012 system and have them still be there when the event handler is invoked.
7017 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7018 __repr__
= _swig_repr
7019 def __init__(self
, *args
, **kwargs
):
7020 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
7021 _core_
.PyCommandEvent_swiginit(self
,_core_
.new_PyCommandEvent(*args
, **kwargs
))
7024 __swig_destroy__
= _core_
.delete_PyCommandEvent
7025 __del__
= lambda self
: None;
7026 def _SetSelf(*args
, **kwargs
):
7027 """_SetSelf(self, PyObject self)"""
7028 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
7030 def _GetSelf(*args
, **kwargs
):
7031 """_GetSelf(self) -> PyObject"""
7032 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
7034 _core_
.PyCommandEvent_swigregister(PyCommandEvent
)
7036 class DateEvent(CommandEvent
):
7038 This event class holds information about a date change event and is
7039 used together with `wx.DatePickerCtrl`. It also serves as a base class
7040 for `wx.calendar.CalendarEvent`. Bind these event types with
7043 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7044 __repr__
= _swig_repr
7045 def __init__(self
, *args
, **kwargs
):
7046 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
7047 _core_
.DateEvent_swiginit(self
,_core_
.new_DateEvent(*args
, **kwargs
))
7048 def GetDate(*args
, **kwargs
):
7050 GetDate(self) -> DateTime
7054 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
7056 def SetDate(*args
, **kwargs
):
7058 SetDate(self, DateTime date)
7060 Sets the date carried by the event, normally only used by the library
7063 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
7065 Date
= property(GetDate
,SetDate
,doc
="See `GetDate` and `SetDate`")
7066 _core_
.DateEvent_swigregister(DateEvent
)
7068 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
7069 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
7071 class EventBlocker(EvtHandler
):
7072 """Helper class to temporarily disable event handling for a window."""
7073 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7074 __repr__
= _swig_repr
7075 def __init__(self
, *args
, **kwargs
):
7077 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7079 Helper class to temporarily disable event handling for a window.
7081 _core_
.EventBlocker_swiginit(self
,_core_
.new_EventBlocker(*args
, **kwargs
))
7082 __swig_destroy__
= _core_
.delete_EventBlocker
7083 __del__
= lambda self
: None;
7084 def Block(*args
, **kwargs
):
7085 """Block(self, EventType type)"""
7086 return _core_
.EventBlocker_Block(*args
, **kwargs
)
7088 _core_
.EventBlocker_swigregister(EventBlocker
)
7090 #---------------------------------------------------------------------------
7092 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
7093 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
7094 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
7095 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
7096 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
7097 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
7098 class PyApp(EvtHandler
):
7100 The ``wx.PyApp`` class is an *implementation detail*, please use the
7101 `wx.App` class (or some other derived class) instead.
7103 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7104 __repr__
= _swig_repr
7105 def __init__(self
, *args
, **kwargs
):
7107 __init__(self) -> PyApp
7109 Create a new application object, starting the bootstrap process.
7111 _core_
.PyApp_swiginit(self
,_core_
.new_PyApp(*args
, **kwargs
))
7112 self
._setOORInfo
(self
, False);PyApp
._setCallbackInfo
(self
, self
, PyApp
)
7114 __swig_destroy__
= _core_
.delete_PyApp
7115 __del__
= lambda self
: None;
7116 def _setCallbackInfo(*args
, **kwargs
):
7117 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
7118 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
7120 def GetAppName(*args
, **kwargs
):
7122 GetAppName(self) -> String
7124 Get the application name.
7126 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
7128 def SetAppName(*args
, **kwargs
):
7130 SetAppName(self, String name)
7132 Set the application name. This value may be used automatically by
7133 `wx.Config` and such.
7135 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
7137 def GetClassName(*args
, **kwargs
):
7139 GetClassName(self) -> String
7141 Get the application's class name.
7143 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
7145 def SetClassName(*args
, **kwargs
):
7147 SetClassName(self, String name)
7149 Set the application's class name. This value may be used for
7150 X-resources if applicable for the platform
7152 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
7154 def GetVendorName(*args
, **kwargs
):
7156 GetVendorName(self) -> String
7158 Get the application's vendor name.
7160 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
7162 def SetVendorName(*args
, **kwargs
):
7164 SetVendorName(self, String name)
7166 Set the application's vendor name. This value may be used
7167 automatically by `wx.Config` and such.
7169 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
7171 def GetTraits(*args
, **kwargs
):
7173 GetTraits(self) -> wxAppTraits
7175 Return (and create if necessary) the app traits object to which we
7176 delegate for everything which either should be configurable by the
7177 user (then he can change the default behaviour simply by overriding
7178 CreateTraits() and returning his own traits object) or which is
7179 GUI/console dependent as then wx.AppTraits allows us to abstract the
7180 differences behind the common facade.
7182 :todo: Add support for overriding CreateAppTraits in wxPython.
7184 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
7186 def ProcessPendingEvents(*args
, **kwargs
):
7188 ProcessPendingEvents(self)
7190 Process all events in the Pending Events list -- it is necessary to
7191 call this function to process posted events. This normally happens
7192 during each event loop iteration.
7194 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
7196 def Yield(*args
, **kwargs
):
7198 Yield(self, bool onlyIfNeeded=False) -> bool
7200 Process all currently pending events right now, instead of waiting
7201 until return to the event loop. It is an error to call ``Yield``
7202 recursively unless the value of ``onlyIfNeeded`` is True.
7204 :warning: This function is dangerous as it can lead to unexpected
7205 reentrancies (i.e. when called from an event handler it may
7206 result in calling the same event handler again), use with
7207 extreme care or, better, don't use at all!
7209 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
7212 return _core_
.PyApp_Yield(*args
, **kwargs
)
7214 def WakeUpIdle(*args
, **kwargs
):
7218 Make sure that idle events are sent again.
7219 :see: `wx.WakeUpIdle`
7221 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
7223 def IsMainLoopRunning(*args
, **kwargs
):
7225 IsMainLoopRunning() -> bool
7227 Returns True if we're running the main loop, i.e. if the events can
7228 currently be dispatched.
7230 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
7232 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
7233 def MainLoop(*args
, **kwargs
):
7235 MainLoop(self) -> int
7237 Execute the main GUI loop, the function doesn't normally return until
7238 all top level windows have been closed and destroyed.
7240 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
7242 def Exit(*args
, **kwargs
):
7246 Exit the main loop thus terminating the application.
7249 return _core_
.PyApp_Exit(*args
, **kwargs
)
7251 def GetLayoutDirection(*args
, **kwargs
):
7253 GetLayoutDirection(self) -> int
7255 Return the layout direction for the current locale.
7257 return _core_
.PyApp_GetLayoutDirection(*args
, **kwargs
)
7259 def ExitMainLoop(*args
, **kwargs
):
7263 Exit the main GUI loop during the next iteration of the main
7264 loop, (i.e. it does not stop the program immediately!)
7266 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
7268 def Pending(*args
, **kwargs
):
7270 Pending(self) -> bool
7272 Returns True if there are unprocessed events in the event queue.
7274 return _core_
.PyApp_Pending(*args
, **kwargs
)
7276 def Dispatch(*args
, **kwargs
):
7278 Dispatch(self) -> bool
7280 Process the first event in the event queue (blocks until an event
7281 appears if there are none currently)
7283 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
7285 def ProcessIdle(*args
, **kwargs
):
7287 ProcessIdle(self) -> bool
7289 Called from the MainLoop when the application becomes idle (there are
7290 no pending events) and sends a `wx.IdleEvent` to all interested
7291 parties. Returns True if more idle events are needed, False if not.
7293 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
7295 def SendIdleEvents(*args
, **kwargs
):
7297 SendIdleEvents(self, Window win, IdleEvent event) -> bool
7299 Send idle event to window and all subwindows. Returns True if more
7300 idle time is requested.
7302 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
7304 def IsActive(*args
, **kwargs
):
7306 IsActive(self) -> bool
7308 Return True if our app has focus.
7310 return _core_
.PyApp_IsActive(*args
, **kwargs
)
7312 def SetTopWindow(*args
, **kwargs
):
7314 SetTopWindow(self, Window win)
7316 Set the *main* top level window
7318 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
7320 def GetTopWindow(*args
, **kwargs
):
7322 GetTopWindow(self) -> Window
7324 Return the *main* top level window (if it hadn't been set previously
7325 with SetTopWindow(), will return just some top level window and, if
7326 there not any, will return None)
7328 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
7330 def SetExitOnFrameDelete(*args
, **kwargs
):
7332 SetExitOnFrameDelete(self, bool flag)
7334 Control the exit behaviour: by default, the program will exit the main
7335 loop (and so, usually, terminate) when the last top-level program
7336 window is deleted. Beware that if you disable this behaviour (with
7337 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7338 explicitly from somewhere.
7340 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
7342 def GetExitOnFrameDelete(*args
, **kwargs
):
7344 GetExitOnFrameDelete(self) -> bool
7346 Get the current exit behaviour setting.
7348 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
7350 def SetUseBestVisual(*args
, **kwargs
):
7352 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
7354 Set whether the app should try to use the best available visual on
7355 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
7357 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
7359 def GetUseBestVisual(*args
, **kwargs
):
7361 GetUseBestVisual(self) -> bool
7363 Get current UseBestVisual setting.
7365 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
7367 def SetPrintMode(*args
, **kwargs
):
7368 """SetPrintMode(self, int mode)"""
7369 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
7371 def GetPrintMode(*args
, **kwargs
):
7372 """GetPrintMode(self) -> int"""
7373 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
7375 def SetAssertMode(*args
, **kwargs
):
7377 SetAssertMode(self, int mode)
7379 Set the OnAssert behaviour for debug and hybrid builds.
7381 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
7383 def GetAssertMode(*args
, **kwargs
):
7385 GetAssertMode(self) -> int
7387 Get the current OnAssert behaviour setting.
7389 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
7391 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7392 """GetMacSupportPCMenuShortcuts() -> bool"""
7393 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7395 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
7396 def GetMacAboutMenuItemId(*args
, **kwargs
):
7397 """GetMacAboutMenuItemId() -> long"""
7398 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
7400 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
7401 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
7402 """GetMacPreferencesMenuItemId() -> long"""
7403 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
7405 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
7406 def GetMacExitMenuItemId(*args
, **kwargs
):
7407 """GetMacExitMenuItemId() -> long"""
7408 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
7410 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
7411 def GetMacHelpMenuTitleName(*args
, **kwargs
):
7412 """GetMacHelpMenuTitleName() -> String"""
7413 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
7415 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
7416 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7417 """SetMacSupportPCMenuShortcuts(bool val)"""
7418 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7420 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
7421 def SetMacAboutMenuItemId(*args
, **kwargs
):
7422 """SetMacAboutMenuItemId(long val)"""
7423 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7425 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
7426 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
7427 """SetMacPreferencesMenuItemId(long val)"""
7428 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7430 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
7431 def SetMacExitMenuItemId(*args
, **kwargs
):
7432 """SetMacExitMenuItemId(long val)"""
7433 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7435 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
7436 def SetMacHelpMenuTitleName(*args
, **kwargs
):
7437 """SetMacHelpMenuTitleName(String val)"""
7438 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7440 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
7441 def _BootstrapApp(*args
, **kwargs
):
7445 For internal use only
7447 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
7449 def GetComCtl32Version(*args
, **kwargs
):
7451 GetComCtl32Version() -> int
7453 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7454 it wasn't found at all. Raises an exception on non-Windows platforms.
7456 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
7458 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
7459 def IsDisplayAvailable(*args
, **kwargs
):
7461 IsDisplayAvailable() -> bool
7463 Tests if it is possible to create a GUI in the current environment.
7464 This will mean different things on the different platforms.
7466 * On X Windows systems this function will return ``False`` if it is
7467 not able to open a connection to the X display, which can happen
7468 if $DISPLAY is not set, or is not set correctly.
7470 * On Mac OS X a ``False`` return value will mean that wx is not
7471 able to access the window manager, which can happen if logged in
7472 remotely or if running from the normal version of python instead
7473 of the framework version, (i.e., pythonw.)
7478 return _core_
.PyApp_IsDisplayAvailable(*args
, **kwargs
)
7480 IsDisplayAvailable
= staticmethod(IsDisplayAvailable
)
7481 AppName
= property(GetAppName
,SetAppName
,doc
="See `GetAppName` and `SetAppName`")
7482 AssertMode
= property(GetAssertMode
,SetAssertMode
,doc
="See `GetAssertMode` and `SetAssertMode`")
7483 ClassName
= property(GetClassName
,SetClassName
,doc
="See `GetClassName` and `SetClassName`")
7484 ExitOnFrameDelete
= property(GetExitOnFrameDelete
,SetExitOnFrameDelete
,doc
="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7485 LayoutDirection
= property(GetLayoutDirection
,doc
="See `GetLayoutDirection`")
7486 PrintMode
= property(GetPrintMode
,SetPrintMode
,doc
="See `GetPrintMode` and `SetPrintMode`")
7487 TopWindow
= property(GetTopWindow
,SetTopWindow
,doc
="See `GetTopWindow` and `SetTopWindow`")
7488 Traits
= property(GetTraits
,doc
="See `GetTraits`")
7489 UseBestVisual
= property(GetUseBestVisual
,SetUseBestVisual
,doc
="See `GetUseBestVisual` and `SetUseBestVisual`")
7490 VendorName
= property(GetVendorName
,SetVendorName
,doc
="See `GetVendorName` and `SetVendorName`")
7491 Active
= property(IsActive
)
7492 _core_
.PyApp_swigregister(PyApp
)
7494 def PyApp_IsMainLoopRunning(*args
):
7496 PyApp_IsMainLoopRunning() -> bool
7498 Returns True if we're running the main loop, i.e. if the events can
7499 currently be dispatched.
7501 return _core_
.PyApp_IsMainLoopRunning(*args
)
7503 def PyApp_GetMacSupportPCMenuShortcuts(*args
):
7504 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7505 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
)
7507 def PyApp_GetMacAboutMenuItemId(*args
):
7508 """PyApp_GetMacAboutMenuItemId() -> long"""
7509 return _core_
.PyApp_GetMacAboutMenuItemId(*args
)
7511 def PyApp_GetMacPreferencesMenuItemId(*args
):
7512 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7513 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
)
7515 def PyApp_GetMacExitMenuItemId(*args
):
7516 """PyApp_GetMacExitMenuItemId() -> long"""
7517 return _core_
.PyApp_GetMacExitMenuItemId(*args
)
7519 def PyApp_GetMacHelpMenuTitleName(*args
):
7520 """PyApp_GetMacHelpMenuTitleName() -> String"""
7521 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
)
7523 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7524 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7525 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7527 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
7528 """PyApp_SetMacAboutMenuItemId(long val)"""
7529 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7531 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
7532 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7533 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7535 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
7536 """PyApp_SetMacExitMenuItemId(long val)"""
7537 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7539 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
7540 """PyApp_SetMacHelpMenuTitleName(String val)"""
7541 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7543 def PyApp_GetComCtl32Version(*args
):
7545 PyApp_GetComCtl32Version() -> int
7547 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7548 it wasn't found at all. Raises an exception on non-Windows platforms.
7550 return _core_
.PyApp_GetComCtl32Version(*args
)
7552 def PyApp_IsDisplayAvailable(*args
):
7554 PyApp_IsDisplayAvailable() -> bool
7556 Tests if it is possible to create a GUI in the current environment.
7557 This will mean different things on the different platforms.
7559 * On X Windows systems this function will return ``False`` if it is
7560 not able to open a connection to the X display, which can happen
7561 if $DISPLAY is not set, or is not set correctly.
7563 * On Mac OS X a ``False`` return value will mean that wx is not
7564 able to access the window manager, which can happen if logged in
7565 remotely or if running from the normal version of python instead
7566 of the framework version, (i.e., pythonw.)
7571 return _core_
.PyApp_IsDisplayAvailable(*args
)
7573 #---------------------------------------------------------------------------
7580 Force an exit of the application. Convenience for wx.GetApp().Exit()
7582 return _core_
.Exit(*args
)
7588 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7590 return _core_
.Yield(*args
)
7592 def YieldIfNeeded(*args
):
7594 YieldIfNeeded() -> bool
7596 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7598 return _core_
.YieldIfNeeded(*args
)
7600 def SafeYield(*args
, **kwargs
):
7602 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7604 This function is similar to `wx.Yield`, except that it disables the
7605 user input to all program windows before calling `wx.Yield` and
7606 re-enables it again afterwards. If ``win`` is not None, this window
7607 will remain enabled, allowing the implementation of some limited user
7610 :Returns: the result of the call to `wx.Yield`.
7612 return _core_
.SafeYield(*args
, **kwargs
)
7614 def WakeUpIdle(*args
):
7618 Cause the message queue to become empty again, so idle events will be
7621 return _core_
.WakeUpIdle(*args
)
7623 def PostEvent(*args
, **kwargs
):
7625 PostEvent(EvtHandler dest, Event event)
7627 Send an event to a window or other wx.EvtHandler to be processed
7630 return _core_
.PostEvent(*args
, **kwargs
)
7632 def App_CleanUp(*args
):
7636 For internal use only, it is used to cleanup after wxWidgets when
7639 return _core_
.App_CleanUp(*args
)
7645 Return a reference to the current wx.App object.
7647 return _core_
.GetApp(*args
)
7649 def SetDefaultPyEncoding(*args
, **kwargs
):
7651 SetDefaultPyEncoding(string encoding)
7653 Sets the encoding that wxPython will use when it needs to convert a
7654 Python string or unicode object to or from a wxString.
7656 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7657 but please be aware that the default encoding within the same locale
7658 may be slightly different on different platforms. For example, please
7659 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7660 between the common latin/roman encodings.
7662 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
7664 def GetDefaultPyEncoding(*args
):
7666 GetDefaultPyEncoding() -> string
7668 Gets the current encoding that wxPython will use when it needs to
7669 convert a Python string or unicode object to or from a wxString.
7671 return _core_
.GetDefaultPyEncoding(*args
)
7672 #----------------------------------------------------------------------
7674 class PyOnDemandOutputWindow
:
7676 A class that can be used for redirecting Python's stdout and
7677 stderr streams. It will do nothing until something is wrriten to
7678 the stream at which point it will create a Frame with a text area
7679 and write the text there.
7681 def __init__(self
, title
= "wxPython: stdout/stderr"):
7684 self
.pos
= wx
.DefaultPosition
7685 self
.size
= (450, 300)
7688 def SetParent(self
, parent
):
7689 """Set the window to be used as the popup Frame's parent."""
7690 self
.parent
= parent
7693 def CreateOutputWindow(self
, st
):
7694 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
7695 style
=wx
.DEFAULT_FRAME_STYLE
)
7696 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
7697 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
7698 self
.text
.AppendText(st
)
7699 self
.frame
.Show(True)
7700 self
.frame
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
7703 def OnCloseWindow(self
, event
):
7704 if self
.frame
is not None:
7705 self
.frame
.Destroy()
7710 # These methods provide the file-like output behaviour.
7711 def write(self
, text
):
7713 Create the output window if needed and write the string to it.
7714 If not called in the context of the gui thread then uses
7715 CallAfter to do the work there.
7717 if self
.frame
is None:
7718 if not wx
.Thread_IsMain():
7719 wx
.CallAfter(self
.CreateOutputWindow
, text
)
7721 self
.CreateOutputWindow(text
)
7723 if not wx
.Thread_IsMain():
7724 wx
.CallAfter(self
.text
.AppendText
, text
)
7726 self
.text
.AppendText(text
)
7730 if self
.frame
is not None:
7731 wx
.CallAfter(self
.frame
.Close
)
7739 #----------------------------------------------------------------------
7741 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
7743 class App(wx
.PyApp
):
7745 The ``wx.App`` class represents the application and is used to:
7747 * bootstrap the wxPython system and initialize the underlying
7749 * set and get application-wide properties
7750 * implement the windowing system main message or event loop,
7751 and to dispatch events to window instances
7754 Every application must have a ``wx.App`` instance, and all
7755 creation of UI objects should be delayed until after the
7756 ``wx.App`` object has been created in order to ensure that the gui
7757 platform and wxWidgets have been fully initialized.
7759 Normally you would derive from this class and implement an
7760 ``OnInit`` method that creates a frame and then calls
7761 ``self.SetTopWindow(frame)``.
7763 :see: `wx.PySimpleApp` for a simpler app class that can be used
7767 outputWindowClass
= PyOnDemandOutputWindow
7769 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7770 useBestVisual
=False, clearSigInt
=True):
7772 Construct a ``wx.App`` object.
7774 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7775 redirected? Defaults to True on Windows and Mac, False
7776 otherwise. If `filename` is None then output will be
7777 redirected to a window that pops up as needed. (You can
7778 control what kind of window is created for the output by
7779 resetting the class variable ``outputWindowClass`` to a
7780 class of your choosing.)
7782 :param filename: The name of a file to redirect output to, if
7785 :param useBestVisual: Should the app try to use the best
7786 available visual provided by the system (only relevant on
7787 systems that have more than one visual.) This parameter
7788 must be used instead of calling `SetUseBestVisual` later
7789 on because it must be set before the underlying GUI
7790 toolkit is initialized.
7792 :param clearSigInt: Should SIGINT be cleared? This allows the
7793 app to terminate upon a Ctrl-C in the console like other
7796 :note: You should override OnInit to do applicaition
7797 initialization to ensure that the system, toolkit and
7798 wxWidgets are fully initialized.
7801 wx
.PyApp
.__init
__(self
)
7803 # make sure we can create a GUI
7804 if not self
.IsDisplayAvailable():
7806 if wx
.Platform
== "__WXMAC__":
7807 msg
= """This program needs access to the screen.
7808 Please run with 'pythonw', not 'python', and only when you are logged
7809 in on the main display of your Mac."""
7811 elif wx
.Platform
== "__WXGTK__":
7812 msg
="Unable to access the X Display, is $DISPLAY set properly?"
7815 msg
= "Unable to create GUI"
7816 # TODO: more description is needed for wxMSW...
7818 raise SystemExit(msg
)
7820 # This has to be done before OnInit
7821 self
.SetUseBestVisual(useBestVisual
)
7823 # Set the default handler for SIGINT. This fixes a problem
7824 # where if Ctrl-C is pressed in the console that started this
7825 # app then it will not appear to do anything, (not even send
7826 # KeyboardInterrupt???) but will later segfault on exit. By
7827 # setting the default handler then the app will exit, as
7828 # expected (depending on platform.)
7832 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7836 # Save and redirect the stdio to a window?
7837 self
.stdioWin
= None
7838 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7840 self
.RedirectStdio(filename
)
7842 # Use Python's install prefix as the default
7843 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7845 # Until the new native control for wxMac is up to par, still use the generic one.
7846 wx
.SystemOptions
.SetOptionInt("mac.listctrl.always_use_generic", 1)
7848 # This finishes the initialization of wxWindows and then calls
7849 # the OnInit that should be present in the derived class
7850 self
._BootstrapApp
()
7853 def OnPreInit(self
):
7855 Things that must be done after _BootstrapApp has done its
7856 thing, but would be nice if they were already done by the time
7857 that OnInit is called.
7859 wx
.StockGDI
._initStockObjects
()
7862 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7863 self
.RestoreStdio() # Just in case the MainLoop was overridden
7867 self
.this
.own(False)
7868 wx
.PyApp
.Destroy(self
)
7870 def SetTopWindow(self
, frame
):
7871 """Set the \"main\" top level window"""
7873 self
.stdioWin
.SetParent(frame
)
7874 wx
.PyApp
.SetTopWindow(self
, frame
)
7878 """Execute the main GUI event loop"""
7879 wx
.PyApp
.MainLoop(self
)
7883 def RedirectStdio(self
, filename
=None):
7884 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7886 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7888 self
.stdioWin
= self
.outputWindowClass()
7889 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7892 def RestoreStdio(self
):
7894 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7899 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7901 Set the title, position and/or size of the output window if
7902 the stdio has been redirected. This should be called before
7903 any output would cause the output window to be created.
7906 if title
is not None:
7907 self
.stdioWin
.title
= title
7909 self
.stdioWin
.pos
= pos
7910 if size
is not None:
7911 self
.stdioWin
.size
= size
7916 # change from wx.PyApp_XX to wx.App_XX
7917 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7918 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7919 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7920 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7921 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7922 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7923 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7924 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7925 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7926 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7927 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7929 #----------------------------------------------------------------------------
7931 class PySimpleApp(wx
.App
):
7933 A simple application class. You can just create one of these and
7934 then then make your top level windows later, and not have to worry
7935 about OnInit. For example::
7937 app = wx.PySimpleApp()
7938 frame = wx.Frame(None, title='Hello World')
7945 def __init__(self
, redirect
=False, filename
=None,
7946 useBestVisual
=False, clearSigInt
=True):
7948 :see: `wx.App.__init__`
7950 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7957 # Is anybody using this one?
7958 class PyWidgetTester(wx
.App
):
7959 def __init__(self
, size
= (250, 100)):
7961 wx
.App
.__init
__(self
, 0)
7964 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7965 self
.SetTopWindow(self
.frame
)
7968 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7969 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7970 self
.frame
.Show(True)
7972 #----------------------------------------------------------------------------
7973 # DO NOT hold any other references to this object. This is how we
7974 # know when to cleanup system resources that wxWidgets is holding. When
7975 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7976 # goes to zero and it calls the wx.App_CleanUp function.
7978 class __wxPyCleanup
:
7980 self
.cleanup
= _core_
.App_CleanUp
7984 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7986 ## # another possible solution, but it gets called too early...
7988 ## atexit.register(_core_.wxApp_CleanUp)
7991 #----------------------------------------------------------------------------
7993 #---------------------------------------------------------------------------
7995 class EventLoop(object):
7996 """Proxy of C++ EventLoop class"""
7997 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7998 __repr__
= _swig_repr
7999 def __init__(self
, *args
, **kwargs
):
8000 """__init__(self) -> EventLoop"""
8001 _core_
.EventLoop_swiginit(self
,_core_
.new_EventLoop(*args
, **kwargs
))
8002 __swig_destroy__
= _core_
.delete_EventLoop
8003 __del__
= lambda self
: None;
8004 def Run(*args
, **kwargs
):
8005 """Run(self) -> int"""
8006 return _core_
.EventLoop_Run(*args
, **kwargs
)
8008 def Exit(*args
, **kwargs
):
8009 """Exit(self, int rc=0)"""
8010 return _core_
.EventLoop_Exit(*args
, **kwargs
)
8012 def Pending(*args
, **kwargs
):
8013 """Pending(self) -> bool"""
8014 return _core_
.EventLoop_Pending(*args
, **kwargs
)
8016 def Dispatch(*args
, **kwargs
):
8017 """Dispatch(self) -> bool"""
8018 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
8020 def IsRunning(*args
, **kwargs
):
8021 """IsRunning(self) -> bool"""
8022 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
8024 def GetActive(*args
, **kwargs
):
8025 """GetActive() -> EventLoop"""
8026 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
8028 GetActive
= staticmethod(GetActive
)
8029 def SetActive(*args
, **kwargs
):
8030 """SetActive(EventLoop loop)"""
8031 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
8033 SetActive
= staticmethod(SetActive
)
8034 _core_
.EventLoop_swigregister(EventLoop
)
8036 def EventLoop_GetActive(*args
):
8037 """EventLoop_GetActive() -> EventLoop"""
8038 return _core_
.EventLoop_GetActive(*args
)
8040 def EventLoop_SetActive(*args
, **kwargs
):
8041 """EventLoop_SetActive(EventLoop loop)"""
8042 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
8044 class EventLoopActivator(object):
8045 """Proxy of C++ EventLoopActivator class"""
8046 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8047 __repr__
= _swig_repr
8048 def __init__(self
, *args
, **kwargs
):
8049 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
8050 _core_
.EventLoopActivator_swiginit(self
,_core_
.new_EventLoopActivator(*args
, **kwargs
))
8051 __swig_destroy__
= _core_
.delete_EventLoopActivator
8052 __del__
= lambda self
: None;
8053 _core_
.EventLoopActivator_swigregister(EventLoopActivator
)
8055 #---------------------------------------------------------------------------
8057 ACCEL_ALT
= _core_
.ACCEL_ALT
8058 ACCEL_CTRL
= _core_
.ACCEL_CTRL
8059 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
8060 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
8061 ACCEL_CMD
= _core_
.ACCEL_CMD
8062 class AcceleratorEntry(object):
8064 A class used to define items in an `wx.AcceleratorTable`. wxPython
8065 programs can choose to use wx.AcceleratorEntry objects, but using a
8066 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
8067 as well. See `__init__` for of the tuple values.
8069 :see: `wx.AcceleratorTable`
8071 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8072 __repr__
= _swig_repr
8073 def __init__(self
, *args
, **kwargs
):
8075 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
8077 Construct a wx.AcceleratorEntry.
8079 _core_
.AcceleratorEntry_swiginit(self
,_core_
.new_AcceleratorEntry(*args
, **kwargs
))
8080 __swig_destroy__
= _core_
.delete_AcceleratorEntry
8081 __del__
= lambda self
: None;
8082 def Set(*args
, **kwargs
):
8084 Set(self, int flags, int keyCode, int cmd)
8086 (Re)set the attributes of a wx.AcceleratorEntry.
8089 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
8091 def Create(*args
, **kwargs
):
8093 Create(String str) -> AcceleratorEntry
8095 Create accelerator corresponding to the specified string, or None if
8096 it coulnd't be parsed.
8098 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
8100 Create
= staticmethod(Create
)
8101 def GetFlags(*args
, **kwargs
):
8103 GetFlags(self) -> int
8105 Get the AcceleratorEntry's flags.
8107 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
8109 def GetKeyCode(*args
, **kwargs
):
8111 GetKeyCode(self) -> int
8113 Get the AcceleratorEntry's keycode.
8115 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
8117 def GetCommand(*args
, **kwargs
):
8119 GetCommand(self) -> int
8121 Get the AcceleratorEntry's command ID.
8123 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
8125 def IsOk(*args
, **kwargs
):
8126 """IsOk(self) -> bool"""
8127 return _core_
.AcceleratorEntry_IsOk(*args
, **kwargs
)
8129 def ToString(*args
, **kwargs
):
8131 ToString(self) -> String
8133 Returns a string representation for the this accelerator. The string
8134 is formatted using the <flags>-<keycode> format where <flags> maybe a
8135 hyphen-separed list of "shift|alt|ctrl"
8138 return _core_
.AcceleratorEntry_ToString(*args
, **kwargs
)
8140 def FromString(*args
, **kwargs
):
8142 FromString(self, String str) -> bool
8144 Returns true if the given string correctly initialized this object.
8146 return _core_
.AcceleratorEntry_FromString(*args
, **kwargs
)
8148 Command
= property(GetCommand
,doc
="See `GetCommand`")
8149 Flags
= property(GetFlags
,doc
="See `GetFlags`")
8150 KeyCode
= property(GetKeyCode
,doc
="See `GetKeyCode`")
8151 _core_
.AcceleratorEntry_swigregister(AcceleratorEntry
)
8153 def AcceleratorEntry_Create(*args
, **kwargs
):
8155 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8157 Create accelerator corresponding to the specified string, or None if
8158 it coulnd't be parsed.
8160 return _core_
.AcceleratorEntry_Create(*args
, **kwargs
)
8162 class AcceleratorTable(Object
):
8164 An accelerator table allows the application to specify a table of
8165 keyboard shortcuts for menus or other commands. On Windows, menu or
8166 button commands are supported; on GTK, only menu commands are
8169 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8170 __repr__
= _swig_repr
8171 def __init__(self
, *args
, **kwargs
):
8173 __init__(entries) -> AcceleratorTable
8175 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8176 items or or of 3-tuples (flags, keyCode, cmdID)
8178 :see: `wx.AcceleratorEntry`
8180 _core_
.AcceleratorTable_swiginit(self
,_core_
.new_AcceleratorTable(*args
, **kwargs
))
8181 __swig_destroy__
= _core_
.delete_AcceleratorTable
8182 __del__
= lambda self
: None;
8183 def IsOk(*args
, **kwargs
):
8184 """IsOk(self) -> bool"""
8185 return _core_
.AcceleratorTable_IsOk(*args
, **kwargs
)
8188 _core_
.AcceleratorTable_swigregister(AcceleratorTable
)
8190 def GetAccelFromString(label
):
8191 entry
= AcceleratorEntry()
8192 entry
.FromString(label
)
8195 #---------------------------------------------------------------------------
8197 class VisualAttributes(object):
8198 """struct containing all the visual attributes of a control"""
8199 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8200 __repr__
= _swig_repr
8201 def __init__(self
, *args
, **kwargs
):
8203 __init__(self) -> VisualAttributes
8205 struct containing all the visual attributes of a control
8207 _core_
.VisualAttributes_swiginit(self
,_core_
.new_VisualAttributes(*args
, **kwargs
))
8208 __swig_destroy__
= _core_
.delete_VisualAttributes
8209 __del__
= lambda self
: None;
8210 def _get_font(*args
, **kwargs
):
8211 """_get_font(self) -> Font"""
8212 return _core_
.VisualAttributes__get_font(*args
, **kwargs
)
8214 def _get_colFg(*args
, **kwargs
):
8215 """_get_colFg(self) -> Colour"""
8216 return _core_
.VisualAttributes__get_colFg(*args
, **kwargs
)
8218 def _get_colBg(*args
, **kwargs
):
8219 """_get_colBg(self) -> Colour"""
8220 return _core_
.VisualAttributes__get_colBg(*args
, **kwargs
)
8222 font
= property(_get_font
)
8223 colFg
= property(_get_colFg
)
8224 colBg
= property(_get_colBg
)
8225 _core_
.VisualAttributes_swigregister(VisualAttributes
)
8226 NullAcceleratorTable
= cvar
.NullAcceleratorTable
8227 PanelNameStr
= cvar
.PanelNameStr
8229 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
8230 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
8231 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
8232 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
8233 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
8234 class Window(EvtHandler
):
8236 wx.Window is the base class for all windows and represents any visible
8237 object on the screen. All controls, top level windows and so on are
8238 wx.Windows. Sizers and device contexts are not however, as they don't
8239 appear on screen themselves.
8242 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
8243 __repr__
= _swig_repr
8244 def __init__(self
, *args
, **kwargs
):
8246 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8247 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
8249 Construct and show a generic Window.
8251 _core_
.Window_swiginit(self
,_core_
.new_Window(*args
, **kwargs
))
8252 self
._setOORInfo
(self
)
8254 def Create(*args
, **kwargs
):
8256 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8257 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
8259 Create the GUI part of the Window for 2-phase creation mode.
8261 return _core_
.Window_Create(*args
, **kwargs
)
8263 def Close(*args
, **kwargs
):
8265 Close(self, bool force=False) -> bool
8267 This function simply generates a EVT_CLOSE event whose handler usually
8268 tries to close the window. It doesn't close the window itself,
8269 however. If force is False (the default) then the window's close
8270 handler will be allowed to veto the destruction of the window.
8272 return _core_
.Window_Close(*args
, **kwargs
)
8274 def Destroy(*args
, **kwargs
):
8276 Destroy(self) -> bool
8278 Destroys the window safely. Frames and dialogs are not destroyed
8279 immediately when this function is called -- they are added to a list
8280 of windows to be deleted on idle time, when all the window's events
8281 have been processed. This prevents problems with events being sent to
8282 non-existent windows.
8284 Returns True if the window has either been successfully deleted, or it
8285 has been added to the list of windows pending real deletion.
8287 args
[0].this
.own(False)
8288 return _core_
.Window_Destroy(*args
, **kwargs
)
8290 def DestroyChildren(*args
, **kwargs
):
8292 DestroyChildren(self) -> bool
8294 Destroys all children of a window. Called automatically by the
8297 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
8299 def IsBeingDeleted(*args
, **kwargs
):
8301 IsBeingDeleted(self) -> bool
8303 Is the window in the process of being deleted?
8305 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
8307 def SetLabel(*args
, **kwargs
):
8309 SetLabel(self, String label)
8311 Set the text which the window shows in its label if applicable.
8313 return _core_
.Window_SetLabel(*args
, **kwargs
)
8315 def GetLabel(*args
, **kwargs
):
8317 GetLabel(self) -> String
8319 Generic way of getting a label from any window, for identification
8320 purposes. The interpretation of this function differs from class to
8321 class. For frames and dialogs, the value returned is the title. For
8322 buttons or static text controls, it is the button text. This function
8323 can be useful for meta-programs such as testing tools or special-needs
8324 access programs)which need to identify windows by name.
8326 return _core_
.Window_GetLabel(*args
, **kwargs
)
8328 def SetName(*args
, **kwargs
):
8330 SetName(self, String name)
8332 Sets the window's name. The window name is used for ressource setting
8333 in X, it is not the same as the window title/label
8335 return _core_
.Window_SetName(*args
, **kwargs
)
8337 def GetName(*args
, **kwargs
):
8339 GetName(self) -> String
8341 Returns the windows name. This name is not guaranteed to be unique;
8342 it is up to the programmer to supply an appropriate name in the window
8343 constructor or via wx.Window.SetName.
8345 return _core_
.Window_GetName(*args
, **kwargs
)
8347 def SetWindowVariant(*args
, **kwargs
):
8349 SetWindowVariant(self, int variant)
8351 Sets the variant of the window/font size to use for this window, if
8352 the platform supports variants, for example, wxMac.
8354 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
8356 def GetWindowVariant(*args
, **kwargs
):
8357 """GetWindowVariant(self) -> int"""
8358 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
8360 def SetId(*args
, **kwargs
):
8362 SetId(self, int winid)
8364 Sets the identifier of the window. Each window has an integer
8365 identifier. If the application has not provided one, an identifier
8366 will be generated. Normally, the identifier should be provided on
8367 creation and should not be modified subsequently.
8369 return _core_
.Window_SetId(*args
, **kwargs
)
8371 def GetId(*args
, **kwargs
):
8375 Returns the identifier of the window. Each window has an integer
8376 identifier. If the application has not provided one (or the default Id
8377 -1 is used) then an unique identifier with a negative value will be
8380 return _core_
.Window_GetId(*args
, **kwargs
)
8382 def NewControlId(*args
, **kwargs
):
8384 NewControlId() -> int
8386 Generate a control id for the controls which were not given one.
8388 return _core_
.Window_NewControlId(*args
, **kwargs
)
8390 NewControlId
= staticmethod(NewControlId
)
8391 def NextControlId(*args
, **kwargs
):
8393 NextControlId(int winid) -> int
8395 Get the id of the control following the one with the given
8398 return _core_
.Window_NextControlId(*args
, **kwargs
)
8400 NextControlId
= staticmethod(NextControlId
)
8401 def PrevControlId(*args
, **kwargs
):
8403 PrevControlId(int winid) -> int
8405 Get the id of the control preceding the one with the given
8408 return _core_
.Window_PrevControlId(*args
, **kwargs
)
8410 PrevControlId
= staticmethod(PrevControlId
)
8411 def GetLayoutDirection(*args
, **kwargs
):
8413 GetLayoutDirection(self) -> int
8415 Get the layout direction (LTR or RTL) for this window. Returns
8416 ``wx.Layout_Default`` if layout direction is not supported.
8418 return _core_
.Window_GetLayoutDirection(*args
, **kwargs
)
8420 def SetLayoutDirection(*args
, **kwargs
):
8422 SetLayoutDirection(self, int dir)
8424 Set the layout direction (LTR or RTL) for this window.
8426 return _core_
.Window_SetLayoutDirection(*args
, **kwargs
)
8428 def AdjustForLayoutDirection(*args
, **kwargs
):
8430 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8432 Mirror coordinates for RTL layout if this window uses it and if the
8433 mirroring is not done automatically like Win32.
8435 return _core_
.Window_AdjustForLayoutDirection(*args
, **kwargs
)
8437 def SetSize(*args
, **kwargs
):
8439 SetSize(self, Size size)
8441 Sets the size of the window in pixels.
8443 return _core_
.Window_SetSize(*args
, **kwargs
)
8445 def SetDimensions(*args
, **kwargs
):
8447 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8449 Sets the position and size of the window in pixels. The sizeFlags
8450 parameter indicates the interpretation of the other params if they are
8453 ======================== ======================================
8454 wx.SIZE_AUTO A -1 indicates that a class-specific
8455 default should be used.
8456 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8457 -1 values are supplied.
8458 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8459 interpreted as real dimensions, not
8461 ======================== ======================================
8464 return _core_
.Window_SetDimensions(*args
, **kwargs
)
8466 def SetRect(*args
, **kwargs
):
8468 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8470 Sets the position and size of the window in pixels using a wx.Rect.
8472 return _core_
.Window_SetRect(*args
, **kwargs
)
8474 def SetSizeWH(*args
, **kwargs
):
8476 SetSizeWH(self, int width, int height)
8478 Sets the size of the window in pixels.
8480 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
8482 def Move(*args
, **kwargs
):
8484 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8486 Moves the window to the given position.
8488 return _core_
.Window_Move(*args
, **kwargs
)
8491 def MoveXY(*args
, **kwargs
):
8493 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8495 Moves the window to the given position.
8497 return _core_
.Window_MoveXY(*args
, **kwargs
)
8499 def SetInitialSize(*args
, **kwargs
):
8501 SetInitialSize(self, Size size=DefaultSize)
8503 A 'Smart' SetSize that will fill in default size components with the
8504 window's *best size* values. Also set's the minsize for use with sizers.
8506 return _core_
.Window_SetInitialSize(*args
, **kwargs
)
8508 SetBestFittingSize
= wx
._deprecated
(SetInitialSize
, 'Use `SetInitialSize`')
8509 def Raise(*args
, **kwargs
):
8513 Raises the window to the top of the window hierarchy. In current
8514 version of wxWidgets this works both for managed and child windows.
8516 return _core_
.Window_Raise(*args
, **kwargs
)
8518 def Lower(*args
, **kwargs
):
8522 Lowers the window to the bottom of the window hierarchy. In current
8523 version of wxWidgets this works both for managed and child windows.
8525 return _core_
.Window_Lower(*args
, **kwargs
)
8527 def SetClientSize(*args
, **kwargs
):
8529 SetClientSize(self, Size size)
8531 This sets the size of the window client area in pixels. Using this
8532 function to size a window tends to be more device-independent than
8533 wx.Window.SetSize, since the application need not worry about what
8534 dimensions the border or title bar have when trying to fit the window
8535 around panel items, for example.
8537 return _core_
.Window_SetClientSize(*args
, **kwargs
)
8539 def SetClientSizeWH(*args
, **kwargs
):
8541 SetClientSizeWH(self, int width, int height)
8543 This sets the size of the window client area in pixels. Using this
8544 function to size a window tends to be more device-independent than
8545 wx.Window.SetSize, since the application need not worry about what
8546 dimensions the border or title bar have when trying to fit the window
8547 around panel items, for example.
8549 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
8551 def SetClientRect(*args
, **kwargs
):
8553 SetClientRect(self, Rect rect)
8555 This sets the size of the window client area in pixels. Using this
8556 function to size a window tends to be more device-independent than
8557 wx.Window.SetSize, since the application need not worry about what
8558 dimensions the border or title bar have when trying to fit the window
8559 around panel items, for example.
8561 return _core_
.Window_SetClientRect(*args
, **kwargs
)
8563 def GetPosition(*args
, **kwargs
):
8565 GetPosition(self) -> Point
8567 Get the window's position. Notice that the position is in client
8568 coordinates for child windows and screen coordinates for the top level
8569 ones, use `GetScreenPosition` if you need screen coordinates for all
8572 return _core_
.Window_GetPosition(*args
, **kwargs
)
8574 def GetPositionTuple(*args
, **kwargs
):
8576 GetPositionTuple() -> (x,y)
8578 Get the window's position. Notice that the position is in client
8579 coordinates for child windows and screen coordinates for the top level
8580 ones, use `GetScreenPosition` if you need screen coordinates for all
8583 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
8585 def GetScreenPosition(*args
, **kwargs
):
8587 GetScreenPosition(self) -> Point
8589 Get the position of the window in screen coordinantes.
8591 return _core_
.Window_GetScreenPosition(*args
, **kwargs
)
8593 def GetScreenPositionTuple(*args
, **kwargs
):
8595 GetScreenPositionTuple() -> (x,y)
8597 Get the position of the window in screen coordinantes.
8599 return _core_
.Window_GetScreenPositionTuple(*args
, **kwargs
)
8601 def GetScreenRect(*args
, **kwargs
):
8603 GetScreenRect(self) -> Rect
8605 Returns the size and position of the window in screen coordinantes as
8608 return _core_
.Window_GetScreenRect(*args
, **kwargs
)
8610 def GetSize(*args
, **kwargs
):
8612 GetSize(self) -> Size
8614 Get the window size.
8616 return _core_
.Window_GetSize(*args
, **kwargs
)
8618 def GetSizeTuple(*args
, **kwargs
):
8620 GetSizeTuple() -> (width, height)
8622 Get the window size.
8624 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
8626 def GetRect(*args
, **kwargs
):
8628 GetRect(self) -> Rect
8630 Returns the size and position of the window as a `wx.Rect` object.
8632 return _core_
.Window_GetRect(*args
, **kwargs
)
8634 def GetClientSize(*args
, **kwargs
):
8636 GetClientSize(self) -> Size
8638 This gets the size of the window's 'client area' in pixels. The client
8639 area is the area which may be drawn on by the programmer, excluding
8640 title bar, border, scrollbars, etc.
8642 return _core_
.Window_GetClientSize(*args
, **kwargs
)
8644 def GetClientSizeTuple(*args
, **kwargs
):
8646 GetClientSizeTuple() -> (width, height)
8648 This gets the size of the window's 'client area' in pixels. The client
8649 area is the area which may be drawn on by the programmer, excluding
8650 title bar, border, scrollbars, etc.
8652 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
8654 def GetClientAreaOrigin(*args
, **kwargs
):
8656 GetClientAreaOrigin(self) -> Point
8658 Get the origin of the client area of the window relative to the
8659 window's top left corner (the client area may be shifted because of
8660 the borders, scrollbars, other decorations...)
8662 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
8664 def GetClientRect(*args
, **kwargs
):
8666 GetClientRect(self) -> Rect
8668 Get the client area position and size as a `wx.Rect` object.
8670 return _core_
.Window_GetClientRect(*args
, **kwargs
)
8672 def GetBestSize(*args
, **kwargs
):
8674 GetBestSize(self) -> Size
8676 This function returns the best acceptable minimal size for the
8677 window, if applicable. For example, for a static text control, it will
8678 be the minimal size such that the control label is not truncated. For
8679 windows containing subwindows (suzh aswx.Panel), the size returned by
8680 this function will be the same as the size the window would have had
8683 return _core_
.Window_GetBestSize(*args
, **kwargs
)
8685 def GetBestSizeTuple(*args
, **kwargs
):
8687 GetBestSizeTuple() -> (width, height)
8689 This function returns the best acceptable minimal size for the
8690 window, if applicable. For example, for a static text control, it will
8691 be the minimal size such that the control label is not truncated. For
8692 windows containing subwindows (suzh aswx.Panel), the size returned by
8693 this function will be the same as the size the window would have had
8696 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
8698 def InvalidateBestSize(*args
, **kwargs
):
8700 InvalidateBestSize(self)
8702 Reset the cached best size value so it will be recalculated the next
8705 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
8707 def CacheBestSize(*args
, **kwargs
):
8709 CacheBestSize(self, Size size)
8711 Cache the best size so it doesn't need to be calculated again, (at least until
8712 some properties of the window change.)
8714 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
8716 def GetEffectiveMinSize(*args
, **kwargs
):
8718 GetEffectiveMinSize(self) -> Size
8720 This function will merge the window's best size into the window's
8721 minimum size, giving priority to the min size components, and returns
8725 return _core_
.Window_GetEffectiveMinSize(*args
, **kwargs
)
8727 GetBestFittingSize
= wx
._deprecated
(GetEffectiveMinSize
, 'Use `GetEffectiveMinSize` instead.')
8728 def GetAdjustedBestSize(self
):
8729 s
= self
.GetBestSize()
8730 return wx
.Size(max(s
.width
, self
.GetMinWidth()),
8731 max(s
.height
, self
.GetMinHeight()))
8732 GetAdjustedBestSize
= wx
._deprecated
(GetAdjustedBestSize
, 'Use `GetEffectiveMinSize` instead.')
8734 def Center(*args
, **kwargs
):
8736 Center(self, int direction=BOTH)
8738 Centers the window. The parameter specifies the direction for
8739 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8740 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8741 on the entire screen and not on its parent window. If it is a
8742 top-level window and has no parent then it will always be centered
8743 relative to the screen.
8745 return _core_
.Window_Center(*args
, **kwargs
)
8748 def CenterOnParent(*args
, **kwargs
):
8750 CenterOnParent(self, int dir=BOTH)
8752 Center with respect to the the parent window
8754 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
8756 CentreOnParent
= CenterOnParent
8757 def Fit(*args
, **kwargs
):
8761 Sizes the window so that it fits around its subwindows. This function
8762 won't do anything if there are no subwindows and will only really work
8763 correctly if sizers are used for the subwindows layout. Also, if the
8764 window has exactly one subwindow it is better (faster and the result
8765 is more precise as Fit adds some margin to account for fuzziness of
8766 its calculations) to call window.SetClientSize(child.GetSize())
8767 instead of calling Fit.
8769 return _core_
.Window_Fit(*args
, **kwargs
)
8771 def FitInside(*args
, **kwargs
):
8775 Similar to Fit, but sizes the interior (virtual) size of a
8776 window. Mainly useful with scrolled windows to reset scrollbars after
8777 sizing changes that do not trigger a size event, and/or scrolled
8778 windows without an interior sizer. This function similarly won't do
8779 anything if there are no subwindows.
8781 return _core_
.Window_FitInside(*args
, **kwargs
)
8783 def SetSizeHints(*args
, **kwargs
):
8785 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8788 Allows specification of minimum and maximum window sizes, and window
8789 size increments. If a pair of values is not set (or set to -1), the
8790 default values will be used. If this function is called, the user
8791 will not be able to size the window outside the given bounds (if it is
8792 a top-level window.) Sizers will also inspect the minimum window size
8793 and will use that value if set when calculating layout.
8795 The resizing increments are only significant under Motif or Xt.
8797 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
8799 def SetSizeHintsSz(*args
, **kwargs
):
8801 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8803 Allows specification of minimum and maximum window sizes, and window
8804 size increments. If a pair of values is not set (or set to -1), the
8805 default values will be used. If this function is called, the user
8806 will not be able to size the window outside the given bounds (if it is
8807 a top-level window.) Sizers will also inspect the minimum window size
8808 and will use that value if set when calculating layout.
8810 The resizing increments are only significant under Motif or Xt.
8812 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
8814 def SetVirtualSizeHints(*args
, **kwargs
):
8816 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8818 Allows specification of minimum and maximum virtual window sizes. If a
8819 pair of values is not set (or set to -1), the default values will be
8820 used. If this function is called, the user will not be able to size
8821 the virtual area of the window outside the given bounds.
8823 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
8825 def SetVirtualSizeHintsSz(*args
, **kwargs
):
8827 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8829 Allows specification of minimum and maximum virtual window sizes. If a
8830 pair of values is not set (or set to -1), the default values will be
8831 used. If this function is called, the user will not be able to size
8832 the virtual area of the window outside the given bounds.
8834 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
8836 def GetMaxSize(*args
, **kwargs
):
8837 """GetMaxSize(self) -> Size"""
8838 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8840 def GetMinSize(*args
, **kwargs
):
8841 """GetMinSize(self) -> Size"""
8842 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8844 def SetMinSize(*args
, **kwargs
):
8846 SetMinSize(self, Size minSize)
8848 A more convenient method than `SetSizeHints` for setting just the
8851 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8853 def SetMaxSize(*args
, **kwargs
):
8855 SetMaxSize(self, Size maxSize)
8857 A more convenient method than `SetSizeHints` for setting just the
8860 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8862 def GetMinWidth(*args
, **kwargs
):
8863 """GetMinWidth(self) -> int"""
8864 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8866 def GetMinHeight(*args
, **kwargs
):
8867 """GetMinHeight(self) -> int"""
8868 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8870 def GetMaxWidth(*args
, **kwargs
):
8871 """GetMaxWidth(self) -> int"""
8872 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8874 def GetMaxHeight(*args
, **kwargs
):
8875 """GetMaxHeight(self) -> int"""
8876 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8878 def SetVirtualSize(*args
, **kwargs
):
8880 SetVirtualSize(self, Size size)
8882 Set the the virtual size of a window in pixels. For most windows this
8883 is just the client area of the window, but for some like scrolled
8884 windows it is more or less independent of the screen window size.
8886 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8888 def SetVirtualSizeWH(*args
, **kwargs
):
8890 SetVirtualSizeWH(self, int w, int h)
8892 Set the the virtual size of a window in pixels. For most windows this
8893 is just the client area of the window, but for some like scrolled
8894 windows it is more or less independent of the screen window size.
8896 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8898 def GetVirtualSize(*args
, **kwargs
):
8900 GetVirtualSize(self) -> Size
8902 Get the the virtual size of the window in pixels. For most windows
8903 this is just the client area of the window, but for some like scrolled
8904 windows it is more or less independent of the screen window size.
8906 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8908 def GetVirtualSizeTuple(*args
, **kwargs
):
8910 GetVirtualSizeTuple() -> (width, height)
8912 Get the the virtual size of the window in pixels. For most windows
8913 this is just the client area of the window, but for some like scrolled
8914 windows it is more or less independent of the screen window size.
8916 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8918 def GetWindowBorderSize(*args
, **kwargs
):
8920 GetWindowBorderSize(self) -> Size
8922 Return the size of the left/right and top/bottom borders.
8924 return _core_
.Window_GetWindowBorderSize(*args
, **kwargs
)
8926 def GetBestVirtualSize(*args
, **kwargs
):
8928 GetBestVirtualSize(self) -> Size
8930 Return the largest of ClientSize and BestSize (as determined by a
8931 sizer, interior children, or other means)
8933 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8935 def Show(*args
, **kwargs
):
8937 Show(self, bool show=True) -> bool
8939 Shows or hides the window. You may need to call Raise for a top level
8940 window if you want to bring it to top, although this is not needed if
8941 Show is called immediately after the frame creation. Returns True if
8942 the window has been shown or hidden or False if nothing was done
8943 because it already was in the requested state.
8945 return _core_
.Window_Show(*args
, **kwargs
)
8947 def Hide(*args
, **kwargs
):
8951 Equivalent to calling Show(False).
8953 return _core_
.Window_Hide(*args
, **kwargs
)
8955 def Enable(*args
, **kwargs
):
8957 Enable(self, bool enable=True) -> bool
8959 Enable or disable the window for user input. Note that when a parent
8960 window is disabled, all of its children are disabled as well and they
8961 are reenabled again when the parent is. Returns true if the window
8962 has been enabled or disabled, false if nothing was done, i.e. if the
8963 window had already been in the specified state.
8965 return _core_
.Window_Enable(*args
, **kwargs
)
8967 def Disable(*args
, **kwargs
):
8969 Disable(self) -> bool
8971 Disables the window, same as Enable(false).
8973 return _core_
.Window_Disable(*args
, **kwargs
)
8975 def IsShown(*args
, **kwargs
):
8977 IsShown(self) -> bool
8979 Returns true if the window is shown, false if it has been hidden.
8981 return _core_
.Window_IsShown(*args
, **kwargs
)
8983 def IsEnabled(*args
, **kwargs
):
8985 IsEnabled(self) -> bool
8987 Returns true if the window is enabled for input, false otherwise.
8988 This method takes into account the enabled state of parent windows up
8989 to the top-level window.
8991 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8993 def IsThisEnabled(*args
, **kwargs
):
8995 IsThisEnabled(self) -> bool
8997 Returns the internal enabled state independent of the parent(s) state,
8998 i.e. the state in which the window would be if all of its parents are
8999 enabled. Use `IsEnabled` to get the effective window state.
9001 return _core_
.Window_IsThisEnabled(*args
, **kwargs
)
9003 def IsShownOnScreen(*args
, **kwargs
):
9005 IsShownOnScreen(self) -> bool
9007 Returns ``True`` if the window is physically visible on the screen,
9008 i.e. it is shown and all its parents up to the toplevel window are
9011 return _core_
.Window_IsShownOnScreen(*args
, **kwargs
)
9013 def SetWindowStyleFlag(*args
, **kwargs
):
9015 SetWindowStyleFlag(self, long style)
9017 Sets the style of the window. Please note that some styles cannot be
9018 changed after the window creation and that Refresh() might need to be
9019 called after changing the others for the change to take place
9022 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
9024 def GetWindowStyleFlag(*args
, **kwargs
):
9026 GetWindowStyleFlag(self) -> long
9028 Gets the window style that was passed to the constructor or Create
9031 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
9033 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
9034 def HasFlag(*args
, **kwargs
):
9036 HasFlag(self, int flag) -> bool
9038 Test if the given style is set for this window.
9040 return _core_
.Window_HasFlag(*args
, **kwargs
)
9042 def IsRetained(*args
, **kwargs
):
9044 IsRetained(self) -> bool
9046 Returns true if the window is retained, false otherwise. Retained
9047 windows are only available on X platforms.
9049 return _core_
.Window_IsRetained(*args
, **kwargs
)
9051 def ToggleWindowStyle(*args
, **kwargs
):
9053 ToggleWindowStyle(self, int flag) -> bool
9055 Turn the flag on if it had been turned off before and vice versa,
9056 returns True if the flag is turned on by this function call.
9058 return _core_
.Window_ToggleWindowStyle(*args
, **kwargs
)
9060 def SetExtraStyle(*args
, **kwargs
):
9062 SetExtraStyle(self, long exStyle)
9064 Sets the extra style bits for the window. Extra styles are the less
9065 often used style bits which can't be set with the constructor or with
9066 SetWindowStyleFlag()
9068 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
9070 def GetExtraStyle(*args
, **kwargs
):
9072 GetExtraStyle(self) -> long
9074 Returns the extra style bits for the window.
9076 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
9078 def MakeModal(*args
, **kwargs
):
9080 MakeModal(self, bool modal=True)
9082 Disables all other windows in the application so that the user can
9083 only interact with this window. Passing False will reverse this
9086 return _core_
.Window_MakeModal(*args
, **kwargs
)
9088 def SetThemeEnabled(*args
, **kwargs
):
9090 SetThemeEnabled(self, bool enableTheme)
9092 This function tells a window if it should use the system's "theme"
9093 code to draw the windows' background instead if its own background
9094 drawing code. This will only have an effect on platforms that support
9095 the notion of themes in user defined windows. One such platform is
9096 GTK+ where windows can have (very colourful) backgrounds defined by a
9097 user's selected theme.
9099 Dialogs, notebook pages and the status bar have this flag set to true
9100 by default so that the default look and feel is simulated best.
9102 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
9104 def GetThemeEnabled(*args
, **kwargs
):
9106 GetThemeEnabled(self) -> bool
9108 Return the themeEnabled flag.
9110 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
9112 def SetFocus(*args
, **kwargs
):
9116 Set's the focus to this window, allowing it to receive keyboard input.
9118 return _core_
.Window_SetFocus(*args
, **kwargs
)
9120 def SetFocusFromKbd(*args
, **kwargs
):
9122 SetFocusFromKbd(self)
9124 Set focus to this window as the result of a keyboard action. Normally
9125 only called internally.
9127 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
9129 def FindFocus(*args
, **kwargs
):
9131 FindFocus() -> Window
9133 Returns the window or control that currently has the keyboard focus,
9136 return _core_
.Window_FindFocus(*args
, **kwargs
)
9138 FindFocus
= staticmethod(FindFocus
)
9139 def AcceptsFocus(*args
, **kwargs
):
9141 AcceptsFocus(self) -> bool
9143 Can this window have focus?
9145 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
9147 def CanAcceptFocus(*args
, **kwargs
):
9149 CanAcceptFocus(self) -> bool
9151 Can this window have focus right now?
9153 return _core_
.Window_CanAcceptFocus(*args
, **kwargs
)
9155 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
9157 AcceptsFocusFromKeyboard(self) -> bool
9159 Can this window be given focus by keyboard navigation? if not, the
9160 only way to give it focus (provided it accepts it at all) is to click
9163 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
9165 def CanAcceptFocusFromKeyboard(*args
, **kwargs
):
9167 CanAcceptFocusFromKeyboard(self) -> bool
9169 Can this window be assigned focus from keyboard right now?
9171 return _core_
.Window_CanAcceptFocusFromKeyboard(*args
, **kwargs
)
9173 def SetCanFocus(*args
, **kwargs
):
9174 """SetCanFocus(self, bool canFocus)"""
9175 return _core_
.Window_SetCanFocus(*args
, **kwargs
)
9177 def NavigateIn(*args
, **kwargs
):
9179 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9181 Navigates inside this window.
9183 return _core_
.Window_NavigateIn(*args
, **kwargs
)
9185 def Navigate(*args
, **kwargs
):
9187 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9189 Does keyboard navigation starting from this window to another. This is
9190 equivalient to self.GetParent().NavigateIn().
9192 return _core_
.Window_Navigate(*args
, **kwargs
)
9194 def MoveAfterInTabOrder(*args
, **kwargs
):
9196 MoveAfterInTabOrder(self, Window win)
9198 Moves this window in the tab navigation order after the specified
9199 sibling window. This means that when the user presses the TAB key on
9200 that other window, the focus switches to this window.
9202 The default tab order is the same as creation order. This function
9203 and `MoveBeforeInTabOrder` allow to change it after creating all the
9207 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
9209 def MoveBeforeInTabOrder(*args
, **kwargs
):
9211 MoveBeforeInTabOrder(self, Window win)
9213 Same as `MoveAfterInTabOrder` except that it inserts this window just
9214 before win instead of putting it right after it.
9216 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
9218 def GetChildren(*args
, **kwargs
):
9220 GetChildren(self) -> PyObject
9222 Returns a list of the window's children. NOTE: Currently this is a
9223 copy of the child window list maintained by the window, so the return
9224 value of this function is only valid as long as the window's children
9227 return _core_
.Window_GetChildren(*args
, **kwargs
)
9229 def GetParent(*args
, **kwargs
):
9231 GetParent(self) -> Window
9233 Returns the parent window of this window, or None if there isn't one.
9235 return _core_
.Window_GetParent(*args
, **kwargs
)
9237 def GetGrandParent(*args
, **kwargs
):
9239 GetGrandParent(self) -> Window
9241 Returns the parent of the parent of this window, or None if there
9244 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
9246 def GetTopLevelParent(*args
, **kwargs
):
9248 GetTopLevelParent(self) -> Window
9250 Returns the first frame or dialog in this window's parental hierarchy.
9252 return _core_
.Window_GetTopLevelParent(*args
, **kwargs
)
9254 def IsTopLevel(*args
, **kwargs
):
9256 IsTopLevel(self) -> bool
9258 Returns true if the given window is a top-level one. Currently all
9259 frames and dialogs are always considered to be top-level windows (even
9260 if they have a parent window).
9262 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
9264 def Reparent(*args
, **kwargs
):
9266 Reparent(self, Window newParent) -> bool
9268 Reparents the window, i.e the window will be removed from its current
9269 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9270 re-inserted into another. Available on Windows and GTK. Returns True
9271 if the parent was changed, False otherwise (error or newParent ==
9274 return _core_
.Window_Reparent(*args
, **kwargs
)
9276 def AddChild(*args
, **kwargs
):
9278 AddChild(self, Window child)
9280 Adds a child window. This is called automatically by window creation
9281 functions so should not be required by the application programmer.
9283 return _core_
.Window_AddChild(*args
, **kwargs
)
9285 def RemoveChild(*args
, **kwargs
):
9287 RemoveChild(self, Window child)
9289 Removes a child window. This is called automatically by window
9290 deletion functions so should not be required by the application
9293 return _core_
.Window_RemoveChild(*args
, **kwargs
)
9295 def SetDoubleBuffered(*args
, **kwargs
):
9297 SetDoubleBuffered(self, bool on)
9299 Currently wxGTK2 only.
9301 return _core_
.Window_SetDoubleBuffered(*args
, **kwargs
)
9303 def FindWindowById(*args
, **kwargs
):
9305 FindWindowById(self, long winid) -> Window
9307 Find a chld of this window by window ID
9309 return _core_
.Window_FindWindowById(*args
, **kwargs
)
9311 def FindWindowByName(*args
, **kwargs
):
9313 FindWindowByName(self, String name) -> Window
9315 Find a child of this window by name
9317 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
9319 def GetEventHandler(*args
, **kwargs
):
9321 GetEventHandler(self) -> EvtHandler
9323 Returns the event handler for this window. By default, the window is
9324 its own event handler.
9326 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
9328 def SetEventHandler(*args
, **kwargs
):
9330 SetEventHandler(self, EvtHandler handler)
9332 Sets the event handler for this window. An event handler is an object
9333 that is capable of processing the events sent to a window. (In other
9334 words, is able to dispatch the events to handler function.) By
9335 default, the window is its own event handler, but an application may
9336 wish to substitute another, for example to allow central
9337 implementation of event-handling for a variety of different window
9340 It is usually better to use `wx.Window.PushEventHandler` since this sets
9341 up a chain of event handlers, where an event not handled by one event
9342 handler is handed off to the next one in the chain.
9344 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
9346 def PushEventHandler(*args
, **kwargs
):
9348 PushEventHandler(self, EvtHandler handler)
9350 Pushes this event handler onto the event handler stack for the window.
9351 An event handler is an object that is capable of processing the events
9352 sent to a window. (In other words, is able to dispatch the events to
9353 handler function.) By default, the window is its own event handler,
9354 but an application may wish to substitute another, for example to
9355 allow central implementation of event-handling for a variety of
9356 different window classes.
9358 wx.Window.PushEventHandler allows an application to set up a chain of
9359 event handlers, where an event not handled by one event handler is
9360 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9361 to remove the event handler. Ownership of the handler is *not* given
9362 to the window, so you should be sure to pop the handler before the
9363 window is destroyed and either let PopEventHandler destroy it, or call
9364 its Destroy method yourself.
9366 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
9368 def PopEventHandler(*args
, **kwargs
):
9370 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
9372 Removes and returns the top-most event handler on the event handler
9373 stack. If deleteHandler is True then the wx.EvtHandler object will be
9374 destroyed after it is popped, and ``None`` will be returned instead.
9376 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
9378 def RemoveEventHandler(*args
, **kwargs
):
9380 RemoveEventHandler(self, EvtHandler handler) -> bool
9382 Find the given handler in the event handler chain and remove (but not
9383 delete) it from the event handler chain, returns True if it was found
9384 and False otherwise (this also results in an assert failure so this
9385 function should only be called when the handler is supposed to be
9388 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
9390 def SetValidator(*args
, **kwargs
):
9392 SetValidator(self, Validator validator)
9394 Deletes the current validator (if any) and sets the window validator,
9395 having called wx.Validator.Clone to create a new validator of this
9398 return _core_
.Window_SetValidator(*args
, **kwargs
)
9400 def GetValidator(*args
, **kwargs
):
9402 GetValidator(self) -> Validator
9404 Returns a pointer to the current validator for the window, or None if
9407 return _core_
.Window_GetValidator(*args
, **kwargs
)
9409 def Validate(*args
, **kwargs
):
9411 Validate(self) -> bool
9413 Validates the current values of the child controls using their
9414 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9415 style flag set, the method will also call Validate() of all child
9416 windows. Returns false if any of the validations failed.
9418 return _core_
.Window_Validate(*args
, **kwargs
)
9420 def TransferDataToWindow(*args
, **kwargs
):
9422 TransferDataToWindow(self) -> bool
9424 Transfers values to child controls from data areas specified by their
9425 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9426 style flag set, the method will also call TransferDataToWindow() of
9429 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
9431 def TransferDataFromWindow(*args
, **kwargs
):
9433 TransferDataFromWindow(self) -> bool
9435 Transfers values from child controls to data areas specified by their
9436 validators. Returns false if a transfer failed. If the window has
9437 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9438 also call TransferDataFromWindow() of all child windows.
9440 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
9442 def InitDialog(*args
, **kwargs
):
9446 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9447 to the dialog via validators.
9449 return _core_
.Window_InitDialog(*args
, **kwargs
)
9451 def SetAcceleratorTable(*args
, **kwargs
):
9453 SetAcceleratorTable(self, AcceleratorTable accel)
9455 Sets the accelerator table for this window.
9457 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
9459 def GetAcceleratorTable(*args
, **kwargs
):
9461 GetAcceleratorTable(self) -> AcceleratorTable
9463 Gets the accelerator table for this window.
9465 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
9467 def RegisterHotKey(*args
, **kwargs
):
9469 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9471 Registers a system wide hotkey. Every time the user presses the hotkey
9472 registered here, this window will receive a hotkey event. It will
9473 receive the event even if the application is in the background and
9474 does not have the input focus because the user is working with some
9475 other application. To bind an event handler function to this hotkey
9476 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9477 hotkey was registered successfully.
9479 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
9481 def UnregisterHotKey(*args
, **kwargs
):
9483 UnregisterHotKey(self, int hotkeyId) -> bool
9485 Unregisters a system wide hotkey.
9487 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
9489 def ConvertDialogPointToPixels(*args
, **kwargs
):
9491 ConvertDialogPointToPixels(self, Point pt) -> Point
9493 Converts a point or size from dialog units to pixels. Dialog units
9494 are used for maintaining a dialog's proportions even if the font
9495 changes. For the x dimension, the dialog units are multiplied by the
9496 average character width and then divided by 4. For the y dimension,
9497 the dialog units are multiplied by the average character height and
9500 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
9502 def ConvertDialogSizeToPixels(*args
, **kwargs
):
9504 ConvertDialogSizeToPixels(self, Size sz) -> Size
9506 Converts a point or size from dialog units to pixels. Dialog units
9507 are used for maintaining a dialog's proportions even if the font
9508 changes. For the x dimension, the dialog units are multiplied by the
9509 average character width and then divided by 4. For the y dimension,
9510 the dialog units are multiplied by the average character height and
9513 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
9515 def DLG_PNT(*args
, **kwargs
):
9517 DLG_PNT(self, Point pt) -> Point
9519 Converts a point or size from dialog units to pixels. Dialog units
9520 are used for maintaining a dialog's proportions even if the font
9521 changes. For the x dimension, the dialog units are multiplied by the
9522 average character width and then divided by 4. For the y dimension,
9523 the dialog units are multiplied by the average character height and
9526 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
9528 def DLG_SZE(*args
, **kwargs
):
9530 DLG_SZE(self, Size sz) -> Size
9532 Converts a point or size from dialog units to pixels. Dialog units
9533 are used for maintaining a dialog's proportions even if the font
9534 changes. For the x dimension, the dialog units are multiplied by the
9535 average character width and then divided by 4. For the y dimension,
9536 the dialog units are multiplied by the average character height and
9539 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
9541 def ConvertPixelPointToDialog(*args
, **kwargs
):
9542 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9543 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
9545 def ConvertPixelSizeToDialog(*args
, **kwargs
):
9546 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9547 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
9549 def WarpPointer(*args
, **kwargs
):
9551 WarpPointer(self, int x, int y)
9553 Moves the pointer to the given position on the window.
9555 NOTE: This function is not supported under Mac because Apple Human
9556 Interface Guidelines forbid moving the mouse cursor programmatically.
9558 return _core_
.Window_WarpPointer(*args
, **kwargs
)
9560 def CaptureMouse(*args
, **kwargs
):
9564 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9565 release the capture.
9567 Note that wxWindows maintains the stack of windows having captured the
9568 mouse and when the mouse is released the capture returns to the window
9569 which had had captured it previously and it is only really released if
9570 there were no previous window. In particular, this means that you must
9571 release the mouse as many times as you capture it, unless the window
9572 receives the `wx.MouseCaptureLostEvent` event.
9574 Any application which captures the mouse in the beginning of some
9575 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9576 operation when it receives the event. The event handler must not
9579 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
9581 def ReleaseMouse(*args
, **kwargs
):
9585 Releases mouse input captured with wx.Window.CaptureMouse.
9587 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
9589 def GetCapture(*args
, **kwargs
):
9591 GetCapture() -> Window
9593 Returns the window which currently captures the mouse or None
9595 return _core_
.Window_GetCapture(*args
, **kwargs
)
9597 GetCapture
= staticmethod(GetCapture
)
9598 def HasCapture(*args
, **kwargs
):
9600 HasCapture(self) -> bool
9602 Returns true if this window has the current mouse capture.
9604 return _core_
.Window_HasCapture(*args
, **kwargs
)
9606 def Refresh(*args
, **kwargs
):
9608 Refresh(self, bool eraseBackground=True, Rect rect=None)
9610 Mark the specified rectangle (or the whole window) as "dirty" so it
9611 will be repainted. Causes an EVT_PAINT event to be generated and sent
9614 return _core_
.Window_Refresh(*args
, **kwargs
)
9616 def RefreshRect(*args
, **kwargs
):
9618 RefreshRect(self, Rect rect, bool eraseBackground=True)
9620 Redraws the contents of the given rectangle: the area inside it will
9621 be repainted. This is the same as Refresh but has a nicer syntax.
9623 return _core_
.Window_RefreshRect(*args
, **kwargs
)
9625 def Update(*args
, **kwargs
):
9629 Calling this method immediately repaints the invalidated area of the
9630 window instead of waiting for the EVT_PAINT event to happen, (normally
9631 this would usually only happen when the flow of control returns to the
9632 event loop.) Notice that this function doesn't refresh the window and
9633 does nothing if the window has been already repainted. Use `Refresh`
9634 first if you want to immediately redraw the window (or some portion of
9635 it) unconditionally.
9637 return _core_
.Window_Update(*args
, **kwargs
)
9639 def ClearBackground(*args
, **kwargs
):
9641 ClearBackground(self)
9643 Clears the window by filling it with the current background
9644 colour. Does not cause an erase background event to be generated.
9646 return _core_
.Window_ClearBackground(*args
, **kwargs
)
9648 def Freeze(*args
, **kwargs
):
9652 Freezes the window or, in other words, prevents any updates from
9653 taking place on screen, the window is not redrawn at all. Thaw must be
9654 called to reenable window redrawing. Calls to Freeze/Thaw may be
9655 nested, with the actual Thaw being delayed until all the nesting has
9658 This method is useful for visual appearance optimization (for example,
9659 it is a good idea to use it before inserting large amount of text into
9660 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9661 for all controls so it is mostly just a hint to wxWindows and not a
9662 mandatory directive.
9664 return _core_
.Window_Freeze(*args
, **kwargs
)
9666 def IsFrozen(*args
, **kwargs
):
9668 IsFrozen(self) -> bool
9670 Returns ``True`` if the window has been frozen and not thawed yet.
9672 :see: `Freeze` and `Thaw`
9674 return _core_
.Window_IsFrozen(*args
, **kwargs
)
9676 def Thaw(*args
, **kwargs
):
9680 Reenables window updating after a previous call to Freeze. Calls to
9681 Freeze/Thaw may be nested, so Thaw must be called the same number of
9682 times that Freeze was before the window will be updated.
9684 return _core_
.Window_Thaw(*args
, **kwargs
)
9686 def PrepareDC(*args
, **kwargs
):
9688 PrepareDC(self, DC dc)
9690 Call this function to prepare the device context for drawing a
9691 scrolled image. It sets the device origin according to the current
9694 return _core_
.Window_PrepareDC(*args
, **kwargs
)
9696 def IsDoubleBuffered(*args
, **kwargs
):
9698 IsDoubleBuffered(self) -> bool
9700 Returns ``True`` if the window contents is double-buffered by the
9701 system, i.e. if any drawing done on the window is really done on a
9702 temporary backing surface and transferred to the screen all at once
9705 return _core_
.Window_IsDoubleBuffered(*args
, **kwargs
)
9707 def GetUpdateRegion(*args
, **kwargs
):
9709 GetUpdateRegion(self) -> Region
9711 Returns the region specifying which parts of the window have been
9712 damaged. Should only be called within an EVT_PAINT handler.
9714 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
9716 def GetUpdateClientRect(*args
, **kwargs
):
9718 GetUpdateClientRect(self) -> Rect
9720 Get the update rectangle region bounding box in client coords.
9722 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
9724 def IsExposed(*args
, **kwargs
):
9726 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9728 Returns true if the given point or rectangle area has been exposed
9729 since the last repaint. Call this in an paint event handler to
9730 optimize redrawing by only redrawing those areas, which have been
9733 return _core_
.Window_IsExposed(*args
, **kwargs
)
9735 def IsExposedPoint(*args
, **kwargs
):
9737 IsExposedPoint(self, Point pt) -> bool
9739 Returns true if the given point or rectangle area has been exposed
9740 since the last repaint. Call this in an paint event handler to
9741 optimize redrawing by only redrawing those areas, which have been
9744 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
9746 def IsExposedRect(*args
, **kwargs
):
9748 IsExposedRect(self, Rect rect) -> bool
9750 Returns true if the given point or rectangle area has been exposed
9751 since the last repaint. Call this in an paint event handler to
9752 optimize redrawing by only redrawing those areas, which have been
9755 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
9757 def GetDefaultAttributes(*args
, **kwargs
):
9759 GetDefaultAttributes(self) -> VisualAttributes
9761 Get the default attributes for an instance of this class. This is
9762 useful if you want to use the same font or colour in your own control
9763 as in a standard control -- which is a much better idea than hard
9764 coding specific colours or fonts which might look completely out of
9765 place on the user's system, especially if it uses themes.
9767 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
9769 def GetClassDefaultAttributes(*args
, **kwargs
):
9771 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9773 Get the default attributes for this class. This is useful if you want
9774 to use the same font or colour in your own control as in a standard
9775 control -- which is a much better idea than hard coding specific
9776 colours or fonts which might look completely out of place on the
9777 user's system, especially if it uses themes.
9779 The variant parameter is only relevant under Mac currently and is
9780 ignore under other platforms. Under Mac, it will change the size of
9781 the returned font. See `wx.Window.SetWindowVariant` for more about
9784 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9786 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
9787 def SetBackgroundColour(*args
, **kwargs
):
9789 SetBackgroundColour(self, Colour colour) -> bool
9791 Sets the background colour of the window. Returns True if the colour
9792 was changed. The background colour is usually painted by the default
9793 EVT_ERASE_BACKGROUND event handler function under Windows and
9794 automatically under GTK. Using `wx.NullColour` will reset the window
9795 to the default background colour.
9797 Note that setting the background colour may not cause an immediate
9798 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9799 calling this function.
9801 Using this function will disable attempts to use themes for this
9802 window, if the system supports them. Use with care since usually the
9803 themes represent the appearance chosen by the user to be used for all
9804 applications on the system.
9806 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
9808 def SetOwnBackgroundColour(*args
, **kwargs
):
9809 """SetOwnBackgroundColour(self, Colour colour)"""
9810 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
9812 def SetForegroundColour(*args
, **kwargs
):
9814 SetForegroundColour(self, Colour colour) -> bool
9816 Sets the foreground colour of the window. Returns True is the colour
9817 was changed. The interpretation of foreground colour is dependent on
9818 the window class; it may be the text colour or other colour, or it may
9821 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
9823 def SetOwnForegroundColour(*args
, **kwargs
):
9824 """SetOwnForegroundColour(self, Colour colour)"""
9825 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
9827 def GetBackgroundColour(*args
, **kwargs
):
9829 GetBackgroundColour(self) -> Colour
9831 Returns the background colour of the window.
9833 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
9835 def GetForegroundColour(*args
, **kwargs
):
9837 GetForegroundColour(self) -> Colour
9839 Returns the foreground colour of the window. The interpretation of
9840 foreground colour is dependent on the window class; it may be the text
9841 colour or other colour, or it may not be used at all.
9843 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
9845 def InheritsBackgroundColour(*args
, **kwargs
):
9846 """InheritsBackgroundColour(self) -> bool"""
9847 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
9849 def UseBgCol(*args
, **kwargs
):
9850 """UseBgCol(self) -> bool"""
9851 return _core_
.Window_UseBgCol(*args
, **kwargs
)
9853 def SetBackgroundStyle(*args
, **kwargs
):
9855 SetBackgroundStyle(self, int style) -> bool
9857 Returns the background style of the window. The background style
9858 indicates how the background of the window is drawn.
9860 ====================== ========================================
9861 wx.BG_STYLE_SYSTEM The background colour or pattern should
9862 be determined by the system
9863 wx.BG_STYLE_COLOUR The background should be a solid colour
9864 wx.BG_STYLE_CUSTOM The background will be implemented by the
9866 ====================== ========================================
9868 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9869 a custom background, such as a tiled bitmap. Currently the style has
9870 no effect on other platforms.
9872 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9874 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
9876 def GetBackgroundStyle(*args
, **kwargs
):
9878 GetBackgroundStyle(self) -> int
9880 Returns the background style of the window.
9882 :see: `SetBackgroundStyle`
9884 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
9886 def HasTransparentBackground(*args
, **kwargs
):
9888 HasTransparentBackground(self) -> bool
9890 Returns True if this window's background is transparent (as, for
9891 example, for `wx.StaticText`) and should show the parent window's
9894 This method is mostly used internally by the library itself and you
9895 normally shouldn't have to call it. You may, however, have to override
9896 it in your custom control classes to ensure that background is painted
9899 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
9901 def SetCursor(*args
, **kwargs
):
9903 SetCursor(self, Cursor cursor) -> bool
9905 Sets the window's cursor. Notice that the window cursor also sets it
9906 for the children of the window implicitly.
9908 The cursor may be wx.NullCursor in which case the window cursor will
9909 be reset back to default.
9911 return _core_
.Window_SetCursor(*args
, **kwargs
)
9913 def GetCursor(*args
, **kwargs
):
9915 GetCursor(self) -> Cursor
9917 Return the cursor associated with this window.
9919 return _core_
.Window_GetCursor(*args
, **kwargs
)
9921 def SetFont(*args
, **kwargs
):
9923 SetFont(self, Font font) -> bool
9925 Sets the font for this window.
9927 return _core_
.Window_SetFont(*args
, **kwargs
)
9929 def SetOwnFont(*args
, **kwargs
):
9930 """SetOwnFont(self, Font font)"""
9931 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9933 def GetFont(*args
, **kwargs
):
9935 GetFont(self) -> Font
9937 Returns the default font used for this window.
9939 return _core_
.Window_GetFont(*args
, **kwargs
)
9941 def SetCaret(*args
, **kwargs
):
9943 SetCaret(self, Caret caret)
9945 Sets the caret associated with the window.
9947 return _core_
.Window_SetCaret(*args
, **kwargs
)
9949 def GetCaret(*args
, **kwargs
):
9951 GetCaret(self) -> Caret
9953 Returns the caret associated with the window.
9955 return _core_
.Window_GetCaret(*args
, **kwargs
)
9957 def GetCharHeight(*args
, **kwargs
):
9959 GetCharHeight(self) -> int
9961 Get the (average) character size for the current font.
9963 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9965 def GetCharWidth(*args
, **kwargs
):
9967 GetCharWidth(self) -> int
9969 Get the (average) character size for the current font.
9971 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9973 def GetTextExtent(*args
, **kwargs
):
9975 GetTextExtent(String string) -> (width, height)
9977 Get the width and height of the text using the current font.
9979 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9981 def GetFullTextExtent(*args
, **kwargs
):
9983 GetFullTextExtent(String string, Font font=None) ->
9984 (width, height, descent, externalLeading)
9986 Get the width, height, decent and leading of the text using the
9987 current or specified font.
9989 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9991 def ClientToScreenXY(*args
, **kwargs
):
9993 ClientToScreenXY(int x, int y) -> (x,y)
9995 Converts to screen coordinates from coordinates relative to this window.
9997 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9999 def ScreenToClientXY(*args
, **kwargs
):
10001 ScreenToClientXY(int x, int y) -> (x,y)
10003 Converts from screen to client window coordinates.
10005 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
10007 def ClientToScreen(*args
, **kwargs
):
10009 ClientToScreen(self, Point pt) -> Point
10011 Converts to screen coordinates from coordinates relative to this window.
10013 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
10015 def ScreenToClient(*args
, **kwargs
):
10017 ScreenToClient(self, Point pt) -> Point
10019 Converts from screen to client window coordinates.
10021 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
10023 def HitTestXY(*args
, **kwargs
):
10025 HitTestXY(self, int x, int y) -> int
10027 Test where the given (in client coords) point lies
10029 return _core_
.Window_HitTestXY(*args
, **kwargs
)
10031 def HitTest(*args
, **kwargs
):
10033 HitTest(self, Point pt) -> int
10035 Test where the given (in client coords) point lies
10037 return _core_
.Window_HitTest(*args
, **kwargs
)
10039 def GetBorder(*args
):
10041 GetBorder(self, long flags) -> int
10042 GetBorder(self) -> int
10044 Get border for the flags of this window
10046 return _core_
.Window_GetBorder(*args
)
10048 def UpdateWindowUI(*args
, **kwargs
):
10050 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
10052 This function sends EVT_UPDATE_UI events to the window. The particular
10053 implementation depends on the window; for example a wx.ToolBar will
10054 send an update UI event for each toolbar button, and a wx.Frame will
10055 send an update UI event for each menubar menu item. You can call this
10056 function from your application to ensure that your UI is up-to-date at
10057 a particular point in time (as far as your EVT_UPDATE_UI handlers are
10058 concerned). This may be necessary if you have called
10059 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
10060 limit the overhead that wxWindows incurs by sending update UI events
10063 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
10065 def PopupMenuXY(*args
, **kwargs
):
10067 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
10069 Pops up the given menu at the specified coordinates, relative to this window,
10070 and returns control when the user has dismissed the menu. If a menu item is
10071 selected, the corresponding menu event is generated and will be processed as
10072 usual. If the default position is given then the current position of the
10073 mouse cursor will be used.
10075 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
10077 def PopupMenu(*args
, **kwargs
):
10079 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
10081 Pops up the given menu at the specified coordinates, relative to this window,
10082 and returns control when the user has dismissed the menu. If a menu item is
10083 selected, the corresponding menu event is generated and will be processed as
10084 usual. If the default position is given then the current position of the
10085 mouse cursor will be used.
10087 return _core_
.Window_PopupMenu(*args
, **kwargs
)
10089 def HasMultiplePages(*args
, **kwargs
):
10090 """HasMultiplePages(self) -> bool"""
10091 return _core_
.Window_HasMultiplePages(*args
, **kwargs
)
10093 def GetHandle(*args
, **kwargs
):
10095 GetHandle(self) -> long
10097 Returns the platform-specific handle (as a long integer) of the
10098 physical window. Currently on wxMac it returns the handle of the
10099 toplevel parent of the window.
10101 return _core_
.Window_GetHandle(*args
, **kwargs
)
10103 def AssociateHandle(*args
, **kwargs
):
10105 AssociateHandle(self, long handle)
10107 Associate the window with a new native handle
10109 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
10111 def DissociateHandle(*args
, **kwargs
):
10113 DissociateHandle(self)
10115 Dissociate the current native handle from the window
10117 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
10119 def OnPaint(*args
, **kwargs
):
10120 """OnPaint(self, PaintEvent event)"""
10121 return _core_
.Window_OnPaint(*args
, **kwargs
)
10123 def HasScrollbar(*args
, **kwargs
):
10125 HasScrollbar(self, int orient) -> bool
10127 Does the window have the scrollbar for this orientation?
10129 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
10131 def SetScrollbar(*args
, **kwargs
):
10133 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
10136 Sets the scrollbar properties of a built-in scrollbar.
10138 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
10140 def SetScrollPos(*args
, **kwargs
):
10142 SetScrollPos(self, int orientation, int pos, bool refresh=True)
10144 Sets the position of one of the built-in scrollbars.
10146 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
10148 def GetScrollPos(*args
, **kwargs
):
10150 GetScrollPos(self, int orientation) -> int
10152 Returns the built-in scrollbar position.
10154 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
10156 def GetScrollThumb(*args
, **kwargs
):
10158 GetScrollThumb(self, int orientation) -> int
10160 Returns the built-in scrollbar thumb size.
10162 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
10164 def GetScrollRange(*args
, **kwargs
):
10166 GetScrollRange(self, int orientation) -> int
10168 Returns the built-in scrollbar range.
10170 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
10172 def ScrollWindow(*args
, **kwargs
):
10174 ScrollWindow(self, int dx, int dy, Rect rect=None)
10176 Physically scrolls the pixels in the window and move child windows
10177 accordingly. Use this function to optimise your scrolling
10178 implementations, to minimise the area that must be redrawn. Note that
10179 it is rarely required to call this function from a user program.
10181 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
10183 def ScrollLines(*args
, **kwargs
):
10185 ScrollLines(self, int lines) -> bool
10187 If the platform and window class supports it, scrolls the window by
10188 the given number of lines down, if lines is positive, or up if lines
10189 is negative. Returns True if the window was scrolled, False if it was
10190 already on top/bottom and nothing was done.
10192 return _core_
.Window_ScrollLines(*args
, **kwargs
)
10194 def ScrollPages(*args
, **kwargs
):
10196 ScrollPages(self, int pages) -> bool
10198 If the platform and window class supports it, scrolls the window by
10199 the given number of pages down, if pages is positive, or up if pages
10200 is negative. Returns True if the window was scrolled, False if it was
10201 already on top/bottom and nothing was done.
10203 return _core_
.Window_ScrollPages(*args
, **kwargs
)
10205 def LineUp(*args
, **kwargs
):
10207 LineUp(self) -> bool
10209 This is just a wrapper for ScrollLines(-1).
10211 return _core_
.Window_LineUp(*args
, **kwargs
)
10213 def LineDown(*args
, **kwargs
):
10215 LineDown(self) -> bool
10217 This is just a wrapper for ScrollLines(1).
10219 return _core_
.Window_LineDown(*args
, **kwargs
)
10221 def PageUp(*args
, **kwargs
):
10223 PageUp(self) -> bool
10225 This is just a wrapper for ScrollPages(-1).
10227 return _core_
.Window_PageUp(*args
, **kwargs
)
10229 def PageDown(*args
, **kwargs
):
10231 PageDown(self) -> bool
10233 This is just a wrapper for ScrollPages(1).
10235 return _core_
.Window_PageDown(*args
, **kwargs
)
10237 def SetHelpText(*args
, **kwargs
):
10239 SetHelpText(self, String text)
10241 Sets the help text to be used as context-sensitive help for this
10242 window. Note that the text is actually stored by the current
10243 `wx.HelpProvider` implementation, and not in the window object itself.
10245 return _core_
.Window_SetHelpText(*args
, **kwargs
)
10247 def SetHelpTextForId(*args
, **kwargs
):
10249 SetHelpTextForId(self, String text)
10251 Associate this help text with all windows with the same id as this
10254 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
10256 def GetHelpTextAtPoint(*args
, **kwargs
):
10258 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10260 Get the help string associated with the given position in this window.
10262 Notice that pt may be invalid if event origin is keyboard or unknown
10263 and this method should return the global window help text then
10266 return _core_
.Window_GetHelpTextAtPoint(*args
, **kwargs
)
10268 def GetHelpText(*args
, **kwargs
):
10270 GetHelpText(self) -> String
10272 Gets the help text to be used as context-sensitive help for this
10273 window. Note that the text is actually stored by the current
10274 `wx.HelpProvider` implementation, and not in the window object itself.
10276 return _core_
.Window_GetHelpText(*args
, **kwargs
)
10278 def SetToolTipString(*args
, **kwargs
):
10280 SetToolTipString(self, String tip)
10282 Attach a tooltip to the window.
10284 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
10286 def SetToolTip(*args
, **kwargs
):
10288 SetToolTip(self, ToolTip tip)
10290 Attach a tooltip to the window.
10292 return _core_
.Window_SetToolTip(*args
, **kwargs
)
10294 def GetToolTip(*args
, **kwargs
):
10296 GetToolTip(self) -> ToolTip
10298 get the associated tooltip or None if none
10300 return _core_
.Window_GetToolTip(*args
, **kwargs
)
10302 def SetDropTarget(*args
, **kwargs
):
10304 SetDropTarget(self, DropTarget dropTarget)
10306 Associates a drop target with this window. If the window already has
10307 a drop target, it is deleted.
10309 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
10311 def GetDropTarget(*args
, **kwargs
):
10313 GetDropTarget(self) -> DropTarget
10315 Returns the associated drop target, which may be None.
10317 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
10319 def DragAcceptFiles(*args
, **kwargs
):
10321 DragAcceptFiles(self, bool accept)
10323 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10324 Only functional on Windows.
10326 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
10328 def SetConstraints(*args
, **kwargs
):
10330 SetConstraints(self, LayoutConstraints constraints)
10332 Sets the window to have the given layout constraints. If an existing
10333 layout constraints object is already owned by the window, it will be
10334 deleted. Pass None to disassociate and delete the window's current
10337 You must call SetAutoLayout to tell a window to use the constraints
10338 automatically in its default EVT_SIZE handler; otherwise, you must
10339 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10340 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10343 return _core_
.Window_SetConstraints(*args
, **kwargs
)
10345 def GetConstraints(*args
, **kwargs
):
10347 GetConstraints(self) -> LayoutConstraints
10349 Returns a pointer to the window's layout constraints, or None if there
10352 return _core_
.Window_GetConstraints(*args
, **kwargs
)
10354 def SetAutoLayout(*args
, **kwargs
):
10356 SetAutoLayout(self, bool autoLayout)
10358 Determines whether the Layout function will be called automatically
10359 when the window is resized. lease note that this only happens for the
10360 windows usually used to contain children, namely `wx.Panel` and
10361 `wx.TopLevelWindow` (and the classes deriving from them).
10363 This method is called implicitly by `SetSizer` but if you use
10364 `SetConstraints` you should call it manually or otherwise the window
10365 layout won't be correctly updated when its size changes.
10367 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
10369 def GetAutoLayout(*args
, **kwargs
):
10371 GetAutoLayout(self) -> bool
10373 Returns the current autoLayout setting
10375 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
10377 def Layout(*args
, **kwargs
):
10379 Layout(self) -> bool
10381 Invokes the constraint-based layout algorithm or the sizer-based
10382 algorithm for this window. See SetAutoLayout: when auto layout is on,
10383 this function gets called automatically by the default EVT_SIZE
10384 handler when the window is resized.
10386 return _core_
.Window_Layout(*args
, **kwargs
)
10388 def SetSizer(*args
, **kwargs
):
10390 SetSizer(self, Sizer sizer, bool deleteOld=True)
10392 Sets the window to have the given layout sizer. The window will then
10393 own the object, and will take care of its deletion. If an existing
10394 layout sizer object is already owned by the window, it will be deleted
10395 if the deleteOld parameter is true. Note that this function will also
10396 call SetAutoLayout implicitly with a True parameter if the sizer is
10397 non-None, and False otherwise.
10399 return _core_
.Window_SetSizer(*args
, **kwargs
)
10401 def SetSizerAndFit(*args
, **kwargs
):
10403 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
10405 The same as SetSizer, except it also sets the size hints for the
10406 window based on the sizer's minimum size.
10408 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
10410 def GetSizer(*args
, **kwargs
):
10412 GetSizer(self) -> Sizer
10414 Return the sizer associated with the window by a previous call to
10415 SetSizer or None if there isn't one.
10417 return _core_
.Window_GetSizer(*args
, **kwargs
)
10419 def SetContainingSizer(*args
, **kwargs
):
10421 SetContainingSizer(self, Sizer sizer)
10423 This normally does not need to be called by application code. It is
10424 called internally when a window is added to a sizer, and is used so
10425 the window can remove itself from the sizer when it is destroyed.
10427 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
10429 def GetContainingSizer(*args
, **kwargs
):
10431 GetContainingSizer(self) -> Sizer
10433 Return the sizer that this window is a member of, if any, otherwise None.
10435 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
10437 def InheritAttributes(*args
, **kwargs
):
10439 InheritAttributes(self)
10441 This function is (or should be, in case of custom controls) called
10442 during window creation to intelligently set up the window visual
10443 attributes, that is the font and the foreground and background
10446 By 'intelligently' the following is meant: by default, all windows use
10447 their own default attributes. However if some of the parent's
10448 attributes are explicitly changed (that is, using SetFont and not
10449 SetOwnFont) and if the corresponding attribute hadn't been
10450 explicitly set for this window itself, then this window takes the same
10451 value as used by the parent. In addition, if the window overrides
10452 ShouldInheritColours to return false, the colours will not be changed
10453 no matter what and only the font might.
10455 This rather complicated logic is necessary in order to accommodate the
10456 different usage scenarios. The most common one is when all default
10457 attributes are used and in this case, nothing should be inherited as
10458 in modern GUIs different controls use different fonts (and colours)
10459 than their siblings so they can't inherit the same value from the
10460 parent. However it was also deemed desirable to allow to simply change
10461 the attributes of all children at once by just changing the font or
10462 colour of their common parent, hence in this case we do inherit the
10463 parents attributes.
10466 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
10468 def ShouldInheritColours(*args
, **kwargs
):
10470 ShouldInheritColours(self) -> bool
10472 Return true from here to allow the colours of this window to be
10473 changed by InheritAttributes, returning false forbids inheriting them
10474 from the parent window.
10476 The base class version returns false, but this method is overridden in
10477 wxControl where it returns true.
10479 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
10481 def CanSetTransparent(*args
, **kwargs
):
10483 CanSetTransparent(self) -> bool
10485 Returns ``True`` if the platform supports setting the transparency for
10486 this window. Note that this method will err on the side of caution,
10487 so it is possible that this will return ``False`` when it is in fact
10488 possible to set the transparency.
10490 NOTE: On X-windows systems the X server must have the composite
10491 extension loaded, and there must be a composite manager program (such
10492 as xcompmgr) running.
10494 return _core_
.Window_CanSetTransparent(*args
, **kwargs
)
10496 def SetTransparent(*args
, **kwargs
):
10498 SetTransparent(self, byte alpha) -> bool
10500 Attempt to set the transparency of this window to the ``alpha`` value,
10501 returns True on success. The ``alpha`` value is an integer in the
10502 range of 0 to 255, where 0 is fully transparent and 255 is fully
10505 return _core_
.Window_SetTransparent(*args
, **kwargs
)
10507 def PostCreate(self
, pre
):
10509 Phase 3 of the 2-phase create <wink!>
10510 Call this method after precreating the window with the 2-phase create method.
10512 self
.this
= pre
.this
10513 self
.thisown
= pre
.thisown
10515 if hasattr(self
, '_setOORInfo'):
10517 self
._setOORInfo
(self
)
10520 if hasattr(self
, '_setCallbackInfo'):
10522 self
._setCallbackInfo
(self
, pre
.__class
__)
10526 def SendSizeEvent(self
):
10527 self
.GetEventHandler().ProcessEvent(wx
.SizeEvent((-1,-1)))
10529 AcceleratorTable
= property(GetAcceleratorTable
,SetAcceleratorTable
,doc
="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10530 AutoLayout
= property(GetAutoLayout
,SetAutoLayout
,doc
="See `GetAutoLayout` and `SetAutoLayout`")
10531 BackgroundColour
= property(GetBackgroundColour
,SetBackgroundColour
,doc
="See `GetBackgroundColour` and `SetBackgroundColour`")
10532 BackgroundStyle
= property(GetBackgroundStyle
,SetBackgroundStyle
,doc
="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10533 EffectiveMinSize
= property(GetEffectiveMinSize
,doc
="See `GetEffectiveMinSize`")
10534 BestSize
= property(GetBestSize
,doc
="See `GetBestSize`")
10535 BestVirtualSize
= property(GetBestVirtualSize
,doc
="See `GetBestVirtualSize`")
10536 Border
= property(GetBorder
,doc
="See `GetBorder`")
10537 Caret
= property(GetCaret
,SetCaret
,doc
="See `GetCaret` and `SetCaret`")
10538 CharHeight
= property(GetCharHeight
,doc
="See `GetCharHeight`")
10539 CharWidth
= property(GetCharWidth
,doc
="See `GetCharWidth`")
10540 Children
= property(GetChildren
,doc
="See `GetChildren`")
10541 ClientAreaOrigin
= property(GetClientAreaOrigin
,doc
="See `GetClientAreaOrigin`")
10542 ClientRect
= property(GetClientRect
,SetClientRect
,doc
="See `GetClientRect` and `SetClientRect`")
10543 ClientSize
= property(GetClientSize
,SetClientSize
,doc
="See `GetClientSize` and `SetClientSize`")
10544 Constraints
= property(GetConstraints
,SetConstraints
,doc
="See `GetConstraints` and `SetConstraints`")
10545 ContainingSizer
= property(GetContainingSizer
,SetContainingSizer
,doc
="See `GetContainingSizer` and `SetContainingSizer`")
10546 Cursor
= property(GetCursor
,SetCursor
,doc
="See `GetCursor` and `SetCursor`")
10547 DefaultAttributes
= property(GetDefaultAttributes
,doc
="See `GetDefaultAttributes`")
10548 DropTarget
= property(GetDropTarget
,SetDropTarget
,doc
="See `GetDropTarget` and `SetDropTarget`")
10549 EventHandler
= property(GetEventHandler
,SetEventHandler
,doc
="See `GetEventHandler` and `SetEventHandler`")
10550 ExtraStyle
= property(GetExtraStyle
,SetExtraStyle
,doc
="See `GetExtraStyle` and `SetExtraStyle`")
10551 Font
= property(GetFont
,SetFont
,doc
="See `GetFont` and `SetFont`")
10552 ForegroundColour
= property(GetForegroundColour
,SetForegroundColour
,doc
="See `GetForegroundColour` and `SetForegroundColour`")
10553 GrandParent
= property(GetGrandParent
,doc
="See `GetGrandParent`")
10554 TopLevelParent
= property(GetTopLevelParent
,doc
="See `GetTopLevelParent`")
10555 Handle
= property(GetHandle
,doc
="See `GetHandle`")
10556 HelpText
= property(GetHelpText
,SetHelpText
,doc
="See `GetHelpText` and `SetHelpText`")
10557 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
10558 Label
= property(GetLabel
,SetLabel
,doc
="See `GetLabel` and `SetLabel`")
10559 LayoutDirection
= property(GetLayoutDirection
,SetLayoutDirection
,doc
="See `GetLayoutDirection` and `SetLayoutDirection`")
10560 MaxHeight
= property(GetMaxHeight
,doc
="See `GetMaxHeight`")
10561 MaxSize
= property(GetMaxSize
,SetMaxSize
,doc
="See `GetMaxSize` and `SetMaxSize`")
10562 MaxWidth
= property(GetMaxWidth
,doc
="See `GetMaxWidth`")
10563 MinHeight
= property(GetMinHeight
,doc
="See `GetMinHeight`")
10564 MinSize
= property(GetMinSize
,SetMinSize
,doc
="See `GetMinSize` and `SetMinSize`")
10565 MinWidth
= property(GetMinWidth
,doc
="See `GetMinWidth`")
10566 Name
= property(GetName
,SetName
,doc
="See `GetName` and `SetName`")
10567 Parent
= property(GetParent
,doc
="See `GetParent`")
10568 Position
= property(GetPosition
,SetPosition
,doc
="See `GetPosition` and `SetPosition`")
10569 Rect
= property(GetRect
,SetRect
,doc
="See `GetRect` and `SetRect`")
10570 ScreenPosition
= property(GetScreenPosition
,doc
="See `GetScreenPosition`")
10571 ScreenRect
= property(GetScreenRect
,doc
="See `GetScreenRect`")
10572 Size
= property(GetSize
,SetSize
,doc
="See `GetSize` and `SetSize`")
10573 Sizer
= property(GetSizer
,SetSizer
,doc
="See `GetSizer` and `SetSizer`")
10574 ThemeEnabled
= property(GetThemeEnabled
,SetThemeEnabled
,doc
="See `GetThemeEnabled` and `SetThemeEnabled`")
10575 ToolTip
= property(GetToolTip
,SetToolTip
,doc
="See `GetToolTip` and `SetToolTip`")
10576 UpdateClientRect
= property(GetUpdateClientRect
,doc
="See `GetUpdateClientRect`")
10577 UpdateRegion
= property(GetUpdateRegion
,doc
="See `GetUpdateRegion`")
10578 Validator
= property(GetValidator
,SetValidator
,doc
="See `GetValidator` and `SetValidator`")
10579 VirtualSize
= property(GetVirtualSize
,SetVirtualSize
,doc
="See `GetVirtualSize` and `SetVirtualSize`")
10580 WindowStyle
= property(GetWindowStyle
,SetWindowStyle
,doc
="See `GetWindowStyle` and `SetWindowStyle`")
10581 WindowStyleFlag
= property(GetWindowStyleFlag
,SetWindowStyleFlag
,doc
="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10582 WindowVariant
= property(GetWindowVariant
,SetWindowVariant
,doc
="See `GetWindowVariant` and `SetWindowVariant`")
10583 Shown
= property(IsShown
,Show
,doc
="See `IsShown` and `Show`")
10584 Enabled
= property(IsEnabled
,Enable
,doc
="See `IsEnabled` and `Enable`")
10585 TopLevel
= property(IsTopLevel
,doc
="See `IsTopLevel`")
10586 _core_
.Window_swigregister(Window
)
10588 def PreWindow(*args
, **kwargs
):
10590 PreWindow() -> Window
10592 Precreate a Window for 2-phase creation.
10594 val
= _core_
.new_PreWindow(*args
, **kwargs
)
10597 def Window_NewControlId(*args
):
10599 Window_NewControlId() -> int
10601 Generate a control id for the controls which were not given one.
10603 return _core_
.Window_NewControlId(*args
)
10605 def Window_NextControlId(*args
, **kwargs
):
10607 Window_NextControlId(int winid) -> int
10609 Get the id of the control following the one with the given
10612 return _core_
.Window_NextControlId(*args
, **kwargs
)
10614 def Window_PrevControlId(*args
, **kwargs
):
10616 Window_PrevControlId(int winid) -> int
10618 Get the id of the control preceding the one with the given
10621 return _core_
.Window_PrevControlId(*args
, **kwargs
)
10623 def Window_FindFocus(*args
):
10625 Window_FindFocus() -> Window
10627 Returns the window or control that currently has the keyboard focus,
10630 return _core_
.Window_FindFocus(*args
)
10632 def Window_GetCapture(*args
):
10634 Window_GetCapture() -> Window
10636 Returns the window which currently captures the mouse or None
10638 return _core_
.Window_GetCapture(*args
)
10640 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
10642 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10644 Get the default attributes for this class. This is useful if you want
10645 to use the same font or colour in your own control as in a standard
10646 control -- which is a much better idea than hard coding specific
10647 colours or fonts which might look completely out of place on the
10648 user's system, especially if it uses themes.
10650 The variant parameter is only relevant under Mac currently and is
10651 ignore under other platforms. Under Mac, it will change the size of
10652 the returned font. See `wx.Window.SetWindowVariant` for more about
10655 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
10657 def DLG_PNT(win
, point_or_x
, y
=None):
10659 Convenience function for converting a Point or (x,y) in
10660 dialog units to pixel units.
10663 return win
.ConvertDialogPointToPixels(point_or_x
)
10665 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
10667 def DLG_SZE(win
, size_width
, height
=None):
10669 Convenience function for converting a Size or (w,h) in
10670 dialog units to pixel units.
10673 return win
.ConvertDialogSizeToPixels(size_width
)
10675 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
10678 def FindWindowById(*args
, **kwargs
):
10680 FindWindowById(long id, Window parent=None) -> Window
10682 Find the first window in the application with the given id. If parent
10683 is None, the search will start from all top-level frames and dialog
10684 boxes; if non-None, the search will be limited to the given window
10685 hierarchy. The search is recursive in both cases.
10687 return _core_
.FindWindowById(*args
, **kwargs
)
10689 def FindWindowByName(*args
, **kwargs
):
10691 FindWindowByName(String name, Window parent=None) -> Window
10693 Find a window by its name (as given in a window constructor or Create
10694 function call). If parent is None, the search will start from all
10695 top-level frames and dialog boxes; if non-None, the search will be
10696 limited to the given window hierarchy. The search is recursive in both
10699 If no window with such name is found, wx.FindWindowByLabel is called.
10701 return _core_
.FindWindowByName(*args
, **kwargs
)
10703 def FindWindowByLabel(*args
, **kwargs
):
10705 FindWindowByLabel(String label, Window parent=None) -> Window
10707 Find a window by its label. Depending on the type of window, the label
10708 may be a window title or panel item label. If parent is None, the
10709 search will start from all top-level frames and dialog boxes; if
10710 non-None, the search will be limited to the given window
10711 hierarchy. The search is recursive in both cases.
10713 return _core_
.FindWindowByLabel(*args
, **kwargs
)
10715 def Window_FromHWND(*args
, **kwargs
):
10716 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10717 return _core_
.Window_FromHWND(*args
, **kwargs
)
10719 def GetTopLevelWindows(*args
):
10721 GetTopLevelWindows() -> PyObject
10723 Returns a list of the the application's top-level windows, (frames,
10724 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10725 by wxWidgets, and so it is only valid as long as no top-level windows
10726 are closed or new top-level windows are created.
10729 return _core_
.GetTopLevelWindows(*args
)
10730 #---------------------------------------------------------------------------
10732 class Validator(EvtHandler
):
10733 """Proxy of C++ Validator class"""
10734 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10735 __repr__
= _swig_repr
10736 def __init__(self
, *args
, **kwargs
):
10737 """__init__(self) -> Validator"""
10738 _core_
.Validator_swiginit(self
,_core_
.new_Validator(*args
, **kwargs
))
10739 self
._setOORInfo
(self
)
10741 def Clone(*args
, **kwargs
):
10742 """Clone(self) -> Validator"""
10743 return _core_
.Validator_Clone(*args
, **kwargs
)
10745 def Validate(*args
, **kwargs
):
10746 """Validate(self, Window parent) -> bool"""
10747 return _core_
.Validator_Validate(*args
, **kwargs
)
10749 def TransferToWindow(*args
, **kwargs
):
10750 """TransferToWindow(self) -> bool"""
10751 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
10753 def TransferFromWindow(*args
, **kwargs
):
10754 """TransferFromWindow(self) -> bool"""
10755 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
10757 def GetWindow(*args
, **kwargs
):
10758 """GetWindow(self) -> Window"""
10759 return _core_
.Validator_GetWindow(*args
, **kwargs
)
10761 def SetWindow(*args
, **kwargs
):
10762 """SetWindow(self, Window window)"""
10763 return _core_
.Validator_SetWindow(*args
, **kwargs
)
10765 def IsSilent(*args
, **kwargs
):
10766 """IsSilent() -> bool"""
10767 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10769 IsSilent
= staticmethod(IsSilent
)
10770 def SetBellOnError(*args
, **kwargs
):
10771 """SetBellOnError(int doIt=True)"""
10772 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10774 SetBellOnError
= staticmethod(SetBellOnError
)
10775 Window
= property(GetWindow
,SetWindow
,doc
="See `GetWindow` and `SetWindow`")
10776 _core_
.Validator_swigregister(Validator
)
10778 def Validator_IsSilent(*args
):
10779 """Validator_IsSilent() -> bool"""
10780 return _core_
.Validator_IsSilent(*args
)
10782 def Validator_SetBellOnError(*args
, **kwargs
):
10783 """Validator_SetBellOnError(int doIt=True)"""
10784 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10786 class PyValidator(Validator
):
10787 """Proxy of C++ PyValidator class"""
10788 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10789 __repr__
= _swig_repr
10790 def __init__(self
, *args
, **kwargs
):
10791 """__init__(self) -> PyValidator"""
10792 _core_
.PyValidator_swiginit(self
,_core_
.new_PyValidator(*args
, **kwargs
))
10793 self
._setOORInfo
(self
);PyValidator
._setCallbackInfo
(self
, self
, PyValidator
)
10795 def _setCallbackInfo(*args
, **kwargs
):
10796 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
10797 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
10799 _core_
.PyValidator_swigregister(PyValidator
)
10801 #---------------------------------------------------------------------------
10803 class Menu(EvtHandler
):
10804 """Proxy of C++ Menu class"""
10805 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10806 __repr__
= _swig_repr
10807 def __init__(self
, *args
, **kwargs
):
10808 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10809 _core_
.Menu_swiginit(self
,_core_
.new_Menu(*args
, **kwargs
))
10810 self
._setOORInfo
(self
)
10812 def Append(*args
, **kwargs
):
10814 Append(self, int id, String text=EmptyString, String help=EmptyString,
10815 int kind=ITEM_NORMAL) -> MenuItem
10817 return _core_
.Menu_Append(*args
, **kwargs
)
10819 def AppendSeparator(*args
, **kwargs
):
10820 """AppendSeparator(self) -> MenuItem"""
10821 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
10823 def AppendCheckItem(*args
, **kwargs
):
10824 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10825 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
10827 def AppendRadioItem(*args
, **kwargs
):
10828 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10829 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
10831 def AppendMenu(*args
, **kwargs
):
10832 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10833 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
10835 def AppendSubMenu(*args
, **kwargs
):
10836 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10837 return _core_
.Menu_AppendSubMenu(*args
, **kwargs
)
10839 def AppendItem(*args
, **kwargs
):
10840 """AppendItem(self, MenuItem item) -> MenuItem"""
10841 return _core_
.Menu_AppendItem(*args
, **kwargs
)
10843 def InsertItem(*args
, **kwargs
):
10844 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10845 return _core_
.Menu_InsertItem(*args
, **kwargs
)
10847 def PrependItem(*args
, **kwargs
):
10848 """PrependItem(self, MenuItem item) -> MenuItem"""
10849 return _core_
.Menu_PrependItem(*args
, **kwargs
)
10851 def Break(*args
, **kwargs
):
10853 return _core_
.Menu_Break(*args
, **kwargs
)
10855 def Insert(*args
, **kwargs
):
10857 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
10858 int kind=ITEM_NORMAL) -> MenuItem
10860 return _core_
.Menu_Insert(*args
, **kwargs
)
10862 def InsertSeparator(*args
, **kwargs
):
10863 """InsertSeparator(self, size_t pos) -> MenuItem"""
10864 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
10866 def InsertCheckItem(*args
, **kwargs
):
10867 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10868 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
10870 def InsertRadioItem(*args
, **kwargs
):
10871 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10872 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
10874 def InsertMenu(*args
, **kwargs
):
10875 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10876 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
10878 def Prepend(*args
, **kwargs
):
10880 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10881 int kind=ITEM_NORMAL) -> MenuItem
10883 return _core_
.Menu_Prepend(*args
, **kwargs
)
10885 def PrependSeparator(*args
, **kwargs
):
10886 """PrependSeparator(self) -> MenuItem"""
10887 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
10889 def PrependCheckItem(*args
, **kwargs
):
10890 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10891 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
10893 def PrependRadioItem(*args
, **kwargs
):
10894 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10895 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
10897 def PrependMenu(*args
, **kwargs
):
10898 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10899 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
10901 def Remove(*args
, **kwargs
):
10902 """Remove(self, int id) -> MenuItem"""
10903 return _core_
.Menu_Remove(*args
, **kwargs
)
10905 def RemoveItem(self
, item
):
10906 """RemoveItem(self, MenuItem item) -> MenuItem"""
10907 #// The return object is always the parameter, so return that
10908 #// proxy instead of the new one
10909 val
= _core_
.Menu_RemoveItem(self
, item
)
10910 item
.this
.own(val
.this
.own())
10915 def Delete(*args
, **kwargs
):
10916 """Delete(self, int id) -> bool"""
10917 return _core_
.Menu_Delete(*args
, **kwargs
)
10919 def DeleteItem(*args
, **kwargs
):
10920 """DeleteItem(self, MenuItem item) -> bool"""
10921 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
10923 def Destroy(*args
, **kwargs
):
10927 Deletes the C++ object this Python object is a proxy for.
10929 args
[0].this
.own(False)
10930 return _core_
.Menu_Destroy(*args
, **kwargs
)
10932 def DestroyId(*args
, **kwargs
):
10933 """DestroyId(self, int id) -> bool"""
10934 return _core_
.Menu_DestroyId(*args
, **kwargs
)
10936 def DestroyItem(*args
, **kwargs
):
10937 """DestroyItem(self, MenuItem item) -> bool"""
10938 return _core_
.Menu_DestroyItem(*args
, **kwargs
)
10940 def GetMenuItemCount(*args
, **kwargs
):
10941 """GetMenuItemCount(self) -> size_t"""
10942 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
10944 def GetMenuItems(*args
, **kwargs
):
10945 """GetMenuItems(self) -> PyObject"""
10946 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
10948 def FindItem(*args
, **kwargs
):
10949 """FindItem(self, String item) -> int"""
10950 return _core_
.Menu_FindItem(*args
, **kwargs
)
10952 def FindItemById(*args
, **kwargs
):
10953 """FindItemById(self, int id) -> MenuItem"""
10954 return _core_
.Menu_FindItemById(*args
, **kwargs
)
10956 def FindItemByPosition(*args
, **kwargs
):
10957 """FindItemByPosition(self, size_t position) -> MenuItem"""
10958 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
10960 def Enable(*args
, **kwargs
):
10961 """Enable(self, int id, bool enable)"""
10962 return _core_
.Menu_Enable(*args
, **kwargs
)
10964 def IsEnabled(*args
, **kwargs
):
10965 """IsEnabled(self, int id) -> bool"""
10966 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
10968 def Check(*args
, **kwargs
):
10969 """Check(self, int id, bool check)"""
10970 return _core_
.Menu_Check(*args
, **kwargs
)
10972 def IsChecked(*args
, **kwargs
):
10973 """IsChecked(self, int id) -> bool"""
10974 return _core_
.Menu_IsChecked(*args
, **kwargs
)
10976 def SetLabel(*args
, **kwargs
):
10977 """SetLabel(self, int id, String label)"""
10978 return _core_
.Menu_SetLabel(*args
, **kwargs
)
10980 def GetLabel(*args
, **kwargs
):
10981 """GetLabel(self, int id) -> String"""
10982 return _core_
.Menu_GetLabel(*args
, **kwargs
)
10984 def SetHelpString(*args
, **kwargs
):
10985 """SetHelpString(self, int id, String helpString)"""
10986 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
10988 def GetHelpString(*args
, **kwargs
):
10989 """GetHelpString(self, int id) -> String"""
10990 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
10992 def SetTitle(*args
, **kwargs
):
10993 """SetTitle(self, String title)"""
10994 return _core_
.Menu_SetTitle(*args
, **kwargs
)
10996 def GetTitle(*args
, **kwargs
):
10997 """GetTitle(self) -> String"""
10998 return _core_
.Menu_GetTitle(*args
, **kwargs
)
11000 def SetEventHandler(*args
, **kwargs
):
11001 """SetEventHandler(self, EvtHandler handler)"""
11002 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
11004 def GetEventHandler(*args
, **kwargs
):
11005 """GetEventHandler(self) -> EvtHandler"""
11006 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
11008 def SetInvokingWindow(*args
, **kwargs
):
11009 """SetInvokingWindow(self, Window win)"""
11010 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
11012 def GetInvokingWindow(*args
, **kwargs
):
11013 """GetInvokingWindow(self) -> Window"""
11014 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
11016 def GetStyle(*args
, **kwargs
):
11017 """GetStyle(self) -> long"""
11018 return _core_
.Menu_GetStyle(*args
, **kwargs
)
11020 def UpdateUI(*args
, **kwargs
):
11021 """UpdateUI(self, EvtHandler source=None)"""
11022 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
11024 def GetMenuBar(*args
, **kwargs
):
11025 """GetMenuBar(self) -> MenuBar"""
11026 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
11028 def Attach(*args
, **kwargs
):
11029 """Attach(self, wxMenuBarBase menubar)"""
11030 return _core_
.Menu_Attach(*args
, **kwargs
)
11032 def Detach(*args
, **kwargs
):
11034 return _core_
.Menu_Detach(*args
, **kwargs
)
11036 def IsAttached(*args
, **kwargs
):
11037 """IsAttached(self) -> bool"""
11038 return _core_
.Menu_IsAttached(*args
, **kwargs
)
11040 def SetParent(*args
, **kwargs
):
11041 """SetParent(self, Menu parent)"""
11042 return _core_
.Menu_SetParent(*args
, **kwargs
)
11044 def GetParent(*args
, **kwargs
):
11045 """GetParent(self) -> Menu"""
11046 return _core_
.Menu_GetParent(*args
, **kwargs
)
11048 EventHandler
= property(GetEventHandler
,SetEventHandler
,doc
="See `GetEventHandler` and `SetEventHandler`")
11049 HelpString
= property(GetHelpString
,SetHelpString
,doc
="See `GetHelpString` and `SetHelpString`")
11050 InvokingWindow
= property(GetInvokingWindow
,SetInvokingWindow
,doc
="See `GetInvokingWindow` and `SetInvokingWindow`")
11051 MenuBar
= property(GetMenuBar
,doc
="See `GetMenuBar`")
11052 MenuItemCount
= property(GetMenuItemCount
,doc
="See `GetMenuItemCount`")
11053 MenuItems
= property(GetMenuItems
,doc
="See `GetMenuItems`")
11054 Parent
= property(GetParent
,SetParent
,doc
="See `GetParent` and `SetParent`")
11055 Style
= property(GetStyle
,doc
="See `GetStyle`")
11056 Title
= property(GetTitle
,SetTitle
,doc
="See `GetTitle` and `SetTitle`")
11057 _core_
.Menu_swigregister(Menu
)
11058 DefaultValidator
= cvar
.DefaultValidator
11060 #---------------------------------------------------------------------------
11062 class MenuBar(Window
):
11063 """Proxy of C++ MenuBar class"""
11064 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11065 __repr__
= _swig_repr
11066 def __init__(self
, *args
, **kwargs
):
11067 """__init__(self, long style=0) -> MenuBar"""
11068 _core_
.MenuBar_swiginit(self
,_core_
.new_MenuBar(*args
, **kwargs
))
11069 self
._setOORInfo
(self
)
11071 def Append(*args
, **kwargs
):
11072 """Append(self, Menu menu, String title) -> bool"""
11073 return _core_
.MenuBar_Append(*args
, **kwargs
)
11075 def Insert(*args
, **kwargs
):
11076 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
11077 return _core_
.MenuBar_Insert(*args
, **kwargs
)
11079 def GetMenuCount(*args
, **kwargs
):
11080 """GetMenuCount(self) -> size_t"""
11081 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
11083 def GetMenu(*args
, **kwargs
):
11084 """GetMenu(self, size_t pos) -> Menu"""
11085 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
11087 def Replace(*args
, **kwargs
):
11088 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
11089 return _core_
.MenuBar_Replace(*args
, **kwargs
)
11091 def Remove(*args
, **kwargs
):
11092 """Remove(self, size_t pos) -> Menu"""
11093 return _core_
.MenuBar_Remove(*args
, **kwargs
)
11095 def EnableTop(*args
, **kwargs
):
11096 """EnableTop(self, size_t pos, bool enable)"""
11097 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
11099 def IsEnabledTop(*args
, **kwargs
):
11100 """IsEnabledTop(self, size_t pos) -> bool"""
11101 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
11103 def SetLabelTop(*args
, **kwargs
):
11104 """SetLabelTop(self, size_t pos, String label)"""
11105 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
11107 def GetLabelTop(*args
, **kwargs
):
11108 """GetLabelTop(self, size_t pos) -> String"""
11109 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
11111 def FindMenuItem(*args
, **kwargs
):
11112 """FindMenuItem(self, String menu, String item) -> int"""
11113 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
11115 def FindItemById(*args
, **kwargs
):
11116 """FindItemById(self, int id) -> MenuItem"""
11117 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
11119 def FindMenu(*args
, **kwargs
):
11120 """FindMenu(self, String title) -> int"""
11121 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
11123 def Enable(*args
, **kwargs
):
11124 """Enable(self, int id, bool enable)"""
11125 return _core_
.MenuBar_Enable(*args
, **kwargs
)
11127 def Check(*args
, **kwargs
):
11128 """Check(self, int id, bool check)"""
11129 return _core_
.MenuBar_Check(*args
, **kwargs
)
11131 def IsChecked(*args
, **kwargs
):
11132 """IsChecked(self, int id) -> bool"""
11133 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
11135 def IsEnabled(*args
, **kwargs
):
11136 """IsEnabled(self, int id) -> bool"""
11137 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
11139 def SetLabel(*args
, **kwargs
):
11140 """SetLabel(self, int id, String label)"""
11141 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
11143 def GetLabel(*args
, **kwargs
):
11144 """GetLabel(self, int id) -> String"""
11145 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
11147 def SetHelpString(*args
, **kwargs
):
11148 """SetHelpString(self, int id, String helpString)"""
11149 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
11151 def GetHelpString(*args
, **kwargs
):
11152 """GetHelpString(self, int id) -> String"""
11153 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
11155 def GetFrame(*args
, **kwargs
):
11156 """GetFrame(self) -> wxFrame"""
11157 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
11159 def IsAttached(*args
, **kwargs
):
11160 """IsAttached(self) -> bool"""
11161 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
11163 def Attach(*args
, **kwargs
):
11164 """Attach(self, wxFrame frame)"""
11165 return _core_
.MenuBar_Attach(*args
, **kwargs
)
11167 def Detach(*args
, **kwargs
):
11169 return _core_
.MenuBar_Detach(*args
, **kwargs
)
11171 def UpdateMenus(*args
, **kwargs
):
11172 """UpdateMenus(self)"""
11173 return _core_
.MenuBar_UpdateMenus(*args
, **kwargs
)
11175 def SetAutoWindowMenu(*args
, **kwargs
):
11176 """SetAutoWindowMenu(bool enable)"""
11177 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
11179 SetAutoWindowMenu
= staticmethod(SetAutoWindowMenu
)
11180 def GetAutoWindowMenu(*args
, **kwargs
):
11181 """GetAutoWindowMenu() -> bool"""
11182 return _core_
.MenuBar_GetAutoWindowMenu(*args
, **kwargs
)
11184 GetAutoWindowMenu
= staticmethod(GetAutoWindowMenu
)
11185 def GetMenus(self
):
11186 """Return a list of (menu, label) items for the menus in the MenuBar. """
11187 return [(self
.GetMenu(i
), self
.GetLabelTop(i
))
11188 for i
in range(self
.GetMenuCount())]
11190 def SetMenus(self
, items
):
11191 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11192 for i
in range(self
.GetMenuCount()-1, -1, -1):
11197 Frame
= property(GetFrame
,doc
="See `GetFrame`")
11198 MenuCount
= property(GetMenuCount
,doc
="See `GetMenuCount`")
11199 Menus
= property(GetMenus
,SetMenus
,doc
="See `GetMenus` and `SetMenus`")
11200 _core_
.MenuBar_swigregister(MenuBar
)
11202 def MenuBar_SetAutoWindowMenu(*args
, **kwargs
):
11203 """MenuBar_SetAutoWindowMenu(bool enable)"""
11204 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
11206 def MenuBar_GetAutoWindowMenu(*args
):
11207 """MenuBar_GetAutoWindowMenu() -> bool"""
11208 return _core_
.MenuBar_GetAutoWindowMenu(*args
)
11210 #---------------------------------------------------------------------------
11212 class MenuItem(Object
):
11213 """Proxy of C++ MenuItem class"""
11214 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11215 __repr__
= _swig_repr
11216 def __init__(self
, *args
, **kwargs
):
11218 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
11219 String help=EmptyString, int kind=ITEM_NORMAL,
11220 Menu subMenu=None) -> MenuItem
11222 _core_
.MenuItem_swiginit(self
,_core_
.new_MenuItem(*args
, **kwargs
))
11223 __swig_destroy__
= _core_
.delete_MenuItem
11224 __del__
= lambda self
: None;
11225 def Destroy(self
): pass
11226 def GetMenu(*args
, **kwargs
):
11227 """GetMenu(self) -> Menu"""
11228 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
11230 def SetMenu(*args
, **kwargs
):
11231 """SetMenu(self, Menu menu)"""
11232 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
11234 def SetId(*args
, **kwargs
):
11235 """SetId(self, int id)"""
11236 return _core_
.MenuItem_SetId(*args
, **kwargs
)
11238 def GetId(*args
, **kwargs
):
11239 """GetId(self) -> int"""
11240 return _core_
.MenuItem_GetId(*args
, **kwargs
)
11242 def IsSeparator(*args
, **kwargs
):
11243 """IsSeparator(self) -> bool"""
11244 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
11246 def SetText(*args
, **kwargs
):
11247 """SetText(self, String str)"""
11248 return _core_
.MenuItem_SetText(*args
, **kwargs
)
11250 def GetLabel(*args
, **kwargs
):
11251 """GetLabel(self) -> String"""
11252 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
11254 def GetText(*args
, **kwargs
):
11255 """GetText(self) -> String"""
11256 return _core_
.MenuItem_GetText(*args
, **kwargs
)
11258 def GetLabelFromText(*args
, **kwargs
):
11259 """GetLabelFromText(String text) -> String"""
11260 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
11262 GetLabelFromText
= staticmethod(GetLabelFromText
)
11263 def GetKind(*args
, **kwargs
):
11264 """GetKind(self) -> int"""
11265 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
11267 def SetKind(*args
, **kwargs
):
11268 """SetKind(self, int kind)"""
11269 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
11271 def SetCheckable(*args
, **kwargs
):
11272 """SetCheckable(self, bool checkable)"""
11273 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
11275 def IsCheckable(*args
, **kwargs
):
11276 """IsCheckable(self) -> bool"""
11277 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
11279 def IsSubMenu(*args
, **kwargs
):
11280 """IsSubMenu(self) -> bool"""
11281 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
11283 def SetSubMenu(*args
, **kwargs
):
11284 """SetSubMenu(self, Menu menu)"""
11285 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
11287 def GetSubMenu(*args
, **kwargs
):
11288 """GetSubMenu(self) -> Menu"""
11289 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
11291 def Enable(*args
, **kwargs
):
11292 """Enable(self, bool enable=True)"""
11293 return _core_
.MenuItem_Enable(*args
, **kwargs
)
11295 def IsEnabled(*args
, **kwargs
):
11296 """IsEnabled(self) -> bool"""
11297 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
11299 def Check(*args
, **kwargs
):
11300 """Check(self, bool check=True)"""
11301 return _core_
.MenuItem_Check(*args
, **kwargs
)
11303 def IsChecked(*args
, **kwargs
):
11304 """IsChecked(self) -> bool"""
11305 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
11307 def Toggle(*args
, **kwargs
):
11309 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
11311 def SetHelp(*args
, **kwargs
):
11312 """SetHelp(self, String str)"""
11313 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
11315 def GetHelp(*args
, **kwargs
):
11316 """GetHelp(self) -> String"""
11317 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
11319 def GetAccel(*args
, **kwargs
):
11320 """GetAccel(self) -> AcceleratorEntry"""
11321 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
11323 def SetAccel(*args
, **kwargs
):
11324 """SetAccel(self, AcceleratorEntry accel)"""
11325 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
11327 def SetBitmap(*args
, **kwargs
):
11328 """SetBitmap(self, Bitmap bitmap)"""
11329 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
11331 def GetBitmap(*args
, **kwargs
):
11332 """GetBitmap(self) -> Bitmap"""
11333 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
11335 def SetFont(*args
, **kwargs
):
11336 """SetFont(self, Font font)"""
11337 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
11339 def GetFont(*args
, **kwargs
):
11340 """GetFont(self) -> Font"""
11341 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
11343 def SetTextColour(*args
, **kwargs
):
11344 """SetTextColour(self, Colour colText)"""
11345 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
11347 def GetTextColour(*args
, **kwargs
):
11348 """GetTextColour(self) -> Colour"""
11349 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
11351 def SetBackgroundColour(*args
, **kwargs
):
11352 """SetBackgroundColour(self, Colour colBack)"""
11353 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
11355 def GetBackgroundColour(*args
, **kwargs
):
11356 """GetBackgroundColour(self) -> Colour"""
11357 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
11359 def SetBitmaps(*args
, **kwargs
):
11360 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11361 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
11363 def SetDisabledBitmap(*args
, **kwargs
):
11364 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11365 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
11367 def GetDisabledBitmap(*args
, **kwargs
):
11368 """GetDisabledBitmap(self) -> Bitmap"""
11369 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
11371 def SetMarginWidth(*args
, **kwargs
):
11372 """SetMarginWidth(self, int nWidth)"""
11373 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
11375 def GetMarginWidth(*args
, **kwargs
):
11376 """GetMarginWidth(self) -> int"""
11377 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
11379 def GetDefaultMarginWidth(*args
, **kwargs
):
11380 """GetDefaultMarginWidth() -> int"""
11381 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
11383 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
11384 def IsOwnerDrawn(*args
, **kwargs
):
11385 """IsOwnerDrawn(self) -> bool"""
11386 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
11388 def SetOwnerDrawn(*args
, **kwargs
):
11389 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11390 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
11392 def ResetOwnerDrawn(*args
, **kwargs
):
11393 """ResetOwnerDrawn(self)"""
11394 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
11396 Accel
= property(GetAccel
,SetAccel
,doc
="See `GetAccel` and `SetAccel`")
11397 BackgroundColour
= property(GetBackgroundColour
,SetBackgroundColour
,doc
="See `GetBackgroundColour` and `SetBackgroundColour`")
11398 Bitmap
= property(GetBitmap
,SetBitmap
,doc
="See `GetBitmap` and `SetBitmap`")
11399 DisabledBitmap
= property(GetDisabledBitmap
,SetDisabledBitmap
,doc
="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11400 Font
= property(GetFont
,SetFont
,doc
="See `GetFont` and `SetFont`")
11401 Help
= property(GetHelp
,SetHelp
,doc
="See `GetHelp` and `SetHelp`")
11402 Id
= property(GetId
,SetId
,doc
="See `GetId` and `SetId`")
11403 Kind
= property(GetKind
,SetKind
,doc
="See `GetKind` and `SetKind`")
11404 Label
= property(GetLabel
,doc
="See `GetLabel`")
11405 MarginWidth
= property(GetMarginWidth
,SetMarginWidth
,doc
="See `GetMarginWidth` and `SetMarginWidth`")
11406 Menu
= property(GetMenu
,SetMenu
,doc
="See `GetMenu` and `SetMenu`")
11407 SubMenu
= property(GetSubMenu
,SetSubMenu
,doc
="See `GetSubMenu` and `SetSubMenu`")
11408 Text
= property(GetText
,SetText
,doc
="See `GetText` and `SetText`")
11409 TextColour
= property(GetTextColour
,SetTextColour
,doc
="See `GetTextColour` and `SetTextColour`")
11410 _core_
.MenuItem_swigregister(MenuItem
)
11412 def MenuItem_GetLabelFromText(*args
, **kwargs
):
11413 """MenuItem_GetLabelFromText(String text) -> String"""
11414 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
11416 def MenuItem_GetDefaultMarginWidth(*args
):
11417 """MenuItem_GetDefaultMarginWidth() -> int"""
11418 return _core_
.MenuItem_GetDefaultMarginWidth(*args
)
11420 #---------------------------------------------------------------------------
11422 class Control(Window
):
11424 This is the base class for a control or 'widget'.
11426 A control is generally a small window which processes user input
11427 and/or displays one or more item of data.
11429 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11430 __repr__
= _swig_repr
11431 def __init__(self
, *args
, **kwargs
):
11433 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11434 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11435 String name=ControlNameStr) -> Control
11437 Create a Control. Normally you should only call this from a subclass'
11438 __init__ as a plain old wx.Control is not very useful.
11440 _core_
.Control_swiginit(self
,_core_
.new_Control(*args
, **kwargs
))
11441 self
._setOORInfo
(self
)
11443 def Create(*args
, **kwargs
):
11445 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11446 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11447 String name=ControlNameStr) -> bool
11449 Do the 2nd phase and create the GUI control.
11451 return _core_
.Control_Create(*args
, **kwargs
)
11453 def GetAlignment(*args
, **kwargs
):
11455 GetAlignment(self) -> int
11457 Get the control alignment (left/right/centre, top/bottom/centre)
11459 return _core_
.Control_GetAlignment(*args
, **kwargs
)
11461 def GetLabelText(*args
, **kwargs
):
11463 GetLabelText(self) -> String
11465 Get just the text of the label, without mnemonic characters ('&')
11467 return _core_
.Control_GetLabelText(*args
, **kwargs
)
11469 def Command(*args
, **kwargs
):
11471 Command(self, CommandEvent event)
11473 Simulates the effect of the user issuing a command to the item.
11475 :see: `wx.CommandEvent`
11478 return _core_
.Control_Command(*args
, **kwargs
)
11480 def RemoveMnemonics(*args
, **kwargs
):
11482 RemoveMnemonics(String str) -> String
11484 removes the mnemonics characters
11486 return _core_
.Control_RemoveMnemonics(*args
, **kwargs
)
11488 RemoveMnemonics
= staticmethod(RemoveMnemonics
)
11489 def GetClassDefaultAttributes(*args
, **kwargs
):
11491 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11493 Get the default attributes for this class. This is useful if you want
11494 to use the same font or colour in your own control as in a standard
11495 control -- which is a much better idea than hard coding specific
11496 colours or fonts which might look completely out of place on the
11497 user's system, especially if it uses themes.
11499 The variant parameter is only relevant under Mac currently and is
11500 ignore under other platforms. Under Mac, it will change the size of
11501 the returned font. See `wx.Window.SetWindowVariant` for more about
11504 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
11506 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
11507 Alignment
= property(GetAlignment
,doc
="See `GetAlignment`")
11508 LabelText
= property(GetLabelText
,doc
="See `GetLabelText`")
11509 _core_
.Control_swigregister(Control
)
11510 ControlNameStr
= cvar
.ControlNameStr
11512 def PreControl(*args
, **kwargs
):
11514 PreControl() -> Control
11516 Precreate a Control control for 2-phase creation
11518 val
= _core_
.new_PreControl(*args
, **kwargs
)
11521 def Control_RemoveMnemonics(*args
, **kwargs
):
11523 Control_RemoveMnemonics(String str) -> String
11525 removes the mnemonics characters
11527 return _core_
.Control_RemoveMnemonics(*args
, **kwargs
)
11529 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
11531 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11533 Get the default attributes for this class. This is useful if you want
11534 to use the same font or colour in your own control as in a standard
11535 control -- which is a much better idea than hard coding specific
11536 colours or fonts which might look completely out of place on the
11537 user's system, especially if it uses themes.
11539 The variant parameter is only relevant under Mac currently and is
11540 ignore under other platforms. Under Mac, it will change the size of
11541 the returned font. See `wx.Window.SetWindowVariant` for more about
11544 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
11546 #---------------------------------------------------------------------------
11548 class ItemContainer(object):
11550 The wx.ItemContainer class defines an interface which is implemented
11551 by all controls which have string subitems, each of which may be
11552 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11553 as `wx.ComboBox` which implements an extended interface deriving from
11556 It defines the methods for accessing the control's items and although
11557 each of the derived classes implements them differently, they still
11558 all conform to the same interface.
11560 The items in a wx.ItemContainer have (non empty) string labels and,
11561 optionally, client data associated with them.
11564 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11565 def __init__(self
): raise AttributeError, "No constructor defined"
11566 __repr__
= _swig_repr
11567 def Append(*args
, **kwargs
):
11569 Append(self, String item, PyObject clientData=None) -> int
11571 Adds the item to the control, associating the given data with the item
11572 if not None. The return value is the index of the newly added item
11573 which may be different from the last one if the control is sorted (e.g.
11574 has wx.LB_SORT or wx.CB_SORT style).
11576 return _core_
.ItemContainer_Append(*args
, **kwargs
)
11578 def AppendItems(*args
, **kwargs
):
11580 AppendItems(self, List strings)
11582 Apend several items at once to the control. Notice that calling this
11583 method may be much faster than appending the items one by one if you
11584 need to add a lot of items.
11586 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
11588 def Insert(*args
, **kwargs
):
11590 Insert(self, String item, int pos, PyObject clientData=None) -> int
11592 Insert an item into the control before the item at the ``pos`` index,
11593 optionally associating some data object with the item.
11595 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
11597 def Clear(*args
, **kwargs
):
11601 Removes all items from the control.
11603 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
11605 def Delete(*args
, **kwargs
):
11607 Delete(self, int n)
11609 Deletes the item at the zero-based index 'n' from the control. Note
11610 that it is an error (signalled by a `wx.PyAssertionError` exception if
11611 enabled) to remove an item with the index negative or greater or equal
11612 than the number of items in the control.
11614 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
11616 def GetClientData(*args
, **kwargs
):
11618 GetClientData(self, int n) -> PyObject
11620 Returns the client data associated with the given item, (if any.)
11622 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
11624 def SetClientData(*args
, **kwargs
):
11626 SetClientData(self, int n, PyObject clientData)
11628 Associate the given client data with the item at position n.
11630 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
11632 def GetCount(*args
, **kwargs
):
11634 GetCount(self) -> int
11636 Returns the number of items in the control.
11638 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
11640 def IsEmpty(*args
, **kwargs
):
11642 IsEmpty(self) -> bool
11644 Returns True if the control is empty or False if it has some items.
11646 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
11648 def GetString(*args
, **kwargs
):
11650 GetString(self, int n) -> String
11652 Returns the label of the item with the given index.
11654 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
11656 def GetStrings(*args
, **kwargs
):
11657 """GetStrings(self) -> wxArrayString"""
11658 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
11660 def SetString(*args
, **kwargs
):
11662 SetString(self, int n, String s)
11664 Sets the label for the given item.
11666 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
11668 def FindString(*args
, **kwargs
):
11670 FindString(self, String s) -> int
11672 Finds an item whose label matches the given string. Returns the
11673 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11676 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
11678 def SetSelection(*args
, **kwargs
):
11680 SetSelection(self, int n)
11682 Sets the item at index 'n' to be the selected item.
11684 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
11686 def GetSelection(*args
, **kwargs
):
11688 GetSelection(self) -> int
11690 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11693 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
11695 def SetStringSelection(*args
, **kwargs
):
11696 """SetStringSelection(self, String s) -> bool"""
11697 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
11699 def GetStringSelection(*args
, **kwargs
):
11701 GetStringSelection(self) -> String
11703 Returns the label of the selected item or an empty string if no item
11706 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
11708 def Select(*args
, **kwargs
):
11710 Select(self, int n)
11712 This is the same as `SetSelection` and exists only because it is
11713 slightly more natural for controls which support multiple selection.
11715 return _core_
.ItemContainer_Select(*args
, **kwargs
)
11717 def GetItems(self
):
11718 """Return a list of the strings in the control"""
11719 return [self
.GetString(i
) for i
in xrange(self
.GetCount())]
11721 def SetItems(self
, items
):
11722 """Clear and set the strings in the control from a list"""
11727 Count
= property(GetCount
,doc
="See `GetCount`")
11728 Items
= property(GetItems
,SetItems
,doc
="See `GetItems` and `SetItems`")
11729 Selection
= property(GetSelection
,SetSelection
,doc
="See `GetSelection` and `SetSelection`")
11730 StringSelection
= property(GetStringSelection
,SetStringSelection
,doc
="See `GetStringSelection` and `SetStringSelection`")
11731 Strings
= property(GetStrings
,doc
="See `GetStrings`")
11732 _core_
.ItemContainer_swigregister(ItemContainer
)
11734 #---------------------------------------------------------------------------
11736 class ControlWithItems(Control
,ItemContainer
):
11738 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11739 wx.Control class, and is used for the base class of various controls
11742 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11743 def __init__(self
): raise AttributeError, "No constructor defined"
11744 __repr__
= _swig_repr
11745 _core_
.ControlWithItems_swigregister(ControlWithItems
)
11747 #---------------------------------------------------------------------------
11749 class SizerFlags(object):
11751 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11752 to specify a lot of flags and parameters which can be unwieldy. This
11753 is where wx.SizerFlags comes in: it allows you to specify all
11754 parameters using the named methods instead. For example, instead of::
11756 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11758 you can now write::
11760 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11762 This is more readable and also allows you to create wx.SizerFlags
11763 objects which can be reused for several sizer items.::
11765 flagsExpand = wx.SizerFlags(1)
11766 flagsExpand.Expand().Border(wx.ALL, 10)
11767 sizer.AddF(ctrl1, flagsExpand)
11768 sizer.AddF(ctrl2, flagsExpand)
11770 Note that by specification, all methods of wx.SizerFlags return the
11771 wx.SizerFlags object itself allowing chaining multiple method calls
11772 like in the examples above.
11774 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11775 __repr__
= _swig_repr
11776 def __init__(self
, *args
, **kwargs
):
11778 __init__(self, int proportion=0) -> SizerFlags
11780 Constructs the flags object with the specified proportion.
11782 _core_
.SizerFlags_swiginit(self
,_core_
.new_SizerFlags(*args
, **kwargs
))
11783 __swig_destroy__
= _core_
.delete_SizerFlags
11784 __del__
= lambda self
: None;
11785 def Proportion(*args
, **kwargs
):
11787 Proportion(self, int proportion) -> SizerFlags
11789 Sets the item's proportion value.
11791 return _core_
.SizerFlags_Proportion(*args
, **kwargs
)
11793 def Align(*args
, **kwargs
):
11795 Align(self, int alignment) -> SizerFlags
11797 Sets the item's alignment
11799 return _core_
.SizerFlags_Align(*args
, **kwargs
)
11801 def Expand(*args
, **kwargs
):
11803 Expand(self) -> SizerFlags
11805 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11806 fill as much space as it is given by the sizer.
11808 return _core_
.SizerFlags_Expand(*args
, **kwargs
)
11810 def Centre(*args
, **kwargs
):
11812 Centre(self) -> SizerFlags
11814 Same as `Center` for those with an alternate dialect of English.
11816 return _core_
.SizerFlags_Centre(*args
, **kwargs
)
11818 def Center(*args
, **kwargs
):
11820 Center(self) -> SizerFlags
11822 Sets the centering alignment flags.
11824 return _core_
.SizerFlags_Center(*args
, **kwargs
)
11826 def Left(*args
, **kwargs
):
11828 Left(self) -> SizerFlags
11830 Aligns the object to the left, a shortcut for calling
11831 Align(wx.ALIGN_LEFT)
11833 return _core_
.SizerFlags_Left(*args
, **kwargs
)
11835 def Right(*args
, **kwargs
):
11837 Right(self) -> SizerFlags
11839 Aligns the object to the right, a shortcut for calling
11840 Align(wx.ALIGN_RIGHT)
11842 return _core_
.SizerFlags_Right(*args
, **kwargs
)
11844 def Top(*args
, **kwargs
):
11846 Top(self) -> SizerFlags
11848 Aligns the object to the top of the available space, a shortcut for
11849 calling Align(wx.ALIGN_TOP)
11851 return _core_
.SizerFlags_Top(*args
, **kwargs
)
11853 def Bottom(*args
, **kwargs
):
11855 Bottom(self) -> SizerFlags
11857 Aligns the object to the bottom of the available space, a shortcut for
11858 calling Align(wx.ALIGN_BOTTOM)
11860 return _core_
.SizerFlags_Bottom(*args
, **kwargs
)
11862 def Shaped(*args
, **kwargs
):
11864 Shaped(self) -> SizerFlags
11866 Sets the wx.SHAPED flag.
11868 return _core_
.SizerFlags_Shaped(*args
, **kwargs
)
11870 def FixedMinSize(*args
, **kwargs
):
11872 FixedMinSize(self) -> SizerFlags
11874 Sets the wx.FIXED_MINSIZE flag.
11876 return _core_
.SizerFlags_FixedMinSize(*args
, **kwargs
)
11878 def Border(*args
, **kwargs
):
11880 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11882 Sets the border of the item in the direction(s) or sides given by the
11883 direction parameter. If the borderInPixels value is not given then
11884 the default border size (see `GetDefaultBorder`) will be used.
11886 return _core_
.SizerFlags_Border(*args
, **kwargs
)
11888 def DoubleBorder(*args
, **kwargs
):
11890 DoubleBorder(self, int direction=ALL) -> SizerFlags
11892 Sets the border in the given direction to twice the default border
11895 return _core_
.SizerFlags_DoubleBorder(*args
, **kwargs
)
11897 def TripleBorder(*args
, **kwargs
):
11899 TripleBorder(self, int direction=ALL) -> SizerFlags
11901 Sets the border in the given direction to three times the default
11904 return _core_
.SizerFlags_TripleBorder(*args
, **kwargs
)
11906 def HorzBorder(*args
, **kwargs
):
11908 HorzBorder(self) -> SizerFlags
11910 Sets the left and right borders to the default border size.
11912 return _core_
.SizerFlags_HorzBorder(*args
, **kwargs
)
11914 def DoubleHorzBorder(*args
, **kwargs
):
11916 DoubleHorzBorder(self) -> SizerFlags
11918 Sets the left and right borders to twice the default border size.
11920 return _core_
.SizerFlags_DoubleHorzBorder(*args
, **kwargs
)
11922 def GetDefaultBorder(*args
, **kwargs
):
11924 GetDefaultBorder() -> int
11926 Returns the default border size used by the other border methods
11928 return _core_
.SizerFlags_GetDefaultBorder(*args
, **kwargs
)
11930 GetDefaultBorder
= staticmethod(GetDefaultBorder
)
11931 def GetProportion(*args
, **kwargs
):
11933 GetProportion(self) -> int
11935 Returns the proportion value to be used in the sizer item.
11937 return _core_
.SizerFlags_GetProportion(*args
, **kwargs
)
11939 def GetFlags(*args
, **kwargs
):
11941 GetFlags(self) -> int
11943 Returns the flags value to be used in the sizer item.
11945 return _core_
.SizerFlags_GetFlags(*args
, **kwargs
)
11947 def GetBorderInPixels(*args
, **kwargs
):
11949 GetBorderInPixels(self) -> int
11951 Returns the border value in pixels to be used in the sizer item.
11953 return _core_
.SizerFlags_GetBorderInPixels(*args
, **kwargs
)
11955 _core_
.SizerFlags_swigregister(SizerFlags
)
11957 def SizerFlags_GetDefaultBorder(*args
):
11959 SizerFlags_GetDefaultBorder() -> int
11961 Returns the default border size used by the other border methods
11963 return _core_
.SizerFlags_GetDefaultBorder(*args
)
11965 class SizerItem(Object
):
11967 The wx.SizerItem class is used to track the position, size and other
11968 attributes of each item managed by a `wx.Sizer`. It is not usually
11969 necessary to use this class because the sizer elements can also be
11970 identified by their positions or window or sizer references but
11971 sometimes it may be more convenient to use wx.SizerItem directly.
11972 Also, custom classes derived from `wx.PySizer` will probably need to
11973 use the collection of wx.SizerItems held by wx.Sizer when calculating
11976 :see: `wx.Sizer`, `wx.GBSizerItem`
11978 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11979 __repr__
= _swig_repr
11980 def __init__(self
, *args
, **kwargs
):
11982 __init__(self) -> SizerItem
11984 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11985 size will need to be set before this item can be used in a Sizer.
11987 You will probably never need to create a wx.SizerItem directly as they
11988 are created automatically when the sizer's Add, Insert or Prepend
11989 methods are called.
11991 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11993 _core_
.SizerItem_swiginit(self
,_core_
.new_SizerItem(*args
, **kwargs
))
11994 __swig_destroy__
= _core_
.delete_SizerItem
11995 __del__
= lambda self
: None;
11996 def DeleteWindows(*args
, **kwargs
):
11998 DeleteWindows(self)
12000 Destroy the window or the windows in a subsizer, depending on the type
12003 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
12005 def DetachSizer(*args
, **kwargs
):
12009 Enable deleting the SizerItem without destroying the contained sizer.
12011 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
12013 def GetSize(*args
, **kwargs
):
12015 GetSize(self) -> Size
12017 Get the current size of the item, as set in the last Layout.
12019 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
12021 def CalcMin(*args
, **kwargs
):
12023 CalcMin(self) -> Size
12025 Calculates the minimum desired size for the item, including any space
12028 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
12030 def SetDimension(*args
, **kwargs
):
12032 SetDimension(self, Point pos, Size size)
12034 Set the position and size of the space allocated for this item by the
12035 sizer, and adjust the position and size of the item (window or
12036 subsizer) to be within that space taking alignment and borders into
12039 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
12041 def GetMinSize(*args
, **kwargs
):
12043 GetMinSize(self) -> Size
12045 Get the minimum size needed for the item.
12047 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
12049 def GetMinSizeWithBorder(*args
, **kwargs
):
12051 GetMinSizeWithBorder(self) -> Size
12053 Get the minimum size needed for the item with space for the borders
12056 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
12058 def SetInitSize(*args
, **kwargs
):
12059 """SetInitSize(self, int x, int y)"""
12060 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
12062 def SetRatioWH(*args
, **kwargs
):
12064 SetRatioWH(self, int width, int height)
12066 Set the ratio item attribute.
12068 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
12070 def SetRatioSize(*args
, **kwargs
):
12072 SetRatioSize(self, Size size)
12074 Set the ratio item attribute.
12076 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
12078 def SetRatio(*args
, **kwargs
):
12080 SetRatio(self, float ratio)
12082 Set the ratio item attribute.
12084 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
12086 def GetRatio(*args
, **kwargs
):
12088 GetRatio(self) -> float
12090 Set the ratio item attribute.
12092 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
12094 def GetRect(*args
, **kwargs
):
12096 GetRect(self) -> Rect
12098 Returns the rectangle that the sizer item should occupy
12100 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
12102 def IsWindow(*args
, **kwargs
):
12104 IsWindow(self) -> bool
12106 Is this sizer item a window?
12108 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
12110 def IsSizer(*args
, **kwargs
):
12112 IsSizer(self) -> bool
12114 Is this sizer item a subsizer?
12116 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
12118 def IsSpacer(*args
, **kwargs
):
12120 IsSpacer(self) -> bool
12122 Is this sizer item a spacer?
12124 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
12126 def SetProportion(*args
, **kwargs
):
12128 SetProportion(self, int proportion)
12130 Set the proportion value for this item.
12132 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
12134 def GetProportion(*args
, **kwargs
):
12136 GetProportion(self) -> int
12138 Get the proportion value for this item.
12140 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
12142 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
12143 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
12144 def SetFlag(*args
, **kwargs
):
12146 SetFlag(self, int flag)
12148 Set the flag value for this item.
12150 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
12152 def GetFlag(*args
, **kwargs
):
12154 GetFlag(self) -> int
12156 Get the flag value for this item.
12158 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
12160 def SetBorder(*args
, **kwargs
):
12162 SetBorder(self, int border)
12164 Set the border value for this item.
12166 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
12168 def GetBorder(*args
, **kwargs
):
12170 GetBorder(self) -> int
12172 Get the border value for this item.
12174 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
12176 def GetWindow(*args
, **kwargs
):
12178 GetWindow(self) -> Window
12180 Get the window (if any) that is managed by this sizer item.
12182 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
12184 def GetSizer(*args
, **kwargs
):
12186 GetSizer(self) -> Sizer
12188 Get the subsizer (if any) that is managed by this sizer item.
12190 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
12192 def GetSpacer(*args
, **kwargs
):
12194 GetSpacer(self) -> Size
12196 Get the size of the spacer managed by this sizer item.
12198 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
12200 def SetWindow(*args
, **kwargs
):
12202 SetWindow(self, Window window)
12204 Set the window to be managed by this sizer item.
12206 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
12208 def SetSizer(*args
, **kwargs
):
12210 SetSizer(self, Sizer sizer)
12212 Set the subsizer to be managed by this sizer item.
12214 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
12216 def SetSpacer(*args
, **kwargs
):
12218 SetSpacer(self, Size size)
12220 Set the size of the spacer to be managed by this sizer item.
12222 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
12224 SetWindow
= wx
._deprecated
(SetWindow
, "Use `AssignWindow` instead.")
12225 SetSizer
= wx
._deprecated
(SetSizer
, "Use `AssignSizer` instead.")
12226 SetSpacer
= wx
._deprecated
(SetSpacer
, "Use `AssignSpacer` instead.")
12228 def AssignWindow(*args
, **kwargs
):
12230 AssignWindow(self, Window window)
12232 Set the window to be managed by this sizer item.
12234 return _core_
.SizerItem_AssignWindow(*args
, **kwargs
)
12236 def AssignSizer(*args
, **kwargs
):
12238 AssignSizer(self, Sizer sizer)
12240 Set the subsizer to be managed by this sizer item.
12242 return _core_
.SizerItem_AssignSizer(*args
, **kwargs
)
12244 def AssignSpacer(*args
, **kwargs
):
12246 AssignSpacer(self, Size size)
12248 Set the size of the spacer to be managed by this sizer item.
12250 return _core_
.SizerItem_AssignSpacer(*args
, **kwargs
)
12252 def Show(*args
, **kwargs
):
12254 Show(self, bool show)
12256 Set the show item attribute, which sizers use to determine if the item
12257 is to be made part of the layout or not. If the item is tracking a
12258 window then it is shown or hidden as needed.
12260 return _core_
.SizerItem_Show(*args
, **kwargs
)
12262 def IsShown(*args
, **kwargs
):
12264 IsShown(self) -> bool
12266 Is the item to be shown in the layout?
12268 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
12270 def GetPosition(*args
, **kwargs
):
12272 GetPosition(self) -> Point
12274 Returns the current position of the item, as set in the last Layout.
12276 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
12278 def GetUserData(*args
, **kwargs
):
12280 GetUserData(self) -> PyObject
12282 Returns the userData associated with this sizer item, or None if there
12285 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
12287 def SetUserData(*args
, **kwargs
):
12289 SetUserData(self, PyObject userData)
12291 Associate a Python object with this sizer item.
12293 return _core_
.SizerItem_SetUserData(*args
, **kwargs
)
12295 Border
= property(GetBorder
,SetBorder
,doc
="See `GetBorder` and `SetBorder`")
12296 Flag
= property(GetFlag
,SetFlag
,doc
="See `GetFlag` and `SetFlag`")
12297 MinSize
= property(GetMinSize
,doc
="See `GetMinSize`")
12298 MinSizeWithBorder
= property(GetMinSizeWithBorder
,doc
="See `GetMinSizeWithBorder`")
12299 Position
= property(GetPosition
,doc
="See `GetPosition`")
12300 Proportion
= property(GetProportion
,SetProportion
,doc
="See `GetProportion` and `SetProportion`")
12301 Ratio
= property(GetRatio
,SetRatio
,doc
="See `GetRatio` and `SetRatio`")
12302 Rect
= property(GetRect
,doc
="See `GetRect`")
12303 Size
= property(GetSize
,doc
="See `GetSize`")
12304 Sizer
= property(GetSizer
,AssignSizer
,doc
="See `GetSizer` and `AssignSizer`")
12305 Spacer
= property(GetSpacer
,AssignSpacer
,doc
="See `GetSpacer` and `AssignSpacer`")
12306 UserData
= property(GetUserData
,SetUserData
,doc
="See `GetUserData` and `SetUserData`")
12307 Window
= property(GetWindow
,AssignWindow
,doc
="See `GetWindow` and `AssignWindow`")
12308 _core_
.SizerItem_swigregister(SizerItem
)
12310 def SizerItemWindow(*args
, **kwargs
):
12312 SizerItemWindow(Window window, int proportion, int flag, int border,
12313 PyObject userData=None) -> SizerItem
12315 Constructs a `wx.SizerItem` for tracking a window.
12317 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
12320 def SizerItemSpacer(*args
, **kwargs
):
12322 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
12323 PyObject userData=None) -> SizerItem
12325 Constructs a `wx.SizerItem` for tracking a spacer.
12327 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
12330 def SizerItemSizer(*args
, **kwargs
):
12332 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
12333 PyObject userData=None) -> SizerItem
12335 Constructs a `wx.SizerItem` for tracking a subsizer
12337 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
12340 class Sizer(Object
):
12342 wx.Sizer is the abstract base class used for laying out subwindows in
12343 a window. You cannot use wx.Sizer directly; instead, you will have to
12344 use one of the sizer classes derived from it such as `wx.BoxSizer`,
12345 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12348 The concept implemented by sizers in wxWidgets is closely related to
12349 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12350 toolkit or the Qt toolkit. It is based upon the idea of the individual
12351 subwindows reporting their minimal required size and their ability to
12352 get stretched if the size of the parent window has changed. This will
12353 most often mean that the programmer does not set the original size of
12354 a dialog in the beginning, rather the dialog will assigned a sizer and
12355 this sizer will be queried about the recommended size. The sizer in
12356 turn will query its children, which can be normal windows or contorls,
12357 empty space or other sizers, so that a hierarchy of sizers can be
12358 constructed. Note that wxSizer does not derive from wxWindow and thus
12359 do not interfere with tab ordering and requires very little resources
12360 compared to a real window on screen.
12362 What makes sizers so well fitted for use in wxWidgets is the fact that
12363 every control reports its own minimal size and the algorithm can
12364 handle differences in font sizes or different window (dialog item)
12365 sizes on different platforms without problems. If for example the
12366 standard font as well as the overall design of Mac widgets requires
12367 more space than on Windows, then the initial size of a dialog using a
12368 sizer will automatically be bigger on Mac than on Windows.
12370 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12371 def __init__(self
): raise AttributeError, "No constructor defined"
12372 __repr__
= _swig_repr
12373 __swig_destroy__
= _core_
.delete_Sizer
12374 __del__
= lambda self
: None;
12375 def _setOORInfo(*args
, **kwargs
):
12376 """_setOORInfo(self, PyObject _self)"""
12377 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
12379 def Add(*args
, **kwargs
):
12381 Add(self, item, int proportion=0, int flag=0, int border=0,
12382 PyObject userData=None) -> wx.SizerItem
12384 Appends a child item to the sizer.
12386 return _core_
.Sizer_Add(*args
, **kwargs
)
12388 def AddF(*args
, **kwargs
):
12390 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12392 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12393 setting the various flags, options and borders.
12395 return _core_
.Sizer_AddF(*args
, **kwargs
)
12397 def Insert(*args
, **kwargs
):
12399 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
12400 PyObject userData=None) -> wx.SizerItem
12402 Inserts a new item into the list of items managed by this sizer before
12403 the item at index *before*. See `Add` for a description of the parameters.
12405 return _core_
.Sizer_Insert(*args
, **kwargs
)
12407 def InsertF(*args
, **kwargs
):
12409 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12411 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12412 for setting the various flags, options and borders.
12414 return _core_
.Sizer_InsertF(*args
, **kwargs
)
12416 def Prepend(*args
, **kwargs
):
12418 Prepend(self, item, int proportion=0, int flag=0, int border=0,
12419 PyObject userData=None) -> wx.SizerItem
12421 Adds a new item to the begining of the list of sizer items managed by
12422 this sizer. See `Add` for a description of the parameters.
12424 return _core_
.Sizer_Prepend(*args
, **kwargs
)
12426 def PrependF(*args
, **kwargs
):
12428 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12430 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12431 for setting the various flags, options and borders.
12433 return _core_
.Sizer_PrependF(*args
, **kwargs
)
12435 def Remove(*args
, **kwargs
):
12437 Remove(self, item) -> bool
12439 Removes an item from the sizer and destroys it. This method does not
12440 cause any layout or resizing to take place, call `Layout` to update
12441 the layout on screen after removing a child from the sizer. The
12442 *item* parameter can be either a window, a sizer, or the zero-based
12443 index of an item to remove. Returns True if the child item was found
12446 return _core_
.Sizer_Remove(*args
, **kwargs
)
12448 def Detach(*args
, **kwargs
):
12450 Detach(self, item) -> bool
12452 Detaches an item from the sizer without destroying it. This method
12453 does not cause any layout or resizing to take place, call `Layout` to
12454 do so. The *item* parameter can be either a window, a sizer, or the
12455 zero-based index of the item to be detached. Returns True if the child item
12456 was found and detached.
12458 return _core_
.Sizer_Detach(*args
, **kwargs
)
12460 def GetItem(*args
, **kwargs
):
12462 GetItem(self, item, recursive=False) -> wx.SizerItem
12464 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12465 parameter can be either a window, a sizer, or the zero-based index of
12466 the item to be found.
12468 return _core_
.Sizer_GetItem(*args
, **kwargs
)
12470 def _SetItemMinSize(*args
, **kwargs
):
12471 """_SetItemMinSize(self, PyObject item, Size size)"""
12472 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
12474 def _ReplaceWin(*args
, **kwargs
):
12475 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12476 return _core_
.Sizer__ReplaceWin(*args
, **kwargs
)
12478 def _ReplaceSizer(*args
, **kwargs
):
12479 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12480 return _core_
.Sizer__ReplaceSizer(*args
, **kwargs
)
12482 def _ReplaceItem(*args
, **kwargs
):
12483 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12484 return _core_
.Sizer__ReplaceItem(*args
, **kwargs
)
12486 def Replace(self
, olditem
, item
, recursive
=False):
12488 Detaches the given ``olditem`` from the sizer and replaces it with
12489 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12490 detached child is destroyed only if it is not a window, (because
12491 windows are owned by their parent, not the sizer.) The
12492 ``recursive`` parameter can be used to search for the given
12493 element recursivly in subsizers.
12495 This method does not cause any layout or resizing to take place,
12496 call `Layout` to do so.
12498 Returns ``True`` if the child item was found and removed.
12500 if isinstance(olditem
, wx
.Window
):
12501 return self
._ReplaceWin
(olditem
, item
, recursive
)
12502 elif isinstance(olditem
, wx
.Sizer
):
12503 return self
._ReplaceSizer
(olditem
, item
, recursive
)
12504 elif isinstance(olditem
, int):
12505 return self
._ReplaceItem
(olditem
, item
)
12507 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12509 def SetContainingWindow(*args
, **kwargs
):
12511 SetContainingWindow(self, Window window)
12513 Set (or unset) the window this sizer is used in.
12515 return _core_
.Sizer_SetContainingWindow(*args
, **kwargs
)
12517 def GetContainingWindow(*args
, **kwargs
):
12519 GetContainingWindow(self) -> Window
12521 Get the window this sizer is used in.
12523 return _core_
.Sizer_GetContainingWindow(*args
, **kwargs
)
12525 def SetItemMinSize(self
, item
, *args
):
12527 SetItemMinSize(self, item, Size size)
12529 Sets the minimum size that will be allocated for an item in the sizer.
12530 The *item* parameter can be either a window, a sizer, or the
12531 zero-based index of the item. If a window or sizer is given then it
12532 will be searched for recursivly in subsizers if neccessary.
12535 # for backward compatibility accept separate width,height args too
12536 return self
._SetItemMinSize
(item
, args
)
12538 return self
._SetItemMinSize
(item
, args
[0])
12540 def AddItem(*args
, **kwargs
):
12542 AddItem(self, SizerItem item)
12544 Adds a `wx.SizerItem` to the sizer.
12546 return _core_
.Sizer_AddItem(*args
, **kwargs
)
12548 def InsertItem(*args
, **kwargs
):
12550 InsertItem(self, int index, SizerItem item)
12552 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12554 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
12556 def PrependItem(*args
, **kwargs
):
12558 PrependItem(self, SizerItem item)
12560 Prepends a `wx.SizerItem` to the sizer.
12562 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
12564 def AddMany(self
, items
):
12566 AddMany is a convenience method for adding several items
12567 to a sizer at one time. Simply pass it a list of tuples,
12568 where each tuple consists of the parameters that you
12569 would normally pass to the `Add` method.
12572 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
12576 def AddSpacer(self
, *args
, **kw
):
12577 """AddSpacer(int size) --> SizerItem
12579 Add a spacer that is (size,size) pixels.
12581 if args
and type(args
[0]) == int:
12582 return self
.Add( (args
[0],args
[0] ), 0)
12583 else: # otherwise stay compatible with old AddSpacer
12584 return self
.Add(*args
, **kw
)
12585 def PrependSpacer(self
, *args
, **kw
):
12586 """PrependSpacer(int size) --> SizerItem
12588 Prepend a spacer that is (size, size) pixels."""
12589 if args
and type(args
[0]) == int:
12590 return self
.Prepend( (args
[0],args
[0] ), 0)
12591 else: # otherwise stay compatible with old PrependSpacer
12592 return self
.Prepend(*args
, **kw
)
12593 def InsertSpacer(self
, index
, *args
, **kw
):
12594 """InsertSpacer(int index, int size) --> SizerItem
12596 Insert a spacer at position index that is (size, size) pixels."""
12597 if args
and type(args
[0]) == int:
12598 return self
.Insert( index
, (args
[0],args
[0] ), 0)
12599 else: # otherwise stay compatible with old InsertSpacer
12600 return self
.Insert(index
, *args
, **kw
)
12603 def AddStretchSpacer(self
, prop
=1):
12604 """AddStretchSpacer(int prop=1) --> SizerItem
12606 Add a stretchable spacer."""
12607 return self
.Add((0,0), prop
)
12608 def PrependStretchSpacer(self
, prop
=1):
12609 """PrependStretchSpacer(int prop=1) --> SizerItem
12611 Prepend a stretchable spacer."""
12612 return self
.Prepend((0,0), prop
)
12613 def InsertStretchSpacer(self
, index
, prop
=1):
12614 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12616 Insert a stretchable spacer."""
12617 return self
.Insert(index
, (0,0), prop
)
12620 # for backwards compatibility only, please do not use in new code
12621 def AddWindow(self
, *args
, **kw
):
12622 """Compatibility alias for `Add`."""
12623 return self
.Add(*args
, **kw
)
12624 def AddSizer(self
, *args
, **kw
):
12625 """Compatibility alias for `Add`."""
12626 return self
.Add(*args
, **kw
)
12628 def PrependWindow(self
, *args
, **kw
):
12629 """Compatibility alias for `Prepend`."""
12630 return self
.Prepend(*args
, **kw
)
12631 def PrependSizer(self
, *args
, **kw
):
12632 """Compatibility alias for `Prepend`."""
12633 return self
.Prepend(*args
, **kw
)
12635 def InsertWindow(self
, *args
, **kw
):
12636 """Compatibility alias for `Insert`."""
12637 return self
.Insert(*args
, **kw
)
12638 def InsertSizer(self
, *args
, **kw
):
12639 """Compatibility alias for `Insert`."""
12640 return self
.Insert(*args
, **kw
)
12642 def RemoveWindow(self
, *args
, **kw
):
12643 """Compatibility alias for `Remove`."""
12644 return self
.Remove(*args
, **kw
)
12645 def RemoveSizer(self
, *args
, **kw
):
12646 """Compatibility alias for `Remove`."""
12647 return self
.Remove(*args
, **kw
)
12648 def RemovePos(self
, *args
, **kw
):
12649 """Compatibility alias for `Remove`."""
12650 return self
.Remove(*args
, **kw
)
12653 def SetDimension(*args
, **kwargs
):
12655 SetDimension(self, int x, int y, int width, int height)
12657 Call this to force the sizer to take the given dimension and thus
12658 force the items owned by the sizer to resize themselves according to
12659 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12662 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
12664 def SetMinSize(*args
, **kwargs
):
12666 SetMinSize(self, Size size)
12668 Call this to give the sizer a minimal size. Normally, the sizer will
12669 calculate its minimal size based purely on how much space its children
12670 need. After calling this method `GetMinSize` will return either the
12671 minimal size as requested by its children or the minimal size set
12672 here, depending on which is bigger.
12674 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
12676 def GetSize(*args
, **kwargs
):
12678 GetSize(self) -> Size
12680 Returns the current size of the space managed by the sizer.
12682 return _core_
.Sizer_GetSize(*args
, **kwargs
)
12684 def GetPosition(*args
, **kwargs
):
12686 GetPosition(self) -> Point
12688 Returns the current position of the sizer's managed space.
12690 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
12692 def GetMinSize(*args
, **kwargs
):
12694 GetMinSize(self) -> Size
12696 Returns the minimal size of the sizer. This is either the combined
12697 minimal size of all the children and their borders or the minimal size
12698 set by SetMinSize, depending on which is bigger.
12700 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
12702 def GetSizeTuple(self
):
12703 return self
.GetSize().Get()
12704 def GetPositionTuple(self
):
12705 return self
.GetPosition().Get()
12706 def GetMinSizeTuple(self
):
12707 return self
.GetMinSize().Get()
12709 def RecalcSizes(*args
, **kwargs
):
12713 Using the sizes calculated by `CalcMin` reposition and resize all the
12714 items managed by this sizer. You should not need to call this directly as
12715 it is called by `Layout`.
12717 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
12719 def CalcMin(*args
, **kwargs
):
12721 CalcMin(self) -> Size
12723 This method is where the sizer will do the actual calculation of its
12724 children's minimal sizes. You should not need to call this directly as
12725 it is called by `Layout`.
12727 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
12729 def Layout(*args
, **kwargs
):
12733 This method will force the recalculation and layout of the items
12734 controlled by the sizer using the current space allocated to the
12735 sizer. Normally this is called automatically from the owning window's
12736 EVT_SIZE handler, but it is also useful to call it from user code when
12737 one of the items in a sizer change size, or items are added or
12740 return _core_
.Sizer_Layout(*args
, **kwargs
)
12742 def Fit(*args
, **kwargs
):
12744 Fit(self, Window window) -> Size
12746 Tell the sizer to resize the *window* to match the sizer's minimal
12747 size. This is commonly done in the constructor of the window itself in
12748 order to set its initial size to match the needs of the children as
12749 determined by the sizer. Returns the new size.
12751 For a top level window this is the total window size, not the client size.
12753 return _core_
.Sizer_Fit(*args
, **kwargs
)
12755 def FitInside(*args
, **kwargs
):
12757 FitInside(self, Window window)
12759 Tell the sizer to resize the *virtual size* of the *window* to match the
12760 sizer's minimal size. This will not alter the on screen size of the
12761 window, but may cause the addition/removal/alteration of scrollbars
12762 required to view the virtual area in windows which manage it.
12764 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12767 return _core_
.Sizer_FitInside(*args
, **kwargs
)
12769 def SetSizeHints(*args
, **kwargs
):
12771 SetSizeHints(self, Window window)
12773 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12774 match the sizer's minimal size. This is commonly done in the
12775 constructor of the window itself if the window is resizable (as are
12776 many dialogs under Unix and frames on probably all platforms) in order
12777 to prevent the window from being sized smaller than the minimal size
12778 required by the sizer.
12780 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
12782 def SetVirtualSizeHints(*args
, **kwargs
):
12784 SetVirtualSizeHints(self, Window window)
12786 Tell the sizer to set the minimal size of the window virtual area to
12787 match the sizer's minimal size. For windows with managed scrollbars
12788 this will set them appropriately.
12790 :see: `wx.ScrolledWindow.SetScrollbars`
12793 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
12795 def Clear(*args
, **kwargs
):
12797 Clear(self, bool deleteWindows=False)
12799 Clear all items from the sizer, optionally destroying the window items
12802 return _core_
.Sizer_Clear(*args
, **kwargs
)
12804 def DeleteWindows(*args
, **kwargs
):
12806 DeleteWindows(self)
12808 Destroy all windows managed by the sizer.
12810 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
12812 def GetChildren(*args
, **kwargs
):
12814 GetChildren(self) -> list
12816 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12818 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
12820 def Show(*args
, **kwargs
):
12822 Show(self, item, bool show=True, bool recursive=false) -> bool
12824 Shows or hides an item managed by the sizer. To make a sizer item
12825 disappear or reappear, use Show followed by `Layout`. The *item*
12826 parameter can be either a window, a sizer, or the zero-based index of
12827 the item. Use the recursive parameter to show or hide an item in a
12828 subsizer. Returns True if the item was found.
12830 return _core_
.Sizer_Show(*args
, **kwargs
)
12832 def IsShown(*args
, **kwargs
):
12834 IsShown(self, item)
12836 Determines if the item is currently shown. To make a sizer
12837 item disappear or reappear, use Show followed by `Layout`. The *item*
12838 parameter can be either a window, a sizer, or the zero-based index of
12841 return _core_
.Sizer_IsShown(*args
, **kwargs
)
12843 def Hide(self
, item
, recursive
=False):
12845 A convenience method for `Show` (item, False, recursive).
12847 return self
.Show(item
, False, recursive
)
12849 def ShowItems(*args
, **kwargs
):
12851 ShowItems(self, bool show)
12853 Recursively call `wx.SizerItem.Show` on all sizer items.
12855 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
12857 Children
= property(GetChildren
,doc
="See `GetChildren`")
12858 ContainingWindow
= property(GetContainingWindow
,SetContainingWindow
,doc
="See `GetContainingWindow` and `SetContainingWindow`")
12859 MinSize
= property(GetMinSize
,SetMinSize
,doc
="See `GetMinSize` and `SetMinSize`")
12860 Position
= property(GetPosition
,doc
="See `GetPosition`")
12861 Size
= property(GetSize
,doc
="See `GetSize`")
12862 _core_
.Sizer_swigregister(Sizer
)
12864 class PySizer(Sizer
):
12866 wx.PySizer is a special version of `wx.Sizer` that has been
12867 instrumented to allow the C++ virtual methods to be overloaded in
12868 Python derived classes. You would derive from this class if you are
12869 wanting to implement a custom sizer in Python code. Simply implement
12870 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12873 class MySizer(wx.PySizer):
12874 def __init__(self):
12875 wx.PySizer.__init__(self)
12878 for item in self.GetChildren():
12879 # calculate the total minimum width and height needed
12880 # by all items in the sizer according to this sizer's
12881 # layout algorithm.
12883 return wx.Size(width, height)
12885 def RecalcSizes(self):
12886 # find the space allotted to this sizer
12887 pos = self.GetPosition()
12888 size = self.GetSize()
12889 for item in self.GetChildren():
12890 # Recalculate (if necessary) the position and size of
12891 # each item and then call item.SetDimension to do the
12892 # actual positioning and sizing of the items within the
12893 # space alloted to this sizer.
12895 item.SetDimension(itemPos, itemSize)
12898 When `Layout` is called it first calls `CalcMin` followed by
12899 `RecalcSizes` so you can optimize a bit by saving the results of
12900 `CalcMin` and reusing them in `RecalcSizes`.
12902 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12906 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12907 __repr__
= _swig_repr
12908 def __init__(self
, *args
, **kwargs
):
12910 __init__(self) -> PySizer
12912 Creates a wx.PySizer. Must be called from the __init__ in the derived
12915 _core_
.PySizer_swiginit(self
,_core_
.new_PySizer(*args
, **kwargs
))
12916 self
._setOORInfo
(self
);PySizer
._setCallbackInfo
(self
, self
, PySizer
)
12918 def _setCallbackInfo(*args
, **kwargs
):
12919 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12920 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
12922 _core_
.PySizer_swigregister(PySizer
)
12924 #---------------------------------------------------------------------------
12926 class BoxSizer(Sizer
):
12928 The basic idea behind a box sizer is that windows will most often be
12929 laid out in rather simple basic geometry, typically in a row or a
12930 column or nested hierarchies of either. A wx.BoxSizer will lay out
12931 its items in a simple row or column, depending on the orientation
12932 parameter passed to the constructor.
12934 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12935 __repr__
= _swig_repr
12936 def __init__(self
, *args
, **kwargs
):
12938 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12940 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12941 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12944 _core_
.BoxSizer_swiginit(self
,_core_
.new_BoxSizer(*args
, **kwargs
))
12945 self
._setOORInfo
(self
)
12947 def GetOrientation(*args
, **kwargs
):
12949 GetOrientation(self) -> int
12951 Returns the current orientation of the sizer.
12953 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
12955 def SetOrientation(*args
, **kwargs
):
12957 SetOrientation(self, int orient)
12959 Resets the orientation of the sizer.
12961 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
12963 Orientation
= property(GetOrientation
,SetOrientation
,doc
="See `GetOrientation` and `SetOrientation`")
12964 _core_
.BoxSizer_swigregister(BoxSizer
)
12966 #---------------------------------------------------------------------------
12968 class StaticBoxSizer(BoxSizer
):
12970 wx.StaticBoxSizer derives from and functions identically to the
12971 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12972 manages. Note that this static box must be created separately and
12973 passed to the sizer constructor.
12975 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12976 __repr__
= _swig_repr
12977 def __init__(self
, *args
, **kwargs
):
12979 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12981 Constructor. It takes an associated static box and the orientation
12982 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12985 _core_
.StaticBoxSizer_swiginit(self
,_core_
.new_StaticBoxSizer(*args
, **kwargs
))
12986 self
._setOORInfo
(self
)
12988 def GetStaticBox(*args
, **kwargs
):
12990 GetStaticBox(self) -> StaticBox
12992 Returns the static box associated with this sizer.
12994 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
12996 StaticBox
= property(GetStaticBox
,doc
="See `GetStaticBox`")
12997 _core_
.StaticBoxSizer_swigregister(StaticBoxSizer
)
12999 #---------------------------------------------------------------------------
13001 class GridSizer(Sizer
):
13003 A grid sizer is a sizer which lays out its children in a
13004 two-dimensional table with all cells having the same size. In other
13005 words, the width of each cell within the grid is the width of the
13006 widest item added to the sizer and the height of each grid cell is the
13007 height of the tallest item. An optional vertical and/or horizontal
13008 gap between items can also be specified (in pixels.)
13010 Items are placed in the cells of the grid in the order they are added,
13011 in row-major order. In other words, the first row is filled first,
13012 then the second, and so on until all items have been added. (If
13013 neccessary, additional rows will be added as items are added.) If you
13014 need to have greater control over the cells that items are placed in
13015 then use the `wx.GridBagSizer`.
13018 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13019 __repr__
= _swig_repr
13020 def __init__(self
, *args
, **kwargs
):
13022 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
13024 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
13025 of columns and rows in the sizer - if either of the parameters is
13026 zero, it will be calculated to from the total number of children in
13027 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13028 define extra space between all children.
13030 _core_
.GridSizer_swiginit(self
,_core_
.new_GridSizer(*args
, **kwargs
))
13031 self
._setOORInfo
(self
)
13033 def SetCols(*args
, **kwargs
):
13035 SetCols(self, int cols)
13037 Sets the number of columns in the sizer.
13039 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
13041 def SetRows(*args
, **kwargs
):
13043 SetRows(self, int rows)
13045 Sets the number of rows in the sizer.
13047 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
13049 def SetVGap(*args
, **kwargs
):
13051 SetVGap(self, int gap)
13053 Sets the vertical gap (in pixels) between the cells in the sizer.
13055 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
13057 def SetHGap(*args
, **kwargs
):
13059 SetHGap(self, int gap)
13061 Sets the horizontal gap (in pixels) between cells in the sizer
13063 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
13065 def GetCols(*args
, **kwargs
):
13067 GetCols(self) -> int
13069 Returns the number of columns in the sizer.
13071 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
13073 def GetRows(*args
, **kwargs
):
13075 GetRows(self) -> int
13077 Returns the number of rows in the sizer.
13079 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
13081 def GetVGap(*args
, **kwargs
):
13083 GetVGap(self) -> int
13085 Returns the vertical gap (in pixels) between the cells in the sizer.
13087 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
13089 def GetHGap(*args
, **kwargs
):
13091 GetHGap(self) -> int
13093 Returns the horizontal gap (in pixels) between cells in the sizer.
13095 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
13097 def CalcRowsCols(self
):
13099 CalcRowsCols() -> (rows, cols)
13101 Calculates how many rows and columns will be in the sizer based
13102 on the current number of items and also the rows, cols specified
13103 in the constructor.
13105 nitems
= len(self
.GetChildren())
13106 rows
= self
.GetRows()
13107 cols
= self
.GetCols()
13108 assert rows
!= 0 or cols
!= 0, "Grid sizer must have either rows or columns fixed"
13110 rows
= (nitems
+ cols
- 1) / cols
13112 cols
= (nitems
+ rows
- 1) / rows
13113 return (rows
, cols
)
13115 Cols
= property(GetCols
,SetCols
,doc
="See `GetCols` and `SetCols`")
13116 HGap
= property(GetHGap
,SetHGap
,doc
="See `GetHGap` and `SetHGap`")
13117 Rows
= property(GetRows
,SetRows
,doc
="See `GetRows` and `SetRows`")
13118 VGap
= property(GetVGap
,SetVGap
,doc
="See `GetVGap` and `SetVGap`")
13119 _core_
.GridSizer_swigregister(GridSizer
)
13121 #---------------------------------------------------------------------------
13123 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
13124 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
13125 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
13126 class FlexGridSizer(GridSizer
):
13128 A flex grid sizer is a sizer which lays out its children in a
13129 two-dimensional table with all table cells in one row having the same
13130 height and all cells in one column having the same width, but all
13131 rows or all columns are not necessarily the same height or width as in
13132 the `wx.GridSizer`.
13134 wx.FlexGridSizer can also size items equally in one direction but
13135 unequally ("flexibly") in the other. If the sizer is only flexible
13136 in one direction (this can be changed using `SetFlexibleDirection`), it
13137 needs to be decided how the sizer should grow in the other ("non
13138 flexible") direction in order to fill the available space. The
13139 `SetNonFlexibleGrowMode` method serves this purpose.
13143 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13144 __repr__
= _swig_repr
13145 def __init__(self
, *args
, **kwargs
):
13147 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
13149 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13150 number of columns and rows in the sizer - if either of the parameters
13151 is zero, it will be calculated to from the total number of children in
13152 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13153 define extra space between all children.
13155 _core_
.FlexGridSizer_swiginit(self
,_core_
.new_FlexGridSizer(*args
, **kwargs
))
13156 self
._setOORInfo
(self
)
13158 def AddGrowableRow(*args
, **kwargs
):
13160 AddGrowableRow(self, size_t idx, int proportion=0)
13162 Specifies that row *idx* (starting from zero) should be grown if there
13163 is extra space available to the sizer.
13165 The *proportion* parameter has the same meaning as the stretch factor
13166 for the box sizers except that if all proportions are 0, then all
13167 columns are resized equally (instead of not being resized at all).
13169 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
13171 def RemoveGrowableRow(*args
, **kwargs
):
13173 RemoveGrowableRow(self, size_t idx)
13175 Specifies that row *idx* is no longer growable.
13177 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
13179 def AddGrowableCol(*args
, **kwargs
):
13181 AddGrowableCol(self, size_t idx, int proportion=0)
13183 Specifies that column *idx* (starting from zero) should be grown if
13184 there is extra space available to the sizer.
13186 The *proportion* parameter has the same meaning as the stretch factor
13187 for the box sizers except that if all proportions are 0, then all
13188 columns are resized equally (instead of not being resized at all).
13190 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
13192 def RemoveGrowableCol(*args
, **kwargs
):
13194 RemoveGrowableCol(self, size_t idx)
13196 Specifies that column *idx* is no longer growable.
13198 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
13200 def SetFlexibleDirection(*args
, **kwargs
):
13202 SetFlexibleDirection(self, int direction)
13204 Specifies whether the sizer should flexibly resize its columns, rows,
13205 or both. Argument *direction* can be one of the following values. Any
13206 other value is ignored.
13208 ============== =======================================
13209 wx.VERTICAL Rows are flexibly sized.
13210 wx.HORIZONTAL Columns are flexibly sized.
13211 wx.BOTH Both rows and columns are flexibly sized
13212 (this is the default value).
13213 ============== =======================================
13215 Note that this method does not trigger relayout.
13218 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
13220 def GetFlexibleDirection(*args
, **kwargs
):
13222 GetFlexibleDirection(self) -> int
13224 Returns a value that specifies whether the sizer
13225 flexibly resizes its columns, rows, or both (default).
13227 :see: `SetFlexibleDirection`
13229 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
13231 def SetNonFlexibleGrowMode(*args
, **kwargs
):
13233 SetNonFlexibleGrowMode(self, int mode)
13235 Specifies how the sizer should grow in the non-flexible direction if
13236 there is one (so `SetFlexibleDirection` must have been called
13237 previously). Argument *mode* can be one of the following values:
13239 ========================== =================================================
13240 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13241 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13242 `AddGrowableCol` and `AddGrowableRow`. In this
13243 case equal sizing applies to minimum sizes of
13244 columns or rows (this is the default value).
13245 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13246 the non flexible direction, whether they are
13247 growable or not in the flexbile direction.
13248 ========================== =================================================
13250 Note that this method does not trigger relayout.
13252 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
13254 def GetNonFlexibleGrowMode(*args
, **kwargs
):
13256 GetNonFlexibleGrowMode(self) -> int
13258 Returns the value that specifies how the sizer grows in the
13259 non-flexible direction if there is one.
13261 :see: `SetNonFlexibleGrowMode`
13263 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
13265 def GetRowHeights(*args
, **kwargs
):
13267 GetRowHeights(self) -> list
13269 Returns a list of integers representing the heights of each of the
13272 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
13274 def GetColWidths(*args
, **kwargs
):
13276 GetColWidths(self) -> list
13278 Returns a list of integers representing the widths of each of the
13279 columns in the sizer.
13281 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
13283 ColWidths
= property(GetColWidths
,doc
="See `GetColWidths`")
13284 FlexibleDirection
= property(GetFlexibleDirection
,SetFlexibleDirection
,doc
="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13285 NonFlexibleGrowMode
= property(GetNonFlexibleGrowMode
,SetNonFlexibleGrowMode
,doc
="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13286 RowHeights
= property(GetRowHeights
,doc
="See `GetRowHeights`")
13287 _core_
.FlexGridSizer_swigregister(FlexGridSizer
)
13289 class StdDialogButtonSizer(BoxSizer
):
13291 A special sizer that knows how to order and position standard buttons
13292 in order to conform to the current platform's standards. You simply
13293 need to add each `wx.Button` to the sizer, and be sure to create the
13294 buttons using the standard ID's. Then call `Realize` and the sizer
13295 will take care of the rest.
13298 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13299 __repr__
= _swig_repr
13300 def __init__(self
, *args
, **kwargs
):
13301 """__init__(self) -> StdDialogButtonSizer"""
13302 _core_
.StdDialogButtonSizer_swiginit(self
,_core_
.new_StdDialogButtonSizer(*args
, **kwargs
))
13303 def AddButton(*args
, **kwargs
):
13305 AddButton(self, wxButton button)
13307 Use this to add the buttons to this sizer. Do not use the `Add`
13308 method in the base class.
13310 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
13312 def Realize(*args
, **kwargs
):
13316 This funciton needs to be called after all the buttons have been added
13317 to the sizer. It will reorder them and position them in a platform
13320 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
13322 def SetAffirmativeButton(*args
, **kwargs
):
13323 """SetAffirmativeButton(self, wxButton button)"""
13324 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
13326 def SetNegativeButton(*args
, **kwargs
):
13327 """SetNegativeButton(self, wxButton button)"""
13328 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
13330 def SetCancelButton(*args
, **kwargs
):
13331 """SetCancelButton(self, wxButton button)"""
13332 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
13334 def GetAffirmativeButton(*args
, **kwargs
):
13335 """GetAffirmativeButton(self) -> wxButton"""
13336 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
13338 def GetApplyButton(*args
, **kwargs
):
13339 """GetApplyButton(self) -> wxButton"""
13340 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
13342 def GetNegativeButton(*args
, **kwargs
):
13343 """GetNegativeButton(self) -> wxButton"""
13344 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
13346 def GetCancelButton(*args
, **kwargs
):
13347 """GetCancelButton(self) -> wxButton"""
13348 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
13350 def GetHelpButton(*args
, **kwargs
):
13351 """GetHelpButton(self) -> wxButton"""
13352 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
13354 AffirmativeButton
= property(GetAffirmativeButton
,SetAffirmativeButton
,doc
="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13355 ApplyButton
= property(GetApplyButton
,doc
="See `GetApplyButton`")
13356 CancelButton
= property(GetCancelButton
,SetCancelButton
,doc
="See `GetCancelButton` and `SetCancelButton`")
13357 HelpButton
= property(GetHelpButton
,doc
="See `GetHelpButton`")
13358 NegativeButton
= property(GetNegativeButton
,SetNegativeButton
,doc
="See `GetNegativeButton` and `SetNegativeButton`")
13359 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizer
)
13361 #---------------------------------------------------------------------------
13363 class GBPosition(object):
13365 This class represents the position of an item in a virtual grid of
13366 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13367 typemaps that will automatically convert from a 2-element sequence of
13368 integers to a wx.GBPosition, so you can use the more pythonic
13369 representation of the position nearly transparently in Python code.
13371 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13372 __repr__
= _swig_repr
13373 def __init__(self
, *args
, **kwargs
):
13375 __init__(self, int row=0, int col=0) -> GBPosition
13377 This class represents the position of an item in a virtual grid of
13378 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13379 typemaps that will automatically convert from a 2-element sequence of
13380 integers to a wx.GBPosition, so you can use the more pythonic
13381 representation of the position nearly transparently in Python code.
13383 _core_
.GBPosition_swiginit(self
,_core_
.new_GBPosition(*args
, **kwargs
))
13384 __swig_destroy__
= _core_
.delete_GBPosition
13385 __del__
= lambda self
: None;
13386 def GetRow(*args
, **kwargs
):
13387 """GetRow(self) -> int"""
13388 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
13390 def GetCol(*args
, **kwargs
):
13391 """GetCol(self) -> int"""
13392 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
13394 def SetRow(*args
, **kwargs
):
13395 """SetRow(self, int row)"""
13396 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
13398 def SetCol(*args
, **kwargs
):
13399 """SetCol(self, int col)"""
13400 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
13402 def __eq__(*args
, **kwargs
):
13404 __eq__(self, PyObject other) -> bool
13406 Compare GBPosition for equality.
13408 return _core_
.GBPosition___eq__(*args
, **kwargs
)
13410 def __ne__(*args
, **kwargs
):
13412 __ne__(self, PyObject other) -> bool
13414 Compare GBPosition for inequality.
13416 return _core_
.GBPosition___ne__(*args
, **kwargs
)
13418 def Set(*args
, **kwargs
):
13419 """Set(self, int row=0, int col=0)"""
13420 return _core_
.GBPosition_Set(*args
, **kwargs
)
13422 def Get(*args
, **kwargs
):
13423 """Get(self) -> PyObject"""
13424 return _core_
.GBPosition_Get(*args
, **kwargs
)
13426 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
13427 def __str__(self
): return str(self
.Get())
13428 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
13429 def __len__(self
): return len(self
.Get())
13430 def __getitem__(self
, index
): return self
.Get()[index
]
13431 def __setitem__(self
, index
, val
):
13432 if index
== 0: self
.SetRow(val
)
13433 elif index
== 1: self
.SetCol(val
)
13434 else: raise IndexError
13435 def __nonzero__(self
): return self
.Get() != (0,0)
13436 __safe_for_unpickling__
= True
13437 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
13439 row
= property(GetRow
, SetRow
)
13440 col
= property(GetCol
, SetCol
)
13442 _core_
.GBPosition_swigregister(GBPosition
)
13444 class GBSpan(object):
13446 This class is used to hold the row and column spanning attributes of
13447 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13448 automatically convert from a 2-element sequence of integers to a
13449 wx.GBSpan, so you can use the more pythonic representation of the span
13450 nearly transparently in Python code.
13453 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13454 __repr__
= _swig_repr
13455 def __init__(self
, *args
, **kwargs
):
13457 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
13459 Construct a new wxGBSpan, optionally setting the rowspan and
13460 colspan. The default is (1,1). (Meaning that the item occupies one
13461 cell in each direction.
13463 _core_
.GBSpan_swiginit(self
,_core_
.new_GBSpan(*args
, **kwargs
))
13464 __swig_destroy__
= _core_
.delete_GBSpan
13465 __del__
= lambda self
: None;
13466 def GetRowspan(*args
, **kwargs
):
13467 """GetRowspan(self) -> int"""
13468 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
13470 def GetColspan(*args
, **kwargs
):
13471 """GetColspan(self) -> int"""
13472 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
13474 def SetRowspan(*args
, **kwargs
):
13475 """SetRowspan(self, int rowspan)"""
13476 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
13478 def SetColspan(*args
, **kwargs
):
13479 """SetColspan(self, int colspan)"""
13480 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
13482 def __eq__(*args
, **kwargs
):
13484 __eq__(self, PyObject other) -> bool
13486 Compare wxGBSpan for equality.
13488 return _core_
.GBSpan___eq__(*args
, **kwargs
)
13490 def __ne__(*args
, **kwargs
):
13492 __ne__(self, PyObject other) -> bool
13494 Compare GBSpan for inequality.
13496 return _core_
.GBSpan___ne__(*args
, **kwargs
)
13498 def Set(*args
, **kwargs
):
13499 """Set(self, int rowspan=1, int colspan=1)"""
13500 return _core_
.GBSpan_Set(*args
, **kwargs
)
13502 def Get(*args
, **kwargs
):
13503 """Get(self) -> PyObject"""
13504 return _core_
.GBSpan_Get(*args
, **kwargs
)
13506 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
13507 def __str__(self
): return str(self
.Get())
13508 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
13509 def __len__(self
): return len(self
.Get())
13510 def __getitem__(self
, index
): return self
.Get()[index
]
13511 def __setitem__(self
, index
, val
):
13512 if index
== 0: self
.SetRowspan(val
)
13513 elif index
== 1: self
.SetColspan(val
)
13514 else: raise IndexError
13515 def __nonzero__(self
): return self
.Get() != (0,0)
13516 __safe_for_unpickling__
= True
13517 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
13519 rowspan
= property(GetRowspan
, SetRowspan
)
13520 colspan
= property(GetColspan
, SetColspan
)
13522 _core_
.GBSpan_swigregister(GBSpan
)
13524 class GBSizerItem(SizerItem
):
13526 The wx.GBSizerItem class is used to track the additional data about
13527 items in a `wx.GridBagSizer` such as the item's position in the grid
13528 and how many rows or columns it spans.
13531 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13532 __repr__
= _swig_repr
13533 def __init__(self
, *args
, **kwargs
):
13535 __init__(self) -> GBSizerItem
13537 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13538 size will need to be set, as well as a position and span before this
13539 item can be used in a Sizer.
13541 You will probably never need to create a wx.GBSizerItem directly as they
13542 are created automatically when the sizer's Add method is called.
13544 _core_
.GBSizerItem_swiginit(self
,_core_
.new_GBSizerItem(*args
, **kwargs
))
13545 __swig_destroy__
= _core_
.delete_GBSizerItem
13546 __del__
= lambda self
: None;
13547 def GetPos(*args
, **kwargs
):
13549 GetPos(self) -> GBPosition
13551 Get the grid position of the item
13553 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
13555 def GetPosTuple(self
): return self
.GetPos().Get()
13556 def GetSpan(*args
, **kwargs
):
13558 GetSpan(self) -> GBSpan
13560 Get the row and column spanning of the item
13562 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
13564 def GetSpanTuple(self
): return self
.GetSpan().Get()
13565 def SetPos(*args
, **kwargs
):
13567 SetPos(self, GBPosition pos) -> bool
13569 If the item is already a member of a sizer then first ensure that
13570 there is no other item that would intersect with this one at the new
13571 position, then set the new position. Returns True if the change is
13572 successful and after the next Layout() the item will be moved.
13574 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
13576 def SetSpan(*args
, **kwargs
):
13578 SetSpan(self, GBSpan span) -> bool
13580 If the item is already a member of a sizer then first ensure that
13581 there is no other item that would intersect with this one with its new
13582 spanning size, then set the new spanning. Returns True if the change
13583 is successful and after the next Layout() the item will be resized.
13586 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
13588 def Intersects(*args
, **kwargs
):
13590 Intersects(self, GBSizerItem other) -> bool
13592 Returns True if this item and the other item instersect.
13594 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
13596 def IntersectsPos(*args
, **kwargs
):
13598 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
13600 Returns True if the given pos/span would intersect with this item.
13602 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
13604 def GetEndPos(*args
, **kwargs
):
13606 GetEndPos(self) -> GBPosition
13608 Get the row and column of the endpoint of this item.
13610 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
13612 def GetGBSizer(*args
, **kwargs
):
13614 GetGBSizer(self) -> GridBagSizer
13616 Get the sizer this item is a member of.
13618 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
13620 def SetGBSizer(*args
, **kwargs
):
13622 SetGBSizer(self, GridBagSizer sizer)
13624 Set the sizer this item is a member of.
13626 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
13628 EndPos
= property(GetEndPos
,doc
="See `GetEndPos`")
13629 GBSizer
= property(GetGBSizer
,SetGBSizer
,doc
="See `GetGBSizer` and `SetGBSizer`")
13630 Pos
= property(GetPos
,SetPos
,doc
="See `GetPos` and `SetPos`")
13631 Span
= property(GetSpan
,SetSpan
,doc
="See `GetSpan` and `SetSpan`")
13632 _core_
.GBSizerItem_swigregister(GBSizerItem
)
13633 DefaultSpan
= cvar
.DefaultSpan
13635 def GBSizerItemWindow(*args
, **kwargs
):
13637 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
13638 int border, PyObject userData=None) -> GBSizerItem
13640 Construct a `wx.GBSizerItem` for a window.
13642 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
13645 def GBSizerItemSizer(*args
, **kwargs
):
13647 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
13648 int border, PyObject userData=None) -> GBSizerItem
13650 Construct a `wx.GBSizerItem` for a sizer
13652 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
13655 def GBSizerItemSpacer(*args
, **kwargs
):
13657 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
13658 int flag, int border, PyObject userData=None) -> GBSizerItem
13660 Construct a `wx.GBSizerItem` for a spacer.
13662 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
13665 class GridBagSizer(FlexGridSizer
):
13667 A `wx.Sizer` that can lay out items in a virtual grid like a
13668 `wx.FlexGridSizer` but in this case explicit positioning of the items
13669 is allowed using `wx.GBPosition`, and items can optionally span more
13670 than one row and/or column using `wx.GBSpan`. The total size of the
13671 virtual grid is determined by the largest row and column that items are
13672 positioned at, adjusted for spanning.
13675 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13676 __repr__
= _swig_repr
13677 def __init__(self
, *args
, **kwargs
):
13679 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
13681 Constructor, with optional parameters to specify the gap between the
13684 _core_
.GridBagSizer_swiginit(self
,_core_
.new_GridBagSizer(*args
, **kwargs
))
13685 self
._setOORInfo
(self
)
13687 def Add(*args
, **kwargs
):
13689 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
13690 int border=0, userData=None) -> wx.GBSizerItem
13692 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13693 more than one row or column as specified with *span*. The remaining
13694 args behave similarly to `wx.Sizer.Add`.
13696 Returns True if the item was successfully placed at the given cell
13697 position, False if something was already there.
13700 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
13702 def AddItem(*args
, **kwargs
):
13704 Add(self, GBSizerItem item) -> wx.GBSizerItem
13706 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13707 the item was successfully placed at its given cell position, False if
13708 something was already there.
13710 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
13712 def GetCellSize(*args
, **kwargs
):
13714 GetCellSize(self, int row, int col) -> Size
13716 Get the size of the specified cell, including hgap and
13717 vgap. Only valid after a Layout.
13719 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
13721 def GetEmptyCellSize(*args
, **kwargs
):
13723 GetEmptyCellSize(self) -> Size
13725 Get the size used for cells in the grid with no item.
13727 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
13729 def SetEmptyCellSize(*args
, **kwargs
):
13731 SetEmptyCellSize(self, Size sz)
13733 Set the size used for cells in the grid with no item.
13735 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
13737 def GetItemPosition(*args
):
13739 GetItemPosition(self, item) -> GBPosition
13741 Get the grid position of the specified *item* where *item* is either a
13742 window or subsizer that is a member of this sizer, or a zero-based
13745 return _core_
.GridBagSizer_GetItemPosition(*args
)
13747 def SetItemPosition(*args
):
13749 SetItemPosition(self, item, GBPosition pos) -> bool
13751 Set the grid position of the specified *item* where *item* is either a
13752 window or subsizer that is a member of this sizer, or a zero-based
13753 index of an item. Returns True on success. If the move is not
13754 allowed (because an item is already there) then False is returned.
13757 return _core_
.GridBagSizer_SetItemPosition(*args
)
13759 def GetItemSpan(*args
):
13761 GetItemSpan(self, item) -> GBSpan
13763 Get the row/col spanning of the specified *item* where *item* is
13764 either a window or subsizer that is a member of this sizer, or a
13765 zero-based index of an item.
13767 return _core_
.GridBagSizer_GetItemSpan(*args
)
13769 def SetItemSpan(*args
):
13771 SetItemSpan(self, item, GBSpan span) -> bool
13773 Set the row/col spanning of the specified *item* where *item* is
13774 either a window or subsizer that is a member of this sizer, or a
13775 zero-based index of an item. Returns True on success. If the move is
13776 not allowed (because an item is already there) then False is returned.
13778 return _core_
.GridBagSizer_SetItemSpan(*args
)
13780 def FindItem(*args
):
13782 FindItem(self, item) -> GBSizerItem
13784 Find the sizer item for the given window or subsizer, returns None if
13785 not found. (non-recursive)
13787 return _core_
.GridBagSizer_FindItem(*args
)
13789 def GetItem(self
, item
):
13791 si
= wx
.FlexGridSizer
.GetItem(self
, item
)
13794 if type(item
) is not int:
13795 gbsi
= self
.FindItem(item
)
13796 if gbsi
: return gbsi
13799 def FindItemAtPosition(*args
, **kwargs
):
13801 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13803 Return the sizer item for the given grid cell, or None if there is no
13804 item at that position. (non-recursive)
13806 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
13808 def FindItemAtPoint(*args
, **kwargs
):
13810 FindItemAtPoint(self, Point pt) -> GBSizerItem
13812 Return the sizer item located at the point given in *pt*, or None if
13813 there is no item at that point. The (x,y) coordinates in pt correspond
13814 to the client coordinates of the window using the sizer for
13815 layout. (non-recursive)
13817 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
13819 def CheckForIntersection(*args
, **kwargs
):
13821 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
13823 Look at all items and see if any intersect (or would overlap) the
13824 given *item*. Returns True if so, False if there would be no overlap.
13825 If an *excludeItem* is given then it will not be checked for
13826 intersection, for example it may be the item we are checking the
13830 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
13832 def CheckForIntersectionPos(*args
, **kwargs
):
13834 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13836 Look at all items and see if any intersect (or would overlap) the
13837 given position and span. Returns True if so, False if there would be
13838 no overlap. If an *excludeItem* is given then it will not be checked
13839 for intersection, for example it may be the item we are checking the
13842 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
13844 _core_
.GridBagSizer_swigregister(GridBagSizer
)
13846 #---------------------------------------------------------------------------
13850 Right
= _core_
.Right
13851 Bottom
= _core_
.Bottom
13852 Width
= _core_
.Width
13853 Height
= _core_
.Height
13854 Centre
= _core_
.Centre
13855 Center
= _core_
.Center
13856 CentreX
= _core_
.CentreX
13857 CentreY
= _core_
.CentreY
13858 Unconstrained
= _core_
.Unconstrained
13860 PercentOf
= _core_
.PercentOf
13861 Above
= _core_
.Above
13862 Below
= _core_
.Below
13863 LeftOf
= _core_
.LeftOf
13864 RightOf
= _core_
.RightOf
13865 SameAs
= _core_
.SameAs
13866 Absolute
= _core_
.Absolute
13867 class IndividualLayoutConstraint(Object
):
13869 Objects of this class are stored in the `wx.LayoutConstraints` class as
13870 one of eight possible constraints that a window can be involved in.
13871 You will never need to create an instance of
13872 wx.IndividualLayoutConstraint, rather you should create a
13873 `wx.LayoutConstraints` instance and use the individual contstraints
13876 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
13877 def __init__(self
): raise AttributeError, "No constructor defined"
13878 __repr__
= _swig_repr
13879 def Set(*args
, **kwargs
):
13881 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13883 Sets the properties of the constraint. Normally called by one of the
13884 convenience functions such as Above, RightOf, SameAs.
13886 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
13888 def LeftOf(*args
, **kwargs
):
13890 LeftOf(self, Window sibling, int marg=0)
13892 Constrains this edge to be to the left of the given window, with an
13893 optional margin. Implicitly, this is relative to the left edge of the
13896 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
13898 def RightOf(*args
, **kwargs
):
13900 RightOf(self, Window sibling, int marg=0)
13902 Constrains this edge to be to the right of the given window, with an
13903 optional margin. Implicitly, this is relative to the right edge of the
13906 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
13908 def Above(*args
, **kwargs
):
13910 Above(self, Window sibling, int marg=0)
13912 Constrains this edge to be above the given window, with an optional
13913 margin. Implicitly, this is relative to the top edge of the other
13916 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
13918 def Below(*args
, **kwargs
):
13920 Below(self, Window sibling, int marg=0)
13922 Constrains this edge to be below the given window, with an optional
13923 margin. Implicitly, this is relative to the bottom edge of the other
13926 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
13928 def SameAs(*args
, **kwargs
):
13930 SameAs(self, Window otherW, int edge, int marg=0)
13932 Constrains this edge or dimension to be to the same as the edge of the
13933 given window, with an optional margin.
13935 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
13937 def PercentOf(*args
, **kwargs
):
13939 PercentOf(self, Window otherW, int wh, int per)
13941 Constrains this edge or dimension to be to a percentage of the given
13942 window, with an optional margin.
13944 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
13946 def Absolute(*args
, **kwargs
):
13948 Absolute(self, int val)
13950 Constrains this edge or dimension to be the given absolute value.
13952 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
13954 def Unconstrained(*args
, **kwargs
):
13956 Unconstrained(self)
13958 Sets this edge or dimension to be unconstrained, that is, dependent on
13959 other edges and dimensions from which this value can be deduced.
13961 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
13963 def AsIs(*args
, **kwargs
):
13967 Sets this edge or constraint to be whatever the window's value is at
13968 the moment. If either of the width and height constraints are *as is*,
13969 the window will not be resized, but moved instead. This is important
13970 when considering panel items which are intended to have a default
13971 size, such as a button, which may take its size from the size of the
13974 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
13976 def GetOtherWindow(*args
, **kwargs
):
13977 """GetOtherWindow(self) -> Window"""
13978 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
13980 def GetMyEdge(*args
, **kwargs
):
13981 """GetMyEdge(self) -> int"""
13982 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
13984 def SetEdge(*args
, **kwargs
):
13985 """SetEdge(self, int which)"""
13986 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
13988 def SetValue(*args
, **kwargs
):
13989 """SetValue(self, int v)"""
13990 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
13992 def GetMargin(*args
, **kwargs
):
13993 """GetMargin(self) -> int"""
13994 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
13996 def SetMargin(*args
, **kwargs
):
13997 """SetMargin(self, int m)"""
13998 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
14000 def GetValue(*args
, **kwargs
):
14001 """GetValue(self) -> int"""
14002 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
14004 def GetPercent(*args
, **kwargs
):
14005 """GetPercent(self) -> int"""
14006 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
14008 def GetOtherEdge(*args
, **kwargs
):
14009 """GetOtherEdge(self) -> int"""
14010 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
14012 def GetDone(*args
, **kwargs
):
14013 """GetDone(self) -> bool"""
14014 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
14016 def SetDone(*args
, **kwargs
):
14017 """SetDone(self, bool d)"""
14018 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
14020 def GetRelationship(*args
, **kwargs
):
14021 """GetRelationship(self) -> int"""
14022 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
14024 def SetRelationship(*args
, **kwargs
):
14025 """SetRelationship(self, int r)"""
14026 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
14028 def ResetIfWin(*args
, **kwargs
):
14030 ResetIfWin(self, Window otherW) -> bool
14032 Reset constraint if it mentions otherWin
14034 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
14036 def SatisfyConstraint(*args
, **kwargs
):
14038 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
14040 Try to satisfy constraint
14042 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
14044 def GetEdge(*args
, **kwargs
):
14046 GetEdge(self, int which, Window thisWin, Window other) -> int
14048 Get the value of this edge or dimension, or if this
14049 is not determinable, -1.
14051 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
14053 Done
= property(GetDone
,SetDone
,doc
="See `GetDone` and `SetDone`")
14054 Margin
= property(GetMargin
,SetMargin
,doc
="See `GetMargin` and `SetMargin`")
14055 MyEdge
= property(GetMyEdge
,doc
="See `GetMyEdge`")
14056 OtherEdge
= property(GetOtherEdge
,doc
="See `GetOtherEdge`")
14057 OtherWindow
= property(GetOtherWindow
,doc
="See `GetOtherWindow`")
14058 Percent
= property(GetPercent
,doc
="See `GetPercent`")
14059 Relationship
= property(GetRelationship
,SetRelationship
,doc
="See `GetRelationship` and `SetRelationship`")
14060 Value
= property(GetValue
,SetValue
,doc
="See `GetValue` and `SetValue`")
14061 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint
)
14063 class LayoutConstraints(Object
):
14065 **Note:** constraints are now deprecated and you should use sizers
14068 Objects of this class can be associated with a window to define its
14069 layout constraints, with respect to siblings or its parent.
14071 The class consists of the following eight constraints of class
14072 wx.IndividualLayoutConstraint, some or all of which should be accessed
14073 directly to set the appropriate constraints.
14075 * left: represents the left hand edge of the window
14076 * right: represents the right hand edge of the window
14077 * top: represents the top edge of the window
14078 * bottom: represents the bottom edge of the window
14079 * width: represents the width of the window
14080 * height: represents the height of the window
14081 * centreX: represents the horizontal centre point of the window
14082 * centreY: represents the vertical centre point of the window
14084 Most constraints are initially set to have the relationship
14085 wxUnconstrained, which means that their values should be calculated by
14086 looking at known constraints. The exceptions are width and height,
14087 which are set to wxAsIs to ensure that if the user does not specify a
14088 constraint, the existing width and height will be used, to be
14089 compatible with panel items which often have take a default size. If
14090 the constraint is ``wx.AsIs``, the dimension will not be changed.
14092 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
14095 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
14096 __repr__
= _swig_repr
14097 left
= property(_core_
.LayoutConstraints_left_get
)
14098 top
= property(_core_
.LayoutConstraints_top_get
)
14099 right
= property(_core_
.LayoutConstraints_right_get
)
14100 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
14101 width
= property(_core_
.LayoutConstraints_width_get
)
14102 height
= property(_core_
.LayoutConstraints_height_get
)
14103 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
14104 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
14105 def __init__(self
, *args
, **kwargs
):
14106 """__init__(self) -> LayoutConstraints"""
14107 _core_
.LayoutConstraints_swiginit(self
,_core_
.new_LayoutConstraints(*args
, **kwargs
))
14108 __swig_destroy__
= _core_
.delete_LayoutConstraints
14109 __del__
= lambda self
: None;
14110 def SatisfyConstraints(*args
, **kwargs
):
14111 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
14112 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
14114 def AreSatisfied(*args
, **kwargs
):
14115 """AreSatisfied(self) -> bool"""
14116 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
14118 _core_
.LayoutConstraints_swigregister(LayoutConstraints
)
14120 #----------------------------------------------------------------------------
14122 # Use Python's bool constants if available, make some if not
14126 __builtins__
.True = 1==1
14127 __builtins__
.False = 1==0
14128 def bool(value
): return not not value
14129 __builtins__
.bool = bool
14133 # workarounds for bad wxRTTI names
14134 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
14135 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
14136 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
14139 #----------------------------------------------------------------------------
14140 # Load version numbers from __version__... Ensure that major and minor
14141 # versions are the same for both wxPython and wxWidgets.
14143 from __version__
import *
14144 __version__
= VERSION_STRING
14146 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
14147 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
14148 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
14150 warnings
.warn("wxPython/wxWidgets release number mismatch")
14154 """Returns a string containing version and port info"""
14155 ctype
= wx
.USE_UNICODE
and 'unicode' or 'ansi'
14156 if wx
.Platform
== '__WXMSW__':
14158 elif wx
.Platform
== '__WXMAC__':
14160 elif wx
.Platform
== '__WXGTK__':
14162 if 'gtk2' in wx
.PlatformInfo
:
14167 return "%s (%s-%s)" % (wx
.VERSION_STRING
, port
, ctype
)
14170 #----------------------------------------------------------------------------
14172 # Set wxPython's default string<-->unicode conversion encoding from
14173 # the locale, but only if Python's default hasn't been changed. (We
14174 # assume that if the user has customized it already then that is the
14175 # encoding we need to use as well.)
14177 # The encoding selected here is used when string or unicode objects
14178 # need to be converted in order to pass them to wxWidgets. Please be
14179 # aware that the default encoding within the same locale may be
14180 # slightly different on different platforms. For example, please see
14181 # http://www.alanwood.net/demos/charsetdiffs.html for differences
14182 # between the common latin/roman encodings.
14184 default
= _sys
.getdefaultencoding()
14185 if default
== 'ascii':
14189 if hasattr(locale
, 'getpreferredencoding'):
14190 default
= locale
.getpreferredencoding()
14192 default
= locale
.getdefaultlocale()[1]
14193 codecs
.lookup(default
)
14194 except (ValueError, LookupError, TypeError):
14195 default
= _sys
.getdefaultencoding()
14199 wx
.SetDefaultPyEncoding(default
)
14202 #----------------------------------------------------------------------------
14204 class PyDeadObjectError(AttributeError):
14207 class _wxPyDeadObject(object):
14209 Instances of wx objects that are OOR capable will have their __class__
14210 changed to this class when the C++ object is deleted. This should help
14211 prevent crashes due to referencing a bogus C++ pointer.
14213 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14214 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14216 def __repr__(self
):
14217 if not hasattr(self
, "_name"):
14218 self
._name
= "[unknown]"
14219 return self
.reprStr
% self
._name
14221 def __getattr__(self
, *args
):
14222 if not hasattr(self
, "_name"):
14223 self
._name
= "[unknown]"
14224 raise PyDeadObjectError(self
.attrStr
% self
._name
)
14226 def __nonzero__(self
):
14231 class PyUnbornObjectError(AttributeError):
14234 class _wxPyUnbornObject(object):
14236 Some stock objects are created when the wx._core module is
14237 imported, but their C++ instance is not created until the wx.App
14238 object is created and initialized. These object instances will
14239 temporarily have their __class__ changed to this class so an
14240 exception will be raised if they are used before the C++ instance
14244 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14245 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
14247 def __repr__(self
):
14248 #if not hasattr(self, "_name"):
14249 # self._name = "[unknown]"
14250 return self
.reprStr
#% self._name
14252 def __getattr__(self
, *args
):
14253 #if not hasattr(self, "_name"):
14254 # self._name = "[unknown]"
14255 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
14257 def __nonzero__(self
):
14261 #----------------------------------------------------------------------------
14263 def CallAfter(callable, *args
, **kw
):
14265 Call the specified function after the current and pending event
14266 handlers have been completed. This is also good for making GUI
14267 method calls from non-GUI threads. Any extra positional or
14268 keyword args are passed on to the callable when it is called.
14270 :see: `wx.CallLater`
14273 assert app
is not None, 'No wx.App created yet'
14275 if not hasattr(app
, "_CallAfterId"):
14276 app
._CallAfterId
= wx
.NewEventType()
14277 app
.Connect(-1, -1, app
._CallAfterId
,
14278 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
14280 evt
.SetEventType(app
._CallAfterId
)
14281 evt
.callable = callable
14284 wx
.PostEvent(app
, evt
)
14286 #----------------------------------------------------------------------------
14291 A convenience class for `wx.Timer`, that calls the given callable
14292 object once after the given amount of milliseconds, passing any
14293 positional or keyword args. The return value of the callable is
14294 availbale after it has been run with the `GetResult` method.
14296 If you don't need to get the return value or restart the timer
14297 then there is no need to hold a reference to this object. It will
14298 hold a reference to itself while the timer is running (the timer
14299 has a reference to self.Notify) but the cycle will be broken when
14300 the timer completes, automatically cleaning up the wx.CallLater
14303 :see: `wx.CallAfter`
14305 def __init__(self
, millis
, callable, *args
, **kwargs
):
14306 self
.millis
= millis
14307 self
.callable = callable
14308 self
.SetArgs(*args
, **kwargs
)
14310 self
.running
= False
14311 self
.hasRun
= False
14320 def Start(self
, millis
=None, *args
, **kwargs
):
14322 (Re)start the timer
14324 self
.hasRun
= False
14325 if millis
is not None:
14326 self
.millis
= millis
14328 self
.SetArgs(*args
, **kwargs
)
14330 self
.timer
= wx
.PyTimer(self
.Notify
)
14331 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
14332 self
.running
= True
14338 Stop and destroy the timer.
14340 if self
.timer
is not None:
14345 def GetInterval(self
):
14346 if self
.timer
is not None:
14347 return self
.timer
.GetInterval()
14352 def IsRunning(self
):
14353 return self
.timer
is not None and self
.timer
.IsRunning()
14356 def SetArgs(self
, *args
, **kwargs
):
14358 (Re)set the args passed to the callable object. This is
14359 useful in conjunction with Restart if you want to schedule a
14360 new call to the same callable object but with different
14364 self
.kwargs
= kwargs
14370 def GetResult(self
):
14375 The timer has expired so call the callable.
14377 if self
.callable and getattr(self
.callable, 'im_self', True):
14379 self
.running
= False
14380 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
14382 if not self
.running
:
14383 # if it wasn't restarted, then cleanup
14384 wx
.CallAfter(self
.Stop
)
14386 Interval
= property(GetInterval
)
14387 Result
= property(GetResult
)
14390 class FutureCall(CallLater
):
14391 """A compatibility alias for `CallLater`."""
14393 #----------------------------------------------------------------------------
14394 # Control which items in this module should be documented by epydoc.
14395 # We allow only classes and functions, which will help reduce the size
14396 # of the docs by filtering out the zillions of constants, EVT objects,
14397 # and etc that don't make much sense by themselves, but are instead
14398 # documented (or will be) as part of the classes/functions/methods
14399 # where they should be used.
14403 A filter for epydoc that only allows non-Ptr classes and
14404 functions, in order to reduce the clutter in the API docs.
14406 def __init__(self
, globals):
14407 self
._globals
= globals
14409 def __call__(self
, name
):
14411 obj
= self
._globals
.get(name
, None)
14413 # only document classes and function
14414 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
14417 # skip other things that are private or will be documented as part of somethign else
14418 if name
.startswith('_') or name
.startswith('EVT') or name
.endswith('_swigregister') or name
.endswith('Ptr') :
14421 # skip functions that are duplicates of static functions in a class
14422 if name
.find('_') != -1:
14423 cls
= self
._globals
.get(name
.split('_')[0], None)
14424 methname
= name
.split('_')[1]
14425 if hasattr(cls
, methname
) and type(getattr(cls
, methname
)) is types
.FunctionType
:
14430 #----------------------------------------------------------------------------
14431 #----------------------------------------------------------------------------
14433 # Import other modules in this package that should show up in the
14434 # "core" wx namespace
14436 from _windows
import *
14437 from _controls
import *
14438 from _misc
import *
14440 #----------------------------------------------------------------------------
14441 #----------------------------------------------------------------------------