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 ALWAYS_SHOW_SB
= _core_
.ALWAYS_SHOW_SB
106 RETAINED
= _core_
.RETAINED
107 BACKINGSTORE
= _core_
.BACKINGSTORE
108 COLOURED
= _core_
.COLOURED
109 FIXED_LENGTH
= _core_
.FIXED_LENGTH
110 LB_NEEDED_SB
= _core_
.LB_NEEDED_SB
111 LB_ALWAYS_SB
= _core_
.LB_ALWAYS_SB
112 LB_SORT
= _core_
.LB_SORT
113 LB_SINGLE
= _core_
.LB_SINGLE
114 LB_MULTIPLE
= _core_
.LB_MULTIPLE
115 LB_EXTENDED
= _core_
.LB_EXTENDED
116 LB_OWNERDRAW
= _core_
.LB_OWNERDRAW
117 LB_HSCROLL
= _core_
.LB_HSCROLL
118 PROCESS_ENTER
= _core_
.PROCESS_ENTER
119 PASSWORD
= _core_
.PASSWORD
120 CB_SIMPLE
= _core_
.CB_SIMPLE
121 CB_DROPDOWN
= _core_
.CB_DROPDOWN
122 CB_SORT
= _core_
.CB_SORT
123 CB_READONLY
= _core_
.CB_READONLY
124 RA_HORIZONTAL
= _core_
.RA_HORIZONTAL
125 RA_VERTICAL
= _core_
.RA_VERTICAL
126 RA_SPECIFY_ROWS
= _core_
.RA_SPECIFY_ROWS
127 RA_SPECIFY_COLS
= _core_
.RA_SPECIFY_COLS
128 RA_USE_CHECKBOX
= _core_
.RA_USE_CHECKBOX
129 RB_GROUP
= _core_
.RB_GROUP
130 RB_SINGLE
= _core_
.RB_SINGLE
131 SB_HORIZONTAL
= _core_
.SB_HORIZONTAL
132 SB_VERTICAL
= _core_
.SB_VERTICAL
133 RB_USE_CHECKBOX
= _core_
.RB_USE_CHECKBOX
134 ST_SIZEGRIP
= _core_
.ST_SIZEGRIP
135 ST_NO_AUTORESIZE
= _core_
.ST_NO_AUTORESIZE
136 ST_DOTS_MIDDLE
= _core_
.ST_DOTS_MIDDLE
137 ST_DOTS_END
= _core_
.ST_DOTS_END
138 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
139 FLOOD_BORDER
= _core_
.FLOOD_BORDER
140 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
141 WINDING_RULE
= _core_
.WINDING_RULE
142 TOOL_TOP
= _core_
.TOOL_TOP
143 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
144 TOOL_LEFT
= _core_
.TOOL_LEFT
145 TOOL_RIGHT
= _core_
.TOOL_RIGHT
147 YES_NO
= _core_
.YES_NO
148 CANCEL
= _core_
.CANCEL
151 NO_DEFAULT
= _core_
.NO_DEFAULT
152 YES_DEFAULT
= _core_
.YES_DEFAULT
153 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
154 ICON_HAND
= _core_
.ICON_HAND
155 ICON_QUESTION
= _core_
.ICON_QUESTION
156 ICON_INFORMATION
= _core_
.ICON_INFORMATION
157 ICON_STOP
= _core_
.ICON_STOP
158 ICON_ASTERISK
= _core_
.ICON_ASTERISK
159 ICON_MASK
= _core_
.ICON_MASK
160 ICON_WARNING
= _core_
.ICON_WARNING
161 ICON_ERROR
= _core_
.ICON_ERROR
162 FORWARD
= _core_
.FORWARD
163 BACKWARD
= _core_
.BACKWARD
168 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
169 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
170 SIZE_AUTO
= _core_
.SIZE_AUTO
171 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
172 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
173 SIZE_FORCE
= _core_
.SIZE_FORCE
174 PORTRAIT
= _core_
.PORTRAIT
175 LANDSCAPE
= _core_
.LANDSCAPE
176 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
177 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
178 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
179 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
180 ID_ANY
= _core_
.ID_ANY
181 ID_SEPARATOR
= _core_
.ID_SEPARATOR
182 ID_NONE
= _core_
.ID_NONE
183 ID_LOWEST
= _core_
.ID_LOWEST
184 ID_OPEN
= _core_
.ID_OPEN
185 ID_CLOSE
= _core_
.ID_CLOSE
186 ID_NEW
= _core_
.ID_NEW
187 ID_SAVE
= _core_
.ID_SAVE
188 ID_SAVEAS
= _core_
.ID_SAVEAS
189 ID_REVERT
= _core_
.ID_REVERT
190 ID_EXIT
= _core_
.ID_EXIT
191 ID_UNDO
= _core_
.ID_UNDO
192 ID_REDO
= _core_
.ID_REDO
193 ID_HELP
= _core_
.ID_HELP
194 ID_PRINT
= _core_
.ID_PRINT
195 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
196 ID_PREVIEW
= _core_
.ID_PREVIEW
197 ID_ABOUT
= _core_
.ID_ABOUT
198 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
199 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
200 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
201 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
202 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
203 ID_PREFERENCES
= _core_
.ID_PREFERENCES
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_FILE1
= _core_
.ID_FILE1
224 ID_FILE2
= _core_
.ID_FILE2
225 ID_FILE3
= _core_
.ID_FILE3
226 ID_FILE4
= _core_
.ID_FILE4
227 ID_FILE5
= _core_
.ID_FILE5
228 ID_FILE6
= _core_
.ID_FILE6
229 ID_FILE7
= _core_
.ID_FILE7
230 ID_FILE8
= _core_
.ID_FILE8
231 ID_FILE9
= _core_
.ID_FILE9
233 ID_CANCEL
= _core_
.ID_CANCEL
234 ID_APPLY
= _core_
.ID_APPLY
235 ID_YES
= _core_
.ID_YES
237 ID_STATIC
= _core_
.ID_STATIC
238 ID_FORWARD
= _core_
.ID_FORWARD
239 ID_BACKWARD
= _core_
.ID_BACKWARD
240 ID_DEFAULT
= _core_
.ID_DEFAULT
241 ID_MORE
= _core_
.ID_MORE
242 ID_SETUP
= _core_
.ID_SETUP
243 ID_RESET
= _core_
.ID_RESET
244 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
245 ID_YESTOALL
= _core_
.ID_YESTOALL
246 ID_NOTOALL
= _core_
.ID_NOTOALL
247 ID_ABORT
= _core_
.ID_ABORT
248 ID_RETRY
= _core_
.ID_RETRY
249 ID_IGNORE
= _core_
.ID_IGNORE
250 ID_ADD
= _core_
.ID_ADD
251 ID_REMOVE
= _core_
.ID_REMOVE
253 ID_DOWN
= _core_
.ID_DOWN
254 ID_HOME
= _core_
.ID_HOME
255 ID_REFRESH
= _core_
.ID_REFRESH
256 ID_STOP
= _core_
.ID_STOP
257 ID_INDEX
= _core_
.ID_INDEX
258 ID_BOLD
= _core_
.ID_BOLD
259 ID_ITALIC
= _core_
.ID_ITALIC
260 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
261 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
262 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
263 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
264 ID_UNDERLINE
= _core_
.ID_UNDERLINE
265 ID_INDENT
= _core_
.ID_INDENT
266 ID_UNINDENT
= _core_
.ID_UNINDENT
267 ID_ZOOM_100
= _core_
.ID_ZOOM_100
268 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
269 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
270 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
271 ID_UNDELETE
= _core_
.ID_UNDELETE
272 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
273 ID_HIGHEST
= _core_
.ID_HIGHEST
276 HIDE_READONLY
= _core_
.HIDE_READONLY
277 OVERWRITE_PROMPT
= _core_
.OVERWRITE_PROMPT
278 FILE_MUST_EXIST
= _core_
.FILE_MUST_EXIST
279 MULTIPLE
= _core_
.MULTIPLE
280 CHANGE_DIR
= _core_
.CHANGE_DIR
281 ACCEL_ALT
= _core_
.ACCEL_ALT
282 ACCEL_CTRL
= _core_
.ACCEL_CTRL
283 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
284 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
285 PD_AUTO_HIDE
= _core_
.PD_AUTO_HIDE
286 PD_APP_MODAL
= _core_
.PD_APP_MODAL
287 PD_CAN_ABORT
= _core_
.PD_CAN_ABORT
288 PD_ELAPSED_TIME
= _core_
.PD_ELAPSED_TIME
289 PD_ESTIMATED_TIME
= _core_
.PD_ESTIMATED_TIME
290 PD_REMAINING_TIME
= _core_
.PD_REMAINING_TIME
291 PD_SMOOTH
= _core_
.PD_SMOOTH
292 PD_CAN_SKIP
= _core_
.PD_CAN_SKIP
293 DD_NEW_DIR_BUTTON
= _core_
.DD_NEW_DIR_BUTTON
294 DD_DEFAULT_STYLE
= _core_
.DD_DEFAULT_STYLE
295 MENU_TEAROFF
= _core_
.MENU_TEAROFF
296 MB_DOCKABLE
= _core_
.MB_DOCKABLE
297 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
298 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
299 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
300 LI_VERTICAL
= _core_
.LI_VERTICAL
301 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
302 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
303 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
304 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
305 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
306 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
307 MM_TEXT
= _core_
.MM_TEXT
308 MM_LOMETRIC
= _core_
.MM_LOMETRIC
309 MM_HIMETRIC
= _core_
.MM_HIMETRIC
310 MM_LOENGLISH
= _core_
.MM_LOENGLISH
311 MM_HIENGLISH
= _core_
.MM_HIENGLISH
312 MM_TWIPS
= _core_
.MM_TWIPS
313 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
314 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
315 MM_POINTS
= _core_
.MM_POINTS
316 MM_METRIC
= _core_
.MM_METRIC
317 CENTRE
= _core_
.CENTRE
318 CENTER
= _core_
.CENTER
319 HORIZONTAL
= _core_
.HORIZONTAL
320 VERTICAL
= _core_
.VERTICAL
327 BOTTOM
= _core_
.BOTTOM
333 ALIGN_NOT
= _core_
.ALIGN_NOT
334 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
335 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
336 ALIGN_LEFT
= _core_
.ALIGN_LEFT
337 ALIGN_TOP
= _core_
.ALIGN_TOP
338 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
339 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
340 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
341 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
342 ALIGN_CENTER
= _core_
.ALIGN_CENTER
343 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
344 ALIGN_MASK
= _core_
.ALIGN_MASK
345 STRETCH_NOT
= _core_
.STRETCH_NOT
346 SHRINK
= _core_
.SHRINK
348 EXPAND
= _core_
.EXPAND
349 SHAPED
= _core_
.SHAPED
350 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
352 ADJUST_MINSIZE
= _core_
.ADJUST_MINSIZE
353 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
354 BORDER_NONE
= _core_
.BORDER_NONE
355 BORDER_STATIC
= _core_
.BORDER_STATIC
356 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
357 BORDER_RAISED
= _core_
.BORDER_RAISED
358 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
359 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
360 BORDER_MASK
= _core_
.BORDER_MASK
361 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
362 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
363 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
364 DEFAULT
= _core_
.DEFAULT
365 DECORATIVE
= _core_
.DECORATIVE
367 SCRIPT
= _core_
.SCRIPT
369 MODERN
= _core_
.MODERN
370 TELETYPE
= _core_
.TELETYPE
371 VARIABLE
= _core_
.VARIABLE
373 NORMAL
= _core_
.NORMAL
376 ITALIC
= _core_
.ITALIC
380 LONG_DASH
= _core_
.LONG_DASH
381 SHORT_DASH
= _core_
.SHORT_DASH
382 DOT_DASH
= _core_
.DOT_DASH
383 USER_DASH
= _core_
.USER_DASH
384 TRANSPARENT
= _core_
.TRANSPARENT
385 STIPPLE
= _core_
.STIPPLE
386 STIPPLE_MASK
= _core_
.STIPPLE_MASK
387 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
388 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
389 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
390 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
391 CROSS_HATCH
= _core_
.CROSS_HATCH
392 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
393 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
394 JOIN_BEVEL
= _core_
.JOIN_BEVEL
395 JOIN_MITER
= _core_
.JOIN_MITER
396 JOIN_ROUND
= _core_
.JOIN_ROUND
397 CAP_ROUND
= _core_
.CAP_ROUND
398 CAP_PROJECTING
= _core_
.CAP_PROJECTING
399 CAP_BUTT
= _core_
.CAP_BUTT
402 INVERT
= _core_
.INVERT
403 OR_REVERSE
= _core_
.OR_REVERSE
404 AND_REVERSE
= _core_
.AND_REVERSE
407 AND_INVERT
= _core_
.AND_INVERT
411 SRC_INVERT
= _core_
.SRC_INVERT
412 OR_INVERT
= _core_
.OR_INVERT
416 WXK_BACK
= _core_
.WXK_BACK
417 WXK_TAB
= _core_
.WXK_TAB
418 WXK_RETURN
= _core_
.WXK_RETURN
419 WXK_ESCAPE
= _core_
.WXK_ESCAPE
420 WXK_SPACE
= _core_
.WXK_SPACE
421 WXK_DELETE
= _core_
.WXK_DELETE
422 WXK_START
= _core_
.WXK_START
423 WXK_LBUTTON
= _core_
.WXK_LBUTTON
424 WXK_RBUTTON
= _core_
.WXK_RBUTTON
425 WXK_CANCEL
= _core_
.WXK_CANCEL
426 WXK_MBUTTON
= _core_
.WXK_MBUTTON
427 WXK_CLEAR
= _core_
.WXK_CLEAR
428 WXK_SHIFT
= _core_
.WXK_SHIFT
429 WXK_ALT
= _core_
.WXK_ALT
430 WXK_CONTROL
= _core_
.WXK_CONTROL
431 WXK_MENU
= _core_
.WXK_MENU
432 WXK_PAUSE
= _core_
.WXK_PAUSE
433 WXK_CAPITAL
= _core_
.WXK_CAPITAL
434 WXK_PRIOR
= _core_
.WXK_PRIOR
435 WXK_NEXT
= _core_
.WXK_NEXT
436 WXK_END
= _core_
.WXK_END
437 WXK_HOME
= _core_
.WXK_HOME
438 WXK_LEFT
= _core_
.WXK_LEFT
439 WXK_UP
= _core_
.WXK_UP
440 WXK_RIGHT
= _core_
.WXK_RIGHT
441 WXK_DOWN
= _core_
.WXK_DOWN
442 WXK_SELECT
= _core_
.WXK_SELECT
443 WXK_PRINT
= _core_
.WXK_PRINT
444 WXK_EXECUTE
= _core_
.WXK_EXECUTE
445 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
446 WXK_INSERT
= _core_
.WXK_INSERT
447 WXK_HELP
= _core_
.WXK_HELP
448 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
449 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
450 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
451 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
452 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
453 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
454 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
455 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
456 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
457 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
458 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
459 WXK_ADD
= _core_
.WXK_ADD
460 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
461 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
462 WXK_DECIMAL
= _core_
.WXK_DECIMAL
463 WXK_DIVIDE
= _core_
.WXK_DIVIDE
464 WXK_F1
= _core_
.WXK_F1
465 WXK_F2
= _core_
.WXK_F2
466 WXK_F3
= _core_
.WXK_F3
467 WXK_F4
= _core_
.WXK_F4
468 WXK_F5
= _core_
.WXK_F5
469 WXK_F6
= _core_
.WXK_F6
470 WXK_F7
= _core_
.WXK_F7
471 WXK_F8
= _core_
.WXK_F8
472 WXK_F9
= _core_
.WXK_F9
473 WXK_F10
= _core_
.WXK_F10
474 WXK_F11
= _core_
.WXK_F11
475 WXK_F12
= _core_
.WXK_F12
476 WXK_F13
= _core_
.WXK_F13
477 WXK_F14
= _core_
.WXK_F14
478 WXK_F15
= _core_
.WXK_F15
479 WXK_F16
= _core_
.WXK_F16
480 WXK_F17
= _core_
.WXK_F17
481 WXK_F18
= _core_
.WXK_F18
482 WXK_F19
= _core_
.WXK_F19
483 WXK_F20
= _core_
.WXK_F20
484 WXK_F21
= _core_
.WXK_F21
485 WXK_F22
= _core_
.WXK_F22
486 WXK_F23
= _core_
.WXK_F23
487 WXK_F24
= _core_
.WXK_F24
488 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
489 WXK_SCROLL
= _core_
.WXK_SCROLL
490 WXK_PAGEUP
= _core_
.WXK_PAGEUP
491 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
492 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
493 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
494 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
495 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
496 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
497 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
498 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
499 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
500 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
501 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
502 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
503 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
504 WXK_NUMPAD_PRIOR
= _core_
.WXK_NUMPAD_PRIOR
505 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
506 WXK_NUMPAD_NEXT
= _core_
.WXK_NUMPAD_NEXT
507 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
508 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
509 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
510 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
511 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
512 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
513 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
514 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
515 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
516 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
517 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
518 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
519 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
520 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
521 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
522 WXK_COMMAND
= _core_
.WXK_COMMAND
523 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
524 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
525 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
526 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
527 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
528 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
529 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
530 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
531 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
532 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
533 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
534 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
535 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
536 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
537 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
538 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
539 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
540 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
541 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
542 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
543 PAPER_NONE
= _core_
.PAPER_NONE
544 PAPER_LETTER
= _core_
.PAPER_LETTER
545 PAPER_LEGAL
= _core_
.PAPER_LEGAL
546 PAPER_A4
= _core_
.PAPER_A4
547 PAPER_CSHEET
= _core_
.PAPER_CSHEET
548 PAPER_DSHEET
= _core_
.PAPER_DSHEET
549 PAPER_ESHEET
= _core_
.PAPER_ESHEET
550 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
551 PAPER_TABLOID
= _core_
.PAPER_TABLOID
552 PAPER_LEDGER
= _core_
.PAPER_LEDGER
553 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
554 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
555 PAPER_A3
= _core_
.PAPER_A3
556 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
557 PAPER_A5
= _core_
.PAPER_A5
558 PAPER_B4
= _core_
.PAPER_B4
559 PAPER_B5
= _core_
.PAPER_B5
560 PAPER_FOLIO
= _core_
.PAPER_FOLIO
561 PAPER_QUARTO
= _core_
.PAPER_QUARTO
562 PAPER_10X14
= _core_
.PAPER_10X14
563 PAPER_11X17
= _core_
.PAPER_11X17
564 PAPER_NOTE
= _core_
.PAPER_NOTE
565 PAPER_ENV_9
= _core_
.PAPER_ENV_9
566 PAPER_ENV_10
= _core_
.PAPER_ENV_10
567 PAPER_ENV_11
= _core_
.PAPER_ENV_11
568 PAPER_ENV_12
= _core_
.PAPER_ENV_12
569 PAPER_ENV_14
= _core_
.PAPER_ENV_14
570 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
571 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
572 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
573 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
574 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
575 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
576 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
577 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
578 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
579 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
580 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
581 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
582 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
583 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
584 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
585 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
586 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
587 PAPER_9X11
= _core_
.PAPER_9X11
588 PAPER_10X11
= _core_
.PAPER_10X11
589 PAPER_15X11
= _core_
.PAPER_15X11
590 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
591 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
592 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
593 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
594 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
595 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
596 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
597 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
598 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
599 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
600 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
601 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
602 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
603 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
604 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
605 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
606 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
607 PAPER_A2
= _core_
.PAPER_A2
608 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
609 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
610 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
611 PAPER_A6
= _core_
.PAPER_A6
612 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
613 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
614 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
615 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
616 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
617 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
618 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
619 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
620 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
621 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
622 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
623 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
624 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
625 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
626 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
627 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
628 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
629 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
630 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
631 PAPER_12X11
= _core_
.PAPER_12X11
632 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
633 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
634 PAPER_P16K
= _core_
.PAPER_P16K
635 PAPER_P32K
= _core_
.PAPER_P32K
636 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
637 PAPER_PENV_1
= _core_
.PAPER_PENV_1
638 PAPER_PENV_2
= _core_
.PAPER_PENV_2
639 PAPER_PENV_3
= _core_
.PAPER_PENV_3
640 PAPER_PENV_4
= _core_
.PAPER_PENV_4
641 PAPER_PENV_5
= _core_
.PAPER_PENV_5
642 PAPER_PENV_6
= _core_
.PAPER_PENV_6
643 PAPER_PENV_7
= _core_
.PAPER_PENV_7
644 PAPER_PENV_8
= _core_
.PAPER_PENV_8
645 PAPER_PENV_9
= _core_
.PAPER_PENV_9
646 PAPER_PENV_10
= _core_
.PAPER_PENV_10
647 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
648 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
649 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
650 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
651 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
652 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
653 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
654 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
655 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
656 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
657 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
658 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
659 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
660 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
661 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
662 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
663 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
664 ITEM_NORMAL
= _core_
.ITEM_NORMAL
665 ITEM_CHECK
= _core_
.ITEM_CHECK
666 ITEM_RADIO
= _core_
.ITEM_RADIO
667 ITEM_MAX
= _core_
.ITEM_MAX
668 HT_NOWHERE
= _core_
.HT_NOWHERE
669 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
670 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
671 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
672 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
673 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
674 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
675 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
676 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
677 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
678 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
679 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
680 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
681 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
682 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
683 HT_MAX
= _core_
.HT_MAX
684 MOD_NONE
= _core_
.MOD_NONE
685 MOD_ALT
= _core_
.MOD_ALT
686 MOD_CONTROL
= _core_
.MOD_CONTROL
687 MOD_ALTGR
= _core_
.MOD_ALTGR
688 MOD_SHIFT
= _core_
.MOD_SHIFT
689 MOD_META
= _core_
.MOD_META
690 MOD_WIN
= _core_
.MOD_WIN
691 MOD_CMD
= _core_
.MOD_CMD
692 MOD_ALL
= _core_
.MOD_ALL
693 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
694 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
695 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
696 #---------------------------------------------------------------------------
698 class Object(object):
700 The base class for most wx objects, although in wxPython not
701 much functionality is needed nor exposed.
703 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
704 def __init__(self
): raise AttributeError, "No constructor defined"
705 __repr__
= _swig_repr
706 def GetClassName(*args
, **kwargs
):
708 GetClassName(self) -> String
710 Returns the class name of the C++ class using wxRTTI.
712 return _core_
.Object_GetClassName(*args
, **kwargs
)
714 def Destroy(*args
, **kwargs
):
718 Deletes the C++ object this Python object is a proxy for.
720 val
= _core_
.Object_Destroy(*args
, **kwargs
)
724 Object_swigregister
= _core_
.Object_swigregister
725 Object_swigregister(Object
)
726 _wxPySetDictionary
= _core_
._wxPySetDictionary
728 EmptyString
= cvar
.EmptyString
730 #---------------------------------------------------------------------------
732 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
733 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
734 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
735 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
736 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
737 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
738 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
739 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
740 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
741 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
742 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
743 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
744 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
745 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
746 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
747 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
748 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
749 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
750 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
751 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
752 CURSOR_NONE
= _core_
.CURSOR_NONE
753 CURSOR_ARROW
= _core_
.CURSOR_ARROW
754 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
755 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
756 CURSOR_CHAR
= _core_
.CURSOR_CHAR
757 CURSOR_CROSS
= _core_
.CURSOR_CROSS
758 CURSOR_HAND
= _core_
.CURSOR_HAND
759 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
760 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
761 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
762 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
763 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
764 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
765 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
766 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
767 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
768 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
769 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
770 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
771 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
772 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
773 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
774 CURSOR_SIZING
= _core_
.CURSOR_SIZING
775 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
776 CURSOR_WAIT
= _core_
.CURSOR_WAIT
777 CURSOR_WATCH
= _core_
.CURSOR_WATCH
778 CURSOR_BLANK
= _core_
.CURSOR_BLANK
779 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
780 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
781 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
782 CURSOR_MAX
= _core_
.CURSOR_MAX
783 #---------------------------------------------------------------------------
787 wx.Size is a useful data structure used to represent the size of
788 something. It simply contains integer width and height
789 properties. In most places in wxPython where a wx.Size is
790 expected a (width, height) tuple can be used instead.
792 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
793 __repr__
= _swig_repr
794 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
795 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
796 x
= width
; y
= height
797 def __init__(self
, *args
, **kwargs
):
799 __init__(self, int w=0, int h=0) -> Size
801 Creates a size object.
803 _core_
.Size_swiginit(self
,_core_
.new_Size(*args
, **kwargs
))
804 __swig_destroy__
= _core_
.delete_Size
805 __del__
= lambda self
: None;
806 def __eq__(*args
, **kwargs
):
808 __eq__(self, PyObject other) -> bool
810 Test for equality of wx.Size objects.
812 return _core_
.Size___eq__(*args
, **kwargs
)
814 def __ne__(*args
, **kwargs
):
816 __ne__(self, PyObject other) -> bool
818 Test for inequality of wx.Size objects.
820 return _core_
.Size___ne__(*args
, **kwargs
)
822 def __add__(*args
, **kwargs
):
824 __add__(self, Size sz) -> Size
826 Add sz's proprties to this and return the result.
828 return _core_
.Size___add__(*args
, **kwargs
)
830 def __sub__(*args
, **kwargs
):
832 __sub__(self, Size sz) -> Size
834 Subtract sz's properties from this and return the result.
836 return _core_
.Size___sub__(*args
, **kwargs
)
838 def IncTo(*args
, **kwargs
):
842 Increments this object so that both of its dimensions are not less
843 than the corresponding dimensions of the size.
845 return _core_
.Size_IncTo(*args
, **kwargs
)
847 def DecTo(*args
, **kwargs
):
851 Decrements this object so that both of its dimensions are not greater
852 than the corresponding dimensions of the size.
854 return _core_
.Size_DecTo(*args
, **kwargs
)
856 def Set(*args
, **kwargs
):
858 Set(self, int w, int h)
860 Set both width and height.
862 return _core_
.Size_Set(*args
, **kwargs
)
864 def SetWidth(*args
, **kwargs
):
865 """SetWidth(self, int w)"""
866 return _core_
.Size_SetWidth(*args
, **kwargs
)
868 def SetHeight(*args
, **kwargs
):
869 """SetHeight(self, int h)"""
870 return _core_
.Size_SetHeight(*args
, **kwargs
)
872 def GetWidth(*args
, **kwargs
):
873 """GetWidth(self) -> int"""
874 return _core_
.Size_GetWidth(*args
, **kwargs
)
876 def GetHeight(*args
, **kwargs
):
877 """GetHeight(self) -> int"""
878 return _core_
.Size_GetHeight(*args
, **kwargs
)
880 def IsFullySpecified(*args
, **kwargs
):
882 IsFullySpecified(self) -> bool
884 Returns True if both components of the size are non-default values.
886 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
888 def SetDefaults(*args
, **kwargs
):
890 SetDefaults(self, Size size)
892 Combine this size with the other one replacing the default components
893 of this object (i.e. equal to -1) with those of the other.
895 return _core_
.Size_SetDefaults(*args
, **kwargs
)
897 def Get(*args
, **kwargs
):
899 Get() -> (width,height)
901 Returns the width and height properties as a tuple.
903 return _core_
.Size_Get(*args
, **kwargs
)
905 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
906 def __str__(self
): return str(self
.Get())
907 def __repr__(self
): return 'wx.Size'+str(self
.Get())
908 def __len__(self
): return len(self
.Get())
909 def __getitem__(self
, index
): return self
.Get()[index
]
910 def __setitem__(self
, index
, val
):
911 if index
== 0: self
.width
= val
912 elif index
== 1: self
.height
= val
913 else: raise IndexError
914 def __nonzero__(self
): return self
.Get() != (0,0)
915 __safe_for_unpickling__
= True
916 def __reduce__(self
): return (wx
.Size
, self
.Get())
918 Size_swigregister
= _core_
.Size_swigregister
919 Size_swigregister(Size
)
921 #---------------------------------------------------------------------------
923 class RealPoint(object):
925 A data structure for representing a point or position with floating
926 point x and y properties. In wxPython most places that expect a
927 wx.RealPoint can also accept a (x,y) tuple.
929 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
930 __repr__
= _swig_repr
931 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
932 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
933 def __init__(self
, *args
, **kwargs
):
935 __init__(self, double x=0.0, double y=0.0) -> RealPoint
937 Create a wx.RealPoint object
939 _core_
.RealPoint_swiginit(self
,_core_
.new_RealPoint(*args
, **kwargs
))
940 __swig_destroy__
= _core_
.delete_RealPoint
941 __del__
= lambda self
: None;
942 def __eq__(*args
, **kwargs
):
944 __eq__(self, PyObject other) -> bool
946 Test for equality of wx.RealPoint objects.
948 return _core_
.RealPoint___eq__(*args
, **kwargs
)
950 def __ne__(*args
, **kwargs
):
952 __ne__(self, PyObject other) -> bool
954 Test for inequality of wx.RealPoint objects.
956 return _core_
.RealPoint___ne__(*args
, **kwargs
)
958 def __add__(*args
, **kwargs
):
960 __add__(self, RealPoint pt) -> RealPoint
962 Add pt's proprties to this and return the result.
964 return _core_
.RealPoint___add__(*args
, **kwargs
)
966 def __sub__(*args
, **kwargs
):
968 __sub__(self, RealPoint pt) -> RealPoint
970 Subtract pt's proprties from this and return the result
972 return _core_
.RealPoint___sub__(*args
, **kwargs
)
974 def Set(*args
, **kwargs
):
976 Set(self, double x, double y)
978 Set both the x and y properties
980 return _core_
.RealPoint_Set(*args
, **kwargs
)
982 def Get(*args
, **kwargs
):
986 Return the x and y properties as a tuple.
988 return _core_
.RealPoint_Get(*args
, **kwargs
)
990 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
991 def __str__(self
): return str(self
.Get())
992 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
993 def __len__(self
): return len(self
.Get())
994 def __getitem__(self
, index
): return self
.Get()[index
]
995 def __setitem__(self
, index
, val
):
996 if index
== 0: self
.x
= val
997 elif index
== 1: self
.y
= val
998 else: raise IndexError
999 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1000 __safe_for_unpickling__
= True
1001 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
1003 RealPoint_swigregister
= _core_
.RealPoint_swigregister
1004 RealPoint_swigregister(RealPoint
)
1006 #---------------------------------------------------------------------------
1008 class Point(object):
1010 A data structure for representing a point or position with integer x
1011 and y properties. Most places in wxPython that expect a wx.Point can
1012 also accept a (x,y) tuple.
1014 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1015 __repr__
= _swig_repr
1016 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1017 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1018 def __init__(self
, *args
, **kwargs
):
1020 __init__(self, int x=0, int y=0) -> Point
1022 Create a wx.Point object
1024 _core_
.Point_swiginit(self
,_core_
.new_Point(*args
, **kwargs
))
1025 __swig_destroy__
= _core_
.delete_Point
1026 __del__
= lambda self
: None;
1027 def __eq__(*args
, **kwargs
):
1029 __eq__(self, PyObject other) -> bool
1031 Test for equality of wx.Point objects.
1033 return _core_
.Point___eq__(*args
, **kwargs
)
1035 def __ne__(*args
, **kwargs
):
1037 __ne__(self, PyObject other) -> bool
1039 Test for inequality of wx.Point objects.
1041 return _core_
.Point___ne__(*args
, **kwargs
)
1043 def __add__(*args
, **kwargs
):
1045 __add__(self, Point pt) -> Point
1047 Add pt's proprties to this and return the result.
1049 return _core_
.Point___add__(*args
, **kwargs
)
1051 def __sub__(*args
, **kwargs
):
1053 __sub__(self, Point pt) -> Point
1055 Subtract pt's proprties from this and return the result
1057 return _core_
.Point___sub__(*args
, **kwargs
)
1059 def __iadd__(*args
, **kwargs
):
1061 __iadd__(self, Point pt) -> Point
1063 Add pt to this object.
1065 return _core_
.Point___iadd__(*args
, **kwargs
)
1067 def __isub__(*args
, **kwargs
):
1069 __isub__(self, Point pt) -> Point
1071 Subtract pt from this object.
1073 return _core_
.Point___isub__(*args
, **kwargs
)
1075 def Set(*args
, **kwargs
):
1077 Set(self, long x, long y)
1079 Set both the x and y properties
1081 return _core_
.Point_Set(*args
, **kwargs
)
1083 def Get(*args
, **kwargs
):
1087 Return the x and y properties as a tuple.
1089 return _core_
.Point_Get(*args
, **kwargs
)
1091 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1092 def __str__(self
): return str(self
.Get())
1093 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1094 def __len__(self
): return len(self
.Get())
1095 def __getitem__(self
, index
): return self
.Get()[index
]
1096 def __setitem__(self
, index
, val
):
1097 if index
== 0: self
.x
= val
1098 elif index
== 1: self
.y
= val
1099 else: raise IndexError
1100 def __nonzero__(self
): return self
.Get() != (0,0)
1101 __safe_for_unpickling__
= True
1102 def __reduce__(self
): return (wx
.Point
, self
.Get())
1104 Point_swigregister
= _core_
.Point_swigregister
1105 Point_swigregister(Point
)
1107 #---------------------------------------------------------------------------
1111 A class for representing and manipulating rectangles. It has x, y,
1112 width and height properties. In wxPython most palces that expect a
1113 wx.Rect can also accept a (x,y,width,height) tuple.
1115 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1116 __repr__
= _swig_repr
1117 def __init__(self
, *args
, **kwargs
):
1119 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1121 Create a new Rect object.
1123 _core_
.Rect_swiginit(self
,_core_
.new_Rect(*args
, **kwargs
))
1124 __swig_destroy__
= _core_
.delete_Rect
1125 __del__
= lambda self
: None;
1126 def GetX(*args
, **kwargs
):
1127 """GetX(self) -> int"""
1128 return _core_
.Rect_GetX(*args
, **kwargs
)
1130 def SetX(*args
, **kwargs
):
1131 """SetX(self, int x)"""
1132 return _core_
.Rect_SetX(*args
, **kwargs
)
1134 def GetY(*args
, **kwargs
):
1135 """GetY(self) -> int"""
1136 return _core_
.Rect_GetY(*args
, **kwargs
)
1138 def SetY(*args
, **kwargs
):
1139 """SetY(self, int y)"""
1140 return _core_
.Rect_SetY(*args
, **kwargs
)
1142 def GetWidth(*args
, **kwargs
):
1143 """GetWidth(self) -> int"""
1144 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1146 def SetWidth(*args
, **kwargs
):
1147 """SetWidth(self, int w)"""
1148 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1150 def GetHeight(*args
, **kwargs
):
1151 """GetHeight(self) -> int"""
1152 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1154 def SetHeight(*args
, **kwargs
):
1155 """SetHeight(self, int h)"""
1156 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1158 def GetPosition(*args
, **kwargs
):
1159 """GetPosition(self) -> Point"""
1160 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1162 def SetPosition(*args
, **kwargs
):
1163 """SetPosition(self, Point p)"""
1164 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1166 def GetSize(*args
, **kwargs
):
1167 """GetSize(self) -> Size"""
1168 return _core_
.Rect_GetSize(*args
, **kwargs
)
1170 def SetSize(*args
, **kwargs
):
1171 """SetSize(self, Size s)"""
1172 return _core_
.Rect_SetSize(*args
, **kwargs
)
1174 def IsEmpty(*args
, **kwargs
):
1175 """IsEmpty(self) -> bool"""
1176 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1178 def GetTopLeft(*args
, **kwargs
):
1179 """GetTopLeft(self) -> Point"""
1180 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1182 def SetTopLeft(*args
, **kwargs
):
1183 """SetTopLeft(self, Point p)"""
1184 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1186 def GetBottomRight(*args
, **kwargs
):
1187 """GetBottomRight(self) -> Point"""
1188 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1190 def SetBottomRight(*args
, **kwargs
):
1191 """SetBottomRight(self, Point p)"""
1192 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1194 def GetLeft(*args
, **kwargs
):
1195 """GetLeft(self) -> int"""
1196 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1198 def GetTop(*args
, **kwargs
):
1199 """GetTop(self) -> int"""
1200 return _core_
.Rect_GetTop(*args
, **kwargs
)
1202 def GetBottom(*args
, **kwargs
):
1203 """GetBottom(self) -> int"""
1204 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1206 def GetRight(*args
, **kwargs
):
1207 """GetRight(self) -> int"""
1208 return _core_
.Rect_GetRight(*args
, **kwargs
)
1210 def SetLeft(*args
, **kwargs
):
1211 """SetLeft(self, int left)"""
1212 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1214 def SetRight(*args
, **kwargs
):
1215 """SetRight(self, int right)"""
1216 return _core_
.Rect_SetRight(*args
, **kwargs
)
1218 def SetTop(*args
, **kwargs
):
1219 """SetTop(self, int top)"""
1220 return _core_
.Rect_SetTop(*args
, **kwargs
)
1222 def SetBottom(*args
, **kwargs
):
1223 """SetBottom(self, int bottom)"""
1224 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1226 position
= property(GetPosition
, SetPosition
)
1227 size
= property(GetSize
, SetSize
)
1228 left
= property(GetLeft
, SetLeft
)
1229 right
= property(GetRight
, SetRight
)
1230 top
= property(GetTop
, SetTop
)
1231 bottom
= property(GetBottom
, SetBottom
)
1233 def Inflate(*args
, **kwargs
):
1235 Inflate(self, int dx, int dy) -> Rect
1237 Increases the size of the rectangle.
1239 The left border is moved farther left and the right border is moved
1240 farther right by ``dx``. The upper border is moved farther up and the
1241 bottom border is moved farther down by ``dy``. (Note the the width and
1242 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1243 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1244 opposite happens: the rectangle size decreases in the respective
1247 The change is made to the rectangle inplace, if instead you need a
1248 copy that is inflated, preserving the original then make the copy
1251 copy = wx.Rect(*original)
1256 return _core_
.Rect_Inflate(*args
, **kwargs
)
1258 def Deflate(*args
, **kwargs
):
1260 Deflate(self, int dx, int dy) -> Rect
1262 Decrease the rectangle size. This method is the opposite of `Inflate`
1263 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1264 `Inflate` for a full description.
1266 return _core_
.Rect_Deflate(*args
, **kwargs
)
1268 def OffsetXY(*args
, **kwargs
):
1270 OffsetXY(self, int dx, int dy)
1272 Moves the rectangle by the specified offset. If dx is positive, the
1273 rectangle is moved to the right, if dy is positive, it is moved to the
1274 bottom, otherwise it is moved to the left or top respectively.
1276 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1278 def Offset(*args
, **kwargs
):
1280 Offset(self, Point pt)
1282 Same as `OffsetXY` but uses dx,dy from Point
1284 return _core_
.Rect_Offset(*args
, **kwargs
)
1286 def Intersect(*args
, **kwargs
):
1288 Intersect(self, Rect rect) -> Rect
1290 Returns the intersectsion of this rectangle and rect.
1292 return _core_
.Rect_Intersect(*args
, **kwargs
)
1294 def Union(*args
, **kwargs
):
1296 Union(self, Rect rect) -> Rect
1298 Returns the union of this rectangle and rect.
1300 return _core_
.Rect_Union(*args
, **kwargs
)
1302 def __add__(*args
, **kwargs
):
1304 __add__(self, Rect rect) -> Rect
1306 Add the properties of rect to this rectangle and return the result.
1308 return _core_
.Rect___add__(*args
, **kwargs
)
1310 def __iadd__(*args
, **kwargs
):
1312 __iadd__(self, Rect rect) -> Rect
1314 Add the properties of rect to this rectangle, updating this rectangle.
1316 return _core_
.Rect___iadd__(*args
, **kwargs
)
1318 def __eq__(*args
, **kwargs
):
1320 __eq__(self, PyObject other) -> bool
1322 Test for equality of wx.Rect objects.
1324 return _core_
.Rect___eq__(*args
, **kwargs
)
1326 def __ne__(*args
, **kwargs
):
1328 __ne__(self, PyObject other) -> bool
1330 Test for inequality of wx.Rect objects.
1332 return _core_
.Rect___ne__(*args
, **kwargs
)
1334 def InsideXY(*args
, **kwargs
):
1336 InsideXY(self, int x, int y) -> bool
1338 Return True if the point is (not strcitly) inside the rect.
1340 return _core_
.Rect_InsideXY(*args
, **kwargs
)
1342 def Inside(*args
, **kwargs
):
1344 Inside(self, Point pt) -> bool
1346 Return True if the point is (not strcitly) inside the rect.
1348 return _core_
.Rect_Inside(*args
, **kwargs
)
1350 def Intersects(*args
, **kwargs
):
1352 Intersects(self, Rect rect) -> bool
1354 Returns True if the rectangles have a non empty intersection.
1356 return _core_
.Rect_Intersects(*args
, **kwargs
)
1358 def CenterIn(*args
, **kwargs
):
1360 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1362 Center this rectangle within the one passed to the method, which is
1363 usually, but not necessarily, the larger one.
1365 return _core_
.Rect_CenterIn(*args
, **kwargs
)
1368 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1369 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1370 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1371 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1372 def Set(*args
, **kwargs
):
1374 Set(self, int x=0, int y=0, int width=0, int height=0)
1376 Set all rectangle properties.
1378 return _core_
.Rect_Set(*args
, **kwargs
)
1380 def Get(*args
, **kwargs
):
1382 Get() -> (x,y,width,height)
1384 Return the rectangle properties as a tuple.
1386 return _core_
.Rect_Get(*args
, **kwargs
)
1388 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1389 def __str__(self
): return str(self
.Get())
1390 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1391 def __len__(self
): return len(self
.Get())
1392 def __getitem__(self
, index
): return self
.Get()[index
]
1393 def __setitem__(self
, index
, val
):
1394 if index
== 0: self
.x
= val
1395 elif index
== 1: self
.y
= val
1396 elif index
== 2: self
.width
= val
1397 elif index
== 3: self
.height
= val
1398 else: raise IndexError
1399 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1400 __safe_for_unpickling__
= True
1401 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1403 Rect_swigregister
= _core_
.Rect_swigregister
1404 Rect_swigregister(Rect
)
1406 def RectPP(*args
, **kwargs
):
1408 RectPP(Point topLeft, Point bottomRight) -> Rect
1410 Create a new Rect object from Points representing two corners.
1412 val
= _core_
.new_RectPP(*args
, **kwargs
)
1415 def RectPS(*args
, **kwargs
):
1417 RectPS(Point pos, Size size) -> Rect
1419 Create a new Rect from a position and size.
1421 val
= _core_
.new_RectPS(*args
, **kwargs
)
1424 def RectS(*args
, **kwargs
):
1426 RectS(Size size) -> Rect
1428 Create a new Rect from a size only.
1430 val
= _core_
.new_RectS(*args
, **kwargs
)
1434 def IntersectRect(*args
, **kwargs
):
1436 IntersectRect(Rect r1, Rect r2) -> Rect
1438 Calculate and return the intersection of r1 and r2.
1440 return _core_
.IntersectRect(*args
, **kwargs
)
1441 #---------------------------------------------------------------------------
1443 class Point2D(object):
1445 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1446 with floating point values.
1448 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1449 __repr__
= _swig_repr
1450 def __init__(self
, *args
, **kwargs
):
1452 __init__(self, double x=0.0, double y=0.0) -> Point2D
1454 Create a w.Point2D object.
1456 _core_
.Point2D_swiginit(self
,_core_
.new_Point2D(*args
, **kwargs
))
1457 def GetFloor(*args
, **kwargs
):
1463 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1465 def GetRounded(*args
, **kwargs
):
1467 GetRounded() -> (x,y)
1471 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1473 def GetVectorLength(*args
, **kwargs
):
1474 """GetVectorLength(self) -> double"""
1475 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1477 def GetVectorAngle(*args
, **kwargs
):
1478 """GetVectorAngle(self) -> double"""
1479 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1481 def SetVectorLength(*args
, **kwargs
):
1482 """SetVectorLength(self, double length)"""
1483 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1485 def SetVectorAngle(*args
, **kwargs
):
1486 """SetVectorAngle(self, double degrees)"""
1487 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1489 def SetPolarCoordinates(self
, angle
, length
):
1490 self
.SetVectorLength(length
)
1491 self
.SetVectorAngle(angle
)
1492 def Normalize(self
):
1493 self
.SetVectorLength(1.0)
1495 def GetDistance(*args
, **kwargs
):
1496 """GetDistance(self, Point2D pt) -> double"""
1497 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1499 def GetDistanceSquare(*args
, **kwargs
):
1500 """GetDistanceSquare(self, Point2D pt) -> double"""
1501 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1503 def GetDotProduct(*args
, **kwargs
):
1504 """GetDotProduct(self, Point2D vec) -> double"""
1505 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1507 def GetCrossProduct(*args
, **kwargs
):
1508 """GetCrossProduct(self, Point2D vec) -> double"""
1509 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1511 def __neg__(*args
, **kwargs
):
1513 __neg__(self) -> Point2D
1515 the reflection of this point
1517 return _core_
.Point2D___neg__(*args
, **kwargs
)
1519 def __iadd__(*args
, **kwargs
):
1520 """__iadd__(self, Point2D pt) -> Point2D"""
1521 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1523 def __isub__(*args
, **kwargs
):
1524 """__isub__(self, Point2D pt) -> Point2D"""
1525 return _core_
.Point2D___isub__(*args
, **kwargs
)
1527 def __imul__(*args
, **kwargs
):
1528 """__imul__(self, Point2D pt) -> Point2D"""
1529 return _core_
.Point2D___imul__(*args
, **kwargs
)
1531 def __idiv__(*args
, **kwargs
):
1532 """__idiv__(self, Point2D pt) -> Point2D"""
1533 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1535 def __eq__(*args
, **kwargs
):
1537 __eq__(self, PyObject other) -> bool
1539 Test for equality of wx.Point2D objects.
1541 return _core_
.Point2D___eq__(*args
, **kwargs
)
1543 def __ne__(*args
, **kwargs
):
1545 __ne__(self, PyObject other) -> bool
1547 Test for inequality of wx.Point2D objects.
1549 return _core_
.Point2D___ne__(*args
, **kwargs
)
1551 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1552 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1553 def Set(*args
, **kwargs
):
1554 """Set(self, double x=0, double y=0)"""
1555 return _core_
.Point2D_Set(*args
, **kwargs
)
1557 def Get(*args
, **kwargs
):
1561 Return x and y properties as a tuple.
1563 return _core_
.Point2D_Get(*args
, **kwargs
)
1565 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1566 def __str__(self
): return str(self
.Get())
1567 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1568 def __len__(self
): return len(self
.Get())
1569 def __getitem__(self
, index
): return self
.Get()[index
]
1570 def __setitem__(self
, index
, val
):
1571 if index
== 0: self
.x
= val
1572 elif index
== 1: self
.y
= val
1573 else: raise IndexError
1574 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1575 __safe_for_unpickling__
= True
1576 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1578 Point2D_swigregister
= _core_
.Point2D_swigregister
1579 Point2D_swigregister(Point2D
)
1581 def Point2DCopy(*args
, **kwargs
):
1583 Point2DCopy(Point2D pt) -> Point2D
1585 Create a w.Point2D object.
1587 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1590 def Point2DFromPoint(*args
, **kwargs
):
1592 Point2DFromPoint(Point pt) -> Point2D
1594 Create a w.Point2D object.
1596 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1599 #---------------------------------------------------------------------------
1601 FromStart
= _core_
.FromStart
1602 FromCurrent
= _core_
.FromCurrent
1603 FromEnd
= _core_
.FromEnd
1604 class InputStream(object):
1605 """Proxy of C++ InputStream class"""
1606 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1607 __repr__
= _swig_repr
1608 def __init__(self
, *args
, **kwargs
):
1609 """__init__(self, PyObject p) -> InputStream"""
1610 _core_
.InputStream_swiginit(self
,_core_
.new_InputStream(*args
, **kwargs
))
1611 __swig_destroy__
= _core_
.delete_InputStream
1612 __del__
= lambda self
: None;
1613 def close(*args
, **kwargs
):
1615 return _core_
.InputStream_close(*args
, **kwargs
)
1617 def flush(*args
, **kwargs
):
1619 return _core_
.InputStream_flush(*args
, **kwargs
)
1621 def eof(*args
, **kwargs
):
1622 """eof(self) -> bool"""
1623 return _core_
.InputStream_eof(*args
, **kwargs
)
1625 def read(*args
, **kwargs
):
1626 """read(self, int size=-1) -> PyObject"""
1627 return _core_
.InputStream_read(*args
, **kwargs
)
1629 def readline(*args
, **kwargs
):
1630 """readline(self, int size=-1) -> PyObject"""
1631 return _core_
.InputStream_readline(*args
, **kwargs
)
1633 def readlines(*args
, **kwargs
):
1634 """readlines(self, int sizehint=-1) -> PyObject"""
1635 return _core_
.InputStream_readlines(*args
, **kwargs
)
1637 def seek(*args
, **kwargs
):
1638 """seek(self, int offset, int whence=0)"""
1639 return _core_
.InputStream_seek(*args
, **kwargs
)
1641 def tell(*args
, **kwargs
):
1642 """tell(self) -> int"""
1643 return _core_
.InputStream_tell(*args
, **kwargs
)
1645 def Peek(*args
, **kwargs
):
1646 """Peek(self) -> char"""
1647 return _core_
.InputStream_Peek(*args
, **kwargs
)
1649 def GetC(*args
, **kwargs
):
1650 """GetC(self) -> char"""
1651 return _core_
.InputStream_GetC(*args
, **kwargs
)
1653 def LastRead(*args
, **kwargs
):
1654 """LastRead(self) -> size_t"""
1655 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1657 def CanRead(*args
, **kwargs
):
1658 """CanRead(self) -> bool"""
1659 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1661 def Eof(*args
, **kwargs
):
1662 """Eof(self) -> bool"""
1663 return _core_
.InputStream_Eof(*args
, **kwargs
)
1665 def Ungetch(*args
, **kwargs
):
1666 """Ungetch(self, char c) -> bool"""
1667 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1669 def SeekI(*args
, **kwargs
):
1670 """SeekI(self, long pos, int mode=FromStart) -> long"""
1671 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1673 def TellI(*args
, **kwargs
):
1674 """TellI(self) -> long"""
1675 return _core_
.InputStream_TellI(*args
, **kwargs
)
1677 InputStream_swigregister
= _core_
.InputStream_swigregister
1678 InputStream_swigregister(InputStream
)
1679 DefaultPosition
= cvar
.DefaultPosition
1680 DefaultSize
= cvar
.DefaultSize
1682 class OutputStream(object):
1683 """Proxy of C++ OutputStream class"""
1684 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1685 def __init__(self
): raise AttributeError, "No constructor defined"
1686 __repr__
= _swig_repr
1687 def write(*args
, **kwargs
):
1688 """write(self, PyObject obj)"""
1689 return _core_
.OutputStream_write(*args
, **kwargs
)
1691 def LastWrite(*args
, **kwargs
):
1692 """LastWrite(self) -> size_t"""
1693 return _core_
.OutputStream_LastWrite(*args
, **kwargs
)
1695 OutputStream_swigregister
= _core_
.OutputStream_swigregister
1696 OutputStream_swigregister(OutputStream
)
1698 #---------------------------------------------------------------------------
1700 class FSFile(Object
):
1701 """Proxy of C++ FSFile class"""
1702 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1703 __repr__
= _swig_repr
1704 def __init__(self
, *args
, **kwargs
):
1706 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1707 DateTime modif) -> FSFile
1709 _core_
.FSFile_swiginit(self
,_core_
.new_FSFile(*args
, **kwargs
))
1710 self
.thisown
= 0 # It will normally be deleted by the user of the wx.FileSystem
1712 __swig_destroy__
= _core_
.delete_FSFile
1713 __del__
= lambda self
: None;
1714 def GetStream(*args
, **kwargs
):
1715 """GetStream(self) -> InputStream"""
1716 return _core_
.FSFile_GetStream(*args
, **kwargs
)
1718 def GetMimeType(*args
, **kwargs
):
1719 """GetMimeType(self) -> String"""
1720 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
1722 def GetLocation(*args
, **kwargs
):
1723 """GetLocation(self) -> String"""
1724 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
1726 def GetAnchor(*args
, **kwargs
):
1727 """GetAnchor(self) -> String"""
1728 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
1730 def GetModificationTime(*args
, **kwargs
):
1731 """GetModificationTime(self) -> DateTime"""
1732 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
1734 FSFile_swigregister
= _core_
.FSFile_swigregister
1735 FSFile_swigregister(FSFile
)
1737 class CPPFileSystemHandler(object):
1738 """Proxy of C++ CPPFileSystemHandler class"""
1739 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1740 def __init__(self
): raise AttributeError, "No constructor defined"
1741 __repr__
= _swig_repr
1742 __swig_destroy__
= _core_
.delete_CPPFileSystemHandler
1743 __del__
= lambda self
: None;
1744 CPPFileSystemHandler_swigregister
= _core_
.CPPFileSystemHandler_swigregister
1745 CPPFileSystemHandler_swigregister(CPPFileSystemHandler
)
1747 class FileSystemHandler(CPPFileSystemHandler
):
1748 """Proxy of C++ FileSystemHandler class"""
1749 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1750 __repr__
= _swig_repr
1751 def __init__(self
, *args
, **kwargs
):
1752 """__init__(self) -> FileSystemHandler"""
1753 _core_
.FileSystemHandler_swiginit(self
,_core_
.new_FileSystemHandler(*args
, **kwargs
))
1754 self
._setCallbackInfo
(self
, FileSystemHandler
)
1756 def _setCallbackInfo(*args
, **kwargs
):
1757 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1758 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
1760 def CanOpen(*args
, **kwargs
):
1761 """CanOpen(self, String location) -> bool"""
1762 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
1764 def OpenFile(*args
, **kwargs
):
1765 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1766 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
1768 def FindFirst(*args
, **kwargs
):
1769 """FindFirst(self, String spec, int flags=0) -> String"""
1770 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
1772 def FindNext(*args
, **kwargs
):
1773 """FindNext(self) -> String"""
1774 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
1776 def GetProtocol(*args
, **kwargs
):
1777 """GetProtocol(self, String location) -> String"""
1778 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
1780 def GetLeftLocation(*args
, **kwargs
):
1781 """GetLeftLocation(self, String location) -> String"""
1782 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
1784 def GetAnchor(*args
, **kwargs
):
1785 """GetAnchor(self, String location) -> String"""
1786 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
1788 def GetRightLocation(*args
, **kwargs
):
1789 """GetRightLocation(self, String location) -> String"""
1790 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
1792 def GetMimeTypeFromExt(*args
, **kwargs
):
1793 """GetMimeTypeFromExt(self, String location) -> String"""
1794 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
1796 FileSystemHandler_swigregister
= _core_
.FileSystemHandler_swigregister
1797 FileSystemHandler_swigregister(FileSystemHandler
)
1799 class FileSystem(Object
):
1800 """Proxy of C++ FileSystem class"""
1801 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1802 __repr__
= _swig_repr
1803 def __init__(self
, *args
, **kwargs
):
1804 """__init__(self) -> FileSystem"""
1805 _core_
.FileSystem_swiginit(self
,_core_
.new_FileSystem(*args
, **kwargs
))
1806 __swig_destroy__
= _core_
.delete_FileSystem
1807 __del__
= lambda self
: None;
1808 def ChangePathTo(*args
, **kwargs
):
1809 """ChangePathTo(self, String location, bool is_dir=False)"""
1810 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
1812 def GetPath(*args
, **kwargs
):
1813 """GetPath(self) -> String"""
1814 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
1816 def OpenFile(*args
, **kwargs
):
1817 """OpenFile(self, String location) -> FSFile"""
1818 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
1820 def FindFirst(*args
, **kwargs
):
1821 """FindFirst(self, String spec, int flags=0) -> String"""
1822 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
1824 def FindNext(*args
, **kwargs
):
1825 """FindNext(self) -> String"""
1826 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
1828 def AddHandler(*args
, **kwargs
):
1829 """AddHandler(CPPFileSystemHandler handler)"""
1830 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1832 AddHandler
= staticmethod(AddHandler
)
1833 def CleanUpHandlers(*args
, **kwargs
):
1834 """CleanUpHandlers()"""
1835 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1837 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
1838 def FileNameToURL(*args
, **kwargs
):
1839 """FileNameToURL(String filename) -> String"""
1840 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1842 FileNameToURL
= staticmethod(FileNameToURL
)
1843 def URLToFileName(*args
, **kwargs
):
1844 """URLToFileName(String url) -> String"""
1845 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1847 URLToFileName
= staticmethod(URLToFileName
)
1848 FileSystem_swigregister
= _core_
.FileSystem_swigregister
1849 FileSystem_swigregister(FileSystem
)
1851 def FileSystem_AddHandler(*args
, **kwargs
):
1852 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1853 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1855 def FileSystem_CleanUpHandlers(*args
):
1856 """FileSystem_CleanUpHandlers()"""
1857 return _core_
.FileSystem_CleanUpHandlers(*args
)
1859 def FileSystem_FileNameToURL(*args
, **kwargs
):
1860 """FileSystem_FileNameToURL(String filename) -> String"""
1861 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1863 def FileSystem_URLToFileName(*args
, **kwargs
):
1864 """FileSystem_URLToFileName(String url) -> String"""
1865 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1867 class InternetFSHandler(CPPFileSystemHandler
):
1868 """Proxy of C++ InternetFSHandler class"""
1869 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1870 __repr__
= _swig_repr
1871 def __init__(self
, *args
, **kwargs
):
1872 """__init__(self) -> InternetFSHandler"""
1873 _core_
.InternetFSHandler_swiginit(self
,_core_
.new_InternetFSHandler(*args
, **kwargs
))
1874 def CanOpen(*args
, **kwargs
):
1875 """CanOpen(self, String location) -> bool"""
1876 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
1878 def OpenFile(*args
, **kwargs
):
1879 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1880 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
1882 InternetFSHandler_swigregister
= _core_
.InternetFSHandler_swigregister
1883 InternetFSHandler_swigregister(InternetFSHandler
)
1885 class ZipFSHandler(CPPFileSystemHandler
):
1886 """Proxy of C++ ZipFSHandler class"""
1887 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1888 __repr__
= _swig_repr
1889 def __init__(self
, *args
, **kwargs
):
1890 """__init__(self) -> ZipFSHandler"""
1891 _core_
.ZipFSHandler_swiginit(self
,_core_
.new_ZipFSHandler(*args
, **kwargs
))
1892 def CanOpen(*args
, **kwargs
):
1893 """CanOpen(self, String location) -> bool"""
1894 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
1896 def OpenFile(*args
, **kwargs
):
1897 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1898 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
1900 def FindFirst(*args
, **kwargs
):
1901 """FindFirst(self, String spec, int flags=0) -> String"""
1902 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
1904 def FindNext(*args
, **kwargs
):
1905 """FindNext(self) -> String"""
1906 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
1908 ZipFSHandler_swigregister
= _core_
.ZipFSHandler_swigregister
1909 ZipFSHandler_swigregister(ZipFSHandler
)
1912 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
1913 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1914 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
1916 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
1917 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1918 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
1920 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
1921 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1922 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
1923 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
1925 Add 'file' to the memory filesystem. The dataItem parameter can
1926 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1927 arbitrary data. If a bitmap or image is used then the imgType
1928 parameter should specify what kind of image file it should be
1929 written as, wx.BITMAP_TYPE_PNG, etc.
1931 if isinstance(dataItem
, wx
.Image
):
1932 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
1933 elif isinstance(dataItem
, wx
.Bitmap
):
1934 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
1935 elif type(dataItem
) == str:
1936 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
1938 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1940 class MemoryFSHandler(CPPFileSystemHandler
):
1941 """Proxy of C++ MemoryFSHandler class"""
1942 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1943 __repr__
= _swig_repr
1944 def __init__(self
, *args
, **kwargs
):
1945 """__init__(self) -> MemoryFSHandler"""
1946 _core_
.MemoryFSHandler_swiginit(self
,_core_
.new_MemoryFSHandler(*args
, **kwargs
))
1947 def RemoveFile(*args
, **kwargs
):
1948 """RemoveFile(String filename)"""
1949 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1951 RemoveFile
= staticmethod(RemoveFile
)
1952 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
1953 def CanOpen(*args
, **kwargs
):
1954 """CanOpen(self, String location) -> bool"""
1955 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
1957 def OpenFile(*args
, **kwargs
):
1958 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1959 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
1961 def FindFirst(*args
, **kwargs
):
1962 """FindFirst(self, String spec, int flags=0) -> String"""
1963 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
1965 def FindNext(*args
, **kwargs
):
1966 """FindNext(self) -> String"""
1967 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
1969 MemoryFSHandler_swigregister
= _core_
.MemoryFSHandler_swigregister
1970 MemoryFSHandler_swigregister(MemoryFSHandler
)
1972 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
1973 """MemoryFSHandler_RemoveFile(String filename)"""
1974 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1976 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
1977 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
1978 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
1979 #---------------------------------------------------------------------------
1981 class ImageHandler(Object
):
1983 This is the base class for implementing image file loading/saving, and
1984 image creation from data. It is used within `wx.Image` and is not
1985 normally seen by the application.
1987 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1988 def __init__(self
): raise AttributeError, "No constructor defined"
1989 __repr__
= _swig_repr
1990 def GetName(*args
, **kwargs
):
1991 """GetName(self) -> String"""
1992 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
1994 def GetExtension(*args
, **kwargs
):
1995 """GetExtension(self) -> String"""
1996 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
1998 def GetType(*args
, **kwargs
):
1999 """GetType(self) -> long"""
2000 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2002 def GetMimeType(*args
, **kwargs
):
2003 """GetMimeType(self) -> String"""
2004 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2006 def CanRead(*args
, **kwargs
):
2007 """CanRead(self, String name) -> bool"""
2008 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2010 def SetName(*args
, **kwargs
):
2011 """SetName(self, String name)"""
2012 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2014 def SetExtension(*args
, **kwargs
):
2015 """SetExtension(self, String extension)"""
2016 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2018 def SetType(*args
, **kwargs
):
2019 """SetType(self, long type)"""
2020 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2022 def SetMimeType(*args
, **kwargs
):
2023 """SetMimeType(self, String mimetype)"""
2024 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2026 ImageHandler_swigregister
= _core_
.ImageHandler_swigregister
2027 ImageHandler_swigregister(ImageHandler
)
2029 class PyImageHandler(ImageHandler
):
2031 This is the base class for implementing image file loading/saving, and
2032 image creation from data, all written in Python. To create a custom
2033 image handler derive a new class from wx.PyImageHandler and provide
2034 the following methods::
2036 def DoCanRead(self, stream) --> bool
2037 '''Check if this handler can read the image on the stream'''
2039 def LoadFile(self, image, stream, verbose, index) --> bool
2040 '''Load image data from the stream and load it into image.'''
2042 def SaveFile(self, image, stream, verbose) --> bool
2043 '''Save the iamge data in image to the stream using
2044 this handler's image file format.'''
2046 def GetImageCount(self, stream) --> int
2047 '''If this image format can hold more than one image,
2048 how many does the image on the stream have?'''
2050 To activate your handler create an instance of it and pass it to
2051 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2052 `SetExtension` from your constructor.
2055 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2056 __repr__
= _swig_repr
2057 def __init__(self
, *args
, **kwargs
):
2059 __init__(self) -> PyImageHandler
2061 This is the base class for implementing image file loading/saving, and
2062 image creation from data, all written in Python. To create a custom
2063 image handler derive a new class from wx.PyImageHandler and provide
2064 the following methods::
2066 def DoCanRead(self, stream) --> bool
2067 '''Check if this handler can read the image on the stream'''
2069 def LoadFile(self, image, stream, verbose, index) --> bool
2070 '''Load image data from the stream and load it into image.'''
2072 def SaveFile(self, image, stream, verbose) --> bool
2073 '''Save the iamge data in image to the stream using
2074 this handler's image file format.'''
2076 def GetImageCount(self, stream) --> int
2077 '''If this image format can hold more than one image,
2078 how many does the image on the stream have?'''
2080 To activate your handler create an instance of it and pass it to
2081 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2082 `SetExtension` from your constructor.
2085 _core_
.PyImageHandler_swiginit(self
,_core_
.new_PyImageHandler(*args
, **kwargs
))
2088 def _SetSelf(*args
, **kwargs
):
2089 """_SetSelf(self, PyObject self)"""
2090 return _core_
.PyImageHandler__SetSelf(*args
, **kwargs
)
2092 PyImageHandler_swigregister
= _core_
.PyImageHandler_swigregister
2093 PyImageHandler_swigregister(PyImageHandler
)
2095 class ImageHistogram(object):
2096 """Proxy of C++ ImageHistogram class"""
2097 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2098 __repr__
= _swig_repr
2099 def __init__(self
, *args
, **kwargs
):
2100 """__init__(self) -> ImageHistogram"""
2101 _core_
.ImageHistogram_swiginit(self
,_core_
.new_ImageHistogram(*args
, **kwargs
))
2102 def MakeKey(*args
, **kwargs
):
2104 MakeKey(byte r, byte g, byte b) -> unsigned long
2106 Get the key in the histogram for the given RGB values
2108 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2110 MakeKey
= staticmethod(MakeKey
)
2111 def FindFirstUnusedColour(*args
, **kwargs
):
2113 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2115 Find first colour that is not used in the image and has higher RGB
2116 values than startR, startG, startB. Returns a tuple consisting of a
2117 success flag and rgb values.
2119 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2121 def GetCount(*args
, **kwargs
):
2123 GetCount(self, unsigned long key) -> unsigned long
2125 Returns the pixel count for the given key. Use `MakeKey` to create a
2126 key value from a RGB tripple.
2128 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2130 def GetCountRGB(*args
, **kwargs
):
2132 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2134 Returns the pixel count for the given RGB values.
2136 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2138 def GetCountColour(*args
, **kwargs
):
2140 GetCountColour(self, Colour colour) -> unsigned long
2142 Returns the pixel count for the given `wx.Colour` value.
2144 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2146 ImageHistogram_swigregister
= _core_
.ImageHistogram_swigregister
2147 ImageHistogram_swigregister(ImageHistogram
)
2149 def ImageHistogram_MakeKey(*args
, **kwargs
):
2151 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2153 Get the key in the histogram for the given RGB values
2155 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2157 class Image_RGBValue(object):
2159 An object that contains values for red, green and blue which represent
2160 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2161 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2164 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2165 __repr__
= _swig_repr
2166 def __init__(self
, *args
, **kwargs
):
2168 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2172 _core_
.Image_RGBValue_swiginit(self
,_core_
.new_Image_RGBValue(*args
, **kwargs
))
2173 red
= property(_core_
.Image_RGBValue_red_get
, _core_
.Image_RGBValue_red_set
)
2174 green
= property(_core_
.Image_RGBValue_green_get
, _core_
.Image_RGBValue_green_set
)
2175 blue
= property(_core_
.Image_RGBValue_blue_get
, _core_
.Image_RGBValue_blue_set
)
2176 Image_RGBValue_swigregister
= _core_
.Image_RGBValue_swigregister
2177 Image_RGBValue_swigregister(Image_RGBValue
)
2179 class Image_HSVValue(object):
2181 An object that contains values for hue, saturation and value which
2182 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2183 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2186 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2187 __repr__
= _swig_repr
2188 def __init__(self
, *args
, **kwargs
):
2190 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2194 _core_
.Image_HSVValue_swiginit(self
,_core_
.new_Image_HSVValue(*args
, **kwargs
))
2195 hue
= property(_core_
.Image_HSVValue_hue_get
, _core_
.Image_HSVValue_hue_set
)
2196 saturation
= property(_core_
.Image_HSVValue_saturation_get
, _core_
.Image_HSVValue_saturation_set
)
2197 value
= property(_core_
.Image_HSVValue_value_get
, _core_
.Image_HSVValue_value_set
)
2198 Image_HSVValue_swigregister
= _core_
.Image_HSVValue_swigregister
2199 Image_HSVValue_swigregister(Image_HSVValue
)
2201 class Image(Object
):
2203 A platform-independent image class. An image can be created from
2204 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2205 variety of formats. Functions are available to set and get image
2206 bits, so it can be used for basic image manipulation.
2208 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2209 platform-specific `wx.Bitmap` object must be created from it using the
2210 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2211 device context, using `wx.DC.DrawBitmap`.
2213 One colour value of the image may be used as a mask colour which will
2214 lead to the automatic creation of a `wx.Mask` object associated to the
2217 wx.Image supports alpha channel data, that is in addition to a byte
2218 for the red, green and blue colour components for each pixel it also
2219 stores a byte representing the pixel opacity. An alpha value of 0
2220 corresponds to a transparent pixel (null opacity) while a value of 255
2221 means that the pixel is 100% opaque.
2223 Unlike RGB data, not all images have an alpha channel and before using
2224 `GetAlpha` you should check if this image contains an alpha channel
2225 with `HasAlpha`. Note that currently only images loaded from PNG files
2226 with transparency information will have an alpha channel.
2228 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2229 __repr__
= _swig_repr
2230 def __init__(self
, *args
, **kwargs
):
2232 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2234 Loads an image from a file.
2236 _core_
.Image_swiginit(self
,_core_
.new_Image(*args
, **kwargs
))
2237 __swig_destroy__
= _core_
.delete_Image
2238 __del__
= lambda self
: None;
2239 def Create(*args
, **kwargs
):
2241 Create(self, int width, int height, bool clear=True)
2243 Creates a fresh image. If clear is ``True``, the new image will be
2244 initialized to black. Otherwise, the image data will be uninitialized.
2246 return _core_
.Image_Create(*args
, **kwargs
)
2248 def Destroy(*args
, **kwargs
):
2252 Destroys the image data.
2254 val
= _core_
.Image_Destroy(*args
, **kwargs
)
2258 def Scale(*args
, **kwargs
):
2260 Scale(self, int width, int height) -> Image
2262 Returns a scaled version of the image. This is also useful for scaling
2263 bitmaps in general as the only other way to scale bitmaps is to blit a
2264 `wx.MemoryDC` into another `wx.MemoryDC`.
2266 return _core_
.Image_Scale(*args
, **kwargs
)
2268 def ShrinkBy(*args
, **kwargs
):
2270 ShrinkBy(self, int xFactor, int yFactor) -> Image
2272 Return a version of the image scaled smaller by the given factors.
2274 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2276 def Rescale(*args
, **kwargs
):
2278 Rescale(self, int width, int height) -> Image
2280 Changes the size of the image in-place by scaling it: after a call to
2281 this function, the image will have the given width and height.
2283 Returns the (modified) image itself.
2285 return _core_
.Image_Rescale(*args
, **kwargs
)
2287 def Resize(*args
, **kwargs
):
2289 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2291 Changes the size of the image in-place without scaling it, by adding
2292 either a border with the given colour or cropping as necessary. The
2293 image is pasted into a new image with the given size and background
2294 colour at the position pos relative to the upper left of the new
2295 image. If red = green = blue = -1 then use either the current mask
2296 colour if set or find, use, and set a suitable mask colour for any
2297 newly exposed areas.
2299 Returns the (modified) image itself.
2301 return _core_
.Image_Resize(*args
, **kwargs
)
2303 def SetRGB(*args
, **kwargs
):
2305 SetRGB(self, int x, int y, byte r, byte g, byte b)
2307 Sets the pixel at the given coordinate. This routine performs
2308 bounds-checks for the coordinate so it can be considered a safe way to
2309 manipulate the data, but in some cases this might be too slow so that
2310 the data will have to be set directly. In that case you will have to
2311 get access to the image data using the `GetData` method.
2313 return _core_
.Image_SetRGB(*args
, **kwargs
)
2315 def SetRGBRect(*args
, **kwargs
):
2317 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2319 Sets the colour of the pixels within the given rectangle. This routine
2320 performs bounds-checks for the rectangle so it can be considered a
2321 safe way to manipulate the data.
2323 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2325 def GetRed(*args
, **kwargs
):
2327 GetRed(self, int x, int y) -> byte
2329 Returns the red intensity at the given coordinate.
2331 return _core_
.Image_GetRed(*args
, **kwargs
)
2333 def GetGreen(*args
, **kwargs
):
2335 GetGreen(self, int x, int y) -> byte
2337 Returns the green intensity at the given coordinate.
2339 return _core_
.Image_GetGreen(*args
, **kwargs
)
2341 def GetBlue(*args
, **kwargs
):
2343 GetBlue(self, int x, int y) -> byte
2345 Returns the blue intensity at the given coordinate.
2347 return _core_
.Image_GetBlue(*args
, **kwargs
)
2349 def SetAlpha(*args
, **kwargs
):
2351 SetAlpha(self, int x, int y, byte alpha)
2353 Sets the alpha value for the given pixel. This function should only be
2354 called if the image has alpha channel data, use `HasAlpha` to check
2357 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2359 def GetAlpha(*args
, **kwargs
):
2361 GetAlpha(self, int x, int y) -> byte
2363 Returns the alpha value for the given pixel. This function may only be
2364 called for the images with alpha channel, use `HasAlpha` to check for
2367 The returned value is the *opacity* of the image, i.e. the value of 0
2368 corresponds to the fully transparent pixels while the value of 255 to
2369 the fully opaque pixels.
2371 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2373 def HasAlpha(*args
, **kwargs
):
2375 HasAlpha(self) -> bool
2377 Returns true if this image has alpha channel, false otherwise.
2379 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2381 def InitAlpha(*args
, **kwargs
):
2385 Initializes the image alpha channel data. It is an error to call it if
2386 the image already has alpha data. If it doesn't, alpha data will be by
2387 default initialized to all pixels being fully opaque. But if the image
2388 has a a mask colour, all mask pixels will be completely transparent.
2390 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2392 def IsTransparent(*args
, **kwargs
):
2394 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2396 Returns ``True`` if this pixel is masked or has an alpha value less
2397 than the spcified threshold.
2399 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2401 def FindFirstUnusedColour(*args
, **kwargs
):
2403 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2405 Find first colour that is not used in the image and has higher RGB
2406 values than startR, startG, startB. Returns a tuple consisting of a
2407 success flag and rgb values.
2409 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2411 def ConvertAlphaToMask(*args
, **kwargs
):
2413 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2415 If the image has alpha channel, this method converts it to mask. All
2416 pixels with alpha value less than ``threshold`` are replaced with the
2417 mask colour and the alpha channel is removed. The mask colour is
2418 chosen automatically using `FindFirstUnusedColour`.
2420 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2423 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2425 def ConvertColourToAlpha(*args
, **kwargs
):
2427 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2429 This method converts an image where the original alpha information is
2430 only available as a shades of a colour (actually shades of grey)
2431 typically when you draw anti-aliased text into a bitmap. The DC
2432 drawing routines draw grey values on the black background although
2433 they actually mean to draw white with differnt alpha values. This
2434 method reverses it, assuming a black (!) background and white text.
2435 The method will then fill up the whole image with the colour given.
2437 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2439 def SetMaskFromImage(*args
, **kwargs
):
2441 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2443 Sets the image's mask so that the pixels that have RGB value of
2444 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2445 by first finding an unused colour in the image, setting this colour as
2446 the mask colour and then using this colour to draw all pixels in the
2447 image who corresponding pixel in mask has given RGB value.
2449 Returns ``False`` if ``mask`` does not have same dimensions as the
2450 image or if there is no unused colour left. Returns ``True`` if the
2451 mask was successfully applied.
2453 Note that this method involves computing the histogram, which is
2454 computationally intensive operation.
2456 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2458 def CanRead(*args
, **kwargs
):
2460 CanRead(String filename) -> bool
2462 Returns True if the image handlers can read this file.
2464 return _core_
.Image_CanRead(*args
, **kwargs
)
2466 CanRead
= staticmethod(CanRead
)
2467 def GetImageCount(*args
, **kwargs
):
2469 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2471 If the image file contains more than one image and the image handler
2472 is capable of retrieving these individually, this function will return
2473 the number of available images.
2475 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2477 GetImageCount
= staticmethod(GetImageCount
)
2478 def LoadFile(*args
, **kwargs
):
2480 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2482 Loads an image from a file. If no handler type is provided, the
2483 library will try to autodetect the format.
2485 return _core_
.Image_LoadFile(*args
, **kwargs
)
2487 def LoadMimeFile(*args
, **kwargs
):
2489 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2491 Loads an image from a file, specifying the image type with a MIME type
2494 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2496 def SaveFile(*args
, **kwargs
):
2498 SaveFile(self, String name, int type) -> bool
2500 Saves an image in the named file.
2502 return _core_
.Image_SaveFile(*args
, **kwargs
)
2504 def SaveMimeFile(*args
, **kwargs
):
2506 SaveMimeFile(self, String name, String mimetype) -> bool
2508 Saves an image in the named file.
2510 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2512 def CanReadStream(*args
, **kwargs
):
2514 CanReadStream(InputStream stream) -> bool
2516 Returns True if the image handlers can read an image file from the
2517 data currently on the input stream, or a readable Python file-like
2520 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2522 CanReadStream
= staticmethod(CanReadStream
)
2523 def LoadStream(*args
, **kwargs
):
2525 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2527 Loads an image from an input stream or a readable Python file-like
2528 object. If no handler type is provided, the library will try to
2529 autodetect the format.
2531 return _core_
.Image_LoadStream(*args
, **kwargs
)
2533 def LoadMimeStream(*args
, **kwargs
):
2535 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2537 Loads an image from an input stream or a readable Python file-like
2538 object, using a MIME type string to specify the image file format.
2540 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2542 def Ok(*args
, **kwargs
):
2546 Returns true if image data is present.
2548 return _core_
.Image_Ok(*args
, **kwargs
)
2550 def GetWidth(*args
, **kwargs
):
2552 GetWidth(self) -> int
2554 Gets the width of the image in pixels.
2556 return _core_
.Image_GetWidth(*args
, **kwargs
)
2558 def GetHeight(*args
, **kwargs
):
2560 GetHeight(self) -> int
2562 Gets the height of the image in pixels.
2564 return _core_
.Image_GetHeight(*args
, **kwargs
)
2566 def GetSize(*args
, **kwargs
):
2568 GetSize(self) -> Size
2570 Returns the size of the image in pixels.
2572 return _core_
.Image_GetSize(*args
, **kwargs
)
2574 def GetSubImage(*args
, **kwargs
):
2576 GetSubImage(self, Rect rect) -> Image
2578 Returns a sub image of the current one as long as the rect belongs
2579 entirely to the image.
2581 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2583 def Size(*args
, **kwargs
):
2585 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2587 Returns a resized version of this image without scaling it by adding
2588 either a border with the given colour or cropping as necessary. The
2589 image is pasted into a new image with the given size and background
2590 colour at the position ``pos`` relative to the upper left of the new
2591 image. If red = green = blue = -1 then use either the current mask
2592 colour if set or find, use, and set a suitable mask colour for any
2593 newly exposed areas.
2595 return _core_
.Image_Size(*args
, **kwargs
)
2597 def Copy(*args
, **kwargs
):
2601 Returns an identical copy of the image.
2603 return _core_
.Image_Copy(*args
, **kwargs
)
2605 def Paste(*args
, **kwargs
):
2607 Paste(self, Image image, int x, int y)
2609 Pastes ``image`` into this instance and takes care of the mask colour
2610 and any out of bounds problems.
2612 return _core_
.Image_Paste(*args
, **kwargs
)
2614 def GetData(*args
, **kwargs
):
2616 GetData(self) -> PyObject
2618 Returns a string containing a copy of the RGB bytes of the image.
2620 return _core_
.Image_GetData(*args
, **kwargs
)
2622 def SetData(*args
, **kwargs
):
2624 SetData(self, buffer data)
2626 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2627 either a string or a buffer object holding the data and the length of
2628 the data must be width*height*3.
2630 return _core_
.Image_SetData(*args
, **kwargs
)
2632 def GetDataBuffer(*args
, **kwargs
):
2634 GetDataBuffer(self) -> PyObject
2636 Returns a writable Python buffer object that is pointing at the RGB
2637 image data buffer inside the wx.Image. You need to ensure that you do
2638 not use this buffer object after the image has been destroyed.
2640 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
2642 def SetDataBuffer(*args
, **kwargs
):
2644 SetDataBuffer(self, buffer data)
2646 Sets the internal image data pointer to point at a Python buffer
2647 object. This can save making an extra copy of the data but you must
2648 ensure that the buffer object lives longer than the wx.Image does.
2650 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
2652 def GetAlphaData(*args
, **kwargs
):
2654 GetAlphaData(self) -> PyObject
2656 Returns a string containing a copy of the alpha bytes of the image.
2658 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
2660 def SetAlphaData(*args
, **kwargs
):
2662 SetAlphaData(self, buffer alpha)
2664 Resets the Image's alpha data from a buffer of bytes. Accepts either
2665 a string or a buffer object holding the data and the length of the
2666 data must be width*height.
2668 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
2670 def GetAlphaBuffer(*args
, **kwargs
):
2671 """GetAlphaBuffer(self) -> PyObject"""
2672 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
2674 def SetAlphaBuffer(*args
, **kwargs
):
2675 """SetAlphaBuffer(self, buffer alpha)"""
2676 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
2678 def SetMaskColour(*args
, **kwargs
):
2680 SetMaskColour(self, byte r, byte g, byte b)
2682 Sets the mask colour for this image (and tells the image to use the
2685 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
2687 def GetOrFindMaskColour(*args
, **kwargs
):
2689 GetOrFindMaskColour() -> (r,g,b)
2691 Get the current mask colour or find a suitable colour.
2693 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
2695 def GetMaskRed(*args
, **kwargs
):
2697 GetMaskRed(self) -> byte
2699 Gets the red component of the mask colour.
2701 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
2703 def GetMaskGreen(*args
, **kwargs
):
2705 GetMaskGreen(self) -> byte
2707 Gets the green component of the mask colour.
2709 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
2711 def GetMaskBlue(*args
, **kwargs
):
2713 GetMaskBlue(self) -> byte
2715 Gets the blue component of the mask colour.
2717 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
2719 def SetMask(*args
, **kwargs
):
2721 SetMask(self, bool mask=True)
2723 Specifies whether there is a mask or not. The area of the mask is
2724 determined by the current mask colour.
2726 return _core_
.Image_SetMask(*args
, **kwargs
)
2728 def HasMask(*args
, **kwargs
):
2730 HasMask(self) -> bool
2732 Returns ``True`` if there is a mask active, ``False`` otherwise.
2734 return _core_
.Image_HasMask(*args
, **kwargs
)
2736 def Rotate(*args
, **kwargs
):
2738 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2739 Point offset_after_rotation=None) -> Image
2741 Rotates the image about the given point, by ``angle`` radians. Passing
2742 ``True`` to ``interpolating`` results in better image quality, but is
2743 slower. If the image has a mask, then the mask colour is used for the
2744 uncovered pixels in the rotated image background. Otherwise, black
2745 will be used as the fill colour.
2747 Returns the rotated image, leaving this image intact.
2749 return _core_
.Image_Rotate(*args
, **kwargs
)
2751 def Rotate90(*args
, **kwargs
):
2753 Rotate90(self, bool clockwise=True) -> Image
2755 Returns a copy of the image rotated 90 degrees in the direction
2756 indicated by ``clockwise``.
2758 return _core_
.Image_Rotate90(*args
, **kwargs
)
2760 def Mirror(*args
, **kwargs
):
2762 Mirror(self, bool horizontally=True) -> Image
2764 Returns a mirrored copy of the image. The parameter ``horizontally``
2765 indicates the orientation.
2767 return _core_
.Image_Mirror(*args
, **kwargs
)
2769 def Replace(*args
, **kwargs
):
2771 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2773 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2776 return _core_
.Image_Replace(*args
, **kwargs
)
2778 def ConvertToGreyscale(*args
, **kwargs
):
2780 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2782 Convert to greyscale image. Uses the luminance component (Y) of the
2783 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2784 defaults to ITU-T BT.601
2786 return _core_
.Image_ConvertToGreyscale(*args
, **kwargs
)
2788 def ConvertToMono(*args
, **kwargs
):
2790 ConvertToMono(self, byte r, byte g, byte b) -> Image
2792 Returns monochromatic version of the image. The returned image has
2793 white colour where the original has ``(r,g,b)`` colour and black
2794 colour everywhere else.
2796 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
2798 def SetOption(*args
, **kwargs
):
2800 SetOption(self, String name, String value)
2802 Sets an image handler defined option. For example, when saving as a
2803 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2804 number between 0 and 100 (0 is terrible, 100 is very good).
2806 return _core_
.Image_SetOption(*args
, **kwargs
)
2808 def SetOptionInt(*args
, **kwargs
):
2810 SetOptionInt(self, String name, int value)
2812 Sets an image option as an integer.
2814 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
2816 def GetOption(*args
, **kwargs
):
2818 GetOption(self, String name) -> String
2820 Gets the value of an image handler option.
2822 return _core_
.Image_GetOption(*args
, **kwargs
)
2824 def GetOptionInt(*args
, **kwargs
):
2826 GetOptionInt(self, String name) -> int
2828 Gets the value of an image handler option as an integer. If the given
2829 option is not present, the function returns 0.
2831 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
2833 def HasOption(*args
, **kwargs
):
2835 HasOption(self, String name) -> bool
2837 Returns true if the given option is present.
2839 return _core_
.Image_HasOption(*args
, **kwargs
)
2841 def CountColours(*args
, **kwargs
):
2842 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2843 return _core_
.Image_CountColours(*args
, **kwargs
)
2845 def ComputeHistogram(*args
, **kwargs
):
2846 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2847 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
2849 def AddHandler(*args
, **kwargs
):
2850 """AddHandler(ImageHandler handler)"""
2851 return _core_
.Image_AddHandler(*args
, **kwargs
)
2853 AddHandler
= staticmethod(AddHandler
)
2854 def InsertHandler(*args
, **kwargs
):
2855 """InsertHandler(ImageHandler handler)"""
2856 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2858 InsertHandler
= staticmethod(InsertHandler
)
2859 def RemoveHandler(*args
, **kwargs
):
2860 """RemoveHandler(String name) -> bool"""
2861 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2863 RemoveHandler
= staticmethod(RemoveHandler
)
2864 def GetHandlers(*args
, **kwargs
):
2865 """GetHandlers() -> PyObject"""
2866 return _core_
.Image_GetHandlers(*args
, **kwargs
)
2868 GetHandlers
= staticmethod(GetHandlers
)
2869 def GetImageExtWildcard(*args
, **kwargs
):
2871 GetImageExtWildcard() -> String
2873 Iterates all registered wxImageHandler objects, and returns a string
2874 containing file extension masks suitable for passing to file open/save
2877 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2879 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
2880 def ConvertToBitmap(*args
, **kwargs
):
2881 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2882 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
2884 def ConvertToMonoBitmap(*args
, **kwargs
):
2885 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2886 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
2888 def RotateHue(*args
, **kwargs
):
2890 RotateHue(self, double angle)
2892 Rotates the hue of each pixel of the image. Hue is a double in the
2893 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2895 return _core_
.Image_RotateHue(*args
, **kwargs
)
2897 def RGBtoHSV(*args
, **kwargs
):
2899 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2901 Converts a color in RGB color space to HSV color space.
2903 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
2905 RGBtoHSV
= staticmethod(RGBtoHSV
)
2906 def HSVtoRGB(*args
, **kwargs
):
2908 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2910 Converts a color in HSV color space to RGB color space.
2912 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
2914 HSVtoRGB
= staticmethod(HSVtoRGB
)
2915 def __nonzero__(self
): return self
.Ok()
2916 Image_swigregister
= _core_
.Image_swigregister
2917 Image_swigregister(Image
)
2919 def ImageFromMime(*args
, **kwargs
):
2921 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2923 Loads an image from a file, using a MIME type string (such as
2924 'image/jpeg') to specify image type.
2926 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
2929 def ImageFromStream(*args
, **kwargs
):
2931 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2933 Loads an image from an input stream, or any readable Python file-like
2936 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
2939 def ImageFromStreamMime(*args
, **kwargs
):
2941 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2943 Loads an image from an input stream, or any readable Python file-like
2944 object, specifying the image format with a MIME type string.
2946 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
2949 def EmptyImage(*args
, **kwargs
):
2951 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2953 Construct an empty image of a given size, optionally setting all
2956 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
2959 def ImageFromBitmap(*args
, **kwargs
):
2961 ImageFromBitmap(Bitmap bitmap) -> Image
2963 Construct an Image from a `wx.Bitmap`.
2965 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
2968 def ImageFromData(*args
, **kwargs
):
2970 ImageFromData(int width, int height, buffer data) -> Image
2972 Construct an Image from a buffer of RGB bytes. Accepts either a
2973 string or a buffer object holding the data and the length of the data
2974 must be width*height*3.
2976 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
2979 def ImageFromDataWithAlpha(*args
, **kwargs
):
2981 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2983 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2984 Accepts either a string or a buffer object holding the data and the
2985 length of the data must be width*height*3 bytes, and the length of the
2986 alpha data must be width*height bytes.
2988 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
2991 def Image_CanRead(*args
, **kwargs
):
2993 Image_CanRead(String filename) -> bool
2995 Returns True if the image handlers can read this file.
2997 return _core_
.Image_CanRead(*args
, **kwargs
)
2999 def Image_GetImageCount(*args
, **kwargs
):
3001 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3003 If the image file contains more than one image and the image handler
3004 is capable of retrieving these individually, this function will return
3005 the number of available images.
3007 return _core_
.Image_GetImageCount(*args
, **kwargs
)
3009 def Image_CanReadStream(*args
, **kwargs
):
3011 Image_CanReadStream(InputStream stream) -> bool
3013 Returns True if the image handlers can read an image file from the
3014 data currently on the input stream, or a readable Python file-like
3017 return _core_
.Image_CanReadStream(*args
, **kwargs
)
3019 def Image_AddHandler(*args
, **kwargs
):
3020 """Image_AddHandler(ImageHandler handler)"""
3021 return _core_
.Image_AddHandler(*args
, **kwargs
)
3023 def Image_InsertHandler(*args
, **kwargs
):
3024 """Image_InsertHandler(ImageHandler handler)"""
3025 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3027 def Image_RemoveHandler(*args
, **kwargs
):
3028 """Image_RemoveHandler(String name) -> bool"""
3029 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3031 def Image_GetHandlers(*args
):
3032 """Image_GetHandlers() -> PyObject"""
3033 return _core_
.Image_GetHandlers(*args
)
3035 def Image_GetImageExtWildcard(*args
):
3037 Image_GetImageExtWildcard() -> String
3039 Iterates all registered wxImageHandler objects, and returns a string
3040 containing file extension masks suitable for passing to file open/save
3043 return _core_
.Image_GetImageExtWildcard(*args
)
3045 def Image_RGBtoHSV(*args
, **kwargs
):
3047 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3049 Converts a color in RGB color space to HSV color space.
3051 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3053 def Image_HSVtoRGB(*args
, **kwargs
):
3055 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3057 Converts a color in HSV color space to RGB color space.
3059 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3061 def InitAllImageHandlers():
3063 The former functionality of InitAllImageHanders is now done internal to
3064 the _core_ extension module and so this function has become a simple NOP.
3068 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3069 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3070 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3071 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3072 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3073 BMP_24BPP
= _core_
.BMP_24BPP
3074 BMP_8BPP
= _core_
.BMP_8BPP
3075 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3076 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3077 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3078 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3079 BMP_4BPP
= _core_
.BMP_4BPP
3080 BMP_1BPP
= _core_
.BMP_1BPP
3081 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3082 class BMPHandler(ImageHandler
):
3083 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3084 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3085 __repr__
= _swig_repr
3086 def __init__(self
, *args
, **kwargs
):
3088 __init__(self) -> BMPHandler
3090 A `wx.ImageHandler` for \*.bmp bitmap files.
3092 _core_
.BMPHandler_swiginit(self
,_core_
.new_BMPHandler(*args
, **kwargs
))
3093 BMPHandler_swigregister
= _core_
.BMPHandler_swigregister
3094 BMPHandler_swigregister(BMPHandler
)
3095 NullImage
= cvar
.NullImage
3096 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3097 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3098 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3099 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3100 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3101 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3102 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3103 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3104 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3105 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3106 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3107 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3108 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3109 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3110 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3112 class ICOHandler(BMPHandler
):
3113 """A `wx.ImageHandler` for \*.ico icon files."""
3114 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3115 __repr__
= _swig_repr
3116 def __init__(self
, *args
, **kwargs
):
3118 __init__(self) -> ICOHandler
3120 A `wx.ImageHandler` for \*.ico icon files.
3122 _core_
.ICOHandler_swiginit(self
,_core_
.new_ICOHandler(*args
, **kwargs
))
3123 ICOHandler_swigregister
= _core_
.ICOHandler_swigregister
3124 ICOHandler_swigregister(ICOHandler
)
3126 class CURHandler(ICOHandler
):
3127 """A `wx.ImageHandler` for \*.cur cursor files."""
3128 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3129 __repr__
= _swig_repr
3130 def __init__(self
, *args
, **kwargs
):
3132 __init__(self) -> CURHandler
3134 A `wx.ImageHandler` for \*.cur cursor files.
3136 _core_
.CURHandler_swiginit(self
,_core_
.new_CURHandler(*args
, **kwargs
))
3137 CURHandler_swigregister
= _core_
.CURHandler_swigregister
3138 CURHandler_swigregister(CURHandler
)
3140 class ANIHandler(CURHandler
):
3141 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3142 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3143 __repr__
= _swig_repr
3144 def __init__(self
, *args
, **kwargs
):
3146 __init__(self) -> ANIHandler
3148 A `wx.ImageHandler` for \*.ani animated cursor files.
3150 _core_
.ANIHandler_swiginit(self
,_core_
.new_ANIHandler(*args
, **kwargs
))
3151 ANIHandler_swigregister
= _core_
.ANIHandler_swigregister
3152 ANIHandler_swigregister(ANIHandler
)
3154 class PNGHandler(ImageHandler
):
3155 """A `wx.ImageHandler` for PNG image files."""
3156 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3157 __repr__
= _swig_repr
3158 def __init__(self
, *args
, **kwargs
):
3160 __init__(self) -> PNGHandler
3162 A `wx.ImageHandler` for PNG image files.
3164 _core_
.PNGHandler_swiginit(self
,_core_
.new_PNGHandler(*args
, **kwargs
))
3165 PNGHandler_swigregister
= _core_
.PNGHandler_swigregister
3166 PNGHandler_swigregister(PNGHandler
)
3168 class GIFHandler(ImageHandler
):
3169 """A `wx.ImageHandler` for GIF image files."""
3170 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3171 __repr__
= _swig_repr
3172 def __init__(self
, *args
, **kwargs
):
3174 __init__(self) -> GIFHandler
3176 A `wx.ImageHandler` for GIF image files.
3178 _core_
.GIFHandler_swiginit(self
,_core_
.new_GIFHandler(*args
, **kwargs
))
3179 GIFHandler_swigregister
= _core_
.GIFHandler_swigregister
3180 GIFHandler_swigregister(GIFHandler
)
3182 class PCXHandler(ImageHandler
):
3183 """A `wx.ImageHandler` for PCX imager files."""
3184 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3185 __repr__
= _swig_repr
3186 def __init__(self
, *args
, **kwargs
):
3188 __init__(self) -> PCXHandler
3190 A `wx.ImageHandler` for PCX imager files.
3192 _core_
.PCXHandler_swiginit(self
,_core_
.new_PCXHandler(*args
, **kwargs
))
3193 PCXHandler_swigregister
= _core_
.PCXHandler_swigregister
3194 PCXHandler_swigregister(PCXHandler
)
3196 class JPEGHandler(ImageHandler
):
3197 """A `wx.ImageHandler` for JPEG/JPG image files."""
3198 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3199 __repr__
= _swig_repr
3200 def __init__(self
, *args
, **kwargs
):
3202 __init__(self) -> JPEGHandler
3204 A `wx.ImageHandler` for JPEG/JPG image files.
3206 _core_
.JPEGHandler_swiginit(self
,_core_
.new_JPEGHandler(*args
, **kwargs
))
3207 JPEGHandler_swigregister
= _core_
.JPEGHandler_swigregister
3208 JPEGHandler_swigregister(JPEGHandler
)
3210 class PNMHandler(ImageHandler
):
3211 """A `wx.ImageHandler` for PNM image files."""
3212 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3213 __repr__
= _swig_repr
3214 def __init__(self
, *args
, **kwargs
):
3216 __init__(self) -> PNMHandler
3218 A `wx.ImageHandler` for PNM image files.
3220 _core_
.PNMHandler_swiginit(self
,_core_
.new_PNMHandler(*args
, **kwargs
))
3221 PNMHandler_swigregister
= _core_
.PNMHandler_swigregister
3222 PNMHandler_swigregister(PNMHandler
)
3224 class XPMHandler(ImageHandler
):
3225 """A `wx.ImageHandler` for XPM image."""
3226 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3227 __repr__
= _swig_repr
3228 def __init__(self
, *args
, **kwargs
):
3230 __init__(self) -> XPMHandler
3232 A `wx.ImageHandler` for XPM image.
3234 _core_
.XPMHandler_swiginit(self
,_core_
.new_XPMHandler(*args
, **kwargs
))
3235 XPMHandler_swigregister
= _core_
.XPMHandler_swigregister
3236 XPMHandler_swigregister(XPMHandler
)
3238 class TIFFHandler(ImageHandler
):
3239 """A `wx.ImageHandler` for TIFF image files."""
3240 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3241 __repr__
= _swig_repr
3242 def __init__(self
, *args
, **kwargs
):
3244 __init__(self) -> TIFFHandler
3246 A `wx.ImageHandler` for TIFF image files.
3248 _core_
.TIFFHandler_swiginit(self
,_core_
.new_TIFFHandler(*args
, **kwargs
))
3249 TIFFHandler_swigregister
= _core_
.TIFFHandler_swigregister
3250 TIFFHandler_swigregister(TIFFHandler
)
3252 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3253 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3254 class Quantize(object):
3255 """Performs quantization, or colour reduction, on a wxImage."""
3256 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3257 def __init__(self
): raise AttributeError, "No constructor defined"
3258 __repr__
= _swig_repr
3259 def Quantize(*args
, **kwargs
):
3261 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3263 Reduce the colours in the source image and put the result into the
3264 destination image, setting the palette in the destination if
3265 needed. Both images may be the same, to overwrite the source image.
3267 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3269 Quantize
= staticmethod(Quantize
)
3270 Quantize_swigregister
= _core_
.Quantize_swigregister
3271 Quantize_swigregister(Quantize
)
3273 def Quantize_Quantize(*args
, **kwargs
):
3275 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3277 Reduce the colours in the source image and put the result into the
3278 destination image, setting the palette in the destination if
3279 needed. Both images may be the same, to overwrite the source image.
3281 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3283 #---------------------------------------------------------------------------
3285 class EvtHandler(Object
):
3286 """Proxy of C++ EvtHandler class"""
3287 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3288 __repr__
= _swig_repr
3289 def __init__(self
, *args
, **kwargs
):
3290 """__init__(self) -> EvtHandler"""
3291 _core_
.EvtHandler_swiginit(self
,_core_
.new_EvtHandler(*args
, **kwargs
))
3292 def GetNextHandler(*args
, **kwargs
):
3293 """GetNextHandler(self) -> EvtHandler"""
3294 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3296 def GetPreviousHandler(*args
, **kwargs
):
3297 """GetPreviousHandler(self) -> EvtHandler"""
3298 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3300 def SetNextHandler(*args
, **kwargs
):
3301 """SetNextHandler(self, EvtHandler handler)"""
3302 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3304 def SetPreviousHandler(*args
, **kwargs
):
3305 """SetPreviousHandler(self, EvtHandler handler)"""
3306 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3308 def GetEvtHandlerEnabled(*args
, **kwargs
):
3309 """GetEvtHandlerEnabled(self) -> bool"""
3310 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3312 def SetEvtHandlerEnabled(*args
, **kwargs
):
3313 """SetEvtHandlerEnabled(self, bool enabled)"""
3314 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3316 def ProcessEvent(*args
, **kwargs
):
3317 """ProcessEvent(self, Event event) -> bool"""
3318 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3320 def AddPendingEvent(*args
, **kwargs
):
3321 """AddPendingEvent(self, Event event)"""
3322 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3324 def ProcessPendingEvents(*args
, **kwargs
):
3325 """ProcessPendingEvents(self)"""
3326 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3328 def Connect(*args
, **kwargs
):
3329 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3330 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3332 def Disconnect(*args
, **kwargs
):
3333 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
3334 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3336 def _setOORInfo(*args
, **kwargs
):
3337 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3338 val
= _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3342 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3344 Bind an event to an event handler.
3346 :param event: One of the EVT_* objects that specifies the
3347 type of event to bind,
3349 :param handler: A callable object to be invoked when the
3350 event is delivered to self. Pass None to
3351 disconnect an event handler.
3353 :param source: Sometimes the event originates from a
3354 different window than self, but you still
3355 want to catch it in self. (For example, a
3356 button event delivered to a frame.) By
3357 passing the source of the event, the event
3358 handling system is able to differentiate
3359 between the same event type from different
3362 :param id: Used to spcify the event source by ID instead
3365 :param id2: Used when it is desirable to bind a handler
3366 to a range of IDs, such as with EVT_MENU_RANGE.
3368 if source
is not None:
3370 event
.Bind(self
, id, id2
, handler
)
3372 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3374 Disconencts the event handler binding for event from self.
3375 Returns True if successful.
3377 if source
is not None:
3379 return event
.Unbind(self
, id, id2
)
3381 EvtHandler_swigregister
= _core_
.EvtHandler_swigregister
3382 EvtHandler_swigregister(EvtHandler
)
3384 #---------------------------------------------------------------------------
3386 class PyEventBinder(object):
3388 Instances of this class are used to bind specific events to event
3391 def __init__(self
, evtType
, expectedIDs
=0):
3392 if expectedIDs
not in [0, 1, 2]:
3393 raise ValueError, "Invalid number of expectedIDs"
3394 self
.expectedIDs
= expectedIDs
3396 if type(evtType
) == list or type(evtType
) == tuple:
3397 self
.evtType
= evtType
3399 self
.evtType
= [evtType
]
3402 def Bind(self
, target
, id1
, id2
, function
):
3403 """Bind this set of event types to target."""
3404 for et
in self
.evtType
:
3405 target
.Connect(id1
, id2
, et
, function
)
3408 def Unbind(self
, target
, id1
, id2
):
3409 """Remove an event binding."""
3411 for et
in self
.evtType
:
3412 success
+= target
.Disconnect(id1
, id2
, et
)
3416 def __call__(self
, *args
):
3418 For backwards compatibility with the old EVT_* functions.
3419 Should be called with either (window, func), (window, ID,
3420 func) or (window, ID1, ID2, func) parameters depending on the
3423 assert len(args
) == 2 + self
.expectedIDs
3427 if self
.expectedIDs
== 0:
3429 elif self
.expectedIDs
== 1:
3432 elif self
.expectedIDs
== 2:
3437 raise ValueError, "Unexpected number of IDs"
3439 self
.Bind(target
, id1
, id2
, func
)
3442 # These two are square pegs that don't fit the PyEventBinder hole...
3443 def EVT_COMMAND(win
, id, cmd
, func
):
3444 win
.Connect(id, -1, cmd
, func
)
3445 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3446 win
.Connect(id1
, id2
, cmd
, func
)
3449 #---------------------------------------------------------------------------
3451 #---------------------------------------------------------------------------
3453 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3454 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3456 def NewEventType(*args
):
3457 """NewEventType() -> wxEventType"""
3458 return _core_
.NewEventType(*args
)
3459 wxEVT_NULL
= _core_
.wxEVT_NULL
3460 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3461 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3462 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3463 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3464 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3465 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3466 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3467 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3468 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3469 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3470 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3471 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3472 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3473 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3474 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3475 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3476 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3477 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3478 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3479 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3480 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3481 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3482 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3483 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3484 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3485 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3486 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3487 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3488 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3489 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3490 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3491 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3492 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3493 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3494 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3495 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3496 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3497 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3498 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3499 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3500 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3501 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3502 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3503 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3504 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3505 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3506 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3507 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3508 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3509 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3510 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3511 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3512 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3513 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3514 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3515 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3516 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3517 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3518 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3519 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3520 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3521 wxEVT_SCROLL_CHANGED
= _core_
.wxEVT_SCROLL_CHANGED
3522 wxEVT_SCROLL_ENDSCROLL
= wxEVT_SCROLL_CHANGED
3523 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3524 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3525 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3526 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3527 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3528 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3529 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3530 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3531 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3532 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3533 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3534 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3535 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3536 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3537 wxEVT_POWER
= _core_
.wxEVT_POWER
3538 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3539 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3540 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3541 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3542 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3543 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3544 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3545 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3546 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3547 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3548 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3549 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3550 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3551 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3552 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3553 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3554 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3555 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3556 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3557 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3558 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
3559 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
3560 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
3561 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
3562 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
3563 wxEVT_IDLE
= _core_
.wxEVT_IDLE
3564 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
3565 wxEVT_SIZING
= _core_
.wxEVT_SIZING
3566 wxEVT_MOVING
= _core_
.wxEVT_MOVING
3567 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
3568 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
3569 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
3570 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
3571 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
3572 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
3573 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
3574 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
3576 # Create some event binders
3577 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
3578 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
3579 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
3580 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
3581 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
3582 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3583 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3584 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
3585 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
3586 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
3587 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
3588 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
3589 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
3590 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
3591 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
3592 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
3593 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
3594 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
3595 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
3596 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
3597 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
3598 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
3599 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
3600 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
3601 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
3602 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3603 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3604 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
3605 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
3606 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
3607 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
3608 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
3609 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
3610 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
3611 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
3612 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
3613 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
3614 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
3615 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
3616 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
3617 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
3619 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
3620 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
3621 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
3622 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
3623 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
3624 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
3625 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
3626 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
3627 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
3628 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
3629 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
3630 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
3631 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
3633 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
3641 wxEVT_MIDDLE_DCLICK
,
3649 # Scrolling from wxWindow (sent to wxScrolledWindow)
3650 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
3651 wxEVT_SCROLLWIN_BOTTOM
,
3652 wxEVT_SCROLLWIN_LINEUP
,
3653 wxEVT_SCROLLWIN_LINEDOWN
,
3654 wxEVT_SCROLLWIN_PAGEUP
,
3655 wxEVT_SCROLLWIN_PAGEDOWN
,
3656 wxEVT_SCROLLWIN_THUMBTRACK
,
3657 wxEVT_SCROLLWIN_THUMBRELEASE
,
3660 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
3661 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
3662 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
3663 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
3664 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
3665 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
3666 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
3667 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
3669 # Scrolling from wx.Slider and wx.ScrollBar
3670 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3671 wxEVT_SCROLL_BOTTOM
,
3672 wxEVT_SCROLL_LINEUP
,
3673 wxEVT_SCROLL_LINEDOWN
,
3674 wxEVT_SCROLL_PAGEUP
,
3675 wxEVT_SCROLL_PAGEDOWN
,
3676 wxEVT_SCROLL_THUMBTRACK
,
3677 wxEVT_SCROLL_THUMBRELEASE
,
3678 wxEVT_SCROLL_CHANGED
,
3681 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
3682 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
3683 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
3684 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
3685 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
3686 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
3687 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
3688 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
3689 EVT_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
)
3690 EVT_SCROLL_ENDSCROLL
= EVT_SCROLL_CHANGED
3692 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3693 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3694 wxEVT_SCROLL_BOTTOM
,
3695 wxEVT_SCROLL_LINEUP
,
3696 wxEVT_SCROLL_LINEDOWN
,
3697 wxEVT_SCROLL_PAGEUP
,
3698 wxEVT_SCROLL_PAGEDOWN
,
3699 wxEVT_SCROLL_THUMBTRACK
,
3700 wxEVT_SCROLL_THUMBRELEASE
,
3701 wxEVT_SCROLL_CHANGED
,
3704 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
3705 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
3706 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
3707 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
3708 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
3709 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
3710 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
3711 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
3712 EVT_COMMAND_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
, 1)
3713 EVT_COMMAND_SCROLL_ENDSCROLL
= EVT_COMMAND_SCROLL_CHANGED
3715 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
3716 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
3717 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
3718 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
3719 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
3720 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
3721 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
3722 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
3723 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
3724 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
3726 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
3727 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
3728 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
3729 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
3730 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
3731 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
3732 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
3733 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
3734 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
3737 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
3738 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
3739 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
3740 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
3741 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
3742 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
3743 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
3745 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
3747 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
3748 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
3750 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
3754 #---------------------------------------------------------------------------
3756 class Event(Object
):
3758 An event is a structure holding information about an event passed to a
3759 callback or member function. wx.Event is an abstract base class for
3762 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3763 def __init__(self
): raise AttributeError, "No constructor defined"
3764 __repr__
= _swig_repr
3765 __swig_destroy__
= _core_
.delete_Event
3766 __del__
= lambda self
: None;
3767 def SetEventType(*args
, **kwargs
):
3769 SetEventType(self, wxEventType typ)
3771 Sets the specific type of the event.
3773 return _core_
.Event_SetEventType(*args
, **kwargs
)
3775 def GetEventType(*args
, **kwargs
):
3777 GetEventType(self) -> wxEventType
3779 Returns the identifier of the given event type, such as
3780 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3782 return _core_
.Event_GetEventType(*args
, **kwargs
)
3784 def GetEventObject(*args
, **kwargs
):
3786 GetEventObject(self) -> Object
3788 Returns the object (usually a window) associated with the event, if
3791 return _core_
.Event_GetEventObject(*args
, **kwargs
)
3793 def SetEventObject(*args
, **kwargs
):
3795 SetEventObject(self, Object obj)
3797 Sets the originating object, or in other words, obj is normally the
3798 object that is sending the event.
3800 return _core_
.Event_SetEventObject(*args
, **kwargs
)
3802 def GetTimestamp(*args
, **kwargs
):
3803 """GetTimestamp(self) -> long"""
3804 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
3806 def SetTimestamp(*args
, **kwargs
):
3807 """SetTimestamp(self, long ts=0)"""
3808 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
3810 def GetId(*args
, **kwargs
):
3814 Returns the identifier associated with this event, such as a button
3817 return _core_
.Event_GetId(*args
, **kwargs
)
3819 def SetId(*args
, **kwargs
):
3823 Set's the ID for the event. This is usually the ID of the window that
3824 is sending the event, but it can also be a command id from a menu
3827 return _core_
.Event_SetId(*args
, **kwargs
)
3829 def IsCommandEvent(*args
, **kwargs
):
3831 IsCommandEvent(self) -> bool
3833 Returns true if the event is or is derived from `wx.CommandEvent` else
3834 it returns false. Note: Exists only for optimization purposes.
3836 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
3838 def Skip(*args
, **kwargs
):
3840 Skip(self, bool skip=True)
3842 Called by an event handler, it controls whether additional event
3843 handlers bound to this event will be called after the current event
3844 handler returns. Skip(false) (the default setting) will prevent
3845 additional event handlers from being called and control will be
3846 returned to the sender of the event immediately after the current
3847 handler has finished. Skip(True) will cause the event processing
3848 system to continue searching for a handler function for this event.
3851 return _core_
.Event_Skip(*args
, **kwargs
)
3853 def GetSkipped(*args
, **kwargs
):
3855 GetSkipped(self) -> bool
3857 Returns true if the event handler should be skipped, false otherwise.
3860 return _core_
.Event_GetSkipped(*args
, **kwargs
)
3862 def ShouldPropagate(*args
, **kwargs
):
3864 ShouldPropagate(self) -> bool
3866 Test if this event should be propagated to the parent window or not,
3867 i.e. if the propagation level is currently greater than 0.
3869 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
3871 def StopPropagation(*args
, **kwargs
):
3873 StopPropagation(self) -> int
3875 Stop the event from propagating to its parent window. Returns the old
3876 propagation level value which may be later passed to
3877 `ResumePropagation` to allow propagating the event again.
3879 return _core_
.Event_StopPropagation(*args
, **kwargs
)
3881 def ResumePropagation(*args
, **kwargs
):
3883 ResumePropagation(self, int propagationLevel)
3885 Resume the event propagation by restoring the propagation level. (For
3886 example, you can use the value returned by an earlier call to
3890 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
3892 def Clone(*args
, **kwargs
):
3893 """Clone(self) -> Event"""
3894 return _core_
.Event_Clone(*args
, **kwargs
)
3896 Event_swigregister
= _core_
.Event_swigregister
3897 Event_swigregister(Event
)
3899 #---------------------------------------------------------------------------
3901 class PropagationDisabler(object):
3903 Helper class to temporarily change an event not to propagate. Simply
3904 create an instance of this class and then whe it is destroyed the
3905 propogation of the event will be restored.
3907 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3908 __repr__
= _swig_repr
3909 def __init__(self
, *args
, **kwargs
):
3911 __init__(self, Event event) -> PropagationDisabler
3913 Helper class to temporarily change an event not to propagate. Simply
3914 create an instance of this class and then whe it is destroyed the
3915 propogation of the event will be restored.
3917 _core_
.PropagationDisabler_swiginit(self
,_core_
.new_PropagationDisabler(*args
, **kwargs
))
3918 __swig_destroy__
= _core_
.delete_PropagationDisabler
3919 __del__
= lambda self
: None;
3920 PropagationDisabler_swigregister
= _core_
.PropagationDisabler_swigregister
3921 PropagationDisabler_swigregister(PropagationDisabler
)
3923 class PropagateOnce(object):
3925 A helper class that will temporarily lower propagation level of an
3926 event. Simply create an instance of this class and then whe it is
3927 destroyed the propogation of the event will be restored.
3929 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3930 __repr__
= _swig_repr
3931 def __init__(self
, *args
, **kwargs
):
3933 __init__(self, Event event) -> PropagateOnce
3935 A helper class that will temporarily lower propagation level of an
3936 event. Simply create an instance of this class and then whe it is
3937 destroyed the propogation of the event will be restored.
3939 _core_
.PropagateOnce_swiginit(self
,_core_
.new_PropagateOnce(*args
, **kwargs
))
3940 __swig_destroy__
= _core_
.delete_PropagateOnce
3941 __del__
= lambda self
: None;
3942 PropagateOnce_swigregister
= _core_
.PropagateOnce_swigregister
3943 PropagateOnce_swigregister(PropagateOnce
)
3945 #---------------------------------------------------------------------------
3947 class CommandEvent(Event
):
3949 This event class contains information about command events, which
3950 originate from a variety of simple controls, as well as menus and
3953 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3954 __repr__
= _swig_repr
3955 def __init__(self
, *args
, **kwargs
):
3957 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3959 This event class contains information about command events, which
3960 originate from a variety of simple controls, as well as menus and
3963 _core_
.CommandEvent_swiginit(self
,_core_
.new_CommandEvent(*args
, **kwargs
))
3964 def GetSelection(*args
, **kwargs
):
3966 GetSelection(self) -> int
3968 Returns item index for a listbox or choice selection event (not valid
3971 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
3973 def SetString(*args
, **kwargs
):
3974 """SetString(self, String s)"""
3975 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
3977 def GetString(*args
, **kwargs
):
3979 GetString(self) -> String
3981 Returns item string for a listbox or choice selection event (not valid
3984 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
3986 def IsChecked(*args
, **kwargs
):
3988 IsChecked(self) -> bool
3990 This method can be used with checkbox and menu events: for the
3991 checkboxes, the method returns true for a selection event and false
3992 for a deselection one. For the menu events, this method indicates if
3993 the menu item just has become checked or unchecked (and thus only
3994 makes sense for checkable menu items).
3996 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
3999 def IsSelection(*args
, **kwargs
):
4001 IsSelection(self) -> bool
4003 For a listbox or similar event, returns true if it is a selection,
4004 false if it is a deselection.
4006 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4008 def SetExtraLong(*args
, **kwargs
):
4009 """SetExtraLong(self, long extraLong)"""
4010 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4012 def GetExtraLong(*args
, **kwargs
):
4014 GetExtraLong(self) -> long
4016 Returns extra information dependant on the event objects type. If the
4017 event comes from a listbox selection, it is a boolean determining
4018 whether the event was a selection (true) or a deselection (false). A
4019 listbox deselection only occurs for multiple-selection boxes, and in
4020 this case the index and string values are indeterminate and the
4021 listbox must be examined by the application.
4023 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4025 def SetInt(*args
, **kwargs
):
4026 """SetInt(self, int i)"""
4027 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4029 def GetInt(*args
, **kwargs
):
4031 GetInt(self) -> long
4033 Returns the integer identifier corresponding to a listbox, choice or
4034 radiobox selection (only if the event was a selection, not a
4035 deselection), or a boolean value representing the value of a checkbox.
4037 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4039 def GetClientData(*args
, **kwargs
):
4041 GetClientData(self) -> PyObject
4043 Returns the client data object for a listbox or choice selection event, (if any.)
4045 return _core_
.CommandEvent_GetClientData(*args
, **kwargs
)
4047 def SetClientData(*args
, **kwargs
):
4049 SetClientData(self, PyObject clientData)
4051 Associate the given client data with the item at position n.
4053 return _core_
.CommandEvent_SetClientData(*args
, **kwargs
)
4055 GetClientObject
= GetClientData
4056 SetClientObject
= SetClientData
4058 def Clone(*args
, **kwargs
):
4059 """Clone(self) -> Event"""
4060 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4062 CommandEvent_swigregister
= _core_
.CommandEvent_swigregister
4063 CommandEvent_swigregister(CommandEvent
)
4065 #---------------------------------------------------------------------------
4067 class NotifyEvent(CommandEvent
):
4069 An instance of this class (or one of its derived classes) is sent from
4070 a control when the control's state is being changed and the control
4071 allows that change to be prevented from happening. The event handler
4072 can call `Veto` or `Allow` to tell the control what to do.
4074 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4075 __repr__
= _swig_repr
4076 def __init__(self
, *args
, **kwargs
):
4078 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4080 An instance of this class (or one of its derived classes) is sent from
4081 a control when the control's state is being changed and the control
4082 allows that change to be prevented from happening. The event handler
4083 can call `Veto` or `Allow` to tell the control what to do.
4085 _core_
.NotifyEvent_swiginit(self
,_core_
.new_NotifyEvent(*args
, **kwargs
))
4086 def Veto(*args
, **kwargs
):
4090 Prevents the change announced by this event from happening.
4092 It is in general a good idea to notify the user about the reasons for
4093 vetoing the change because otherwise the applications behaviour (which
4094 just refuses to do what the user wants) might be quite surprising.
4096 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4098 def Allow(*args
, **kwargs
):
4102 This is the opposite of `Veto`: it explicitly allows the event to be
4103 processed. For most events it is not necessary to call this method as
4104 the events are allowed anyhow but some are forbidden by default (this
4105 will be mentioned in the corresponding event description).
4107 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4109 def IsAllowed(*args
, **kwargs
):
4111 IsAllowed(self) -> bool
4113 Returns true if the change is allowed (`Veto` hasn't been called) or
4114 false otherwise (if it was).
4116 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4118 NotifyEvent_swigregister
= _core_
.NotifyEvent_swigregister
4119 NotifyEvent_swigregister(NotifyEvent
)
4121 #---------------------------------------------------------------------------
4123 class ScrollEvent(CommandEvent
):
4125 A scroll event holds information about events sent from stand-alone
4126 scrollbars and sliders. Note that scrolled windows do not send
4127 instnaces of this event class, but send the `wx.ScrollWinEvent`
4130 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4131 __repr__
= _swig_repr
4132 def __init__(self
, *args
, **kwargs
):
4134 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4135 int orient=0) -> ScrollEvent
4137 _core_
.ScrollEvent_swiginit(self
,_core_
.new_ScrollEvent(*args
, **kwargs
))
4138 def GetOrientation(*args
, **kwargs
):
4140 GetOrientation(self) -> int
4142 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4145 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4147 def GetPosition(*args
, **kwargs
):
4149 GetPosition(self) -> int
4151 Returns the position of the scrollbar.
4153 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4155 def SetOrientation(*args
, **kwargs
):
4156 """SetOrientation(self, int orient)"""
4157 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4159 def SetPosition(*args
, **kwargs
):
4160 """SetPosition(self, int pos)"""
4161 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4163 ScrollEvent_swigregister
= _core_
.ScrollEvent_swigregister
4164 ScrollEvent_swigregister(ScrollEvent
)
4166 #---------------------------------------------------------------------------
4168 class ScrollWinEvent(Event
):
4170 A wx.ScrollWinEvent holds information about scrolling and is sent from
4173 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4174 __repr__
= _swig_repr
4175 def __init__(self
, *args
, **kwargs
):
4177 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4179 A wx.ScrollWinEvent holds information about scrolling and is sent from
4182 _core_
.ScrollWinEvent_swiginit(self
,_core_
.new_ScrollWinEvent(*args
, **kwargs
))
4183 def GetOrientation(*args
, **kwargs
):
4185 GetOrientation(self) -> int
4187 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4190 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4192 def GetPosition(*args
, **kwargs
):
4194 GetPosition(self) -> int
4196 Returns the position of the scrollbar for the thumb track and release
4197 events. Note that this field can't be used for the other events, you
4198 need to query the window itself for the current position in that case.
4200 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4202 def SetOrientation(*args
, **kwargs
):
4203 """SetOrientation(self, int orient)"""
4204 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4206 def SetPosition(*args
, **kwargs
):
4207 """SetPosition(self, int pos)"""
4208 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4210 ScrollWinEvent_swigregister
= _core_
.ScrollWinEvent_swigregister
4211 ScrollWinEvent_swigregister(ScrollWinEvent
)
4213 #---------------------------------------------------------------------------
4215 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4216 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4217 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4218 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4219 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4220 class MouseEvent(Event
):
4222 This event class contains information about the events generated by
4223 the mouse: they include mouse buttons press and release events and
4226 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4227 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4228 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4229 a middle button so a portable application should avoid relying on the
4232 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4233 the former returns true when the event corresponds to the left mouse
4234 button click while the latter returns true if the left mouse button is
4235 currently being pressed. For example, when the user is dragging the
4236 mouse you can use `LeftIsDown` to test whether the left mouse button
4237 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4238 `LeftIsDown` will also return true in wxWidgets whatever the
4239 underlying GUI behaviour is (which is platform-dependent). The same
4240 applies, of course, to other mouse buttons as well.
4242 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4243 __repr__
= _swig_repr
4244 def __init__(self
, *args
, **kwargs
):
4246 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4248 Constructs a wx.MouseEvent. Valid event types are:
4250 * wxEVT_ENTER_WINDOW
4251 * wxEVT_LEAVE_WINDOW
4257 * wxEVT_MIDDLE_DCLICK
4260 * wxEVT_RIGHT_DCLICK
4264 _core_
.MouseEvent_swiginit(self
,_core_
.new_MouseEvent(*args
, **kwargs
))
4265 def IsButton(*args
, **kwargs
):
4267 IsButton(self) -> bool
4269 Returns true if the event was a mouse button event (not necessarily a
4270 button down event - that may be tested using `ButtonDown`).
4272 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4274 def ButtonDown(*args
, **kwargs
):
4276 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4278 If the argument is omitted, this returns true if the event was any
4279 mouse button down event. Otherwise the argument specifies which
4280 button-down event shold be checked for (see `Button` for the possible
4283 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4285 def ButtonDClick(*args
, **kwargs
):
4287 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4289 If the argument is omitted, this returns true if the event was any
4290 mouse double click event. Otherwise the argument specifies which
4291 double click event to check for (see `Button` for the possible
4294 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4296 def ButtonUp(*args
, **kwargs
):
4298 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4300 If the argument is omitted, this returns true if the event was any
4301 mouse button up event. Otherwise the argument specifies which button
4302 up event to check for (see `Button` for the possible values).
4304 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4306 def Button(*args
, **kwargs
):
4308 Button(self, int button) -> bool
4310 Returns true if the identified mouse button is changing state. Valid
4311 values of button are:
4313 ==================== =====================================
4314 wx.MOUSE_BTN_LEFT check if left button was pressed
4315 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4316 wx.MOUSE_BTN_RIGHT check if right button was pressed
4317 wx.MOUSE_BTN_ANY check if any button was pressed
4318 ==================== =====================================
4321 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4323 def ButtonIsDown(*args
, **kwargs
):
4324 """ButtonIsDown(self, int but) -> bool"""
4325 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4327 def GetButton(*args
, **kwargs
):
4329 GetButton(self) -> int
4331 Returns the mouse button which generated this event or
4332 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4333 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4334 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4335 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4336 right buttons respectively.
4338 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4340 def ControlDown(*args
, **kwargs
):
4342 ControlDown(self) -> bool
4344 Returns true if the control key was down at the time of the event.
4346 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4348 def MetaDown(*args
, **kwargs
):
4350 MetaDown(self) -> bool
4352 Returns true if the Meta key was down at the time of the event.
4354 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4356 def AltDown(*args
, **kwargs
):
4358 AltDown(self) -> bool
4360 Returns true if the Alt key was down at the time of the event.
4362 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4364 def ShiftDown(*args
, **kwargs
):
4366 ShiftDown(self) -> bool
4368 Returns true if the Shift key was down at the time of the event.
4370 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4372 def CmdDown(*args
, **kwargs
):
4374 CmdDown(self) -> bool
4376 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4377 platforms but the special "Apple" (a.k.a as "Command") key on
4378 Macs. It often makes sense to use it instead of, say, `ControlDown`
4379 because Cmd key is used for the same thing under Mac as Ctrl
4380 elsewhere. The Ctrl key still exists, it's just not used for this
4381 purpose. So for non-Mac platforms this is the same as `ControlDown`
4382 and Macs this is the same as `MetaDown`.
4384 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4386 def LeftDown(*args
, **kwargs
):
4388 LeftDown(self) -> bool
4390 Returns true if the left mouse button state changed to down.
4392 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4394 def MiddleDown(*args
, **kwargs
):
4396 MiddleDown(self) -> bool
4398 Returns true if the middle mouse button state changed to down.
4400 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4402 def RightDown(*args
, **kwargs
):
4404 RightDown(self) -> bool
4406 Returns true if the right mouse button state changed to down.
4408 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4410 def LeftUp(*args
, **kwargs
):
4412 LeftUp(self) -> bool
4414 Returns true if the left mouse button state changed to up.
4416 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4418 def MiddleUp(*args
, **kwargs
):
4420 MiddleUp(self) -> bool
4422 Returns true if the middle mouse button state changed to up.
4424 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4426 def RightUp(*args
, **kwargs
):
4428 RightUp(self) -> bool
4430 Returns true if the right mouse button state changed to up.
4432 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4434 def LeftDClick(*args
, **kwargs
):
4436 LeftDClick(self) -> bool
4438 Returns true if the event was a left button double click.
4440 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4442 def MiddleDClick(*args
, **kwargs
):
4444 MiddleDClick(self) -> bool
4446 Returns true if the event was a middle button double click.
4448 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4450 def RightDClick(*args
, **kwargs
):
4452 RightDClick(self) -> bool
4454 Returns true if the event was a right button double click.
4456 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4458 def LeftIsDown(*args
, **kwargs
):
4460 LeftIsDown(self) -> bool
4462 Returns true if the left mouse button is currently down, independent
4463 of the current event type.
4465 Please notice that it is not the same as LeftDown which returns true
4466 if the left mouse button was just pressed. Rather, it describes the
4467 state of the mouse button before the event happened.
4469 This event is usually used in the mouse event handlers which process
4470 "move mouse" messages to determine whether the user is (still)
4473 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4475 def MiddleIsDown(*args
, **kwargs
):
4477 MiddleIsDown(self) -> bool
4479 Returns true if the middle mouse button is currently down, independent
4480 of the current event type.
4482 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4484 def RightIsDown(*args
, **kwargs
):
4486 RightIsDown(self) -> bool
4488 Returns true if the right mouse button is currently down, independent
4489 of the current event type.
4491 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4493 def Dragging(*args
, **kwargs
):
4495 Dragging(self) -> bool
4497 Returns true if this was a dragging event (motion while a button is
4500 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4502 def Moving(*args
, **kwargs
):
4504 Moving(self) -> bool
4506 Returns true if this was a motion event and no mouse buttons were
4507 pressed. If any mouse button is held pressed, then this method returns
4508 false and Dragging returns true.
4510 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4512 def Entering(*args
, **kwargs
):
4514 Entering(self) -> bool
4516 Returns true if the mouse was entering the window.
4518 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4520 def Leaving(*args
, **kwargs
):
4522 Leaving(self) -> bool
4524 Returns true if the mouse was leaving the window.
4526 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4528 def GetPosition(*args
, **kwargs
):
4530 GetPosition(self) -> Point
4532 Returns the pixel position of the mouse in window coordinates when the
4535 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4537 def GetPositionTuple(*args
, **kwargs
):
4539 GetPositionTuple() -> (x,y)
4541 Returns the pixel position of the mouse in window coordinates when the
4544 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
4546 def GetLogicalPosition(*args
, **kwargs
):
4548 GetLogicalPosition(self, DC dc) -> Point
4550 Returns the logical mouse position in pixels (i.e. translated
4551 according to the translation set for the DC, which usually indicates
4552 that the window has been scrolled).
4554 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
4556 def GetX(*args
, **kwargs
):
4560 Returns X coordinate of the physical mouse event position.
4562 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
4564 def GetY(*args
, **kwargs
):
4568 Returns Y coordinate of the physical mouse event position.
4570 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
4572 def GetWheelRotation(*args
, **kwargs
):
4574 GetWheelRotation(self) -> int
4576 Get wheel rotation, positive or negative indicates direction of
4577 rotation. Current devices all send an event when rotation is equal to
4578 +/-WheelDelta, but this allows for finer resolution devices to be
4579 created in the future. Because of this you shouldn't assume that one
4580 event is equal to 1 line or whatever, but you should be able to either
4581 do partial line scrolling or wait until +/-WheelDelta rotation values
4582 have been accumulated before scrolling.
4584 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
4586 def GetWheelDelta(*args
, **kwargs
):
4588 GetWheelDelta(self) -> int
4590 Get wheel delta, normally 120. This is the threshold for action to be
4591 taken, and one such action (for example, scrolling one increment)
4592 should occur for each delta.
4594 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
4596 def GetLinesPerAction(*args
, **kwargs
):
4598 GetLinesPerAction(self) -> int
4600 Returns the configured number of lines (or whatever) to be scrolled
4601 per wheel action. Defaults to three.
4603 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
4605 def IsPageScroll(*args
, **kwargs
):
4607 IsPageScroll(self) -> bool
4609 Returns true if the system has been setup to do page scrolling with
4610 the mouse wheel instead of line scrolling.
4612 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
4614 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
4615 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
4616 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
4617 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
4618 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
4619 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
4620 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
4621 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
4622 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
4623 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
4624 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
4625 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
4626 MouseEvent_swigregister
= _core_
.MouseEvent_swigregister
4627 MouseEvent_swigregister(MouseEvent
)
4629 #---------------------------------------------------------------------------
4631 class SetCursorEvent(Event
):
4633 A SetCursorEvent is generated when the mouse cursor is about to be set
4634 as a result of mouse motion. This event gives the application the
4635 chance to perform specific mouse cursor processing based on the
4636 current position of the mouse within the window. Use the `SetCursor`
4637 method to specify the cursor you want to be displayed.
4639 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4640 __repr__
= _swig_repr
4641 def __init__(self
, *args
, **kwargs
):
4643 __init__(self, int x=0, int y=0) -> SetCursorEvent
4645 Construct a new `wx.SetCursorEvent`.
4647 _core_
.SetCursorEvent_swiginit(self
,_core_
.new_SetCursorEvent(*args
, **kwargs
))
4648 def GetX(*args
, **kwargs
):
4652 Returns the X coordinate of the mouse in client coordinates.
4654 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
4656 def GetY(*args
, **kwargs
):
4660 Returns the Y coordinate of the mouse in client coordinates.
4662 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
4664 def SetCursor(*args
, **kwargs
):
4666 SetCursor(self, Cursor cursor)
4668 Sets the cursor associated with this event.
4670 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
4672 def GetCursor(*args
, **kwargs
):
4674 GetCursor(self) -> Cursor
4676 Returns a reference to the cursor specified by this event.
4678 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
4680 def HasCursor(*args
, **kwargs
):
4682 HasCursor(self) -> bool
4684 Returns true if the cursor specified by this event is a valid cursor.
4686 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
4688 SetCursorEvent_swigregister
= _core_
.SetCursorEvent_swigregister
4689 SetCursorEvent_swigregister(SetCursorEvent
)
4691 #---------------------------------------------------------------------------
4693 class KeyEvent(Event
):
4695 This event class contains information about keypress and character
4696 events. These events are only sent to the widget that currently has
4699 Notice that there are three different kinds of keyboard events in
4700 wxWidgets: key down and up events and char events. The difference
4701 between the first two is clear - the first corresponds to a key press
4702 and the second to a key release - otherwise they are identical. Just
4703 note that if the key is maintained in a pressed state you will
4704 typically get a lot of (automatically generated) down events but only
4705 one up so it is wrong to assume that there is one up event
4706 corresponding to each down one.
4708 Both key events provide untranslated key codes while the char event
4709 carries the translated one. The untranslated code for alphanumeric
4710 keys is always an upper case value. For the other keys it is one of
4711 WXK_XXX values from the keycodes table. The translated key is, in
4712 general, the character the user expects to appear as the result of the
4713 key combination when typing the text into a text entry zone, for
4716 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4717 and the standard US keyboard): when the 'A' key is pressed, the key
4718 down event key code is equal to ASCII A == 65. But the char event key
4719 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4720 'A' keys simultaneously , the key code in key down event will still be
4721 just 'A' while the char event key code parameter will now be 'A' as
4724 Although in this simple case it is clear that the correct key code
4725 could be found in the key down event handler by checking the value
4726 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4727 as for non alphanumeric keys or non-US keyboard layouts the
4728 translation is keyboard-layout dependent and can only be done properly
4729 by the system itself.
4731 Another kind of translation is done when the control key is pressed:
4732 for example, for CTRL-A key press the key down event still carries the
4733 same key code 'A' as usual but the char event will have key code of 1,
4734 the ASCII value of this key combination.
4736 You may discover how the other keys on your system behave
4737 interactively by running the KeyEvents sample in the wxPython demo and
4738 pressing some keys while the blue box at the top has the keyboard
4741 **Note**: If a key down event is caught and the event handler does not
4742 call event.Skip() then the coresponding char event will not
4743 happen. This is by design and enables the programs that handle both
4744 types of events to be a bit simpler.
4746 **Note for Windows programmers**: The key and char events in wxWidgets
4747 are similar to but slightly different from Windows WM_KEYDOWN and
4748 WM_CHAR events. In particular, Alt-x combination will generate a char
4749 event in wxWidgets (unless it is used as an accelerator).
4751 **Tip**: be sure to call event.Skip() for events that you don't
4752 process in key event function, otherwise menu shortcuts may cease to
4756 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4757 __repr__
= _swig_repr
4758 def __init__(self
, *args
, **kwargs
):
4760 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
4762 Construct a new `wx.KeyEvent`. Valid event types are:
4765 _core_
.KeyEvent_swiginit(self
,_core_
.new_KeyEvent(*args
, **kwargs
))
4766 def GetModifiers(*args
, **kwargs
):
4768 GetModifiers(self) -> int
4770 Returns a bitmask of the current modifier settings. Can be used to
4771 check if the key event has exactly the given modifiers without having
4772 to explicitly check that the other modifiers are not down. For
4775 if event.GetModifers() == wx.MOD_CONTROL:
4779 return _core_
.KeyEvent_GetModifiers(*args
, **kwargs
)
4781 def ControlDown(*args
, **kwargs
):
4783 ControlDown(self) -> bool
4785 Returns ``True`` if the Control key was down at the time of the event.
4787 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
4789 def MetaDown(*args
, **kwargs
):
4791 MetaDown(self) -> bool
4793 Returns ``True`` if the Meta key was down at the time of the event.
4795 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
4797 def AltDown(*args
, **kwargs
):
4799 AltDown(self) -> bool
4801 Returns ``True`` if the Alt key was down at the time of the event.
4803 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
4805 def ShiftDown(*args
, **kwargs
):
4807 ShiftDown(self) -> bool
4809 Returns ``True`` if the Shift key was down at the time of the event.
4811 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
4813 def CmdDown(*args
, **kwargs
):
4815 CmdDown(self) -> bool
4817 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4818 platforms but the special "Apple" (a.k.a as "Command") key on
4819 Macs. It makes often sense to use it instead of, say, `ControlDown`
4820 because Cmd key is used for the same thing under Mac as Ctrl
4821 elsewhere. The Ctrl still exists, it's just not used for this
4822 purpose. So for non-Mac platforms this is the same as `ControlDown`
4823 and Macs this is the same as `MetaDown`.
4825 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
4827 def HasModifiers(*args
, **kwargs
):
4829 HasModifiers(self) -> bool
4831 Returns true if either CTRL or ALT keys was down at the time of the
4832 key event. Note that this function does not take into account neither
4833 SHIFT nor META key states (the reason for ignoring the latter is that
4834 it is common for NUMLOCK key to be configured as META under X but the
4835 key presses even while NUMLOCK is on should be still processed
4838 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
4840 def GetKeyCode(*args
, **kwargs
):
4842 GetKeyCode(self) -> int
4844 Returns the virtual key code. ASCII events return normal ASCII values,
4845 while non-ASCII events return values such as WXK_LEFT for the left
4846 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4849 Note that in Unicode build, the returned value is meaningful only if
4850 the user entered a character that can be represented in current
4851 locale's default charset. You can obtain the corresponding Unicode
4852 character using `GetUnicodeKey`.
4854 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
4856 KeyCode
= GetKeyCode
4857 def GetUnicodeKey(*args
, **kwargs
):
4859 GetUnicodeKey(self) -> int
4861 Returns the Unicode character corresponding to this key event. This
4862 function is only meaningfule in a Unicode build of wxPython.
4864 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
4866 GetUniChar
= GetUnicodeKey
4867 def GetRawKeyCode(*args
, **kwargs
):
4869 GetRawKeyCode(self) -> unsigned int
4871 Returns the raw key code for this event. This is a platform-dependent
4872 scan code which should only be used in advanced
4873 applications. Currently the raw key codes are not supported by all
4876 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
4878 def GetRawKeyFlags(*args
, **kwargs
):
4880 GetRawKeyFlags(self) -> unsigned int
4882 Returns the low level key flags for this event. The flags are
4883 platform-dependent and should only be used in advanced applications.
4884 Currently the raw key flags are not supported by all ports.
4886 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
4888 def GetPosition(*args
, **kwargs
):
4890 GetPosition(self) -> Point
4892 Find the position of the event, if applicable.
4894 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
4896 def GetPositionTuple(*args
, **kwargs
):
4898 GetPositionTuple() -> (x,y)
4900 Find the position of the event, if applicable.
4902 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
4904 def GetX(*args
, **kwargs
):
4908 Returns the X position (in client coordinates) of the event, if
4911 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
4913 def GetY(*args
, **kwargs
):
4917 Returns the Y position (in client coordinates) of the event, if
4920 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
4922 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
4923 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
4924 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
4925 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
4926 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
4927 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
4928 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
4929 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
4930 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
4931 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
4932 KeyEvent_swigregister
= _core_
.KeyEvent_swigregister
4933 KeyEvent_swigregister(KeyEvent
)
4935 #---------------------------------------------------------------------------
4937 class SizeEvent(Event
):
4939 A size event holds information about size change events. The EVT_SIZE
4940 handler function will be called when the window it is bound to has
4943 Note that the size passed is of the whole window: call
4944 `wx.Window.GetClientSize` for the area which may be used by the
4947 When a window is resized, usually only a small part of the window is
4948 damaged and and that area is all that is in the update region for the
4949 next paint event. However, if your drawing depends on the size of the
4950 window, you may need to clear the DC explicitly and repaint the whole
4951 window. In which case, you may need to call `wx.Window.Refresh` to
4952 invalidate the entire window.
4955 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4956 __repr__
= _swig_repr
4957 def __init__(self
, *args
, **kwargs
):
4959 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4961 Construct a new ``wx.SizeEvent``.
4963 _core_
.SizeEvent_swiginit(self
,_core_
.new_SizeEvent(*args
, **kwargs
))
4964 def GetSize(*args
, **kwargs
):
4966 GetSize(self) -> Size
4968 Returns the entire size of the window generating the size change
4971 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
4973 def GetRect(*args
, **kwargs
):
4974 """GetRect(self) -> Rect"""
4975 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
4977 def SetRect(*args
, **kwargs
):
4978 """SetRect(self, Rect rect)"""
4979 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
4981 def SetSize(*args
, **kwargs
):
4982 """SetSize(self, Size size)"""
4983 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
4985 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
4986 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
4987 SizeEvent_swigregister
= _core_
.SizeEvent_swigregister
4988 SizeEvent_swigregister(SizeEvent
)
4990 #---------------------------------------------------------------------------
4992 class MoveEvent(Event
):
4994 This event object is sent for EVT_MOVE event bindings when a window is
4995 moved to a new position.
4997 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4998 __repr__
= _swig_repr
4999 def __init__(self
, *args
, **kwargs
):
5001 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5005 _core_
.MoveEvent_swiginit(self
,_core_
.new_MoveEvent(*args
, **kwargs
))
5006 def GetPosition(*args
, **kwargs
):
5008 GetPosition(self) -> Point
5010 Returns the position of the window generating the move change event.
5012 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
5014 def GetRect(*args
, **kwargs
):
5015 """GetRect(self) -> Rect"""
5016 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
5018 def SetRect(*args
, **kwargs
):
5019 """SetRect(self, Rect rect)"""
5020 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
5022 def SetPosition(*args
, **kwargs
):
5023 """SetPosition(self, Point pos)"""
5024 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
5026 m_pos
= property(GetPosition
, SetPosition
)
5027 m_rect
= property(GetRect
, SetRect
)
5029 MoveEvent_swigregister
= _core_
.MoveEvent_swigregister
5030 MoveEvent_swigregister(MoveEvent
)
5032 #---------------------------------------------------------------------------
5034 class PaintEvent(Event
):
5036 A paint event is sent when a window's contents needs to be repainted.
5037 Note that in an EVT_PAINT handler the application must *always* create
5038 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5039 Windows assumes that the window has not been painted yet and will send
5040 the event again, causing endless refreshes.
5042 You can optimize painting by retrieving the rectangles that have been
5043 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5044 and only repainting these rectangles. The rectangles are in terms of
5045 the client area, and are unscrolled, so you will need to do some
5046 calculations using the current view position to obtain logical,
5050 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5051 __repr__
= _swig_repr
5052 def __init__(self
, *args
, **kwargs
):
5053 """__init__(self, int Id=0) -> PaintEvent"""
5054 _core_
.PaintEvent_swiginit(self
,_core_
.new_PaintEvent(*args
, **kwargs
))
5055 PaintEvent_swigregister
= _core_
.PaintEvent_swigregister
5056 PaintEvent_swigregister(PaintEvent
)
5058 class NcPaintEvent(Event
):
5059 """Proxy of C++ NcPaintEvent class"""
5060 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5061 __repr__
= _swig_repr
5062 def __init__(self
, *args
, **kwargs
):
5063 """__init__(self, int winid=0) -> NcPaintEvent"""
5064 _core_
.NcPaintEvent_swiginit(self
,_core_
.new_NcPaintEvent(*args
, **kwargs
))
5065 NcPaintEvent_swigregister
= _core_
.NcPaintEvent_swigregister
5066 NcPaintEvent_swigregister(NcPaintEvent
)
5068 #---------------------------------------------------------------------------
5070 class EraseEvent(Event
):
5072 An erase event is sent whenever the background of a window needs to be
5073 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5074 binder. On some platforms, such as GTK+, this event is simulated
5075 (simply generated just before the paint event) and may cause flicker.
5077 To paint a custom background use the `GetDC` method and use the returned
5078 device context if it is not ``None``, otherwise create a temporary
5079 `wx.ClientDC` and draw on that.
5082 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5083 __repr__
= _swig_repr
5084 def __init__(self
, *args
, **kwargs
):
5086 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5090 _core_
.EraseEvent_swiginit(self
,_core_
.new_EraseEvent(*args
, **kwargs
))
5091 def GetDC(*args
, **kwargs
):
5095 Returns the device context the event handler should draw upon. If
5096 ``None`` is returned then create a temporary `wx.ClientDC` and use
5099 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5101 EraseEvent_swigregister
= _core_
.EraseEvent_swigregister
5102 EraseEvent_swigregister(EraseEvent
)
5104 #---------------------------------------------------------------------------
5106 class FocusEvent(Event
):
5108 A focus event is sent when a window's focus changes. The window losing
5109 focus receives an EVT_KILL_FOCUS event while the window gaining it
5110 gets an EVT_SET_FOCUS event.
5112 Notice that the set focus event happens both when the user gives focus
5113 to the window (whether using the mouse or keyboard) and when it is
5114 done from the program itself using `wx.Window.SetFocus`.
5117 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5118 __repr__
= _swig_repr
5119 def __init__(self
, *args
, **kwargs
):
5121 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5125 _core_
.FocusEvent_swiginit(self
,_core_
.new_FocusEvent(*args
, **kwargs
))
5126 def GetWindow(*args
, **kwargs
):
5128 GetWindow(self) -> Window
5130 Returns the other window associated with this event, that is the
5131 window which had the focus before for the EVT_SET_FOCUS event and the
5132 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5134 Warning: the window returned may be None!
5136 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5138 def SetWindow(*args
, **kwargs
):
5139 """SetWindow(self, Window win)"""
5140 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5142 FocusEvent_swigregister
= _core_
.FocusEvent_swigregister
5143 FocusEvent_swigregister(FocusEvent
)
5145 #---------------------------------------------------------------------------
5147 class ChildFocusEvent(CommandEvent
):
5149 wx.ChildFocusEvent notifies the parent that a child has received the
5150 focus. Unlike `wx.FocusEvent` it is propagated up the window
5153 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5154 __repr__
= _swig_repr
5155 def __init__(self
, *args
, **kwargs
):
5157 __init__(self, Window win=None) -> ChildFocusEvent
5161 _core_
.ChildFocusEvent_swiginit(self
,_core_
.new_ChildFocusEvent(*args
, **kwargs
))
5162 def GetWindow(*args
, **kwargs
):
5164 GetWindow(self) -> Window
5166 The window which has just received the focus.
5168 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5170 ChildFocusEvent_swigregister
= _core_
.ChildFocusEvent_swigregister
5171 ChildFocusEvent_swigregister(ChildFocusEvent
)
5173 #---------------------------------------------------------------------------
5175 class ActivateEvent(Event
):
5177 An activate event is sent when a top-level window or the entire
5178 application is being activated or deactivated.
5180 A top-level window (a dialog or frame) receives an activate event when
5181 is being activated or deactivated. This is indicated visually by the
5182 title bar changing colour, and a subwindow gaining the keyboard focus.
5183 An application is activated or deactivated when one of its frames
5184 becomes activated, or a frame becomes inactivate resulting in all
5185 application frames being inactive.
5187 Please note that usually you should call event.Skip() in your handlers
5188 for these events so the default handlers will still be called, as not
5189 doing so can result in strange effects.
5192 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5193 __repr__
= _swig_repr
5194 def __init__(self
, *args
, **kwargs
):
5196 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5200 _core_
.ActivateEvent_swiginit(self
,_core_
.new_ActivateEvent(*args
, **kwargs
))
5201 def GetActive(*args
, **kwargs
):
5203 GetActive(self) -> bool
5205 Returns true if the application or window is being activated, false
5208 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5210 ActivateEvent_swigregister
= _core_
.ActivateEvent_swigregister
5211 ActivateEvent_swigregister(ActivateEvent
)
5213 #---------------------------------------------------------------------------
5215 class InitDialogEvent(Event
):
5217 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5218 any window when `wx.Window.InitDialog` is called. Handlers for this
5219 event can transfer data to the window, or anything else that should be
5220 done before the user begins editing the form. The default handler
5221 calls `wx.Window.TransferDataToWindow`.
5223 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5224 __repr__
= _swig_repr
5225 def __init__(self
, *args
, **kwargs
):
5227 __init__(self, int Id=0) -> InitDialogEvent
5231 _core_
.InitDialogEvent_swiginit(self
,_core_
.new_InitDialogEvent(*args
, **kwargs
))
5232 InitDialogEvent_swigregister
= _core_
.InitDialogEvent_swigregister
5233 InitDialogEvent_swigregister(InitDialogEvent
)
5235 #---------------------------------------------------------------------------
5237 class MenuEvent(Event
):
5239 This class is used for a variety of menu-related events. Note that
5240 these do not include menu command events, which are handled by sending
5241 `wx.CommandEvent` objects.
5243 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5244 text in the first field of the status bar.
5246 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5247 __repr__
= _swig_repr
5248 def __init__(self
, *args
, **kwargs
):
5250 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5254 _core_
.MenuEvent_swiginit(self
,_core_
.new_MenuEvent(*args
, **kwargs
))
5255 def GetMenuId(*args
, **kwargs
):
5257 GetMenuId(self) -> int
5259 Returns the menu identifier associated with the event. This method
5260 should be only used with the HIGHLIGHT events.
5262 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5264 def IsPopup(*args
, **kwargs
):
5266 IsPopup(self) -> bool
5268 Returns ``True`` if the menu which is being opened or closed is a
5269 popup menu, ``False`` if it is a normal one. This method should only
5270 be used with the OPEN and CLOSE events.
5272 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5274 def GetMenu(*args
, **kwargs
):
5276 GetMenu(self) -> Menu
5278 Returns the menu which is being opened or closed. This method should
5279 only be used with the OPEN and CLOSE events.
5281 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5283 MenuEvent_swigregister
= _core_
.MenuEvent_swigregister
5284 MenuEvent_swigregister(MenuEvent
)
5286 #---------------------------------------------------------------------------
5288 class CloseEvent(Event
):
5290 This event class contains information about window and session close
5293 The handler function for EVT_CLOSE is called when the user has tried
5294 to close a a frame or dialog box using the window manager controls or
5295 the system menu. It can also be invoked by the application itself
5296 programmatically, for example by calling the `wx.Window.Close`
5299 You should check whether the application is forcing the deletion of
5300 the window using `CanVeto`. If it returns ``False``, you must destroy
5301 the window using `wx.Window.Destroy`. If the return value is ``True``,
5302 it is up to you whether you respond by destroying the window or not.
5303 For example you may wish to display a message dialog prompting to save
5304 files or to cancel the close.
5306 If you don't destroy the window, you should call `Veto` to let the
5307 calling code know that you did not destroy the window. This allows the
5308 `wx.Window.Close` function to return ``True`` or ``False`` depending
5309 on whether the close instruction was honored or not.
5311 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5312 __repr__
= _swig_repr
5313 def __init__(self
, *args
, **kwargs
):
5315 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5319 _core_
.CloseEvent_swiginit(self
,_core_
.new_CloseEvent(*args
, **kwargs
))
5320 def SetLoggingOff(*args
, **kwargs
):
5322 SetLoggingOff(self, bool logOff)
5324 Sets the 'logging off' flag.
5326 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5328 def GetLoggingOff(*args
, **kwargs
):
5330 GetLoggingOff(self) -> bool
5332 Returns ``True`` if the user is logging off or ``False`` if the
5333 system is shutting down. This method can only be called for end
5334 session and query end session events, it doesn't make sense for close
5337 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5339 def Veto(*args
, **kwargs
):
5341 Veto(self, bool veto=True)
5343 Call this from your event handler to veto a system shutdown or to
5344 signal to the calling application that a window close did not happen.
5346 You can only veto a shutdown or close if `CanVeto` returns true.
5348 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5350 def GetVeto(*args
, **kwargs
):
5351 """GetVeto(self) -> bool"""
5352 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5354 def SetCanVeto(*args
, **kwargs
):
5356 SetCanVeto(self, bool canVeto)
5358 Sets the 'can veto' flag.
5360 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5362 def CanVeto(*args
, **kwargs
):
5364 CanVeto(self) -> bool
5366 Returns true if you can veto a system shutdown or a window close
5367 event. Vetoing a window close event is not possible if the calling
5368 code wishes to force the application to exit, and so this function
5369 must be called to check this.
5371 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5373 CloseEvent_swigregister
= _core_
.CloseEvent_swigregister
5374 CloseEvent_swigregister(CloseEvent
)
5376 #---------------------------------------------------------------------------
5378 class ShowEvent(Event
):
5379 """An EVT_SHOW event is sent when a window is shown or hidden."""
5380 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5381 __repr__
= _swig_repr
5382 def __init__(self
, *args
, **kwargs
):
5384 __init__(self, int winid=0, bool show=False) -> ShowEvent
5386 An EVT_SHOW event is sent when a window is shown or hidden.
5388 _core_
.ShowEvent_swiginit(self
,_core_
.new_ShowEvent(*args
, **kwargs
))
5389 def SetShow(*args
, **kwargs
):
5390 """SetShow(self, bool show)"""
5391 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5393 def GetShow(*args
, **kwargs
):
5394 """GetShow(self) -> bool"""
5395 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5397 ShowEvent_swigregister
= _core_
.ShowEvent_swigregister
5398 ShowEvent_swigregister(ShowEvent
)
5400 #---------------------------------------------------------------------------
5402 class IconizeEvent(Event
):
5404 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5407 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5408 __repr__
= _swig_repr
5409 def __init__(self
, *args
, **kwargs
):
5411 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5413 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5416 _core_
.IconizeEvent_swiginit(self
,_core_
.new_IconizeEvent(*args
, **kwargs
))
5417 def Iconized(*args
, **kwargs
):
5419 Iconized(self) -> bool
5421 Returns ``True`` if the frame has been iconized, ``False`` if it has
5424 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5426 IconizeEvent_swigregister
= _core_
.IconizeEvent_swigregister
5427 IconizeEvent_swigregister(IconizeEvent
)
5429 #---------------------------------------------------------------------------
5431 class MaximizeEvent(Event
):
5432 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5433 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5434 __repr__
= _swig_repr
5435 def __init__(self
, *args
, **kwargs
):
5437 __init__(self, int id=0) -> MaximizeEvent
5439 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5441 _core_
.MaximizeEvent_swiginit(self
,_core_
.new_MaximizeEvent(*args
, **kwargs
))
5442 MaximizeEvent_swigregister
= _core_
.MaximizeEvent_swigregister
5443 MaximizeEvent_swigregister(MaximizeEvent
)
5445 #---------------------------------------------------------------------------
5447 class DropFilesEvent(Event
):
5449 This class is used for drop files events, that is, when files have
5450 been dropped onto the window. This functionality is only available
5451 under Windows. The window must have previously been enabled for
5452 dropping by calling `wx.Window.DragAcceptFiles`.
5454 Important note: this is a separate implementation to the more general
5455 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5456 implementation uses the older, Windows message-based approach of
5459 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5463 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5464 def __init__(self
): raise AttributeError, "No constructor defined"
5465 __repr__
= _swig_repr
5466 def GetPosition(*args
, **kwargs
):
5468 GetPosition(self) -> Point
5470 Returns the position at which the files were dropped.
5472 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5474 def GetNumberOfFiles(*args
, **kwargs
):
5476 GetNumberOfFiles(self) -> int
5478 Returns the number of files dropped.
5480 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5482 def GetFiles(*args
, **kwargs
):
5484 GetFiles(self) -> PyObject
5486 Returns a list of the filenames that were dropped.
5488 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5490 DropFilesEvent_swigregister
= _core_
.DropFilesEvent_swigregister
5491 DropFilesEvent_swigregister(DropFilesEvent
)
5493 #---------------------------------------------------------------------------
5495 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5496 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5497 class UpdateUIEvent(CommandEvent
):
5499 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5500 wxWidgets to give an application the chance to update various user
5503 Without update UI events, an application has to work hard to
5504 check/uncheck, enable/disable, and set the text for elements such as
5505 menu items and toolbar buttons. The code for doing this has to be
5506 mixed up with the code that is invoked when an action is invoked for a
5507 menu item or button.
5509 With update UI events, you define an event handler to look at the
5510 state of the application and change UI elements accordingly. wxWidgets
5511 will call your handler functions in idle time, so you don't have to
5512 worry where to call this code. In addition to being a clearer and more
5513 declarative method, it also means you don't have to worry whether
5514 you're updating a toolbar or menubar identifier. The same handler can
5515 update a menu item and toolbar button, if the ID values are the same.
5517 Instead of directly manipulating the menu or button, you call
5518 functions in the event object, such as `Check`. wxWidgets will
5519 determine whether such a call has been made, and which UI element to
5522 These events will work for popup menus as well as menubars. Just
5523 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5524 any UI events for the window that owns the menu.
5526 If you find that the overhead of UI update processing is affecting
5527 your application, you can do one or both of the following:
5529 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5530 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5531 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5532 receive update events. No other windows will receive update
5535 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5536 value to set the delay between updates. You may need to call
5537 `wx.Window.UpdateWindowUI` at critical points, for example when
5538 a dialog is about to be shown, in case the user sees a slight
5539 delay before windows are updated.
5541 Note that although events are sent in idle time, defining a EVT_IDLE
5542 handler for a window does not affect this because the events are sent
5543 from an internal idle handler.
5545 wxWidgets tries to optimize update events on some platforms. On
5546 Windows and GTK+, events for menubar items are only sent when the menu
5547 is about to be shown, and not in idle time.
5550 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5551 __repr__
= _swig_repr
5552 def __init__(self
, *args
, **kwargs
):
5554 __init__(self, int commandId=0) -> UpdateUIEvent
5558 _core_
.UpdateUIEvent_swiginit(self
,_core_
.new_UpdateUIEvent(*args
, **kwargs
))
5559 def GetChecked(*args
, **kwargs
):
5561 GetChecked(self) -> bool
5563 Returns ``True`` if the UI element should be checked.
5565 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
5567 def GetEnabled(*args
, **kwargs
):
5569 GetEnabled(self) -> bool
5571 Returns ``True`` if the UI element should be enabled.
5573 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
5575 def GetShown(*args
, **kwargs
):
5577 GetShown(self) -> bool
5579 Returns ``True`` if the UI element should be shown.
5581 return _core_
.UpdateUIEvent_GetShown(*args
, **kwargs
)
5583 def GetText(*args
, **kwargs
):
5585 GetText(self) -> String
5587 Returns the text that should be set for the UI element.
5589 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
5591 def GetSetText(*args
, **kwargs
):
5593 GetSetText(self) -> bool
5595 Returns ``True`` if the application has called `SetText`. For
5596 wxWidgets internal use only.
5598 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
5600 def GetSetChecked(*args
, **kwargs
):
5602 GetSetChecked(self) -> bool
5604 Returns ``True`` if the application has called `Check`. For wxWidgets
5607 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
5609 def GetSetEnabled(*args
, **kwargs
):
5611 GetSetEnabled(self) -> bool
5613 Returns ``True`` if the application has called `Enable`. For wxWidgets
5616 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
5618 def GetSetShown(*args
, **kwargs
):
5620 GetSetShown(self) -> bool
5622 Returns ``True`` if the application has called `Show`. For wxWidgets
5625 return _core_
.UpdateUIEvent_GetSetShown(*args
, **kwargs
)
5627 def Check(*args
, **kwargs
):
5629 Check(self, bool check)
5631 Check or uncheck the UI element.
5633 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
5635 def Enable(*args
, **kwargs
):
5637 Enable(self, bool enable)
5639 Enable or disable the UI element.
5641 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
5643 def Show(*args
, **kwargs
):
5645 Show(self, bool show)
5647 Show or hide the UI element.
5649 return _core_
.UpdateUIEvent_Show(*args
, **kwargs
)
5651 def SetText(*args
, **kwargs
):
5653 SetText(self, String text)
5655 Sets the text for this UI element.
5657 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
5659 def SetUpdateInterval(*args
, **kwargs
):
5661 SetUpdateInterval(long updateInterval)
5663 Sets the interval between updates in milliseconds. Set to -1 to
5664 disable updates, or to 0 to update as frequently as possible. The
5667 Use this to reduce the overhead of UI update events if your
5668 application has a lot of windows. If you set the value to -1 or
5669 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5670 at appropriate points in your application, such as when a dialog is
5673 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5675 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
5676 def GetUpdateInterval(*args
, **kwargs
):
5678 GetUpdateInterval() -> long
5680 Returns the current interval between updates in milliseconds. -1
5681 disables updates, 0 updates as frequently as possible.
5683 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5685 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
5686 def CanUpdate(*args
, **kwargs
):
5688 CanUpdate(Window win) -> bool
5690 Returns ``True`` if it is appropriate to update (send UI update events
5693 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5694 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5695 events were last sent in idle time, and the update interval, to
5696 determine whether events should be sent to this window now. By default
5697 this will always return true because the update mode is initially
5698 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5699 events will be sent as often as possible. You can reduce the frequency
5700 that events are sent by changing the mode and/or setting an update
5704 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5706 CanUpdate
= staticmethod(CanUpdate
)
5707 def ResetUpdateTime(*args
, **kwargs
):
5711 Used internally to reset the last-updated time to the current time. It
5712 is assumed that update events are normally sent in idle time, so this
5713 is called at the end of idle processing.
5715 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5717 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
5718 def SetMode(*args
, **kwargs
):
5722 Specify how wxWidgets will send update events: to all windows, or only
5723 to those which specify that they will process the events.
5725 The mode may be one of the following values:
5727 ============================= ==========================================
5728 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5729 is the default setting.
5730 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5731 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5733 ============================= ==========================================
5736 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5738 SetMode
= staticmethod(SetMode
)
5739 def GetMode(*args
, **kwargs
):
5743 Returns a value specifying how wxWidgets will send update events: to
5744 all windows, or only to those which specify that they will process the
5747 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5749 GetMode
= staticmethod(GetMode
)
5750 UpdateUIEvent_swigregister
= _core_
.UpdateUIEvent_swigregister
5751 UpdateUIEvent_swigregister(UpdateUIEvent
)
5753 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
5755 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5757 Sets the interval between updates in milliseconds. Set to -1 to
5758 disable updates, or to 0 to update as frequently as possible. The
5761 Use this to reduce the overhead of UI update events if your
5762 application has a lot of windows. If you set the value to -1 or
5763 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5764 at appropriate points in your application, such as when a dialog is
5767 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5769 def UpdateUIEvent_GetUpdateInterval(*args
):
5771 UpdateUIEvent_GetUpdateInterval() -> long
5773 Returns the current interval between updates in milliseconds. -1
5774 disables updates, 0 updates as frequently as possible.
5776 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
)
5778 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
5780 UpdateUIEvent_CanUpdate(Window win) -> bool
5782 Returns ``True`` if it is appropriate to update (send UI update events
5785 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5786 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5787 events were last sent in idle time, and the update interval, to
5788 determine whether events should be sent to this window now. By default
5789 this will always return true because the update mode is initially
5790 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5791 events will be sent as often as possible. You can reduce the frequency
5792 that events are sent by changing the mode and/or setting an update
5796 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5798 def UpdateUIEvent_ResetUpdateTime(*args
):
5800 UpdateUIEvent_ResetUpdateTime()
5802 Used internally to reset the last-updated time to the current time. It
5803 is assumed that update events are normally sent in idle time, so this
5804 is called at the end of idle processing.
5806 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
)
5808 def UpdateUIEvent_SetMode(*args
, **kwargs
):
5810 UpdateUIEvent_SetMode(int mode)
5812 Specify how wxWidgets will send update events: to all windows, or only
5813 to those which specify that they will process the events.
5815 The mode may be one of the following values:
5817 ============================= ==========================================
5818 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5819 is the default setting.
5820 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5821 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5823 ============================= ==========================================
5826 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5828 def UpdateUIEvent_GetMode(*args
):
5830 UpdateUIEvent_GetMode() -> int
5832 Returns a value specifying how wxWidgets will send update events: to
5833 all windows, or only to those which specify that they will process the
5836 return _core_
.UpdateUIEvent_GetMode(*args
)
5838 #---------------------------------------------------------------------------
5840 class SysColourChangedEvent(Event
):
5842 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5843 when the user changes the colour settings using the control
5844 panel. This is only applicable under Windows.
5846 The default event handler for this event propagates the event to child
5847 windows, since Windows only sends the events to top-level windows. If
5848 intercepting this event for a top-level window, remember to call
5849 `Skip` so the the base class handler will still be executed, or to
5850 pass the event on to the window's children explicitly.
5853 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5854 __repr__
= _swig_repr
5855 def __init__(self
, *args
, **kwargs
):
5857 __init__(self) -> SysColourChangedEvent
5861 _core_
.SysColourChangedEvent_swiginit(self
,_core_
.new_SysColourChangedEvent(*args
, **kwargs
))
5862 SysColourChangedEvent_swigregister
= _core_
.SysColourChangedEvent_swigregister
5863 SysColourChangedEvent_swigregister(SysColourChangedEvent
)
5865 #---------------------------------------------------------------------------
5867 class MouseCaptureChangedEvent(Event
):
5869 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5870 a window that loses its mouse capture. This is called even if
5871 `wx.Window.ReleaseMouse` was called by the application code. Handling
5872 this event allows an application to cater for unexpected capture
5873 releases which might otherwise confuse mouse handling code.
5875 This event is implemented under Windows only.
5877 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5878 __repr__
= _swig_repr
5879 def __init__(self
, *args
, **kwargs
):
5881 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5885 _core_
.MouseCaptureChangedEvent_swiginit(self
,_core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
))
5886 def GetCapturedWindow(*args
, **kwargs
):
5888 GetCapturedWindow(self) -> Window
5890 Returns the window that gained the capture, or ``None`` if it was a
5891 non-wxWidgets window.
5893 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
5895 MouseCaptureChangedEvent_swigregister
= _core_
.MouseCaptureChangedEvent_swigregister
5896 MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent
)
5898 #---------------------------------------------------------------------------
5900 class DisplayChangedEvent(Event
):
5902 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5903 resolution has changed.
5905 This event is implemented under Windows only.
5907 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5908 __repr__
= _swig_repr
5909 def __init__(self
, *args
, **kwargs
):
5910 """__init__(self) -> DisplayChangedEvent"""
5911 _core_
.DisplayChangedEvent_swiginit(self
,_core_
.new_DisplayChangedEvent(*args
, **kwargs
))
5912 DisplayChangedEvent_swigregister
= _core_
.DisplayChangedEvent_swigregister
5913 DisplayChangedEvent_swigregister(DisplayChangedEvent
)
5915 #---------------------------------------------------------------------------
5917 class PaletteChangedEvent(Event
):
5919 An EVT_PALETTE_CHANGED event is sent when the system palette has
5920 changed, thereby giving each window a chance to redo their own to
5923 This event is implemented under Windows only.
5925 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5926 __repr__
= _swig_repr
5927 def __init__(self
, *args
, **kwargs
):
5929 __init__(self, int id=0) -> PaletteChangedEvent
5931 An EVT_PALETTE_CHANGED event is sent when the system palette has
5932 changed, thereby giving each window a chance to redo their own to
5935 This event is implemented under Windows only.
5937 _core_
.PaletteChangedEvent_swiginit(self
,_core_
.new_PaletteChangedEvent(*args
, **kwargs
))
5938 def SetChangedWindow(*args
, **kwargs
):
5939 """SetChangedWindow(self, Window win)"""
5940 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
5942 def GetChangedWindow(*args
, **kwargs
):
5943 """GetChangedWindow(self) -> Window"""
5944 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
5946 PaletteChangedEvent_swigregister
= _core_
.PaletteChangedEvent_swigregister
5947 PaletteChangedEvent_swigregister(PaletteChangedEvent
)
5949 #---------------------------------------------------------------------------
5951 class QueryNewPaletteEvent(Event
):
5953 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5954 focus and should re-do its palette.
5956 This event is implemented under Windows only.
5958 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5959 __repr__
= _swig_repr
5960 def __init__(self
, *args
, **kwargs
):
5962 __init__(self, int winid=0) -> QueryNewPaletteEvent
5966 _core_
.QueryNewPaletteEvent_swiginit(self
,_core_
.new_QueryNewPaletteEvent(*args
, **kwargs
))
5967 def SetPaletteRealized(*args
, **kwargs
):
5969 SetPaletteRealized(self, bool realized)
5971 App should set this if it changes the palette.
5973 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
5975 def GetPaletteRealized(*args
, **kwargs
):
5976 """GetPaletteRealized(self) -> bool"""
5977 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
5979 QueryNewPaletteEvent_swigregister
= _core_
.QueryNewPaletteEvent_swigregister
5980 QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent
)
5982 #---------------------------------------------------------------------------
5984 class NavigationKeyEvent(Event
):
5986 EVT_NAVIGATION_KEY events are used to control moving the focus between
5987 widgets, otherwise known as tab-traversal. You woudl normally not
5988 catch navigation events in applications as there are already
5989 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5990 it useful to send navigation events in certain situations to change
5991 the focus in certain ways, although it's probably easier to just call
5992 `wx.Window.Navigate`.
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
):
5997 """__init__(self) -> NavigationKeyEvent"""
5998 _core_
.NavigationKeyEvent_swiginit(self
,_core_
.new_NavigationKeyEvent(*args
, **kwargs
))
5999 def GetDirection(*args
, **kwargs
):
6001 GetDirection(self) -> bool
6003 Returns ``True`` if the direction is forward, ``False`` otherwise.
6005 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
6007 def SetDirection(*args
, **kwargs
):
6009 SetDirection(self, bool forward)
6011 Specify the direction that the navigation should take. Usually the
6012 difference between using Tab and Shift-Tab.
6014 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
6016 def IsWindowChange(*args
, **kwargs
):
6018 IsWindowChange(self) -> bool
6020 Returns ``True`` if window change is allowed.
6022 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
6024 def SetWindowChange(*args
, **kwargs
):
6026 SetWindowChange(self, bool ischange)
6028 Specify if the navigation should be able to change parent windows.
6029 For example, changing notebook pages, etc. This is usually implemented
6030 by using Control-Tab.
6032 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
6034 def IsFromTab(*args
, **kwargs
):
6036 IsFromTab(self) -> bool
6038 Returns ``True`` if the navigation event is originated from the Tab
6041 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
6043 def SetFromTab(*args
, **kwargs
):
6045 SetFromTab(self, bool bIs)
6047 Set to true under MSW if the event was generated using the tab key.
6048 This is required for proper navogation over radio buttons.
6050 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
6052 def SetFlags(*args
, **kwargs
):
6054 SetFlags(self, long flags)
6056 Set the navigation flags to a combination of the following:
6058 * wx.NavigationKeyEvent.IsBackward
6059 * wx.NavigationKeyEvent.IsForward
6060 * wx.NavigationKeyEvent.WinChange
6061 * wx.NavigationKeyEvent.FromTab
6064 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6066 def GetCurrentFocus(*args
, **kwargs
):
6068 GetCurrentFocus(self) -> Window
6070 Returns the child window which currenty has the focus. May be
6073 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6075 def SetCurrentFocus(*args
, **kwargs
):
6077 SetCurrentFocus(self, Window win)
6079 Set the window that has the focus.
6081 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6083 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6084 IsForward
= _core_
.NavigationKeyEvent_IsForward
6085 WinChange
= _core_
.NavigationKeyEvent_WinChange
6086 FromTab
= _core_
.NavigationKeyEvent_FromTab
6087 NavigationKeyEvent_swigregister
= _core_
.NavigationKeyEvent_swigregister
6088 NavigationKeyEvent_swigregister(NavigationKeyEvent
)
6090 #---------------------------------------------------------------------------
6092 class WindowCreateEvent(CommandEvent
):
6094 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6095 underlying GUI object) exists.
6097 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6098 __repr__
= _swig_repr
6099 def __init__(self
, *args
, **kwargs
):
6101 __init__(self, Window win=None) -> WindowCreateEvent
6103 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6104 underlying GUI object) exists.
6106 _core_
.WindowCreateEvent_swiginit(self
,_core_
.new_WindowCreateEvent(*args
, **kwargs
))
6107 def GetWindow(*args
, **kwargs
):
6109 GetWindow(self) -> Window
6111 Returns the window that this event refers to.
6113 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6115 WindowCreateEvent_swigregister
= _core_
.WindowCreateEvent_swigregister
6116 WindowCreateEvent_swigregister(WindowCreateEvent
)
6118 class WindowDestroyEvent(CommandEvent
):
6120 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6121 when the GUI window is destroyed.
6123 When a class derived from `wx.Window` is destroyed its destructor will
6124 have already run by the time this event is sent. Therefore this event
6125 will not usually be received at all by the window itself. Since it is
6126 received after the destructor has run, an object should not try to
6127 handle its own wx.WindowDestroyEvent, but it can be used to get
6128 notification of the destruction of another window.
6130 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6131 __repr__
= _swig_repr
6132 def __init__(self
, *args
, **kwargs
):
6134 __init__(self, Window win=None) -> WindowDestroyEvent
6136 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6137 when the GUI window is destroyed.
6139 When a class derived from `wx.Window` is destroyed its destructor will
6140 have already run by the time this event is sent. Therefore this event
6141 will not usually be received at all by the window itself. Since it is
6142 received after the destructor has run, an object should not try to
6143 handle its own wx.WindowDestroyEvent, but it can be used to get
6144 notification of the destruction of another window.
6146 _core_
.WindowDestroyEvent_swiginit(self
,_core_
.new_WindowDestroyEvent(*args
, **kwargs
))
6147 def GetWindow(*args
, **kwargs
):
6149 GetWindow(self) -> Window
6151 Returns the window that this event refers to.
6153 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6155 WindowDestroyEvent_swigregister
= _core_
.WindowDestroyEvent_swigregister
6156 WindowDestroyEvent_swigregister(WindowDestroyEvent
)
6158 #---------------------------------------------------------------------------
6160 class ContextMenuEvent(CommandEvent
):
6162 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6163 give the application a chance to show a context (popup) menu.
6165 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6166 __repr__
= _swig_repr
6167 def __init__(self
, *args
, **kwargs
):
6169 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6173 _core_
.ContextMenuEvent_swiginit(self
,_core_
.new_ContextMenuEvent(*args
, **kwargs
))
6174 def GetPosition(*args
, **kwargs
):
6176 GetPosition(self) -> Point
6178 Returns the position (in screen coordinants) at which the menu should
6181 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6183 def SetPosition(*args
, **kwargs
):
6185 SetPosition(self, Point pos)
6187 Sets the position at which the menu should be shown.
6189 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6191 ContextMenuEvent_swigregister
= _core_
.ContextMenuEvent_swigregister
6192 ContextMenuEvent_swigregister(ContextMenuEvent
)
6194 #---------------------------------------------------------------------------
6196 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6197 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6198 class IdleEvent(Event
):
6200 This class is used for EVT_IDLE events, which are generated and sent
6201 when the application *becomes* idle. In other words, the when the
6202 event queue becomes empty then idle events are sent to all windows (by
6203 default) and as long as none of them call `RequestMore` then there are
6204 no more idle events until after the system event queue has some normal
6205 events and then becomes empty again.
6207 By default, idle events are sent to all windows. If this is causing a
6208 significant overhead in your application, you can call
6209 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6210 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6211 which should receive idle events. Then idle events will only be sent
6212 to those windows and not to any others.
6214 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6215 __repr__
= _swig_repr
6216 def __init__(self
, *args
, **kwargs
):
6218 __init__(self) -> IdleEvent
6222 _core_
.IdleEvent_swiginit(self
,_core_
.new_IdleEvent(*args
, **kwargs
))
6223 def RequestMore(*args
, **kwargs
):
6225 RequestMore(self, bool needMore=True)
6227 Tells wxWidgets that more processing is required. This function can be
6228 called by an EVT_IDLE handler for a window to indicate that the
6229 application should forward the EVT_IDLE event once more to the
6230 application windows. If no window calls this function during its
6231 EVT_IDLE handler, then the application will remain in a passive event
6232 loop until a new event is posted to the application by the windowing
6235 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6237 def MoreRequested(*args
, **kwargs
):
6239 MoreRequested(self) -> bool
6241 Returns ``True`` if the OnIdle function processing this event
6242 requested more processing time.
6244 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6246 def SetMode(*args
, **kwargs
):
6250 Static method for specifying how wxWidgets will send idle events: to
6251 all windows, or only to those which specify that they will process the
6254 The mode can be one of the following values:
6256 ========================= ========================================
6257 wx.IDLE_PROCESS_ALL Send idle events to all windows
6258 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6259 the wx.WS_EX_PROCESS_IDLE extra style
6261 ========================= ========================================
6264 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6266 SetMode
= staticmethod(SetMode
)
6267 def GetMode(*args
, **kwargs
):
6271 Static method returning a value specifying how wxWidgets will send
6272 idle events: to all windows, or only to those which specify that they
6273 will process the events.
6275 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6277 GetMode
= staticmethod(GetMode
)
6278 def CanSend(*args
, **kwargs
):
6280 CanSend(Window win) -> bool
6282 Returns ``True`` if it is appropriate to send idle events to this
6285 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6286 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6287 events should be sent to this window now. By default this will always
6288 return ``True`` because the update mode is initially
6289 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6290 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6292 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6294 CanSend
= staticmethod(CanSend
)
6295 IdleEvent_swigregister
= _core_
.IdleEvent_swigregister
6296 IdleEvent_swigregister(IdleEvent
)
6298 def IdleEvent_SetMode(*args
, **kwargs
):
6300 IdleEvent_SetMode(int mode)
6302 Static method for specifying how wxWidgets will send idle events: to
6303 all windows, or only to those which specify that they will process the
6306 The mode can be one of the following values:
6308 ========================= ========================================
6309 wx.IDLE_PROCESS_ALL Send idle events to all windows
6310 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6311 the wx.WS_EX_PROCESS_IDLE extra style
6313 ========================= ========================================
6316 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6318 def IdleEvent_GetMode(*args
):
6320 IdleEvent_GetMode() -> int
6322 Static method returning a value specifying how wxWidgets will send
6323 idle events: to all windows, or only to those which specify that they
6324 will process the events.
6326 return _core_
.IdleEvent_GetMode(*args
)
6328 def IdleEvent_CanSend(*args
, **kwargs
):
6330 IdleEvent_CanSend(Window win) -> bool
6332 Returns ``True`` if it is appropriate to send idle events to this
6335 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6336 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6337 events should be sent to this window now. By default this will always
6338 return ``True`` because the update mode is initially
6339 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6340 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6342 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6344 #---------------------------------------------------------------------------
6346 class PyEvent(Event
):
6348 wx.PyEvent can be used as a base class for implementing custom event
6349 types in Python. You should derived from this class instead of
6350 `wx.Event` because this class is Python-aware and is able to transport
6351 its Python bits safely through the wxWidgets event system and have
6352 them still be there when the event handler is invoked.
6354 :see: `wx.PyCommandEvent`
6357 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6358 __repr__
= _swig_repr
6359 def __init__(self
, *args
, **kwargs
):
6360 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
6361 _core_
.PyEvent_swiginit(self
,_core_
.new_PyEvent(*args
, **kwargs
))
6364 __swig_destroy__
= _core_
.delete_PyEvent
6365 __del__
= lambda self
: None;
6366 def _SetSelf(*args
, **kwargs
):
6367 """_SetSelf(self, PyObject self)"""
6368 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6370 def _GetSelf(*args
, **kwargs
):
6371 """_GetSelf(self) -> PyObject"""
6372 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6374 PyEvent_swigregister
= _core_
.PyEvent_swigregister
6375 PyEvent_swigregister(PyEvent
)
6377 class PyCommandEvent(CommandEvent
):
6379 wx.PyCommandEvent can be used as a base class for implementing custom
6380 event types in Python, where the event shoudl travel up to parent
6381 windows looking for a handler. You should derived from this class
6382 instead of `wx.CommandEvent` because this class is Python-aware and is
6383 able to transport its Python bits safely through the wxWidgets event
6384 system and have them still be there when the event handler is invoked.
6389 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6390 __repr__
= _swig_repr
6391 def __init__(self
, *args
, **kwargs
):
6392 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6393 _core_
.PyCommandEvent_swiginit(self
,_core_
.new_PyCommandEvent(*args
, **kwargs
))
6396 __swig_destroy__
= _core_
.delete_PyCommandEvent
6397 __del__
= lambda self
: None;
6398 def _SetSelf(*args
, **kwargs
):
6399 """_SetSelf(self, PyObject self)"""
6400 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6402 def _GetSelf(*args
, **kwargs
):
6403 """_GetSelf(self) -> PyObject"""
6404 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6406 PyCommandEvent_swigregister
= _core_
.PyCommandEvent_swigregister
6407 PyCommandEvent_swigregister(PyCommandEvent
)
6409 class DateEvent(CommandEvent
):
6411 This event class holds information about a date change event and is
6412 used together with `wx.DatePickerCtrl`. It also serves as a base class
6413 for `wx.calendar.CalendarEvent`. Bind these event types with
6416 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6417 __repr__
= _swig_repr
6418 def __init__(self
, *args
, **kwargs
):
6419 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6420 _core_
.DateEvent_swiginit(self
,_core_
.new_DateEvent(*args
, **kwargs
))
6421 def GetDate(*args
, **kwargs
):
6423 GetDate(self) -> DateTime
6427 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6429 def SetDate(*args
, **kwargs
):
6431 SetDate(self, DateTime date)
6433 Sets the date carried by the event, normally only used by the library
6436 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
6438 DateEvent_swigregister
= _core_
.DateEvent_swigregister
6439 DateEvent_swigregister(DateEvent
)
6441 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
6442 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
6444 #---------------------------------------------------------------------------
6446 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
6447 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
6448 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
6449 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
6450 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
6451 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
6452 class PyApp(EvtHandler
):
6454 The ``wx.PyApp`` class is an *implementation detail*, please use the
6455 `wx.App` class (or some other derived class) instead.
6457 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6458 __repr__
= _swig_repr
6459 def __init__(self
, *args
, **kwargs
):
6461 __init__(self) -> PyApp
6463 Create a new application object, starting the bootstrap process.
6465 _core_
.PyApp_swiginit(self
,_core_
.new_PyApp(*args
, **kwargs
))
6466 self
._setCallbackInfo
(self
, PyApp
, False)
6467 self
._setOORInfo
(self
, False)
6469 __swig_destroy__
= _core_
.delete_PyApp
6470 __del__
= lambda self
: None;
6471 def _setCallbackInfo(*args
, **kwargs
):
6472 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6473 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
6475 def GetAppName(*args
, **kwargs
):
6477 GetAppName(self) -> String
6479 Get the application name.
6481 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
6483 def SetAppName(*args
, **kwargs
):
6485 SetAppName(self, String name)
6487 Set the application name. This value may be used automatically by
6488 `wx.Config` and such.
6490 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
6492 def GetClassName(*args
, **kwargs
):
6494 GetClassName(self) -> String
6496 Get the application's class name.
6498 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
6500 def SetClassName(*args
, **kwargs
):
6502 SetClassName(self, String name)
6504 Set the application's class name. This value may be used for
6505 X-resources if applicable for the platform
6507 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
6509 def GetVendorName(*args
, **kwargs
):
6511 GetVendorName(self) -> String
6513 Get the application's vendor name.
6515 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
6517 def SetVendorName(*args
, **kwargs
):
6519 SetVendorName(self, String name)
6521 Set the application's vendor name. This value may be used
6522 automatically by `wx.Config` and such.
6524 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
6526 def GetTraits(*args
, **kwargs
):
6528 GetTraits(self) -> wxAppTraits
6530 Return (and create if necessary) the app traits object to which we
6531 delegate for everything which either should be configurable by the
6532 user (then he can change the default behaviour simply by overriding
6533 CreateTraits() and returning his own traits object) or which is
6534 GUI/console dependent as then wx.AppTraits allows us to abstract the
6535 differences behind the common facade.
6537 :todo: Add support for overriding CreateAppTraits in wxPython.
6539 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
6541 def ProcessPendingEvents(*args
, **kwargs
):
6543 ProcessPendingEvents(self)
6545 Process all events in the Pending Events list -- it is necessary to
6546 call this function to process posted events. This normally happens
6547 during each event loop iteration.
6549 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
6551 def Yield(*args
, **kwargs
):
6553 Yield(self, bool onlyIfNeeded=False) -> bool
6555 Process all currently pending events right now, instead of waiting
6556 until return to the event loop. It is an error to call ``Yield``
6557 recursively unless the value of ``onlyIfNeeded`` is True.
6559 :warning: This function is dangerous as it can lead to unexpected
6560 reentrancies (i.e. when called from an event handler it may
6561 result in calling the same event handler again), use with
6562 extreme care or, better, don't use at all!
6564 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6567 return _core_
.PyApp_Yield(*args
, **kwargs
)
6569 def WakeUpIdle(*args
, **kwargs
):
6573 Make sure that idle events are sent again.
6574 :see: `wx.WakeUpIdle`
6576 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
6578 def IsMainLoopRunning(*args
, **kwargs
):
6580 IsMainLoopRunning() -> bool
6582 Returns True if we're running the main loop, i.e. if the events can
6583 currently be dispatched.
6585 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
6587 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
6588 def MainLoop(*args
, **kwargs
):
6590 MainLoop(self) -> int
6592 Execute the main GUI loop, the function doesn't normally return until
6593 all top level windows have been closed and destroyed.
6595 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
6597 def Exit(*args
, **kwargs
):
6601 Exit the main loop thus terminating the application.
6604 return _core_
.PyApp_Exit(*args
, **kwargs
)
6606 def ExitMainLoop(*args
, **kwargs
):
6610 Exit the main GUI loop during the next iteration of the main
6611 loop, (i.e. it does not stop the program immediately!)
6613 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
6615 def Pending(*args
, **kwargs
):
6617 Pending(self) -> bool
6619 Returns True if there are unprocessed events in the event queue.
6621 return _core_
.PyApp_Pending(*args
, **kwargs
)
6623 def Dispatch(*args
, **kwargs
):
6625 Dispatch(self) -> bool
6627 Process the first event in the event queue (blocks until an event
6628 appears if there are none currently)
6630 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
6632 def ProcessIdle(*args
, **kwargs
):
6634 ProcessIdle(self) -> bool
6636 Called from the MainLoop when the application becomes idle (there are
6637 no pending events) and sends a `wx.IdleEvent` to all interested
6638 parties. Returns True if more idle events are needed, False if not.
6640 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
6642 def SendIdleEvents(*args
, **kwargs
):
6644 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6646 Send idle event to window and all subwindows. Returns True if more
6647 idle time is requested.
6649 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
6651 def IsActive(*args
, **kwargs
):
6653 IsActive(self) -> bool
6655 Return True if our app has focus.
6657 return _core_
.PyApp_IsActive(*args
, **kwargs
)
6659 def SetTopWindow(*args
, **kwargs
):
6661 SetTopWindow(self, Window win)
6663 Set the *main* top level window
6665 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
6667 def GetTopWindow(*args
, **kwargs
):
6669 GetTopWindow(self) -> Window
6671 Return the *main* top level window (if it hadn't been set previously
6672 with SetTopWindow(), will return just some top level window and, if
6673 there not any, will return None)
6675 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
6677 def SetExitOnFrameDelete(*args
, **kwargs
):
6679 SetExitOnFrameDelete(self, bool flag)
6681 Control the exit behaviour: by default, the program will exit the main
6682 loop (and so, usually, terminate) when the last top-level program
6683 window is deleted. Beware that if you disable this behaviour (with
6684 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6685 explicitly from somewhere.
6687 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
6689 def GetExitOnFrameDelete(*args
, **kwargs
):
6691 GetExitOnFrameDelete(self) -> bool
6693 Get the current exit behaviour setting.
6695 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
6697 def SetUseBestVisual(*args
, **kwargs
):
6699 SetUseBestVisual(self, bool flag)
6701 Set whether the app should try to use the best available visual on
6702 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6704 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
6706 def GetUseBestVisual(*args
, **kwargs
):
6708 GetUseBestVisual(self) -> bool
6710 Get current UseBestVisual setting.
6712 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
6714 def SetPrintMode(*args
, **kwargs
):
6715 """SetPrintMode(self, int mode)"""
6716 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
6718 def GetPrintMode(*args
, **kwargs
):
6719 """GetPrintMode(self) -> int"""
6720 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
6722 def SetAssertMode(*args
, **kwargs
):
6724 SetAssertMode(self, int mode)
6726 Set the OnAssert behaviour for debug and hybrid builds.
6728 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
6730 def GetAssertMode(*args
, **kwargs
):
6732 GetAssertMode(self) -> int
6734 Get the current OnAssert behaviour setting.
6736 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
6738 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6739 """GetMacSupportPCMenuShortcuts() -> bool"""
6740 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6742 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
6743 def GetMacAboutMenuItemId(*args
, **kwargs
):
6744 """GetMacAboutMenuItemId() -> long"""
6745 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
6747 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
6748 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
6749 """GetMacPreferencesMenuItemId() -> long"""
6750 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
6752 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
6753 def GetMacExitMenuItemId(*args
, **kwargs
):
6754 """GetMacExitMenuItemId() -> long"""
6755 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
6757 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
6758 def GetMacHelpMenuTitleName(*args
, **kwargs
):
6759 """GetMacHelpMenuTitleName() -> String"""
6760 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
6762 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
6763 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6764 """SetMacSupportPCMenuShortcuts(bool val)"""
6765 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6767 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
6768 def SetMacAboutMenuItemId(*args
, **kwargs
):
6769 """SetMacAboutMenuItemId(long val)"""
6770 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6772 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
6773 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
6774 """SetMacPreferencesMenuItemId(long val)"""
6775 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6777 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
6778 def SetMacExitMenuItemId(*args
, **kwargs
):
6779 """SetMacExitMenuItemId(long val)"""
6780 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6782 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
6783 def SetMacHelpMenuTitleName(*args
, **kwargs
):
6784 """SetMacHelpMenuTitleName(String val)"""
6785 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6787 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
6788 def _BootstrapApp(*args
, **kwargs
):
6792 For internal use only
6794 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
6796 def GetComCtl32Version(*args
, **kwargs
):
6798 GetComCtl32Version() -> int
6800 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6801 it wasn't found at all. Raises an exception on non-Windows platforms.
6803 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
6805 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
6806 PyApp_swigregister
= _core_
.PyApp_swigregister
6807 PyApp_swigregister(PyApp
)
6809 def PyApp_IsMainLoopRunning(*args
):
6811 PyApp_IsMainLoopRunning() -> bool
6813 Returns True if we're running the main loop, i.e. if the events can
6814 currently be dispatched.
6816 return _core_
.PyApp_IsMainLoopRunning(*args
)
6818 def PyApp_GetMacSupportPCMenuShortcuts(*args
):
6819 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6820 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
)
6822 def PyApp_GetMacAboutMenuItemId(*args
):
6823 """PyApp_GetMacAboutMenuItemId() -> long"""
6824 return _core_
.PyApp_GetMacAboutMenuItemId(*args
)
6826 def PyApp_GetMacPreferencesMenuItemId(*args
):
6827 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6828 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
)
6830 def PyApp_GetMacExitMenuItemId(*args
):
6831 """PyApp_GetMacExitMenuItemId() -> long"""
6832 return _core_
.PyApp_GetMacExitMenuItemId(*args
)
6834 def PyApp_GetMacHelpMenuTitleName(*args
):
6835 """PyApp_GetMacHelpMenuTitleName() -> String"""
6836 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
)
6838 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6839 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6840 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6842 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
6843 """PyApp_SetMacAboutMenuItemId(long val)"""
6844 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6846 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
6847 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6848 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6850 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
6851 """PyApp_SetMacExitMenuItemId(long val)"""
6852 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6854 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
6855 """PyApp_SetMacHelpMenuTitleName(String val)"""
6856 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6858 def PyApp_GetComCtl32Version(*args
):
6860 PyApp_GetComCtl32Version() -> int
6862 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6863 it wasn't found at all. Raises an exception on non-Windows platforms.
6865 return _core_
.PyApp_GetComCtl32Version(*args
)
6867 #---------------------------------------------------------------------------
6874 Force an exit of the application. Convenience for wx.GetApp().Exit()
6876 return _core_
.Exit(*args
)
6882 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6884 return _core_
.Yield(*args
)
6886 def YieldIfNeeded(*args
):
6888 YieldIfNeeded() -> bool
6890 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6892 return _core_
.YieldIfNeeded(*args
)
6894 def SafeYield(*args
, **kwargs
):
6896 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6898 This function is similar to `wx.Yield`, except that it disables the
6899 user input to all program windows before calling `wx.Yield` and
6900 re-enables it again afterwards. If ``win`` is not None, this window
6901 will remain enabled, allowing the implementation of some limited user
6904 :Returns: the result of the call to `wx.Yield`.
6906 return _core_
.SafeYield(*args
, **kwargs
)
6908 def WakeUpIdle(*args
):
6912 Cause the message queue to become empty again, so idle events will be
6915 return _core_
.WakeUpIdle(*args
)
6917 def PostEvent(*args
, **kwargs
):
6919 PostEvent(EvtHandler dest, Event event)
6921 Send an event to a window or other wx.EvtHandler to be processed
6924 return _core_
.PostEvent(*args
, **kwargs
)
6926 def App_CleanUp(*args
):
6930 For internal use only, it is used to cleanup after wxWidgets when
6933 return _core_
.App_CleanUp(*args
)
6939 Return a reference to the current wx.App object.
6941 return _core_
.GetApp(*args
)
6943 def SetDefaultPyEncoding(*args
, **kwargs
):
6945 SetDefaultPyEncoding(string encoding)
6947 Sets the encoding that wxPython will use when it needs to convert a
6948 Python string or unicode object to or from a wxString.
6950 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6951 but please be aware that the default encoding within the same locale
6952 may be slightly different on different platforms. For example, please
6953 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6954 between the common latin/roman encodings.
6956 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
6958 def GetDefaultPyEncoding(*args
):
6960 GetDefaultPyEncoding() -> string
6962 Gets the current encoding that wxPython will use when it needs to
6963 convert a Python string or unicode object to or from a wxString.
6965 return _core_
.GetDefaultPyEncoding(*args
)
6966 #----------------------------------------------------------------------
6968 class PyOnDemandOutputWindow
:
6970 A class that can be used for redirecting Python's stdout and
6971 stderr streams. It will do nothing until something is wrriten to
6972 the stream at which point it will create a Frame with a text area
6973 and write the text there.
6975 def __init__(self
, title
= "wxPython: stdout/stderr"):
6978 self
.pos
= wx
.DefaultPosition
6979 self
.size
= (450, 300)
6982 def SetParent(self
, parent
):
6983 """Set the window to be used as the popup Frame's parent."""
6984 self
.parent
= parent
6987 def CreateOutputWindow(self
, st
):
6988 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
6989 style
=wx
.DEFAULT_FRAME_STYLE
)
6990 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
6991 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
6992 self
.text
.AppendText(st
)
6993 self
.frame
.Show(True)
6994 EVT_CLOSE(self
.frame
, self
.OnCloseWindow
)
6997 def OnCloseWindow(self
, event
):
6998 if self
.frame
is not None:
6999 self
.frame
.Destroy()
7004 # These methods provide the file-like output behaviour.
7005 def write(self
, text
):
7007 Create the output window if needed and write the string to it.
7008 If not called in the context of the gui thread then uses
7009 CallAfter to do the work there.
7011 if self
.frame
is None:
7012 if not wx
.Thread_IsMain():
7013 wx
.CallAfter(self
.CreateOutputWindow
, text
)
7015 self
.CreateOutputWindow(text
)
7017 if not wx
.Thread_IsMain():
7018 wx
.CallAfter(self
.text
.AppendText
, text
)
7020 self
.text
.AppendText(text
)
7024 if self
.frame
is not None:
7025 wx
.CallAfter(self
.frame
.Close
)
7033 #----------------------------------------------------------------------
7035 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
7037 class App(wx
.PyApp
):
7039 The ``wx.App`` class represents the application and is used to:
7041 * bootstrap the wxPython system and initialize the underlying
7043 * set and get application-wide properties
7044 * implement the windowing system main message or event loop,
7045 and to dispatch events to window instances
7048 Every application must have a ``wx.App`` instance, and all
7049 creation of UI objects should be delayed until after the
7050 ``wx.App`` object has been created in order to ensure that the gui
7051 platform and wxWidgets have been fully initialized.
7053 Normally you would derive from this class and implement an
7054 ``OnInit`` method that creates a frame and then calls
7055 ``self.SetTopWindow(frame)``.
7057 :see: `wx.PySimpleApp` for a simpler app class that can be used
7061 outputWindowClass
= PyOnDemandOutputWindow
7063 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7064 useBestVisual
=False, clearSigInt
=True):
7066 Construct a ``wx.App`` object.
7068 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7069 redirected? Defaults to True on Windows and Mac, False
7070 otherwise. If `filename` is None then output will be
7071 redirected to a window that pops up as needed. (You can
7072 control what kind of window is created for the output by
7073 resetting the class variable ``outputWindowClass`` to a
7074 class of your choosing.)
7076 :param filename: The name of a file to redirect output to, if
7079 :param useBestVisual: Should the app try to use the best
7080 available visual provided by the system (only relevant on
7081 systems that have more than one visual.) This parameter
7082 must be used instead of calling `SetUseBestVisual` later
7083 on because it must be set before the underlying GUI
7084 toolkit is initialized.
7086 :param clearSigInt: Should SIGINT be cleared? This allows the
7087 app to terminate upon a Ctrl-C in the console like other
7090 :note: You should override OnInit to do applicaition
7091 initialization to ensure that the system, toolkit and
7092 wxWidgets are fully initialized.
7094 wx
.PyApp
.__init
__(self
)
7096 if wx
.Platform
== "__WXMAC__":
7099 if not MacOS
.WMAvailable():
7101 This program needs access to the screen. Please run with 'pythonw',
7102 not 'python', and only when you are logged in on the main display of
7110 # This has to be done before OnInit
7111 self
.SetUseBestVisual(useBestVisual
)
7113 # Set the default handler for SIGINT. This fixes a problem
7114 # where if Ctrl-C is pressed in the console that started this
7115 # app then it will not appear to do anything, (not even send
7116 # KeyboardInterrupt???) but will later segfault on exit. By
7117 # setting the default handler then the app will exit, as
7118 # expected (depending on platform.)
7122 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7126 # Save and redirect the stdio to a window?
7127 self
.stdioWin
= None
7128 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7130 self
.RedirectStdio(filename
)
7132 # Use Python's install prefix as the default
7133 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7135 # This finishes the initialization of wxWindows and then calls
7136 # the OnInit that should be present in the derived class
7137 self
._BootstrapApp
()
7140 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7141 self
.RestoreStdio() # Just in case the MainLoop was overridden
7145 wx
.PyApp
.Destroy(self
)
7148 def SetTopWindow(self
, frame
):
7149 """Set the \"main\" top level window"""
7151 self
.stdioWin
.SetParent(frame
)
7152 wx
.PyApp
.SetTopWindow(self
, frame
)
7156 """Execute the main GUI event loop"""
7157 wx
.PyApp
.MainLoop(self
)
7161 def RedirectStdio(self
, filename
=None):
7162 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7164 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7166 self
.stdioWin
= self
.outputWindowClass()
7167 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7170 def RestoreStdio(self
):
7172 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7177 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7179 Set the title, position and/or size of the output window if
7180 the stdio has been redirected. This should be called before
7181 any output would cause the output window to be created.
7184 if title
is not None:
7185 self
.stdioWin
.title
= title
7187 self
.stdioWin
.pos
= pos
7188 if size
is not None:
7189 self
.stdioWin
.size
= size
7194 # change from wx.PyApp_XX to wx.App_XX
7195 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7196 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7197 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7198 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7199 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7200 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7201 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7202 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7203 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7204 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7205 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7207 #----------------------------------------------------------------------------
7209 class PySimpleApp(wx
.App
):
7211 A simple application class. You can just create one of these and
7212 then then make your top level windows later, and not have to worry
7213 about OnInit. For example::
7215 app = wx.PySimpleApp()
7216 frame = wx.Frame(None, title='Hello World')
7223 def __init__(self
, redirect
=False, filename
=None,
7224 useBestVisual
=False, clearSigInt
=True):
7226 :see: `wx.App.__init__`
7228 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7235 # Is anybody using this one?
7236 class PyWidgetTester(wx
.App
):
7237 def __init__(self
, size
= (250, 100)):
7239 wx
.App
.__init
__(self
, 0)
7242 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7243 self
.SetTopWindow(self
.frame
)
7246 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7247 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7248 self
.frame
.Show(True)
7250 #----------------------------------------------------------------------------
7251 # DO NOT hold any other references to this object. This is how we
7252 # know when to cleanup system resources that wxWidgets is holding. When
7253 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7254 # goes to zero and it calls the wx.App_CleanUp function.
7256 class __wxPyCleanup
:
7258 self
.cleanup
= _core_
.App_CleanUp
7262 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7264 ## # another possible solution, but it gets called too early...
7266 ## atexit.register(_core_.wxApp_CleanUp)
7269 #----------------------------------------------------------------------------
7271 #---------------------------------------------------------------------------
7273 class EventLoop(object):
7274 """Proxy of C++ EventLoop class"""
7275 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7276 __repr__
= _swig_repr
7277 def __init__(self
, *args
, **kwargs
):
7278 """__init__(self) -> EventLoop"""
7279 _core_
.EventLoop_swiginit(self
,_core_
.new_EventLoop(*args
, **kwargs
))
7280 __swig_destroy__
= _core_
.delete_EventLoop
7281 __del__
= lambda self
: None;
7282 def Run(*args
, **kwargs
):
7283 """Run(self) -> int"""
7284 return _core_
.EventLoop_Run(*args
, **kwargs
)
7286 def Exit(*args
, **kwargs
):
7287 """Exit(self, int rc=0)"""
7288 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7290 def Pending(*args
, **kwargs
):
7291 """Pending(self) -> bool"""
7292 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7294 def Dispatch(*args
, **kwargs
):
7295 """Dispatch(self) -> bool"""
7296 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7298 def IsRunning(*args
, **kwargs
):
7299 """IsRunning(self) -> bool"""
7300 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7302 def GetActive(*args
, **kwargs
):
7303 """GetActive() -> EventLoop"""
7304 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7306 GetActive
= staticmethod(GetActive
)
7307 def SetActive(*args
, **kwargs
):
7308 """SetActive(EventLoop loop)"""
7309 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7311 SetActive
= staticmethod(SetActive
)
7312 EventLoop_swigregister
= _core_
.EventLoop_swigregister
7313 EventLoop_swigregister(EventLoop
)
7315 def EventLoop_GetActive(*args
):
7316 """EventLoop_GetActive() -> EventLoop"""
7317 return _core_
.EventLoop_GetActive(*args
)
7319 def EventLoop_SetActive(*args
, **kwargs
):
7320 """EventLoop_SetActive(EventLoop loop)"""
7321 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7323 class EventLoopActivator(object):
7324 """Proxy of C++ EventLoopActivator class"""
7325 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7326 __repr__
= _swig_repr
7327 def __init__(self
, *args
, **kwargs
):
7328 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7329 _core_
.EventLoopActivator_swiginit(self
,_core_
.new_EventLoopActivator(*args
, **kwargs
))
7330 __swig_destroy__
= _core_
.delete_EventLoopActivator
7331 __del__
= lambda self
: None;
7332 EventLoopActivator_swigregister
= _core_
.EventLoopActivator_swigregister
7333 EventLoopActivator_swigregister(EventLoopActivator
)
7335 #---------------------------------------------------------------------------
7337 class AcceleratorEntry(object):
7339 A class used to define items in an `wx.AcceleratorTable`. wxPython
7340 programs can choose to use wx.AcceleratorEntry objects, but using a
7341 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7342 as well. See `__init__` for of the tuple values.
7344 :see: `wx.AcceleratorTable`
7346 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7347 __repr__
= _swig_repr
7348 def __init__(self
, *args
, **kwargs
):
7350 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7352 Construct a wx.AcceleratorEntry.
7354 _core_
.AcceleratorEntry_swiginit(self
,_core_
.new_AcceleratorEntry(*args
, **kwargs
))
7355 __swig_destroy__
= _core_
.delete_AcceleratorEntry
7356 __del__
= lambda self
: None;
7357 def Set(*args
, **kwargs
):
7359 Set(self, int flags, int keyCode, int cmd)
7361 (Re)set the attributes of a wx.AcceleratorEntry.
7364 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
7366 def GetFlags(*args
, **kwargs
):
7368 GetFlags(self) -> int
7370 Get the AcceleratorEntry's flags.
7372 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
7374 def GetKeyCode(*args
, **kwargs
):
7376 GetKeyCode(self) -> int
7378 Get the AcceleratorEntry's keycode.
7380 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
7382 def GetCommand(*args
, **kwargs
):
7384 GetCommand(self) -> int
7386 Get the AcceleratorEntry's command ID.
7388 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
7390 AcceleratorEntry_swigregister
= _core_
.AcceleratorEntry_swigregister
7391 AcceleratorEntry_swigregister(AcceleratorEntry
)
7393 class AcceleratorTable(Object
):
7395 An accelerator table allows the application to specify a table of
7396 keyboard shortcuts for menus or other commands. On Windows, menu or
7397 button commands are supported; on GTK, only menu commands are
7400 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7401 __repr__
= _swig_repr
7402 def __init__(self
, *args
, **kwargs
):
7404 __init__(entries) -> AcceleratorTable
7406 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7407 items or or of 3-tuples (flags, keyCode, cmdID)
7409 :see: `wx.AcceleratorEntry`
7411 _core_
.AcceleratorTable_swiginit(self
,_core_
.new_AcceleratorTable(*args
, **kwargs
))
7412 __swig_destroy__
= _core_
.delete_AcceleratorTable
7413 __del__
= lambda self
: None;
7414 def Ok(*args
, **kwargs
):
7415 """Ok(self) -> bool"""
7416 return _core_
.AcceleratorTable_Ok(*args
, **kwargs
)
7418 AcceleratorTable_swigregister
= _core_
.AcceleratorTable_swigregister
7419 AcceleratorTable_swigregister(AcceleratorTable
)
7422 def GetAccelFromString(*args
, **kwargs
):
7423 """GetAccelFromString(String label) -> AcceleratorEntry"""
7424 return _core_
.GetAccelFromString(*args
, **kwargs
)
7425 #---------------------------------------------------------------------------
7427 class VisualAttributes(object):
7428 """struct containing all the visual attributes of a control"""
7429 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7430 __repr__
= _swig_repr
7431 def __init__(self
, *args
, **kwargs
):
7433 __init__(self) -> VisualAttributes
7435 struct containing all the visual attributes of a control
7437 _core_
.VisualAttributes_swiginit(self
,_core_
.new_VisualAttributes(*args
, **kwargs
))
7438 __swig_destroy__
= _core_
.delete_VisualAttributes
7439 __del__
= lambda self
: None;
7440 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
7441 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
7442 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
7443 VisualAttributes_swigregister
= _core_
.VisualAttributes_swigregister
7444 VisualAttributes_swigregister(VisualAttributes
)
7445 NullAcceleratorTable
= cvar
.NullAcceleratorTable
7446 PanelNameStr
= cvar
.PanelNameStr
7448 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
7449 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
7450 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
7451 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
7452 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
7453 class Window(EvtHandler
):
7455 wx.Window is the base class for all windows and represents any visible
7456 object on the screen. All controls, top level windows and so on are
7457 wx.Windows. Sizers and device contexts are not however, as they don't
7458 appear on screen themselves.
7461 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7462 __repr__
= _swig_repr
7463 def __init__(self
, *args
, **kwargs
):
7465 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7466 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7468 Construct and show a generic Window.
7470 _core_
.Window_swiginit(self
,_core_
.new_Window(*args
, **kwargs
))
7471 self
._setOORInfo
(self
)
7473 def Create(*args
, **kwargs
):
7475 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7476 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7478 Create the GUI part of the Window for 2-phase creation mode.
7480 return _core_
.Window_Create(*args
, **kwargs
)
7482 def Close(*args
, **kwargs
):
7484 Close(self, bool force=False) -> bool
7486 This function simply generates a EVT_CLOSE event whose handler usually
7487 tries to close the window. It doesn't close the window itself,
7488 however. If force is False (the default) then the window's close
7489 handler will be allowed to veto the destruction of the window.
7491 return _core_
.Window_Close(*args
, **kwargs
)
7493 def Destroy(*args
, **kwargs
):
7495 Destroy(self) -> bool
7497 Destroys the window safely. Frames and dialogs are not destroyed
7498 immediately when this function is called -- they are added to a list
7499 of windows to be deleted on idle time, when all the window's events
7500 have been processed. This prevents problems with events being sent to
7501 non-existent windows.
7503 Returns True if the window has either been successfully deleted, or it
7504 has been added to the list of windows pending real deletion.
7506 val
= _core_
.Window_Destroy(*args
, **kwargs
)
7510 def DestroyChildren(*args
, **kwargs
):
7512 DestroyChildren(self) -> bool
7514 Destroys all children of a window. Called automatically by the
7517 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
7519 def IsBeingDeleted(*args
, **kwargs
):
7521 IsBeingDeleted(self) -> bool
7523 Is the window in the process of being deleted?
7525 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
7527 def SetLabel(*args
, **kwargs
):
7529 SetLabel(self, String label)
7531 Set the text which the window shows in its label if applicable.
7533 return _core_
.Window_SetLabel(*args
, **kwargs
)
7535 def GetLabel(*args
, **kwargs
):
7537 GetLabel(self) -> String
7539 Generic way of getting a label from any window, for identification
7540 purposes. The interpretation of this function differs from class to
7541 class. For frames and dialogs, the value returned is the title. For
7542 buttons or static text controls, it is the button text. This function
7543 can be useful for meta-programs such as testing tools or special-needs
7544 access programs)which need to identify windows by name.
7546 return _core_
.Window_GetLabel(*args
, **kwargs
)
7548 def SetName(*args
, **kwargs
):
7550 SetName(self, String name)
7552 Sets the window's name. The window name is used for ressource setting
7553 in X, it is not the same as the window title/label
7555 return _core_
.Window_SetName(*args
, **kwargs
)
7557 def GetName(*args
, **kwargs
):
7559 GetName(self) -> String
7561 Returns the windows name. This name is not guaranteed to be unique;
7562 it is up to the programmer to supply an appropriate name in the window
7563 constructor or via wx.Window.SetName.
7565 return _core_
.Window_GetName(*args
, **kwargs
)
7567 def SetWindowVariant(*args
, **kwargs
):
7569 SetWindowVariant(self, int variant)
7571 Sets the variant of the window/font size to use for this window, if
7572 the platform supports variants, for example, wxMac.
7574 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
7576 def GetWindowVariant(*args
, **kwargs
):
7577 """GetWindowVariant(self) -> int"""
7578 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
7580 def SetId(*args
, **kwargs
):
7582 SetId(self, int winid)
7584 Sets the identifier of the window. Each window has an integer
7585 identifier. If the application has not provided one, an identifier
7586 will be generated. Normally, the identifier should be provided on
7587 creation and should not be modified subsequently.
7589 return _core_
.Window_SetId(*args
, **kwargs
)
7591 def GetId(*args
, **kwargs
):
7595 Returns the identifier of the window. Each window has an integer
7596 identifier. If the application has not provided one (or the default Id
7597 -1 is used) then an unique identifier with a negative value will be
7600 return _core_
.Window_GetId(*args
, **kwargs
)
7602 def NewControlId(*args
, **kwargs
):
7604 NewControlId() -> int
7606 Generate a control id for the controls which were not given one.
7608 return _core_
.Window_NewControlId(*args
, **kwargs
)
7610 NewControlId
= staticmethod(NewControlId
)
7611 def NextControlId(*args
, **kwargs
):
7613 NextControlId(int winid) -> int
7615 Get the id of the control following the one with the given
7618 return _core_
.Window_NextControlId(*args
, **kwargs
)
7620 NextControlId
= staticmethod(NextControlId
)
7621 def PrevControlId(*args
, **kwargs
):
7623 PrevControlId(int winid) -> int
7625 Get the id of the control preceding the one with the given
7628 return _core_
.Window_PrevControlId(*args
, **kwargs
)
7630 PrevControlId
= staticmethod(PrevControlId
)
7631 def SetSize(*args
, **kwargs
):
7633 SetSize(self, Size size)
7635 Sets the size of the window in pixels.
7637 return _core_
.Window_SetSize(*args
, **kwargs
)
7639 def SetDimensions(*args
, **kwargs
):
7641 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7643 Sets the position and size of the window in pixels. The sizeFlags
7644 parameter indicates the interpretation of the other params if they are
7647 ======================== ======================================
7648 wx.SIZE_AUTO A -1 indicates that a class-specific
7649 default should be used.
7650 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7651 -1 values are supplied.
7652 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7653 interpreted as real dimensions, not
7655 ======================== ======================================
7658 return _core_
.Window_SetDimensions(*args
, **kwargs
)
7660 def SetRect(*args
, **kwargs
):
7662 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7664 Sets the position and size of the window in pixels using a wx.Rect.
7666 return _core_
.Window_SetRect(*args
, **kwargs
)
7668 def SetSizeWH(*args
, **kwargs
):
7670 SetSizeWH(self, int width, int height)
7672 Sets the size of the window in pixels.
7674 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
7676 def Move(*args
, **kwargs
):
7678 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7680 Moves the window to the given position.
7682 return _core_
.Window_Move(*args
, **kwargs
)
7685 def MoveXY(*args
, **kwargs
):
7687 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7689 Moves the window to the given position.
7691 return _core_
.Window_MoveXY(*args
, **kwargs
)
7693 def SetBestFittingSize(*args
, **kwargs
):
7695 SetBestFittingSize(self, Size size=DefaultSize)
7697 A 'Smart' SetSize that will fill in default size components with the
7698 window's *best size* values. Also set's the minsize for use with sizers.
7700 return _core_
.Window_SetBestFittingSize(*args
, **kwargs
)
7702 def Raise(*args
, **kwargs
):
7706 Raises the window to the top of the window hierarchy. In current
7707 version of wxWidgets this works both for manage and child windows.
7709 return _core_
.Window_Raise(*args
, **kwargs
)
7711 def Lower(*args
, **kwargs
):
7715 Lowers the window to the bottom of the window hierarchy. In current
7716 version of wxWidgets this works both for manage and child windows.
7718 return _core_
.Window_Lower(*args
, **kwargs
)
7720 def SetClientSize(*args
, **kwargs
):
7722 SetClientSize(self, Size size)
7724 This sets the size of the window client area in pixels. Using this
7725 function to size a window tends to be more device-independent than
7726 wx.Window.SetSize, since the application need not worry about what
7727 dimensions the border or title bar have when trying to fit the window
7728 around panel items, for example.
7730 return _core_
.Window_SetClientSize(*args
, **kwargs
)
7732 def SetClientSizeWH(*args
, **kwargs
):
7734 SetClientSizeWH(self, int width, int height)
7736 This sets the size of the window client area in pixels. Using this
7737 function to size a window tends to be more device-independent than
7738 wx.Window.SetSize, since the application need not worry about what
7739 dimensions the border or title bar have when trying to fit the window
7740 around panel items, for example.
7742 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
7744 def SetClientRect(*args
, **kwargs
):
7746 SetClientRect(self, Rect rect)
7748 This sets the size of the window client area in pixels. Using this
7749 function to size a window tends to be more device-independent than
7750 wx.Window.SetSize, since the application need not worry about what
7751 dimensions the border or title bar have when trying to fit the window
7752 around panel items, for example.
7754 return _core_
.Window_SetClientRect(*args
, **kwargs
)
7756 def GetPosition(*args
, **kwargs
):
7758 GetPosition(self) -> Point
7760 Get the window's position. Notice that the position is in client
7761 coordinates for child windows and screen coordinates for the top level
7762 ones, use `GetScreenPosition` if you need screen coordinates for all
7765 return _core_
.Window_GetPosition(*args
, **kwargs
)
7767 def GetPositionTuple(*args
, **kwargs
):
7769 GetPositionTuple() -> (x,y)
7771 Get the window's position. Notice that the position is in client
7772 coordinates for child windows and screen coordinates for the top level
7773 ones, use `GetScreenPosition` if you need screen coordinates for all
7776 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
7778 def GetScreenPosition(*args
, **kwargs
):
7780 GetScreenPosition(self) -> Point
7782 Get the position of the window in screen coordinantes.
7784 return _core_
.Window_GetScreenPosition(*args
, **kwargs
)
7786 def GetScreenPositionTuple(*args
, **kwargs
):
7788 GetScreenPositionTuple() -> (x,y)
7790 Get the position of the window in screen coordinantes.
7792 return _core_
.Window_GetScreenPositionTuple(*args
, **kwargs
)
7794 def GetScreenRect(*args
, **kwargs
):
7796 GetScreenRect(self) -> Rect
7798 Returns the size and position of the window in screen coordinantes as
7801 return _core_
.Window_GetScreenRect(*args
, **kwargs
)
7803 def GetSize(*args
, **kwargs
):
7805 GetSize(self) -> Size
7807 Get the window size.
7809 return _core_
.Window_GetSize(*args
, **kwargs
)
7811 def GetSizeTuple(*args
, **kwargs
):
7813 GetSizeTuple() -> (width, height)
7815 Get the window size.
7817 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
7819 def GetRect(*args
, **kwargs
):
7821 GetRect(self) -> Rect
7823 Returns the size and position of the window as a `wx.Rect` object.
7825 return _core_
.Window_GetRect(*args
, **kwargs
)
7827 def GetClientSize(*args
, **kwargs
):
7829 GetClientSize(self) -> Size
7831 This gets the size of the window's 'client area' in pixels. The client
7832 area is the area which may be drawn on by the programmer, excluding
7833 title bar, border, scrollbars, etc.
7835 return _core_
.Window_GetClientSize(*args
, **kwargs
)
7837 def GetClientSizeTuple(*args
, **kwargs
):
7839 GetClientSizeTuple() -> (width, height)
7841 This gets the size of the window's 'client area' in pixels. The client
7842 area is the area which may be drawn on by the programmer, excluding
7843 title bar, border, scrollbars, etc.
7845 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
7847 def GetClientAreaOrigin(*args
, **kwargs
):
7849 GetClientAreaOrigin(self) -> Point
7851 Get the origin of the client area of the window relative to the
7852 window's top left corner (the client area may be shifted because of
7853 the borders, scrollbars, other decorations...)
7855 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
7857 def GetClientRect(*args
, **kwargs
):
7859 GetClientRect(self) -> Rect
7861 Get the client area position and size as a `wx.Rect` object.
7863 return _core_
.Window_GetClientRect(*args
, **kwargs
)
7865 def GetBestSize(*args
, **kwargs
):
7867 GetBestSize(self) -> Size
7869 This function returns the best acceptable minimal size for the
7870 window, if applicable. For example, for a static text control, it will
7871 be the minimal size such that the control label is not truncated. For
7872 windows containing subwindows (suzh aswx.Panel), the size returned by
7873 this function will be the same as the size the window would have had
7876 return _core_
.Window_GetBestSize(*args
, **kwargs
)
7878 def GetBestSizeTuple(*args
, **kwargs
):
7880 GetBestSizeTuple() -> (width, height)
7882 This function returns the best acceptable minimal size for the
7883 window, if applicable. For example, for a static text control, it will
7884 be the minimal size such that the control label is not truncated. For
7885 windows containing subwindows (suzh aswx.Panel), the size returned by
7886 this function will be the same as the size the window would have had
7889 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
7891 def InvalidateBestSize(*args
, **kwargs
):
7893 InvalidateBestSize(self)
7895 Reset the cached best size value so it will be recalculated the next
7898 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
7900 def CacheBestSize(*args
, **kwargs
):
7902 CacheBestSize(self, Size size)
7904 Cache the best size so it doesn't need to be calculated again, (at least until
7905 some properties of the window change.)
7907 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
7909 def GetBestFittingSize(*args
, **kwargs
):
7911 GetBestFittingSize(self) -> Size
7913 This function will merge the window's best size into the window's
7914 minimum size, giving priority to the min size components, and returns
7918 return _core_
.Window_GetBestFittingSize(*args
, **kwargs
)
7920 def GetAdjustedBestSize(*args
, **kwargs
):
7922 GetAdjustedBestSize(self) -> Size
7924 This method is similar to GetBestSize, except in one
7925 thing. GetBestSize should return the minimum untruncated size of the
7926 window, while this method will return the largest of BestSize and any
7927 user specified minimum size. ie. it is the minimum size the window
7928 should currently be drawn at, not the minimal size it can possibly
7931 return _core_
.Window_GetAdjustedBestSize(*args
, **kwargs
)
7933 def Center(*args
, **kwargs
):
7935 Center(self, int direction=BOTH)
7937 Centers the window. The parameter specifies the direction for
7938 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7939 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7940 on the entire screen and not on its parent window. If it is a
7941 top-level window and has no parent then it will always be centered
7942 relative to the screen.
7944 return _core_
.Window_Center(*args
, **kwargs
)
7947 def CenterOnParent(*args
, **kwargs
):
7949 CenterOnParent(self, int dir=BOTH)
7951 Center with respect to the the parent window
7953 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
7955 CentreOnParent
= CenterOnParent
7956 def Fit(*args
, **kwargs
):
7960 Sizes the window so that it fits around its subwindows. This function
7961 won't do anything if there are no subwindows and will only really work
7962 correctly if sizers are used for the subwindows layout. Also, if the
7963 window has exactly one subwindow it is better (faster and the result
7964 is more precise as Fit adds some margin to account for fuzziness of
7965 its calculations) to call window.SetClientSize(child.GetSize())
7966 instead of calling Fit.
7968 return _core_
.Window_Fit(*args
, **kwargs
)
7970 def FitInside(*args
, **kwargs
):
7974 Similar to Fit, but sizes the interior (virtual) size of a
7975 window. Mainly useful with scrolled windows to reset scrollbars after
7976 sizing changes that do not trigger a size event, and/or scrolled
7977 windows without an interior sizer. This function similarly won't do
7978 anything if there are no subwindows.
7980 return _core_
.Window_FitInside(*args
, **kwargs
)
7982 def SetSizeHints(*args
, **kwargs
):
7984 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7987 Allows specification of minimum and maximum window sizes, and window
7988 size increments. If a pair of values is not set (or set to -1), the
7989 default values will be used. If this function is called, the user
7990 will not be able to size the window outside the given bounds (if it is
7991 a top-level window.) Sizers will also inspect the minimum window size
7992 and will use that value if set when calculating layout.
7994 The resizing increments are only significant under Motif or Xt.
7996 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
7998 def SetSizeHintsSz(*args
, **kwargs
):
8000 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8002 Allows specification of minimum and maximum window sizes, and window
8003 size increments. If a pair of values is not set (or set to -1), the
8004 default values will be used. If this function is called, the user
8005 will not be able to size the window outside the given bounds (if it is
8006 a top-level window.) Sizers will also inspect the minimum window size
8007 and will use that value if set when calculating layout.
8009 The resizing increments are only significant under Motif or Xt.
8011 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
8013 def SetVirtualSizeHints(*args
, **kwargs
):
8015 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8017 Allows specification of minimum and maximum virtual window sizes. If a
8018 pair of values is not set (or set to -1), the default values will be
8019 used. If this function is called, the user will not be able to size
8020 the virtual area of the window outside the given bounds.
8022 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
8024 def SetVirtualSizeHintsSz(*args
, **kwargs
):
8026 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8028 Allows specification of minimum and maximum virtual window sizes. If a
8029 pair of values is not set (or set to -1), the default values will be
8030 used. If this function is called, the user will not be able to size
8031 the virtual area of the window outside the given bounds.
8033 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
8035 def GetMaxSize(*args
, **kwargs
):
8036 """GetMaxSize(self) -> Size"""
8037 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8039 def GetMinSize(*args
, **kwargs
):
8040 """GetMinSize(self) -> Size"""
8041 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8043 def SetMinSize(*args
, **kwargs
):
8045 SetMinSize(self, Size minSize)
8047 A more convenient method than `SetSizeHints` for setting just the
8050 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8052 def SetMaxSize(*args
, **kwargs
):
8054 SetMaxSize(self, Size maxSize)
8056 A more convenient method than `SetSizeHints` for setting just the
8059 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8061 def GetMinWidth(*args
, **kwargs
):
8062 """GetMinWidth(self) -> int"""
8063 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8065 def GetMinHeight(*args
, **kwargs
):
8066 """GetMinHeight(self) -> int"""
8067 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8069 def GetMaxWidth(*args
, **kwargs
):
8070 """GetMaxWidth(self) -> int"""
8071 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8073 def GetMaxHeight(*args
, **kwargs
):
8074 """GetMaxHeight(self) -> int"""
8075 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8077 def SetVirtualSize(*args
, **kwargs
):
8079 SetVirtualSize(self, Size size)
8081 Set the the virtual size of a window in pixels. For most windows this
8082 is just the client area of the window, but for some like scrolled
8083 windows it is more or less independent of the screen window size.
8085 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8087 def SetVirtualSizeWH(*args
, **kwargs
):
8089 SetVirtualSizeWH(self, int w, int h)
8091 Set the the virtual size of a window in pixels. For most windows this
8092 is just the client area of the window, but for some like scrolled
8093 windows it is more or less independent of the screen window size.
8095 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8097 def GetVirtualSize(*args
, **kwargs
):
8099 GetVirtualSize(self) -> Size
8101 Get the the virtual size of the window in pixels. For most windows
8102 this is just the client area of the window, but for some like scrolled
8103 windows it is more or less independent of the screen window size.
8105 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8107 def GetVirtualSizeTuple(*args
, **kwargs
):
8109 GetVirtualSizeTuple() -> (width, height)
8111 Get the the virtual size of the window in pixels. For most windows
8112 this is just the client area of the window, but for some like scrolled
8113 windows it is more or less independent of the screen window size.
8115 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8117 def GetBestVirtualSize(*args
, **kwargs
):
8119 GetBestVirtualSize(self) -> Size
8121 Return the largest of ClientSize and BestSize (as determined by a
8122 sizer, interior children, or other means)
8124 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8126 def Show(*args
, **kwargs
):
8128 Show(self, bool show=True) -> bool
8130 Shows or hides the window. You may need to call Raise for a top level
8131 window if you want to bring it to top, although this is not needed if
8132 Show is called immediately after the frame creation. Returns True if
8133 the window has been shown or hidden or False if nothing was done
8134 because it already was in the requested state.
8136 return _core_
.Window_Show(*args
, **kwargs
)
8138 def Hide(*args
, **kwargs
):
8142 Equivalent to calling Show(False).
8144 return _core_
.Window_Hide(*args
, **kwargs
)
8146 def Enable(*args
, **kwargs
):
8148 Enable(self, bool enable=True) -> bool
8150 Enable or disable the window for user input. Note that when a parent
8151 window is disabled, all of its children are disabled as well and they
8152 are reenabled again when the parent is. Returns true if the window
8153 has been enabled or disabled, false if nothing was done, i.e. if the
8154 window had already been in the specified state.
8156 return _core_
.Window_Enable(*args
, **kwargs
)
8158 def Disable(*args
, **kwargs
):
8160 Disable(self) -> bool
8162 Disables the window, same as Enable(false).
8164 return _core_
.Window_Disable(*args
, **kwargs
)
8166 def IsShown(*args
, **kwargs
):
8168 IsShown(self) -> bool
8170 Returns true if the window is shown, false if it has been hidden.
8172 return _core_
.Window_IsShown(*args
, **kwargs
)
8174 def IsEnabled(*args
, **kwargs
):
8176 IsEnabled(self) -> bool
8178 Returns true if the window is enabled for input, false otherwise.
8180 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8182 def SetWindowStyleFlag(*args
, **kwargs
):
8184 SetWindowStyleFlag(self, long style)
8186 Sets the style of the window. Please note that some styles cannot be
8187 changed after the window creation and that Refresh() might need to be
8188 called after changing the others for the change to take place
8191 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8193 def GetWindowStyleFlag(*args
, **kwargs
):
8195 GetWindowStyleFlag(self) -> long
8197 Gets the window style that was passed to the constructor or Create
8200 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8202 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8203 def HasFlag(*args
, **kwargs
):
8205 HasFlag(self, int flag) -> bool
8207 Test if the given style is set for this window.
8209 return _core_
.Window_HasFlag(*args
, **kwargs
)
8211 def IsRetained(*args
, **kwargs
):
8213 IsRetained(self) -> bool
8215 Returns true if the window is retained, false otherwise. Retained
8216 windows are only available on X platforms.
8218 return _core_
.Window_IsRetained(*args
, **kwargs
)
8220 def SetExtraStyle(*args
, **kwargs
):
8222 SetExtraStyle(self, long exStyle)
8224 Sets the extra style bits for the window. Extra styles are the less
8225 often used style bits which can't be set with the constructor or with
8226 SetWindowStyleFlag()
8228 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8230 def GetExtraStyle(*args
, **kwargs
):
8232 GetExtraStyle(self) -> long
8234 Returns the extra style bits for the window.
8236 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
8238 def MakeModal(*args
, **kwargs
):
8240 MakeModal(self, bool modal=True)
8242 Disables all other windows in the application so that the user can
8243 only interact with this window. Passing False will reverse this
8246 return _core_
.Window_MakeModal(*args
, **kwargs
)
8248 def SetThemeEnabled(*args
, **kwargs
):
8250 SetThemeEnabled(self, bool enableTheme)
8252 This function tells a window if it should use the system's "theme"
8253 code to draw the windows' background instead if its own background
8254 drawing code. This will only have an effect on platforms that support
8255 the notion of themes in user defined windows. One such platform is
8256 GTK+ where windows can have (very colourful) backgrounds defined by a
8257 user's selected theme.
8259 Dialogs, notebook pages and the status bar have this flag set to true
8260 by default so that the default look and feel is simulated best.
8262 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
8264 def GetThemeEnabled(*args
, **kwargs
):
8266 GetThemeEnabled(self) -> bool
8268 Return the themeEnabled flag.
8270 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
8272 def SetFocus(*args
, **kwargs
):
8276 Set's the focus to this window, allowing it to receive keyboard input.
8278 return _core_
.Window_SetFocus(*args
, **kwargs
)
8280 def SetFocusFromKbd(*args
, **kwargs
):
8282 SetFocusFromKbd(self)
8284 Set focus to this window as the result of a keyboard action. Normally
8285 only called internally.
8287 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
8289 def FindFocus(*args
, **kwargs
):
8291 FindFocus() -> Window
8293 Returns the window or control that currently has the keyboard focus,
8296 return _core_
.Window_FindFocus(*args
, **kwargs
)
8298 FindFocus
= staticmethod(FindFocus
)
8299 def AcceptsFocus(*args
, **kwargs
):
8301 AcceptsFocus(self) -> bool
8303 Can this window have focus?
8305 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
8307 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
8309 AcceptsFocusFromKeyboard(self) -> bool
8311 Can this window be given focus by keyboard navigation? if not, the
8312 only way to give it focus (provided it accepts it at all) is to click
8315 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
8317 def GetDefaultItem(*args
, **kwargs
):
8319 GetDefaultItem(self) -> Window
8321 Get the default child of this parent, i.e. the one which is activated
8322 by pressing <Enter> such as the OK button on a wx.Dialog.
8324 return _core_
.Window_GetDefaultItem(*args
, **kwargs
)
8326 def SetDefaultItem(*args
, **kwargs
):
8328 SetDefaultItem(self, Window child) -> Window
8330 Set this child as default, return the old default.
8332 return _core_
.Window_SetDefaultItem(*args
, **kwargs
)
8334 def SetTmpDefaultItem(*args
, **kwargs
):
8336 SetTmpDefaultItem(self, Window win)
8338 Set this child as temporary default
8340 return _core_
.Window_SetTmpDefaultItem(*args
, **kwargs
)
8342 def Navigate(*args
, **kwargs
):
8344 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8346 Does keyboard navigation from this window to another, by sending a
8347 `wx.NavigationKeyEvent`.
8349 return _core_
.Window_Navigate(*args
, **kwargs
)
8351 def MoveAfterInTabOrder(*args
, **kwargs
):
8353 MoveAfterInTabOrder(self, Window win)
8355 Moves this window in the tab navigation order after the specified
8356 sibling window. This means that when the user presses the TAB key on
8357 that other window, the focus switches to this window.
8359 The default tab order is the same as creation order. This function
8360 and `MoveBeforeInTabOrder` allow to change it after creating all the
8364 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
8366 def MoveBeforeInTabOrder(*args
, **kwargs
):
8368 MoveBeforeInTabOrder(self, Window win)
8370 Same as `MoveAfterInTabOrder` except that it inserts this window just
8371 before win instead of putting it right after it.
8373 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
8375 def GetChildren(*args
, **kwargs
):
8377 GetChildren(self) -> PyObject
8379 Returns a list of the window's children. NOTE: Currently this is a
8380 copy of the child window list maintained by the window, so the return
8381 value of this function is only valid as long as the window's children
8384 return _core_
.Window_GetChildren(*args
, **kwargs
)
8386 def GetParent(*args
, **kwargs
):
8388 GetParent(self) -> Window
8390 Returns the parent window of this window, or None if there isn't one.
8392 return _core_
.Window_GetParent(*args
, **kwargs
)
8394 def GetGrandParent(*args
, **kwargs
):
8396 GetGrandParent(self) -> Window
8398 Returns the parent of the parent of this window, or None if there
8401 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
8403 def IsTopLevel(*args
, **kwargs
):
8405 IsTopLevel(self) -> bool
8407 Returns true if the given window is a top-level one. Currently all
8408 frames and dialogs are always considered to be top-level windows (even
8409 if they have a parent window).
8411 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
8413 def Reparent(*args
, **kwargs
):
8415 Reparent(self, Window newParent) -> bool
8417 Reparents the window, i.e the window will be removed from its current
8418 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8419 re-inserted into another. Available on Windows and GTK. Returns True
8420 if the parent was changed, False otherwise (error or newParent ==
8423 return _core_
.Window_Reparent(*args
, **kwargs
)
8425 def AddChild(*args
, **kwargs
):
8427 AddChild(self, Window child)
8429 Adds a child window. This is called automatically by window creation
8430 functions so should not be required by the application programmer.
8432 return _core_
.Window_AddChild(*args
, **kwargs
)
8434 def RemoveChild(*args
, **kwargs
):
8436 RemoveChild(self, Window child)
8438 Removes a child window. This is called automatically by window
8439 deletion functions so should not be required by the application
8442 return _core_
.Window_RemoveChild(*args
, **kwargs
)
8444 def FindWindowById(*args
, **kwargs
):
8446 FindWindowById(self, long winid) -> Window
8448 Find a chld of this window by window ID
8450 return _core_
.Window_FindWindowById(*args
, **kwargs
)
8452 def FindWindowByName(*args
, **kwargs
):
8454 FindWindowByName(self, String name) -> Window
8456 Find a child of this window by name
8458 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
8460 def GetEventHandler(*args
, **kwargs
):
8462 GetEventHandler(self) -> EvtHandler
8464 Returns the event handler for this window. By default, the window is
8465 its own event handler.
8467 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
8469 def SetEventHandler(*args
, **kwargs
):
8471 SetEventHandler(self, EvtHandler handler)
8473 Sets the event handler for this window. An event handler is an object
8474 that is capable of processing the events sent to a window. By default,
8475 the window is its own event handler, but an application may wish to
8476 substitute another, for example to allow central implementation of
8477 event-handling for a variety of different window classes.
8479 It is usually better to use `wx.Window.PushEventHandler` since this sets
8480 up a chain of event handlers, where an event not handled by one event
8481 handler is handed to the next one in the chain.
8483 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
8485 def PushEventHandler(*args
, **kwargs
):
8487 PushEventHandler(self, EvtHandler handler)
8489 Pushes this event handler onto the event handler stack for the window.
8490 An event handler is an object that is capable of processing the events
8491 sent to a window. By default, the window is its own event handler, but
8492 an application may wish to substitute another, for example to allow
8493 central implementation of event-handling for a variety of different
8496 wx.Window.PushEventHandler allows an application to set up a chain of
8497 event handlers, where an event not handled by one event handler is
8498 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8499 remove the event handler.
8501 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
8503 def PopEventHandler(*args
, **kwargs
):
8505 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8507 Removes and returns the top-most event handler on the event handler
8508 stack. If deleteHandler is True then the wx.EvtHandler object will be
8509 destroyed after it is popped.
8511 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
8513 def RemoveEventHandler(*args
, **kwargs
):
8515 RemoveEventHandler(self, EvtHandler handler) -> bool
8517 Find the given handler in the event handler chain and remove (but not
8518 delete) it from the event handler chain, return True if it was found
8519 and False otherwise (this also results in an assert failure so this
8520 function should only be called when the handler is supposed to be
8523 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
8525 def SetValidator(*args
, **kwargs
):
8527 SetValidator(self, Validator validator)
8529 Deletes the current validator (if any) and sets the window validator,
8530 having called wx.Validator.Clone to create a new validator of this
8533 return _core_
.Window_SetValidator(*args
, **kwargs
)
8535 def GetValidator(*args
, **kwargs
):
8537 GetValidator(self) -> Validator
8539 Returns a pointer to the current validator for the window, or None if
8542 return _core_
.Window_GetValidator(*args
, **kwargs
)
8544 def Validate(*args
, **kwargs
):
8546 Validate(self) -> bool
8548 Validates the current values of the child controls using their
8549 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8550 style flag set, the method will also call Validate() of all child
8551 windows. Returns false if any of the validations failed.
8553 return _core_
.Window_Validate(*args
, **kwargs
)
8555 def TransferDataToWindow(*args
, **kwargs
):
8557 TransferDataToWindow(self) -> bool
8559 Transfers values to child controls from data areas specified by their
8560 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8561 style flag set, the method will also call TransferDataToWindow() of
8564 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
8566 def TransferDataFromWindow(*args
, **kwargs
):
8568 TransferDataFromWindow(self) -> bool
8570 Transfers values from child controls to data areas specified by their
8571 validators. Returns false if a transfer failed. If the window has
8572 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8573 also call TransferDataFromWindow() of all child windows.
8575 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
8577 def InitDialog(*args
, **kwargs
):
8581 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8582 to the dialog via validators.
8584 return _core_
.Window_InitDialog(*args
, **kwargs
)
8586 def SetAcceleratorTable(*args
, **kwargs
):
8588 SetAcceleratorTable(self, AcceleratorTable accel)
8590 Sets the accelerator table for this window.
8592 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
8594 def GetAcceleratorTable(*args
, **kwargs
):
8596 GetAcceleratorTable(self) -> AcceleratorTable
8598 Gets the accelerator table for this window.
8600 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
8602 def RegisterHotKey(*args
, **kwargs
):
8604 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8606 Registers a system wide hotkey. Every time the user presses the hotkey
8607 registered here, this window will receive a hotkey event. It will
8608 receive the event even if the application is in the background and
8609 does not have the input focus because the user is working with some
8610 other application. To bind an event handler function to this hotkey
8611 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8612 hotkey was registered successfully.
8614 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
8616 def UnregisterHotKey(*args
, **kwargs
):
8618 UnregisterHotKey(self, int hotkeyId) -> bool
8620 Unregisters a system wide hotkey.
8622 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
8624 def ConvertDialogPointToPixels(*args
, **kwargs
):
8626 ConvertDialogPointToPixels(self, Point pt) -> Point
8628 Converts a point or size from dialog units to pixels. Dialog units
8629 are used for maintaining a dialog's proportions even if the font
8630 changes. For the x dimension, the dialog units are multiplied by the
8631 average character width and then divided by 4. For the y dimension,
8632 the dialog units are multiplied by the average character height and
8635 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
8637 def ConvertDialogSizeToPixels(*args
, **kwargs
):
8639 ConvertDialogSizeToPixels(self, Size sz) -> Size
8641 Converts a point or size from dialog units to pixels. Dialog units
8642 are used for maintaining a dialog's proportions even if the font
8643 changes. For the x dimension, the dialog units are multiplied by the
8644 average character width and then divided by 4. For the y dimension,
8645 the dialog units are multiplied by the average character height and
8648 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
8650 def DLG_PNT(*args
, **kwargs
):
8652 DLG_PNT(self, Point pt) -> Point
8654 Converts a point or size from dialog units to pixels. Dialog units
8655 are used for maintaining a dialog's proportions even if the font
8656 changes. For the x dimension, the dialog units are multiplied by the
8657 average character width and then divided by 4. For the y dimension,
8658 the dialog units are multiplied by the average character height and
8661 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
8663 def DLG_SZE(*args
, **kwargs
):
8665 DLG_SZE(self, Size sz) -> Size
8667 Converts a point or size from dialog units to pixels. Dialog units
8668 are used for maintaining a dialog's proportions even if the font
8669 changes. For the x dimension, the dialog units are multiplied by the
8670 average character width and then divided by 4. For the y dimension,
8671 the dialog units are multiplied by the average character height and
8674 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
8676 def ConvertPixelPointToDialog(*args
, **kwargs
):
8677 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8678 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
8680 def ConvertPixelSizeToDialog(*args
, **kwargs
):
8681 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8682 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
8684 def WarpPointer(*args
, **kwargs
):
8686 WarpPointer(self, int x, int y)
8688 Moves the pointer to the given position on the window.
8690 NOTE: This function is not supported under Mac because Apple Human
8691 Interface Guidelines forbid moving the mouse cursor programmatically.
8693 return _core_
.Window_WarpPointer(*args
, **kwargs
)
8695 def CaptureMouse(*args
, **kwargs
):
8699 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8700 release the capture.
8702 Note that wxWindows maintains the stack of windows having captured the
8703 mouse and when the mouse is released the capture returns to the window
8704 which had had captured it previously and it is only really released if
8705 there were no previous window. In particular, this means that you must
8706 release the mouse as many times as you capture it.
8708 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
8710 def ReleaseMouse(*args
, **kwargs
):
8714 Releases mouse input captured with wx.Window.CaptureMouse.
8716 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
8718 def GetCapture(*args
, **kwargs
):
8720 GetCapture() -> Window
8722 Returns the window which currently captures the mouse or None
8724 return _core_
.Window_GetCapture(*args
, **kwargs
)
8726 GetCapture
= staticmethod(GetCapture
)
8727 def HasCapture(*args
, **kwargs
):
8729 HasCapture(self) -> bool
8731 Returns true if this window has the current mouse capture.
8733 return _core_
.Window_HasCapture(*args
, **kwargs
)
8735 def Refresh(*args
, **kwargs
):
8737 Refresh(self, bool eraseBackground=True, Rect rect=None)
8739 Mark the specified rectangle (or the whole window) as "dirty" so it
8740 will be repainted. Causes an EVT_PAINT event to be generated and sent
8743 return _core_
.Window_Refresh(*args
, **kwargs
)
8745 def RefreshRect(*args
, **kwargs
):
8747 RefreshRect(self, Rect rect, bool eraseBackground=True)
8749 Redraws the contents of the given rectangle: the area inside it will
8750 be repainted. This is the same as Refresh but has a nicer syntax.
8752 return _core_
.Window_RefreshRect(*args
, **kwargs
)
8754 def Update(*args
, **kwargs
):
8758 Calling this method immediately repaints the invalidated area of the
8759 window instead of waiting for the EVT_PAINT event to happen, (normally
8760 this would usually only happen when the flow of control returns to the
8761 event loop.) Notice that this function doesn't refresh the window and
8762 does nothing if the window has been already repainted. Use Refresh
8763 first if you want to immediately redraw the window (or some portion of
8764 it) unconditionally.
8766 return _core_
.Window_Update(*args
, **kwargs
)
8768 def ClearBackground(*args
, **kwargs
):
8770 ClearBackground(self)
8772 Clears the window by filling it with the current background
8773 colour. Does not cause an erase background event to be generated.
8775 return _core_
.Window_ClearBackground(*args
, **kwargs
)
8777 def Freeze(*args
, **kwargs
):
8781 Freezes the window or, in other words, prevents any updates from
8782 taking place on screen, the window is not redrawn at all. Thaw must be
8783 called to reenable window redrawing. Calls to Freeze/Thaw may be
8784 nested, with the actual Thaw being delayed until all the nesting has
8787 This method is useful for visual appearance optimization (for example,
8788 it is a good idea to use it before inserting large amount of text into
8789 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8790 for all controls so it is mostly just a hint to wxWindows and not a
8791 mandatory directive.
8793 return _core_
.Window_Freeze(*args
, **kwargs
)
8795 def Thaw(*args
, **kwargs
):
8799 Reenables window updating after a previous call to Freeze. Calls to
8800 Freeze/Thaw may be nested, so Thaw must be called the same number of
8801 times that Freeze was before the window will be updated.
8803 return _core_
.Window_Thaw(*args
, **kwargs
)
8805 def PrepareDC(*args
, **kwargs
):
8807 PrepareDC(self, DC dc)
8809 Call this function to prepare the device context for drawing a
8810 scrolled image. It sets the device origin according to the current
8813 return _core_
.Window_PrepareDC(*args
, **kwargs
)
8815 def GetUpdateRegion(*args
, **kwargs
):
8817 GetUpdateRegion(self) -> Region
8819 Returns the region specifying which parts of the window have been
8820 damaged. Should only be called within an EVT_PAINT handler.
8822 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
8824 def GetUpdateClientRect(*args
, **kwargs
):
8826 GetUpdateClientRect(self) -> Rect
8828 Get the update rectangle region bounding box in client coords.
8830 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
8832 def IsExposed(*args
, **kwargs
):
8834 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8836 Returns true if the given point or rectangle area has been exposed
8837 since the last repaint. Call this in an paint event handler to
8838 optimize redrawing by only redrawing those areas, which have been
8841 return _core_
.Window_IsExposed(*args
, **kwargs
)
8843 def IsExposedPoint(*args
, **kwargs
):
8845 IsExposedPoint(self, Point pt) -> bool
8847 Returns true if the given point or rectangle area has been exposed
8848 since the last repaint. Call this in an paint event handler to
8849 optimize redrawing by only redrawing those areas, which have been
8852 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
8854 def IsExposedRect(*args
, **kwargs
):
8856 IsExposedRect(self, Rect rect) -> bool
8858 Returns true if the given point or rectangle area has been exposed
8859 since the last repaint. Call this in an paint event handler to
8860 optimize redrawing by only redrawing those areas, which have been
8863 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
8865 def GetDefaultAttributes(*args
, **kwargs
):
8867 GetDefaultAttributes(self) -> VisualAttributes
8869 Get the default attributes for an instance of this class. This is
8870 useful if you want to use the same font or colour in your own control
8871 as in a standard control -- which is a much better idea than hard
8872 coding specific colours or fonts which might look completely out of
8873 place on the user's system, especially if it uses themes.
8875 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
8877 def GetClassDefaultAttributes(*args
, **kwargs
):
8879 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8881 Get the default attributes for this class. This is useful if you want
8882 to use the same font or colour in your own control as in a standard
8883 control -- which is a much better idea than hard coding specific
8884 colours or fonts which might look completely out of place on the
8885 user's system, especially if it uses themes.
8887 The variant parameter is only relevant under Mac currently and is
8888 ignore under other platforms. Under Mac, it will change the size of
8889 the returned font. See `wx.Window.SetWindowVariant` for more about
8892 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
8894 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
8895 def SetBackgroundColour(*args
, **kwargs
):
8897 SetBackgroundColour(self, Colour colour) -> bool
8899 Sets the background colour of the window. Returns True if the colour
8900 was changed. The background colour is usually painted by the default
8901 EVT_ERASE_BACKGROUND event handler function under Windows and
8902 automatically under GTK. Using `wx.NullColour` will reset the window
8903 to the default background colour.
8905 Note that setting the background colour may not cause an immediate
8906 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8907 calling this function.
8909 Using this function will disable attempts to use themes for this
8910 window, if the system supports them. Use with care since usually the
8911 themes represent the appearance chosen by the user to be used for all
8912 applications on the system.
8914 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
8916 def SetOwnBackgroundColour(*args
, **kwargs
):
8917 """SetOwnBackgroundColour(self, Colour colour)"""
8918 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
8920 def SetForegroundColour(*args
, **kwargs
):
8922 SetForegroundColour(self, Colour colour) -> bool
8924 Sets the foreground colour of the window. Returns True is the colour
8925 was changed. The interpretation of foreground colour is dependent on
8926 the window class; it may be the text colour or other colour, or it may
8929 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
8931 def SetOwnForegroundColour(*args
, **kwargs
):
8932 """SetOwnForegroundColour(self, Colour colour)"""
8933 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
8935 def GetBackgroundColour(*args
, **kwargs
):
8937 GetBackgroundColour(self) -> Colour
8939 Returns the background colour of the window.
8941 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
8943 def GetForegroundColour(*args
, **kwargs
):
8945 GetForegroundColour(self) -> Colour
8947 Returns the foreground colour of the window. The interpretation of
8948 foreground colour is dependent on the window class; it may be the text
8949 colour or other colour, or it may not be used at all.
8951 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
8953 def InheritsBackgroundColour(*args
, **kwargs
):
8954 """InheritsBackgroundColour(self) -> bool"""
8955 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
8957 def UseBgCol(*args
, **kwargs
):
8958 """UseBgCol(self) -> bool"""
8959 return _core_
.Window_UseBgCol(*args
, **kwargs
)
8961 def SetBackgroundStyle(*args
, **kwargs
):
8963 SetBackgroundStyle(self, int style) -> bool
8965 Returns the background style of the window. The background style
8966 indicates how the background of the window is drawn.
8968 ====================== ========================================
8969 wx.BG_STYLE_SYSTEM The background colour or pattern should
8970 be determined by the system
8971 wx.BG_STYLE_COLOUR The background should be a solid colour
8972 wx.BG_STYLE_CUSTOM The background will be implemented by the
8974 ====================== ========================================
8976 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8977 a custom background, such as a tiled bitmap. Currently the style has
8978 no effect on other platforms.
8980 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8982 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
8984 def GetBackgroundStyle(*args
, **kwargs
):
8986 GetBackgroundStyle(self) -> int
8988 Returns the background style of the window.
8990 :see: `SetBackgroundStyle`
8992 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
8994 def HasTransparentBackground(*args
, **kwargs
):
8996 HasTransparentBackground(self) -> bool
8998 Returns True if this window's background is transparent (as, for
8999 example, for `wx.StaticText`) and should show the parent window's
9002 This method is mostly used internally by the library itself and you
9003 normally shouldn't have to call it. You may, however, have to override
9004 it in your custom control classes to ensure that background is painted
9007 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
9009 def SetCursor(*args
, **kwargs
):
9011 SetCursor(self, Cursor cursor) -> bool
9013 Sets the window's cursor. Notice that the window cursor also sets it
9014 for the children of the window implicitly.
9016 The cursor may be wx.NullCursor in which case the window cursor will
9017 be reset back to default.
9019 return _core_
.Window_SetCursor(*args
, **kwargs
)
9021 def GetCursor(*args
, **kwargs
):
9023 GetCursor(self) -> Cursor
9025 Return the cursor associated with this window.
9027 return _core_
.Window_GetCursor(*args
, **kwargs
)
9029 def SetFont(*args
, **kwargs
):
9031 SetFont(self, Font font) -> bool
9033 Sets the font for this window.
9035 return _core_
.Window_SetFont(*args
, **kwargs
)
9037 def SetOwnFont(*args
, **kwargs
):
9038 """SetOwnFont(self, Font font)"""
9039 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9041 def GetFont(*args
, **kwargs
):
9043 GetFont(self) -> Font
9045 Returns the default font used for this window.
9047 return _core_
.Window_GetFont(*args
, **kwargs
)
9049 def SetCaret(*args
, **kwargs
):
9051 SetCaret(self, Caret caret)
9053 Sets the caret associated with the window.
9055 return _core_
.Window_SetCaret(*args
, **kwargs
)
9057 def GetCaret(*args
, **kwargs
):
9059 GetCaret(self) -> Caret
9061 Returns the caret associated with the window.
9063 return _core_
.Window_GetCaret(*args
, **kwargs
)
9065 def GetCharHeight(*args
, **kwargs
):
9067 GetCharHeight(self) -> int
9069 Get the (average) character size for the current font.
9071 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9073 def GetCharWidth(*args
, **kwargs
):
9075 GetCharWidth(self) -> int
9077 Get the (average) character size for the current font.
9079 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9081 def GetTextExtent(*args
, **kwargs
):
9083 GetTextExtent(String string) -> (width, height)
9085 Get the width and height of the text using the current font.
9087 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9089 def GetFullTextExtent(*args
, **kwargs
):
9091 GetFullTextExtent(String string, Font font=None) ->
9092 (width, height, descent, externalLeading)
9094 Get the width, height, decent and leading of the text using the
9095 current or specified font.
9097 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9099 def ClientToScreenXY(*args
, **kwargs
):
9101 ClientToScreenXY(int x, int y) -> (x,y)
9103 Converts to screen coordinates from coordinates relative to this window.
9105 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9107 def ScreenToClientXY(*args
, **kwargs
):
9109 ScreenToClientXY(int x, int y) -> (x,y)
9111 Converts from screen to client window coordinates.
9113 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9115 def ClientToScreen(*args
, **kwargs
):
9117 ClientToScreen(self, Point pt) -> Point
9119 Converts to screen coordinates from coordinates relative to this window.
9121 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9123 def ScreenToClient(*args
, **kwargs
):
9125 ScreenToClient(self, Point pt) -> Point
9127 Converts from screen to client window coordinates.
9129 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9131 def HitTestXY(*args
, **kwargs
):
9133 HitTestXY(self, int x, int y) -> int
9135 Test where the given (in client coords) point lies
9137 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9139 def HitTest(*args
, **kwargs
):
9141 HitTest(self, Point pt) -> int
9143 Test where the given (in client coords) point lies
9145 return _core_
.Window_HitTest(*args
, **kwargs
)
9147 def GetBorder(*args
):
9149 GetBorder(self, long flags) -> int
9150 GetBorder(self) -> int
9152 Get border for the flags of this window
9154 return _core_
.Window_GetBorder(*args
)
9156 def UpdateWindowUI(*args
, **kwargs
):
9158 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9160 This function sends EVT_UPDATE_UI events to the window. The particular
9161 implementation depends on the window; for example a wx.ToolBar will
9162 send an update UI event for each toolbar button, and a wx.Frame will
9163 send an update UI event for each menubar menu item. You can call this
9164 function from your application to ensure that your UI is up-to-date at
9165 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9166 concerned). This may be necessary if you have called
9167 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9168 limit the overhead that wxWindows incurs by sending update UI events
9171 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9173 def PopupMenuXY(*args
, **kwargs
):
9175 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9177 Pops up the given menu at the specified coordinates, relative to this window,
9178 and returns control when the user has dismissed the menu. If a menu item is
9179 selected, the corresponding menu event is generated and will be processed as
9180 usual. If the default position is given then the current position of the
9181 mouse cursor will be used.
9183 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9185 def PopupMenu(*args
, **kwargs
):
9187 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9189 Pops up the given menu at the specified coordinates, relative to this window,
9190 and returns control when the user has dismissed the menu. If a menu item is
9191 selected, the corresponding menu event is generated and will be processed as
9192 usual. If the default position is given then the current position of the
9193 mouse cursor will be used.
9195 return _core_
.Window_PopupMenu(*args
, **kwargs
)
9197 def GetHandle(*args
, **kwargs
):
9199 GetHandle(self) -> long
9201 Returns the platform-specific handle (as a long integer) of the
9202 physical window. Currently on wxMac it returns the handle of the
9203 toplevel parent of the window.
9205 return _core_
.Window_GetHandle(*args
, **kwargs
)
9207 def AssociateHandle(*args
, **kwargs
):
9209 AssociateHandle(self, long handle)
9211 Associate the window with a new native handle
9213 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
9215 def DissociateHandle(*args
, **kwargs
):
9217 DissociateHandle(self)
9219 Dissociate the current native handle from the window
9221 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
9223 def OnPaint(*args
, **kwargs
):
9224 """OnPaint(self, PaintEvent event)"""
9225 return _core_
.Window_OnPaint(*args
, **kwargs
)
9227 def HasScrollbar(*args
, **kwargs
):
9229 HasScrollbar(self, int orient) -> bool
9231 Does the window have the scrollbar for this orientation?
9233 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
9235 def SetScrollbar(*args
, **kwargs
):
9237 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9240 Sets the scrollbar properties of a built-in scrollbar.
9242 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
9244 def SetScrollPos(*args
, **kwargs
):
9246 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9248 Sets the position of one of the built-in scrollbars.
9250 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
9252 def GetScrollPos(*args
, **kwargs
):
9254 GetScrollPos(self, int orientation) -> int
9256 Returns the built-in scrollbar position.
9258 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
9260 def GetScrollThumb(*args
, **kwargs
):
9262 GetScrollThumb(self, int orientation) -> int
9264 Returns the built-in scrollbar thumb size.
9266 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
9268 def GetScrollRange(*args
, **kwargs
):
9270 GetScrollRange(self, int orientation) -> int
9272 Returns the built-in scrollbar range.
9274 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
9276 def ScrollWindow(*args
, **kwargs
):
9278 ScrollWindow(self, int dx, int dy, Rect rect=None)
9280 Physically scrolls the pixels in the window and move child windows
9281 accordingly. Use this function to optimise your scrolling
9282 implementations, to minimise the area that must be redrawn. Note that
9283 it is rarely required to call this function from a user program.
9285 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
9287 def ScrollLines(*args
, **kwargs
):
9289 ScrollLines(self, int lines) -> bool
9291 If the platform and window class supports it, scrolls the window by
9292 the given number of lines down, if lines is positive, or up if lines
9293 is negative. Returns True if the window was scrolled, False if it was
9294 already on top/bottom and nothing was done.
9296 return _core_
.Window_ScrollLines(*args
, **kwargs
)
9298 def ScrollPages(*args
, **kwargs
):
9300 ScrollPages(self, int pages) -> bool
9302 If the platform and window class supports it, scrolls the window by
9303 the given number of pages down, if pages is positive, or up if pages
9304 is negative. Returns True if the window was scrolled, False if it was
9305 already on top/bottom and nothing was done.
9307 return _core_
.Window_ScrollPages(*args
, **kwargs
)
9309 def LineUp(*args
, **kwargs
):
9311 LineUp(self) -> bool
9313 This is just a wrapper for ScrollLines(-1).
9315 return _core_
.Window_LineUp(*args
, **kwargs
)
9317 def LineDown(*args
, **kwargs
):
9319 LineDown(self) -> bool
9321 This is just a wrapper for ScrollLines(1).
9323 return _core_
.Window_LineDown(*args
, **kwargs
)
9325 def PageUp(*args
, **kwargs
):
9327 PageUp(self) -> bool
9329 This is just a wrapper for ScrollPages(-1).
9331 return _core_
.Window_PageUp(*args
, **kwargs
)
9333 def PageDown(*args
, **kwargs
):
9335 PageDown(self) -> bool
9337 This is just a wrapper for ScrollPages(1).
9339 return _core_
.Window_PageDown(*args
, **kwargs
)
9341 def SetHelpText(*args
, **kwargs
):
9343 SetHelpText(self, String text)
9345 Sets the help text to be used as context-sensitive help for this
9346 window. Note that the text is actually stored by the current
9347 `wx.HelpProvider` implementation, and not in the window object itself.
9349 return _core_
.Window_SetHelpText(*args
, **kwargs
)
9351 def SetHelpTextForId(*args
, **kwargs
):
9353 SetHelpTextForId(self, String text)
9355 Associate this help text with all windows with the same id as this
9358 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
9360 def GetHelpText(*args
, **kwargs
):
9362 GetHelpText(self) -> String
9364 Gets the help text to be used as context-sensitive help for this
9365 window. Note that the text is actually stored by the current
9366 `wx.HelpProvider` implementation, and not in the window object itself.
9368 return _core_
.Window_GetHelpText(*args
, **kwargs
)
9370 def SetToolTipString(*args
, **kwargs
):
9372 SetToolTipString(self, String tip)
9374 Attach a tooltip to the window.
9376 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
9378 def SetToolTip(*args
, **kwargs
):
9380 SetToolTip(self, ToolTip tip)
9382 Attach a tooltip to the window.
9384 return _core_
.Window_SetToolTip(*args
, **kwargs
)
9386 def GetToolTip(*args
, **kwargs
):
9388 GetToolTip(self) -> ToolTip
9390 get the associated tooltip or None if none
9392 return _core_
.Window_GetToolTip(*args
, **kwargs
)
9394 def SetDropTarget(*args
, **kwargs
):
9396 SetDropTarget(self, DropTarget dropTarget)
9398 Associates a drop target with this window. If the window already has
9399 a drop target, it is deleted.
9401 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
9403 def GetDropTarget(*args
, **kwargs
):
9405 GetDropTarget(self) -> DropTarget
9407 Returns the associated drop target, which may be None.
9409 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
9411 def DragAcceptFiles(*args
, **kwargs
):
9413 DragAcceptFiles(self, bool accept)
9415 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9416 Only functional on Windows.
9418 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
9420 def SetConstraints(*args
, **kwargs
):
9422 SetConstraints(self, LayoutConstraints constraints)
9424 Sets the window to have the given layout constraints. If an existing
9425 layout constraints object is already owned by the window, it will be
9426 deleted. Pass None to disassociate and delete the window's current
9429 You must call SetAutoLayout to tell a window to use the constraints
9430 automatically in its default EVT_SIZE handler; otherwise, you must
9431 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9432 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9435 return _core_
.Window_SetConstraints(*args
, **kwargs
)
9437 def GetConstraints(*args
, **kwargs
):
9439 GetConstraints(self) -> LayoutConstraints
9441 Returns a pointer to the window's layout constraints, or None if there
9444 return _core_
.Window_GetConstraints(*args
, **kwargs
)
9446 def SetAutoLayout(*args
, **kwargs
):
9448 SetAutoLayout(self, bool autoLayout)
9450 Determines whether the Layout function will be called automatically
9451 when the window is resized. lease note that this only happens for the
9452 windows usually used to contain children, namely `wx.Panel` and
9453 `wx.TopLevelWindow` (and the classes deriving from them).
9455 This method is called implicitly by `SetSizer` but if you use
9456 `SetConstraints` you should call it manually or otherwise the window
9457 layout won't be correctly updated when its size changes.
9459 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
9461 def GetAutoLayout(*args
, **kwargs
):
9463 GetAutoLayout(self) -> bool
9465 Returns the current autoLayout setting
9467 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
9469 def Layout(*args
, **kwargs
):
9471 Layout(self) -> bool
9473 Invokes the constraint-based layout algorithm or the sizer-based
9474 algorithm for this window. See SetAutoLayout: when auto layout is on,
9475 this function gets called automatically by the default EVT_SIZE
9476 handler when the window is resized.
9478 return _core_
.Window_Layout(*args
, **kwargs
)
9480 def SetSizer(*args
, **kwargs
):
9482 SetSizer(self, Sizer sizer, bool deleteOld=True)
9484 Sets the window to have the given layout sizer. The window will then
9485 own the object, and will take care of its deletion. If an existing
9486 layout sizer object is already owned by the window, it will be deleted
9487 if the deleteOld parameter is true. Note that this function will also
9488 call SetAutoLayout implicitly with a True parameter if the sizer is
9489 non-None, and False otherwise.
9491 return _core_
.Window_SetSizer(*args
, **kwargs
)
9493 def SetSizerAndFit(*args
, **kwargs
):
9495 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9497 The same as SetSizer, except it also sets the size hints for the
9498 window based on the sizer's minimum size.
9500 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
9502 def GetSizer(*args
, **kwargs
):
9504 GetSizer(self) -> Sizer
9506 Return the sizer associated with the window by a previous call to
9507 SetSizer or None if there isn't one.
9509 return _core_
.Window_GetSizer(*args
, **kwargs
)
9511 def SetContainingSizer(*args
, **kwargs
):
9513 SetContainingSizer(self, Sizer sizer)
9515 This normally does not need to be called by application code. It is
9516 called internally when a window is added to a sizer, and is used so
9517 the window can remove itself from the sizer when it is destroyed.
9519 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
9521 def GetContainingSizer(*args
, **kwargs
):
9523 GetContainingSizer(self) -> Sizer
9525 Return the sizer that this window is a member of, if any, otherwise None.
9527 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
9529 def InheritAttributes(*args
, **kwargs
):
9531 InheritAttributes(self)
9533 This function is (or should be, in case of custom controls) called
9534 during window creation to intelligently set up the window visual
9535 attributes, that is the font and the foreground and background
9538 By 'intelligently' the following is meant: by default, all windows use
9539 their own default attributes. However if some of the parent's
9540 attributes are explicitly changed (that is, using SetFont and not
9541 SetOwnFont) and if the corresponding attribute hadn't been
9542 explicitly set for this window itself, then this window takes the same
9543 value as used by the parent. In addition, if the window overrides
9544 ShouldInheritColours to return false, the colours will not be changed
9545 no matter what and only the font might.
9547 This rather complicated logic is necessary in order to accommodate the
9548 different usage scenarios. The most common one is when all default
9549 attributes are used and in this case, nothing should be inherited as
9550 in modern GUIs different controls use different fonts (and colours)
9551 than their siblings so they can't inherit the same value from the
9552 parent. However it was also deemed desirable to allow to simply change
9553 the attributes of all children at once by just changing the font or
9554 colour of their common parent, hence in this case we do inherit the
9558 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
9560 def ShouldInheritColours(*args
, **kwargs
):
9562 ShouldInheritColours(self) -> bool
9564 Return true from here to allow the colours of this window to be
9565 changed by InheritAttributes, returning false forbids inheriting them
9566 from the parent window.
9568 The base class version returns false, but this method is overridden in
9569 wxControl where it returns true.
9571 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
9573 def PostCreate(self
, pre
):
9575 Phase 3 of the 2-phase create <wink!>
9576 Call this method after precreating the window with the 2-phase create method.
9578 self
.this
= pre
.this
9579 self
.thisown
= pre
.thisown
9581 if hasattr(self
, '_setOORInfo'):
9582 self
._setOORInfo
(self
)
9583 if hasattr(self
, '_setCallbackInfo'):
9584 self
._setCallbackInfo
(self
, self
.__class
__)
9586 def SendSizeEvent(self
):
9587 self
.GetEventhandler().ProcessEvent(wx
.SizeEvent((-1,-1)))
9589 Window_swigregister
= _core_
.Window_swigregister
9590 Window_swigregister(Window
)
9592 def PreWindow(*args
, **kwargs
):
9594 PreWindow() -> Window
9596 Precreate a Window for 2-phase creation.
9598 val
= _core_
.new_PreWindow(*args
, **kwargs
)
9601 def Window_NewControlId(*args
):
9603 Window_NewControlId() -> int
9605 Generate a control id for the controls which were not given one.
9607 return _core_
.Window_NewControlId(*args
)
9609 def Window_NextControlId(*args
, **kwargs
):
9611 Window_NextControlId(int winid) -> int
9613 Get the id of the control following the one with the given
9616 return _core_
.Window_NextControlId(*args
, **kwargs
)
9618 def Window_PrevControlId(*args
, **kwargs
):
9620 Window_PrevControlId(int winid) -> int
9622 Get the id of the control preceding the one with the given
9625 return _core_
.Window_PrevControlId(*args
, **kwargs
)
9627 def Window_FindFocus(*args
):
9629 Window_FindFocus() -> Window
9631 Returns the window or control that currently has the keyboard focus,
9634 return _core_
.Window_FindFocus(*args
)
9636 def Window_GetCapture(*args
):
9638 Window_GetCapture() -> Window
9640 Returns the window which currently captures the mouse or None
9642 return _core_
.Window_GetCapture(*args
)
9644 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
9646 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9648 Get the default attributes for this class. This is useful if you want
9649 to use the same font or colour in your own control as in a standard
9650 control -- which is a much better idea than hard coding specific
9651 colours or fonts which might look completely out of place on the
9652 user's system, especially if it uses themes.
9654 The variant parameter is only relevant under Mac currently and is
9655 ignore under other platforms. Under Mac, it will change the size of
9656 the returned font. See `wx.Window.SetWindowVariant` for more about
9659 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9661 def DLG_PNT(win
, point_or_x
, y
=None):
9663 Convenience function for converting a Point or (x,y) in
9664 dialog units to pixel units.
9667 return win
.ConvertDialogPointToPixels(point_or_x
)
9669 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
9671 def DLG_SZE(win
, size_width
, height
=None):
9673 Convenience function for converting a Size or (w,h) in
9674 dialog units to pixel units.
9677 return win
.ConvertDialogSizeToPixels(size_width
)
9679 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
9682 def FindWindowById(*args
, **kwargs
):
9684 FindWindowById(long id, Window parent=None) -> Window
9686 Find the first window in the application with the given id. If parent
9687 is None, the search will start from all top-level frames and dialog
9688 boxes; if non-None, the search will be limited to the given window
9689 hierarchy. The search is recursive in both cases.
9691 return _core_
.FindWindowById(*args
, **kwargs
)
9693 def FindWindowByName(*args
, **kwargs
):
9695 FindWindowByName(String name, Window parent=None) -> Window
9697 Find a window by its name (as given in a window constructor or Create
9698 function call). If parent is None, the search will start from all
9699 top-level frames and dialog boxes; if non-None, the search will be
9700 limited to the given window hierarchy. The search is recursive in both
9703 If no window with such name is found, wx.FindWindowByLabel is called.
9705 return _core_
.FindWindowByName(*args
, **kwargs
)
9707 def FindWindowByLabel(*args
, **kwargs
):
9709 FindWindowByLabel(String label, Window parent=None) -> Window
9711 Find a window by its label. Depending on the type of window, the label
9712 may be a window title or panel item label. If parent is None, the
9713 search will start from all top-level frames and dialog boxes; if
9714 non-None, the search will be limited to the given window
9715 hierarchy. The search is recursive in both cases.
9717 return _core_
.FindWindowByLabel(*args
, **kwargs
)
9719 def Window_FromHWND(*args
, **kwargs
):
9720 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9721 return _core_
.Window_FromHWND(*args
, **kwargs
)
9723 def GetTopLevelWindows(*args
):
9725 GetTopLevelWindows() -> PyObject
9727 Returns a list of the the application's top-level windows, (frames,
9728 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9729 by wxWidgets, and so it is only valid as long as no top-level windows
9730 are closed or new top-level windows are created.
9733 return _core_
.GetTopLevelWindows(*args
)
9734 #---------------------------------------------------------------------------
9736 class Validator(EvtHandler
):
9737 """Proxy of C++ Validator class"""
9738 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9739 __repr__
= _swig_repr
9740 def __init__(self
, *args
, **kwargs
):
9741 """__init__(self) -> Validator"""
9742 _core_
.Validator_swiginit(self
,_core_
.new_Validator(*args
, **kwargs
))
9743 self
._setOORInfo
(self
)
9745 def Clone(*args
, **kwargs
):
9746 """Clone(self) -> Validator"""
9747 return _core_
.Validator_Clone(*args
, **kwargs
)
9749 def Validate(*args
, **kwargs
):
9750 """Validate(self, Window parent) -> bool"""
9751 return _core_
.Validator_Validate(*args
, **kwargs
)
9753 def TransferToWindow(*args
, **kwargs
):
9754 """TransferToWindow(self) -> bool"""
9755 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
9757 def TransferFromWindow(*args
, **kwargs
):
9758 """TransferFromWindow(self) -> bool"""
9759 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
9761 def GetWindow(*args
, **kwargs
):
9762 """GetWindow(self) -> Window"""
9763 return _core_
.Validator_GetWindow(*args
, **kwargs
)
9765 def SetWindow(*args
, **kwargs
):
9766 """SetWindow(self, Window window)"""
9767 return _core_
.Validator_SetWindow(*args
, **kwargs
)
9769 def IsSilent(*args
, **kwargs
):
9770 """IsSilent() -> bool"""
9771 return _core_
.Validator_IsSilent(*args
, **kwargs
)
9773 IsSilent
= staticmethod(IsSilent
)
9774 def SetBellOnError(*args
, **kwargs
):
9775 """SetBellOnError(int doIt=True)"""
9776 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
9778 SetBellOnError
= staticmethod(SetBellOnError
)
9779 Validator_swigregister
= _core_
.Validator_swigregister
9780 Validator_swigregister(Validator
)
9782 def Validator_IsSilent(*args
):
9783 """Validator_IsSilent() -> bool"""
9784 return _core_
.Validator_IsSilent(*args
)
9786 def Validator_SetBellOnError(*args
, **kwargs
):
9787 """Validator_SetBellOnError(int doIt=True)"""
9788 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
9790 class PyValidator(Validator
):
9791 """Proxy of C++ PyValidator class"""
9792 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9793 __repr__
= _swig_repr
9794 def __init__(self
, *args
, **kwargs
):
9795 """__init__(self) -> PyValidator"""
9796 _core_
.PyValidator_swiginit(self
,_core_
.new_PyValidator(*args
, **kwargs
))
9798 self
._setCallbackInfo
(self
, PyValidator
, 1)
9799 self
._setOORInfo
(self
)
9801 def _setCallbackInfo(*args
, **kwargs
):
9802 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9803 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
9805 PyValidator_swigregister
= _core_
.PyValidator_swigregister
9806 PyValidator_swigregister(PyValidator
)
9808 #---------------------------------------------------------------------------
9810 class Menu(EvtHandler
):
9811 """Proxy of C++ Menu class"""
9812 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9813 __repr__
= _swig_repr
9814 def __init__(self
, *args
, **kwargs
):
9815 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9816 _core_
.Menu_swiginit(self
,_core_
.new_Menu(*args
, **kwargs
))
9817 self
._setOORInfo
(self
)
9819 def Append(*args
, **kwargs
):
9820 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9821 return _core_
.Menu_Append(*args
, **kwargs
)
9823 def AppendSeparator(*args
, **kwargs
):
9824 """AppendSeparator(self) -> MenuItem"""
9825 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
9827 def AppendCheckItem(*args
, **kwargs
):
9828 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9829 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
9831 def AppendRadioItem(*args
, **kwargs
):
9832 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9833 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
9835 def AppendMenu(*args
, **kwargs
):
9836 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9837 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
9839 def AppendSubMenu(*args
, **kwargs
):
9840 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9841 return _core_
.Menu_AppendSubMenu(*args
, **kwargs
)
9843 def AppendItem(*args
, **kwargs
):
9844 """AppendItem(self, MenuItem item) -> MenuItem"""
9845 return _core_
.Menu_AppendItem(*args
, **kwargs
)
9847 def InsertItem(*args
, **kwargs
):
9848 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9849 return _core_
.Menu_InsertItem(*args
, **kwargs
)
9851 def PrependItem(*args
, **kwargs
):
9852 """PrependItem(self, MenuItem item) -> MenuItem"""
9853 return _core_
.Menu_PrependItem(*args
, **kwargs
)
9855 def Break(*args
, **kwargs
):
9857 return _core_
.Menu_Break(*args
, **kwargs
)
9859 def Insert(*args
, **kwargs
):
9861 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9862 int kind=ITEM_NORMAL) -> MenuItem
9864 return _core_
.Menu_Insert(*args
, **kwargs
)
9866 def InsertSeparator(*args
, **kwargs
):
9867 """InsertSeparator(self, size_t pos) -> MenuItem"""
9868 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
9870 def InsertCheckItem(*args
, **kwargs
):
9871 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9872 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
9874 def InsertRadioItem(*args
, **kwargs
):
9875 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9876 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
9878 def InsertMenu(*args
, **kwargs
):
9879 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9880 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
9882 def Prepend(*args
, **kwargs
):
9883 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9884 return _core_
.Menu_Prepend(*args
, **kwargs
)
9886 def PrependSeparator(*args
, **kwargs
):
9887 """PrependSeparator(self) -> MenuItem"""
9888 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
9890 def PrependCheckItem(*args
, **kwargs
):
9891 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9892 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
9894 def PrependRadioItem(*args
, **kwargs
):
9895 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9896 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
9898 def PrependMenu(*args
, **kwargs
):
9899 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9900 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
9902 def Remove(*args
, **kwargs
):
9903 """Remove(self, int id) -> MenuItem"""
9904 return _core_
.Menu_Remove(*args
, **kwargs
)
9906 def RemoveItem(*args
, **kwargs
):
9907 """RemoveItem(self, MenuItem item) -> MenuItem"""
9908 return _core_
.Menu_RemoveItem(*args
, **kwargs
)
9910 def Delete(*args
, **kwargs
):
9911 """Delete(self, int id) -> bool"""
9912 return _core_
.Menu_Delete(*args
, **kwargs
)
9914 def DeleteItem(*args
, **kwargs
):
9915 """DeleteItem(self, MenuItem item) -> bool"""
9916 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
9918 def Destroy(*args
, **kwargs
):
9922 Deletes the C++ object this Python object is a proxy for.
9924 val
= _core_
.Menu_Destroy(*args
, **kwargs
)
9928 def DestroyId(*args
, **kwargs
):
9930 DestroyId(self, int id) -> bool
9932 Deletes the C++ object this Python object is a proxy for.
9934 val
= _core_
.Menu_DestroyId(*args
, **kwargs
)
9938 def DestroyItem(*args
, **kwargs
):
9940 DestroyItem(self, MenuItem item) -> bool
9942 Deletes the C++ object this Python object is a proxy for.
9944 val
= _core_
.Menu_DestroyItem(*args
, **kwargs
)
9948 def GetMenuItemCount(*args
, **kwargs
):
9949 """GetMenuItemCount(self) -> size_t"""
9950 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
9952 def GetMenuItems(*args
, **kwargs
):
9953 """GetMenuItems(self) -> PyObject"""
9954 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
9956 def FindItem(*args
, **kwargs
):
9957 """FindItem(self, String item) -> int"""
9958 return _core_
.Menu_FindItem(*args
, **kwargs
)
9960 def FindItemById(*args
, **kwargs
):
9961 """FindItemById(self, int id) -> MenuItem"""
9962 return _core_
.Menu_FindItemById(*args
, **kwargs
)
9964 def FindItemByPosition(*args
, **kwargs
):
9965 """FindItemByPosition(self, size_t position) -> MenuItem"""
9966 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
9968 def Enable(*args
, **kwargs
):
9969 """Enable(self, int id, bool enable)"""
9970 return _core_
.Menu_Enable(*args
, **kwargs
)
9972 def IsEnabled(*args
, **kwargs
):
9973 """IsEnabled(self, int id) -> bool"""
9974 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
9976 def Check(*args
, **kwargs
):
9977 """Check(self, int id, bool check)"""
9978 return _core_
.Menu_Check(*args
, **kwargs
)
9980 def IsChecked(*args
, **kwargs
):
9981 """IsChecked(self, int id) -> bool"""
9982 return _core_
.Menu_IsChecked(*args
, **kwargs
)
9984 def SetLabel(*args
, **kwargs
):
9985 """SetLabel(self, int id, String label)"""
9986 return _core_
.Menu_SetLabel(*args
, **kwargs
)
9988 def GetLabel(*args
, **kwargs
):
9989 """GetLabel(self, int id) -> String"""
9990 return _core_
.Menu_GetLabel(*args
, **kwargs
)
9992 def SetHelpString(*args
, **kwargs
):
9993 """SetHelpString(self, int id, String helpString)"""
9994 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
9996 def GetHelpString(*args
, **kwargs
):
9997 """GetHelpString(self, int id) -> String"""
9998 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
10000 def SetTitle(*args
, **kwargs
):
10001 """SetTitle(self, String title)"""
10002 return _core_
.Menu_SetTitle(*args
, **kwargs
)
10004 def GetTitle(*args
, **kwargs
):
10005 """GetTitle(self) -> String"""
10006 return _core_
.Menu_GetTitle(*args
, **kwargs
)
10008 def SetEventHandler(*args
, **kwargs
):
10009 """SetEventHandler(self, EvtHandler handler)"""
10010 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
10012 def GetEventHandler(*args
, **kwargs
):
10013 """GetEventHandler(self) -> EvtHandler"""
10014 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
10016 def SetInvokingWindow(*args
, **kwargs
):
10017 """SetInvokingWindow(self, Window win)"""
10018 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
10020 def GetInvokingWindow(*args
, **kwargs
):
10021 """GetInvokingWindow(self) -> Window"""
10022 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
10024 def GetStyle(*args
, **kwargs
):
10025 """GetStyle(self) -> long"""
10026 return _core_
.Menu_GetStyle(*args
, **kwargs
)
10028 def UpdateUI(*args
, **kwargs
):
10029 """UpdateUI(self, EvtHandler source=None)"""
10030 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
10032 def GetMenuBar(*args
, **kwargs
):
10033 """GetMenuBar(self) -> MenuBar"""
10034 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
10036 def Attach(*args
, **kwargs
):
10037 """Attach(self, wxMenuBarBase menubar)"""
10038 return _core_
.Menu_Attach(*args
, **kwargs
)
10040 def Detach(*args
, **kwargs
):
10042 return _core_
.Menu_Detach(*args
, **kwargs
)
10044 def IsAttached(*args
, **kwargs
):
10045 """IsAttached(self) -> bool"""
10046 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10048 def SetParent(*args
, **kwargs
):
10049 """SetParent(self, Menu parent)"""
10050 return _core_
.Menu_SetParent(*args
, **kwargs
)
10052 def GetParent(*args
, **kwargs
):
10053 """GetParent(self) -> Menu"""
10054 return _core_
.Menu_GetParent(*args
, **kwargs
)
10056 Menu_swigregister
= _core_
.Menu_swigregister
10057 Menu_swigregister(Menu
)
10058 DefaultValidator
= cvar
.DefaultValidator
10060 #---------------------------------------------------------------------------
10062 class MenuBar(Window
):
10063 """Proxy of C++ MenuBar class"""
10064 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10065 __repr__
= _swig_repr
10066 def __init__(self
, *args
, **kwargs
):
10067 """__init__(self, long style=0) -> MenuBar"""
10068 _core_
.MenuBar_swiginit(self
,_core_
.new_MenuBar(*args
, **kwargs
))
10069 self
._setOORInfo
(self
)
10071 def Append(*args
, **kwargs
):
10072 """Append(self, Menu menu, String title) -> bool"""
10073 return _core_
.MenuBar_Append(*args
, **kwargs
)
10075 def Insert(*args
, **kwargs
):
10076 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10077 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10079 def GetMenuCount(*args
, **kwargs
):
10080 """GetMenuCount(self) -> size_t"""
10081 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
10083 def GetMenu(*args
, **kwargs
):
10084 """GetMenu(self, size_t pos) -> Menu"""
10085 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
10087 def Replace(*args
, **kwargs
):
10088 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10089 return _core_
.MenuBar_Replace(*args
, **kwargs
)
10091 def Remove(*args
, **kwargs
):
10092 """Remove(self, size_t pos) -> Menu"""
10093 return _core_
.MenuBar_Remove(*args
, **kwargs
)
10095 def EnableTop(*args
, **kwargs
):
10096 """EnableTop(self, size_t pos, bool enable)"""
10097 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
10099 def IsEnabledTop(*args
, **kwargs
):
10100 """IsEnabledTop(self, size_t pos) -> bool"""
10101 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
10103 def SetLabelTop(*args
, **kwargs
):
10104 """SetLabelTop(self, size_t pos, String label)"""
10105 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
10107 def GetLabelTop(*args
, **kwargs
):
10108 """GetLabelTop(self, size_t pos) -> String"""
10109 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
10111 def FindMenuItem(*args
, **kwargs
):
10112 """FindMenuItem(self, String menu, String item) -> int"""
10113 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
10115 def FindItemById(*args
, **kwargs
):
10116 """FindItemById(self, int id) -> MenuItem"""
10117 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
10119 def FindMenu(*args
, **kwargs
):
10120 """FindMenu(self, String title) -> int"""
10121 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
10123 def Enable(*args
, **kwargs
):
10124 """Enable(self, int id, bool enable)"""
10125 return _core_
.MenuBar_Enable(*args
, **kwargs
)
10127 def Check(*args
, **kwargs
):
10128 """Check(self, int id, bool check)"""
10129 return _core_
.MenuBar_Check(*args
, **kwargs
)
10131 def IsChecked(*args
, **kwargs
):
10132 """IsChecked(self, int id) -> bool"""
10133 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
10135 def IsEnabled(*args
, **kwargs
):
10136 """IsEnabled(self, int id) -> bool"""
10137 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
10139 def SetLabel(*args
, **kwargs
):
10140 """SetLabel(self, int id, String label)"""
10141 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
10143 def GetLabel(*args
, **kwargs
):
10144 """GetLabel(self, int id) -> String"""
10145 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
10147 def SetHelpString(*args
, **kwargs
):
10148 """SetHelpString(self, int id, String helpString)"""
10149 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
10151 def GetHelpString(*args
, **kwargs
):
10152 """GetHelpString(self, int id) -> String"""
10153 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
10155 def GetFrame(*args
, **kwargs
):
10156 """GetFrame(self) -> wxFrame"""
10157 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
10159 def IsAttached(*args
, **kwargs
):
10160 """IsAttached(self) -> bool"""
10161 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
10163 def Attach(*args
, **kwargs
):
10164 """Attach(self, wxFrame frame)"""
10165 return _core_
.MenuBar_Attach(*args
, **kwargs
)
10167 def Detach(*args
, **kwargs
):
10169 return _core_
.MenuBar_Detach(*args
, **kwargs
)
10171 def SetAutoWindowMenu(*args
, **kwargs
):
10172 """SetAutoWindowMenu(bool enable)"""
10173 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10175 SetAutoWindowMenu
= staticmethod(SetAutoWindowMenu
)
10176 def GetAutoWindowMenu(*args
, **kwargs
):
10177 """GetAutoWindowMenu() -> bool"""
10178 return _core_
.MenuBar_GetAutoWindowMenu(*args
, **kwargs
)
10180 GetAutoWindowMenu
= staticmethod(GetAutoWindowMenu
)
10181 MenuBar_swigregister
= _core_
.MenuBar_swigregister
10182 MenuBar_swigregister(MenuBar
)
10184 def MenuBar_SetAutoWindowMenu(*args
, **kwargs
):
10185 """MenuBar_SetAutoWindowMenu(bool enable)"""
10186 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10188 def MenuBar_GetAutoWindowMenu(*args
):
10189 """MenuBar_GetAutoWindowMenu() -> bool"""
10190 return _core_
.MenuBar_GetAutoWindowMenu(*args
)
10192 #---------------------------------------------------------------------------
10194 class MenuItem(Object
):
10195 """Proxy of C++ MenuItem class"""
10196 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10197 __repr__
= _swig_repr
10198 def __init__(self
, *args
, **kwargs
):
10200 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10201 String help=EmptyString, int kind=ITEM_NORMAL,
10202 Menu subMenu=None) -> MenuItem
10204 _core_
.MenuItem_swiginit(self
,_core_
.new_MenuItem(*args
, **kwargs
))
10205 __swig_destroy__
= _core_
.delete_MenuItem
10206 __del__
= lambda self
: None;
10207 def GetMenu(*args
, **kwargs
):
10208 """GetMenu(self) -> Menu"""
10209 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
10211 def SetMenu(*args
, **kwargs
):
10212 """SetMenu(self, Menu menu)"""
10213 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
10215 def SetId(*args
, **kwargs
):
10216 """SetId(self, int id)"""
10217 return _core_
.MenuItem_SetId(*args
, **kwargs
)
10219 def GetId(*args
, **kwargs
):
10220 """GetId(self) -> int"""
10221 return _core_
.MenuItem_GetId(*args
, **kwargs
)
10223 def IsSeparator(*args
, **kwargs
):
10224 """IsSeparator(self) -> bool"""
10225 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
10227 def SetText(*args
, **kwargs
):
10228 """SetText(self, String str)"""
10229 return _core_
.MenuItem_SetText(*args
, **kwargs
)
10231 def GetLabel(*args
, **kwargs
):
10232 """GetLabel(self) -> String"""
10233 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
10235 def GetText(*args
, **kwargs
):
10236 """GetText(self) -> String"""
10237 return _core_
.MenuItem_GetText(*args
, **kwargs
)
10239 def GetLabelFromText(*args
, **kwargs
):
10240 """GetLabelFromText(String text) -> String"""
10241 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10243 GetLabelFromText
= staticmethod(GetLabelFromText
)
10244 def GetKind(*args
, **kwargs
):
10245 """GetKind(self) -> int"""
10246 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
10248 def SetKind(*args
, **kwargs
):
10249 """SetKind(self, int kind)"""
10250 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
10252 def SetCheckable(*args
, **kwargs
):
10253 """SetCheckable(self, bool checkable)"""
10254 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
10256 def IsCheckable(*args
, **kwargs
):
10257 """IsCheckable(self) -> bool"""
10258 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
10260 def IsSubMenu(*args
, **kwargs
):
10261 """IsSubMenu(self) -> bool"""
10262 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
10264 def SetSubMenu(*args
, **kwargs
):
10265 """SetSubMenu(self, Menu menu)"""
10266 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
10268 def GetSubMenu(*args
, **kwargs
):
10269 """GetSubMenu(self) -> Menu"""
10270 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
10272 def Enable(*args
, **kwargs
):
10273 """Enable(self, bool enable=True)"""
10274 return _core_
.MenuItem_Enable(*args
, **kwargs
)
10276 def IsEnabled(*args
, **kwargs
):
10277 """IsEnabled(self) -> bool"""
10278 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
10280 def Check(*args
, **kwargs
):
10281 """Check(self, bool check=True)"""
10282 return _core_
.MenuItem_Check(*args
, **kwargs
)
10284 def IsChecked(*args
, **kwargs
):
10285 """IsChecked(self) -> bool"""
10286 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
10288 def Toggle(*args
, **kwargs
):
10290 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
10292 def SetHelp(*args
, **kwargs
):
10293 """SetHelp(self, String str)"""
10294 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
10296 def GetHelp(*args
, **kwargs
):
10297 """GetHelp(self) -> String"""
10298 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
10300 def GetAccel(*args
, **kwargs
):
10301 """GetAccel(self) -> AcceleratorEntry"""
10302 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
10304 def SetAccel(*args
, **kwargs
):
10305 """SetAccel(self, AcceleratorEntry accel)"""
10306 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
10308 def SetBitmap(*args
, **kwargs
):
10309 """SetBitmap(self, Bitmap bitmap)"""
10310 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
10312 def GetBitmap(*args
, **kwargs
):
10313 """GetBitmap(self) -> Bitmap"""
10314 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
10316 def SetFont(*args
, **kwargs
):
10317 """SetFont(self, Font font)"""
10318 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
10320 def GetFont(*args
, **kwargs
):
10321 """GetFont(self) -> Font"""
10322 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
10324 def SetTextColour(*args
, **kwargs
):
10325 """SetTextColour(self, Colour colText)"""
10326 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
10328 def GetTextColour(*args
, **kwargs
):
10329 """GetTextColour(self) -> Colour"""
10330 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
10332 def SetBackgroundColour(*args
, **kwargs
):
10333 """SetBackgroundColour(self, Colour colBack)"""
10334 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
10336 def GetBackgroundColour(*args
, **kwargs
):
10337 """GetBackgroundColour(self) -> Colour"""
10338 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
10340 def SetBitmaps(*args
, **kwargs
):
10341 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10342 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
10344 def SetDisabledBitmap(*args
, **kwargs
):
10345 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10346 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
10348 def GetDisabledBitmap(*args
, **kwargs
):
10349 """GetDisabledBitmap(self) -> Bitmap"""
10350 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
10352 def SetMarginWidth(*args
, **kwargs
):
10353 """SetMarginWidth(self, int nWidth)"""
10354 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
10356 def GetMarginWidth(*args
, **kwargs
):
10357 """GetMarginWidth(self) -> int"""
10358 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
10360 def GetDefaultMarginWidth(*args
, **kwargs
):
10361 """GetDefaultMarginWidth() -> int"""
10362 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10364 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
10365 def IsOwnerDrawn(*args
, **kwargs
):
10366 """IsOwnerDrawn(self) -> bool"""
10367 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
10369 def SetOwnerDrawn(*args
, **kwargs
):
10370 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10371 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
10373 def ResetOwnerDrawn(*args
, **kwargs
):
10374 """ResetOwnerDrawn(self)"""
10375 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
10377 MenuItem_swigregister
= _core_
.MenuItem_swigregister
10378 MenuItem_swigregister(MenuItem
)
10380 def MenuItem_GetLabelFromText(*args
, **kwargs
):
10381 """MenuItem_GetLabelFromText(String text) -> String"""
10382 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10384 def MenuItem_GetDefaultMarginWidth(*args
):
10385 """MenuItem_GetDefaultMarginWidth() -> int"""
10386 return _core_
.MenuItem_GetDefaultMarginWidth(*args
)
10388 #---------------------------------------------------------------------------
10390 class Control(Window
):
10392 This is the base class for a control or 'widget'.
10394 A control is generally a small window which processes user input
10395 and/or displays one or more item of data.
10397 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10398 __repr__
= _swig_repr
10399 def __init__(self
, *args
, **kwargs
):
10401 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10402 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10403 String name=ControlNameStr) -> Control
10405 Create a Control. Normally you should only call this from a subclass'
10406 __init__ as a plain old wx.Control is not very useful.
10408 _core_
.Control_swiginit(self
,_core_
.new_Control(*args
, **kwargs
))
10409 self
._setOORInfo
(self
)
10411 def Create(*args
, **kwargs
):
10413 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10414 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10415 String name=ControlNameStr) -> bool
10417 Do the 2nd phase and create the GUI control.
10419 return _core_
.Control_Create(*args
, **kwargs
)
10421 def Command(*args
, **kwargs
):
10423 Command(self, CommandEvent event)
10425 Simulates the effect of the user issuing a command to the item.
10427 :see: `wx.CommandEvent`
10430 return _core_
.Control_Command(*args
, **kwargs
)
10432 def GetLabel(*args
, **kwargs
):
10434 GetLabel(self) -> String
10436 Return a control's text.
10438 return _core_
.Control_GetLabel(*args
, **kwargs
)
10440 def GetClassDefaultAttributes(*args
, **kwargs
):
10442 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10444 Get the default attributes for this class. This is useful if you want
10445 to use the same font or colour in your own control as in a standard
10446 control -- which is a much better idea than hard coding specific
10447 colours or fonts which might look completely out of place on the
10448 user's system, especially if it uses themes.
10450 The variant parameter is only relevant under Mac currently and is
10451 ignore under other platforms. Under Mac, it will change the size of
10452 the returned font. See `wx.Window.SetWindowVariant` for more about
10455 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10457 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
10458 Control_swigregister
= _core_
.Control_swigregister
10459 Control_swigregister(Control
)
10460 ControlNameStr
= cvar
.ControlNameStr
10462 def PreControl(*args
, **kwargs
):
10464 PreControl() -> Control
10466 Precreate a Control control for 2-phase creation
10468 val
= _core_
.new_PreControl(*args
, **kwargs
)
10471 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
10473 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10475 Get the default attributes for this class. This is useful if you want
10476 to use the same font or colour in your own control as in a standard
10477 control -- which is a much better idea than hard coding specific
10478 colours or fonts which might look completely out of place on the
10479 user's system, especially if it uses themes.
10481 The variant parameter is only relevant under Mac currently and is
10482 ignore under other platforms. Under Mac, it will change the size of
10483 the returned font. See `wx.Window.SetWindowVariant` for more about
10486 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10488 #---------------------------------------------------------------------------
10490 class ItemContainer(object):
10492 The wx.ItemContainer class defines an interface which is implemented
10493 by all controls which have string subitems, each of which may be
10494 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10495 as `wx.ComboBox` which implements an extended interface deriving from
10498 It defines the methods for accessing the control's items and although
10499 each of the derived classes implements them differently, they still
10500 all conform to the same interface.
10502 The items in a wx.ItemContainer have (non empty) string labels and,
10503 optionally, client data associated with them.
10506 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10507 def __init__(self
): raise AttributeError, "No constructor defined"
10508 __repr__
= _swig_repr
10509 def Append(*args
, **kwargs
):
10511 Append(self, String item, PyObject clientData=None) -> int
10513 Adds the item to the control, associating the given data with the item
10514 if not None. The return value is the index of the newly added item
10515 which may be different from the last one if the control is sorted (e.g.
10516 has wx.LB_SORT or wx.CB_SORT style).
10518 return _core_
.ItemContainer_Append(*args
, **kwargs
)
10520 def AppendItems(*args
, **kwargs
):
10522 AppendItems(self, List strings)
10524 Apend several items at once to the control. Notice that calling this
10525 method may be much faster than appending the items one by one if you
10526 need to add a lot of items.
10528 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
10530 def Insert(*args
, **kwargs
):
10532 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10534 Insert an item into the control before the item at the ``pos`` index,
10535 optionally associating some data object with the item.
10537 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
10539 def Clear(*args
, **kwargs
):
10543 Removes all items from the control.
10545 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
10547 def Delete(*args
, **kwargs
):
10549 Delete(self, unsigned int n)
10551 Deletes the item at the zero-based index 'n' from the control. Note
10552 that it is an error (signalled by a `wx.PyAssertionError` exception if
10553 enabled) to remove an item with the index negative or greater or equal
10554 than the number of items in the control.
10556 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
10558 def GetClientData(*args
, **kwargs
):
10560 GetClientData(self, unsigned int n) -> PyObject
10562 Returns the client data associated with the given item, (if any.)
10564 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
10566 def SetClientData(*args
, **kwargs
):
10568 SetClientData(self, unsigned int n, PyObject clientData)
10570 Associate the given client data with the item at position n.
10572 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
10574 def GetCount(*args
, **kwargs
):
10576 GetCount(self) -> unsigned int
10578 Returns the number of items in the control.
10580 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
10582 def IsEmpty(*args
, **kwargs
):
10584 IsEmpty(self) -> bool
10586 Returns True if the control is empty or False if it has some items.
10588 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
10590 def GetString(*args
, **kwargs
):
10592 GetString(self, unsigned int n) -> String
10594 Returns the label of the item with the given index.
10596 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
10598 def GetStrings(*args
, **kwargs
):
10599 """GetStrings(self) -> wxArrayString"""
10600 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
10602 def SetString(*args
, **kwargs
):
10604 SetString(self, unsigned int n, String s)
10606 Sets the label for the given item.
10608 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
10610 def FindString(*args
, **kwargs
):
10612 FindString(self, String s) -> int
10614 Finds an item whose label matches the given string. Returns the
10615 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10618 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
10620 def SetSelection(*args
, **kwargs
):
10622 SetSelection(self, int n)
10624 Sets the item at index 'n' to be the selected item.
10626 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
10628 def GetSelection(*args
, **kwargs
):
10630 GetSelection(self) -> int
10632 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10635 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
10637 def SetStringSelection(*args
, **kwargs
):
10638 """SetStringSelection(self, String s) -> bool"""
10639 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
10641 def GetStringSelection(*args
, **kwargs
):
10643 GetStringSelection(self) -> String
10645 Returns the label of the selected item or an empty string if no item
10648 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
10650 def Select(*args
, **kwargs
):
10652 Select(self, int n)
10654 This is the same as `SetSelection` and exists only because it is
10655 slightly more natural for controls which support multiple selection.
10657 return _core_
.ItemContainer_Select(*args
, **kwargs
)
10659 ItemContainer_swigregister
= _core_
.ItemContainer_swigregister
10660 ItemContainer_swigregister(ItemContainer
)
10662 #---------------------------------------------------------------------------
10664 class ControlWithItems(Control
,ItemContainer
):
10666 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10667 wx.Control class, and is used for the base class of various controls
10670 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10671 def __init__(self
): raise AttributeError, "No constructor defined"
10672 __repr__
= _swig_repr
10673 ControlWithItems_swigregister
= _core_
.ControlWithItems_swigregister
10674 ControlWithItems_swigregister(ControlWithItems
)
10676 #---------------------------------------------------------------------------
10678 class SizerItem(Object
):
10680 The wx.SizerItem class is used to track the position, size and other
10681 attributes of each item managed by a `wx.Sizer`. In normal usage user
10682 code should never need to deal directly with a wx.SizerItem, but
10683 custom classes derived from `wx.PySizer` will probably need to use the
10684 collection of wx.SizerItems held by wx.Sizer when calculating layout.
10686 :see: `wx.Sizer`, `wx.GBSizerItem`
10688 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10689 __repr__
= _swig_repr
10690 def __init__(self
, *args
, **kwargs
):
10692 __init__(self) -> SizerItem
10694 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10695 size will need to be set before this item can be used in a Sizer.
10697 You will probably never need to create a wx.SizerItem directly as they
10698 are created automatically when the sizer's Add, Insert or Prepend
10699 methods are called.
10701 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10703 _core_
.SizerItem_swiginit(self
,_core_
.new_SizerItem(*args
, **kwargs
))
10704 __swig_destroy__
= _core_
.delete_SizerItem
10705 __del__
= lambda self
: None;
10706 def DeleteWindows(*args
, **kwargs
):
10708 DeleteWindows(self)
10710 Destroy the window or the windows in a subsizer, depending on the type
10713 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
10715 def DetachSizer(*args
, **kwargs
):
10719 Enable deleting the SizerItem without destroying the contained sizer.
10721 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
10723 def GetSize(*args
, **kwargs
):
10725 GetSize(self) -> Size
10727 Get the current size of the item, as set in the last Layout.
10729 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
10731 def CalcMin(*args
, **kwargs
):
10733 CalcMin(self) -> Size
10735 Calculates the minimum desired size for the item, including any space
10738 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
10740 def SetDimension(*args
, **kwargs
):
10742 SetDimension(self, Point pos, Size size)
10744 Set the position and size of the space allocated for this item by the
10745 sizer, and adjust the position and size of the item (window or
10746 subsizer) to be within that space taking alignment and borders into
10749 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
10751 def GetMinSize(*args
, **kwargs
):
10753 GetMinSize(self) -> Size
10755 Get the minimum size needed for the item.
10757 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
10759 def GetMinSizeWithBorder(*args
, **kwargs
):
10761 GetMinSizeWithBorder(self) -> Size
10763 Get the minimum size needed for the item with space for the borders
10766 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
10768 def SetInitSize(*args
, **kwargs
):
10769 """SetInitSize(self, int x, int y)"""
10770 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
10772 def SetRatioWH(*args
, **kwargs
):
10774 SetRatioWH(self, int width, int height)
10776 Set the ratio item attribute.
10778 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
10780 def SetRatioSize(*args
, **kwargs
):
10782 SetRatioSize(self, Size size)
10784 Set the ratio item attribute.
10786 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
10788 def SetRatio(*args
, **kwargs
):
10790 SetRatio(self, float ratio)
10792 Set the ratio item attribute.
10794 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
10796 def GetRatio(*args
, **kwargs
):
10798 GetRatio(self) -> float
10800 Set the ratio item attribute.
10802 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
10804 def GetRect(*args
, **kwargs
):
10806 GetRect(self) -> Rect
10808 Returns the rectangle that the sizer item should occupy
10810 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
10812 def IsWindow(*args
, **kwargs
):
10814 IsWindow(self) -> bool
10816 Is this sizer item a window?
10818 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
10820 def IsSizer(*args
, **kwargs
):
10822 IsSizer(self) -> bool
10824 Is this sizer item a subsizer?
10826 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
10828 def IsSpacer(*args
, **kwargs
):
10830 IsSpacer(self) -> bool
10832 Is this sizer item a spacer?
10834 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
10836 def SetProportion(*args
, **kwargs
):
10838 SetProportion(self, int proportion)
10840 Set the proportion value for this item.
10842 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
10844 def GetProportion(*args
, **kwargs
):
10846 GetProportion(self) -> int
10848 Get the proportion value for this item.
10850 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
10852 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
10853 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
10854 def SetFlag(*args
, **kwargs
):
10856 SetFlag(self, int flag)
10858 Set the flag value for this item.
10860 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
10862 def GetFlag(*args
, **kwargs
):
10864 GetFlag(self) -> int
10866 Get the flag value for this item.
10868 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
10870 def SetBorder(*args
, **kwargs
):
10872 SetBorder(self, int border)
10874 Set the border value for this item.
10876 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
10878 def GetBorder(*args
, **kwargs
):
10880 GetBorder(self) -> int
10882 Get the border value for this item.
10884 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
10886 def GetWindow(*args
, **kwargs
):
10888 GetWindow(self) -> Window
10890 Get the window (if any) that is managed by this sizer item.
10892 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
10894 def SetWindow(*args
, **kwargs
):
10896 SetWindow(self, Window window)
10898 Set the window to be managed by this sizer item.
10900 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
10902 def GetSizer(*args
, **kwargs
):
10904 GetSizer(self) -> Sizer
10906 Get the subsizer (if any) that is managed by this sizer item.
10908 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
10910 def SetSizer(*args
, **kwargs
):
10912 SetSizer(self, Sizer sizer)
10914 Set the subsizer to be managed by this sizer item.
10916 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
10918 def GetSpacer(*args
, **kwargs
):
10920 GetSpacer(self) -> Size
10922 Get the size of the spacer managed by this sizer item.
10924 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
10926 def SetSpacer(*args
, **kwargs
):
10928 SetSpacer(self, Size size)
10930 Set the size of the spacer to be managed by this sizer item.
10932 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
10934 def Show(*args
, **kwargs
):
10936 Show(self, bool show)
10938 Set the show item attribute, which sizers use to determine if the item
10939 is to be made part of the layout or not. If the item is tracking a
10940 window then it is shown or hidden as needed.
10942 return _core_
.SizerItem_Show(*args
, **kwargs
)
10944 def IsShown(*args
, **kwargs
):
10946 IsShown(self) -> bool
10948 Is the item to be shown in the layout?
10950 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
10952 def GetPosition(*args
, **kwargs
):
10954 GetPosition(self) -> Point
10956 Returns the current position of the item, as set in the last Layout.
10958 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
10960 def GetUserData(*args
, **kwargs
):
10962 GetUserData(self) -> PyObject
10964 Returns the userData associated with this sizer item, or None if there
10967 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
10969 def SetUserData(*args
, **kwargs
):
10971 SetUserData(self, PyObject userData)
10973 Associate a Python object with this sizer item.
10975 return _core_
.SizerItem_SetUserData(*args
, **kwargs
)
10977 SizerItem_swigregister
= _core_
.SizerItem_swigregister
10978 SizerItem_swigregister(SizerItem
)
10980 def SizerItemWindow(*args
, **kwargs
):
10982 SizerItemWindow(Window window, int proportion, int flag, int border,
10983 PyObject userData=None) -> SizerItem
10985 Constructs a `wx.SizerItem` for tracking a window.
10987 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
10990 def SizerItemSpacer(*args
, **kwargs
):
10992 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10993 PyObject userData=None) -> SizerItem
10995 Constructs a `wx.SizerItem` for tracking a spacer.
10997 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
11000 def SizerItemSizer(*args
, **kwargs
):
11002 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11003 PyObject userData=None) -> SizerItem
11005 Constructs a `wx.SizerItem` for tracking a subsizer
11007 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
11010 class Sizer(Object
):
11012 wx.Sizer is the abstract base class used for laying out subwindows in
11013 a window. You cannot use wx.Sizer directly; instead, you will have to
11014 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11015 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11016 and `wx.GridBagSizer`.
11018 The concept implemented by sizers in wxWidgets is closely related to
11019 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11020 toolkit or the Qt toolkit. It is based upon the idea of the individual
11021 subwindows reporting their minimal required size and their ability to
11022 get stretched if the size of the parent window has changed. This will
11023 most often mean that the programmer does not set the original size of
11024 a dialog in the beginning, rather the dialog will assigned a sizer and
11025 this sizer will be queried about the recommended size. The sizer in
11026 turn will query its children, which can be normal windows or contorls,
11027 empty space or other sizers, so that a hierarchy of sizers can be
11028 constructed. Note that wxSizer does not derive from wxWindow and thus
11029 do not interfere with tab ordering and requires very little resources
11030 compared to a real window on screen.
11032 What makes sizers so well fitted for use in wxWidgets is the fact that
11033 every control reports its own minimal size and the algorithm can
11034 handle differences in font sizes or different window (dialog item)
11035 sizes on different platforms without problems. If for example the
11036 standard font as well as the overall design of Mac widgets requires
11037 more space than on Windows, then the initial size of a dialog using a
11038 sizer will automatically be bigger on Mac than on Windows.
11040 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11041 def __init__(self
): raise AttributeError, "No constructor defined"
11042 __repr__
= _swig_repr
11043 __swig_destroy__
= _core_
.delete_Sizer
11044 __del__
= lambda self
: None;
11045 def _setOORInfo(*args
, **kwargs
):
11046 """_setOORInfo(self, PyObject _self)"""
11047 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
11049 def Add(*args
, **kwargs
):
11051 Add(self, item, int proportion=0, int flag=0, int border=0,
11052 PyObject userData=None) -> wx.SizerItem
11054 Appends a child item to the sizer.
11056 return _core_
.Sizer_Add(*args
, **kwargs
)
11058 def Insert(*args
, **kwargs
):
11060 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11061 PyObject userData=None) -> wx.SizerItem
11063 Inserts a new item into the list of items managed by this sizer before
11064 the item at index *before*. See `Add` for a description of the parameters.
11066 return _core_
.Sizer_Insert(*args
, **kwargs
)
11068 def Prepend(*args
, **kwargs
):
11070 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11071 PyObject userData=None) -> wx.SizerItem
11073 Adds a new item to the begining of the list of sizer items managed by
11074 this sizer. See `Add` for a description of the parameters.
11076 return _core_
.Sizer_Prepend(*args
, **kwargs
)
11078 def Remove(*args
, **kwargs
):
11080 Remove(self, item) -> bool
11082 Removes an item from the sizer and destroys it. This method does not
11083 cause any layout or resizing to take place, call `Layout` to update
11084 the layout on screen after removing a child from the sizer. The
11085 *item* parameter can be either a window, a sizer, or the zero-based
11086 index of an item to remove. Returns True if the child item was found
11089 return _core_
.Sizer_Remove(*args
, **kwargs
)
11091 def Detach(*args
, **kwargs
):
11093 Detach(self, item) -> bool
11095 Detaches an item from the sizer without destroying it. This method
11096 does not cause any layout or resizing to take place, call `Layout` to
11097 do so. The *item* parameter can be either a window, a sizer, or the
11098 zero-based index of the item to be detached. Returns True if the child item
11099 was found and detached.
11101 return _core_
.Sizer_Detach(*args
, **kwargs
)
11103 def GetItem(*args
, **kwargs
):
11105 GetItem(self, item) -> wx.SizerItem
11107 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11108 parameter can be either a window, a sizer, or the zero-based index of
11109 the item to be found.
11111 return _core_
.Sizer_GetItem(*args
, **kwargs
)
11113 def _SetItemMinSize(*args
, **kwargs
):
11114 """_SetItemMinSize(self, PyObject item, Size size)"""
11115 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
11117 def SetItemMinSize(self
, item
, *args
):
11119 SetItemMinSize(self, item, Size size)
11121 Sets the minimum size that will be allocated for an item in the sizer.
11122 The *item* parameter can be either a window, a sizer, or the
11123 zero-based index of the item. If a window or sizer is given then it
11124 will be searched for recursivly in subsizers if neccessary.
11127 # for backward compatibility accept separate width,height args too
11128 return self
._SetItemMinSize
(item
, args
)
11130 return self
._SetItemMinSize
(item
, args
[0])
11132 def AddItem(*args
, **kwargs
):
11134 AddItem(self, SizerItem item)
11136 Adds a `wx.SizerItem` to the sizer.
11138 return _core_
.Sizer_AddItem(*args
, **kwargs
)
11140 def InsertItem(*args
, **kwargs
):
11142 InsertItem(self, int index, SizerItem item)
11144 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11146 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
11148 def PrependItem(*args
, **kwargs
):
11150 PrependItem(self, SizerItem item)
11152 Prepends a `wx.SizerItem` to the sizer.
11154 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
11156 def AddMany(self
, items
):
11158 AddMany is a convenience method for adding several items
11159 to a sizer at one time. Simply pass it a list of tuples,
11160 where each tuple consists of the parameters that you
11161 would normally pass to the `Add` method.
11164 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
11168 # for backwards compatibility only, please do not use in new code
11169 def AddWindow(self
, *args
, **kw
):
11170 """Compatibility alias for `Add`."""
11171 return self
.Add(*args
, **kw
)
11172 def AddSizer(self
, *args
, **kw
):
11173 """Compatibility alias for `Add`."""
11174 return self
.Add(*args
, **kw
)
11175 def AddSpacer(self
, *args
, **kw
):
11176 """Compatibility alias for `Add`."""
11177 return self
.Add(*args
, **kw
)
11179 def PrependWindow(self
, *args
, **kw
):
11180 """Compatibility alias for `Prepend`."""
11181 return self
.Prepend(*args
, **kw
)
11182 def PrependSizer(self
, *args
, **kw
):
11183 """Compatibility alias for `Prepend`."""
11184 return self
.Prepend(*args
, **kw
)
11185 def PrependSpacer(self
, *args
, **kw
):
11186 """Compatibility alias for `Prepend`."""
11187 return self
.Prepend(*args
, **kw
)
11189 def InsertWindow(self
, *args
, **kw
):
11190 """Compatibility alias for `Insert`."""
11191 return self
.Insert(*args
, **kw
)
11192 def InsertSizer(self
, *args
, **kw
):
11193 """Compatibility alias for `Insert`."""
11194 return self
.Insert(*args
, **kw
)
11195 def InsertSpacer(self
, *args
, **kw
):
11196 """Compatibility alias for `Insert`."""
11197 return self
.Insert(*args
, **kw
)
11199 def RemoveWindow(self
, *args
, **kw
):
11200 """Compatibility alias for `Remove`."""
11201 return self
.Remove(*args
, **kw
)
11202 def RemoveSizer(self
, *args
, **kw
):
11203 """Compatibility alias for `Remove`."""
11204 return self
.Remove(*args
, **kw
)
11205 def RemovePos(self
, *args
, **kw
):
11206 """Compatibility alias for `Remove`."""
11207 return self
.Remove(*args
, **kw
)
11210 def SetDimension(*args
, **kwargs
):
11212 SetDimension(self, int x, int y, int width, int height)
11214 Call this to force the sizer to take the given dimension and thus
11215 force the items owned by the sizer to resize themselves according to
11216 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11219 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
11221 def SetMinSize(*args
, **kwargs
):
11223 SetMinSize(self, Size size)
11225 Call this to give the sizer a minimal size. Normally, the sizer will
11226 calculate its minimal size based purely on how much space its children
11227 need. After calling this method `GetMinSize` will return either the
11228 minimal size as requested by its children or the minimal size set
11229 here, depending on which is bigger.
11231 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
11233 def GetSize(*args
, **kwargs
):
11235 GetSize(self) -> Size
11237 Returns the current size of the space managed by the sizer.
11239 return _core_
.Sizer_GetSize(*args
, **kwargs
)
11241 def GetPosition(*args
, **kwargs
):
11243 GetPosition(self) -> Point
11245 Returns the current position of the sizer's managed space.
11247 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
11249 def GetMinSize(*args
, **kwargs
):
11251 GetMinSize(self) -> Size
11253 Returns the minimal size of the sizer. This is either the combined
11254 minimal size of all the children and their borders or the minimal size
11255 set by SetMinSize, depending on which is bigger.
11257 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
11259 def GetSizeTuple(self
):
11260 return self
.GetSize().Get()
11261 def GetPositionTuple(self
):
11262 return self
.GetPosition().Get()
11263 def GetMinSizeTuple(self
):
11264 return self
.GetMinSize().Get()
11266 def RecalcSizes(*args
, **kwargs
):
11270 Using the sizes calculated by `CalcMin` reposition and resize all the
11271 items managed by this sizer. You should not need to call this directly as
11272 it is called by `Layout`.
11274 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
11276 def CalcMin(*args
, **kwargs
):
11278 CalcMin(self) -> Size
11280 This method is where the sizer will do the actual calculation of its
11281 children's minimal sizes. You should not need to call this directly as
11282 it is called by `Layout`.
11284 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
11286 def Layout(*args
, **kwargs
):
11290 This method will force the recalculation and layout of the items
11291 controlled by the sizer using the current space allocated to the
11292 sizer. Normally this is called automatically from the owning window's
11293 EVT_SIZE handler, but it is also useful to call it from user code when
11294 one of the items in a sizer change size, or items are added or
11297 return _core_
.Sizer_Layout(*args
, **kwargs
)
11299 def Fit(*args
, **kwargs
):
11301 Fit(self, Window window) -> Size
11303 Tell the sizer to resize the *window* to match the sizer's minimal
11304 size. This is commonly done in the constructor of the window itself in
11305 order to set its initial size to match the needs of the children as
11306 determined by the sizer. Returns the new size.
11308 For a top level window this is the total window size, not the client size.
11310 return _core_
.Sizer_Fit(*args
, **kwargs
)
11312 def FitInside(*args
, **kwargs
):
11314 FitInside(self, Window window)
11316 Tell the sizer to resize the *virtual size* of the *window* to match the
11317 sizer's minimal size. This will not alter the on screen size of the
11318 window, but may cause the addition/removal/alteration of scrollbars
11319 required to view the virtual area in windows which manage it.
11321 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11324 return _core_
.Sizer_FitInside(*args
, **kwargs
)
11326 def SetSizeHints(*args
, **kwargs
):
11328 SetSizeHints(self, Window window)
11330 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11331 match the sizer's minimal size. This is commonly done in the
11332 constructor of the window itself if the window is resizable (as are
11333 many dialogs under Unix and frames on probably all platforms) in order
11334 to prevent the window from being sized smaller than the minimal size
11335 required by the sizer.
11337 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
11339 def SetVirtualSizeHints(*args
, **kwargs
):
11341 SetVirtualSizeHints(self, Window window)
11343 Tell the sizer to set the minimal size of the window virtual area to
11344 match the sizer's minimal size. For windows with managed scrollbars
11345 this will set them appropriately.
11347 :see: `wx.ScrolledWindow.SetScrollbars`
11350 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
11352 def Clear(*args
, **kwargs
):
11354 Clear(self, bool deleteWindows=False)
11356 Clear all items from the sizer, optionally destroying the window items
11359 return _core_
.Sizer_Clear(*args
, **kwargs
)
11361 def DeleteWindows(*args
, **kwargs
):
11363 DeleteWindows(self)
11365 Destroy all windows managed by the sizer.
11367 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
11369 def GetChildren(*args
, **kwargs
):
11371 GetChildren(self) -> list
11373 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11375 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
11377 def Show(*args
, **kwargs
):
11379 Show(self, item, bool show=True, bool recursive=false) -> bool
11381 Shows or hides an item managed by the sizer. To make a sizer item
11382 disappear or reappear, use Show followed by `Layout`. The *item*
11383 parameter can be either a window, a sizer, or the zero-based index of
11384 the item. Use the recursive parameter to show or hide an item in a
11385 subsizer. Returns True if the item was found.
11387 return _core_
.Sizer_Show(*args
, **kwargs
)
11389 def IsShown(*args
, **kwargs
):
11391 IsShown(self, item)
11393 Determines if the item is currently shown. To make a sizer
11394 item disappear or reappear, use Show followed by `Layout`. The *item*
11395 parameter can be either a window, a sizer, or the zero-based index of
11398 return _core_
.Sizer_IsShown(*args
, **kwargs
)
11400 def Hide(self
, item
, recursive
=False):
11402 A convenience method for `Show` (item, False, recursive).
11404 return self
.Show(item
, False, recursive
)
11406 def ShowItems(*args
, **kwargs
):
11408 ShowItems(self, bool show)
11410 Recursively call `wx.SizerItem.Show` on all sizer items.
11412 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
11414 Sizer_swigregister
= _core_
.Sizer_swigregister
11415 Sizer_swigregister(Sizer
)
11417 class PySizer(Sizer
):
11419 wx.PySizer is a special version of `wx.Sizer` that has been
11420 instrumented to allow the C++ virtual methods to be overloaded in
11421 Python derived classes. You would derive from this class if you are
11422 wanting to implement a custom sizer in Python code. Simply implement
11423 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11426 class MySizer(wx.PySizer):
11427 def __init__(self):
11428 wx.PySizer.__init__(self)
11431 for item in self.GetChildren():
11432 # calculate the total minimum width and height needed
11433 # by all items in the sizer according to this sizer's
11434 # layout algorithm.
11436 return wx.Size(width, height)
11438 def RecalcSizes(self):
11439 # find the space allotted to this sizer
11440 pos = self.GetPosition()
11441 size = self.GetSize()
11442 for item in self.GetChildren():
11443 # Recalculate (if necessary) the position and size of
11444 # each item and then call item.SetDimension to do the
11445 # actual positioning and sizing of the items within the
11446 # space alloted to this sizer.
11448 item.SetDimension(itemPos, itemSize)
11451 When `Layout` is called it first calls `CalcMin` followed by
11452 `RecalcSizes` so you can optimize a bit by saving the results of
11453 `CalcMin` and reusing them in `RecalcSizes`.
11455 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11459 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11460 __repr__
= _swig_repr
11461 def __init__(self
, *args
, **kwargs
):
11463 __init__(self) -> PySizer
11465 Creates a wx.PySizer. Must be called from the __init__ in the derived
11468 _core_
.PySizer_swiginit(self
,_core_
.new_PySizer(*args
, **kwargs
))
11469 self
._setCallbackInfo
(self
, PySizer
);self
._setOORInfo
(self
)
11471 def _setCallbackInfo(*args
, **kwargs
):
11472 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11473 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
11475 PySizer_swigregister
= _core_
.PySizer_swigregister
11476 PySizer_swigregister(PySizer
)
11478 #---------------------------------------------------------------------------
11480 class BoxSizer(Sizer
):
11482 The basic idea behind a box sizer is that windows will most often be
11483 laid out in rather simple basic geometry, typically in a row or a
11484 column or nested hierarchies of either. A wx.BoxSizer will lay out
11485 its items in a simple row or column, depending on the orientation
11486 parameter passed to the constructor.
11488 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11489 __repr__
= _swig_repr
11490 def __init__(self
, *args
, **kwargs
):
11492 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11494 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11495 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11498 _core_
.BoxSizer_swiginit(self
,_core_
.new_BoxSizer(*args
, **kwargs
))
11499 self
._setOORInfo
(self
)
11501 def GetOrientation(*args
, **kwargs
):
11503 GetOrientation(self) -> int
11505 Returns the current orientation of the sizer.
11507 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
11509 def SetOrientation(*args
, **kwargs
):
11511 SetOrientation(self, int orient)
11513 Resets the orientation of the sizer.
11515 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
11517 BoxSizer_swigregister
= _core_
.BoxSizer_swigregister
11518 BoxSizer_swigregister(BoxSizer
)
11520 #---------------------------------------------------------------------------
11522 class StaticBoxSizer(BoxSizer
):
11524 wx.StaticBoxSizer derives from and functions identically to the
11525 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11526 manages. Note that this static box must be created separately and
11527 passed to the sizer constructor.
11529 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11530 __repr__
= _swig_repr
11531 def __init__(self
, *args
, **kwargs
):
11533 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11535 Constructor. It takes an associated static box and the orientation
11536 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11539 _core_
.StaticBoxSizer_swiginit(self
,_core_
.new_StaticBoxSizer(*args
, **kwargs
))
11540 self
._setOORInfo
(self
)
11542 def GetStaticBox(*args
, **kwargs
):
11544 GetStaticBox(self) -> StaticBox
11546 Returns the static box associated with this sizer.
11548 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
11550 StaticBoxSizer_swigregister
= _core_
.StaticBoxSizer_swigregister
11551 StaticBoxSizer_swigregister(StaticBoxSizer
)
11553 #---------------------------------------------------------------------------
11555 class GridSizer(Sizer
):
11557 A grid sizer is a sizer which lays out its children in a
11558 two-dimensional table with all cells having the same size. In other
11559 words, the width of each cell within the grid is the width of the
11560 widest item added to the sizer and the height of each grid cell is the
11561 height of the tallest item. An optional vertical and/or horizontal
11562 gap between items can also be specified (in pixels.)
11564 Items are placed in the cells of the grid in the order they are added,
11565 in row-major order. In other words, the first row is filled first,
11566 then the second, and so on until all items have been added. (If
11567 neccessary, additional rows will be added as items are added.) If you
11568 need to have greater control over the cells that items are placed in
11569 then use the `wx.GridBagSizer`.
11572 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11573 __repr__
= _swig_repr
11574 def __init__(self
, *args
, **kwargs
):
11576 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11578 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11579 of columns and rows in the sizer - if either of the parameters is
11580 zero, it will be calculated to from the total number of children in
11581 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11582 define extra space between all children.
11584 _core_
.GridSizer_swiginit(self
,_core_
.new_GridSizer(*args
, **kwargs
))
11585 self
._setOORInfo
(self
)
11587 def SetCols(*args
, **kwargs
):
11589 SetCols(self, int cols)
11591 Sets the number of columns in the sizer.
11593 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
11595 def SetRows(*args
, **kwargs
):
11597 SetRows(self, int rows)
11599 Sets the number of rows in the sizer.
11601 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
11603 def SetVGap(*args
, **kwargs
):
11605 SetVGap(self, int gap)
11607 Sets the vertical gap (in pixels) between the cells in the sizer.
11609 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
11611 def SetHGap(*args
, **kwargs
):
11613 SetHGap(self, int gap)
11615 Sets the horizontal gap (in pixels) between cells in the sizer
11617 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
11619 def GetCols(*args
, **kwargs
):
11621 GetCols(self) -> int
11623 Returns the number of columns in the sizer.
11625 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
11627 def GetRows(*args
, **kwargs
):
11629 GetRows(self) -> int
11631 Returns the number of rows in the sizer.
11633 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
11635 def GetVGap(*args
, **kwargs
):
11637 GetVGap(self) -> int
11639 Returns the vertical gap (in pixels) between the cells in the sizer.
11641 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
11643 def GetHGap(*args
, **kwargs
):
11645 GetHGap(self) -> int
11647 Returns the horizontal gap (in pixels) between cells in the sizer.
11649 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
11651 def CalcRowsCols(self
):
11653 CalcRowsCols() -> (rows, cols)
11655 Calculates how many rows and columns will be in the sizer based
11656 on the current number of items and also the rows, cols specified
11657 in the constructor.
11659 nitems
= len(self
.GetChildren())
11660 rows
= self
.GetRows()
11661 cols
= self
.GetCols()
11662 assert rows
!= 0 or cols
!= 0, "Grid sizer must have either rows or columns fixed"
11664 rows
= (nitems
+ cols
- 1) / cols
11666 cols
= (nitems
+ rows
- 1) / rows
11667 return (rows
, cols
)
11669 GridSizer_swigregister
= _core_
.GridSizer_swigregister
11670 GridSizer_swigregister(GridSizer
)
11672 #---------------------------------------------------------------------------
11674 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
11675 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
11676 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
11677 class FlexGridSizer(GridSizer
):
11679 A flex grid sizer is a sizer which lays out its children in a
11680 two-dimensional table with all table cells in one row having the same
11681 height and all cells in one column having the same width, but all
11682 rows or all columns are not necessarily the same height or width as in
11683 the `wx.GridSizer`.
11685 wx.FlexGridSizer can also size items equally in one direction but
11686 unequally ("flexibly") in the other. If the sizer is only flexible
11687 in one direction (this can be changed using `SetFlexibleDirection`), it
11688 needs to be decided how the sizer should grow in the other ("non
11689 flexible") direction in order to fill the available space. The
11690 `SetNonFlexibleGrowMode` method serves this purpose.
11694 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11695 __repr__
= _swig_repr
11696 def __init__(self
, *args
, **kwargs
):
11698 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11700 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11701 number of columns and rows in the sizer - if either of the parameters
11702 is zero, it will be calculated to from the total number of children in
11703 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11704 define extra space between all children.
11706 _core_
.FlexGridSizer_swiginit(self
,_core_
.new_FlexGridSizer(*args
, **kwargs
))
11707 self
._setOORInfo
(self
)
11709 def AddGrowableRow(*args
, **kwargs
):
11711 AddGrowableRow(self, size_t idx, int proportion=0)
11713 Specifies that row *idx* (starting from zero) should be grown if there
11714 is extra space available to the sizer.
11716 The *proportion* parameter has the same meaning as the stretch factor
11717 for the box sizers except that if all proportions are 0, then all
11718 columns are resized equally (instead of not being resized at all).
11720 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
11722 def RemoveGrowableRow(*args
, **kwargs
):
11724 RemoveGrowableRow(self, size_t idx)
11726 Specifies that row *idx* is no longer growable.
11728 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
11730 def AddGrowableCol(*args
, **kwargs
):
11732 AddGrowableCol(self, size_t idx, int proportion=0)
11734 Specifies that column *idx* (starting from zero) should be grown if
11735 there is extra space available to the sizer.
11737 The *proportion* parameter has the same meaning as the stretch factor
11738 for the box sizers except that if all proportions are 0, then all
11739 columns are resized equally (instead of not being resized at all).
11741 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
11743 def RemoveGrowableCol(*args
, **kwargs
):
11745 RemoveGrowableCol(self, size_t idx)
11747 Specifies that column *idx* is no longer growable.
11749 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
11751 def SetFlexibleDirection(*args
, **kwargs
):
11753 SetFlexibleDirection(self, int direction)
11755 Specifies whether the sizer should flexibly resize its columns, rows,
11756 or both. Argument *direction* can be one of the following values. Any
11757 other value is ignored.
11759 ============== =======================================
11760 wx.VERTICAL Rows are flexibly sized.
11761 wx.HORIZONTAL Columns are flexibly sized.
11762 wx.BOTH Both rows and columns are flexibly sized
11763 (this is the default value).
11764 ============== =======================================
11766 Note that this method does not trigger relayout.
11769 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
11771 def GetFlexibleDirection(*args
, **kwargs
):
11773 GetFlexibleDirection(self) -> int
11775 Returns a value that specifies whether the sizer
11776 flexibly resizes its columns, rows, or both (default).
11778 :see: `SetFlexibleDirection`
11780 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
11782 def SetNonFlexibleGrowMode(*args
, **kwargs
):
11784 SetNonFlexibleGrowMode(self, int mode)
11786 Specifies how the sizer should grow in the non-flexible direction if
11787 there is one (so `SetFlexibleDirection` must have been called
11788 previously). Argument *mode* can be one of the following values:
11790 ========================== =================================================
11791 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11792 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11793 `AddGrowableCol` and `AddGrowableRow`. In this
11794 case equal sizing applies to minimum sizes of
11795 columns or rows (this is the default value).
11796 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11797 the non flexible direction, whether they are
11798 growable or not in the flexbile direction.
11799 ========================== =================================================
11801 Note that this method does not trigger relayout.
11805 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
11807 def GetNonFlexibleGrowMode(*args
, **kwargs
):
11809 GetNonFlexibleGrowMode(self) -> int
11811 Returns the value that specifies how the sizer grows in the
11812 non-flexible direction if there is one.
11814 :see: `SetNonFlexibleGrowMode`
11816 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
11818 def GetRowHeights(*args
, **kwargs
):
11820 GetRowHeights(self) -> list
11822 Returns a list of integers representing the heights of each of the
11825 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
11827 def GetColWidths(*args
, **kwargs
):
11829 GetColWidths(self) -> list
11831 Returns a list of integers representing the widths of each of the
11832 columns in the sizer.
11834 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
11836 FlexGridSizer_swigregister
= _core_
.FlexGridSizer_swigregister
11837 FlexGridSizer_swigregister(FlexGridSizer
)
11839 class StdDialogButtonSizer(BoxSizer
):
11841 A special sizer that knows how to order and position standard buttons
11842 in order to conform to the current platform's standards. You simply
11843 need to add each `wx.Button` to the sizer, and be sure to create the
11844 buttons using the standard ID's. Then call `Realize` and the sizer
11845 will take care of the rest.
11848 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11849 __repr__
= _swig_repr
11850 def __init__(self
, *args
, **kwargs
):
11851 """__init__(self) -> StdDialogButtonSizer"""
11852 _core_
.StdDialogButtonSizer_swiginit(self
,_core_
.new_StdDialogButtonSizer(*args
, **kwargs
))
11853 def AddButton(*args
, **kwargs
):
11855 AddButton(self, wxButton button)
11857 Use this to add the buttons to this sizer. Do not use the `Add`
11858 method in the base class.
11860 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
11862 def Realize(*args
, **kwargs
):
11866 This funciton needs to be called after all the buttons have been added
11867 to the sizer. It will reorder them and position them in a platform
11870 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
11872 def SetAffirmativeButton(*args
, **kwargs
):
11873 """SetAffirmativeButton(self, wxButton button)"""
11874 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
11876 def SetNegativeButton(*args
, **kwargs
):
11877 """SetNegativeButton(self, wxButton button)"""
11878 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
11880 def SetCancelButton(*args
, **kwargs
):
11881 """SetCancelButton(self, wxButton button)"""
11882 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
11884 def GetAffirmativeButton(*args
, **kwargs
):
11885 """GetAffirmativeButton(self) -> wxButton"""
11886 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
11888 def GetApplyButton(*args
, **kwargs
):
11889 """GetApplyButton(self) -> wxButton"""
11890 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
11892 def GetNegativeButton(*args
, **kwargs
):
11893 """GetNegativeButton(self) -> wxButton"""
11894 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
11896 def GetCancelButton(*args
, **kwargs
):
11897 """GetCancelButton(self) -> wxButton"""
11898 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
11900 def GetHelpButton(*args
, **kwargs
):
11901 """GetHelpButton(self) -> wxButton"""
11902 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
11904 StdDialogButtonSizer_swigregister
= _core_
.StdDialogButtonSizer_swigregister
11905 StdDialogButtonSizer_swigregister(StdDialogButtonSizer
)
11907 #---------------------------------------------------------------------------
11909 class GBPosition(object):
11911 This class represents the position of an item in a virtual grid of
11912 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11913 typemaps that will automatically convert from a 2-element sequence of
11914 integers to a wx.GBPosition, so you can use the more pythonic
11915 representation of the position nearly transparently in Python code.
11917 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11918 __repr__
= _swig_repr
11919 def __init__(self
, *args
, **kwargs
):
11921 __init__(self, int row=0, int col=0) -> GBPosition
11923 This class represents the position of an item in a virtual grid of
11924 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11925 typemaps that will automatically convert from a 2-element sequence of
11926 integers to a wx.GBPosition, so you can use the more pythonic
11927 representation of the position nearly transparently in Python code.
11929 _core_
.GBPosition_swiginit(self
,_core_
.new_GBPosition(*args
, **kwargs
))
11930 __swig_destroy__
= _core_
.delete_GBPosition
11931 __del__
= lambda self
: None;
11932 def GetRow(*args
, **kwargs
):
11933 """GetRow(self) -> int"""
11934 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
11936 def GetCol(*args
, **kwargs
):
11937 """GetCol(self) -> int"""
11938 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
11940 def SetRow(*args
, **kwargs
):
11941 """SetRow(self, int row)"""
11942 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
11944 def SetCol(*args
, **kwargs
):
11945 """SetCol(self, int col)"""
11946 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
11948 def __eq__(*args
, **kwargs
):
11950 __eq__(self, PyObject other) -> bool
11952 Compare GBPosition for equality.
11954 return _core_
.GBPosition___eq__(*args
, **kwargs
)
11956 def __ne__(*args
, **kwargs
):
11958 __ne__(self, PyObject other) -> bool
11960 Compare GBPosition for inequality.
11962 return _core_
.GBPosition___ne__(*args
, **kwargs
)
11964 def Set(*args
, **kwargs
):
11965 """Set(self, int row=0, int col=0)"""
11966 return _core_
.GBPosition_Set(*args
, **kwargs
)
11968 def Get(*args
, **kwargs
):
11969 """Get(self) -> PyObject"""
11970 return _core_
.GBPosition_Get(*args
, **kwargs
)
11972 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
11973 def __str__(self
): return str(self
.Get())
11974 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
11975 def __len__(self
): return len(self
.Get())
11976 def __getitem__(self
, index
): return self
.Get()[index
]
11977 def __setitem__(self
, index
, val
):
11978 if index
== 0: self
.SetRow(val
)
11979 elif index
== 1: self
.SetCol(val
)
11980 else: raise IndexError
11981 def __nonzero__(self
): return self
.Get() != (0,0)
11982 __safe_for_unpickling__
= True
11983 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
11985 row
= property(GetRow
, SetRow
)
11986 col
= property(GetCol
, SetCol
)
11988 GBPosition_swigregister
= _core_
.GBPosition_swigregister
11989 GBPosition_swigregister(GBPosition
)
11991 class GBSpan(object):
11993 This class is used to hold the row and column spanning attributes of
11994 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11995 automatically convert from a 2-element sequence of integers to a
11996 wx.GBSpan, so you can use the more pythonic representation of the span
11997 nearly transparently in Python code.
12000 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12001 __repr__
= _swig_repr
12002 def __init__(self
, *args
, **kwargs
):
12004 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12006 Construct a new wxGBSpan, optionally setting the rowspan and
12007 colspan. The default is (1,1). (Meaning that the item occupies one
12008 cell in each direction.
12010 _core_
.GBSpan_swiginit(self
,_core_
.new_GBSpan(*args
, **kwargs
))
12011 __swig_destroy__
= _core_
.delete_GBSpan
12012 __del__
= lambda self
: None;
12013 def GetRowspan(*args
, **kwargs
):
12014 """GetRowspan(self) -> int"""
12015 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
12017 def GetColspan(*args
, **kwargs
):
12018 """GetColspan(self) -> int"""
12019 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
12021 def SetRowspan(*args
, **kwargs
):
12022 """SetRowspan(self, int rowspan)"""
12023 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
12025 def SetColspan(*args
, **kwargs
):
12026 """SetColspan(self, int colspan)"""
12027 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
12029 def __eq__(*args
, **kwargs
):
12031 __eq__(self, PyObject other) -> bool
12033 Compare wxGBSpan for equality.
12035 return _core_
.GBSpan___eq__(*args
, **kwargs
)
12037 def __ne__(*args
, **kwargs
):
12039 __ne__(self, PyObject other) -> bool
12041 Compare GBSpan for inequality.
12043 return _core_
.GBSpan___ne__(*args
, **kwargs
)
12045 def Set(*args
, **kwargs
):
12046 """Set(self, int rowspan=1, int colspan=1)"""
12047 return _core_
.GBSpan_Set(*args
, **kwargs
)
12049 def Get(*args
, **kwargs
):
12050 """Get(self) -> PyObject"""
12051 return _core_
.GBSpan_Get(*args
, **kwargs
)
12053 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12054 def __str__(self
): return str(self
.Get())
12055 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
12056 def __len__(self
): return len(self
.Get())
12057 def __getitem__(self
, index
): return self
.Get()[index
]
12058 def __setitem__(self
, index
, val
):
12059 if index
== 0: self
.SetRowspan(val
)
12060 elif index
== 1: self
.SetColspan(val
)
12061 else: raise IndexError
12062 def __nonzero__(self
): return self
.Get() != (0,0)
12063 __safe_for_unpickling__
= True
12064 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
12066 rowspan
= property(GetRowspan
, SetRowspan
)
12067 colspan
= property(GetColspan
, SetColspan
)
12069 GBSpan_swigregister
= _core_
.GBSpan_swigregister
12070 GBSpan_swigregister(GBSpan
)
12072 class GBSizerItem(SizerItem
):
12074 The wx.GBSizerItem class is used to track the additional data about
12075 items in a `wx.GridBagSizer` such as the item's position in the grid
12076 and how many rows or columns it spans.
12079 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12080 __repr__
= _swig_repr
12081 def __init__(self
, *args
, **kwargs
):
12083 __init__(self) -> GBSizerItem
12085 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12086 size will need to be set, as well as a position and span before this
12087 item can be used in a Sizer.
12089 You will probably never need to create a wx.GBSizerItem directly as they
12090 are created automatically when the sizer's Add method is called.
12092 _core_
.GBSizerItem_swiginit(self
,_core_
.new_GBSizerItem(*args
, **kwargs
))
12093 __swig_destroy__
= _core_
.delete_GBSizerItem
12094 __del__
= lambda self
: None;
12095 def GetPos(*args
, **kwargs
):
12097 GetPos(self) -> GBPosition
12099 Get the grid position of the item
12101 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
12103 def GetPosTuple(self
): return self
.GetPos().Get()
12104 def GetSpan(*args
, **kwargs
):
12106 GetSpan(self) -> GBSpan
12108 Get the row and column spanning of the item
12110 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
12112 def GetSpanTuple(self
): return self
.GetSpan().Get()
12113 def SetPos(*args
, **kwargs
):
12115 SetPos(self, GBPosition pos) -> bool
12117 If the item is already a member of a sizer then first ensure that
12118 there is no other item that would intersect with this one at the new
12119 position, then set the new position. Returns True if the change is
12120 successful and after the next Layout() the item will be moved.
12122 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
12124 def SetSpan(*args
, **kwargs
):
12126 SetSpan(self, GBSpan span) -> bool
12128 If the item is already a member of a sizer then first ensure that
12129 there is no other item that would intersect with this one with its new
12130 spanning size, then set the new spanning. Returns True if the change
12131 is successful and after the next Layout() the item will be resized.
12134 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
12136 def Intersects(*args
, **kwargs
):
12138 Intersects(self, GBSizerItem other) -> bool
12140 Returns True if this item and the other item instersect.
12142 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
12144 def IntersectsPos(*args
, **kwargs
):
12146 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12148 Returns True if the given pos/span would intersect with this item.
12150 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
12152 def GetEndPos(*args
, **kwargs
):
12154 GetEndPos(self) -> GBPosition
12156 Get the row and column of the endpoint of this item.
12158 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
12160 def GetGBSizer(*args
, **kwargs
):
12162 GetGBSizer(self) -> GridBagSizer
12164 Get the sizer this item is a member of.
12166 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
12168 def SetGBSizer(*args
, **kwargs
):
12170 SetGBSizer(self, GridBagSizer sizer)
12172 Set the sizer this item is a member of.
12174 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
12176 GBSizerItem_swigregister
= _core_
.GBSizerItem_swigregister
12177 GBSizerItem_swigregister(GBSizerItem
)
12178 DefaultSpan
= cvar
.DefaultSpan
12180 def GBSizerItemWindow(*args
, **kwargs
):
12182 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12183 int border, PyObject userData=None) -> GBSizerItem
12185 Construct a `wx.GBSizerItem` for a window.
12187 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
12190 def GBSizerItemSizer(*args
, **kwargs
):
12192 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12193 int border, PyObject userData=None) -> GBSizerItem
12195 Construct a `wx.GBSizerItem` for a sizer
12197 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
12200 def GBSizerItemSpacer(*args
, **kwargs
):
12202 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12203 int flag, int border, PyObject userData=None) -> GBSizerItem
12205 Construct a `wx.GBSizerItem` for a spacer.
12207 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
12210 class GridBagSizer(FlexGridSizer
):
12212 A `wx.Sizer` that can lay out items in a virtual grid like a
12213 `wx.FlexGridSizer` but in this case explicit positioning of the items
12214 is allowed using `wx.GBPosition`, and items can optionally span more
12215 than one row and/or column using `wx.GBSpan`. The total size of the
12216 virtual grid is determined by the largest row and column that items are
12217 positioned at, adjusted for spanning.
12220 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12221 __repr__
= _swig_repr
12222 def __init__(self
, *args
, **kwargs
):
12224 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12226 Constructor, with optional parameters to specify the gap between the
12229 _core_
.GridBagSizer_swiginit(self
,_core_
.new_GridBagSizer(*args
, **kwargs
))
12230 self
._setOORInfo
(self
)
12232 def Add(*args
, **kwargs
):
12234 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12235 int border=0, userData=None) -> wx.GBSizerItem
12237 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12238 more than one row or column as specified with *span*. The remaining
12239 args behave similarly to `wx.Sizer.Add`.
12241 Returns True if the item was successfully placed at the given cell
12242 position, False if something was already there.
12245 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
12247 def AddItem(*args
, **kwargs
):
12249 Add(self, GBSizerItem item) -> wx.GBSizerItem
12251 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12252 the item was successfully placed at its given cell position, False if
12253 something was already there.
12255 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
12257 def GetCellSize(*args
, **kwargs
):
12259 GetCellSize(self, int row, int col) -> Size
12261 Get the size of the specified cell, including hgap and
12262 vgap. Only valid after a Layout.
12264 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
12266 def GetEmptyCellSize(*args
, **kwargs
):
12268 GetEmptyCellSize(self) -> Size
12270 Get the size used for cells in the grid with no item.
12272 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
12274 def SetEmptyCellSize(*args
, **kwargs
):
12276 SetEmptyCellSize(self, Size sz)
12278 Set the size used for cells in the grid with no item.
12280 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
12282 def GetItemPosition(*args
):
12284 GetItemPosition(self, item) -> GBPosition
12286 Get the grid position of the specified *item* where *item* is either a
12287 window or subsizer that is a member of this sizer, or a zero-based
12290 return _core_
.GridBagSizer_GetItemPosition(*args
)
12292 def SetItemPosition(*args
):
12294 SetItemPosition(self, item, GBPosition pos) -> bool
12296 Set the grid position of the specified *item* where *item* is either a
12297 window or subsizer that is a member of this sizer, or a zero-based
12298 index of an item. Returns True on success. If the move is not
12299 allowed (because an item is already there) then False is returned.
12302 return _core_
.GridBagSizer_SetItemPosition(*args
)
12304 def GetItemSpan(*args
):
12306 GetItemSpan(self, item) -> GBSpan
12308 Get the row/col spanning of the specified *item* where *item* is
12309 either a window or subsizer that is a member of this sizer, or a
12310 zero-based index of an item.
12312 return _core_
.GridBagSizer_GetItemSpan(*args
)
12314 def SetItemSpan(*args
):
12316 SetItemSpan(self, item, GBSpan span) -> bool
12318 Set the row/col spanning of the specified *item* where *item* is
12319 either a window or subsizer that is a member of this sizer, or a
12320 zero-based index of an item. Returns True on success. If the move is
12321 not allowed (because an item is already there) then False is returned.
12323 return _core_
.GridBagSizer_SetItemSpan(*args
)
12325 def FindItem(*args
):
12327 FindItem(self, item) -> GBSizerItem
12329 Find the sizer item for the given window or subsizer, returns None if
12330 not found. (non-recursive)
12332 return _core_
.GridBagSizer_FindItem(*args
)
12334 def FindItemAtPosition(*args
, **kwargs
):
12336 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12338 Return the sizer item for the given grid cell, or None if there is no
12339 item at that position. (non-recursive)
12341 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
12343 def FindItemAtPoint(*args
, **kwargs
):
12345 FindItemAtPoint(self, Point pt) -> GBSizerItem
12347 Return the sizer item located at the point given in *pt*, or None if
12348 there is no item at that point. The (x,y) coordinates in pt correspond
12349 to the client coordinates of the window using the sizer for
12350 layout. (non-recursive)
12352 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
12354 def CheckForIntersection(*args
, **kwargs
):
12356 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12358 Look at all items and see if any intersect (or would overlap) the
12359 given *item*. Returns True if so, False if there would be no overlap.
12360 If an *excludeItem* is given then it will not be checked for
12361 intersection, for example it may be the item we are checking the
12365 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
12367 def CheckForIntersectionPos(*args
, **kwargs
):
12369 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12371 Look at all items and see if any intersect (or would overlap) the
12372 given position and span. Returns True if so, False if there would be
12373 no overlap. If an *excludeItem* is given then it will not be checked
12374 for intersection, for example it may be the item we are checking the
12377 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
12379 GridBagSizer_swigregister
= _core_
.GridBagSizer_swigregister
12380 GridBagSizer_swigregister(GridBagSizer
)
12382 #---------------------------------------------------------------------------
12386 Right
= _core_
.Right
12387 Bottom
= _core_
.Bottom
12388 Width
= _core_
.Width
12389 Height
= _core_
.Height
12390 Centre
= _core_
.Centre
12391 Center
= _core_
.Center
12392 CentreX
= _core_
.CentreX
12393 CentreY
= _core_
.CentreY
12394 Unconstrained
= _core_
.Unconstrained
12396 PercentOf
= _core_
.PercentOf
12397 Above
= _core_
.Above
12398 Below
= _core_
.Below
12399 LeftOf
= _core_
.LeftOf
12400 RightOf
= _core_
.RightOf
12401 SameAs
= _core_
.SameAs
12402 Absolute
= _core_
.Absolute
12403 class IndividualLayoutConstraint(Object
):
12405 Objects of this class are stored in the `wx.LayoutConstraints` class as
12406 one of eight possible constraints that a window can be involved in.
12407 You will never need to create an instance of
12408 wx.IndividualLayoutConstraint, rather you should create a
12409 `wx.LayoutConstraints` instance and use the individual contstraints
12412 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12413 def __init__(self
): raise AttributeError, "No constructor defined"
12414 __repr__
= _swig_repr
12415 def Set(*args
, **kwargs
):
12417 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12419 Sets the properties of the constraint. Normally called by one of the
12420 convenience functions such as Above, RightOf, SameAs.
12422 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
12424 def LeftOf(*args
, **kwargs
):
12426 LeftOf(self, Window sibling, int marg=0)
12428 Constrains this edge to be to the left of the given window, with an
12429 optional margin. Implicitly, this is relative to the left edge of the
12432 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
12434 def RightOf(*args
, **kwargs
):
12436 RightOf(self, Window sibling, int marg=0)
12438 Constrains this edge to be to the right of the given window, with an
12439 optional margin. Implicitly, this is relative to the right edge of the
12442 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
12444 def Above(*args
, **kwargs
):
12446 Above(self, Window sibling, int marg=0)
12448 Constrains this edge to be above the given window, with an optional
12449 margin. Implicitly, this is relative to the top edge of the other
12452 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
12454 def Below(*args
, **kwargs
):
12456 Below(self, Window sibling, int marg=0)
12458 Constrains this edge to be below the given window, with an optional
12459 margin. Implicitly, this is relative to the bottom edge of the other
12462 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
12464 def SameAs(*args
, **kwargs
):
12466 SameAs(self, Window otherW, int edge, int marg=0)
12468 Constrains this edge or dimension to be to the same as the edge of the
12469 given window, with an optional margin.
12471 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
12473 def PercentOf(*args
, **kwargs
):
12475 PercentOf(self, Window otherW, int wh, int per)
12477 Constrains this edge or dimension to be to a percentage of the given
12478 window, with an optional margin.
12480 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
12482 def Absolute(*args
, **kwargs
):
12484 Absolute(self, int val)
12486 Constrains this edge or dimension to be the given absolute value.
12488 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
12490 def Unconstrained(*args
, **kwargs
):
12492 Unconstrained(self)
12494 Sets this edge or dimension to be unconstrained, that is, dependent on
12495 other edges and dimensions from which this value can be deduced.
12497 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
12499 def AsIs(*args
, **kwargs
):
12503 Sets this edge or constraint to be whatever the window's value is at
12504 the moment. If either of the width and height constraints are *as is*,
12505 the window will not be resized, but moved instead. This is important
12506 when considering panel items which are intended to have a default
12507 size, such as a button, which may take its size from the size of the
12510 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
12512 def GetOtherWindow(*args
, **kwargs
):
12513 """GetOtherWindow(self) -> Window"""
12514 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
12516 def GetMyEdge(*args
, **kwargs
):
12517 """GetMyEdge(self) -> int"""
12518 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
12520 def SetEdge(*args
, **kwargs
):
12521 """SetEdge(self, int which)"""
12522 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
12524 def SetValue(*args
, **kwargs
):
12525 """SetValue(self, int v)"""
12526 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
12528 def GetMargin(*args
, **kwargs
):
12529 """GetMargin(self) -> int"""
12530 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
12532 def SetMargin(*args
, **kwargs
):
12533 """SetMargin(self, int m)"""
12534 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
12536 def GetValue(*args
, **kwargs
):
12537 """GetValue(self) -> int"""
12538 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
12540 def GetPercent(*args
, **kwargs
):
12541 """GetPercent(self) -> int"""
12542 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
12544 def GetOtherEdge(*args
, **kwargs
):
12545 """GetOtherEdge(self) -> int"""
12546 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
12548 def GetDone(*args
, **kwargs
):
12549 """GetDone(self) -> bool"""
12550 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
12552 def SetDone(*args
, **kwargs
):
12553 """SetDone(self, bool d)"""
12554 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
12556 def GetRelationship(*args
, **kwargs
):
12557 """GetRelationship(self) -> int"""
12558 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
12560 def SetRelationship(*args
, **kwargs
):
12561 """SetRelationship(self, int r)"""
12562 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
12564 def ResetIfWin(*args
, **kwargs
):
12566 ResetIfWin(self, Window otherW) -> bool
12568 Reset constraint if it mentions otherWin
12570 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
12572 def SatisfyConstraint(*args
, **kwargs
):
12574 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12576 Try to satisfy constraint
12578 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
12580 def GetEdge(*args
, **kwargs
):
12582 GetEdge(self, int which, Window thisWin, Window other) -> int
12584 Get the value of this edge or dimension, or if this
12585 is not determinable, -1.
12587 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
12589 IndividualLayoutConstraint_swigregister
= _core_
.IndividualLayoutConstraint_swigregister
12590 IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint
)
12592 class LayoutConstraints(Object
):
12594 **Note:** constraints are now deprecated and you should use sizers
12597 Objects of this class can be associated with a window to define its
12598 layout constraints, with respect to siblings or its parent.
12600 The class consists of the following eight constraints of class
12601 wx.IndividualLayoutConstraint, some or all of which should be accessed
12602 directly to set the appropriate constraints.
12604 * left: represents the left hand edge of the window
12605 * right: represents the right hand edge of the window
12606 * top: represents the top edge of the window
12607 * bottom: represents the bottom edge of the window
12608 * width: represents the width of the window
12609 * height: represents the height of the window
12610 * centreX: represents the horizontal centre point of the window
12611 * centreY: represents the vertical centre point of the window
12613 Most constraints are initially set to have the relationship
12614 wxUnconstrained, which means that their values should be calculated by
12615 looking at known constraints. The exceptions are width and height,
12616 which are set to wxAsIs to ensure that if the user does not specify a
12617 constraint, the existing width and height will be used, to be
12618 compatible with panel items which often have take a default size. If
12619 the constraint is ``wx.AsIs``, the dimension will not be changed.
12621 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12624 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12625 __repr__
= _swig_repr
12626 left
= property(_core_
.LayoutConstraints_left_get
)
12627 top
= property(_core_
.LayoutConstraints_top_get
)
12628 right
= property(_core_
.LayoutConstraints_right_get
)
12629 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
12630 width
= property(_core_
.LayoutConstraints_width_get
)
12631 height
= property(_core_
.LayoutConstraints_height_get
)
12632 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
12633 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
12634 def __init__(self
, *args
, **kwargs
):
12635 """__init__(self) -> LayoutConstraints"""
12636 _core_
.LayoutConstraints_swiginit(self
,_core_
.new_LayoutConstraints(*args
, **kwargs
))
12637 __swig_destroy__
= _core_
.delete_LayoutConstraints
12638 __del__
= lambda self
: None;
12639 def SatisfyConstraints(*args
, **kwargs
):
12640 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12641 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
12643 def AreSatisfied(*args
, **kwargs
):
12644 """AreSatisfied(self) -> bool"""
12645 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
12647 LayoutConstraints_swigregister
= _core_
.LayoutConstraints_swigregister
12648 LayoutConstraints_swigregister(LayoutConstraints
)
12650 #----------------------------------------------------------------------------
12652 # Use Python's bool constants if available, make some if not
12656 __builtins__
.True = 1==1
12657 __builtins__
.False = 1==0
12658 def bool(value
): return not not value
12659 __builtins__
.bool = bool
12663 # workarounds for bad wxRTTI names
12664 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
12665 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
12666 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
12669 #----------------------------------------------------------------------------
12670 # Load version numbers from __version__... Ensure that major and minor
12671 # versions are the same for both wxPython and wxWidgets.
12673 from __version__
import *
12674 __version__
= VERSION_STRING
12676 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
12677 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
12678 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
12680 warnings
.warn("wxPython/wxWidgets release number mismatch")
12682 #----------------------------------------------------------------------------
12684 # Set wxPython's default string<-->unicode conversion encoding from
12685 # the locale, but only if Python's default hasn't been changed. (We
12686 # assume that if the user has customized it already then that is the
12687 # encoding we need to use as well.)
12689 # The encoding selected here is used when string or unicode objects
12690 # need to be converted in order to pass them to wxWidgets. Please be
12691 # aware that the default encoding within the same locale may be
12692 # slightly different on different platforms. For example, please see
12693 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12694 # between the common latin/roman encodings.
12696 default
= _sys
.getdefaultencoding()
12697 if default
== 'ascii':
12701 default
= locale
.getdefaultlocale()[1]
12702 codecs
.lookup(default
)
12703 except (ValueError, LookupError, TypeError):
12704 default
= _sys
.getdefaultencoding()
12708 wx
.SetDefaultPyEncoding(default
)
12711 #----------------------------------------------------------------------------
12713 class PyDeadObjectError(AttributeError):
12716 class _wxPyDeadObject(object):
12718 Instances of wx objects that are OOR capable will have their __class__
12719 changed to this class when the C++ object is deleted. This should help
12720 prevent crashes due to referencing a bogus C++ pointer.
12722 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12723 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12725 def __repr__(self
):
12726 if not hasattr(self
, "_name"):
12727 self
._name
= "[unknown]"
12728 return self
.reprStr
% self
._name
12730 def __getattr__(self
, *args
):
12731 if not hasattr(self
, "_name"):
12732 self
._name
= "[unknown]"
12733 raise PyDeadObjectError(self
.attrStr
% self
._name
)
12735 def __nonzero__(self
):
12740 class PyUnbornObjectError(AttributeError):
12743 class _wxPyUnbornObject(object):
12745 Some stock objects are created when the wx._core module is
12746 imported, but their C++ instance is not created until the wx.App
12747 object is created and initialized. These object instances will
12748 temporarily have their __class__ changed to this class so an
12749 exception will be raised if they are used before the C++ instance
12753 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12754 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
12756 def __repr__(self
):
12757 #if not hasattr(self, "_name"):
12758 # self._name = "[unknown]"
12759 return self
.reprStr
#% self._name
12761 def __getattr__(self
, *args
):
12762 #if not hasattr(self, "_name"):
12763 # self._name = "[unknown]"
12764 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
12766 def __nonzero__(self
):
12770 #----------------------------------------------------------------------------
12772 def CallAfter(callable, *args
, **kw
):
12774 Call the specified function after the current and pending event
12775 handlers have been completed. This is also good for making GUI
12776 method calls from non-GUI threads. Any extra positional or
12777 keyword args are passed on to the callable when it is called.
12779 :see: `wx.FutureCall`
12782 assert app
is not None, 'No wx.App created yet'
12784 if not hasattr(app
, "_CallAfterId"):
12785 app
._CallAfterId
= wx
.NewEventType()
12786 app
.Connect(-1, -1, app
._CallAfterId
,
12787 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
12789 evt
.SetEventType(app
._CallAfterId
)
12790 evt
.callable = callable
12793 wx
.PostEvent(app
, evt
)
12795 #----------------------------------------------------------------------------
12800 A convenience class for `wx.Timer`, that calls the given callable
12801 object once after the given amount of milliseconds, passing any
12802 positional or keyword args. The return value of the callable is
12803 availbale after it has been run with the `GetResult` method.
12805 If you don't need to get the return value or restart the timer
12806 then there is no need to hold a reference to this object. It will
12807 hold a reference to itself while the timer is running (the timer
12808 has a reference to self.Notify) but the cycle will be broken when
12809 the timer completes, automatically cleaning up the wx.FutureCall
12812 :see: `wx.CallAfter`
12814 def __init__(self
, millis
, callable, *args
, **kwargs
):
12815 self
.millis
= millis
12816 self
.callable = callable
12817 self
.SetArgs(*args
, **kwargs
)
12819 self
.running
= False
12820 self
.hasRun
= False
12829 def Start(self
, millis
=None, *args
, **kwargs
):
12831 (Re)start the timer
12833 self
.hasRun
= False
12834 if millis
is not None:
12835 self
.millis
= millis
12837 self
.SetArgs(*args
, **kwargs
)
12839 self
.timer
= wx
.PyTimer(self
.Notify
)
12840 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
12841 self
.running
= True
12847 Stop and destroy the timer.
12849 if self
.timer
is not None:
12854 def GetInterval(self
):
12855 if self
.timer
is not None:
12856 return self
.timer
.GetInterval()
12861 def IsRunning(self
):
12862 return self
.timer
is not None and self
.timer
.IsRunning()
12865 def SetArgs(self
, *args
, **kwargs
):
12867 (Re)set the args passed to the callable object. This is
12868 useful in conjunction with Restart if you want to schedule a
12869 new call to the same callable object but with different
12873 self
.kwargs
= kwargs
12879 def GetResult(self
):
12884 The timer has expired so call the callable.
12886 if self
.callable and getattr(self
.callable, 'im_self', True):
12888 self
.running
= False
12889 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
12891 if not self
.running
:
12892 # if it wasn't restarted, then cleanup
12893 wx
.CallAfter(self
.Stop
)
12897 #----------------------------------------------------------------------------
12898 # Control which items in this module should be documented by epydoc.
12899 # We allow only classes and functions, which will help reduce the size
12900 # of the docs by filtering out the zillions of constants, EVT objects,
12901 # and etc that don't make much sense by themselves, but are instead
12902 # documented (or will be) as part of the classes/functions/methods
12903 # where they should be used.
12907 A filter for epydoc that only allows non-Ptr classes and
12908 fucntions, in order to reduce the clutter in the API docs.
12910 def __init__(self
, globals):
12911 self
._globals
= globals
12913 def __call__(self
, name
):
12915 obj
= self
._globals
.get(name
, None)
12916 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
12918 if name
.startswith('_') or name
.startswith('EVT') or name
.endswith('_swigregister') or name
.endswith('Ptr') :
12922 #----------------------------------------------------------------------------
12923 #----------------------------------------------------------------------------
12925 # Import other modules in this package that should show up in the
12926 # "core" wx namespace
12928 from _windows
import *
12929 from _controls
import *
12930 from _misc
import *
12932 #----------------------------------------------------------------------------
12933 #----------------------------------------------------------------------------