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
274 ACCEL_ALT
= _core_
.ACCEL_ALT
275 ACCEL_CTRL
= _core_
.ACCEL_CTRL
276 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
277 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
278 PD_AUTO_HIDE
= _core_
.PD_AUTO_HIDE
279 PD_APP_MODAL
= _core_
.PD_APP_MODAL
280 PD_CAN_ABORT
= _core_
.PD_CAN_ABORT
281 PD_ELAPSED_TIME
= _core_
.PD_ELAPSED_TIME
282 PD_ESTIMATED_TIME
= _core_
.PD_ESTIMATED_TIME
283 PD_REMAINING_TIME
= _core_
.PD_REMAINING_TIME
284 PD_SMOOTH
= _core_
.PD_SMOOTH
285 PD_CAN_SKIP
= _core_
.PD_CAN_SKIP
286 MENU_TEAROFF
= _core_
.MENU_TEAROFF
287 MB_DOCKABLE
= _core_
.MB_DOCKABLE
288 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
289 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
290 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
291 LI_VERTICAL
= _core_
.LI_VERTICAL
292 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
293 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
294 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
295 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
296 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
297 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
298 MM_TEXT
= _core_
.MM_TEXT
299 MM_LOMETRIC
= _core_
.MM_LOMETRIC
300 MM_HIMETRIC
= _core_
.MM_HIMETRIC
301 MM_LOENGLISH
= _core_
.MM_LOENGLISH
302 MM_HIENGLISH
= _core_
.MM_HIENGLISH
303 MM_TWIPS
= _core_
.MM_TWIPS
304 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
305 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
306 MM_POINTS
= _core_
.MM_POINTS
307 MM_METRIC
= _core_
.MM_METRIC
308 CENTRE
= _core_
.CENTRE
309 CENTER
= _core_
.CENTER
310 HORIZONTAL
= _core_
.HORIZONTAL
311 VERTICAL
= _core_
.VERTICAL
318 BOTTOM
= _core_
.BOTTOM
324 ALIGN_NOT
= _core_
.ALIGN_NOT
325 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
326 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
327 ALIGN_LEFT
= _core_
.ALIGN_LEFT
328 ALIGN_TOP
= _core_
.ALIGN_TOP
329 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
330 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
331 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
332 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
333 ALIGN_CENTER
= _core_
.ALIGN_CENTER
334 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
335 ALIGN_MASK
= _core_
.ALIGN_MASK
336 STRETCH_NOT
= _core_
.STRETCH_NOT
337 SHRINK
= _core_
.SHRINK
339 EXPAND
= _core_
.EXPAND
340 SHAPED
= _core_
.SHAPED
341 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
343 ADJUST_MINSIZE
= _core_
.ADJUST_MINSIZE
344 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
345 BORDER_NONE
= _core_
.BORDER_NONE
346 BORDER_STATIC
= _core_
.BORDER_STATIC
347 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
348 BORDER_RAISED
= _core_
.BORDER_RAISED
349 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
350 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
351 BORDER_MASK
= _core_
.BORDER_MASK
352 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
353 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
354 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
355 DEFAULT
= _core_
.DEFAULT
356 DECORATIVE
= _core_
.DECORATIVE
358 SCRIPT
= _core_
.SCRIPT
360 MODERN
= _core_
.MODERN
361 TELETYPE
= _core_
.TELETYPE
362 VARIABLE
= _core_
.VARIABLE
364 NORMAL
= _core_
.NORMAL
367 ITALIC
= _core_
.ITALIC
371 LONG_DASH
= _core_
.LONG_DASH
372 SHORT_DASH
= _core_
.SHORT_DASH
373 DOT_DASH
= _core_
.DOT_DASH
374 USER_DASH
= _core_
.USER_DASH
375 TRANSPARENT
= _core_
.TRANSPARENT
376 STIPPLE
= _core_
.STIPPLE
377 STIPPLE_MASK
= _core_
.STIPPLE_MASK
378 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
379 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
380 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
381 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
382 CROSS_HATCH
= _core_
.CROSS_HATCH
383 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
384 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
385 JOIN_BEVEL
= _core_
.JOIN_BEVEL
386 JOIN_MITER
= _core_
.JOIN_MITER
387 JOIN_ROUND
= _core_
.JOIN_ROUND
388 CAP_ROUND
= _core_
.CAP_ROUND
389 CAP_PROJECTING
= _core_
.CAP_PROJECTING
390 CAP_BUTT
= _core_
.CAP_BUTT
393 INVERT
= _core_
.INVERT
394 OR_REVERSE
= _core_
.OR_REVERSE
395 AND_REVERSE
= _core_
.AND_REVERSE
398 AND_INVERT
= _core_
.AND_INVERT
402 SRC_INVERT
= _core_
.SRC_INVERT
403 OR_INVERT
= _core_
.OR_INVERT
407 WXK_BACK
= _core_
.WXK_BACK
408 WXK_TAB
= _core_
.WXK_TAB
409 WXK_RETURN
= _core_
.WXK_RETURN
410 WXK_ESCAPE
= _core_
.WXK_ESCAPE
411 WXK_SPACE
= _core_
.WXK_SPACE
412 WXK_DELETE
= _core_
.WXK_DELETE
413 WXK_START
= _core_
.WXK_START
414 WXK_LBUTTON
= _core_
.WXK_LBUTTON
415 WXK_RBUTTON
= _core_
.WXK_RBUTTON
416 WXK_CANCEL
= _core_
.WXK_CANCEL
417 WXK_MBUTTON
= _core_
.WXK_MBUTTON
418 WXK_CLEAR
= _core_
.WXK_CLEAR
419 WXK_SHIFT
= _core_
.WXK_SHIFT
420 WXK_ALT
= _core_
.WXK_ALT
421 WXK_CONTROL
= _core_
.WXK_CONTROL
422 WXK_MENU
= _core_
.WXK_MENU
423 WXK_PAUSE
= _core_
.WXK_PAUSE
424 WXK_CAPITAL
= _core_
.WXK_CAPITAL
425 WXK_PRIOR
= _core_
.WXK_PRIOR
426 WXK_NEXT
= _core_
.WXK_NEXT
427 WXK_END
= _core_
.WXK_END
428 WXK_HOME
= _core_
.WXK_HOME
429 WXK_LEFT
= _core_
.WXK_LEFT
430 WXK_UP
= _core_
.WXK_UP
431 WXK_RIGHT
= _core_
.WXK_RIGHT
432 WXK_DOWN
= _core_
.WXK_DOWN
433 WXK_SELECT
= _core_
.WXK_SELECT
434 WXK_PRINT
= _core_
.WXK_PRINT
435 WXK_EXECUTE
= _core_
.WXK_EXECUTE
436 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
437 WXK_INSERT
= _core_
.WXK_INSERT
438 WXK_HELP
= _core_
.WXK_HELP
439 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
440 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
441 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
442 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
443 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
444 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
445 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
446 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
447 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
448 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
449 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
450 WXK_ADD
= _core_
.WXK_ADD
451 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
452 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
453 WXK_DECIMAL
= _core_
.WXK_DECIMAL
454 WXK_DIVIDE
= _core_
.WXK_DIVIDE
455 WXK_F1
= _core_
.WXK_F1
456 WXK_F2
= _core_
.WXK_F2
457 WXK_F3
= _core_
.WXK_F3
458 WXK_F4
= _core_
.WXK_F4
459 WXK_F5
= _core_
.WXK_F5
460 WXK_F6
= _core_
.WXK_F6
461 WXK_F7
= _core_
.WXK_F7
462 WXK_F8
= _core_
.WXK_F8
463 WXK_F9
= _core_
.WXK_F9
464 WXK_F10
= _core_
.WXK_F10
465 WXK_F11
= _core_
.WXK_F11
466 WXK_F12
= _core_
.WXK_F12
467 WXK_F13
= _core_
.WXK_F13
468 WXK_F14
= _core_
.WXK_F14
469 WXK_F15
= _core_
.WXK_F15
470 WXK_F16
= _core_
.WXK_F16
471 WXK_F17
= _core_
.WXK_F17
472 WXK_F18
= _core_
.WXK_F18
473 WXK_F19
= _core_
.WXK_F19
474 WXK_F20
= _core_
.WXK_F20
475 WXK_F21
= _core_
.WXK_F21
476 WXK_F22
= _core_
.WXK_F22
477 WXK_F23
= _core_
.WXK_F23
478 WXK_F24
= _core_
.WXK_F24
479 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
480 WXK_SCROLL
= _core_
.WXK_SCROLL
481 WXK_PAGEUP
= _core_
.WXK_PAGEUP
482 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
483 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
484 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
485 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
486 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
487 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
488 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
489 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
490 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
491 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
492 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
493 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
494 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
495 WXK_NUMPAD_PRIOR
= _core_
.WXK_NUMPAD_PRIOR
496 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
497 WXK_NUMPAD_NEXT
= _core_
.WXK_NUMPAD_NEXT
498 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
499 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
500 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
501 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
502 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
503 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
504 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
505 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
506 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
507 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
508 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
509 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
510 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
511 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
512 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
513 WXK_COMMAND
= _core_
.WXK_COMMAND
514 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
515 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
516 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
517 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
518 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
519 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
520 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
521 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
522 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
523 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
524 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
525 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
526 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
527 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
528 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
529 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
530 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
531 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
532 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
533 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
534 PAPER_NONE
= _core_
.PAPER_NONE
535 PAPER_LETTER
= _core_
.PAPER_LETTER
536 PAPER_LEGAL
= _core_
.PAPER_LEGAL
537 PAPER_A4
= _core_
.PAPER_A4
538 PAPER_CSHEET
= _core_
.PAPER_CSHEET
539 PAPER_DSHEET
= _core_
.PAPER_DSHEET
540 PAPER_ESHEET
= _core_
.PAPER_ESHEET
541 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
542 PAPER_TABLOID
= _core_
.PAPER_TABLOID
543 PAPER_LEDGER
= _core_
.PAPER_LEDGER
544 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
545 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
546 PAPER_A3
= _core_
.PAPER_A3
547 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
548 PAPER_A5
= _core_
.PAPER_A5
549 PAPER_B4
= _core_
.PAPER_B4
550 PAPER_B5
= _core_
.PAPER_B5
551 PAPER_FOLIO
= _core_
.PAPER_FOLIO
552 PAPER_QUARTO
= _core_
.PAPER_QUARTO
553 PAPER_10X14
= _core_
.PAPER_10X14
554 PAPER_11X17
= _core_
.PAPER_11X17
555 PAPER_NOTE
= _core_
.PAPER_NOTE
556 PAPER_ENV_9
= _core_
.PAPER_ENV_9
557 PAPER_ENV_10
= _core_
.PAPER_ENV_10
558 PAPER_ENV_11
= _core_
.PAPER_ENV_11
559 PAPER_ENV_12
= _core_
.PAPER_ENV_12
560 PAPER_ENV_14
= _core_
.PAPER_ENV_14
561 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
562 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
563 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
564 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
565 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
566 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
567 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
568 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
569 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
570 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
571 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
572 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
573 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
574 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
575 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
576 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
577 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
578 PAPER_9X11
= _core_
.PAPER_9X11
579 PAPER_10X11
= _core_
.PAPER_10X11
580 PAPER_15X11
= _core_
.PAPER_15X11
581 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
582 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
583 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
584 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
585 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
586 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
587 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
588 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
589 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
590 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
591 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
592 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
593 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
594 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
595 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
596 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
597 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
598 PAPER_A2
= _core_
.PAPER_A2
599 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
600 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
601 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
602 PAPER_A6
= _core_
.PAPER_A6
603 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
604 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
605 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
606 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
607 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
608 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
609 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
610 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
611 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
612 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
613 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
614 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
615 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
616 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
617 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
618 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
619 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
620 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
621 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
622 PAPER_12X11
= _core_
.PAPER_12X11
623 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
624 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
625 PAPER_P16K
= _core_
.PAPER_P16K
626 PAPER_P32K
= _core_
.PAPER_P32K
627 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
628 PAPER_PENV_1
= _core_
.PAPER_PENV_1
629 PAPER_PENV_2
= _core_
.PAPER_PENV_2
630 PAPER_PENV_3
= _core_
.PAPER_PENV_3
631 PAPER_PENV_4
= _core_
.PAPER_PENV_4
632 PAPER_PENV_5
= _core_
.PAPER_PENV_5
633 PAPER_PENV_6
= _core_
.PAPER_PENV_6
634 PAPER_PENV_7
= _core_
.PAPER_PENV_7
635 PAPER_PENV_8
= _core_
.PAPER_PENV_8
636 PAPER_PENV_9
= _core_
.PAPER_PENV_9
637 PAPER_PENV_10
= _core_
.PAPER_PENV_10
638 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
639 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
640 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
641 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
642 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
643 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
644 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
645 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
646 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
647 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
648 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
649 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
650 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
651 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
652 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
653 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
654 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
655 ITEM_NORMAL
= _core_
.ITEM_NORMAL
656 ITEM_CHECK
= _core_
.ITEM_CHECK
657 ITEM_RADIO
= _core_
.ITEM_RADIO
658 ITEM_MAX
= _core_
.ITEM_MAX
659 HT_NOWHERE
= _core_
.HT_NOWHERE
660 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
661 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
662 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
663 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
664 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
665 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
666 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
667 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
668 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
669 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
670 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
671 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
672 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
673 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
674 HT_MAX
= _core_
.HT_MAX
675 MOD_NONE
= _core_
.MOD_NONE
676 MOD_ALT
= _core_
.MOD_ALT
677 MOD_CONTROL
= _core_
.MOD_CONTROL
678 MOD_ALTGR
= _core_
.MOD_ALTGR
679 MOD_SHIFT
= _core_
.MOD_SHIFT
680 MOD_META
= _core_
.MOD_META
681 MOD_WIN
= _core_
.MOD_WIN
682 MOD_CMD
= _core_
.MOD_CMD
683 MOD_ALL
= _core_
.MOD_ALL
684 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
685 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
686 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
687 #---------------------------------------------------------------------------
689 class Object(object):
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
694 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
695 def __init__(self
): raise AttributeError, "No constructor defined"
696 __repr__
= _swig_repr
697 def GetClassName(*args
, **kwargs
):
699 GetClassName(self) -> String
701 Returns the class name of the C++ class using wxRTTI.
703 return _core_
.Object_GetClassName(*args
, **kwargs
)
705 def Destroy(*args
, **kwargs
):
709 Deletes the C++ object this Python object is a proxy for.
711 val
= _core_
.Object_Destroy(*args
, **kwargs
)
715 _core_
.Object_swigregister(Object
)
716 _wxPySetDictionary
= _core_
._wxPySetDictionary
718 EmptyString
= cvar
.EmptyString
720 #---------------------------------------------------------------------------
722 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
723 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
724 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
725 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
726 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
727 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
728 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
729 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
730 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
731 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
732 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
733 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
734 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
735 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
736 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
737 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
738 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
739 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
740 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
741 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
742 CURSOR_NONE
= _core_
.CURSOR_NONE
743 CURSOR_ARROW
= _core_
.CURSOR_ARROW
744 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
745 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
746 CURSOR_CHAR
= _core_
.CURSOR_CHAR
747 CURSOR_CROSS
= _core_
.CURSOR_CROSS
748 CURSOR_HAND
= _core_
.CURSOR_HAND
749 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
750 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
751 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
752 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
753 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
754 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
755 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
756 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
757 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
758 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
759 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
760 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
761 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
762 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
763 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
764 CURSOR_SIZING
= _core_
.CURSOR_SIZING
765 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
766 CURSOR_WAIT
= _core_
.CURSOR_WAIT
767 CURSOR_WATCH
= _core_
.CURSOR_WATCH
768 CURSOR_BLANK
= _core_
.CURSOR_BLANK
769 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
770 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
771 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
772 CURSOR_MAX
= _core_
.CURSOR_MAX
773 #---------------------------------------------------------------------------
777 wx.Size is a useful data structure used to represent the size of
778 something. It simply contains integer width and height
779 properties. In most places in wxPython where a wx.Size is
780 expected a (width, height) tuple can be used instead.
782 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
783 __repr__
= _swig_repr
784 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
785 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
786 x
= width
; y
= height
787 def __init__(self
, *args
, **kwargs
):
789 __init__(self, int w=0, int h=0) -> Size
791 Creates a size object.
793 _core_
.Size_swiginit(self
,_core_
.new_Size(*args
, **kwargs
))
794 __swig_destroy__
= _core_
.delete_Size
795 __del__
= lambda self
: None;
796 def __eq__(*args
, **kwargs
):
798 __eq__(self, PyObject other) -> bool
800 Test for equality of wx.Size objects.
802 return _core_
.Size___eq__(*args
, **kwargs
)
804 def __ne__(*args
, **kwargs
):
806 __ne__(self, PyObject other) -> bool
808 Test for inequality of wx.Size objects.
810 return _core_
.Size___ne__(*args
, **kwargs
)
812 def __add__(*args
, **kwargs
):
814 __add__(self, Size sz) -> Size
816 Add sz's proprties to this and return the result.
818 return _core_
.Size___add__(*args
, **kwargs
)
820 def __sub__(*args
, **kwargs
):
822 __sub__(self, Size sz) -> Size
824 Subtract sz's properties from this and return the result.
826 return _core_
.Size___sub__(*args
, **kwargs
)
828 def IncTo(*args
, **kwargs
):
832 Increments this object so that both of its dimensions are not less
833 than the corresponding dimensions of the size.
835 return _core_
.Size_IncTo(*args
, **kwargs
)
837 def DecTo(*args
, **kwargs
):
841 Decrements this object so that both of its dimensions are not greater
842 than the corresponding dimensions of the size.
844 return _core_
.Size_DecTo(*args
, **kwargs
)
846 def Set(*args
, **kwargs
):
848 Set(self, int w, int h)
850 Set both width and height.
852 return _core_
.Size_Set(*args
, **kwargs
)
854 def SetWidth(*args
, **kwargs
):
855 """SetWidth(self, int w)"""
856 return _core_
.Size_SetWidth(*args
, **kwargs
)
858 def SetHeight(*args
, **kwargs
):
859 """SetHeight(self, int h)"""
860 return _core_
.Size_SetHeight(*args
, **kwargs
)
862 def GetWidth(*args
, **kwargs
):
863 """GetWidth(self) -> int"""
864 return _core_
.Size_GetWidth(*args
, **kwargs
)
866 def GetHeight(*args
, **kwargs
):
867 """GetHeight(self) -> int"""
868 return _core_
.Size_GetHeight(*args
, **kwargs
)
870 def IsFullySpecified(*args
, **kwargs
):
872 IsFullySpecified(self) -> bool
874 Returns True if both components of the size are non-default values.
876 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
878 def SetDefaults(*args
, **kwargs
):
880 SetDefaults(self, Size size)
882 Combine this size with the other one replacing the default components
883 of this object (i.e. equal to -1) with those of the other.
885 return _core_
.Size_SetDefaults(*args
, **kwargs
)
887 def Get(*args
, **kwargs
):
889 Get() -> (width,height)
891 Returns the width and height properties as a tuple.
893 return _core_
.Size_Get(*args
, **kwargs
)
895 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
896 def __str__(self
): return str(self
.Get())
897 def __repr__(self
): return 'wx.Size'+str(self
.Get())
898 def __len__(self
): return len(self
.Get())
899 def __getitem__(self
, index
): return self
.Get()[index
]
900 def __setitem__(self
, index
, val
):
901 if index
== 0: self
.width
= val
902 elif index
== 1: self
.height
= val
903 else: raise IndexError
904 def __nonzero__(self
): return self
.Get() != (0,0)
905 __safe_for_unpickling__
= True
906 def __reduce__(self
): return (wx
.Size
, self
.Get())
908 _core_
.Size_swigregister(Size
)
910 #---------------------------------------------------------------------------
912 class RealPoint(object):
914 A data structure for representing a point or position with floating
915 point x and y properties. In wxPython most places that expect a
916 wx.RealPoint can also accept a (x,y) tuple.
918 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
919 __repr__
= _swig_repr
920 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
921 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
922 def __init__(self
, *args
, **kwargs
):
924 __init__(self, double x=0.0, double y=0.0) -> RealPoint
926 Create a wx.RealPoint object
928 _core_
.RealPoint_swiginit(self
,_core_
.new_RealPoint(*args
, **kwargs
))
929 __swig_destroy__
= _core_
.delete_RealPoint
930 __del__
= lambda self
: None;
931 def __eq__(*args
, **kwargs
):
933 __eq__(self, PyObject other) -> bool
935 Test for equality of wx.RealPoint objects.
937 return _core_
.RealPoint___eq__(*args
, **kwargs
)
939 def __ne__(*args
, **kwargs
):
941 __ne__(self, PyObject other) -> bool
943 Test for inequality of wx.RealPoint objects.
945 return _core_
.RealPoint___ne__(*args
, **kwargs
)
947 def __add__(*args
, **kwargs
):
949 __add__(self, RealPoint pt) -> RealPoint
951 Add pt's proprties to this and return the result.
953 return _core_
.RealPoint___add__(*args
, **kwargs
)
955 def __sub__(*args
, **kwargs
):
957 __sub__(self, RealPoint pt) -> RealPoint
959 Subtract pt's proprties from this and return the result
961 return _core_
.RealPoint___sub__(*args
, **kwargs
)
963 def Set(*args
, **kwargs
):
965 Set(self, double x, double y)
967 Set both the x and y properties
969 return _core_
.RealPoint_Set(*args
, **kwargs
)
971 def Get(*args
, **kwargs
):
975 Return the x and y properties as a tuple.
977 return _core_
.RealPoint_Get(*args
, **kwargs
)
979 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
980 def __str__(self
): return str(self
.Get())
981 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
982 def __len__(self
): return len(self
.Get())
983 def __getitem__(self
, index
): return self
.Get()[index
]
984 def __setitem__(self
, index
, val
):
985 if index
== 0: self
.x
= val
986 elif index
== 1: self
.y
= val
987 else: raise IndexError
988 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
989 __safe_for_unpickling__
= True
990 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
992 _core_
.RealPoint_swigregister(RealPoint
)
994 #---------------------------------------------------------------------------
998 A data structure for representing a point or position with integer x
999 and y properties. Most places in wxPython that expect a wx.Point can
1000 also accept a (x,y) tuple.
1002 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1003 __repr__
= _swig_repr
1004 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1005 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1006 def __init__(self
, *args
, **kwargs
):
1008 __init__(self, int x=0, int y=0) -> Point
1010 Create a wx.Point object
1012 _core_
.Point_swiginit(self
,_core_
.new_Point(*args
, **kwargs
))
1013 __swig_destroy__
= _core_
.delete_Point
1014 __del__
= lambda self
: None;
1015 def __eq__(*args
, **kwargs
):
1017 __eq__(self, PyObject other) -> bool
1019 Test for equality of wx.Point objects.
1021 return _core_
.Point___eq__(*args
, **kwargs
)
1023 def __ne__(*args
, **kwargs
):
1025 __ne__(self, PyObject other) -> bool
1027 Test for inequality of wx.Point objects.
1029 return _core_
.Point___ne__(*args
, **kwargs
)
1031 def __add__(*args
, **kwargs
):
1033 __add__(self, Point pt) -> Point
1035 Add pt's proprties to this and return the result.
1037 return _core_
.Point___add__(*args
, **kwargs
)
1039 def __sub__(*args
, **kwargs
):
1041 __sub__(self, Point pt) -> Point
1043 Subtract pt's proprties from this and return the result
1045 return _core_
.Point___sub__(*args
, **kwargs
)
1047 def __iadd__(*args
, **kwargs
):
1049 __iadd__(self, Point pt) -> Point
1051 Add pt to this object.
1053 return _core_
.Point___iadd__(*args
, **kwargs
)
1055 def __isub__(*args
, **kwargs
):
1057 __isub__(self, Point pt) -> Point
1059 Subtract pt from this object.
1061 return _core_
.Point___isub__(*args
, **kwargs
)
1063 def Set(*args
, **kwargs
):
1065 Set(self, long x, long y)
1067 Set both the x and y properties
1069 return _core_
.Point_Set(*args
, **kwargs
)
1071 def Get(*args
, **kwargs
):
1075 Return the x and y properties as a tuple.
1077 return _core_
.Point_Get(*args
, **kwargs
)
1079 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1080 def __str__(self
): return str(self
.Get())
1081 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1082 def __len__(self
): return len(self
.Get())
1083 def __getitem__(self
, index
): return self
.Get()[index
]
1084 def __setitem__(self
, index
, val
):
1085 if index
== 0: self
.x
= val
1086 elif index
== 1: self
.y
= val
1087 else: raise IndexError
1088 def __nonzero__(self
): return self
.Get() != (0,0)
1089 __safe_for_unpickling__
= True
1090 def __reduce__(self
): return (wx
.Point
, self
.Get())
1092 _core_
.Point_swigregister(Point
)
1094 #---------------------------------------------------------------------------
1098 A class for representing and manipulating rectangles. It has x, y,
1099 width and height properties. In wxPython most palces that expect a
1100 wx.Rect can also accept a (x,y,width,height) tuple.
1102 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1103 __repr__
= _swig_repr
1104 def __init__(self
, *args
, **kwargs
):
1106 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1108 Create a new Rect object.
1110 _core_
.Rect_swiginit(self
,_core_
.new_Rect(*args
, **kwargs
))
1111 __swig_destroy__
= _core_
.delete_Rect
1112 __del__
= lambda self
: None;
1113 def GetX(*args
, **kwargs
):
1114 """GetX(self) -> int"""
1115 return _core_
.Rect_GetX(*args
, **kwargs
)
1117 def SetX(*args
, **kwargs
):
1118 """SetX(self, int x)"""
1119 return _core_
.Rect_SetX(*args
, **kwargs
)
1121 def GetY(*args
, **kwargs
):
1122 """GetY(self) -> int"""
1123 return _core_
.Rect_GetY(*args
, **kwargs
)
1125 def SetY(*args
, **kwargs
):
1126 """SetY(self, int y)"""
1127 return _core_
.Rect_SetY(*args
, **kwargs
)
1129 def GetWidth(*args
, **kwargs
):
1130 """GetWidth(self) -> int"""
1131 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1133 def SetWidth(*args
, **kwargs
):
1134 """SetWidth(self, int w)"""
1135 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1137 def GetHeight(*args
, **kwargs
):
1138 """GetHeight(self) -> int"""
1139 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1141 def SetHeight(*args
, **kwargs
):
1142 """SetHeight(self, int h)"""
1143 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1145 def GetPosition(*args
, **kwargs
):
1146 """GetPosition(self) -> Point"""
1147 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1149 def SetPosition(*args
, **kwargs
):
1150 """SetPosition(self, Point p)"""
1151 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1153 def GetSize(*args
, **kwargs
):
1154 """GetSize(self) -> Size"""
1155 return _core_
.Rect_GetSize(*args
, **kwargs
)
1157 def SetSize(*args
, **kwargs
):
1158 """SetSize(self, Size s)"""
1159 return _core_
.Rect_SetSize(*args
, **kwargs
)
1161 def IsEmpty(*args
, **kwargs
):
1162 """IsEmpty(self) -> bool"""
1163 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1165 def GetTopLeft(*args
, **kwargs
):
1166 """GetTopLeft(self) -> Point"""
1167 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1169 def SetTopLeft(*args
, **kwargs
):
1170 """SetTopLeft(self, Point p)"""
1171 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1173 def GetBottomRight(*args
, **kwargs
):
1174 """GetBottomRight(self) -> Point"""
1175 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1177 def SetBottomRight(*args
, **kwargs
):
1178 """SetBottomRight(self, Point p)"""
1179 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1181 def GetLeft(*args
, **kwargs
):
1182 """GetLeft(self) -> int"""
1183 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1185 def GetTop(*args
, **kwargs
):
1186 """GetTop(self) -> int"""
1187 return _core_
.Rect_GetTop(*args
, **kwargs
)
1189 def GetBottom(*args
, **kwargs
):
1190 """GetBottom(self) -> int"""
1191 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1193 def GetRight(*args
, **kwargs
):
1194 """GetRight(self) -> int"""
1195 return _core_
.Rect_GetRight(*args
, **kwargs
)
1197 def SetLeft(*args
, **kwargs
):
1198 """SetLeft(self, int left)"""
1199 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1201 def SetRight(*args
, **kwargs
):
1202 """SetRight(self, int right)"""
1203 return _core_
.Rect_SetRight(*args
, **kwargs
)
1205 def SetTop(*args
, **kwargs
):
1206 """SetTop(self, int top)"""
1207 return _core_
.Rect_SetTop(*args
, **kwargs
)
1209 def SetBottom(*args
, **kwargs
):
1210 """SetBottom(self, int bottom)"""
1211 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1213 position
= property(GetPosition
, SetPosition
)
1214 size
= property(GetSize
, SetSize
)
1215 left
= property(GetLeft
, SetLeft
)
1216 right
= property(GetRight
, SetRight
)
1217 top
= property(GetTop
, SetTop
)
1218 bottom
= property(GetBottom
, SetBottom
)
1220 def Inflate(*args
, **kwargs
):
1222 Inflate(self, int dx, int dy) -> Rect
1224 Increases the size of the rectangle.
1226 The left border is moved farther left and the right border is moved
1227 farther right by ``dx``. The upper border is moved farther up and the
1228 bottom border is moved farther down by ``dy``. (Note the the width and
1229 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1230 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1231 opposite happens: the rectangle size decreases in the respective
1234 The change is made to the rectangle inplace, if instead you need a
1235 copy that is inflated, preserving the original then make the copy
1238 copy = wx.Rect(*original)
1243 return _core_
.Rect_Inflate(*args
, **kwargs
)
1245 def Deflate(*args
, **kwargs
):
1247 Deflate(self, int dx, int dy) -> Rect
1249 Decrease the rectangle size. This method is the opposite of `Inflate`
1250 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1251 `Inflate` for a full description.
1253 return _core_
.Rect_Deflate(*args
, **kwargs
)
1255 def OffsetXY(*args
, **kwargs
):
1257 OffsetXY(self, int dx, int dy)
1259 Moves the rectangle by the specified offset. If dx is positive, the
1260 rectangle is moved to the right, if dy is positive, it is moved to the
1261 bottom, otherwise it is moved to the left or top respectively.
1263 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1265 def Offset(*args
, **kwargs
):
1267 Offset(self, Point pt)
1269 Same as `OffsetXY` but uses dx,dy from Point
1271 return _core_
.Rect_Offset(*args
, **kwargs
)
1273 def Intersect(*args
, **kwargs
):
1275 Intersect(self, Rect rect) -> Rect
1277 Returns the intersectsion of this rectangle and rect.
1279 return _core_
.Rect_Intersect(*args
, **kwargs
)
1281 def Union(*args
, **kwargs
):
1283 Union(self, Rect rect) -> Rect
1285 Returns the union of this rectangle and rect.
1287 return _core_
.Rect_Union(*args
, **kwargs
)
1289 def __add__(*args
, **kwargs
):
1291 __add__(self, Rect rect) -> Rect
1293 Add the properties of rect to this rectangle and return the result.
1295 return _core_
.Rect___add__(*args
, **kwargs
)
1297 def __iadd__(*args
, **kwargs
):
1299 __iadd__(self, Rect rect) -> Rect
1301 Add the properties of rect to this rectangle, updating this rectangle.
1303 return _core_
.Rect___iadd__(*args
, **kwargs
)
1305 def __eq__(*args
, **kwargs
):
1307 __eq__(self, PyObject other) -> bool
1309 Test for equality of wx.Rect objects.
1311 return _core_
.Rect___eq__(*args
, **kwargs
)
1313 def __ne__(*args
, **kwargs
):
1315 __ne__(self, PyObject other) -> bool
1317 Test for inequality of wx.Rect objects.
1319 return _core_
.Rect___ne__(*args
, **kwargs
)
1321 def InsideXY(*args
, **kwargs
):
1323 InsideXY(self, int x, int y) -> bool
1325 Return True if the point is (not strcitly) inside the rect.
1327 return _core_
.Rect_InsideXY(*args
, **kwargs
)
1329 def Inside(*args
, **kwargs
):
1331 Inside(self, Point pt) -> bool
1333 Return True if the point is (not strcitly) inside the rect.
1335 return _core_
.Rect_Inside(*args
, **kwargs
)
1337 def Intersects(*args
, **kwargs
):
1339 Intersects(self, Rect rect) -> bool
1341 Returns True if the rectangles have a non empty intersection.
1343 return _core_
.Rect_Intersects(*args
, **kwargs
)
1345 def CenterIn(*args
, **kwargs
):
1347 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1349 Center this rectangle within the one passed to the method, which is
1350 usually, but not necessarily, the larger one.
1352 return _core_
.Rect_CenterIn(*args
, **kwargs
)
1355 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1356 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1357 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1358 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1359 def Set(*args
, **kwargs
):
1361 Set(self, int x=0, int y=0, int width=0, int height=0)
1363 Set all rectangle properties.
1365 return _core_
.Rect_Set(*args
, **kwargs
)
1367 def Get(*args
, **kwargs
):
1369 Get() -> (x,y,width,height)
1371 Return the rectangle properties as a tuple.
1373 return _core_
.Rect_Get(*args
, **kwargs
)
1375 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1376 def __str__(self
): return str(self
.Get())
1377 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1378 def __len__(self
): return len(self
.Get())
1379 def __getitem__(self
, index
): return self
.Get()[index
]
1380 def __setitem__(self
, index
, val
):
1381 if index
== 0: self
.x
= val
1382 elif index
== 1: self
.y
= val
1383 elif index
== 2: self
.width
= val
1384 elif index
== 3: self
.height
= val
1385 else: raise IndexError
1386 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1387 __safe_for_unpickling__
= True
1388 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1390 _core_
.Rect_swigregister(Rect
)
1392 def RectPP(*args
, **kwargs
):
1394 RectPP(Point topLeft, Point bottomRight) -> Rect
1396 Create a new Rect object from Points representing two corners.
1398 val
= _core_
.new_RectPP(*args
, **kwargs
)
1401 def RectPS(*args
, **kwargs
):
1403 RectPS(Point pos, Size size) -> Rect
1405 Create a new Rect from a position and size.
1407 val
= _core_
.new_RectPS(*args
, **kwargs
)
1410 def RectS(*args
, **kwargs
):
1412 RectS(Size size) -> Rect
1414 Create a new Rect from a size only.
1416 val
= _core_
.new_RectS(*args
, **kwargs
)
1420 def IntersectRect(*args
, **kwargs
):
1422 IntersectRect(Rect r1, Rect r2) -> Rect
1424 Calculate and return the intersection of r1 and r2.
1426 return _core_
.IntersectRect(*args
, **kwargs
)
1427 #---------------------------------------------------------------------------
1429 class Point2D(object):
1431 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1432 with floating point values.
1434 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1435 __repr__
= _swig_repr
1436 def __init__(self
, *args
, **kwargs
):
1438 __init__(self, double x=0.0, double y=0.0) -> Point2D
1440 Create a w.Point2D object.
1442 _core_
.Point2D_swiginit(self
,_core_
.new_Point2D(*args
, **kwargs
))
1443 def GetFloor(*args
, **kwargs
):
1449 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1451 def GetRounded(*args
, **kwargs
):
1453 GetRounded() -> (x,y)
1457 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1459 def GetVectorLength(*args
, **kwargs
):
1460 """GetVectorLength(self) -> double"""
1461 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1463 def GetVectorAngle(*args
, **kwargs
):
1464 """GetVectorAngle(self) -> double"""
1465 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1467 def SetVectorLength(*args
, **kwargs
):
1468 """SetVectorLength(self, double length)"""
1469 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1471 def SetVectorAngle(*args
, **kwargs
):
1472 """SetVectorAngle(self, double degrees)"""
1473 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1475 def SetPolarCoordinates(self
, angle
, length
):
1476 self
.SetVectorLength(length
)
1477 self
.SetVectorAngle(angle
)
1478 def Normalize(self
):
1479 self
.SetVectorLength(1.0)
1481 def GetDistance(*args
, **kwargs
):
1482 """GetDistance(self, Point2D pt) -> double"""
1483 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1485 def GetDistanceSquare(*args
, **kwargs
):
1486 """GetDistanceSquare(self, Point2D pt) -> double"""
1487 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1489 def GetDotProduct(*args
, **kwargs
):
1490 """GetDotProduct(self, Point2D vec) -> double"""
1491 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1493 def GetCrossProduct(*args
, **kwargs
):
1494 """GetCrossProduct(self, Point2D vec) -> double"""
1495 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1497 def __neg__(*args
, **kwargs
):
1499 __neg__(self) -> Point2D
1501 the reflection of this point
1503 return _core_
.Point2D___neg__(*args
, **kwargs
)
1505 def __iadd__(*args
, **kwargs
):
1506 """__iadd__(self, Point2D pt) -> Point2D"""
1507 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1509 def __isub__(*args
, **kwargs
):
1510 """__isub__(self, Point2D pt) -> Point2D"""
1511 return _core_
.Point2D___isub__(*args
, **kwargs
)
1513 def __imul__(*args
, **kwargs
):
1514 """__imul__(self, Point2D pt) -> Point2D"""
1515 return _core_
.Point2D___imul__(*args
, **kwargs
)
1517 def __idiv__(*args
, **kwargs
):
1518 """__idiv__(self, Point2D pt) -> Point2D"""
1519 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1521 def __eq__(*args
, **kwargs
):
1523 __eq__(self, PyObject other) -> bool
1525 Test for equality of wx.Point2D objects.
1527 return _core_
.Point2D___eq__(*args
, **kwargs
)
1529 def __ne__(*args
, **kwargs
):
1531 __ne__(self, PyObject other) -> bool
1533 Test for inequality of wx.Point2D objects.
1535 return _core_
.Point2D___ne__(*args
, **kwargs
)
1537 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1538 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1539 def Set(*args
, **kwargs
):
1540 """Set(self, double x=0, double y=0)"""
1541 return _core_
.Point2D_Set(*args
, **kwargs
)
1543 def Get(*args
, **kwargs
):
1547 Return x and y properties as a tuple.
1549 return _core_
.Point2D_Get(*args
, **kwargs
)
1551 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1552 def __str__(self
): return str(self
.Get())
1553 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1554 def __len__(self
): return len(self
.Get())
1555 def __getitem__(self
, index
): return self
.Get()[index
]
1556 def __setitem__(self
, index
, val
):
1557 if index
== 0: self
.x
= val
1558 elif index
== 1: self
.y
= val
1559 else: raise IndexError
1560 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1561 __safe_for_unpickling__
= True
1562 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1564 _core_
.Point2D_swigregister(Point2D
)
1566 def Point2DCopy(*args
, **kwargs
):
1568 Point2DCopy(Point2D pt) -> Point2D
1570 Create a w.Point2D object.
1572 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1575 def Point2DFromPoint(*args
, **kwargs
):
1577 Point2DFromPoint(Point pt) -> Point2D
1579 Create a w.Point2D object.
1581 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1584 #---------------------------------------------------------------------------
1586 FromStart
= _core_
.FromStart
1587 FromCurrent
= _core_
.FromCurrent
1588 FromEnd
= _core_
.FromEnd
1589 class InputStream(object):
1590 """Proxy of C++ InputStream class"""
1591 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1592 __repr__
= _swig_repr
1593 def __init__(self
, *args
, **kwargs
):
1594 """__init__(self, PyObject p) -> InputStream"""
1595 _core_
.InputStream_swiginit(self
,_core_
.new_InputStream(*args
, **kwargs
))
1596 __swig_destroy__
= _core_
.delete_InputStream
1597 __del__
= lambda self
: None;
1598 def close(*args
, **kwargs
):
1600 return _core_
.InputStream_close(*args
, **kwargs
)
1602 def flush(*args
, **kwargs
):
1604 return _core_
.InputStream_flush(*args
, **kwargs
)
1606 def eof(*args
, **kwargs
):
1607 """eof(self) -> bool"""
1608 return _core_
.InputStream_eof(*args
, **kwargs
)
1610 def read(*args
, **kwargs
):
1611 """read(self, int size=-1) -> PyObject"""
1612 return _core_
.InputStream_read(*args
, **kwargs
)
1614 def readline(*args
, **kwargs
):
1615 """readline(self, int size=-1) -> PyObject"""
1616 return _core_
.InputStream_readline(*args
, **kwargs
)
1618 def readlines(*args
, **kwargs
):
1619 """readlines(self, int sizehint=-1) -> PyObject"""
1620 return _core_
.InputStream_readlines(*args
, **kwargs
)
1622 def seek(*args
, **kwargs
):
1623 """seek(self, int offset, int whence=0)"""
1624 return _core_
.InputStream_seek(*args
, **kwargs
)
1626 def tell(*args
, **kwargs
):
1627 """tell(self) -> int"""
1628 return _core_
.InputStream_tell(*args
, **kwargs
)
1630 def Peek(*args
, **kwargs
):
1631 """Peek(self) -> char"""
1632 return _core_
.InputStream_Peek(*args
, **kwargs
)
1634 def GetC(*args
, **kwargs
):
1635 """GetC(self) -> char"""
1636 return _core_
.InputStream_GetC(*args
, **kwargs
)
1638 def LastRead(*args
, **kwargs
):
1639 """LastRead(self) -> size_t"""
1640 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1642 def CanRead(*args
, **kwargs
):
1643 """CanRead(self) -> bool"""
1644 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1646 def Eof(*args
, **kwargs
):
1647 """Eof(self) -> bool"""
1648 return _core_
.InputStream_Eof(*args
, **kwargs
)
1650 def Ungetch(*args
, **kwargs
):
1651 """Ungetch(self, char c) -> bool"""
1652 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1654 def SeekI(*args
, **kwargs
):
1655 """SeekI(self, long pos, int mode=FromStart) -> long"""
1656 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1658 def TellI(*args
, **kwargs
):
1659 """TellI(self) -> long"""
1660 return _core_
.InputStream_TellI(*args
, **kwargs
)
1662 _core_
.InputStream_swigregister(InputStream
)
1663 DefaultPosition
= cvar
.DefaultPosition
1664 DefaultSize
= cvar
.DefaultSize
1666 class OutputStream(object):
1667 """Proxy of C++ OutputStream class"""
1668 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1669 def __init__(self
): raise AttributeError, "No constructor defined"
1670 __repr__
= _swig_repr
1671 def write(*args
, **kwargs
):
1672 """write(self, PyObject obj)"""
1673 return _core_
.OutputStream_write(*args
, **kwargs
)
1675 def LastWrite(*args
, **kwargs
):
1676 """LastWrite(self) -> size_t"""
1677 return _core_
.OutputStream_LastWrite(*args
, **kwargs
)
1679 _core_
.OutputStream_swigregister(OutputStream
)
1681 #---------------------------------------------------------------------------
1683 class FSFile(Object
):
1684 """Proxy of C++ FSFile class"""
1685 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1686 __repr__
= _swig_repr
1687 def __init__(self
, *args
, **kwargs
):
1689 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1690 DateTime modif) -> FSFile
1692 _core_
.FSFile_swiginit(self
,_core_
.new_FSFile(*args
, **kwargs
))
1693 self
.thisown
= 0 # It will normally be deleted by the user of the wx.FileSystem
1695 __swig_destroy__
= _core_
.delete_FSFile
1696 __del__
= lambda self
: None;
1697 def GetStream(*args
, **kwargs
):
1698 """GetStream(self) -> InputStream"""
1699 return _core_
.FSFile_GetStream(*args
, **kwargs
)
1701 def GetMimeType(*args
, **kwargs
):
1702 """GetMimeType(self) -> String"""
1703 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
1705 def GetLocation(*args
, **kwargs
):
1706 """GetLocation(self) -> String"""
1707 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
1709 def GetAnchor(*args
, **kwargs
):
1710 """GetAnchor(self) -> String"""
1711 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
1713 def GetModificationTime(*args
, **kwargs
):
1714 """GetModificationTime(self) -> DateTime"""
1715 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
1717 _core_
.FSFile_swigregister(FSFile
)
1719 class CPPFileSystemHandler(object):
1720 """Proxy of C++ CPPFileSystemHandler class"""
1721 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1722 def __init__(self
): raise AttributeError, "No constructor defined"
1723 __repr__
= _swig_repr
1724 __swig_destroy__
= _core_
.delete_CPPFileSystemHandler
1725 __del__
= lambda self
: None;
1726 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandler
)
1728 class FileSystemHandler(CPPFileSystemHandler
):
1729 """Proxy of C++ FileSystemHandler class"""
1730 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1731 __repr__
= _swig_repr
1732 def __init__(self
, *args
, **kwargs
):
1733 """__init__(self) -> FileSystemHandler"""
1734 _core_
.FileSystemHandler_swiginit(self
,_core_
.new_FileSystemHandler(*args
, **kwargs
))
1735 self
._setCallbackInfo
(self
, FileSystemHandler
)
1737 def _setCallbackInfo(*args
, **kwargs
):
1738 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1739 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
1741 def CanOpen(*args
, **kwargs
):
1742 """CanOpen(self, String location) -> bool"""
1743 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
1745 def OpenFile(*args
, **kwargs
):
1746 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1747 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
1749 def FindFirst(*args
, **kwargs
):
1750 """FindFirst(self, String spec, int flags=0) -> String"""
1751 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
1753 def FindNext(*args
, **kwargs
):
1754 """FindNext(self) -> String"""
1755 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
1757 def GetProtocol(*args
, **kwargs
):
1758 """GetProtocol(self, String location) -> String"""
1759 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
1761 def GetLeftLocation(*args
, **kwargs
):
1762 """GetLeftLocation(self, String location) -> String"""
1763 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
1765 def GetAnchor(*args
, **kwargs
):
1766 """GetAnchor(self, String location) -> String"""
1767 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
1769 def GetRightLocation(*args
, **kwargs
):
1770 """GetRightLocation(self, String location) -> String"""
1771 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
1773 def GetMimeTypeFromExt(*args
, **kwargs
):
1774 """GetMimeTypeFromExt(self, String location) -> String"""
1775 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
1777 _core_
.FileSystemHandler_swigregister(FileSystemHandler
)
1779 class FileSystem(Object
):
1780 """Proxy of C++ FileSystem class"""
1781 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1782 __repr__
= _swig_repr
1783 def __init__(self
, *args
, **kwargs
):
1784 """__init__(self) -> FileSystem"""
1785 _core_
.FileSystem_swiginit(self
,_core_
.new_FileSystem(*args
, **kwargs
))
1786 __swig_destroy__
= _core_
.delete_FileSystem
1787 __del__
= lambda self
: None;
1788 def ChangePathTo(*args
, **kwargs
):
1789 """ChangePathTo(self, String location, bool is_dir=False)"""
1790 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
1792 def GetPath(*args
, **kwargs
):
1793 """GetPath(self) -> String"""
1794 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
1796 def OpenFile(*args
, **kwargs
):
1797 """OpenFile(self, String location) -> FSFile"""
1798 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
1800 def FindFirst(*args
, **kwargs
):
1801 """FindFirst(self, String spec, int flags=0) -> String"""
1802 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
1804 def FindNext(*args
, **kwargs
):
1805 """FindNext(self) -> String"""
1806 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
1808 def AddHandler(*args
, **kwargs
):
1809 """AddHandler(CPPFileSystemHandler handler)"""
1810 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1812 AddHandler
= staticmethod(AddHandler
)
1813 def CleanUpHandlers(*args
, **kwargs
):
1814 """CleanUpHandlers()"""
1815 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1817 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
1818 def FileNameToURL(*args
, **kwargs
):
1819 """FileNameToURL(String filename) -> String"""
1820 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1822 FileNameToURL
= staticmethod(FileNameToURL
)
1823 def URLToFileName(*args
, **kwargs
):
1824 """URLToFileName(String url) -> String"""
1825 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1827 URLToFileName
= staticmethod(URLToFileName
)
1828 _core_
.FileSystem_swigregister(FileSystem
)
1830 def FileSystem_AddHandler(*args
, **kwargs
):
1831 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1832 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1834 def FileSystem_CleanUpHandlers(*args
):
1835 """FileSystem_CleanUpHandlers()"""
1836 return _core_
.FileSystem_CleanUpHandlers(*args
)
1838 def FileSystem_FileNameToURL(*args
, **kwargs
):
1839 """FileSystem_FileNameToURL(String filename) -> String"""
1840 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1842 def FileSystem_URLToFileName(*args
, **kwargs
):
1843 """FileSystem_URLToFileName(String url) -> String"""
1844 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1846 class InternetFSHandler(CPPFileSystemHandler
):
1847 """Proxy of C++ InternetFSHandler class"""
1848 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1849 __repr__
= _swig_repr
1850 def __init__(self
, *args
, **kwargs
):
1851 """__init__(self) -> InternetFSHandler"""
1852 _core_
.InternetFSHandler_swiginit(self
,_core_
.new_InternetFSHandler(*args
, **kwargs
))
1853 def CanOpen(*args
, **kwargs
):
1854 """CanOpen(self, String location) -> bool"""
1855 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
1857 def OpenFile(*args
, **kwargs
):
1858 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1859 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
1861 _core_
.InternetFSHandler_swigregister(InternetFSHandler
)
1863 class ZipFSHandler(CPPFileSystemHandler
):
1864 """Proxy of C++ ZipFSHandler class"""
1865 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1866 __repr__
= _swig_repr
1867 def __init__(self
, *args
, **kwargs
):
1868 """__init__(self) -> ZipFSHandler"""
1869 _core_
.ZipFSHandler_swiginit(self
,_core_
.new_ZipFSHandler(*args
, **kwargs
))
1870 def CanOpen(*args
, **kwargs
):
1871 """CanOpen(self, String location) -> bool"""
1872 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
1874 def OpenFile(*args
, **kwargs
):
1875 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1876 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
1878 def FindFirst(*args
, **kwargs
):
1879 """FindFirst(self, String spec, int flags=0) -> String"""
1880 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
1882 def FindNext(*args
, **kwargs
):
1883 """FindNext(self) -> String"""
1884 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
1886 _core_
.ZipFSHandler_swigregister(ZipFSHandler
)
1889 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
1890 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1891 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
1893 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
1894 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1895 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
1897 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
1898 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1899 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
1900 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
1902 Add 'file' to the memory filesystem. The dataItem parameter can
1903 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1904 arbitrary data. If a bitmap or image is used then the imgType
1905 parameter should specify what kind of image file it should be
1906 written as, wx.BITMAP_TYPE_PNG, etc.
1908 if isinstance(dataItem
, wx
.Image
):
1909 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
1910 elif isinstance(dataItem
, wx
.Bitmap
):
1911 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
1912 elif type(dataItem
) == str:
1913 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
1915 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1917 class MemoryFSHandler(CPPFileSystemHandler
):
1918 """Proxy of C++ MemoryFSHandler class"""
1919 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1920 __repr__
= _swig_repr
1921 def __init__(self
, *args
, **kwargs
):
1922 """__init__(self) -> MemoryFSHandler"""
1923 _core_
.MemoryFSHandler_swiginit(self
,_core_
.new_MemoryFSHandler(*args
, **kwargs
))
1924 def RemoveFile(*args
, **kwargs
):
1925 """RemoveFile(String filename)"""
1926 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1928 RemoveFile
= staticmethod(RemoveFile
)
1929 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
1930 def CanOpen(*args
, **kwargs
):
1931 """CanOpen(self, String location) -> bool"""
1932 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
1934 def OpenFile(*args
, **kwargs
):
1935 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1936 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
1938 def FindFirst(*args
, **kwargs
):
1939 """FindFirst(self, String spec, int flags=0) -> String"""
1940 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
1942 def FindNext(*args
, **kwargs
):
1943 """FindNext(self) -> String"""
1944 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
1946 _core_
.MemoryFSHandler_swigregister(MemoryFSHandler
)
1948 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
1949 """MemoryFSHandler_RemoveFile(String filename)"""
1950 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
1952 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
1953 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
1954 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
1955 #---------------------------------------------------------------------------
1957 class ImageHandler(Object
):
1959 This is the base class for implementing image file loading/saving, and
1960 image creation from data. It is used within `wx.Image` and is not
1961 normally seen by the application.
1963 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
1964 def __init__(self
): raise AttributeError, "No constructor defined"
1965 __repr__
= _swig_repr
1966 def GetName(*args
, **kwargs
):
1967 """GetName(self) -> String"""
1968 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
1970 def GetExtension(*args
, **kwargs
):
1971 """GetExtension(self) -> String"""
1972 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
1974 def GetType(*args
, **kwargs
):
1975 """GetType(self) -> long"""
1976 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
1978 def GetMimeType(*args
, **kwargs
):
1979 """GetMimeType(self) -> String"""
1980 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
1982 def CanRead(*args
, **kwargs
):
1983 """CanRead(self, String name) -> bool"""
1984 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
1986 def SetName(*args
, **kwargs
):
1987 """SetName(self, String name)"""
1988 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
1990 def SetExtension(*args
, **kwargs
):
1991 """SetExtension(self, String extension)"""
1992 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
1994 def SetType(*args
, **kwargs
):
1995 """SetType(self, long type)"""
1996 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
1998 def SetMimeType(*args
, **kwargs
):
1999 """SetMimeType(self, String mimetype)"""
2000 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2002 _core_
.ImageHandler_swigregister(ImageHandler
)
2004 class PyImageHandler(ImageHandler
):
2006 This is the base class for implementing image file loading/saving, and
2007 image creation from data, all written in Python. To create a custom
2008 image handler derive a new class from wx.PyImageHandler and provide
2009 the following methods::
2011 def DoCanRead(self, stream) --> bool
2012 '''Check if this handler can read the image on the stream'''
2014 def LoadFile(self, image, stream, verbose, index) --> bool
2015 '''Load image data from the stream and load it into image.'''
2017 def SaveFile(self, image, stream, verbose) --> bool
2018 '''Save the iamge data in image to the stream using
2019 this handler's image file format.'''
2021 def GetImageCount(self, stream) --> int
2022 '''If this image format can hold more than one image,
2023 how many does the image on the stream have?'''
2025 To activate your handler create an instance of it and pass it to
2026 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2027 `SetExtension` from your constructor.
2030 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2031 __repr__
= _swig_repr
2032 def __init__(self
, *args
, **kwargs
):
2034 __init__(self) -> PyImageHandler
2036 This is the base class for implementing image file loading/saving, and
2037 image creation from data, all written in Python. To create a custom
2038 image handler derive a new class from wx.PyImageHandler and provide
2039 the following methods::
2041 def DoCanRead(self, stream) --> bool
2042 '''Check if this handler can read the image on the stream'''
2044 def LoadFile(self, image, stream, verbose, index) --> bool
2045 '''Load image data from the stream and load it into image.'''
2047 def SaveFile(self, image, stream, verbose) --> bool
2048 '''Save the iamge data in image to the stream using
2049 this handler's image file format.'''
2051 def GetImageCount(self, stream) --> int
2052 '''If this image format can hold more than one image,
2053 how many does the image on the stream have?'''
2055 To activate your handler create an instance of it and pass it to
2056 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2057 `SetExtension` from your constructor.
2060 _core_
.PyImageHandler_swiginit(self
,_core_
.new_PyImageHandler(*args
, **kwargs
))
2063 def _SetSelf(*args
, **kwargs
):
2064 """_SetSelf(self, PyObject self)"""
2065 return _core_
.PyImageHandler__SetSelf(*args
, **kwargs
)
2067 _core_
.PyImageHandler_swigregister(PyImageHandler
)
2069 class ImageHistogram(object):
2070 """Proxy of C++ ImageHistogram class"""
2071 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2072 __repr__
= _swig_repr
2073 def __init__(self
, *args
, **kwargs
):
2074 """__init__(self) -> ImageHistogram"""
2075 _core_
.ImageHistogram_swiginit(self
,_core_
.new_ImageHistogram(*args
, **kwargs
))
2076 def MakeKey(*args
, **kwargs
):
2078 MakeKey(byte r, byte g, byte b) -> unsigned long
2080 Get the key in the histogram for the given RGB values
2082 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2084 MakeKey
= staticmethod(MakeKey
)
2085 def FindFirstUnusedColour(*args
, **kwargs
):
2087 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2089 Find first colour that is not used in the image and has higher RGB
2090 values than startR, startG, startB. Returns a tuple consisting of a
2091 success flag and rgb values.
2093 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2095 def GetCount(*args
, **kwargs
):
2097 GetCount(self, unsigned long key) -> unsigned long
2099 Returns the pixel count for the given key. Use `MakeKey` to create a
2100 key value from a RGB tripple.
2102 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2104 def GetCountRGB(*args
, **kwargs
):
2106 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2108 Returns the pixel count for the given RGB values.
2110 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2112 def GetCountColour(*args
, **kwargs
):
2114 GetCountColour(self, Colour colour) -> unsigned long
2116 Returns the pixel count for the given `wx.Colour` value.
2118 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2120 _core_
.ImageHistogram_swigregister(ImageHistogram
)
2122 def ImageHistogram_MakeKey(*args
, **kwargs
):
2124 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2126 Get the key in the histogram for the given RGB values
2128 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2130 class Image_RGBValue(object):
2132 An object that contains values for red, green and blue which represent
2133 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2134 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2137 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2138 __repr__
= _swig_repr
2139 def __init__(self
, *args
, **kwargs
):
2141 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2145 _core_
.Image_RGBValue_swiginit(self
,_core_
.new_Image_RGBValue(*args
, **kwargs
))
2146 red
= property(_core_
.Image_RGBValue_red_get
, _core_
.Image_RGBValue_red_set
)
2147 green
= property(_core_
.Image_RGBValue_green_get
, _core_
.Image_RGBValue_green_set
)
2148 blue
= property(_core_
.Image_RGBValue_blue_get
, _core_
.Image_RGBValue_blue_set
)
2149 _core_
.Image_RGBValue_swigregister(Image_RGBValue
)
2151 class Image_HSVValue(object):
2153 An object that contains values for hue, saturation and value which
2154 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2155 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2158 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2159 __repr__
= _swig_repr
2160 def __init__(self
, *args
, **kwargs
):
2162 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2166 _core_
.Image_HSVValue_swiginit(self
,_core_
.new_Image_HSVValue(*args
, **kwargs
))
2167 hue
= property(_core_
.Image_HSVValue_hue_get
, _core_
.Image_HSVValue_hue_set
)
2168 saturation
= property(_core_
.Image_HSVValue_saturation_get
, _core_
.Image_HSVValue_saturation_set
)
2169 value
= property(_core_
.Image_HSVValue_value_get
, _core_
.Image_HSVValue_value_set
)
2170 _core_
.Image_HSVValue_swigregister(Image_HSVValue
)
2172 class Image(Object
):
2174 A platform-independent image class. An image can be created from
2175 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2176 variety of formats. Functions are available to set and get image
2177 bits, so it can be used for basic image manipulation.
2179 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2180 platform-specific `wx.Bitmap` object must be created from it using the
2181 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2182 device context, using `wx.DC.DrawBitmap`.
2184 One colour value of the image may be used as a mask colour which will
2185 lead to the automatic creation of a `wx.Mask` object associated to the
2188 wx.Image supports alpha channel data, that is in addition to a byte
2189 for the red, green and blue colour components for each pixel it also
2190 stores a byte representing the pixel opacity. An alpha value of 0
2191 corresponds to a transparent pixel (null opacity) while a value of 255
2192 means that the pixel is 100% opaque.
2194 Unlike RGB data, not all images have an alpha channel and before using
2195 `GetAlpha` you should check if this image contains an alpha channel
2196 with `HasAlpha`. Note that currently only images loaded from PNG files
2197 with transparency information will have an alpha channel.
2199 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
2200 __repr__
= _swig_repr
2201 def __init__(self
, *args
, **kwargs
):
2203 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2205 Loads an image from a file.
2207 _core_
.Image_swiginit(self
,_core_
.new_Image(*args
, **kwargs
))
2208 __swig_destroy__
= _core_
.delete_Image
2209 __del__
= lambda self
: None;
2210 def Create(*args
, **kwargs
):
2212 Create(self, int width, int height, bool clear=True)
2214 Creates a fresh image. If clear is ``True``, the new image will be
2215 initialized to black. Otherwise, the image data will be uninitialized.
2217 return _core_
.Image_Create(*args
, **kwargs
)
2219 def Destroy(*args
, **kwargs
):
2223 Destroys the image data.
2225 val
= _core_
.Image_Destroy(*args
, **kwargs
)
2229 def Scale(*args
, **kwargs
):
2231 Scale(self, int width, int height) -> Image
2233 Returns a scaled version of the image. This is also useful for scaling
2234 bitmaps in general as the only other way to scale bitmaps is to blit a
2235 `wx.MemoryDC` into another `wx.MemoryDC`.
2237 return _core_
.Image_Scale(*args
, **kwargs
)
2239 def ShrinkBy(*args
, **kwargs
):
2241 ShrinkBy(self, int xFactor, int yFactor) -> Image
2243 Return a version of the image scaled smaller by the given factors.
2245 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2247 def Rescale(*args
, **kwargs
):
2249 Rescale(self, int width, int height) -> Image
2251 Changes the size of the image in-place by scaling it: after a call to
2252 this function, the image will have the given width and height.
2254 Returns the (modified) image itself.
2256 return _core_
.Image_Rescale(*args
, **kwargs
)
2258 def Resize(*args
, **kwargs
):
2260 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2262 Changes the size of the image in-place without scaling it, by adding
2263 either a border with the given colour or cropping as necessary. The
2264 image is pasted into a new image with the given size and background
2265 colour at the position pos relative to the upper left of the new
2266 image. If red = green = blue = -1 then use either the current mask
2267 colour if set or find, use, and set a suitable mask colour for any
2268 newly exposed areas.
2270 Returns the (modified) image itself.
2272 return _core_
.Image_Resize(*args
, **kwargs
)
2274 def SetRGB(*args
, **kwargs
):
2276 SetRGB(self, int x, int y, byte r, byte g, byte b)
2278 Sets the pixel at the given coordinate. This routine performs
2279 bounds-checks for the coordinate so it can be considered a safe way to
2280 manipulate the data, but in some cases this might be too slow so that
2281 the data will have to be set directly. In that case you will have to
2282 get access to the image data using the `GetData` method.
2284 return _core_
.Image_SetRGB(*args
, **kwargs
)
2286 def SetRGBRect(*args
, **kwargs
):
2288 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2290 Sets the colour of the pixels within the given rectangle. This routine
2291 performs bounds-checks for the rectangle so it can be considered a
2292 safe way to manipulate the data.
2294 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2296 def GetRed(*args
, **kwargs
):
2298 GetRed(self, int x, int y) -> byte
2300 Returns the red intensity at the given coordinate.
2302 return _core_
.Image_GetRed(*args
, **kwargs
)
2304 def GetGreen(*args
, **kwargs
):
2306 GetGreen(self, int x, int y) -> byte
2308 Returns the green intensity at the given coordinate.
2310 return _core_
.Image_GetGreen(*args
, **kwargs
)
2312 def GetBlue(*args
, **kwargs
):
2314 GetBlue(self, int x, int y) -> byte
2316 Returns the blue intensity at the given coordinate.
2318 return _core_
.Image_GetBlue(*args
, **kwargs
)
2320 def SetAlpha(*args
, **kwargs
):
2322 SetAlpha(self, int x, int y, byte alpha)
2324 Sets the alpha value for the given pixel. This function should only be
2325 called if the image has alpha channel data, use `HasAlpha` to check
2328 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2330 def GetAlpha(*args
, **kwargs
):
2332 GetAlpha(self, int x, int y) -> byte
2334 Returns the alpha value for the given pixel. This function may only be
2335 called for the images with alpha channel, use `HasAlpha` to check for
2338 The returned value is the *opacity* of the image, i.e. the value of 0
2339 corresponds to the fully transparent pixels while the value of 255 to
2340 the fully opaque pixels.
2342 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2344 def HasAlpha(*args
, **kwargs
):
2346 HasAlpha(self) -> bool
2348 Returns true if this image has alpha channel, false otherwise.
2350 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2352 def InitAlpha(*args
, **kwargs
):
2356 Initializes the image alpha channel data. It is an error to call it if
2357 the image already has alpha data. If it doesn't, alpha data will be by
2358 default initialized to all pixels being fully opaque. But if the image
2359 has a a mask colour, all mask pixels will be completely transparent.
2361 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2363 def IsTransparent(*args
, **kwargs
):
2365 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2367 Returns ``True`` if this pixel is masked or has an alpha value less
2368 than the spcified threshold.
2370 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2372 def FindFirstUnusedColour(*args
, **kwargs
):
2374 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2376 Find first colour that is not used in the image and has higher RGB
2377 values than startR, startG, startB. Returns a tuple consisting of a
2378 success flag and rgb values.
2380 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2382 def ConvertAlphaToMask(*args
, **kwargs
):
2384 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2386 If the image has alpha channel, this method converts it to mask. All
2387 pixels with alpha value less than ``threshold`` are replaced with the
2388 mask colour and the alpha channel is removed. The mask colour is
2389 chosen automatically using `FindFirstUnusedColour`.
2391 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2394 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2396 def ConvertColourToAlpha(*args
, **kwargs
):
2398 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2400 This method converts an image where the original alpha information is
2401 only available as a shades of a colour (actually shades of grey)
2402 typically when you draw anti-aliased text into a bitmap. The DC
2403 drawing routines draw grey values on the black background although
2404 they actually mean to draw white with differnt alpha values. This
2405 method reverses it, assuming a black (!) background and white text.
2406 The method will then fill up the whole image with the colour given.
2408 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2410 def SetMaskFromImage(*args
, **kwargs
):
2412 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2414 Sets the image's mask so that the pixels that have RGB value of
2415 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2416 by first finding an unused colour in the image, setting this colour as
2417 the mask colour and then using this colour to draw all pixels in the
2418 image who corresponding pixel in mask has given RGB value.
2420 Returns ``False`` if ``mask`` does not have same dimensions as the
2421 image or if there is no unused colour left. Returns ``True`` if the
2422 mask was successfully applied.
2424 Note that this method involves computing the histogram, which is
2425 computationally intensive operation.
2427 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2429 def CanRead(*args
, **kwargs
):
2431 CanRead(String filename) -> bool
2433 Returns True if the image handlers can read this file.
2435 return _core_
.Image_CanRead(*args
, **kwargs
)
2437 CanRead
= staticmethod(CanRead
)
2438 def GetImageCount(*args
, **kwargs
):
2440 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2442 If the image file contains more than one image and the image handler
2443 is capable of retrieving these individually, this function will return
2444 the number of available images.
2446 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2448 GetImageCount
= staticmethod(GetImageCount
)
2449 def LoadFile(*args
, **kwargs
):
2451 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2453 Loads an image from a file. If no handler type is provided, the
2454 library will try to autodetect the format.
2456 return _core_
.Image_LoadFile(*args
, **kwargs
)
2458 def LoadMimeFile(*args
, **kwargs
):
2460 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2462 Loads an image from a file, specifying the image type with a MIME type
2465 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2467 def SaveFile(*args
, **kwargs
):
2469 SaveFile(self, String name, int type) -> bool
2471 Saves an image in the named file.
2473 return _core_
.Image_SaveFile(*args
, **kwargs
)
2475 def SaveMimeFile(*args
, **kwargs
):
2477 SaveMimeFile(self, String name, String mimetype) -> bool
2479 Saves an image in the named file.
2481 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2483 def CanReadStream(*args
, **kwargs
):
2485 CanReadStream(InputStream stream) -> bool
2487 Returns True if the image handlers can read an image file from the
2488 data currently on the input stream, or a readable Python file-like
2491 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2493 CanReadStream
= staticmethod(CanReadStream
)
2494 def LoadStream(*args
, **kwargs
):
2496 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2498 Loads an image from an input stream or a readable Python file-like
2499 object. If no handler type is provided, the library will try to
2500 autodetect the format.
2502 return _core_
.Image_LoadStream(*args
, **kwargs
)
2504 def LoadMimeStream(*args
, **kwargs
):
2506 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2508 Loads an image from an input stream or a readable Python file-like
2509 object, using a MIME type string to specify the image file format.
2511 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2513 def Ok(*args
, **kwargs
):
2517 Returns true if image data is present.
2519 return _core_
.Image_Ok(*args
, **kwargs
)
2521 def GetWidth(*args
, **kwargs
):
2523 GetWidth(self) -> int
2525 Gets the width of the image in pixels.
2527 return _core_
.Image_GetWidth(*args
, **kwargs
)
2529 def GetHeight(*args
, **kwargs
):
2531 GetHeight(self) -> int
2533 Gets the height of the image in pixels.
2535 return _core_
.Image_GetHeight(*args
, **kwargs
)
2537 def GetSize(*args
, **kwargs
):
2539 GetSize(self) -> Size
2541 Returns the size of the image in pixels.
2543 return _core_
.Image_GetSize(*args
, **kwargs
)
2545 def GetSubImage(*args
, **kwargs
):
2547 GetSubImage(self, Rect rect) -> Image
2549 Returns a sub image of the current one as long as the rect belongs
2550 entirely to the image.
2552 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2554 def Size(*args
, **kwargs
):
2556 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2558 Returns a resized version of this image without scaling it by adding
2559 either a border with the given colour or cropping as necessary. The
2560 image is pasted into a new image with the given size and background
2561 colour at the position ``pos`` relative to the upper left of the new
2562 image. If red = green = blue = -1 then use either the current mask
2563 colour if set or find, use, and set a suitable mask colour for any
2564 newly exposed areas.
2566 return _core_
.Image_Size(*args
, **kwargs
)
2568 def Copy(*args
, **kwargs
):
2572 Returns an identical copy of the image.
2574 return _core_
.Image_Copy(*args
, **kwargs
)
2576 def Paste(*args
, **kwargs
):
2578 Paste(self, Image image, int x, int y)
2580 Pastes ``image`` into this instance and takes care of the mask colour
2581 and any out of bounds problems.
2583 return _core_
.Image_Paste(*args
, **kwargs
)
2585 def GetData(*args
, **kwargs
):
2587 GetData(self) -> PyObject
2589 Returns a string containing a copy of the RGB bytes of the image.
2591 return _core_
.Image_GetData(*args
, **kwargs
)
2593 def SetData(*args
, **kwargs
):
2595 SetData(self, buffer data)
2597 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2598 either a string or a buffer object holding the data and the length of
2599 the data must be width*height*3.
2601 return _core_
.Image_SetData(*args
, **kwargs
)
2603 def GetDataBuffer(*args
, **kwargs
):
2605 GetDataBuffer(self) -> PyObject
2607 Returns a writable Python buffer object that is pointing at the RGB
2608 image data buffer inside the wx.Image. You need to ensure that you do
2609 not use this buffer object after the image has been destroyed.
2611 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
2613 def SetDataBuffer(*args
, **kwargs
):
2615 SetDataBuffer(self, buffer data)
2617 Sets the internal image data pointer to point at a Python buffer
2618 object. This can save making an extra copy of the data but you must
2619 ensure that the buffer object lives longer than the wx.Image does.
2621 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
2623 def GetAlphaData(*args
, **kwargs
):
2625 GetAlphaData(self) -> PyObject
2627 Returns a string containing a copy of the alpha bytes of the image.
2629 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
2631 def SetAlphaData(*args
, **kwargs
):
2633 SetAlphaData(self, buffer alpha)
2635 Resets the Image's alpha data from a buffer of bytes. Accepts either
2636 a string or a buffer object holding the data and the length of the
2637 data must be width*height.
2639 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
2641 def GetAlphaBuffer(*args
, **kwargs
):
2642 """GetAlphaBuffer(self) -> PyObject"""
2643 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
2645 def SetAlphaBuffer(*args
, **kwargs
):
2646 """SetAlphaBuffer(self, buffer alpha)"""
2647 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
2649 def SetMaskColour(*args
, **kwargs
):
2651 SetMaskColour(self, byte r, byte g, byte b)
2653 Sets the mask colour for this image (and tells the image to use the
2656 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
2658 def GetOrFindMaskColour(*args
, **kwargs
):
2660 GetOrFindMaskColour() -> (r,g,b)
2662 Get the current mask colour or find a suitable colour.
2664 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
2666 def GetMaskRed(*args
, **kwargs
):
2668 GetMaskRed(self) -> byte
2670 Gets the red component of the mask colour.
2672 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
2674 def GetMaskGreen(*args
, **kwargs
):
2676 GetMaskGreen(self) -> byte
2678 Gets the green component of the mask colour.
2680 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
2682 def GetMaskBlue(*args
, **kwargs
):
2684 GetMaskBlue(self) -> byte
2686 Gets the blue component of the mask colour.
2688 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
2690 def SetMask(*args
, **kwargs
):
2692 SetMask(self, bool mask=True)
2694 Specifies whether there is a mask or not. The area of the mask is
2695 determined by the current mask colour.
2697 return _core_
.Image_SetMask(*args
, **kwargs
)
2699 def HasMask(*args
, **kwargs
):
2701 HasMask(self) -> bool
2703 Returns ``True`` if there is a mask active, ``False`` otherwise.
2705 return _core_
.Image_HasMask(*args
, **kwargs
)
2707 def Rotate(*args
, **kwargs
):
2709 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2710 Point offset_after_rotation=None) -> Image
2712 Rotates the image about the given point, by ``angle`` radians. Passing
2713 ``True`` to ``interpolating`` results in better image quality, but is
2714 slower. If the image has a mask, then the mask colour is used for the
2715 uncovered pixels in the rotated image background. Otherwise, black
2716 will be used as the fill colour.
2718 Returns the rotated image, leaving this image intact.
2720 return _core_
.Image_Rotate(*args
, **kwargs
)
2722 def Rotate90(*args
, **kwargs
):
2724 Rotate90(self, bool clockwise=True) -> Image
2726 Returns a copy of the image rotated 90 degrees in the direction
2727 indicated by ``clockwise``.
2729 return _core_
.Image_Rotate90(*args
, **kwargs
)
2731 def Mirror(*args
, **kwargs
):
2733 Mirror(self, bool horizontally=True) -> Image
2735 Returns a mirrored copy of the image. The parameter ``horizontally``
2736 indicates the orientation.
2738 return _core_
.Image_Mirror(*args
, **kwargs
)
2740 def Replace(*args
, **kwargs
):
2742 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2744 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2747 return _core_
.Image_Replace(*args
, **kwargs
)
2749 def ConvertToGreyscale(*args
, **kwargs
):
2751 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2753 Convert to greyscale image. Uses the luminance component (Y) of the
2754 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2755 defaults to ITU-T BT.601
2757 return _core_
.Image_ConvertToGreyscale(*args
, **kwargs
)
2759 def ConvertToMono(*args
, **kwargs
):
2761 ConvertToMono(self, byte r, byte g, byte b) -> Image
2763 Returns monochromatic version of the image. The returned image has
2764 white colour where the original has ``(r,g,b)`` colour and black
2765 colour everywhere else.
2767 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
2769 def SetOption(*args
, **kwargs
):
2771 SetOption(self, String name, String value)
2773 Sets an image handler defined option. For example, when saving as a
2774 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2775 number between 0 and 100 (0 is terrible, 100 is very good).
2777 return _core_
.Image_SetOption(*args
, **kwargs
)
2779 def SetOptionInt(*args
, **kwargs
):
2781 SetOptionInt(self, String name, int value)
2783 Sets an image option as an integer.
2785 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
2787 def GetOption(*args
, **kwargs
):
2789 GetOption(self, String name) -> String
2791 Gets the value of an image handler option.
2793 return _core_
.Image_GetOption(*args
, **kwargs
)
2795 def GetOptionInt(*args
, **kwargs
):
2797 GetOptionInt(self, String name) -> int
2799 Gets the value of an image handler option as an integer. If the given
2800 option is not present, the function returns 0.
2802 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
2804 def HasOption(*args
, **kwargs
):
2806 HasOption(self, String name) -> bool
2808 Returns true if the given option is present.
2810 return _core_
.Image_HasOption(*args
, **kwargs
)
2812 def CountColours(*args
, **kwargs
):
2813 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2814 return _core_
.Image_CountColours(*args
, **kwargs
)
2816 def ComputeHistogram(*args
, **kwargs
):
2817 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2818 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
2820 def AddHandler(*args
, **kwargs
):
2821 """AddHandler(ImageHandler handler)"""
2822 return _core_
.Image_AddHandler(*args
, **kwargs
)
2824 AddHandler
= staticmethod(AddHandler
)
2825 def InsertHandler(*args
, **kwargs
):
2826 """InsertHandler(ImageHandler handler)"""
2827 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2829 InsertHandler
= staticmethod(InsertHandler
)
2830 def RemoveHandler(*args
, **kwargs
):
2831 """RemoveHandler(String name) -> bool"""
2832 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2834 RemoveHandler
= staticmethod(RemoveHandler
)
2835 def GetHandlers(*args
, **kwargs
):
2836 """GetHandlers() -> PyObject"""
2837 return _core_
.Image_GetHandlers(*args
, **kwargs
)
2839 GetHandlers
= staticmethod(GetHandlers
)
2840 def GetImageExtWildcard(*args
, **kwargs
):
2842 GetImageExtWildcard() -> String
2844 Iterates all registered wxImageHandler objects, and returns a string
2845 containing file extension masks suitable for passing to file open/save
2848 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2850 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
2851 def ConvertToBitmap(*args
, **kwargs
):
2852 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2853 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
2855 def ConvertToMonoBitmap(*args
, **kwargs
):
2856 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2857 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
2859 def RotateHue(*args
, **kwargs
):
2861 RotateHue(self, double angle)
2863 Rotates the hue of each pixel of the image. Hue is a double in the
2864 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2866 return _core_
.Image_RotateHue(*args
, **kwargs
)
2868 def RGBtoHSV(*args
, **kwargs
):
2870 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2872 Converts a color in RGB color space to HSV color space.
2874 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
2876 RGBtoHSV
= staticmethod(RGBtoHSV
)
2877 def HSVtoRGB(*args
, **kwargs
):
2879 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2881 Converts a color in HSV color space to RGB color space.
2883 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
2885 HSVtoRGB
= staticmethod(HSVtoRGB
)
2886 def __nonzero__(self
): return self
.Ok()
2887 _core_
.Image_swigregister(Image
)
2889 def ImageFromMime(*args
, **kwargs
):
2891 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2893 Loads an image from a file, using a MIME type string (such as
2894 'image/jpeg') to specify image type.
2896 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
2899 def ImageFromStream(*args
, **kwargs
):
2901 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2903 Loads an image from an input stream, or any readable Python file-like
2906 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
2909 def ImageFromStreamMime(*args
, **kwargs
):
2911 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2913 Loads an image from an input stream, or any readable Python file-like
2914 object, specifying the image format with a MIME type string.
2916 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
2919 def EmptyImage(*args
, **kwargs
):
2921 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2923 Construct an empty image of a given size, optionally setting all
2926 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
2929 def ImageFromBitmap(*args
, **kwargs
):
2931 ImageFromBitmap(Bitmap bitmap) -> Image
2933 Construct an Image from a `wx.Bitmap`.
2935 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
2938 def ImageFromData(*args
, **kwargs
):
2940 ImageFromData(int width, int height, buffer data) -> Image
2942 Construct an Image from a buffer of RGB bytes. Accepts either a
2943 string or a buffer object holding the data and the length of the data
2944 must be width*height*3.
2946 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
2949 def ImageFromDataWithAlpha(*args
, **kwargs
):
2951 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2953 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2954 Accepts either a string or a buffer object holding the data and the
2955 length of the data must be width*height*3 bytes, and the length of the
2956 alpha data must be width*height bytes.
2958 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
2961 def Image_CanRead(*args
, **kwargs
):
2963 Image_CanRead(String filename) -> bool
2965 Returns True if the image handlers can read this file.
2967 return _core_
.Image_CanRead(*args
, **kwargs
)
2969 def Image_GetImageCount(*args
, **kwargs
):
2971 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2973 If the image file contains more than one image and the image handler
2974 is capable of retrieving these individually, this function will return
2975 the number of available images.
2977 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2979 def Image_CanReadStream(*args
, **kwargs
):
2981 Image_CanReadStream(InputStream stream) -> bool
2983 Returns True if the image handlers can read an image file from the
2984 data currently on the input stream, or a readable Python file-like
2987 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2989 def Image_AddHandler(*args
, **kwargs
):
2990 """Image_AddHandler(ImageHandler handler)"""
2991 return _core_
.Image_AddHandler(*args
, **kwargs
)
2993 def Image_InsertHandler(*args
, **kwargs
):
2994 """Image_InsertHandler(ImageHandler handler)"""
2995 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2997 def Image_RemoveHandler(*args
, **kwargs
):
2998 """Image_RemoveHandler(String name) -> bool"""
2999 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3001 def Image_GetHandlers(*args
):
3002 """Image_GetHandlers() -> PyObject"""
3003 return _core_
.Image_GetHandlers(*args
)
3005 def Image_GetImageExtWildcard(*args
):
3007 Image_GetImageExtWildcard() -> String
3009 Iterates all registered wxImageHandler objects, and returns a string
3010 containing file extension masks suitable for passing to file open/save
3013 return _core_
.Image_GetImageExtWildcard(*args
)
3015 def Image_RGBtoHSV(*args
, **kwargs
):
3017 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3019 Converts a color in RGB color space to HSV color space.
3021 return _core_
.Image_RGBtoHSV(*args
, **kwargs
)
3023 def Image_HSVtoRGB(*args
, **kwargs
):
3025 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3027 Converts a color in HSV color space to RGB color space.
3029 return _core_
.Image_HSVtoRGB(*args
, **kwargs
)
3031 def InitAllImageHandlers():
3033 The former functionality of InitAllImageHanders is now done internal to
3034 the _core_ extension module and so this function has become a simple NOP.
3038 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3039 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3040 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3041 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3042 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3043 BMP_24BPP
= _core_
.BMP_24BPP
3044 BMP_8BPP
= _core_
.BMP_8BPP
3045 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3046 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3047 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3048 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3049 BMP_4BPP
= _core_
.BMP_4BPP
3050 BMP_1BPP
= _core_
.BMP_1BPP
3051 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3052 class BMPHandler(ImageHandler
):
3053 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3054 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3055 __repr__
= _swig_repr
3056 def __init__(self
, *args
, **kwargs
):
3058 __init__(self) -> BMPHandler
3060 A `wx.ImageHandler` for \*.bmp bitmap files.
3062 _core_
.BMPHandler_swiginit(self
,_core_
.new_BMPHandler(*args
, **kwargs
))
3063 _core_
.BMPHandler_swigregister(BMPHandler
)
3064 NullImage
= cvar
.NullImage
3065 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3066 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3067 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3068 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3069 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3070 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3071 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3072 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3073 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3074 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3075 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3076 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3077 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3078 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3079 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3081 class ICOHandler(BMPHandler
):
3082 """A `wx.ImageHandler` for \*.ico icon files."""
3083 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3084 __repr__
= _swig_repr
3085 def __init__(self
, *args
, **kwargs
):
3087 __init__(self) -> ICOHandler
3089 A `wx.ImageHandler` for \*.ico icon files.
3091 _core_
.ICOHandler_swiginit(self
,_core_
.new_ICOHandler(*args
, **kwargs
))
3092 _core_
.ICOHandler_swigregister(ICOHandler
)
3094 class CURHandler(ICOHandler
):
3095 """A `wx.ImageHandler` for \*.cur cursor files."""
3096 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3097 __repr__
= _swig_repr
3098 def __init__(self
, *args
, **kwargs
):
3100 __init__(self) -> CURHandler
3102 A `wx.ImageHandler` for \*.cur cursor files.
3104 _core_
.CURHandler_swiginit(self
,_core_
.new_CURHandler(*args
, **kwargs
))
3105 _core_
.CURHandler_swigregister(CURHandler
)
3107 class ANIHandler(CURHandler
):
3108 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3109 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3110 __repr__
= _swig_repr
3111 def __init__(self
, *args
, **kwargs
):
3113 __init__(self) -> ANIHandler
3115 A `wx.ImageHandler` for \*.ani animated cursor files.
3117 _core_
.ANIHandler_swiginit(self
,_core_
.new_ANIHandler(*args
, **kwargs
))
3118 _core_
.ANIHandler_swigregister(ANIHandler
)
3120 class PNGHandler(ImageHandler
):
3121 """A `wx.ImageHandler` for PNG image files."""
3122 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3123 __repr__
= _swig_repr
3124 def __init__(self
, *args
, **kwargs
):
3126 __init__(self) -> PNGHandler
3128 A `wx.ImageHandler` for PNG image files.
3130 _core_
.PNGHandler_swiginit(self
,_core_
.new_PNGHandler(*args
, **kwargs
))
3131 _core_
.PNGHandler_swigregister(PNGHandler
)
3133 class GIFHandler(ImageHandler
):
3134 """A `wx.ImageHandler` for GIF image files."""
3135 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3136 __repr__
= _swig_repr
3137 def __init__(self
, *args
, **kwargs
):
3139 __init__(self) -> GIFHandler
3141 A `wx.ImageHandler` for GIF image files.
3143 _core_
.GIFHandler_swiginit(self
,_core_
.new_GIFHandler(*args
, **kwargs
))
3144 _core_
.GIFHandler_swigregister(GIFHandler
)
3146 class PCXHandler(ImageHandler
):
3147 """A `wx.ImageHandler` for PCX imager files."""
3148 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3149 __repr__
= _swig_repr
3150 def __init__(self
, *args
, **kwargs
):
3152 __init__(self) -> PCXHandler
3154 A `wx.ImageHandler` for PCX imager files.
3156 _core_
.PCXHandler_swiginit(self
,_core_
.new_PCXHandler(*args
, **kwargs
))
3157 _core_
.PCXHandler_swigregister(PCXHandler
)
3159 class JPEGHandler(ImageHandler
):
3160 """A `wx.ImageHandler` for JPEG/JPG image files."""
3161 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3162 __repr__
= _swig_repr
3163 def __init__(self
, *args
, **kwargs
):
3165 __init__(self) -> JPEGHandler
3167 A `wx.ImageHandler` for JPEG/JPG image files.
3169 _core_
.JPEGHandler_swiginit(self
,_core_
.new_JPEGHandler(*args
, **kwargs
))
3170 _core_
.JPEGHandler_swigregister(JPEGHandler
)
3172 class PNMHandler(ImageHandler
):
3173 """A `wx.ImageHandler` for PNM image files."""
3174 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3175 __repr__
= _swig_repr
3176 def __init__(self
, *args
, **kwargs
):
3178 __init__(self) -> PNMHandler
3180 A `wx.ImageHandler` for PNM image files.
3182 _core_
.PNMHandler_swiginit(self
,_core_
.new_PNMHandler(*args
, **kwargs
))
3183 _core_
.PNMHandler_swigregister(PNMHandler
)
3185 class XPMHandler(ImageHandler
):
3186 """A `wx.ImageHandler` for XPM image."""
3187 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3188 __repr__
= _swig_repr
3189 def __init__(self
, *args
, **kwargs
):
3191 __init__(self) -> XPMHandler
3193 A `wx.ImageHandler` for XPM image.
3195 _core_
.XPMHandler_swiginit(self
,_core_
.new_XPMHandler(*args
, **kwargs
))
3196 _core_
.XPMHandler_swigregister(XPMHandler
)
3198 class TIFFHandler(ImageHandler
):
3199 """A `wx.ImageHandler` for TIFF image files."""
3200 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3201 __repr__
= _swig_repr
3202 def __init__(self
, *args
, **kwargs
):
3204 __init__(self) -> TIFFHandler
3206 A `wx.ImageHandler` for TIFF image files.
3208 _core_
.TIFFHandler_swiginit(self
,_core_
.new_TIFFHandler(*args
, **kwargs
))
3209 _core_
.TIFFHandler_swigregister(TIFFHandler
)
3211 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3212 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3213 class Quantize(object):
3214 """Performs quantization, or colour reduction, on a wxImage."""
3215 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3216 def __init__(self
): raise AttributeError, "No constructor defined"
3217 __repr__
= _swig_repr
3218 def Quantize(*args
, **kwargs
):
3220 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3222 Reduce the colours in the source image and put the result into the
3223 destination image, setting the palette in the destination if
3224 needed. Both images may be the same, to overwrite the source image.
3226 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3228 Quantize
= staticmethod(Quantize
)
3229 _core_
.Quantize_swigregister(Quantize
)
3231 def Quantize_Quantize(*args
, **kwargs
):
3233 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3235 Reduce the colours in the source image and put the result into the
3236 destination image, setting the palette in the destination if
3237 needed. Both images may be the same, to overwrite the source image.
3239 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3241 #---------------------------------------------------------------------------
3243 class EvtHandler(Object
):
3244 """Proxy of C++ EvtHandler class"""
3245 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3246 __repr__
= _swig_repr
3247 def __init__(self
, *args
, **kwargs
):
3248 """__init__(self) -> EvtHandler"""
3249 _core_
.EvtHandler_swiginit(self
,_core_
.new_EvtHandler(*args
, **kwargs
))
3250 def GetNextHandler(*args
, **kwargs
):
3251 """GetNextHandler(self) -> EvtHandler"""
3252 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3254 def GetPreviousHandler(*args
, **kwargs
):
3255 """GetPreviousHandler(self) -> EvtHandler"""
3256 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3258 def SetNextHandler(*args
, **kwargs
):
3259 """SetNextHandler(self, EvtHandler handler)"""
3260 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3262 def SetPreviousHandler(*args
, **kwargs
):
3263 """SetPreviousHandler(self, EvtHandler handler)"""
3264 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3266 def GetEvtHandlerEnabled(*args
, **kwargs
):
3267 """GetEvtHandlerEnabled(self) -> bool"""
3268 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3270 def SetEvtHandlerEnabled(*args
, **kwargs
):
3271 """SetEvtHandlerEnabled(self, bool enabled)"""
3272 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3274 def ProcessEvent(*args
, **kwargs
):
3275 """ProcessEvent(self, Event event) -> bool"""
3276 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3278 def AddPendingEvent(*args
, **kwargs
):
3279 """AddPendingEvent(self, Event event)"""
3280 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3282 def ProcessPendingEvents(*args
, **kwargs
):
3283 """ProcessPendingEvents(self)"""
3284 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3286 def Connect(*args
, **kwargs
):
3287 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3288 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3290 def Disconnect(*args
, **kwargs
):
3291 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
3292 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3294 def _setOORInfo(*args
, **kwargs
):
3295 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3296 val
= _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3300 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3302 Bind an event to an event handler.
3304 :param event: One of the EVT_* objects that specifies the
3305 type of event to bind,
3307 :param handler: A callable object to be invoked when the
3308 event is delivered to self. Pass None to
3309 disconnect an event handler.
3311 :param source: Sometimes the event originates from a
3312 different window than self, but you still
3313 want to catch it in self. (For example, a
3314 button event delivered to a frame.) By
3315 passing the source of the event, the event
3316 handling system is able to differentiate
3317 between the same event type from different
3320 :param id: Used to spcify the event source by ID instead
3323 :param id2: Used when it is desirable to bind a handler
3324 to a range of IDs, such as with EVT_MENU_RANGE.
3326 if source
is not None:
3328 event
.Bind(self
, id, id2
, handler
)
3330 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3332 Disconencts the event handler binding for event from self.
3333 Returns True if successful.
3335 if source
is not None:
3337 return event
.Unbind(self
, id, id2
)
3339 _core_
.EvtHandler_swigregister(EvtHandler
)
3341 #---------------------------------------------------------------------------
3343 class PyEventBinder(object):
3345 Instances of this class are used to bind specific events to event
3348 def __init__(self
, evtType
, expectedIDs
=0):
3349 if expectedIDs
not in [0, 1, 2]:
3350 raise ValueError, "Invalid number of expectedIDs"
3351 self
.expectedIDs
= expectedIDs
3353 if type(evtType
) == list or type(evtType
) == tuple:
3354 self
.evtType
= evtType
3356 self
.evtType
= [evtType
]
3359 def Bind(self
, target
, id1
, id2
, function
):
3360 """Bind this set of event types to target."""
3361 for et
in self
.evtType
:
3362 target
.Connect(id1
, id2
, et
, function
)
3365 def Unbind(self
, target
, id1
, id2
):
3366 """Remove an event binding."""
3368 for et
in self
.evtType
:
3369 success
+= target
.Disconnect(id1
, id2
, et
)
3373 def __call__(self
, *args
):
3375 For backwards compatibility with the old EVT_* functions.
3376 Should be called with either (window, func), (window, ID,
3377 func) or (window, ID1, ID2, func) parameters depending on the
3380 assert len(args
) == 2 + self
.expectedIDs
3384 if self
.expectedIDs
== 0:
3386 elif self
.expectedIDs
== 1:
3389 elif self
.expectedIDs
== 2:
3394 raise ValueError, "Unexpected number of IDs"
3396 self
.Bind(target
, id1
, id2
, func
)
3399 # These two are square pegs that don't fit the PyEventBinder hole...
3400 def EVT_COMMAND(win
, id, cmd
, func
):
3401 win
.Connect(id, -1, cmd
, func
)
3402 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3403 win
.Connect(id1
, id2
, cmd
, func
)
3406 #---------------------------------------------------------------------------
3408 #---------------------------------------------------------------------------
3410 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3411 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3413 def NewEventType(*args
):
3414 """NewEventType() -> EventType"""
3415 return _core_
.NewEventType(*args
)
3416 wxEVT_NULL
= _core_
.wxEVT_NULL
3417 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3418 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3419 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3420 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3421 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3422 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3423 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3424 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3425 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3426 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3427 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3428 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3429 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3430 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3431 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3432 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3433 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3434 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3435 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3436 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3437 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3438 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3439 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3440 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3441 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3442 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3443 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3444 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3445 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3446 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3447 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3448 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3449 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3450 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3451 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3452 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3453 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3454 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3455 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3456 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3457 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3458 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3459 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3460 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3461 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3462 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3463 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3464 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3465 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3466 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3467 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3468 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3469 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3470 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3471 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3472 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3473 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3474 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3475 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3476 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3477 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3478 wxEVT_SCROLL_CHANGED
= _core_
.wxEVT_SCROLL_CHANGED
3479 wxEVT_SCROLL_ENDSCROLL
= wxEVT_SCROLL_CHANGED
3480 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3481 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3482 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3483 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3484 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3485 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3486 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3487 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3488 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3489 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3490 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3491 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3492 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3493 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3494 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3495 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3496 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3497 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3498 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3499 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3500 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3501 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3502 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3503 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3504 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3505 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3506 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3507 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3508 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3509 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3510 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3511 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3512 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3513 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3514 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
3515 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
3516 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
3517 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
3518 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
3519 wxEVT_IDLE
= _core_
.wxEVT_IDLE
3520 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
3521 wxEVT_SIZING
= _core_
.wxEVT_SIZING
3522 wxEVT_MOVING
= _core_
.wxEVT_MOVING
3523 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
3524 wxEVT_COMMAND_TEXT_COPY
= _core_
.wxEVT_COMMAND_TEXT_COPY
3525 wxEVT_COMMAND_TEXT_CUT
= _core_
.wxEVT_COMMAND_TEXT_CUT
3526 wxEVT_COMMAND_TEXT_PASTE
= _core_
.wxEVT_COMMAND_TEXT_PASTE
3527 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
3528 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
3529 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
3530 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
3531 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
3532 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
3533 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
3535 # Create some event binders
3536 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
3537 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
3538 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
3539 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
3540 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
3541 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3542 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3543 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
3544 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
3545 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
3546 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
3547 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
3548 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
3549 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
3550 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
3551 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
3552 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
3553 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
3554 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
3555 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
3556 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
3557 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
3558 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
3559 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
3560 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
3561 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3562 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3563 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
3564 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
3565 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
3566 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
3567 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
3568 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
3569 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
3570 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
3571 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
3572 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
3573 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
3574 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
3575 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
3576 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
3578 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
3579 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
3580 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
3581 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
3582 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
3583 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
3584 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
3585 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
3586 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
3587 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
3588 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
3589 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
3590 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
3592 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
3600 wxEVT_MIDDLE_DCLICK
,
3608 # Scrolling from wxWindow (sent to wxScrolledWindow)
3609 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
3610 wxEVT_SCROLLWIN_BOTTOM
,
3611 wxEVT_SCROLLWIN_LINEUP
,
3612 wxEVT_SCROLLWIN_LINEDOWN
,
3613 wxEVT_SCROLLWIN_PAGEUP
,
3614 wxEVT_SCROLLWIN_PAGEDOWN
,
3615 wxEVT_SCROLLWIN_THUMBTRACK
,
3616 wxEVT_SCROLLWIN_THUMBRELEASE
,
3619 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
3620 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
3621 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
3622 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
3623 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
3624 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
3625 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
3626 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
3628 # Scrolling from wx.Slider and wx.ScrollBar
3629 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3630 wxEVT_SCROLL_BOTTOM
,
3631 wxEVT_SCROLL_LINEUP
,
3632 wxEVT_SCROLL_LINEDOWN
,
3633 wxEVT_SCROLL_PAGEUP
,
3634 wxEVT_SCROLL_PAGEDOWN
,
3635 wxEVT_SCROLL_THUMBTRACK
,
3636 wxEVT_SCROLL_THUMBRELEASE
,
3637 wxEVT_SCROLL_CHANGED
,
3640 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
3641 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
3642 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
3643 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
3644 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
3645 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
3646 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
3647 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
3648 EVT_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
)
3649 EVT_SCROLL_ENDSCROLL
= EVT_SCROLL_CHANGED
3651 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3652 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3653 wxEVT_SCROLL_BOTTOM
,
3654 wxEVT_SCROLL_LINEUP
,
3655 wxEVT_SCROLL_LINEDOWN
,
3656 wxEVT_SCROLL_PAGEUP
,
3657 wxEVT_SCROLL_PAGEDOWN
,
3658 wxEVT_SCROLL_THUMBTRACK
,
3659 wxEVT_SCROLL_THUMBRELEASE
,
3660 wxEVT_SCROLL_CHANGED
,
3663 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
3664 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
3665 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
3666 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
3667 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
3668 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
3669 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
3670 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
3671 EVT_COMMAND_SCROLL_CHANGED
= wx
.PyEventBinder( wxEVT_SCROLL_CHANGED
, 1)
3672 EVT_COMMAND_SCROLL_ENDSCROLL
= EVT_COMMAND_SCROLL_CHANGED
3674 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
3675 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
3676 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
3677 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
3678 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
3679 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
3680 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
3681 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
3682 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
3683 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
3685 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
3686 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
3687 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
3688 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
3689 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
3690 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
3691 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
3692 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
3693 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
3696 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
3697 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
3698 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
3699 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
3700 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
3701 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
3702 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
3704 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
3706 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
3707 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
3709 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
3711 EVT_TEXT_CUT
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_CUT
)
3712 EVT_TEXT_COPY
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_COPY
)
3713 EVT_TEXT_PASTE
= wx
.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE
)
3716 #---------------------------------------------------------------------------
3718 class Event(Object
):
3720 An event is a structure holding information about an event passed to a
3721 callback or member function. wx.Event is an abstract base class for
3724 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3725 def __init__(self
): raise AttributeError, "No constructor defined"
3726 __repr__
= _swig_repr
3727 __swig_destroy__
= _core_
.delete_Event
3728 __del__
= lambda self
: None;
3729 def SetEventType(*args
, **kwargs
):
3731 SetEventType(self, EventType typ)
3733 Sets the specific type of the event.
3735 return _core_
.Event_SetEventType(*args
, **kwargs
)
3737 def GetEventType(*args
, **kwargs
):
3739 GetEventType(self) -> EventType
3741 Returns the identifier of the given event type, such as
3742 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3744 return _core_
.Event_GetEventType(*args
, **kwargs
)
3746 def GetEventObject(*args
, **kwargs
):
3748 GetEventObject(self) -> Object
3750 Returns the object (usually a window) associated with the event, if
3753 return _core_
.Event_GetEventObject(*args
, **kwargs
)
3755 def SetEventObject(*args
, **kwargs
):
3757 SetEventObject(self, Object obj)
3759 Sets the originating object, or in other words, obj is normally the
3760 object that is sending the event.
3762 return _core_
.Event_SetEventObject(*args
, **kwargs
)
3764 def GetTimestamp(*args
, **kwargs
):
3765 """GetTimestamp(self) -> long"""
3766 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
3768 def SetTimestamp(*args
, **kwargs
):
3769 """SetTimestamp(self, long ts=0)"""
3770 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
3772 def GetId(*args
, **kwargs
):
3776 Returns the identifier associated with this event, such as a button
3779 return _core_
.Event_GetId(*args
, **kwargs
)
3781 def SetId(*args
, **kwargs
):
3785 Set's the ID for the event. This is usually the ID of the window that
3786 is sending the event, but it can also be a command id from a menu
3789 return _core_
.Event_SetId(*args
, **kwargs
)
3791 def IsCommandEvent(*args
, **kwargs
):
3793 IsCommandEvent(self) -> bool
3795 Returns true if the event is or is derived from `wx.CommandEvent` else
3796 it returns false. Note: Exists only for optimization purposes.
3798 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
3800 def Skip(*args
, **kwargs
):
3802 Skip(self, bool skip=True)
3804 Called by an event handler, it controls whether additional event
3805 handlers bound to this event will be called after the current event
3806 handler returns. Skip(false) (the default setting) will prevent
3807 additional event handlers from being called and control will be
3808 returned to the sender of the event immediately after the current
3809 handler has finished. Skip(True) will cause the event processing
3810 system to continue searching for a handler function for this event.
3813 return _core_
.Event_Skip(*args
, **kwargs
)
3815 def GetSkipped(*args
, **kwargs
):
3817 GetSkipped(self) -> bool
3819 Returns true if the event handler should be skipped, false otherwise.
3822 return _core_
.Event_GetSkipped(*args
, **kwargs
)
3824 def ShouldPropagate(*args
, **kwargs
):
3826 ShouldPropagate(self) -> bool
3828 Test if this event should be propagated to the parent window or not,
3829 i.e. if the propagation level is currently greater than 0.
3831 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
3833 def StopPropagation(*args
, **kwargs
):
3835 StopPropagation(self) -> int
3837 Stop the event from propagating to its parent window. Returns the old
3838 propagation level value which may be later passed to
3839 `ResumePropagation` to allow propagating the event again.
3841 return _core_
.Event_StopPropagation(*args
, **kwargs
)
3843 def ResumePropagation(*args
, **kwargs
):
3845 ResumePropagation(self, int propagationLevel)
3847 Resume the event propagation by restoring the propagation level. (For
3848 example, you can use the value returned by an earlier call to
3852 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
3854 def Clone(*args
, **kwargs
):
3855 """Clone(self) -> Event"""
3856 return _core_
.Event_Clone(*args
, **kwargs
)
3858 _core_
.Event_swigregister(Event
)
3860 #---------------------------------------------------------------------------
3862 class PropagationDisabler(object):
3864 Helper class to temporarily change an event not to propagate. Simply
3865 create an instance of this class and then whe it is destroyed the
3866 propogation of the event will be restored.
3868 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3869 __repr__
= _swig_repr
3870 def __init__(self
, *args
, **kwargs
):
3872 __init__(self, Event event) -> PropagationDisabler
3874 Helper class to temporarily change an event not to propagate. Simply
3875 create an instance of this class and then whe it is destroyed the
3876 propogation of the event will be restored.
3878 _core_
.PropagationDisabler_swiginit(self
,_core_
.new_PropagationDisabler(*args
, **kwargs
))
3879 __swig_destroy__
= _core_
.delete_PropagationDisabler
3880 __del__
= lambda self
: None;
3881 _core_
.PropagationDisabler_swigregister(PropagationDisabler
)
3883 class PropagateOnce(object):
3885 A helper class that will temporarily lower propagation level of an
3886 event. Simply create an instance of this class and then whe it is
3887 destroyed the propogation of the event will be restored.
3889 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3890 __repr__
= _swig_repr
3891 def __init__(self
, *args
, **kwargs
):
3893 __init__(self, Event event) -> PropagateOnce
3895 A helper class that will temporarily lower propagation level of an
3896 event. Simply create an instance of this class and then whe it is
3897 destroyed the propogation of the event will be restored.
3899 _core_
.PropagateOnce_swiginit(self
,_core_
.new_PropagateOnce(*args
, **kwargs
))
3900 __swig_destroy__
= _core_
.delete_PropagateOnce
3901 __del__
= lambda self
: None;
3902 _core_
.PropagateOnce_swigregister(PropagateOnce
)
3904 #---------------------------------------------------------------------------
3906 class CommandEvent(Event
):
3908 This event class contains information about command events, which
3909 originate from a variety of simple controls, as well as menus and
3912 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
3913 __repr__
= _swig_repr
3914 def __init__(self
, *args
, **kwargs
):
3916 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3918 This event class contains information about command events, which
3919 originate from a variety of simple controls, as well as menus and
3922 _core_
.CommandEvent_swiginit(self
,_core_
.new_CommandEvent(*args
, **kwargs
))
3923 def GetSelection(*args
, **kwargs
):
3925 GetSelection(self) -> int
3927 Returns item index for a listbox or choice selection event (not valid
3930 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
3932 def SetString(*args
, **kwargs
):
3933 """SetString(self, String s)"""
3934 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
3936 def GetString(*args
, **kwargs
):
3938 GetString(self) -> String
3940 Returns item string for a listbox or choice selection event (not valid
3943 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
3945 def IsChecked(*args
, **kwargs
):
3947 IsChecked(self) -> bool
3949 This method can be used with checkbox and menu events: for the
3950 checkboxes, the method returns true for a selection event and false
3951 for a deselection one. For the menu events, this method indicates if
3952 the menu item just has become checked or unchecked (and thus only
3953 makes sense for checkable menu items).
3955 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
3958 def IsSelection(*args
, **kwargs
):
3960 IsSelection(self) -> bool
3962 For a listbox or similar event, returns true if it is a selection,
3963 false if it is a deselection.
3965 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
3967 def SetExtraLong(*args
, **kwargs
):
3968 """SetExtraLong(self, long extraLong)"""
3969 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
3971 def GetExtraLong(*args
, **kwargs
):
3973 GetExtraLong(self) -> long
3975 Returns extra information dependant on the event objects type. If the
3976 event comes from a listbox selection, it is a boolean determining
3977 whether the event was a selection (true) or a deselection (false). A
3978 listbox deselection only occurs for multiple-selection boxes, and in
3979 this case the index and string values are indeterminate and the
3980 listbox must be examined by the application.
3982 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
3984 def SetInt(*args
, **kwargs
):
3985 """SetInt(self, int i)"""
3986 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
3988 def GetInt(*args
, **kwargs
):
3992 Returns the integer identifier corresponding to a listbox, choice or
3993 radiobox selection (only if the event was a selection, not a
3994 deselection), or a boolean value representing the value of a checkbox.
3996 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
3998 def GetClientData(*args
, **kwargs
):
4000 GetClientData(self) -> PyObject
4002 Returns the client data object for a listbox or choice selection event, (if any.)
4004 return _core_
.CommandEvent_GetClientData(*args
, **kwargs
)
4006 def SetClientData(*args
, **kwargs
):
4008 SetClientData(self, PyObject clientData)
4010 Associate the given client data with the item at position n.
4012 return _core_
.CommandEvent_SetClientData(*args
, **kwargs
)
4014 GetClientObject
= GetClientData
4015 SetClientObject
= SetClientData
4017 def Clone(*args
, **kwargs
):
4018 """Clone(self) -> Event"""
4019 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4021 _core_
.CommandEvent_swigregister(CommandEvent
)
4023 #---------------------------------------------------------------------------
4025 class NotifyEvent(CommandEvent
):
4027 An instance of this class (or one of its derived classes) is sent from
4028 a control when the control's state is being changed and the control
4029 allows that change to be prevented from happening. The event handler
4030 can call `Veto` or `Allow` to tell the control what to do.
4032 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4033 __repr__
= _swig_repr
4034 def __init__(self
, *args
, **kwargs
):
4036 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4038 An instance of this class (or one of its derived classes) is sent from
4039 a control when the control's state is being changed and the control
4040 allows that change to be prevented from happening. The event handler
4041 can call `Veto` or `Allow` to tell the control what to do.
4043 _core_
.NotifyEvent_swiginit(self
,_core_
.new_NotifyEvent(*args
, **kwargs
))
4044 def Veto(*args
, **kwargs
):
4048 Prevents the change announced by this event from happening.
4050 It is in general a good idea to notify the user about the reasons for
4051 vetoing the change because otherwise the applications behaviour (which
4052 just refuses to do what the user wants) might be quite surprising.
4054 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4056 def Allow(*args
, **kwargs
):
4060 This is the opposite of `Veto`: it explicitly allows the event to be
4061 processed. For most events it is not necessary to call this method as
4062 the events are allowed anyhow but some are forbidden by default (this
4063 will be mentioned in the corresponding event description).
4065 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4067 def IsAllowed(*args
, **kwargs
):
4069 IsAllowed(self) -> bool
4071 Returns true if the change is allowed (`Veto` hasn't been called) or
4072 false otherwise (if it was).
4074 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4076 _core_
.NotifyEvent_swigregister(NotifyEvent
)
4078 #---------------------------------------------------------------------------
4080 class ScrollEvent(CommandEvent
):
4082 A scroll event holds information about events sent from stand-alone
4083 scrollbars and sliders. Note that scrolled windows do not send
4084 instnaces of this event class, but send the `wx.ScrollWinEvent`
4087 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4088 __repr__
= _swig_repr
4089 def __init__(self
, *args
, **kwargs
):
4091 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4092 int orient=0) -> ScrollEvent
4094 _core_
.ScrollEvent_swiginit(self
,_core_
.new_ScrollEvent(*args
, **kwargs
))
4095 def GetOrientation(*args
, **kwargs
):
4097 GetOrientation(self) -> int
4099 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4102 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4104 def GetPosition(*args
, **kwargs
):
4106 GetPosition(self) -> int
4108 Returns the position of the scrollbar.
4110 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4112 def SetOrientation(*args
, **kwargs
):
4113 """SetOrientation(self, int orient)"""
4114 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4116 def SetPosition(*args
, **kwargs
):
4117 """SetPosition(self, int pos)"""
4118 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4120 _core_
.ScrollEvent_swigregister(ScrollEvent
)
4122 #---------------------------------------------------------------------------
4124 class ScrollWinEvent(Event
):
4126 A wx.ScrollWinEvent holds information about scrolling and is sent from
4129 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4130 __repr__
= _swig_repr
4131 def __init__(self
, *args
, **kwargs
):
4133 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4135 A wx.ScrollWinEvent holds information about scrolling and is sent from
4138 _core_
.ScrollWinEvent_swiginit(self
,_core_
.new_ScrollWinEvent(*args
, **kwargs
))
4139 def GetOrientation(*args
, **kwargs
):
4141 GetOrientation(self) -> int
4143 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4146 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4148 def GetPosition(*args
, **kwargs
):
4150 GetPosition(self) -> int
4152 Returns the position of the scrollbar for the thumb track and release
4153 events. Note that this field can't be used for the other events, you
4154 need to query the window itself for the current position in that case.
4156 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4158 def SetOrientation(*args
, **kwargs
):
4159 """SetOrientation(self, int orient)"""
4160 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4162 def SetPosition(*args
, **kwargs
):
4163 """SetPosition(self, int pos)"""
4164 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4166 _core_
.ScrollWinEvent_swigregister(ScrollWinEvent
)
4168 #---------------------------------------------------------------------------
4170 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4171 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4172 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4173 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4174 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4175 class MouseEvent(Event
):
4177 This event class contains information about the events generated by
4178 the mouse: they include mouse buttons press and release events and
4181 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4182 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4183 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4184 a middle button so a portable application should avoid relying on the
4187 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4188 the former returns true when the event corresponds to the left mouse
4189 button click while the latter returns true if the left mouse button is
4190 currently being pressed. For example, when the user is dragging the
4191 mouse you can use `LeftIsDown` to test whether the left mouse button
4192 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4193 `LeftIsDown` will also return true in wxWidgets whatever the
4194 underlying GUI behaviour is (which is platform-dependent). The same
4195 applies, of course, to other mouse buttons as well.
4197 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4198 __repr__
= _swig_repr
4199 def __init__(self
, *args
, **kwargs
):
4201 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
4203 Constructs a wx.MouseEvent. Valid event types are:
4205 * wxEVT_ENTER_WINDOW
4206 * wxEVT_LEAVE_WINDOW
4212 * wxEVT_MIDDLE_DCLICK
4215 * wxEVT_RIGHT_DCLICK
4219 _core_
.MouseEvent_swiginit(self
,_core_
.new_MouseEvent(*args
, **kwargs
))
4220 def IsButton(*args
, **kwargs
):
4222 IsButton(self) -> bool
4224 Returns true if the event was a mouse button event (not necessarily a
4225 button down event - that may be tested using `ButtonDown`).
4227 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4229 def ButtonDown(*args
, **kwargs
):
4231 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4233 If the argument is omitted, this returns true if the event was any
4234 mouse button down event. Otherwise the argument specifies which
4235 button-down event shold be checked for (see `Button` for the possible
4238 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4240 def ButtonDClick(*args
, **kwargs
):
4242 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4244 If the argument is omitted, this returns true if the event was any
4245 mouse double click event. Otherwise the argument specifies which
4246 double click event to check for (see `Button` for the possible
4249 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4251 def ButtonUp(*args
, **kwargs
):
4253 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4255 If the argument is omitted, this returns true if the event was any
4256 mouse button up event. Otherwise the argument specifies which button
4257 up event to check for (see `Button` for the possible values).
4259 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4261 def Button(*args
, **kwargs
):
4263 Button(self, int button) -> bool
4265 Returns true if the identified mouse button is changing state. Valid
4266 values of button are:
4268 ==================== =====================================
4269 wx.MOUSE_BTN_LEFT check if left button was pressed
4270 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4271 wx.MOUSE_BTN_RIGHT check if right button was pressed
4272 wx.MOUSE_BTN_ANY check if any button was pressed
4273 ==================== =====================================
4276 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4278 def ButtonIsDown(*args
, **kwargs
):
4279 """ButtonIsDown(self, int but) -> bool"""
4280 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4282 def GetButton(*args
, **kwargs
):
4284 GetButton(self) -> int
4286 Returns the mouse button which generated this event or
4287 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4288 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4289 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4290 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4291 right buttons respectively.
4293 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4295 def ControlDown(*args
, **kwargs
):
4297 ControlDown(self) -> bool
4299 Returns true if the control key was down at the time of the event.
4301 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4303 def MetaDown(*args
, **kwargs
):
4305 MetaDown(self) -> bool
4307 Returns true if the Meta key was down at the time of the event.
4309 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4311 def AltDown(*args
, **kwargs
):
4313 AltDown(self) -> bool
4315 Returns true if the Alt key was down at the time of the event.
4317 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4319 def ShiftDown(*args
, **kwargs
):
4321 ShiftDown(self) -> bool
4323 Returns true if the Shift key was down at the time of the event.
4325 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4327 def CmdDown(*args
, **kwargs
):
4329 CmdDown(self) -> bool
4331 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4332 platforms but the special "Apple" (a.k.a as "Command") key on
4333 Macs. It often makes sense to use it instead of, say, `ControlDown`
4334 because Cmd key is used for the same thing under Mac as Ctrl
4335 elsewhere. The Ctrl key still exists, it's just not used for this
4336 purpose. So for non-Mac platforms this is the same as `ControlDown`
4337 and Macs this is the same as `MetaDown`.
4339 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4341 def LeftDown(*args
, **kwargs
):
4343 LeftDown(self) -> bool
4345 Returns true if the left mouse button state changed to down.
4347 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4349 def MiddleDown(*args
, **kwargs
):
4351 MiddleDown(self) -> bool
4353 Returns true if the middle mouse button state changed to down.
4355 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4357 def RightDown(*args
, **kwargs
):
4359 RightDown(self) -> bool
4361 Returns true if the right mouse button state changed to down.
4363 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4365 def LeftUp(*args
, **kwargs
):
4367 LeftUp(self) -> bool
4369 Returns true if the left mouse button state changed to up.
4371 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4373 def MiddleUp(*args
, **kwargs
):
4375 MiddleUp(self) -> bool
4377 Returns true if the middle mouse button state changed to up.
4379 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4381 def RightUp(*args
, **kwargs
):
4383 RightUp(self) -> bool
4385 Returns true if the right mouse button state changed to up.
4387 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4389 def LeftDClick(*args
, **kwargs
):
4391 LeftDClick(self) -> bool
4393 Returns true if the event was a left button double click.
4395 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4397 def MiddleDClick(*args
, **kwargs
):
4399 MiddleDClick(self) -> bool
4401 Returns true if the event was a middle button double click.
4403 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4405 def RightDClick(*args
, **kwargs
):
4407 RightDClick(self) -> bool
4409 Returns true if the event was a right button double click.
4411 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4413 def LeftIsDown(*args
, **kwargs
):
4415 LeftIsDown(self) -> bool
4417 Returns true if the left mouse button is currently down, independent
4418 of the current event type.
4420 Please notice that it is not the same as LeftDown which returns true
4421 if the left mouse button was just pressed. Rather, it describes the
4422 state of the mouse button before the event happened.
4424 This event is usually used in the mouse event handlers which process
4425 "move mouse" messages to determine whether the user is (still)
4428 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4430 def MiddleIsDown(*args
, **kwargs
):
4432 MiddleIsDown(self) -> bool
4434 Returns true if the middle mouse button is currently down, independent
4435 of the current event type.
4437 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4439 def RightIsDown(*args
, **kwargs
):
4441 RightIsDown(self) -> bool
4443 Returns true if the right mouse button is currently down, independent
4444 of the current event type.
4446 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4448 def Dragging(*args
, **kwargs
):
4450 Dragging(self) -> bool
4452 Returns true if this was a dragging event (motion while a button is
4455 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4457 def Moving(*args
, **kwargs
):
4459 Moving(self) -> bool
4461 Returns true if this was a motion event and no mouse buttons were
4462 pressed. If any mouse button is held pressed, then this method returns
4463 false and Dragging returns true.
4465 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4467 def Entering(*args
, **kwargs
):
4469 Entering(self) -> bool
4471 Returns true if the mouse was entering the window.
4473 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4475 def Leaving(*args
, **kwargs
):
4477 Leaving(self) -> bool
4479 Returns true if the mouse was leaving the window.
4481 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4483 def GetPosition(*args
, **kwargs
):
4485 GetPosition(self) -> Point
4487 Returns the pixel position of the mouse in window coordinates when the
4490 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4492 def GetPositionTuple(*args
, **kwargs
):
4494 GetPositionTuple() -> (x,y)
4496 Returns the pixel position of the mouse in window coordinates when the
4499 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
4501 def GetLogicalPosition(*args
, **kwargs
):
4503 GetLogicalPosition(self, DC dc) -> Point
4505 Returns the logical mouse position in pixels (i.e. translated
4506 according to the translation set for the DC, which usually indicates
4507 that the window has been scrolled).
4509 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
4511 def GetX(*args
, **kwargs
):
4515 Returns X coordinate of the physical mouse event position.
4517 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
4519 def GetY(*args
, **kwargs
):
4523 Returns Y coordinate of the physical mouse event position.
4525 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
4527 def GetWheelRotation(*args
, **kwargs
):
4529 GetWheelRotation(self) -> int
4531 Get wheel rotation, positive or negative indicates direction of
4532 rotation. Current devices all send an event when rotation is equal to
4533 +/-WheelDelta, but this allows for finer resolution devices to be
4534 created in the future. Because of this you shouldn't assume that one
4535 event is equal to 1 line or whatever, but you should be able to either
4536 do partial line scrolling or wait until +/-WheelDelta rotation values
4537 have been accumulated before scrolling.
4539 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
4541 def GetWheelDelta(*args
, **kwargs
):
4543 GetWheelDelta(self) -> int
4545 Get wheel delta, normally 120. This is the threshold for action to be
4546 taken, and one such action (for example, scrolling one increment)
4547 should occur for each delta.
4549 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
4551 def GetLinesPerAction(*args
, **kwargs
):
4553 GetLinesPerAction(self) -> int
4555 Returns the configured number of lines (or whatever) to be scrolled
4556 per wheel action. Defaults to three.
4558 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
4560 def IsPageScroll(*args
, **kwargs
):
4562 IsPageScroll(self) -> bool
4564 Returns true if the system has been setup to do page scrolling with
4565 the mouse wheel instead of line scrolling.
4567 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
4569 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
4570 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
4571 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
4572 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
4573 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
4574 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
4575 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
4576 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
4577 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
4578 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
4579 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
4580 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
4581 _core_
.MouseEvent_swigregister(MouseEvent
)
4583 #---------------------------------------------------------------------------
4585 class SetCursorEvent(Event
):
4587 A SetCursorEvent is generated when the mouse cursor is about to be set
4588 as a result of mouse motion. This event gives the application the
4589 chance to perform specific mouse cursor processing based on the
4590 current position of the mouse within the window. Use the `SetCursor`
4591 method to specify the cursor you want to be displayed.
4593 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4594 __repr__
= _swig_repr
4595 def __init__(self
, *args
, **kwargs
):
4597 __init__(self, int x=0, int y=0) -> SetCursorEvent
4599 Construct a new `wx.SetCursorEvent`.
4601 _core_
.SetCursorEvent_swiginit(self
,_core_
.new_SetCursorEvent(*args
, **kwargs
))
4602 def GetX(*args
, **kwargs
):
4606 Returns the X coordinate of the mouse in client coordinates.
4608 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
4610 def GetY(*args
, **kwargs
):
4614 Returns the Y coordinate of the mouse in client coordinates.
4616 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
4618 def SetCursor(*args
, **kwargs
):
4620 SetCursor(self, Cursor cursor)
4622 Sets the cursor associated with this event.
4624 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
4626 def GetCursor(*args
, **kwargs
):
4628 GetCursor(self) -> Cursor
4630 Returns a reference to the cursor specified by this event.
4632 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
4634 def HasCursor(*args
, **kwargs
):
4636 HasCursor(self) -> bool
4638 Returns true if the cursor specified by this event is a valid cursor.
4640 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
4642 _core_
.SetCursorEvent_swigregister(SetCursorEvent
)
4644 #---------------------------------------------------------------------------
4646 class KeyEvent(Event
):
4648 This event class contains information about keypress and character
4649 events. These events are only sent to the widget that currently has
4652 Notice that there are three different kinds of keyboard events in
4653 wxWidgets: key down and up events and char events. The difference
4654 between the first two is clear - the first corresponds to a key press
4655 and the second to a key release - otherwise they are identical. Just
4656 note that if the key is maintained in a pressed state you will
4657 typically get a lot of (automatically generated) down events but only
4658 one up so it is wrong to assume that there is one up event
4659 corresponding to each down one.
4661 Both key events provide untranslated key codes while the char event
4662 carries the translated one. The untranslated code for alphanumeric
4663 keys is always an upper case value. For the other keys it is one of
4664 WXK_XXX values from the keycodes table. The translated key is, in
4665 general, the character the user expects to appear as the result of the
4666 key combination when typing the text into a text entry zone, for
4669 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4670 and the standard US keyboard): when the 'A' key is pressed, the key
4671 down event key code is equal to ASCII A == 65. But the char event key
4672 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4673 'A' keys simultaneously , the key code in key down event will still be
4674 just 'A' while the char event key code parameter will now be 'A' as
4677 Although in this simple case it is clear that the correct key code
4678 could be found in the key down event handler by checking the value
4679 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4680 as for non alphanumeric keys or non-US keyboard layouts the
4681 translation is keyboard-layout dependent and can only be done properly
4682 by the system itself.
4684 Another kind of translation is done when the control key is pressed:
4685 for example, for CTRL-A key press the key down event still carries the
4686 same key code 'A' as usual but the char event will have key code of 1,
4687 the ASCII value of this key combination.
4689 You may discover how the other keys on your system behave
4690 interactively by running the KeyEvents sample in the wxPython demo and
4691 pressing some keys while the blue box at the top has the keyboard
4694 **Note**: If a key down event is caught and the event handler does not
4695 call event.Skip() then the coresponding char event will not
4696 happen. This is by design and enables the programs that handle both
4697 types of events to be a bit simpler.
4699 **Note for Windows programmers**: The key and char events in wxWidgets
4700 are similar to but slightly different from Windows WM_KEYDOWN and
4701 WM_CHAR events. In particular, Alt-x combination will generate a char
4702 event in wxWidgets (unless it is used as an accelerator).
4704 **Tip**: be sure to call event.Skip() for events that you don't
4705 process in key event function, otherwise menu shortcuts may cease to
4709 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4710 __repr__
= _swig_repr
4711 def __init__(self
, *args
, **kwargs
):
4713 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
4715 Construct a new `wx.KeyEvent`. Valid event types are:
4718 _core_
.KeyEvent_swiginit(self
,_core_
.new_KeyEvent(*args
, **kwargs
))
4719 def GetModifiers(*args
, **kwargs
):
4721 GetModifiers(self) -> int
4723 Returns a bitmask of the current modifier settings. Can be used to
4724 check if the key event has exactly the given modifiers without having
4725 to explicitly check that the other modifiers are not down. For
4728 if event.GetModifers() == wx.MOD_CONTROL:
4732 return _core_
.KeyEvent_GetModifiers(*args
, **kwargs
)
4734 def ControlDown(*args
, **kwargs
):
4736 ControlDown(self) -> bool
4738 Returns ``True`` if the Control key was down at the time of the event.
4740 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
4742 def MetaDown(*args
, **kwargs
):
4744 MetaDown(self) -> bool
4746 Returns ``True`` if the Meta key was down at the time of the event.
4748 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
4750 def AltDown(*args
, **kwargs
):
4752 AltDown(self) -> bool
4754 Returns ``True`` if the Alt key was down at the time of the event.
4756 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
4758 def ShiftDown(*args
, **kwargs
):
4760 ShiftDown(self) -> bool
4762 Returns ``True`` if the Shift key was down at the time of the event.
4764 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
4766 def CmdDown(*args
, **kwargs
):
4768 CmdDown(self) -> bool
4770 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4771 platforms but the special "Apple" (a.k.a as "Command") key on
4772 Macs. It makes often sense to use it instead of, say, `ControlDown`
4773 because Cmd key is used for the same thing under Mac as Ctrl
4774 elsewhere. The Ctrl still exists, it's just not used for this
4775 purpose. So for non-Mac platforms this is the same as `ControlDown`
4776 and Macs this is the same as `MetaDown`.
4778 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
4780 def HasModifiers(*args
, **kwargs
):
4782 HasModifiers(self) -> bool
4784 Returns true if either CTRL or ALT keys was down at the time of the
4785 key event. Note that this function does not take into account neither
4786 SHIFT nor META key states (the reason for ignoring the latter is that
4787 it is common for NUMLOCK key to be configured as META under X but the
4788 key presses even while NUMLOCK is on should be still processed
4791 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
4793 def GetKeyCode(*args
, **kwargs
):
4795 GetKeyCode(self) -> int
4797 Returns the virtual key code. ASCII events return normal ASCII values,
4798 while non-ASCII events return values such as WXK_LEFT for the left
4799 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4802 Note that in Unicode build, the returned value is meaningful only if
4803 the user entered a character that can be represented in current
4804 locale's default charset. You can obtain the corresponding Unicode
4805 character using `GetUnicodeKey`.
4807 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
4809 KeyCode
= GetKeyCode
4810 def GetUnicodeKey(*args
, **kwargs
):
4812 GetUnicodeKey(self) -> int
4814 Returns the Unicode character corresponding to this key event. This
4815 function is only meaningfule in a Unicode build of wxPython.
4817 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
4819 GetUniChar
= GetUnicodeKey
4820 def GetRawKeyCode(*args
, **kwargs
):
4822 GetRawKeyCode(self) -> unsigned int
4824 Returns the raw key code for this event. This is a platform-dependent
4825 scan code which should only be used in advanced
4826 applications. Currently the raw key codes are not supported by all
4829 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
4831 def GetRawKeyFlags(*args
, **kwargs
):
4833 GetRawKeyFlags(self) -> unsigned int
4835 Returns the low level key flags for this event. The flags are
4836 platform-dependent and should only be used in advanced applications.
4837 Currently the raw key flags are not supported by all ports.
4839 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
4841 def GetPosition(*args
, **kwargs
):
4843 GetPosition(self) -> Point
4845 Find the position of the event, if applicable.
4847 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
4849 def GetPositionTuple(*args
, **kwargs
):
4851 GetPositionTuple() -> (x,y)
4853 Find the position of the event, if applicable.
4855 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
4857 def GetX(*args
, **kwargs
):
4861 Returns the X position (in client coordinates) of the event, if
4864 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
4866 def GetY(*args
, **kwargs
):
4870 Returns the Y position (in client coordinates) of the event, if
4873 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
4875 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
4876 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
4877 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
4878 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
4879 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
4880 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
4881 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
4882 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
4883 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
4884 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
4885 _core_
.KeyEvent_swigregister(KeyEvent
)
4887 #---------------------------------------------------------------------------
4889 class SizeEvent(Event
):
4891 A size event holds information about size change events. The EVT_SIZE
4892 handler function will be called when the window it is bound to has
4895 Note that the size passed is of the whole window: call
4896 `wx.Window.GetClientSize` for the area which may be used by the
4899 When a window is resized, usually only a small part of the window is
4900 damaged and and that area is all that is in the update region for the
4901 next paint event. However, if your drawing depends on the size of the
4902 window, you may need to clear the DC explicitly and repaint the whole
4903 window. In which case, you may need to call `wx.Window.Refresh` to
4904 invalidate the entire window.
4907 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4908 __repr__
= _swig_repr
4909 def __init__(self
, *args
, **kwargs
):
4911 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4913 Construct a new ``wx.SizeEvent``.
4915 _core_
.SizeEvent_swiginit(self
,_core_
.new_SizeEvent(*args
, **kwargs
))
4916 def GetSize(*args
, **kwargs
):
4918 GetSize(self) -> Size
4920 Returns the entire size of the window generating the size change
4923 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
4925 def GetRect(*args
, **kwargs
):
4926 """GetRect(self) -> Rect"""
4927 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
4929 def SetRect(*args
, **kwargs
):
4930 """SetRect(self, Rect rect)"""
4931 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
4933 def SetSize(*args
, **kwargs
):
4934 """SetSize(self, Size size)"""
4935 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
4937 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
4938 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
4939 _core_
.SizeEvent_swigregister(SizeEvent
)
4941 #---------------------------------------------------------------------------
4943 class MoveEvent(Event
):
4945 This event object is sent for EVT_MOVE event bindings when a window is
4946 moved to a new position.
4948 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
4949 __repr__
= _swig_repr
4950 def __init__(self
, *args
, **kwargs
):
4952 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4956 _core_
.MoveEvent_swiginit(self
,_core_
.new_MoveEvent(*args
, **kwargs
))
4957 def GetPosition(*args
, **kwargs
):
4959 GetPosition(self) -> Point
4961 Returns the position of the window generating the move change event.
4963 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
4965 def GetRect(*args
, **kwargs
):
4966 """GetRect(self) -> Rect"""
4967 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
4969 def SetRect(*args
, **kwargs
):
4970 """SetRect(self, Rect rect)"""
4971 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
4973 def SetPosition(*args
, **kwargs
):
4974 """SetPosition(self, Point pos)"""
4975 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
4977 m_pos
= property(GetPosition
, SetPosition
)
4978 m_rect
= property(GetRect
, SetRect
)
4980 _core_
.MoveEvent_swigregister(MoveEvent
)
4982 #---------------------------------------------------------------------------
4984 class PaintEvent(Event
):
4986 A paint event is sent when a window's contents needs to be repainted.
4987 Note that in an EVT_PAINT handler the application must *always* create
4988 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
4989 Windows assumes that the window has not been painted yet and will send
4990 the event again, causing endless refreshes.
4992 You can optimize painting by retrieving the rectangles that have been
4993 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
4994 and only repainting these rectangles. The rectangles are in terms of
4995 the client area, and are unscrolled, so you will need to do some
4996 calculations using the current view position to obtain logical,
5000 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5001 __repr__
= _swig_repr
5002 def __init__(self
, *args
, **kwargs
):
5003 """__init__(self, int Id=0) -> PaintEvent"""
5004 _core_
.PaintEvent_swiginit(self
,_core_
.new_PaintEvent(*args
, **kwargs
))
5005 _core_
.PaintEvent_swigregister(PaintEvent
)
5007 class NcPaintEvent(Event
):
5008 """Proxy of C++ NcPaintEvent class"""
5009 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5010 __repr__
= _swig_repr
5011 def __init__(self
, *args
, **kwargs
):
5012 """__init__(self, int winid=0) -> NcPaintEvent"""
5013 _core_
.NcPaintEvent_swiginit(self
,_core_
.new_NcPaintEvent(*args
, **kwargs
))
5014 _core_
.NcPaintEvent_swigregister(NcPaintEvent
)
5016 #---------------------------------------------------------------------------
5018 class EraseEvent(Event
):
5020 An erase event is sent whenever the background of a window needs to be
5021 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5022 binder. On some platforms, such as GTK+, this event is simulated
5023 (simply generated just before the paint event) and may cause flicker.
5025 To paint a custom background use the `GetDC` method and use the returned
5026 device context if it is not ``None``, otherwise create a temporary
5027 `wx.ClientDC` and draw on that.
5030 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5031 __repr__
= _swig_repr
5032 def __init__(self
, *args
, **kwargs
):
5034 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5038 _core_
.EraseEvent_swiginit(self
,_core_
.new_EraseEvent(*args
, **kwargs
))
5039 def GetDC(*args
, **kwargs
):
5043 Returns the device context the event handler should draw upon. If
5044 ``None`` is returned then create a temporary `wx.ClientDC` and use
5047 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5049 _core_
.EraseEvent_swigregister(EraseEvent
)
5051 #---------------------------------------------------------------------------
5053 class FocusEvent(Event
):
5055 A focus event is sent when a window's focus changes. The window losing
5056 focus receives an EVT_KILL_FOCUS event while the window gaining it
5057 gets an EVT_SET_FOCUS event.
5059 Notice that the set focus event happens both when the user gives focus
5060 to the window (whether using the mouse or keyboard) and when it is
5061 done from the program itself using `wx.Window.SetFocus`.
5064 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5065 __repr__
= _swig_repr
5066 def __init__(self
, *args
, **kwargs
):
5068 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5072 _core_
.FocusEvent_swiginit(self
,_core_
.new_FocusEvent(*args
, **kwargs
))
5073 def GetWindow(*args
, **kwargs
):
5075 GetWindow(self) -> Window
5077 Returns the other window associated with this event, that is the
5078 window which had the focus before for the EVT_SET_FOCUS event and the
5079 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5081 Warning: the window returned may be None!
5083 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5085 def SetWindow(*args
, **kwargs
):
5086 """SetWindow(self, Window win)"""
5087 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5089 _core_
.FocusEvent_swigregister(FocusEvent
)
5091 #---------------------------------------------------------------------------
5093 class ChildFocusEvent(CommandEvent
):
5095 wx.ChildFocusEvent notifies the parent that a child has received the
5096 focus. Unlike `wx.FocusEvent` it is propagated up the window
5099 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5100 __repr__
= _swig_repr
5101 def __init__(self
, *args
, **kwargs
):
5103 __init__(self, Window win=None) -> ChildFocusEvent
5107 _core_
.ChildFocusEvent_swiginit(self
,_core_
.new_ChildFocusEvent(*args
, **kwargs
))
5108 def GetWindow(*args
, **kwargs
):
5110 GetWindow(self) -> Window
5112 The window which has just received the focus.
5114 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5116 _core_
.ChildFocusEvent_swigregister(ChildFocusEvent
)
5118 #---------------------------------------------------------------------------
5120 class ActivateEvent(Event
):
5122 An activate event is sent when a top-level window or the entire
5123 application is being activated or deactivated.
5125 A top-level window (a dialog or frame) receives an activate event when
5126 is being activated or deactivated. This is indicated visually by the
5127 title bar changing colour, and a subwindow gaining the keyboard focus.
5128 An application is activated or deactivated when one of its frames
5129 becomes activated, or a frame becomes inactivate resulting in all
5130 application frames being inactive.
5132 Please note that usually you should call event.Skip() in your handlers
5133 for these events so the default handlers will still be called, as not
5134 doing so can result in strange effects.
5137 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5138 __repr__
= _swig_repr
5139 def __init__(self
, *args
, **kwargs
):
5141 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5145 _core_
.ActivateEvent_swiginit(self
,_core_
.new_ActivateEvent(*args
, **kwargs
))
5146 def GetActive(*args
, **kwargs
):
5148 GetActive(self) -> bool
5150 Returns true if the application or window is being activated, false
5153 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5155 _core_
.ActivateEvent_swigregister(ActivateEvent
)
5157 #---------------------------------------------------------------------------
5159 class InitDialogEvent(Event
):
5161 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5162 any window when `wx.Window.InitDialog` is called. Handlers for this
5163 event can transfer data to the window, or anything else that should be
5164 done before the user begins editing the form. The default handler
5165 calls `wx.Window.TransferDataToWindow`.
5167 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5168 __repr__
= _swig_repr
5169 def __init__(self
, *args
, **kwargs
):
5171 __init__(self, int Id=0) -> InitDialogEvent
5175 _core_
.InitDialogEvent_swiginit(self
,_core_
.new_InitDialogEvent(*args
, **kwargs
))
5176 _core_
.InitDialogEvent_swigregister(InitDialogEvent
)
5178 #---------------------------------------------------------------------------
5180 class MenuEvent(Event
):
5182 This class is used for a variety of menu-related events. Note that
5183 these do not include menu command events, which are handled by sending
5184 `wx.CommandEvent` objects.
5186 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5187 text in the first field of the status bar.
5189 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5190 __repr__
= _swig_repr
5191 def __init__(self
, *args
, **kwargs
):
5193 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5197 _core_
.MenuEvent_swiginit(self
,_core_
.new_MenuEvent(*args
, **kwargs
))
5198 def GetMenuId(*args
, **kwargs
):
5200 GetMenuId(self) -> int
5202 Returns the menu identifier associated with the event. This method
5203 should be only used with the HIGHLIGHT events.
5205 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5207 def IsPopup(*args
, **kwargs
):
5209 IsPopup(self) -> bool
5211 Returns ``True`` if the menu which is being opened or closed is a
5212 popup menu, ``False`` if it is a normal one. This method should only
5213 be used with the OPEN and CLOSE events.
5215 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5217 def GetMenu(*args
, **kwargs
):
5219 GetMenu(self) -> Menu
5221 Returns the menu which is being opened or closed. This method should
5222 only be used with the OPEN and CLOSE events.
5224 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5226 _core_
.MenuEvent_swigregister(MenuEvent
)
5228 #---------------------------------------------------------------------------
5230 class CloseEvent(Event
):
5232 This event class contains information about window and session close
5235 The handler function for EVT_CLOSE is called when the user has tried
5236 to close a a frame or dialog box using the window manager controls or
5237 the system menu. It can also be invoked by the application itself
5238 programmatically, for example by calling the `wx.Window.Close`
5241 You should check whether the application is forcing the deletion of
5242 the window using `CanVeto`. If it returns ``False``, you must destroy
5243 the window using `wx.Window.Destroy`. If the return value is ``True``,
5244 it is up to you whether you respond by destroying the window or not.
5245 For example you may wish to display a message dialog prompting to save
5246 files or to cancel the close.
5248 If you don't destroy the window, you should call `Veto` to let the
5249 calling code know that you did not destroy the window. This allows the
5250 `wx.Window.Close` function to return ``True`` or ``False`` depending
5251 on whether the close instruction was honored or not.
5253 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5254 __repr__
= _swig_repr
5255 def __init__(self
, *args
, **kwargs
):
5257 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5261 _core_
.CloseEvent_swiginit(self
,_core_
.new_CloseEvent(*args
, **kwargs
))
5262 def SetLoggingOff(*args
, **kwargs
):
5264 SetLoggingOff(self, bool logOff)
5266 Sets the 'logging off' flag.
5268 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5270 def GetLoggingOff(*args
, **kwargs
):
5272 GetLoggingOff(self) -> bool
5274 Returns ``True`` if the user is logging off or ``False`` if the
5275 system is shutting down. This method can only be called for end
5276 session and query end session events, it doesn't make sense for close
5279 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5281 def Veto(*args
, **kwargs
):
5283 Veto(self, bool veto=True)
5285 Call this from your event handler to veto a system shutdown or to
5286 signal to the calling application that a window close did not happen.
5288 You can only veto a shutdown or close if `CanVeto` returns true.
5290 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5292 def GetVeto(*args
, **kwargs
):
5293 """GetVeto(self) -> bool"""
5294 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5296 def SetCanVeto(*args
, **kwargs
):
5298 SetCanVeto(self, bool canVeto)
5300 Sets the 'can veto' flag.
5302 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5304 def CanVeto(*args
, **kwargs
):
5306 CanVeto(self) -> bool
5308 Returns true if you can veto a system shutdown or a window close
5309 event. Vetoing a window close event is not possible if the calling
5310 code wishes to force the application to exit, and so this function
5311 must be called to check this.
5313 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5315 _core_
.CloseEvent_swigregister(CloseEvent
)
5317 #---------------------------------------------------------------------------
5319 class ShowEvent(Event
):
5320 """An EVT_SHOW event is sent when a window is shown or hidden."""
5321 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5322 __repr__
= _swig_repr
5323 def __init__(self
, *args
, **kwargs
):
5325 __init__(self, int winid=0, bool show=False) -> ShowEvent
5327 An EVT_SHOW event is sent when a window is shown or hidden.
5329 _core_
.ShowEvent_swiginit(self
,_core_
.new_ShowEvent(*args
, **kwargs
))
5330 def SetShow(*args
, **kwargs
):
5331 """SetShow(self, bool show)"""
5332 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5334 def GetShow(*args
, **kwargs
):
5335 """GetShow(self) -> bool"""
5336 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5338 _core_
.ShowEvent_swigregister(ShowEvent
)
5340 #---------------------------------------------------------------------------
5342 class IconizeEvent(Event
):
5344 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5347 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5348 __repr__
= _swig_repr
5349 def __init__(self
, *args
, **kwargs
):
5351 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5353 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5356 _core_
.IconizeEvent_swiginit(self
,_core_
.new_IconizeEvent(*args
, **kwargs
))
5357 def Iconized(*args
, **kwargs
):
5359 Iconized(self) -> bool
5361 Returns ``True`` if the frame has been iconized, ``False`` if it has
5364 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5366 _core_
.IconizeEvent_swigregister(IconizeEvent
)
5368 #---------------------------------------------------------------------------
5370 class MaximizeEvent(Event
):
5371 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5372 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5373 __repr__
= _swig_repr
5374 def __init__(self
, *args
, **kwargs
):
5376 __init__(self, int id=0) -> MaximizeEvent
5378 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5380 _core_
.MaximizeEvent_swiginit(self
,_core_
.new_MaximizeEvent(*args
, **kwargs
))
5381 _core_
.MaximizeEvent_swigregister(MaximizeEvent
)
5383 #---------------------------------------------------------------------------
5385 class DropFilesEvent(Event
):
5387 This class is used for drop files events, that is, when files have
5388 been dropped onto the window. This functionality is only available
5389 under Windows. The window must have previously been enabled for
5390 dropping by calling `wx.Window.DragAcceptFiles`.
5392 Important note: this is a separate implementation to the more general
5393 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5394 implementation uses the older, Windows message-based approach of
5397 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5401 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5402 def __init__(self
): raise AttributeError, "No constructor defined"
5403 __repr__
= _swig_repr
5404 def GetPosition(*args
, **kwargs
):
5406 GetPosition(self) -> Point
5408 Returns the position at which the files were dropped.
5410 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5412 def GetNumberOfFiles(*args
, **kwargs
):
5414 GetNumberOfFiles(self) -> int
5416 Returns the number of files dropped.
5418 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5420 def GetFiles(*args
, **kwargs
):
5422 GetFiles(self) -> PyObject
5424 Returns a list of the filenames that were dropped.
5426 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5428 _core_
.DropFilesEvent_swigregister(DropFilesEvent
)
5430 #---------------------------------------------------------------------------
5432 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5433 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5434 class UpdateUIEvent(CommandEvent
):
5436 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5437 wxWidgets to give an application the chance to update various user
5440 Without update UI events, an application has to work hard to
5441 check/uncheck, enable/disable, and set the text for elements such as
5442 menu items and toolbar buttons. The code for doing this has to be
5443 mixed up with the code that is invoked when an action is invoked for a
5444 menu item or button.
5446 With update UI events, you define an event handler to look at the
5447 state of the application and change UI elements accordingly. wxWidgets
5448 will call your handler functions in idle time, so you don't have to
5449 worry where to call this code. In addition to being a clearer and more
5450 declarative method, it also means you don't have to worry whether
5451 you're updating a toolbar or menubar identifier. The same handler can
5452 update a menu item and toolbar button, if the ID values are the same.
5454 Instead of directly manipulating the menu or button, you call
5455 functions in the event object, such as `Check`. wxWidgets will
5456 determine whether such a call has been made, and which UI element to
5459 These events will work for popup menus as well as menubars. Just
5460 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5461 any UI events for the window that owns the menu.
5463 If you find that the overhead of UI update processing is affecting
5464 your application, you can do one or both of the following:
5466 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5467 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5468 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5469 receive update events. No other windows will receive update
5472 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5473 value to set the delay between updates. You may need to call
5474 `wx.Window.UpdateWindowUI` at critical points, for example when
5475 a dialog is about to be shown, in case the user sees a slight
5476 delay before windows are updated.
5478 Note that although events are sent in idle time, defining a EVT_IDLE
5479 handler for a window does not affect this because the events are sent
5480 from an internal idle handler.
5482 wxWidgets tries to optimize update events on some platforms. On
5483 Windows and GTK+, events for menubar items are only sent when the menu
5484 is about to be shown, and not in idle time.
5487 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5488 __repr__
= _swig_repr
5489 def __init__(self
, *args
, **kwargs
):
5491 __init__(self, int commandId=0) -> UpdateUIEvent
5495 _core_
.UpdateUIEvent_swiginit(self
,_core_
.new_UpdateUIEvent(*args
, **kwargs
))
5496 def GetChecked(*args
, **kwargs
):
5498 GetChecked(self) -> bool
5500 Returns ``True`` if the UI element should be checked.
5502 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
5504 def GetEnabled(*args
, **kwargs
):
5506 GetEnabled(self) -> bool
5508 Returns ``True`` if the UI element should be enabled.
5510 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
5512 def GetShown(*args
, **kwargs
):
5514 GetShown(self) -> bool
5516 Returns ``True`` if the UI element should be shown.
5518 return _core_
.UpdateUIEvent_GetShown(*args
, **kwargs
)
5520 def GetText(*args
, **kwargs
):
5522 GetText(self) -> String
5524 Returns the text that should be set for the UI element.
5526 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
5528 def GetSetText(*args
, **kwargs
):
5530 GetSetText(self) -> bool
5532 Returns ``True`` if the application has called `SetText`. For
5533 wxWidgets internal use only.
5535 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
5537 def GetSetChecked(*args
, **kwargs
):
5539 GetSetChecked(self) -> bool
5541 Returns ``True`` if the application has called `Check`. For wxWidgets
5544 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
5546 def GetSetEnabled(*args
, **kwargs
):
5548 GetSetEnabled(self) -> bool
5550 Returns ``True`` if the application has called `Enable`. For wxWidgets
5553 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
5555 def GetSetShown(*args
, **kwargs
):
5557 GetSetShown(self) -> bool
5559 Returns ``True`` if the application has called `Show`. For wxWidgets
5562 return _core_
.UpdateUIEvent_GetSetShown(*args
, **kwargs
)
5564 def Check(*args
, **kwargs
):
5566 Check(self, bool check)
5568 Check or uncheck the UI element.
5570 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
5572 def Enable(*args
, **kwargs
):
5574 Enable(self, bool enable)
5576 Enable or disable the UI element.
5578 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
5580 def Show(*args
, **kwargs
):
5582 Show(self, bool show)
5584 Show or hide the UI element.
5586 return _core_
.UpdateUIEvent_Show(*args
, **kwargs
)
5588 def SetText(*args
, **kwargs
):
5590 SetText(self, String text)
5592 Sets the text for this UI element.
5594 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
5596 def SetUpdateInterval(*args
, **kwargs
):
5598 SetUpdateInterval(long updateInterval)
5600 Sets the interval between updates in milliseconds. Set to -1 to
5601 disable updates, or to 0 to update as frequently as possible. The
5604 Use this to reduce the overhead of UI update events if your
5605 application has a lot of windows. If you set the value to -1 or
5606 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5607 at appropriate points in your application, such as when a dialog is
5610 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5612 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
5613 def GetUpdateInterval(*args
, **kwargs
):
5615 GetUpdateInterval() -> long
5617 Returns the current interval between updates in milliseconds. -1
5618 disables updates, 0 updates as frequently as possible.
5620 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5622 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
5623 def CanUpdate(*args
, **kwargs
):
5625 CanUpdate(Window win) -> bool
5627 Returns ``True`` if it is appropriate to update (send UI update events
5630 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5631 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5632 events were last sent in idle time, and the update interval, to
5633 determine whether events should be sent to this window now. By default
5634 this will always return true because the update mode is initially
5635 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5636 events will be sent as often as possible. You can reduce the frequency
5637 that events are sent by changing the mode and/or setting an update
5641 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5643 CanUpdate
= staticmethod(CanUpdate
)
5644 def ResetUpdateTime(*args
, **kwargs
):
5648 Used internally to reset the last-updated time to the current time. It
5649 is assumed that update events are normally sent in idle time, so this
5650 is called at the end of idle processing.
5652 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5654 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
5655 def SetMode(*args
, **kwargs
):
5659 Specify how wxWidgets will send update events: to all windows, or only
5660 to those which specify that they will process the events.
5662 The mode may be one of the following values:
5664 ============================= ==========================================
5665 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5666 is the default setting.
5667 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5668 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5670 ============================= ==========================================
5673 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5675 SetMode
= staticmethod(SetMode
)
5676 def GetMode(*args
, **kwargs
):
5680 Returns a value specifying how wxWidgets will send update events: to
5681 all windows, or only to those which specify that they will process the
5684 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5686 GetMode
= staticmethod(GetMode
)
5687 _core_
.UpdateUIEvent_swigregister(UpdateUIEvent
)
5689 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
5691 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5693 Sets the interval between updates in milliseconds. Set to -1 to
5694 disable updates, or to 0 to update as frequently as possible. The
5697 Use this to reduce the overhead of UI update events if your
5698 application has a lot of windows. If you set the value to -1 or
5699 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5700 at appropriate points in your application, such as when a dialog is
5703 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5705 def UpdateUIEvent_GetUpdateInterval(*args
):
5707 UpdateUIEvent_GetUpdateInterval() -> long
5709 Returns the current interval between updates in milliseconds. -1
5710 disables updates, 0 updates as frequently as possible.
5712 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
)
5714 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
5716 UpdateUIEvent_CanUpdate(Window win) -> bool
5718 Returns ``True`` if it is appropriate to update (send UI update events
5721 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5722 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5723 events were last sent in idle time, and the update interval, to
5724 determine whether events should be sent to this window now. By default
5725 this will always return true because the update mode is initially
5726 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5727 events will be sent as often as possible. You can reduce the frequency
5728 that events are sent by changing the mode and/or setting an update
5732 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5734 def UpdateUIEvent_ResetUpdateTime(*args
):
5736 UpdateUIEvent_ResetUpdateTime()
5738 Used internally to reset the last-updated time to the current time. It
5739 is assumed that update events are normally sent in idle time, so this
5740 is called at the end of idle processing.
5742 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
)
5744 def UpdateUIEvent_SetMode(*args
, **kwargs
):
5746 UpdateUIEvent_SetMode(int mode)
5748 Specify how wxWidgets will send update events: to all windows, or only
5749 to those which specify that they will process the events.
5751 The mode may be one of the following values:
5753 ============================= ==========================================
5754 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5755 is the default setting.
5756 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5757 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5759 ============================= ==========================================
5762 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5764 def UpdateUIEvent_GetMode(*args
):
5766 UpdateUIEvent_GetMode() -> int
5768 Returns a value specifying how wxWidgets will send update events: to
5769 all windows, or only to those which specify that they will process the
5772 return _core_
.UpdateUIEvent_GetMode(*args
)
5774 #---------------------------------------------------------------------------
5776 class SysColourChangedEvent(Event
):
5778 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5779 when the user changes the colour settings using the control
5780 panel. This is only applicable under Windows.
5782 The default event handler for this event propagates the event to child
5783 windows, since Windows only sends the events to top-level windows. If
5784 intercepting this event for a top-level window, remember to call
5785 `Skip` so the the base class handler will still be executed, or to
5786 pass the event on to the window's children explicitly.
5789 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5790 __repr__
= _swig_repr
5791 def __init__(self
, *args
, **kwargs
):
5793 __init__(self) -> SysColourChangedEvent
5797 _core_
.SysColourChangedEvent_swiginit(self
,_core_
.new_SysColourChangedEvent(*args
, **kwargs
))
5798 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEvent
)
5800 #---------------------------------------------------------------------------
5802 class MouseCaptureChangedEvent(Event
):
5804 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5805 a window that loses its mouse capture. This is called even if
5806 `wx.Window.ReleaseMouse` was called by the application code. Handling
5807 this event allows an application to cater for unexpected capture
5808 releases which might otherwise confuse mouse handling code.
5810 This event is implemented under Windows only.
5812 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5813 __repr__
= _swig_repr
5814 def __init__(self
, *args
, **kwargs
):
5816 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5820 _core_
.MouseCaptureChangedEvent_swiginit(self
,_core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
))
5821 def GetCapturedWindow(*args
, **kwargs
):
5823 GetCapturedWindow(self) -> Window
5825 Returns the window that gained the capture, or ``None`` if it was a
5826 non-wxWidgets window.
5828 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
5830 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent
)
5832 #---------------------------------------------------------------------------
5834 class DisplayChangedEvent(Event
):
5836 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5837 resolution has changed.
5839 This event is implemented under Windows only.
5841 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5842 __repr__
= _swig_repr
5843 def __init__(self
, *args
, **kwargs
):
5844 """__init__(self) -> DisplayChangedEvent"""
5845 _core_
.DisplayChangedEvent_swiginit(self
,_core_
.new_DisplayChangedEvent(*args
, **kwargs
))
5846 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEvent
)
5848 #---------------------------------------------------------------------------
5850 class PaletteChangedEvent(Event
):
5852 An EVT_PALETTE_CHANGED event is sent when the system palette has
5853 changed, thereby giving each window a chance to redo their own to
5856 This event is implemented under Windows only.
5858 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5859 __repr__
= _swig_repr
5860 def __init__(self
, *args
, **kwargs
):
5862 __init__(self, int id=0) -> PaletteChangedEvent
5864 An EVT_PALETTE_CHANGED event is sent when the system palette has
5865 changed, thereby giving each window a chance to redo their own to
5868 This event is implemented under Windows only.
5870 _core_
.PaletteChangedEvent_swiginit(self
,_core_
.new_PaletteChangedEvent(*args
, **kwargs
))
5871 def SetChangedWindow(*args
, **kwargs
):
5872 """SetChangedWindow(self, Window win)"""
5873 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
5875 def GetChangedWindow(*args
, **kwargs
):
5876 """GetChangedWindow(self) -> Window"""
5877 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
5879 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEvent
)
5881 #---------------------------------------------------------------------------
5883 class QueryNewPaletteEvent(Event
):
5885 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5886 focus and should re-do its palette.
5888 This event is implemented under Windows only.
5890 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
5891 __repr__
= _swig_repr
5892 def __init__(self
, *args
, **kwargs
):
5894 __init__(self, int winid=0) -> QueryNewPaletteEvent
5898 _core_
.QueryNewPaletteEvent_swiginit(self
,_core_
.new_QueryNewPaletteEvent(*args
, **kwargs
))
5899 def SetPaletteRealized(*args
, **kwargs
):
5901 SetPaletteRealized(self, bool realized)
5903 App should set this if it changes the palette.
5905 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
5907 def GetPaletteRealized(*args
, **kwargs
):
5908 """GetPaletteRealized(self) -> bool"""
5909 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
5911 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent
)
5913 #---------------------------------------------------------------------------
5915 class NavigationKeyEvent(Event
):
5917 EVT_NAVIGATION_KEY events are used to control moving the focus between
5918 widgets, otherwise known as tab-traversal. You woudl normally not
5919 catch navigation events in applications as there are already
5920 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5921 it useful to send navigation events in certain situations to change
5922 the focus in certain ways, although it's probably easier to just call
5923 `wx.Window.Navigate`.
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
):
5928 """__init__(self) -> NavigationKeyEvent"""
5929 _core_
.NavigationKeyEvent_swiginit(self
,_core_
.new_NavigationKeyEvent(*args
, **kwargs
))
5930 def GetDirection(*args
, **kwargs
):
5932 GetDirection(self) -> bool
5934 Returns ``True`` if the direction is forward, ``False`` otherwise.
5936 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
5938 def SetDirection(*args
, **kwargs
):
5940 SetDirection(self, bool forward)
5942 Specify the direction that the navigation should take. Usually the
5943 difference between using Tab and Shift-Tab.
5945 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
5947 def IsWindowChange(*args
, **kwargs
):
5949 IsWindowChange(self) -> bool
5951 Returns ``True`` if window change is allowed.
5953 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
5955 def SetWindowChange(*args
, **kwargs
):
5957 SetWindowChange(self, bool ischange)
5959 Specify if the navigation should be able to change parent windows.
5960 For example, changing notebook pages, etc. This is usually implemented
5961 by using Control-Tab.
5963 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
5965 def IsFromTab(*args
, **kwargs
):
5967 IsFromTab(self) -> bool
5969 Returns ``True`` if the navigation event is originated from the Tab
5972 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
5974 def SetFromTab(*args
, **kwargs
):
5976 SetFromTab(self, bool bIs)
5978 Set to true under MSW if the event was generated using the tab key.
5979 This is required for proper navogation over radio buttons.
5981 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
5983 def SetFlags(*args
, **kwargs
):
5985 SetFlags(self, long flags)
5987 Set the navigation flags to a combination of the following:
5989 * wx.NavigationKeyEvent.IsBackward
5990 * wx.NavigationKeyEvent.IsForward
5991 * wx.NavigationKeyEvent.WinChange
5992 * wx.NavigationKeyEvent.FromTab
5995 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
5997 def GetCurrentFocus(*args
, **kwargs
):
5999 GetCurrentFocus(self) -> Window
6001 Returns the child window which currenty has the focus. May be
6004 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6006 def SetCurrentFocus(*args
, **kwargs
):
6008 SetCurrentFocus(self, Window win)
6010 Set the window that has the focus.
6012 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6014 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6015 IsForward
= _core_
.NavigationKeyEvent_IsForward
6016 WinChange
= _core_
.NavigationKeyEvent_WinChange
6017 FromTab
= _core_
.NavigationKeyEvent_FromTab
6018 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEvent
)
6020 #---------------------------------------------------------------------------
6022 class WindowCreateEvent(CommandEvent
):
6024 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6025 underlying GUI object) exists.
6027 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6028 __repr__
= _swig_repr
6029 def __init__(self
, *args
, **kwargs
):
6031 __init__(self, Window win=None) -> WindowCreateEvent
6033 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6034 underlying GUI object) exists.
6036 _core_
.WindowCreateEvent_swiginit(self
,_core_
.new_WindowCreateEvent(*args
, **kwargs
))
6037 def GetWindow(*args
, **kwargs
):
6039 GetWindow(self) -> Window
6041 Returns the window that this event refers to.
6043 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6045 _core_
.WindowCreateEvent_swigregister(WindowCreateEvent
)
6047 class WindowDestroyEvent(CommandEvent
):
6049 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6050 when the GUI window is destroyed.
6052 When a class derived from `wx.Window` is destroyed its destructor will
6053 have already run by the time this event is sent. Therefore this event
6054 will not usually be received at all by the window itself. Since it is
6055 received after the destructor has run, an object should not try to
6056 handle its own wx.WindowDestroyEvent, but it can be used to get
6057 notification of the destruction of another window.
6059 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6060 __repr__
= _swig_repr
6061 def __init__(self
, *args
, **kwargs
):
6063 __init__(self, Window win=None) -> WindowDestroyEvent
6065 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6066 when the GUI window is destroyed.
6068 When a class derived from `wx.Window` is destroyed its destructor will
6069 have already run by the time this event is sent. Therefore this event
6070 will not usually be received at all by the window itself. Since it is
6071 received after the destructor has run, an object should not try to
6072 handle its own wx.WindowDestroyEvent, but it can be used to get
6073 notification of the destruction of another window.
6075 _core_
.WindowDestroyEvent_swiginit(self
,_core_
.new_WindowDestroyEvent(*args
, **kwargs
))
6076 def GetWindow(*args
, **kwargs
):
6078 GetWindow(self) -> Window
6080 Returns the window that this event refers to.
6082 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6084 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEvent
)
6086 #---------------------------------------------------------------------------
6088 class ContextMenuEvent(CommandEvent
):
6090 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6091 give the application a chance to show a context (popup) menu.
6093 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6094 __repr__
= _swig_repr
6095 def __init__(self
, *args
, **kwargs
):
6097 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6101 _core_
.ContextMenuEvent_swiginit(self
,_core_
.new_ContextMenuEvent(*args
, **kwargs
))
6102 def GetPosition(*args
, **kwargs
):
6104 GetPosition(self) -> Point
6106 Returns the position (in screen coordinants) at which the menu should
6109 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6111 def SetPosition(*args
, **kwargs
):
6113 SetPosition(self, Point pos)
6115 Sets the position at which the menu should be shown.
6117 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6119 _core_
.ContextMenuEvent_swigregister(ContextMenuEvent
)
6121 #---------------------------------------------------------------------------
6123 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6124 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6125 class IdleEvent(Event
):
6127 This class is used for EVT_IDLE events, which are generated and sent
6128 when the application *becomes* idle. In other words, the when the
6129 event queue becomes empty then idle events are sent to all windows (by
6130 default) and as long as none of them call `RequestMore` then there are
6131 no more idle events until after the system event queue has some normal
6132 events and then becomes empty again.
6134 By default, idle events are sent to all windows. If this is causing a
6135 significant overhead in your application, you can call
6136 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6137 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6138 which should receive idle events. Then idle events will only be sent
6139 to those windows and not to any others.
6141 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6142 __repr__
= _swig_repr
6143 def __init__(self
, *args
, **kwargs
):
6145 __init__(self) -> IdleEvent
6149 _core_
.IdleEvent_swiginit(self
,_core_
.new_IdleEvent(*args
, **kwargs
))
6150 def RequestMore(*args
, **kwargs
):
6152 RequestMore(self, bool needMore=True)
6154 Tells wxWidgets that more processing is required. This function can be
6155 called by an EVT_IDLE handler for a window to indicate that the
6156 application should forward the EVT_IDLE event once more to the
6157 application windows. If no window calls this function during its
6158 EVT_IDLE handler, then the application will remain in a passive event
6159 loop until a new event is posted to the application by the windowing
6162 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6164 def MoreRequested(*args
, **kwargs
):
6166 MoreRequested(self) -> bool
6168 Returns ``True`` if the OnIdle function processing this event
6169 requested more processing time.
6171 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6173 def SetMode(*args
, **kwargs
):
6177 Static method for specifying how wxWidgets will send idle events: to
6178 all windows, or only to those which specify that they will process the
6181 The mode can be one of the following values:
6183 ========================= ========================================
6184 wx.IDLE_PROCESS_ALL Send idle events to all windows
6185 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6186 the wx.WS_EX_PROCESS_IDLE extra style
6188 ========================= ========================================
6191 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6193 SetMode
= staticmethod(SetMode
)
6194 def GetMode(*args
, **kwargs
):
6198 Static method returning a value specifying how wxWidgets will send
6199 idle events: to all windows, or only to those which specify that they
6200 will process the events.
6202 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6204 GetMode
= staticmethod(GetMode
)
6205 def CanSend(*args
, **kwargs
):
6207 CanSend(Window win) -> bool
6209 Returns ``True`` if it is appropriate to send idle events to this
6212 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6213 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6214 events should be sent to this window now. By default this will always
6215 return ``True`` because the update mode is initially
6216 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6217 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6219 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6221 CanSend
= staticmethod(CanSend
)
6222 _core_
.IdleEvent_swigregister(IdleEvent
)
6224 def IdleEvent_SetMode(*args
, **kwargs
):
6226 IdleEvent_SetMode(int mode)
6228 Static method for specifying how wxWidgets will send idle events: to
6229 all windows, or only to those which specify that they will process the
6232 The mode can be one of the following values:
6234 ========================= ========================================
6235 wx.IDLE_PROCESS_ALL Send idle events to all windows
6236 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6237 the wx.WS_EX_PROCESS_IDLE extra style
6239 ========================= ========================================
6242 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6244 def IdleEvent_GetMode(*args
):
6246 IdleEvent_GetMode() -> int
6248 Static method returning a value specifying how wxWidgets will send
6249 idle events: to all windows, or only to those which specify that they
6250 will process the events.
6252 return _core_
.IdleEvent_GetMode(*args
)
6254 def IdleEvent_CanSend(*args
, **kwargs
):
6256 IdleEvent_CanSend(Window win) -> bool
6258 Returns ``True`` if it is appropriate to send idle events to this
6261 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6262 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6263 events should be sent to this window now. By default this will always
6264 return ``True`` because the update mode is initially
6265 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6266 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6268 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6270 #---------------------------------------------------------------------------
6272 class ClipboardTextEvent(CommandEvent
):
6274 A Clipboard Text event is sent when a window intercepts a text
6275 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6276 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6277 popup menu command, etc. NOTE : under windows these events are *NOT*
6278 generated automatically for a Rich Edit text control.
6280 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6281 __repr__
= _swig_repr
6282 def __init__(self
, *args
, **kwargs
):
6284 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6286 A Clipboard Text event is sent when a window intercepts a text
6287 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6288 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6289 popup menu command, etc. NOTE : under windows these events are *NOT*
6290 generated automatically for a Rich Edit text control.
6292 _core_
.ClipboardTextEvent_swiginit(self
,_core_
.new_ClipboardTextEvent(*args
, **kwargs
))
6293 _core_
.ClipboardTextEvent_swigregister(ClipboardTextEvent
)
6295 #---------------------------------------------------------------------------
6297 class PyEvent(Event
):
6299 wx.PyEvent can be used as a base class for implementing custom event
6300 types in Python. You should derived from this class instead of
6301 `wx.Event` because this class is Python-aware and is able to transport
6302 its Python bits safely through the wxWidgets event system and have
6303 them still be there when the event handler is invoked.
6305 :see: `wx.PyCommandEvent`
6308 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6309 __repr__
= _swig_repr
6310 def __init__(self
, *args
, **kwargs
):
6311 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
6312 _core_
.PyEvent_swiginit(self
,_core_
.new_PyEvent(*args
, **kwargs
))
6315 __swig_destroy__
= _core_
.delete_PyEvent
6316 __del__
= lambda self
: None;
6317 def _SetSelf(*args
, **kwargs
):
6318 """_SetSelf(self, PyObject self)"""
6319 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6321 def _GetSelf(*args
, **kwargs
):
6322 """_GetSelf(self) -> PyObject"""
6323 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6325 _core_
.PyEvent_swigregister(PyEvent
)
6327 class PyCommandEvent(CommandEvent
):
6329 wx.PyCommandEvent can be used as a base class for implementing custom
6330 event types in Python, where the event shoudl travel up to parent
6331 windows looking for a handler. You should derived from this class
6332 instead of `wx.CommandEvent` because this class is Python-aware and is
6333 able to transport its Python bits safely through the wxWidgets event
6334 system and have them still be there when the event handler is invoked.
6339 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6340 __repr__
= _swig_repr
6341 def __init__(self
, *args
, **kwargs
):
6342 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6343 _core_
.PyCommandEvent_swiginit(self
,_core_
.new_PyCommandEvent(*args
, **kwargs
))
6346 __swig_destroy__
= _core_
.delete_PyCommandEvent
6347 __del__
= lambda self
: None;
6348 def _SetSelf(*args
, **kwargs
):
6349 """_SetSelf(self, PyObject self)"""
6350 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6352 def _GetSelf(*args
, **kwargs
):
6353 """_GetSelf(self) -> PyObject"""
6354 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6356 _core_
.PyCommandEvent_swigregister(PyCommandEvent
)
6358 class DateEvent(CommandEvent
):
6360 This event class holds information about a date change event and is
6361 used together with `wx.DatePickerCtrl`. It also serves as a base class
6362 for `wx.calendar.CalendarEvent`. Bind these event types with
6365 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6366 __repr__
= _swig_repr
6367 def __init__(self
, *args
, **kwargs
):
6368 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
6369 _core_
.DateEvent_swiginit(self
,_core_
.new_DateEvent(*args
, **kwargs
))
6370 def GetDate(*args
, **kwargs
):
6372 GetDate(self) -> DateTime
6376 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6378 def SetDate(*args
, **kwargs
):
6380 SetDate(self, DateTime date)
6382 Sets the date carried by the event, normally only used by the library
6385 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
6387 _core_
.DateEvent_swigregister(DateEvent
)
6389 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
6390 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
6392 #---------------------------------------------------------------------------
6394 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
6395 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
6396 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
6397 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
6398 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
6399 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
6400 class PyApp(EvtHandler
):
6402 The ``wx.PyApp`` class is an *implementation detail*, please use the
6403 `wx.App` class (or some other derived class) instead.
6405 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
6406 __repr__
= _swig_repr
6407 def __init__(self
, *args
, **kwargs
):
6409 __init__(self) -> PyApp
6411 Create a new application object, starting the bootstrap process.
6413 _core_
.PyApp_swiginit(self
,_core_
.new_PyApp(*args
, **kwargs
))
6414 self
._setCallbackInfo
(self
, PyApp
, False)
6415 self
._setOORInfo
(self
, False)
6417 __swig_destroy__
= _core_
.delete_PyApp
6418 __del__
= lambda self
: None;
6419 def _setCallbackInfo(*args
, **kwargs
):
6420 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6421 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
6423 def GetAppName(*args
, **kwargs
):
6425 GetAppName(self) -> String
6427 Get the application name.
6429 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
6431 def SetAppName(*args
, **kwargs
):
6433 SetAppName(self, String name)
6435 Set the application name. This value may be used automatically by
6436 `wx.Config` and such.
6438 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
6440 def GetClassName(*args
, **kwargs
):
6442 GetClassName(self) -> String
6444 Get the application's class name.
6446 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
6448 def SetClassName(*args
, **kwargs
):
6450 SetClassName(self, String name)
6452 Set the application's class name. This value may be used for
6453 X-resources if applicable for the platform
6455 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
6457 def GetVendorName(*args
, **kwargs
):
6459 GetVendorName(self) -> String
6461 Get the application's vendor name.
6463 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
6465 def SetVendorName(*args
, **kwargs
):
6467 SetVendorName(self, String name)
6469 Set the application's vendor name. This value may be used
6470 automatically by `wx.Config` and such.
6472 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
6474 def GetTraits(*args
, **kwargs
):
6476 GetTraits(self) -> wxAppTraits
6478 Return (and create if necessary) the app traits object to which we
6479 delegate for everything which either should be configurable by the
6480 user (then he can change the default behaviour simply by overriding
6481 CreateTraits() and returning his own traits object) or which is
6482 GUI/console dependent as then wx.AppTraits allows us to abstract the
6483 differences behind the common facade.
6485 :todo: Add support for overriding CreateAppTraits in wxPython.
6487 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
6489 def ProcessPendingEvents(*args
, **kwargs
):
6491 ProcessPendingEvents(self)
6493 Process all events in the Pending Events list -- it is necessary to
6494 call this function to process posted events. This normally happens
6495 during each event loop iteration.
6497 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
6499 def Yield(*args
, **kwargs
):
6501 Yield(self, bool onlyIfNeeded=False) -> bool
6503 Process all currently pending events right now, instead of waiting
6504 until return to the event loop. It is an error to call ``Yield``
6505 recursively unless the value of ``onlyIfNeeded`` is True.
6507 :warning: This function is dangerous as it can lead to unexpected
6508 reentrancies (i.e. when called from an event handler it may
6509 result in calling the same event handler again), use with
6510 extreme care or, better, don't use at all!
6512 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6515 return _core_
.PyApp_Yield(*args
, **kwargs
)
6517 def WakeUpIdle(*args
, **kwargs
):
6521 Make sure that idle events are sent again.
6522 :see: `wx.WakeUpIdle`
6524 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
6526 def IsMainLoopRunning(*args
, **kwargs
):
6528 IsMainLoopRunning() -> bool
6530 Returns True if we're running the main loop, i.e. if the events can
6531 currently be dispatched.
6533 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
6535 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
6536 def MainLoop(*args
, **kwargs
):
6538 MainLoop(self) -> int
6540 Execute the main GUI loop, the function doesn't normally return until
6541 all top level windows have been closed and destroyed.
6543 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
6545 def Exit(*args
, **kwargs
):
6549 Exit the main loop thus terminating the application.
6552 return _core_
.PyApp_Exit(*args
, **kwargs
)
6554 def ExitMainLoop(*args
, **kwargs
):
6558 Exit the main GUI loop during the next iteration of the main
6559 loop, (i.e. it does not stop the program immediately!)
6561 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
6563 def Pending(*args
, **kwargs
):
6565 Pending(self) -> bool
6567 Returns True if there are unprocessed events in the event queue.
6569 return _core_
.PyApp_Pending(*args
, **kwargs
)
6571 def Dispatch(*args
, **kwargs
):
6573 Dispatch(self) -> bool
6575 Process the first event in the event queue (blocks until an event
6576 appears if there are none currently)
6578 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
6580 def ProcessIdle(*args
, **kwargs
):
6582 ProcessIdle(self) -> bool
6584 Called from the MainLoop when the application becomes idle (there are
6585 no pending events) and sends a `wx.IdleEvent` to all interested
6586 parties. Returns True if more idle events are needed, False if not.
6588 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
6590 def SendIdleEvents(*args
, **kwargs
):
6592 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6594 Send idle event to window and all subwindows. Returns True if more
6595 idle time is requested.
6597 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
6599 def IsActive(*args
, **kwargs
):
6601 IsActive(self) -> bool
6603 Return True if our app has focus.
6605 return _core_
.PyApp_IsActive(*args
, **kwargs
)
6607 def SetTopWindow(*args
, **kwargs
):
6609 SetTopWindow(self, Window win)
6611 Set the *main* top level window
6613 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
6615 def GetTopWindow(*args
, **kwargs
):
6617 GetTopWindow(self) -> Window
6619 Return the *main* top level window (if it hadn't been set previously
6620 with SetTopWindow(), will return just some top level window and, if
6621 there not any, will return None)
6623 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
6625 def SetExitOnFrameDelete(*args
, **kwargs
):
6627 SetExitOnFrameDelete(self, bool flag)
6629 Control the exit behaviour: by default, the program will exit the main
6630 loop (and so, usually, terminate) when the last top-level program
6631 window is deleted. Beware that if you disable this behaviour (with
6632 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6633 explicitly from somewhere.
6635 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
6637 def GetExitOnFrameDelete(*args
, **kwargs
):
6639 GetExitOnFrameDelete(self) -> bool
6641 Get the current exit behaviour setting.
6643 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
6645 def SetUseBestVisual(*args
, **kwargs
):
6647 SetUseBestVisual(self, bool flag)
6649 Set whether the app should try to use the best available visual on
6650 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6652 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
6654 def GetUseBestVisual(*args
, **kwargs
):
6656 GetUseBestVisual(self) -> bool
6658 Get current UseBestVisual setting.
6660 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
6662 def SetPrintMode(*args
, **kwargs
):
6663 """SetPrintMode(self, int mode)"""
6664 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
6666 def GetPrintMode(*args
, **kwargs
):
6667 """GetPrintMode(self) -> int"""
6668 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
6670 def SetAssertMode(*args
, **kwargs
):
6672 SetAssertMode(self, int mode)
6674 Set the OnAssert behaviour for debug and hybrid builds.
6676 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
6678 def GetAssertMode(*args
, **kwargs
):
6680 GetAssertMode(self) -> int
6682 Get the current OnAssert behaviour setting.
6684 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
6686 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6687 """GetMacSupportPCMenuShortcuts() -> bool"""
6688 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6690 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
6691 def GetMacAboutMenuItemId(*args
, **kwargs
):
6692 """GetMacAboutMenuItemId() -> long"""
6693 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
6695 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
6696 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
6697 """GetMacPreferencesMenuItemId() -> long"""
6698 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
6700 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
6701 def GetMacExitMenuItemId(*args
, **kwargs
):
6702 """GetMacExitMenuItemId() -> long"""
6703 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
6705 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
6706 def GetMacHelpMenuTitleName(*args
, **kwargs
):
6707 """GetMacHelpMenuTitleName() -> String"""
6708 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
6710 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
6711 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6712 """SetMacSupportPCMenuShortcuts(bool val)"""
6713 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6715 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
6716 def SetMacAboutMenuItemId(*args
, **kwargs
):
6717 """SetMacAboutMenuItemId(long val)"""
6718 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6720 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
6721 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
6722 """SetMacPreferencesMenuItemId(long val)"""
6723 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6725 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
6726 def SetMacExitMenuItemId(*args
, **kwargs
):
6727 """SetMacExitMenuItemId(long val)"""
6728 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6730 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
6731 def SetMacHelpMenuTitleName(*args
, **kwargs
):
6732 """SetMacHelpMenuTitleName(String val)"""
6733 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6735 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
6736 def _BootstrapApp(*args
, **kwargs
):
6740 For internal use only
6742 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
6744 def GetComCtl32Version(*args
, **kwargs
):
6746 GetComCtl32Version() -> int
6748 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6749 it wasn't found at all. Raises an exception on non-Windows platforms.
6751 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
6753 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
6754 _core_
.PyApp_swigregister(PyApp
)
6756 def PyApp_IsMainLoopRunning(*args
):
6758 PyApp_IsMainLoopRunning() -> bool
6760 Returns True if we're running the main loop, i.e. if the events can
6761 currently be dispatched.
6763 return _core_
.PyApp_IsMainLoopRunning(*args
)
6765 def PyApp_GetMacSupportPCMenuShortcuts(*args
):
6766 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6767 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
)
6769 def PyApp_GetMacAboutMenuItemId(*args
):
6770 """PyApp_GetMacAboutMenuItemId() -> long"""
6771 return _core_
.PyApp_GetMacAboutMenuItemId(*args
)
6773 def PyApp_GetMacPreferencesMenuItemId(*args
):
6774 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6775 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
)
6777 def PyApp_GetMacExitMenuItemId(*args
):
6778 """PyApp_GetMacExitMenuItemId() -> long"""
6779 return _core_
.PyApp_GetMacExitMenuItemId(*args
)
6781 def PyApp_GetMacHelpMenuTitleName(*args
):
6782 """PyApp_GetMacHelpMenuTitleName() -> String"""
6783 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
)
6785 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6786 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6787 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6789 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
6790 """PyApp_SetMacAboutMenuItemId(long val)"""
6791 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6793 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
6794 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6795 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6797 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
6798 """PyApp_SetMacExitMenuItemId(long val)"""
6799 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6801 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
6802 """PyApp_SetMacHelpMenuTitleName(String val)"""
6803 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6805 def PyApp_GetComCtl32Version(*args
):
6807 PyApp_GetComCtl32Version() -> int
6809 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6810 it wasn't found at all. Raises an exception on non-Windows platforms.
6812 return _core_
.PyApp_GetComCtl32Version(*args
)
6814 #---------------------------------------------------------------------------
6821 Force an exit of the application. Convenience for wx.GetApp().Exit()
6823 return _core_
.Exit(*args
)
6829 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6831 return _core_
.Yield(*args
)
6833 def YieldIfNeeded(*args
):
6835 YieldIfNeeded() -> bool
6837 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6839 return _core_
.YieldIfNeeded(*args
)
6841 def SafeYield(*args
, **kwargs
):
6843 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6845 This function is similar to `wx.Yield`, except that it disables the
6846 user input to all program windows before calling `wx.Yield` and
6847 re-enables it again afterwards. If ``win`` is not None, this window
6848 will remain enabled, allowing the implementation of some limited user
6851 :Returns: the result of the call to `wx.Yield`.
6853 return _core_
.SafeYield(*args
, **kwargs
)
6855 def WakeUpIdle(*args
):
6859 Cause the message queue to become empty again, so idle events will be
6862 return _core_
.WakeUpIdle(*args
)
6864 def PostEvent(*args
, **kwargs
):
6866 PostEvent(EvtHandler dest, Event event)
6868 Send an event to a window or other wx.EvtHandler to be processed
6871 return _core_
.PostEvent(*args
, **kwargs
)
6873 def App_CleanUp(*args
):
6877 For internal use only, it is used to cleanup after wxWidgets when
6880 return _core_
.App_CleanUp(*args
)
6886 Return a reference to the current wx.App object.
6888 return _core_
.GetApp(*args
)
6890 def SetDefaultPyEncoding(*args
, **kwargs
):
6892 SetDefaultPyEncoding(string encoding)
6894 Sets the encoding that wxPython will use when it needs to convert a
6895 Python string or unicode object to or from a wxString.
6897 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6898 but please be aware that the default encoding within the same locale
6899 may be slightly different on different platforms. For example, please
6900 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6901 between the common latin/roman encodings.
6903 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
6905 def GetDefaultPyEncoding(*args
):
6907 GetDefaultPyEncoding() -> string
6909 Gets the current encoding that wxPython will use when it needs to
6910 convert a Python string or unicode object to or from a wxString.
6912 return _core_
.GetDefaultPyEncoding(*args
)
6913 #----------------------------------------------------------------------
6915 class PyOnDemandOutputWindow
:
6917 A class that can be used for redirecting Python's stdout and
6918 stderr streams. It will do nothing until something is wrriten to
6919 the stream at which point it will create a Frame with a text area
6920 and write the text there.
6922 def __init__(self
, title
= "wxPython: stdout/stderr"):
6925 self
.pos
= wx
.DefaultPosition
6926 self
.size
= (450, 300)
6929 def SetParent(self
, parent
):
6930 """Set the window to be used as the popup Frame's parent."""
6931 self
.parent
= parent
6934 def CreateOutputWindow(self
, st
):
6935 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
6936 style
=wx
.DEFAULT_FRAME_STYLE
)
6937 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
6938 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
6939 self
.text
.AppendText(st
)
6940 self
.frame
.Show(True)
6941 self
.frame
.Bind(wx
.EVT_CLOSE
, self
.OnCloseWindow
)
6944 def OnCloseWindow(self
, event
):
6945 if self
.frame
is not None:
6946 self
.frame
.Destroy()
6951 # These methods provide the file-like output behaviour.
6952 def write(self
, text
):
6954 Create the output window if needed and write the string to it.
6955 If not called in the context of the gui thread then uses
6956 CallAfter to do the work there.
6958 if self
.frame
is None:
6959 if not wx
.Thread_IsMain():
6960 wx
.CallAfter(self
.CreateOutputWindow
, text
)
6962 self
.CreateOutputWindow(text
)
6964 if not wx
.Thread_IsMain():
6965 wx
.CallAfter(self
.text
.AppendText
, text
)
6967 self
.text
.AppendText(text
)
6971 if self
.frame
is not None:
6972 wx
.CallAfter(self
.frame
.Close
)
6980 #----------------------------------------------------------------------
6982 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
6984 class App(wx
.PyApp
):
6986 The ``wx.App`` class represents the application and is used to:
6988 * bootstrap the wxPython system and initialize the underlying
6990 * set and get application-wide properties
6991 * implement the windowing system main message or event loop,
6992 and to dispatch events to window instances
6995 Every application must have a ``wx.App`` instance, and all
6996 creation of UI objects should be delayed until after the
6997 ``wx.App`` object has been created in order to ensure that the gui
6998 platform and wxWidgets have been fully initialized.
7000 Normally you would derive from this class and implement an
7001 ``OnInit`` method that creates a frame and then calls
7002 ``self.SetTopWindow(frame)``.
7004 :see: `wx.PySimpleApp` for a simpler app class that can be used
7008 outputWindowClass
= PyOnDemandOutputWindow
7010 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7011 useBestVisual
=False, clearSigInt
=True):
7013 Construct a ``wx.App`` object.
7015 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7016 redirected? Defaults to True on Windows and Mac, False
7017 otherwise. If `filename` is None then output will be
7018 redirected to a window that pops up as needed. (You can
7019 control what kind of window is created for the output by
7020 resetting the class variable ``outputWindowClass`` to a
7021 class of your choosing.)
7023 :param filename: The name of a file to redirect output to, if
7026 :param useBestVisual: Should the app try to use the best
7027 available visual provided by the system (only relevant on
7028 systems that have more than one visual.) This parameter
7029 must be used instead of calling `SetUseBestVisual` later
7030 on because it must be set before the underlying GUI
7031 toolkit is initialized.
7033 :param clearSigInt: Should SIGINT be cleared? This allows the
7034 app to terminate upon a Ctrl-C in the console like other
7037 :note: You should override OnInit to do applicaition
7038 initialization to ensure that the system, toolkit and
7039 wxWidgets are fully initialized.
7041 wx
.PyApp
.__init
__(self
)
7043 if wx
.Platform
== "__WXMAC__":
7046 if not MacOS
.WMAvailable():
7048 This program needs access to the screen. Please run with 'pythonw',
7049 not 'python', and only when you are logged in on the main display of
7057 # This has to be done before OnInit
7058 self
.SetUseBestVisual(useBestVisual
)
7060 # Set the default handler for SIGINT. This fixes a problem
7061 # where if Ctrl-C is pressed in the console that started this
7062 # app then it will not appear to do anything, (not even send
7063 # KeyboardInterrupt???) but will later segfault on exit. By
7064 # setting the default handler then the app will exit, as
7065 # expected (depending on platform.)
7069 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7073 # Save and redirect the stdio to a window?
7074 self
.stdioWin
= None
7075 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7077 self
.RedirectStdio(filename
)
7079 # Use Python's install prefix as the default
7080 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7082 # This finishes the initialization of wxWindows and then calls
7083 # the OnInit that should be present in the derived class
7084 self
._BootstrapApp
()
7087 def OnPreInit(self
):
7089 Things that must be done after _BootstrapApp has done its
7090 thing, but would be nice if they were already done by the time
7091 that OnInit is called.
7093 wx
.StockGDI
._initStockObjects
()
7096 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7097 self
.RestoreStdio() # Just in case the MainLoop was overridden
7101 wx
.PyApp
.Destroy(self
)
7104 def SetTopWindow(self
, frame
):
7105 """Set the \"main\" top level window"""
7107 self
.stdioWin
.SetParent(frame
)
7108 wx
.PyApp
.SetTopWindow(self
, frame
)
7112 """Execute the main GUI event loop"""
7113 wx
.PyApp
.MainLoop(self
)
7117 def RedirectStdio(self
, filename
=None):
7118 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7120 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7122 self
.stdioWin
= self
.outputWindowClass()
7123 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7126 def RestoreStdio(self
):
7128 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7133 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7135 Set the title, position and/or size of the output window if
7136 the stdio has been redirected. This should be called before
7137 any output would cause the output window to be created.
7140 if title
is not None:
7141 self
.stdioWin
.title
= title
7143 self
.stdioWin
.pos
= pos
7144 if size
is not None:
7145 self
.stdioWin
.size
= size
7150 # change from wx.PyApp_XX to wx.App_XX
7151 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7152 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7153 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7154 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7155 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7156 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7157 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7158 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7159 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7160 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7161 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7163 #----------------------------------------------------------------------------
7165 class PySimpleApp(wx
.App
):
7167 A simple application class. You can just create one of these and
7168 then then make your top level windows later, and not have to worry
7169 about OnInit. For example::
7171 app = wx.PySimpleApp()
7172 frame = wx.Frame(None, title='Hello World')
7179 def __init__(self
, redirect
=False, filename
=None,
7180 useBestVisual
=False, clearSigInt
=True):
7182 :see: `wx.App.__init__`
7184 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7191 # Is anybody using this one?
7192 class PyWidgetTester(wx
.App
):
7193 def __init__(self
, size
= (250, 100)):
7195 wx
.App
.__init
__(self
, 0)
7198 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7199 self
.SetTopWindow(self
.frame
)
7202 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7203 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7204 self
.frame
.Show(True)
7206 #----------------------------------------------------------------------------
7207 # DO NOT hold any other references to this object. This is how we
7208 # know when to cleanup system resources that wxWidgets is holding. When
7209 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7210 # goes to zero and it calls the wx.App_CleanUp function.
7212 class __wxPyCleanup
:
7214 self
.cleanup
= _core_
.App_CleanUp
7218 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7220 ## # another possible solution, but it gets called too early...
7222 ## atexit.register(_core_.wxApp_CleanUp)
7225 #----------------------------------------------------------------------------
7227 #---------------------------------------------------------------------------
7229 class EventLoop(object):
7230 """Proxy of C++ EventLoop class"""
7231 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7232 __repr__
= _swig_repr
7233 def __init__(self
, *args
, **kwargs
):
7234 """__init__(self) -> EventLoop"""
7235 _core_
.EventLoop_swiginit(self
,_core_
.new_EventLoop(*args
, **kwargs
))
7236 __swig_destroy__
= _core_
.delete_EventLoop
7237 __del__
= lambda self
: None;
7238 def Run(*args
, **kwargs
):
7239 """Run(self) -> int"""
7240 return _core_
.EventLoop_Run(*args
, **kwargs
)
7242 def Exit(*args
, **kwargs
):
7243 """Exit(self, int rc=0)"""
7244 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7246 def Pending(*args
, **kwargs
):
7247 """Pending(self) -> bool"""
7248 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7250 def Dispatch(*args
, **kwargs
):
7251 """Dispatch(self) -> bool"""
7252 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7254 def IsRunning(*args
, **kwargs
):
7255 """IsRunning(self) -> bool"""
7256 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7258 def GetActive(*args
, **kwargs
):
7259 """GetActive() -> EventLoop"""
7260 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7262 GetActive
= staticmethod(GetActive
)
7263 def SetActive(*args
, **kwargs
):
7264 """SetActive(EventLoop loop)"""
7265 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7267 SetActive
= staticmethod(SetActive
)
7268 _core_
.EventLoop_swigregister(EventLoop
)
7270 def EventLoop_GetActive(*args
):
7271 """EventLoop_GetActive() -> EventLoop"""
7272 return _core_
.EventLoop_GetActive(*args
)
7274 def EventLoop_SetActive(*args
, **kwargs
):
7275 """EventLoop_SetActive(EventLoop loop)"""
7276 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7278 class EventLoopActivator(object):
7279 """Proxy of C++ EventLoopActivator class"""
7280 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7281 __repr__
= _swig_repr
7282 def __init__(self
, *args
, **kwargs
):
7283 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7284 _core_
.EventLoopActivator_swiginit(self
,_core_
.new_EventLoopActivator(*args
, **kwargs
))
7285 __swig_destroy__
= _core_
.delete_EventLoopActivator
7286 __del__
= lambda self
: None;
7287 _core_
.EventLoopActivator_swigregister(EventLoopActivator
)
7289 #---------------------------------------------------------------------------
7291 class AcceleratorEntry(object):
7293 A class used to define items in an `wx.AcceleratorTable`. wxPython
7294 programs can choose to use wx.AcceleratorEntry objects, but using a
7295 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7296 as well. See `__init__` for of the tuple values.
7298 :see: `wx.AcceleratorTable`
7300 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7301 __repr__
= _swig_repr
7302 def __init__(self
, *args
, **kwargs
):
7304 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7306 Construct a wx.AcceleratorEntry.
7308 _core_
.AcceleratorEntry_swiginit(self
,_core_
.new_AcceleratorEntry(*args
, **kwargs
))
7309 __swig_destroy__
= _core_
.delete_AcceleratorEntry
7310 __del__
= lambda self
: None;
7311 def Set(*args
, **kwargs
):
7313 Set(self, int flags, int keyCode, int cmd)
7315 (Re)set the attributes of a wx.AcceleratorEntry.
7318 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
7320 def GetFlags(*args
, **kwargs
):
7322 GetFlags(self) -> int
7324 Get the AcceleratorEntry's flags.
7326 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
7328 def GetKeyCode(*args
, **kwargs
):
7330 GetKeyCode(self) -> int
7332 Get the AcceleratorEntry's keycode.
7334 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
7336 def GetCommand(*args
, **kwargs
):
7338 GetCommand(self) -> int
7340 Get the AcceleratorEntry's command ID.
7342 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
7344 _core_
.AcceleratorEntry_swigregister(AcceleratorEntry
)
7346 class AcceleratorTable(Object
):
7348 An accelerator table allows the application to specify a table of
7349 keyboard shortcuts for menus or other commands. On Windows, menu or
7350 button commands are supported; on GTK, only menu commands are
7353 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7354 __repr__
= _swig_repr
7355 def __init__(self
, *args
, **kwargs
):
7357 __init__(entries) -> AcceleratorTable
7359 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7360 items or or of 3-tuples (flags, keyCode, cmdID)
7362 :see: `wx.AcceleratorEntry`
7364 _core_
.AcceleratorTable_swiginit(self
,_core_
.new_AcceleratorTable(*args
, **kwargs
))
7365 __swig_destroy__
= _core_
.delete_AcceleratorTable
7366 __del__
= lambda self
: None;
7367 def Ok(*args
, **kwargs
):
7368 """Ok(self) -> bool"""
7369 return _core_
.AcceleratorTable_Ok(*args
, **kwargs
)
7371 _core_
.AcceleratorTable_swigregister(AcceleratorTable
)
7374 def GetAccelFromString(*args
, **kwargs
):
7375 """GetAccelFromString(String label) -> AcceleratorEntry"""
7376 return _core_
.GetAccelFromString(*args
, **kwargs
)
7377 #---------------------------------------------------------------------------
7379 class VisualAttributes(object):
7380 """struct containing all the visual attributes of a control"""
7381 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7382 __repr__
= _swig_repr
7383 def __init__(self
, *args
, **kwargs
):
7385 __init__(self) -> VisualAttributes
7387 struct containing all the visual attributes of a control
7389 _core_
.VisualAttributes_swiginit(self
,_core_
.new_VisualAttributes(*args
, **kwargs
))
7390 __swig_destroy__
= _core_
.delete_VisualAttributes
7391 __del__
= lambda self
: None;
7392 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
7393 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
7394 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
7395 _core_
.VisualAttributes_swigregister(VisualAttributes
)
7396 NullAcceleratorTable
= cvar
.NullAcceleratorTable
7397 PanelNameStr
= cvar
.PanelNameStr
7399 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
7400 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
7401 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
7402 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
7403 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
7404 class Window(EvtHandler
):
7406 wx.Window is the base class for all windows and represents any visible
7407 object on the screen. All controls, top level windows and so on are
7408 wx.Windows. Sizers and device contexts are not however, as they don't
7409 appear on screen themselves.
7412 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
7413 __repr__
= _swig_repr
7414 def __init__(self
, *args
, **kwargs
):
7416 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7417 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7419 Construct and show a generic Window.
7421 _core_
.Window_swiginit(self
,_core_
.new_Window(*args
, **kwargs
))
7422 self
._setOORInfo
(self
)
7424 def Create(*args
, **kwargs
):
7426 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7427 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7429 Create the GUI part of the Window for 2-phase creation mode.
7431 return _core_
.Window_Create(*args
, **kwargs
)
7433 def Close(*args
, **kwargs
):
7435 Close(self, bool force=False) -> bool
7437 This function simply generates a EVT_CLOSE event whose handler usually
7438 tries to close the window. It doesn't close the window itself,
7439 however. If force is False (the default) then the window's close
7440 handler will be allowed to veto the destruction of the window.
7442 return _core_
.Window_Close(*args
, **kwargs
)
7444 def Destroy(*args
, **kwargs
):
7446 Destroy(self) -> bool
7448 Destroys the window safely. Frames and dialogs are not destroyed
7449 immediately when this function is called -- they are added to a list
7450 of windows to be deleted on idle time, when all the window's events
7451 have been processed. This prevents problems with events being sent to
7452 non-existent windows.
7454 Returns True if the window has either been successfully deleted, or it
7455 has been added to the list of windows pending real deletion.
7457 val
= _core_
.Window_Destroy(*args
, **kwargs
)
7461 def DestroyChildren(*args
, **kwargs
):
7463 DestroyChildren(self) -> bool
7465 Destroys all children of a window. Called automatically by the
7468 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
7470 def IsBeingDeleted(*args
, **kwargs
):
7472 IsBeingDeleted(self) -> bool
7474 Is the window in the process of being deleted?
7476 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
7478 def SetLabel(*args
, **kwargs
):
7480 SetLabel(self, String label)
7482 Set the text which the window shows in its label if applicable.
7484 return _core_
.Window_SetLabel(*args
, **kwargs
)
7486 def GetLabel(*args
, **kwargs
):
7488 GetLabel(self) -> String
7490 Generic way of getting a label from any window, for identification
7491 purposes. The interpretation of this function differs from class to
7492 class. For frames and dialogs, the value returned is the title. For
7493 buttons or static text controls, it is the button text. This function
7494 can be useful for meta-programs such as testing tools or special-needs
7495 access programs)which need to identify windows by name.
7497 return _core_
.Window_GetLabel(*args
, **kwargs
)
7499 def SetName(*args
, **kwargs
):
7501 SetName(self, String name)
7503 Sets the window's name. The window name is used for ressource setting
7504 in X, it is not the same as the window title/label
7506 return _core_
.Window_SetName(*args
, **kwargs
)
7508 def GetName(*args
, **kwargs
):
7510 GetName(self) -> String
7512 Returns the windows name. This name is not guaranteed to be unique;
7513 it is up to the programmer to supply an appropriate name in the window
7514 constructor or via wx.Window.SetName.
7516 return _core_
.Window_GetName(*args
, **kwargs
)
7518 def SetWindowVariant(*args
, **kwargs
):
7520 SetWindowVariant(self, int variant)
7522 Sets the variant of the window/font size to use for this window, if
7523 the platform supports variants, for example, wxMac.
7525 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
7527 def GetWindowVariant(*args
, **kwargs
):
7528 """GetWindowVariant(self) -> int"""
7529 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
7531 def SetId(*args
, **kwargs
):
7533 SetId(self, int winid)
7535 Sets the identifier of the window. Each window has an integer
7536 identifier. If the application has not provided one, an identifier
7537 will be generated. Normally, the identifier should be provided on
7538 creation and should not be modified subsequently.
7540 return _core_
.Window_SetId(*args
, **kwargs
)
7542 def GetId(*args
, **kwargs
):
7546 Returns the identifier of the window. Each window has an integer
7547 identifier. If the application has not provided one (or the default Id
7548 -1 is used) then an unique identifier with a negative value will be
7551 return _core_
.Window_GetId(*args
, **kwargs
)
7553 def NewControlId(*args
, **kwargs
):
7555 NewControlId() -> int
7557 Generate a control id for the controls which were not given one.
7559 return _core_
.Window_NewControlId(*args
, **kwargs
)
7561 NewControlId
= staticmethod(NewControlId
)
7562 def NextControlId(*args
, **kwargs
):
7564 NextControlId(int winid) -> int
7566 Get the id of the control following the one with the given
7569 return _core_
.Window_NextControlId(*args
, **kwargs
)
7571 NextControlId
= staticmethod(NextControlId
)
7572 def PrevControlId(*args
, **kwargs
):
7574 PrevControlId(int winid) -> int
7576 Get the id of the control preceding the one with the given
7579 return _core_
.Window_PrevControlId(*args
, **kwargs
)
7581 PrevControlId
= staticmethod(PrevControlId
)
7582 def SetSize(*args
, **kwargs
):
7584 SetSize(self, Size size)
7586 Sets the size of the window in pixels.
7588 return _core_
.Window_SetSize(*args
, **kwargs
)
7590 def SetDimensions(*args
, **kwargs
):
7592 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7594 Sets the position and size of the window in pixels. The sizeFlags
7595 parameter indicates the interpretation of the other params if they are
7598 ======================== ======================================
7599 wx.SIZE_AUTO A -1 indicates that a class-specific
7600 default should be used.
7601 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7602 -1 values are supplied.
7603 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7604 interpreted as real dimensions, not
7606 ======================== ======================================
7609 return _core_
.Window_SetDimensions(*args
, **kwargs
)
7611 def SetRect(*args
, **kwargs
):
7613 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7615 Sets the position and size of the window in pixels using a wx.Rect.
7617 return _core_
.Window_SetRect(*args
, **kwargs
)
7619 def SetSizeWH(*args
, **kwargs
):
7621 SetSizeWH(self, int width, int height)
7623 Sets the size of the window in pixels.
7625 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
7627 def Move(*args
, **kwargs
):
7629 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7631 Moves the window to the given position.
7633 return _core_
.Window_Move(*args
, **kwargs
)
7636 def MoveXY(*args
, **kwargs
):
7638 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7640 Moves the window to the given position.
7642 return _core_
.Window_MoveXY(*args
, **kwargs
)
7644 def SetBestFittingSize(*args
, **kwargs
):
7646 SetBestFittingSize(self, Size size=DefaultSize)
7648 A 'Smart' SetSize that will fill in default size components with the
7649 window's *best size* values. Also set's the minsize for use with sizers.
7651 return _core_
.Window_SetBestFittingSize(*args
, **kwargs
)
7653 def Raise(*args
, **kwargs
):
7657 Raises the window to the top of the window hierarchy. In current
7658 version of wxWidgets this works both for manage and child windows.
7660 return _core_
.Window_Raise(*args
, **kwargs
)
7662 def Lower(*args
, **kwargs
):
7666 Lowers the window to the bottom of the window hierarchy. In current
7667 version of wxWidgets this works both for manage and child windows.
7669 return _core_
.Window_Lower(*args
, **kwargs
)
7671 def SetClientSize(*args
, **kwargs
):
7673 SetClientSize(self, Size size)
7675 This sets the size of the window client area in pixels. Using this
7676 function to size a window tends to be more device-independent than
7677 wx.Window.SetSize, since the application need not worry about what
7678 dimensions the border or title bar have when trying to fit the window
7679 around panel items, for example.
7681 return _core_
.Window_SetClientSize(*args
, **kwargs
)
7683 def SetClientSizeWH(*args
, **kwargs
):
7685 SetClientSizeWH(self, int width, int height)
7687 This sets the size of the window client area in pixels. Using this
7688 function to size a window tends to be more device-independent than
7689 wx.Window.SetSize, since the application need not worry about what
7690 dimensions the border or title bar have when trying to fit the window
7691 around panel items, for example.
7693 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
7695 def SetClientRect(*args
, **kwargs
):
7697 SetClientRect(self, Rect rect)
7699 This sets the size of the window client area in pixels. Using this
7700 function to size a window tends to be more device-independent than
7701 wx.Window.SetSize, since the application need not worry about what
7702 dimensions the border or title bar have when trying to fit the window
7703 around panel items, for example.
7705 return _core_
.Window_SetClientRect(*args
, **kwargs
)
7707 def GetPosition(*args
, **kwargs
):
7709 GetPosition(self) -> Point
7711 Get the window's position. Notice that the position is in client
7712 coordinates for child windows and screen coordinates for the top level
7713 ones, use `GetScreenPosition` if you need screen coordinates for all
7716 return _core_
.Window_GetPosition(*args
, **kwargs
)
7718 def GetPositionTuple(*args
, **kwargs
):
7720 GetPositionTuple() -> (x,y)
7722 Get the window's position. Notice that the position is in client
7723 coordinates for child windows and screen coordinates for the top level
7724 ones, use `GetScreenPosition` if you need screen coordinates for all
7727 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
7729 def GetScreenPosition(*args
, **kwargs
):
7731 GetScreenPosition(self) -> Point
7733 Get the position of the window in screen coordinantes.
7735 return _core_
.Window_GetScreenPosition(*args
, **kwargs
)
7737 def GetScreenPositionTuple(*args
, **kwargs
):
7739 GetScreenPositionTuple() -> (x,y)
7741 Get the position of the window in screen coordinantes.
7743 return _core_
.Window_GetScreenPositionTuple(*args
, **kwargs
)
7745 def GetScreenRect(*args
, **kwargs
):
7747 GetScreenRect(self) -> Rect
7749 Returns the size and position of the window in screen coordinantes as
7752 return _core_
.Window_GetScreenRect(*args
, **kwargs
)
7754 def GetSize(*args
, **kwargs
):
7756 GetSize(self) -> Size
7758 Get the window size.
7760 return _core_
.Window_GetSize(*args
, **kwargs
)
7762 def GetSizeTuple(*args
, **kwargs
):
7764 GetSizeTuple() -> (width, height)
7766 Get the window size.
7768 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
7770 def GetRect(*args
, **kwargs
):
7772 GetRect(self) -> Rect
7774 Returns the size and position of the window as a `wx.Rect` object.
7776 return _core_
.Window_GetRect(*args
, **kwargs
)
7778 def GetClientSize(*args
, **kwargs
):
7780 GetClientSize(self) -> Size
7782 This gets the size of the window's 'client area' in pixels. The client
7783 area is the area which may be drawn on by the programmer, excluding
7784 title bar, border, scrollbars, etc.
7786 return _core_
.Window_GetClientSize(*args
, **kwargs
)
7788 def GetClientSizeTuple(*args
, **kwargs
):
7790 GetClientSizeTuple() -> (width, height)
7792 This gets the size of the window's 'client area' in pixels. The client
7793 area is the area which may be drawn on by the programmer, excluding
7794 title bar, border, scrollbars, etc.
7796 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
7798 def GetClientAreaOrigin(*args
, **kwargs
):
7800 GetClientAreaOrigin(self) -> Point
7802 Get the origin of the client area of the window relative to the
7803 window's top left corner (the client area may be shifted because of
7804 the borders, scrollbars, other decorations...)
7806 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
7808 def GetClientRect(*args
, **kwargs
):
7810 GetClientRect(self) -> Rect
7812 Get the client area position and size as a `wx.Rect` object.
7814 return _core_
.Window_GetClientRect(*args
, **kwargs
)
7816 def GetBestSize(*args
, **kwargs
):
7818 GetBestSize(self) -> Size
7820 This function returns the best acceptable minimal size for the
7821 window, if applicable. For example, for a static text control, it will
7822 be the minimal size such that the control label is not truncated. For
7823 windows containing subwindows (suzh aswx.Panel), the size returned by
7824 this function will be the same as the size the window would have had
7827 return _core_
.Window_GetBestSize(*args
, **kwargs
)
7829 def GetBestSizeTuple(*args
, **kwargs
):
7831 GetBestSizeTuple() -> (width, height)
7833 This function returns the best acceptable minimal size for the
7834 window, if applicable. For example, for a static text control, it will
7835 be the minimal size such that the control label is not truncated. For
7836 windows containing subwindows (suzh aswx.Panel), the size returned by
7837 this function will be the same as the size the window would have had
7840 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
7842 def InvalidateBestSize(*args
, **kwargs
):
7844 InvalidateBestSize(self)
7846 Reset the cached best size value so it will be recalculated the next
7849 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
7851 def CacheBestSize(*args
, **kwargs
):
7853 CacheBestSize(self, Size size)
7855 Cache the best size so it doesn't need to be calculated again, (at least until
7856 some properties of the window change.)
7858 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
7860 def GetBestFittingSize(*args
, **kwargs
):
7862 GetBestFittingSize(self) -> Size
7864 This function will merge the window's best size into the window's
7865 minimum size, giving priority to the min size components, and returns
7869 return _core_
.Window_GetBestFittingSize(*args
, **kwargs
)
7871 def GetAdjustedBestSize(*args
, **kwargs
):
7873 GetAdjustedBestSize(self) -> Size
7875 This method is similar to GetBestSize, except in one
7876 thing. GetBestSize should return the minimum untruncated size of the
7877 window, while this method will return the largest of BestSize and any
7878 user specified minimum size. ie. it is the minimum size the window
7879 should currently be drawn at, not the minimal size it can possibly
7882 return _core_
.Window_GetAdjustedBestSize(*args
, **kwargs
)
7884 def Center(*args
, **kwargs
):
7886 Center(self, int direction=BOTH)
7888 Centers the window. The parameter specifies the direction for
7889 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7890 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7891 on the entire screen and not on its parent window. If it is a
7892 top-level window and has no parent then it will always be centered
7893 relative to the screen.
7895 return _core_
.Window_Center(*args
, **kwargs
)
7898 def CenterOnParent(*args
, **kwargs
):
7900 CenterOnParent(self, int dir=BOTH)
7902 Center with respect to the the parent window
7904 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
7906 CentreOnParent
= CenterOnParent
7907 def Fit(*args
, **kwargs
):
7911 Sizes the window so that it fits around its subwindows. This function
7912 won't do anything if there are no subwindows and will only really work
7913 correctly if sizers are used for the subwindows layout. Also, if the
7914 window has exactly one subwindow it is better (faster and the result
7915 is more precise as Fit adds some margin to account for fuzziness of
7916 its calculations) to call window.SetClientSize(child.GetSize())
7917 instead of calling Fit.
7919 return _core_
.Window_Fit(*args
, **kwargs
)
7921 def FitInside(*args
, **kwargs
):
7925 Similar to Fit, but sizes the interior (virtual) size of a
7926 window. Mainly useful with scrolled windows to reset scrollbars after
7927 sizing changes that do not trigger a size event, and/or scrolled
7928 windows without an interior sizer. This function similarly won't do
7929 anything if there are no subwindows.
7931 return _core_
.Window_FitInside(*args
, **kwargs
)
7933 def SetSizeHints(*args
, **kwargs
):
7935 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7938 Allows specification of minimum and maximum window sizes, and window
7939 size increments. If a pair of values is not set (or set to -1), the
7940 default values will be used. If this function is called, the user
7941 will not be able to size the window outside the given bounds (if it is
7942 a top-level window.) Sizers will also inspect the minimum window size
7943 and will use that value if set when calculating layout.
7945 The resizing increments are only significant under Motif or Xt.
7947 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
7949 def SetSizeHintsSz(*args
, **kwargs
):
7951 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7953 Allows specification of minimum and maximum window sizes, and window
7954 size increments. If a pair of values is not set (or set to -1), the
7955 default values will be used. If this function is called, the user
7956 will not be able to size the window outside the given bounds (if it is
7957 a top-level window.) Sizers will also inspect the minimum window size
7958 and will use that value if set when calculating layout.
7960 The resizing increments are only significant under Motif or Xt.
7962 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
7964 def SetVirtualSizeHints(*args
, **kwargs
):
7966 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
7968 Allows specification of minimum and maximum virtual window sizes. If a
7969 pair of values is not set (or set to -1), the default values will be
7970 used. If this function is called, the user will not be able to size
7971 the virtual area of the window outside the given bounds.
7973 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
7975 def SetVirtualSizeHintsSz(*args
, **kwargs
):
7977 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7979 Allows specification of minimum and maximum virtual window sizes. If a
7980 pair of values is not set (or set to -1), the default values will be
7981 used. If this function is called, the user will not be able to size
7982 the virtual area of the window outside the given bounds.
7984 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
7986 def GetMaxSize(*args
, **kwargs
):
7987 """GetMaxSize(self) -> Size"""
7988 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
7990 def GetMinSize(*args
, **kwargs
):
7991 """GetMinSize(self) -> Size"""
7992 return _core_
.Window_GetMinSize(*args
, **kwargs
)
7994 def SetMinSize(*args
, **kwargs
):
7996 SetMinSize(self, Size minSize)
7998 A more convenient method than `SetSizeHints` for setting just the
8001 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8003 def SetMaxSize(*args
, **kwargs
):
8005 SetMaxSize(self, Size maxSize)
8007 A more convenient method than `SetSizeHints` for setting just the
8010 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8012 def GetMinWidth(*args
, **kwargs
):
8013 """GetMinWidth(self) -> int"""
8014 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8016 def GetMinHeight(*args
, **kwargs
):
8017 """GetMinHeight(self) -> int"""
8018 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8020 def GetMaxWidth(*args
, **kwargs
):
8021 """GetMaxWidth(self) -> int"""
8022 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8024 def GetMaxHeight(*args
, **kwargs
):
8025 """GetMaxHeight(self) -> int"""
8026 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8028 def SetVirtualSize(*args
, **kwargs
):
8030 SetVirtualSize(self, Size size)
8032 Set the the virtual size of a window in pixels. For most windows this
8033 is just the client area of the window, but for some like scrolled
8034 windows it is more or less independent of the screen window size.
8036 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8038 def SetVirtualSizeWH(*args
, **kwargs
):
8040 SetVirtualSizeWH(self, int w, int h)
8042 Set the the virtual size of a window in pixels. For most windows this
8043 is just the client area of the window, but for some like scrolled
8044 windows it is more or less independent of the screen window size.
8046 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8048 def GetVirtualSize(*args
, **kwargs
):
8050 GetVirtualSize(self) -> Size
8052 Get the the virtual size of the window in pixels. For most windows
8053 this is just the client area of the window, but for some like scrolled
8054 windows it is more or less independent of the screen window size.
8056 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8058 def GetVirtualSizeTuple(*args
, **kwargs
):
8060 GetVirtualSizeTuple() -> (width, height)
8062 Get the the virtual size of the window in pixels. For most windows
8063 this is just the client area of the window, but for some like scrolled
8064 windows it is more or less independent of the screen window size.
8066 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8068 def GetBestVirtualSize(*args
, **kwargs
):
8070 GetBestVirtualSize(self) -> Size
8072 Return the largest of ClientSize and BestSize (as determined by a
8073 sizer, interior children, or other means)
8075 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8077 def Show(*args
, **kwargs
):
8079 Show(self, bool show=True) -> bool
8081 Shows or hides the window. You may need to call Raise for a top level
8082 window if you want to bring it to top, although this is not needed if
8083 Show is called immediately after the frame creation. Returns True if
8084 the window has been shown or hidden or False if nothing was done
8085 because it already was in the requested state.
8087 return _core_
.Window_Show(*args
, **kwargs
)
8089 def Hide(*args
, **kwargs
):
8093 Equivalent to calling Show(False).
8095 return _core_
.Window_Hide(*args
, **kwargs
)
8097 def Enable(*args
, **kwargs
):
8099 Enable(self, bool enable=True) -> bool
8101 Enable or disable the window for user input. Note that when a parent
8102 window is disabled, all of its children are disabled as well and they
8103 are reenabled again when the parent is. Returns true if the window
8104 has been enabled or disabled, false if nothing was done, i.e. if the
8105 window had already been in the specified state.
8107 return _core_
.Window_Enable(*args
, **kwargs
)
8109 def Disable(*args
, **kwargs
):
8111 Disable(self) -> bool
8113 Disables the window, same as Enable(false).
8115 return _core_
.Window_Disable(*args
, **kwargs
)
8117 def IsShown(*args
, **kwargs
):
8119 IsShown(self) -> bool
8121 Returns true if the window is shown, false if it has been hidden.
8123 return _core_
.Window_IsShown(*args
, **kwargs
)
8125 def IsEnabled(*args
, **kwargs
):
8127 IsEnabled(self) -> bool
8129 Returns true if the window is enabled for input, false otherwise.
8131 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8133 def SetWindowStyleFlag(*args
, **kwargs
):
8135 SetWindowStyleFlag(self, long style)
8137 Sets the style of the window. Please note that some styles cannot be
8138 changed after the window creation and that Refresh() might need to be
8139 called after changing the others for the change to take place
8142 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8144 def GetWindowStyleFlag(*args
, **kwargs
):
8146 GetWindowStyleFlag(self) -> long
8148 Gets the window style that was passed to the constructor or Create
8151 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8153 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8154 def HasFlag(*args
, **kwargs
):
8156 HasFlag(self, int flag) -> bool
8158 Test if the given style is set for this window.
8160 return _core_
.Window_HasFlag(*args
, **kwargs
)
8162 def IsRetained(*args
, **kwargs
):
8164 IsRetained(self) -> bool
8166 Returns true if the window is retained, false otherwise. Retained
8167 windows are only available on X platforms.
8169 return _core_
.Window_IsRetained(*args
, **kwargs
)
8171 def SetExtraStyle(*args
, **kwargs
):
8173 SetExtraStyle(self, long exStyle)
8175 Sets the extra style bits for the window. Extra styles are the less
8176 often used style bits which can't be set with the constructor or with
8177 SetWindowStyleFlag()
8179 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8181 def GetExtraStyle(*args
, **kwargs
):
8183 GetExtraStyle(self) -> long
8185 Returns the extra style bits for the window.
8187 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
8189 def MakeModal(*args
, **kwargs
):
8191 MakeModal(self, bool modal=True)
8193 Disables all other windows in the application so that the user can
8194 only interact with this window. Passing False will reverse this
8197 return _core_
.Window_MakeModal(*args
, **kwargs
)
8199 def SetThemeEnabled(*args
, **kwargs
):
8201 SetThemeEnabled(self, bool enableTheme)
8203 This function tells a window if it should use the system's "theme"
8204 code to draw the windows' background instead if its own background
8205 drawing code. This will only have an effect on platforms that support
8206 the notion of themes in user defined windows. One such platform is
8207 GTK+ where windows can have (very colourful) backgrounds defined by a
8208 user's selected theme.
8210 Dialogs, notebook pages and the status bar have this flag set to true
8211 by default so that the default look and feel is simulated best.
8213 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
8215 def GetThemeEnabled(*args
, **kwargs
):
8217 GetThemeEnabled(self) -> bool
8219 Return the themeEnabled flag.
8221 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
8223 def SetFocus(*args
, **kwargs
):
8227 Set's the focus to this window, allowing it to receive keyboard input.
8229 return _core_
.Window_SetFocus(*args
, **kwargs
)
8231 def SetFocusFromKbd(*args
, **kwargs
):
8233 SetFocusFromKbd(self)
8235 Set focus to this window as the result of a keyboard action. Normally
8236 only called internally.
8238 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
8240 def FindFocus(*args
, **kwargs
):
8242 FindFocus() -> Window
8244 Returns the window or control that currently has the keyboard focus,
8247 return _core_
.Window_FindFocus(*args
, **kwargs
)
8249 FindFocus
= staticmethod(FindFocus
)
8250 def AcceptsFocus(*args
, **kwargs
):
8252 AcceptsFocus(self) -> bool
8254 Can this window have focus?
8256 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
8258 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
8260 AcceptsFocusFromKeyboard(self) -> bool
8262 Can this window be given focus by keyboard navigation? if not, the
8263 only way to give it focus (provided it accepts it at all) is to click
8266 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
8268 def GetDefaultItem(*args
, **kwargs
):
8270 GetDefaultItem(self) -> Window
8272 Get the default child of this parent, i.e. the one which is activated
8273 by pressing <Enter> such as the OK button on a wx.Dialog.
8275 return _core_
.Window_GetDefaultItem(*args
, **kwargs
)
8277 def SetDefaultItem(*args
, **kwargs
):
8279 SetDefaultItem(self, Window child) -> Window
8281 Set this child as default, return the old default.
8283 return _core_
.Window_SetDefaultItem(*args
, **kwargs
)
8285 def SetTmpDefaultItem(*args
, **kwargs
):
8287 SetTmpDefaultItem(self, Window win)
8289 Set this child as temporary default
8291 return _core_
.Window_SetTmpDefaultItem(*args
, **kwargs
)
8293 def Navigate(*args
, **kwargs
):
8295 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8297 Does keyboard navigation from this window to another, by sending a
8298 `wx.NavigationKeyEvent`.
8300 return _core_
.Window_Navigate(*args
, **kwargs
)
8302 def MoveAfterInTabOrder(*args
, **kwargs
):
8304 MoveAfterInTabOrder(self, Window win)
8306 Moves this window in the tab navigation order after the specified
8307 sibling window. This means that when the user presses the TAB key on
8308 that other window, the focus switches to this window.
8310 The default tab order is the same as creation order. This function
8311 and `MoveBeforeInTabOrder` allow to change it after creating all the
8315 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
8317 def MoveBeforeInTabOrder(*args
, **kwargs
):
8319 MoveBeforeInTabOrder(self, Window win)
8321 Same as `MoveAfterInTabOrder` except that it inserts this window just
8322 before win instead of putting it right after it.
8324 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
8326 def GetChildren(*args
, **kwargs
):
8328 GetChildren(self) -> PyObject
8330 Returns a list of the window's children. NOTE: Currently this is a
8331 copy of the child window list maintained by the window, so the return
8332 value of this function is only valid as long as the window's children
8335 return _core_
.Window_GetChildren(*args
, **kwargs
)
8337 def GetParent(*args
, **kwargs
):
8339 GetParent(self) -> Window
8341 Returns the parent window of this window, or None if there isn't one.
8343 return _core_
.Window_GetParent(*args
, **kwargs
)
8345 def GetGrandParent(*args
, **kwargs
):
8347 GetGrandParent(self) -> Window
8349 Returns the parent of the parent of this window, or None if there
8352 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
8354 def IsTopLevel(*args
, **kwargs
):
8356 IsTopLevel(self) -> bool
8358 Returns true if the given window is a top-level one. Currently all
8359 frames and dialogs are always considered to be top-level windows (even
8360 if they have a parent window).
8362 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
8364 def Reparent(*args
, **kwargs
):
8366 Reparent(self, Window newParent) -> bool
8368 Reparents the window, i.e the window will be removed from its current
8369 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8370 re-inserted into another. Available on Windows and GTK. Returns True
8371 if the parent was changed, False otherwise (error or newParent ==
8374 return _core_
.Window_Reparent(*args
, **kwargs
)
8376 def AddChild(*args
, **kwargs
):
8378 AddChild(self, Window child)
8380 Adds a child window. This is called automatically by window creation
8381 functions so should not be required by the application programmer.
8383 return _core_
.Window_AddChild(*args
, **kwargs
)
8385 def RemoveChild(*args
, **kwargs
):
8387 RemoveChild(self, Window child)
8389 Removes a child window. This is called automatically by window
8390 deletion functions so should not be required by the application
8393 return _core_
.Window_RemoveChild(*args
, **kwargs
)
8395 def SetDoubleBuffered(*args
, **kwargs
):
8397 SetDoubleBuffered(self, bool on)
8399 Currently wxGTK2 only.
8401 return _core_
.Window_SetDoubleBuffered(*args
, **kwargs
)
8403 def FindWindowById(*args
, **kwargs
):
8405 FindWindowById(self, long winid) -> Window
8407 Find a chld of this window by window ID
8409 return _core_
.Window_FindWindowById(*args
, **kwargs
)
8411 def FindWindowByName(*args
, **kwargs
):
8413 FindWindowByName(self, String name) -> Window
8415 Find a child of this window by name
8417 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
8419 def GetEventHandler(*args
, **kwargs
):
8421 GetEventHandler(self) -> EvtHandler
8423 Returns the event handler for this window. By default, the window is
8424 its own event handler.
8426 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
8428 def SetEventHandler(*args
, **kwargs
):
8430 SetEventHandler(self, EvtHandler handler)
8432 Sets the event handler for this window. An event handler is an object
8433 that is capable of processing the events sent to a window. By default,
8434 the window is its own event handler, but an application may wish to
8435 substitute another, for example to allow central implementation of
8436 event-handling for a variety of different window classes.
8438 It is usually better to use `wx.Window.PushEventHandler` since this sets
8439 up a chain of event handlers, where an event not handled by one event
8440 handler is handed to the next one in the chain.
8442 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
8444 def PushEventHandler(*args
, **kwargs
):
8446 PushEventHandler(self, EvtHandler handler)
8448 Pushes this event handler onto the event handler stack for the window.
8449 An event handler is an object that is capable of processing the events
8450 sent to a window. By default, the window is its own event handler, but
8451 an application may wish to substitute another, for example to allow
8452 central implementation of event-handling for a variety of different
8455 wx.Window.PushEventHandler allows an application to set up a chain of
8456 event handlers, where an event not handled by one event handler is
8457 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8458 remove the event handler.
8460 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
8462 def PopEventHandler(*args
, **kwargs
):
8464 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8466 Removes and returns the top-most event handler on the event handler
8467 stack. If deleteHandler is True then the wx.EvtHandler object will be
8468 destroyed after it is popped.
8470 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
8472 def RemoveEventHandler(*args
, **kwargs
):
8474 RemoveEventHandler(self, EvtHandler handler) -> bool
8476 Find the given handler in the event handler chain and remove (but not
8477 delete) it from the event handler chain, return True if it was found
8478 and False otherwise (this also results in an assert failure so this
8479 function should only be called when the handler is supposed to be
8482 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
8484 def SetValidator(*args
, **kwargs
):
8486 SetValidator(self, Validator validator)
8488 Deletes the current validator (if any) and sets the window validator,
8489 having called wx.Validator.Clone to create a new validator of this
8492 return _core_
.Window_SetValidator(*args
, **kwargs
)
8494 def GetValidator(*args
, **kwargs
):
8496 GetValidator(self) -> Validator
8498 Returns a pointer to the current validator for the window, or None if
8501 return _core_
.Window_GetValidator(*args
, **kwargs
)
8503 def Validate(*args
, **kwargs
):
8505 Validate(self) -> bool
8507 Validates the current values of the child controls using their
8508 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8509 style flag set, the method will also call Validate() of all child
8510 windows. Returns false if any of the validations failed.
8512 return _core_
.Window_Validate(*args
, **kwargs
)
8514 def TransferDataToWindow(*args
, **kwargs
):
8516 TransferDataToWindow(self) -> bool
8518 Transfers values to child controls from data areas specified by their
8519 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8520 style flag set, the method will also call TransferDataToWindow() of
8523 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
8525 def TransferDataFromWindow(*args
, **kwargs
):
8527 TransferDataFromWindow(self) -> bool
8529 Transfers values from child controls to data areas specified by their
8530 validators. Returns false if a transfer failed. If the window has
8531 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8532 also call TransferDataFromWindow() of all child windows.
8534 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
8536 def InitDialog(*args
, **kwargs
):
8540 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8541 to the dialog via validators.
8543 return _core_
.Window_InitDialog(*args
, **kwargs
)
8545 def SetAcceleratorTable(*args
, **kwargs
):
8547 SetAcceleratorTable(self, AcceleratorTable accel)
8549 Sets the accelerator table for this window.
8551 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
8553 def GetAcceleratorTable(*args
, **kwargs
):
8555 GetAcceleratorTable(self) -> AcceleratorTable
8557 Gets the accelerator table for this window.
8559 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
8561 def RegisterHotKey(*args
, **kwargs
):
8563 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8565 Registers a system wide hotkey. Every time the user presses the hotkey
8566 registered here, this window will receive a hotkey event. It will
8567 receive the event even if the application is in the background and
8568 does not have the input focus because the user is working with some
8569 other application. To bind an event handler function to this hotkey
8570 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8571 hotkey was registered successfully.
8573 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
8575 def UnregisterHotKey(*args
, **kwargs
):
8577 UnregisterHotKey(self, int hotkeyId) -> bool
8579 Unregisters a system wide hotkey.
8581 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
8583 def ConvertDialogPointToPixels(*args
, **kwargs
):
8585 ConvertDialogPointToPixels(self, Point pt) -> Point
8587 Converts a point or size from dialog units to pixels. Dialog units
8588 are used for maintaining a dialog's proportions even if the font
8589 changes. For the x dimension, the dialog units are multiplied by the
8590 average character width and then divided by 4. For the y dimension,
8591 the dialog units are multiplied by the average character height and
8594 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
8596 def ConvertDialogSizeToPixels(*args
, **kwargs
):
8598 ConvertDialogSizeToPixels(self, Size sz) -> Size
8600 Converts a point or size from dialog units to pixels. Dialog units
8601 are used for maintaining a dialog's proportions even if the font
8602 changes. For the x dimension, the dialog units are multiplied by the
8603 average character width and then divided by 4. For the y dimension,
8604 the dialog units are multiplied by the average character height and
8607 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
8609 def DLG_PNT(*args
, **kwargs
):
8611 DLG_PNT(self, Point pt) -> Point
8613 Converts a point or size from dialog units to pixels. Dialog units
8614 are used for maintaining a dialog's proportions even if the font
8615 changes. For the x dimension, the dialog units are multiplied by the
8616 average character width and then divided by 4. For the y dimension,
8617 the dialog units are multiplied by the average character height and
8620 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
8622 def DLG_SZE(*args
, **kwargs
):
8624 DLG_SZE(self, Size sz) -> Size
8626 Converts a point or size from dialog units to pixels. Dialog units
8627 are used for maintaining a dialog's proportions even if the font
8628 changes. For the x dimension, the dialog units are multiplied by the
8629 average character width and then divided by 4. For the y dimension,
8630 the dialog units are multiplied by the average character height and
8633 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
8635 def ConvertPixelPointToDialog(*args
, **kwargs
):
8636 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8637 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
8639 def ConvertPixelSizeToDialog(*args
, **kwargs
):
8640 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8641 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
8643 def WarpPointer(*args
, **kwargs
):
8645 WarpPointer(self, int x, int y)
8647 Moves the pointer to the given position on the window.
8649 NOTE: This function is not supported under Mac because Apple Human
8650 Interface Guidelines forbid moving the mouse cursor programmatically.
8652 return _core_
.Window_WarpPointer(*args
, **kwargs
)
8654 def CaptureMouse(*args
, **kwargs
):
8658 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8659 release the capture.
8661 Note that wxWindows maintains the stack of windows having captured the
8662 mouse and when the mouse is released the capture returns to the window
8663 which had had captured it previously and it is only really released if
8664 there were no previous window. In particular, this means that you must
8665 release the mouse as many times as you capture it.
8667 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
8669 def ReleaseMouse(*args
, **kwargs
):
8673 Releases mouse input captured with wx.Window.CaptureMouse.
8675 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
8677 def GetCapture(*args
, **kwargs
):
8679 GetCapture() -> Window
8681 Returns the window which currently captures the mouse or None
8683 return _core_
.Window_GetCapture(*args
, **kwargs
)
8685 GetCapture
= staticmethod(GetCapture
)
8686 def HasCapture(*args
, **kwargs
):
8688 HasCapture(self) -> bool
8690 Returns true if this window has the current mouse capture.
8692 return _core_
.Window_HasCapture(*args
, **kwargs
)
8694 def Refresh(*args
, **kwargs
):
8696 Refresh(self, bool eraseBackground=True, Rect rect=None)
8698 Mark the specified rectangle (or the whole window) as "dirty" so it
8699 will be repainted. Causes an EVT_PAINT event to be generated and sent
8702 return _core_
.Window_Refresh(*args
, **kwargs
)
8704 def RefreshRect(*args
, **kwargs
):
8706 RefreshRect(self, Rect rect, bool eraseBackground=True)
8708 Redraws the contents of the given rectangle: the area inside it will
8709 be repainted. This is the same as Refresh but has a nicer syntax.
8711 return _core_
.Window_RefreshRect(*args
, **kwargs
)
8713 def Update(*args
, **kwargs
):
8717 Calling this method immediately repaints the invalidated area of the
8718 window instead of waiting for the EVT_PAINT event to happen, (normally
8719 this would usually only happen when the flow of control returns to the
8720 event loop.) Notice that this function doesn't refresh the window and
8721 does nothing if the window has been already repainted. Use Refresh
8722 first if you want to immediately redraw the window (or some portion of
8723 it) unconditionally.
8725 return _core_
.Window_Update(*args
, **kwargs
)
8727 def ClearBackground(*args
, **kwargs
):
8729 ClearBackground(self)
8731 Clears the window by filling it with the current background
8732 colour. Does not cause an erase background event to be generated.
8734 return _core_
.Window_ClearBackground(*args
, **kwargs
)
8736 def Freeze(*args
, **kwargs
):
8740 Freezes the window or, in other words, prevents any updates from
8741 taking place on screen, the window is not redrawn at all. Thaw must be
8742 called to reenable window redrawing. Calls to Freeze/Thaw may be
8743 nested, with the actual Thaw being delayed until all the nesting has
8746 This method is useful for visual appearance optimization (for example,
8747 it is a good idea to use it before inserting large amount of text into
8748 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8749 for all controls so it is mostly just a hint to wxWindows and not a
8750 mandatory directive.
8752 return _core_
.Window_Freeze(*args
, **kwargs
)
8754 def Thaw(*args
, **kwargs
):
8758 Reenables window updating after a previous call to Freeze. Calls to
8759 Freeze/Thaw may be nested, so Thaw must be called the same number of
8760 times that Freeze was before the window will be updated.
8762 return _core_
.Window_Thaw(*args
, **kwargs
)
8764 def PrepareDC(*args
, **kwargs
):
8766 PrepareDC(self, DC dc)
8768 Call this function to prepare the device context for drawing a
8769 scrolled image. It sets the device origin according to the current
8772 return _core_
.Window_PrepareDC(*args
, **kwargs
)
8774 def GetUpdateRegion(*args
, **kwargs
):
8776 GetUpdateRegion(self) -> Region
8778 Returns the region specifying which parts of the window have been
8779 damaged. Should only be called within an EVT_PAINT handler.
8781 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
8783 def GetUpdateClientRect(*args
, **kwargs
):
8785 GetUpdateClientRect(self) -> Rect
8787 Get the update rectangle region bounding box in client coords.
8789 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
8791 def IsExposed(*args
, **kwargs
):
8793 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8795 Returns true if the given point or rectangle area has been exposed
8796 since the last repaint. Call this in an paint event handler to
8797 optimize redrawing by only redrawing those areas, which have been
8800 return _core_
.Window_IsExposed(*args
, **kwargs
)
8802 def IsExposedPoint(*args
, **kwargs
):
8804 IsExposedPoint(self, Point pt) -> bool
8806 Returns true if the given point or rectangle area has been exposed
8807 since the last repaint. Call this in an paint event handler to
8808 optimize redrawing by only redrawing those areas, which have been
8811 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
8813 def IsExposedRect(*args
, **kwargs
):
8815 IsExposedRect(self, Rect rect) -> bool
8817 Returns true if the given point or rectangle area has been exposed
8818 since the last repaint. Call this in an paint event handler to
8819 optimize redrawing by only redrawing those areas, which have been
8822 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
8824 def GetDefaultAttributes(*args
, **kwargs
):
8826 GetDefaultAttributes(self) -> VisualAttributes
8828 Get the default attributes for an instance of this class. This is
8829 useful if you want to use the same font or colour in your own control
8830 as in a standard control -- which is a much better idea than hard
8831 coding specific colours or fonts which might look completely out of
8832 place on the user's system, especially if it uses themes.
8834 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
8836 def GetClassDefaultAttributes(*args
, **kwargs
):
8838 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8840 Get the default attributes for this class. This is useful if you want
8841 to use the same font or colour in your own control as in a standard
8842 control -- which is a much better idea than hard coding specific
8843 colours or fonts which might look completely out of place on the
8844 user's system, especially if it uses themes.
8846 The variant parameter is only relevant under Mac currently and is
8847 ignore under other platforms. Under Mac, it will change the size of
8848 the returned font. See `wx.Window.SetWindowVariant` for more about
8851 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
8853 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
8854 def SetBackgroundColour(*args
, **kwargs
):
8856 SetBackgroundColour(self, Colour colour) -> bool
8858 Sets the background colour of the window. Returns True if the colour
8859 was changed. The background colour is usually painted by the default
8860 EVT_ERASE_BACKGROUND event handler function under Windows and
8861 automatically under GTK. Using `wx.NullColour` will reset the window
8862 to the default background colour.
8864 Note that setting the background colour may not cause an immediate
8865 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8866 calling this function.
8868 Using this function will disable attempts to use themes for this
8869 window, if the system supports them. Use with care since usually the
8870 themes represent the appearance chosen by the user to be used for all
8871 applications on the system.
8873 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
8875 def SetOwnBackgroundColour(*args
, **kwargs
):
8876 """SetOwnBackgroundColour(self, Colour colour)"""
8877 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
8879 def SetForegroundColour(*args
, **kwargs
):
8881 SetForegroundColour(self, Colour colour) -> bool
8883 Sets the foreground colour of the window. Returns True is the colour
8884 was changed. The interpretation of foreground colour is dependent on
8885 the window class; it may be the text colour or other colour, or it may
8888 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
8890 def SetOwnForegroundColour(*args
, **kwargs
):
8891 """SetOwnForegroundColour(self, Colour colour)"""
8892 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
8894 def GetBackgroundColour(*args
, **kwargs
):
8896 GetBackgroundColour(self) -> Colour
8898 Returns the background colour of the window.
8900 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
8902 def GetForegroundColour(*args
, **kwargs
):
8904 GetForegroundColour(self) -> Colour
8906 Returns the foreground colour of the window. The interpretation of
8907 foreground colour is dependent on the window class; it may be the text
8908 colour or other colour, or it may not be used at all.
8910 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
8912 def InheritsBackgroundColour(*args
, **kwargs
):
8913 """InheritsBackgroundColour(self) -> bool"""
8914 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
8916 def UseBgCol(*args
, **kwargs
):
8917 """UseBgCol(self) -> bool"""
8918 return _core_
.Window_UseBgCol(*args
, **kwargs
)
8920 def SetBackgroundStyle(*args
, **kwargs
):
8922 SetBackgroundStyle(self, int style) -> bool
8924 Returns the background style of the window. The background style
8925 indicates how the background of the window is drawn.
8927 ====================== ========================================
8928 wx.BG_STYLE_SYSTEM The background colour or pattern should
8929 be determined by the system
8930 wx.BG_STYLE_COLOUR The background should be a solid colour
8931 wx.BG_STYLE_CUSTOM The background will be implemented by the
8933 ====================== ========================================
8935 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8936 a custom background, such as a tiled bitmap. Currently the style has
8937 no effect on other platforms.
8939 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8941 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
8943 def GetBackgroundStyle(*args
, **kwargs
):
8945 GetBackgroundStyle(self) -> int
8947 Returns the background style of the window.
8949 :see: `SetBackgroundStyle`
8951 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
8953 def HasTransparentBackground(*args
, **kwargs
):
8955 HasTransparentBackground(self) -> bool
8957 Returns True if this window's background is transparent (as, for
8958 example, for `wx.StaticText`) and should show the parent window's
8961 This method is mostly used internally by the library itself and you
8962 normally shouldn't have to call it. You may, however, have to override
8963 it in your custom control classes to ensure that background is painted
8966 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
8968 def SetCursor(*args
, **kwargs
):
8970 SetCursor(self, Cursor cursor) -> bool
8972 Sets the window's cursor. Notice that the window cursor also sets it
8973 for the children of the window implicitly.
8975 The cursor may be wx.NullCursor in which case the window cursor will
8976 be reset back to default.
8978 return _core_
.Window_SetCursor(*args
, **kwargs
)
8980 def GetCursor(*args
, **kwargs
):
8982 GetCursor(self) -> Cursor
8984 Return the cursor associated with this window.
8986 return _core_
.Window_GetCursor(*args
, **kwargs
)
8988 def SetFont(*args
, **kwargs
):
8990 SetFont(self, Font font) -> bool
8992 Sets the font for this window.
8994 return _core_
.Window_SetFont(*args
, **kwargs
)
8996 def SetOwnFont(*args
, **kwargs
):
8997 """SetOwnFont(self, Font font)"""
8998 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9000 def GetFont(*args
, **kwargs
):
9002 GetFont(self) -> Font
9004 Returns the default font used for this window.
9006 return _core_
.Window_GetFont(*args
, **kwargs
)
9008 def SetCaret(*args
, **kwargs
):
9010 SetCaret(self, Caret caret)
9012 Sets the caret associated with the window.
9014 return _core_
.Window_SetCaret(*args
, **kwargs
)
9016 def GetCaret(*args
, **kwargs
):
9018 GetCaret(self) -> Caret
9020 Returns the caret associated with the window.
9022 return _core_
.Window_GetCaret(*args
, **kwargs
)
9024 def GetCharHeight(*args
, **kwargs
):
9026 GetCharHeight(self) -> int
9028 Get the (average) character size for the current font.
9030 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9032 def GetCharWidth(*args
, **kwargs
):
9034 GetCharWidth(self) -> int
9036 Get the (average) character size for the current font.
9038 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9040 def GetTextExtent(*args
, **kwargs
):
9042 GetTextExtent(String string) -> (width, height)
9044 Get the width and height of the text using the current font.
9046 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9048 def GetFullTextExtent(*args
, **kwargs
):
9050 GetFullTextExtent(String string, Font font=None) ->
9051 (width, height, descent, externalLeading)
9053 Get the width, height, decent and leading of the text using the
9054 current or specified font.
9056 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9058 def ClientToScreenXY(*args
, **kwargs
):
9060 ClientToScreenXY(int x, int y) -> (x,y)
9062 Converts to screen coordinates from coordinates relative to this window.
9064 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9066 def ScreenToClientXY(*args
, **kwargs
):
9068 ScreenToClientXY(int x, int y) -> (x,y)
9070 Converts from screen to client window coordinates.
9072 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9074 def ClientToScreen(*args
, **kwargs
):
9076 ClientToScreen(self, Point pt) -> Point
9078 Converts to screen coordinates from coordinates relative to this window.
9080 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9082 def ScreenToClient(*args
, **kwargs
):
9084 ScreenToClient(self, Point pt) -> Point
9086 Converts from screen to client window coordinates.
9088 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9090 def HitTestXY(*args
, **kwargs
):
9092 HitTestXY(self, int x, int y) -> int
9094 Test where the given (in client coords) point lies
9096 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9098 def HitTest(*args
, **kwargs
):
9100 HitTest(self, Point pt) -> int
9102 Test where the given (in client coords) point lies
9104 return _core_
.Window_HitTest(*args
, **kwargs
)
9106 def GetBorder(*args
):
9108 GetBorder(self, long flags) -> int
9109 GetBorder(self) -> int
9111 Get border for the flags of this window
9113 return _core_
.Window_GetBorder(*args
)
9115 def UpdateWindowUI(*args
, **kwargs
):
9117 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9119 This function sends EVT_UPDATE_UI events to the window. The particular
9120 implementation depends on the window; for example a wx.ToolBar will
9121 send an update UI event for each toolbar button, and a wx.Frame will
9122 send an update UI event for each menubar menu item. You can call this
9123 function from your application to ensure that your UI is up-to-date at
9124 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9125 concerned). This may be necessary if you have called
9126 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9127 limit the overhead that wxWindows incurs by sending update UI events
9130 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9132 def PopupMenuXY(*args
, **kwargs
):
9134 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9136 Pops up the given menu at the specified coordinates, relative to this window,
9137 and returns control when the user has dismissed the menu. If a menu item is
9138 selected, the corresponding menu event is generated and will be processed as
9139 usual. If the default position is given then the current position of the
9140 mouse cursor will be used.
9142 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9144 def PopupMenu(*args
, **kwargs
):
9146 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9148 Pops up the given menu at the specified coordinates, relative to this window,
9149 and returns control when the user has dismissed the menu. If a menu item is
9150 selected, the corresponding menu event is generated and will be processed as
9151 usual. If the default position is given then the current position of the
9152 mouse cursor will be used.
9154 return _core_
.Window_PopupMenu(*args
, **kwargs
)
9156 def GetHandle(*args
, **kwargs
):
9158 GetHandle(self) -> long
9160 Returns the platform-specific handle (as a long integer) of the
9161 physical window. Currently on wxMac it returns the handle of the
9162 toplevel parent of the window.
9164 return _core_
.Window_GetHandle(*args
, **kwargs
)
9166 def AssociateHandle(*args
, **kwargs
):
9168 AssociateHandle(self, long handle)
9170 Associate the window with a new native handle
9172 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
9174 def DissociateHandle(*args
, **kwargs
):
9176 DissociateHandle(self)
9178 Dissociate the current native handle from the window
9180 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
9182 def HasScrollbar(*args
, **kwargs
):
9184 HasScrollbar(self, int orient) -> bool
9186 Does the window have the scrollbar for this orientation?
9188 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
9190 def SetScrollbar(*args
, **kwargs
):
9192 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9195 Sets the scrollbar properties of a built-in scrollbar.
9197 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
9199 def SetScrollPos(*args
, **kwargs
):
9201 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9203 Sets the position of one of the built-in scrollbars.
9205 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
9207 def GetScrollPos(*args
, **kwargs
):
9209 GetScrollPos(self, int orientation) -> int
9211 Returns the built-in scrollbar position.
9213 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
9215 def GetScrollThumb(*args
, **kwargs
):
9217 GetScrollThumb(self, int orientation) -> int
9219 Returns the built-in scrollbar thumb size.
9221 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
9223 def GetScrollRange(*args
, **kwargs
):
9225 GetScrollRange(self, int orientation) -> int
9227 Returns the built-in scrollbar range.
9229 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
9231 def ScrollWindow(*args
, **kwargs
):
9233 ScrollWindow(self, int dx, int dy, Rect rect=None)
9235 Physically scrolls the pixels in the window and move child windows
9236 accordingly. Use this function to optimise your scrolling
9237 implementations, to minimise the area that must be redrawn. Note that
9238 it is rarely required to call this function from a user program.
9240 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
9242 def ScrollLines(*args
, **kwargs
):
9244 ScrollLines(self, int lines) -> bool
9246 If the platform and window class supports it, scrolls the window by
9247 the given number of lines down, if lines is positive, or up if lines
9248 is negative. Returns True if the window was scrolled, False if it was
9249 already on top/bottom and nothing was done.
9251 return _core_
.Window_ScrollLines(*args
, **kwargs
)
9253 def ScrollPages(*args
, **kwargs
):
9255 ScrollPages(self, int pages) -> bool
9257 If the platform and window class supports it, scrolls the window by
9258 the given number of pages down, if pages is positive, or up if pages
9259 is negative. Returns True if the window was scrolled, False if it was
9260 already on top/bottom and nothing was done.
9262 return _core_
.Window_ScrollPages(*args
, **kwargs
)
9264 def LineUp(*args
, **kwargs
):
9266 LineUp(self) -> bool
9268 This is just a wrapper for ScrollLines(-1).
9270 return _core_
.Window_LineUp(*args
, **kwargs
)
9272 def LineDown(*args
, **kwargs
):
9274 LineDown(self) -> bool
9276 This is just a wrapper for ScrollLines(1).
9278 return _core_
.Window_LineDown(*args
, **kwargs
)
9280 def PageUp(*args
, **kwargs
):
9282 PageUp(self) -> bool
9284 This is just a wrapper for ScrollPages(-1).
9286 return _core_
.Window_PageUp(*args
, **kwargs
)
9288 def PageDown(*args
, **kwargs
):
9290 PageDown(self) -> bool
9292 This is just a wrapper for ScrollPages(1).
9294 return _core_
.Window_PageDown(*args
, **kwargs
)
9296 def SetHelpText(*args
, **kwargs
):
9298 SetHelpText(self, String text)
9300 Sets the help text to be used as context-sensitive help for this
9301 window. Note that the text is actually stored by the current
9302 `wx.HelpProvider` implementation, and not in the window object itself.
9304 return _core_
.Window_SetHelpText(*args
, **kwargs
)
9306 def SetHelpTextForId(*args
, **kwargs
):
9308 SetHelpTextForId(self, String text)
9310 Associate this help text with all windows with the same id as this
9313 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
9315 def GetHelpText(*args
, **kwargs
):
9317 GetHelpText(self) -> String
9319 Gets the help text to be used as context-sensitive help for this
9320 window. Note that the text is actually stored by the current
9321 `wx.HelpProvider` implementation, and not in the window object itself.
9323 return _core_
.Window_GetHelpText(*args
, **kwargs
)
9325 def SetToolTipString(*args
, **kwargs
):
9327 SetToolTipString(self, String tip)
9329 Attach a tooltip to the window.
9331 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
9333 def SetToolTip(*args
, **kwargs
):
9335 SetToolTip(self, ToolTip tip)
9337 Attach a tooltip to the window.
9339 return _core_
.Window_SetToolTip(*args
, **kwargs
)
9341 def GetToolTip(*args
, **kwargs
):
9343 GetToolTip(self) -> ToolTip
9345 get the associated tooltip or None if none
9347 return _core_
.Window_GetToolTip(*args
, **kwargs
)
9349 def SetDropTarget(*args
, **kwargs
):
9351 SetDropTarget(self, DropTarget dropTarget)
9353 Associates a drop target with this window. If the window already has
9354 a drop target, it is deleted.
9356 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
9358 def GetDropTarget(*args
, **kwargs
):
9360 GetDropTarget(self) -> DropTarget
9362 Returns the associated drop target, which may be None.
9364 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
9366 def DragAcceptFiles(*args
, **kwargs
):
9368 DragAcceptFiles(self, bool accept)
9370 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9371 Only functional on Windows.
9373 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
9375 def SetConstraints(*args
, **kwargs
):
9377 SetConstraints(self, LayoutConstraints constraints)
9379 Sets the window to have the given layout constraints. If an existing
9380 layout constraints object is already owned by the window, it will be
9381 deleted. Pass None to disassociate and delete the window's current
9384 You must call SetAutoLayout to tell a window to use the constraints
9385 automatically in its default EVT_SIZE handler; otherwise, you must
9386 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9387 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9390 return _core_
.Window_SetConstraints(*args
, **kwargs
)
9392 def GetConstraints(*args
, **kwargs
):
9394 GetConstraints(self) -> LayoutConstraints
9396 Returns a pointer to the window's layout constraints, or None if there
9399 return _core_
.Window_GetConstraints(*args
, **kwargs
)
9401 def SetAutoLayout(*args
, **kwargs
):
9403 SetAutoLayout(self, bool autoLayout)
9405 Determines whether the Layout function will be called automatically
9406 when the window is resized. lease note that this only happens for the
9407 windows usually used to contain children, namely `wx.Panel` and
9408 `wx.TopLevelWindow` (and the classes deriving from them).
9410 This method is called implicitly by `SetSizer` but if you use
9411 `SetConstraints` you should call it manually or otherwise the window
9412 layout won't be correctly updated when its size changes.
9414 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
9416 def GetAutoLayout(*args
, **kwargs
):
9418 GetAutoLayout(self) -> bool
9420 Returns the current autoLayout setting
9422 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
9424 def Layout(*args
, **kwargs
):
9426 Layout(self) -> bool
9428 Invokes the constraint-based layout algorithm or the sizer-based
9429 algorithm for this window. See SetAutoLayout: when auto layout is on,
9430 this function gets called automatically by the default EVT_SIZE
9431 handler when the window is resized.
9433 return _core_
.Window_Layout(*args
, **kwargs
)
9435 def SetSizer(*args
, **kwargs
):
9437 SetSizer(self, Sizer sizer, bool deleteOld=True)
9439 Sets the window to have the given layout sizer. The window will then
9440 own the object, and will take care of its deletion. If an existing
9441 layout sizer object is already owned by the window, it will be deleted
9442 if the deleteOld parameter is true. Note that this function will also
9443 call SetAutoLayout implicitly with a True parameter if the sizer is
9444 non-None, and False otherwise.
9446 return _core_
.Window_SetSizer(*args
, **kwargs
)
9448 def SetSizerAndFit(*args
, **kwargs
):
9450 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9452 The same as SetSizer, except it also sets the size hints for the
9453 window based on the sizer's minimum size.
9455 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
9457 def GetSizer(*args
, **kwargs
):
9459 GetSizer(self) -> Sizer
9461 Return the sizer associated with the window by a previous call to
9462 SetSizer or None if there isn't one.
9464 return _core_
.Window_GetSizer(*args
, **kwargs
)
9466 def SetContainingSizer(*args
, **kwargs
):
9468 SetContainingSizer(self, Sizer sizer)
9470 This normally does not need to be called by application code. It is
9471 called internally when a window is added to a sizer, and is used so
9472 the window can remove itself from the sizer when it is destroyed.
9474 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
9476 def GetContainingSizer(*args
, **kwargs
):
9478 GetContainingSizer(self) -> Sizer
9480 Return the sizer that this window is a member of, if any, otherwise None.
9482 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
9484 def InheritAttributes(*args
, **kwargs
):
9486 InheritAttributes(self)
9488 This function is (or should be, in case of custom controls) called
9489 during window creation to intelligently set up the window visual
9490 attributes, that is the font and the foreground and background
9493 By 'intelligently' the following is meant: by default, all windows use
9494 their own default attributes. However if some of the parent's
9495 attributes are explicitly changed (that is, using SetFont and not
9496 SetOwnFont) and if the corresponding attribute hadn't been
9497 explicitly set for this window itself, then this window takes the same
9498 value as used by the parent. In addition, if the window overrides
9499 ShouldInheritColours to return false, the colours will not be changed
9500 no matter what and only the font might.
9502 This rather complicated logic is necessary in order to accommodate the
9503 different usage scenarios. The most common one is when all default
9504 attributes are used and in this case, nothing should be inherited as
9505 in modern GUIs different controls use different fonts (and colours)
9506 than their siblings so they can't inherit the same value from the
9507 parent. However it was also deemed desirable to allow to simply change
9508 the attributes of all children at once by just changing the font or
9509 colour of their common parent, hence in this case we do inherit the
9513 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
9515 def ShouldInheritColours(*args
, **kwargs
):
9517 ShouldInheritColours(self) -> bool
9519 Return true from here to allow the colours of this window to be
9520 changed by InheritAttributes, returning false forbids inheriting them
9521 from the parent window.
9523 The base class version returns false, but this method is overridden in
9524 wxControl where it returns true.
9526 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
9528 def PostCreate(self
, pre
):
9530 Phase 3 of the 2-phase create <wink!>
9531 Call this method after precreating the window with the 2-phase create method.
9533 self
.this
= pre
.this
9534 self
.thisown
= pre
.thisown
9536 if hasattr(self
, '_setOORInfo'):
9537 self
._setOORInfo
(self
)
9538 if hasattr(self
, '_setCallbackInfo'):
9539 self
._setCallbackInfo
(self
, self
.__class
__)
9541 def SendSizeEvent(self
):
9542 self
.GetEventhandler().ProcessEvent(wx
.SizeEvent((-1,-1)))
9544 _core_
.Window_swigregister(Window
)
9546 def PreWindow(*args
, **kwargs
):
9548 PreWindow() -> Window
9550 Precreate a Window for 2-phase creation.
9552 val
= _core_
.new_PreWindow(*args
, **kwargs
)
9555 def Window_NewControlId(*args
):
9557 Window_NewControlId() -> int
9559 Generate a control id for the controls which were not given one.
9561 return _core_
.Window_NewControlId(*args
)
9563 def Window_NextControlId(*args
, **kwargs
):
9565 Window_NextControlId(int winid) -> int
9567 Get the id of the control following the one with the given
9570 return _core_
.Window_NextControlId(*args
, **kwargs
)
9572 def Window_PrevControlId(*args
, **kwargs
):
9574 Window_PrevControlId(int winid) -> int
9576 Get the id of the control preceding the one with the given
9579 return _core_
.Window_PrevControlId(*args
, **kwargs
)
9581 def Window_FindFocus(*args
):
9583 Window_FindFocus() -> Window
9585 Returns the window or control that currently has the keyboard focus,
9588 return _core_
.Window_FindFocus(*args
)
9590 def Window_GetCapture(*args
):
9592 Window_GetCapture() -> Window
9594 Returns the window which currently captures the mouse or None
9596 return _core_
.Window_GetCapture(*args
)
9598 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
9600 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9602 Get the default attributes for this class. This is useful if you want
9603 to use the same font or colour in your own control as in a standard
9604 control -- which is a much better idea than hard coding specific
9605 colours or fonts which might look completely out of place on the
9606 user's system, especially if it uses themes.
9608 The variant parameter is only relevant under Mac currently and is
9609 ignore under other platforms. Under Mac, it will change the size of
9610 the returned font. See `wx.Window.SetWindowVariant` for more about
9613 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9615 def DLG_PNT(win
, point_or_x
, y
=None):
9617 Convenience function for converting a Point or (x,y) in
9618 dialog units to pixel units.
9621 return win
.ConvertDialogPointToPixels(point_or_x
)
9623 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
9625 def DLG_SZE(win
, size_width
, height
=None):
9627 Convenience function for converting a Size or (w,h) in
9628 dialog units to pixel units.
9631 return win
.ConvertDialogSizeToPixels(size_width
)
9633 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
9636 def FindWindowById(*args
, **kwargs
):
9638 FindWindowById(long id, Window parent=None) -> Window
9640 Find the first window in the application with the given id. If parent
9641 is None, the search will start from all top-level frames and dialog
9642 boxes; if non-None, the search will be limited to the given window
9643 hierarchy. The search is recursive in both cases.
9645 return _core_
.FindWindowById(*args
, **kwargs
)
9647 def FindWindowByName(*args
, **kwargs
):
9649 FindWindowByName(String name, Window parent=None) -> Window
9651 Find a window by its name (as given in a window constructor or Create
9652 function call). If parent is None, the search will start from all
9653 top-level frames and dialog boxes; if non-None, the search will be
9654 limited to the given window hierarchy. The search is recursive in both
9657 If no window with such name is found, wx.FindWindowByLabel is called.
9659 return _core_
.FindWindowByName(*args
, **kwargs
)
9661 def FindWindowByLabel(*args
, **kwargs
):
9663 FindWindowByLabel(String label, Window parent=None) -> Window
9665 Find a window by its label. Depending on the type of window, the label
9666 may be a window title or panel item label. If parent is None, the
9667 search will start from all top-level frames and dialog boxes; if
9668 non-None, the search will be limited to the given window
9669 hierarchy. The search is recursive in both cases.
9671 return _core_
.FindWindowByLabel(*args
, **kwargs
)
9673 def Window_FromHWND(*args
, **kwargs
):
9674 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9675 return _core_
.Window_FromHWND(*args
, **kwargs
)
9677 def GetTopLevelWindows(*args
):
9679 GetTopLevelWindows() -> PyObject
9681 Returns a list of the the application's top-level windows, (frames,
9682 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9683 by wxWidgets, and so it is only valid as long as no top-level windows
9684 are closed or new top-level windows are created.
9687 return _core_
.GetTopLevelWindows(*args
)
9688 #---------------------------------------------------------------------------
9690 class Validator(EvtHandler
):
9691 """Proxy of C++ Validator class"""
9692 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9693 __repr__
= _swig_repr
9694 def __init__(self
, *args
, **kwargs
):
9695 """__init__(self) -> Validator"""
9696 _core_
.Validator_swiginit(self
,_core_
.new_Validator(*args
, **kwargs
))
9697 self
._setOORInfo
(self
)
9699 def Clone(*args
, **kwargs
):
9700 """Clone(self) -> Validator"""
9701 return _core_
.Validator_Clone(*args
, **kwargs
)
9703 def Validate(*args
, **kwargs
):
9704 """Validate(self, Window parent) -> bool"""
9705 return _core_
.Validator_Validate(*args
, **kwargs
)
9707 def TransferToWindow(*args
, **kwargs
):
9708 """TransferToWindow(self) -> bool"""
9709 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
9711 def TransferFromWindow(*args
, **kwargs
):
9712 """TransferFromWindow(self) -> bool"""
9713 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
9715 def GetWindow(*args
, **kwargs
):
9716 """GetWindow(self) -> Window"""
9717 return _core_
.Validator_GetWindow(*args
, **kwargs
)
9719 def SetWindow(*args
, **kwargs
):
9720 """SetWindow(self, Window window)"""
9721 return _core_
.Validator_SetWindow(*args
, **kwargs
)
9723 def IsSilent(*args
, **kwargs
):
9724 """IsSilent() -> bool"""
9725 return _core_
.Validator_IsSilent(*args
, **kwargs
)
9727 IsSilent
= staticmethod(IsSilent
)
9728 def SetBellOnError(*args
, **kwargs
):
9729 """SetBellOnError(int doIt=True)"""
9730 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
9732 SetBellOnError
= staticmethod(SetBellOnError
)
9733 _core_
.Validator_swigregister(Validator
)
9735 def Validator_IsSilent(*args
):
9736 """Validator_IsSilent() -> bool"""
9737 return _core_
.Validator_IsSilent(*args
)
9739 def Validator_SetBellOnError(*args
, **kwargs
):
9740 """Validator_SetBellOnError(int doIt=True)"""
9741 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
9743 class PyValidator(Validator
):
9744 """Proxy of C++ PyValidator class"""
9745 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9746 __repr__
= _swig_repr
9747 def __init__(self
, *args
, **kwargs
):
9748 """__init__(self) -> PyValidator"""
9749 _core_
.PyValidator_swiginit(self
,_core_
.new_PyValidator(*args
, **kwargs
))
9751 self
._setCallbackInfo
(self
, PyValidator
, 1)
9752 self
._setOORInfo
(self
)
9754 def _setCallbackInfo(*args
, **kwargs
):
9755 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9756 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
9758 _core_
.PyValidator_swigregister(PyValidator
)
9760 #---------------------------------------------------------------------------
9762 class Menu(EvtHandler
):
9763 """Proxy of C++ Menu class"""
9764 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
9765 __repr__
= _swig_repr
9766 def __init__(self
, *args
, **kwargs
):
9767 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9768 _core_
.Menu_swiginit(self
,_core_
.new_Menu(*args
, **kwargs
))
9769 self
._setOORInfo
(self
)
9771 def Append(*args
, **kwargs
):
9772 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9773 return _core_
.Menu_Append(*args
, **kwargs
)
9775 def AppendSeparator(*args
, **kwargs
):
9776 """AppendSeparator(self) -> MenuItem"""
9777 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
9779 def AppendCheckItem(*args
, **kwargs
):
9780 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9781 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
9783 def AppendRadioItem(*args
, **kwargs
):
9784 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9785 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
9787 def AppendMenu(*args
, **kwargs
):
9788 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9789 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
9791 def AppendSubMenu(*args
, **kwargs
):
9792 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9793 return _core_
.Menu_AppendSubMenu(*args
, **kwargs
)
9795 def AppendItem(*args
, **kwargs
):
9796 """AppendItem(self, MenuItem item) -> MenuItem"""
9797 return _core_
.Menu_AppendItem(*args
, **kwargs
)
9799 def InsertItem(*args
, **kwargs
):
9800 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9801 return _core_
.Menu_InsertItem(*args
, **kwargs
)
9803 def PrependItem(*args
, **kwargs
):
9804 """PrependItem(self, MenuItem item) -> MenuItem"""
9805 return _core_
.Menu_PrependItem(*args
, **kwargs
)
9807 def Break(*args
, **kwargs
):
9809 return _core_
.Menu_Break(*args
, **kwargs
)
9811 def Insert(*args
, **kwargs
):
9813 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9814 int kind=ITEM_NORMAL) -> MenuItem
9816 return _core_
.Menu_Insert(*args
, **kwargs
)
9818 def InsertSeparator(*args
, **kwargs
):
9819 """InsertSeparator(self, size_t pos) -> MenuItem"""
9820 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
9822 def InsertCheckItem(*args
, **kwargs
):
9823 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9824 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
9826 def InsertRadioItem(*args
, **kwargs
):
9827 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9828 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
9830 def InsertMenu(*args
, **kwargs
):
9831 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9832 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
9834 def Prepend(*args
, **kwargs
):
9835 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9836 return _core_
.Menu_Prepend(*args
, **kwargs
)
9838 def PrependSeparator(*args
, **kwargs
):
9839 """PrependSeparator(self) -> MenuItem"""
9840 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
9842 def PrependCheckItem(*args
, **kwargs
):
9843 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9844 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
9846 def PrependRadioItem(*args
, **kwargs
):
9847 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9848 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
9850 def PrependMenu(*args
, **kwargs
):
9851 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9852 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
9854 def Remove(*args
, **kwargs
):
9855 """Remove(self, int id) -> MenuItem"""
9856 return _core_
.Menu_Remove(*args
, **kwargs
)
9858 def RemoveItem(*args
, **kwargs
):
9859 """RemoveItem(self, MenuItem item) -> MenuItem"""
9860 return _core_
.Menu_RemoveItem(*args
, **kwargs
)
9862 def Delete(*args
, **kwargs
):
9863 """Delete(self, int id) -> bool"""
9864 return _core_
.Menu_Delete(*args
, **kwargs
)
9866 def DeleteItem(*args
, **kwargs
):
9867 """DeleteItem(self, MenuItem item) -> bool"""
9868 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
9870 def Destroy(*args
, **kwargs
):
9874 Deletes the C++ object this Python object is a proxy for.
9876 val
= _core_
.Menu_Destroy(*args
, **kwargs
)
9880 def DestroyId(*args
, **kwargs
):
9882 DestroyId(self, int id) -> bool
9884 Deletes the C++ object this Python object is a proxy for.
9886 val
= _core_
.Menu_DestroyId(*args
, **kwargs
)
9890 def DestroyItem(*args
, **kwargs
):
9892 DestroyItem(self, MenuItem item) -> bool
9894 Deletes the C++ object this Python object is a proxy for.
9896 val
= _core_
.Menu_DestroyItem(*args
, **kwargs
)
9900 def GetMenuItemCount(*args
, **kwargs
):
9901 """GetMenuItemCount(self) -> size_t"""
9902 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
9904 def GetMenuItems(*args
, **kwargs
):
9905 """GetMenuItems(self) -> PyObject"""
9906 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
9908 def FindItem(*args
, **kwargs
):
9909 """FindItem(self, String item) -> int"""
9910 return _core_
.Menu_FindItem(*args
, **kwargs
)
9912 def FindItemById(*args
, **kwargs
):
9913 """FindItemById(self, int id) -> MenuItem"""
9914 return _core_
.Menu_FindItemById(*args
, **kwargs
)
9916 def FindItemByPosition(*args
, **kwargs
):
9917 """FindItemByPosition(self, size_t position) -> MenuItem"""
9918 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
9920 def Enable(*args
, **kwargs
):
9921 """Enable(self, int id, bool enable)"""
9922 return _core_
.Menu_Enable(*args
, **kwargs
)
9924 def IsEnabled(*args
, **kwargs
):
9925 """IsEnabled(self, int id) -> bool"""
9926 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
9928 def Check(*args
, **kwargs
):
9929 """Check(self, int id, bool check)"""
9930 return _core_
.Menu_Check(*args
, **kwargs
)
9932 def IsChecked(*args
, **kwargs
):
9933 """IsChecked(self, int id) -> bool"""
9934 return _core_
.Menu_IsChecked(*args
, **kwargs
)
9936 def SetLabel(*args
, **kwargs
):
9937 """SetLabel(self, int id, String label)"""
9938 return _core_
.Menu_SetLabel(*args
, **kwargs
)
9940 def GetLabel(*args
, **kwargs
):
9941 """GetLabel(self, int id) -> String"""
9942 return _core_
.Menu_GetLabel(*args
, **kwargs
)
9944 def SetHelpString(*args
, **kwargs
):
9945 """SetHelpString(self, int id, String helpString)"""
9946 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
9948 def GetHelpString(*args
, **kwargs
):
9949 """GetHelpString(self, int id) -> String"""
9950 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
9952 def SetTitle(*args
, **kwargs
):
9953 """SetTitle(self, String title)"""
9954 return _core_
.Menu_SetTitle(*args
, **kwargs
)
9956 def GetTitle(*args
, **kwargs
):
9957 """GetTitle(self) -> String"""
9958 return _core_
.Menu_GetTitle(*args
, **kwargs
)
9960 def SetEventHandler(*args
, **kwargs
):
9961 """SetEventHandler(self, EvtHandler handler)"""
9962 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
9964 def GetEventHandler(*args
, **kwargs
):
9965 """GetEventHandler(self) -> EvtHandler"""
9966 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
9968 def SetInvokingWindow(*args
, **kwargs
):
9969 """SetInvokingWindow(self, Window win)"""
9970 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
9972 def GetInvokingWindow(*args
, **kwargs
):
9973 """GetInvokingWindow(self) -> Window"""
9974 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
9976 def GetStyle(*args
, **kwargs
):
9977 """GetStyle(self) -> long"""
9978 return _core_
.Menu_GetStyle(*args
, **kwargs
)
9980 def UpdateUI(*args
, **kwargs
):
9981 """UpdateUI(self, EvtHandler source=None)"""
9982 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
9984 def GetMenuBar(*args
, **kwargs
):
9985 """GetMenuBar(self) -> MenuBar"""
9986 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
9988 def Attach(*args
, **kwargs
):
9989 """Attach(self, wxMenuBarBase menubar)"""
9990 return _core_
.Menu_Attach(*args
, **kwargs
)
9992 def Detach(*args
, **kwargs
):
9994 return _core_
.Menu_Detach(*args
, **kwargs
)
9996 def IsAttached(*args
, **kwargs
):
9997 """IsAttached(self) -> bool"""
9998 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10000 def SetParent(*args
, **kwargs
):
10001 """SetParent(self, Menu parent)"""
10002 return _core_
.Menu_SetParent(*args
, **kwargs
)
10004 def GetParent(*args
, **kwargs
):
10005 """GetParent(self) -> Menu"""
10006 return _core_
.Menu_GetParent(*args
, **kwargs
)
10008 _core_
.Menu_swigregister(Menu
)
10009 DefaultValidator
= cvar
.DefaultValidator
10011 #---------------------------------------------------------------------------
10013 class MenuBar(Window
):
10014 """Proxy of C++ MenuBar class"""
10015 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10016 __repr__
= _swig_repr
10017 def __init__(self
, *args
, **kwargs
):
10018 """__init__(self, long style=0) -> MenuBar"""
10019 _core_
.MenuBar_swiginit(self
,_core_
.new_MenuBar(*args
, **kwargs
))
10020 self
._setOORInfo
(self
)
10022 def Append(*args
, **kwargs
):
10023 """Append(self, Menu menu, String title) -> bool"""
10024 return _core_
.MenuBar_Append(*args
, **kwargs
)
10026 def Insert(*args
, **kwargs
):
10027 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10028 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10030 def GetMenuCount(*args
, **kwargs
):
10031 """GetMenuCount(self) -> size_t"""
10032 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
10034 def GetMenu(*args
, **kwargs
):
10035 """GetMenu(self, size_t pos) -> Menu"""
10036 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
10038 def Replace(*args
, **kwargs
):
10039 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10040 return _core_
.MenuBar_Replace(*args
, **kwargs
)
10042 def Remove(*args
, **kwargs
):
10043 """Remove(self, size_t pos) -> Menu"""
10044 return _core_
.MenuBar_Remove(*args
, **kwargs
)
10046 def EnableTop(*args
, **kwargs
):
10047 """EnableTop(self, size_t pos, bool enable)"""
10048 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
10050 def IsEnabledTop(*args
, **kwargs
):
10051 """IsEnabledTop(self, size_t pos) -> bool"""
10052 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
10054 def SetLabelTop(*args
, **kwargs
):
10055 """SetLabelTop(self, size_t pos, String label)"""
10056 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
10058 def GetLabelTop(*args
, **kwargs
):
10059 """GetLabelTop(self, size_t pos) -> String"""
10060 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
10062 def FindMenuItem(*args
, **kwargs
):
10063 """FindMenuItem(self, String menu, String item) -> int"""
10064 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
10066 def FindItemById(*args
, **kwargs
):
10067 """FindItemById(self, int id) -> MenuItem"""
10068 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
10070 def FindMenu(*args
, **kwargs
):
10071 """FindMenu(self, String title) -> int"""
10072 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
10074 def Enable(*args
, **kwargs
):
10075 """Enable(self, int id, bool enable)"""
10076 return _core_
.MenuBar_Enable(*args
, **kwargs
)
10078 def Check(*args
, **kwargs
):
10079 """Check(self, int id, bool check)"""
10080 return _core_
.MenuBar_Check(*args
, **kwargs
)
10082 def IsChecked(*args
, **kwargs
):
10083 """IsChecked(self, int id) -> bool"""
10084 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
10086 def IsEnabled(*args
, **kwargs
):
10087 """IsEnabled(self, int id) -> bool"""
10088 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
10090 def SetLabel(*args
, **kwargs
):
10091 """SetLabel(self, int id, String label)"""
10092 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
10094 def GetLabel(*args
, **kwargs
):
10095 """GetLabel(self, int id) -> String"""
10096 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
10098 def SetHelpString(*args
, **kwargs
):
10099 """SetHelpString(self, int id, String helpString)"""
10100 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
10102 def GetHelpString(*args
, **kwargs
):
10103 """GetHelpString(self, int id) -> String"""
10104 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
10106 def GetFrame(*args
, **kwargs
):
10107 """GetFrame(self) -> wxFrame"""
10108 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
10110 def IsAttached(*args
, **kwargs
):
10111 """IsAttached(self) -> bool"""
10112 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
10114 def Attach(*args
, **kwargs
):
10115 """Attach(self, wxFrame frame)"""
10116 return _core_
.MenuBar_Attach(*args
, **kwargs
)
10118 def Detach(*args
, **kwargs
):
10120 return _core_
.MenuBar_Detach(*args
, **kwargs
)
10122 def SetAutoWindowMenu(*args
, **kwargs
):
10123 """SetAutoWindowMenu(bool enable)"""
10124 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10126 SetAutoWindowMenu
= staticmethod(SetAutoWindowMenu
)
10127 def GetAutoWindowMenu(*args
, **kwargs
):
10128 """GetAutoWindowMenu() -> bool"""
10129 return _core_
.MenuBar_GetAutoWindowMenu(*args
, **kwargs
)
10131 GetAutoWindowMenu
= staticmethod(GetAutoWindowMenu
)
10132 _core_
.MenuBar_swigregister(MenuBar
)
10134 def MenuBar_SetAutoWindowMenu(*args
, **kwargs
):
10135 """MenuBar_SetAutoWindowMenu(bool enable)"""
10136 return _core_
.MenuBar_SetAutoWindowMenu(*args
, **kwargs
)
10138 def MenuBar_GetAutoWindowMenu(*args
):
10139 """MenuBar_GetAutoWindowMenu() -> bool"""
10140 return _core_
.MenuBar_GetAutoWindowMenu(*args
)
10142 #---------------------------------------------------------------------------
10144 class MenuItem(Object
):
10145 """Proxy of C++ MenuItem class"""
10146 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10147 __repr__
= _swig_repr
10148 def __init__(self
, *args
, **kwargs
):
10150 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10151 String help=EmptyString, int kind=ITEM_NORMAL,
10152 Menu subMenu=None) -> MenuItem
10154 _core_
.MenuItem_swiginit(self
,_core_
.new_MenuItem(*args
, **kwargs
))
10155 __swig_destroy__
= _core_
.delete_MenuItem
10156 __del__
= lambda self
: None;
10157 def GetMenu(*args
, **kwargs
):
10158 """GetMenu(self) -> Menu"""
10159 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
10161 def SetMenu(*args
, **kwargs
):
10162 """SetMenu(self, Menu menu)"""
10163 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
10165 def SetId(*args
, **kwargs
):
10166 """SetId(self, int id)"""
10167 return _core_
.MenuItem_SetId(*args
, **kwargs
)
10169 def GetId(*args
, **kwargs
):
10170 """GetId(self) -> int"""
10171 return _core_
.MenuItem_GetId(*args
, **kwargs
)
10173 def IsSeparator(*args
, **kwargs
):
10174 """IsSeparator(self) -> bool"""
10175 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
10177 def SetText(*args
, **kwargs
):
10178 """SetText(self, String str)"""
10179 return _core_
.MenuItem_SetText(*args
, **kwargs
)
10181 def GetLabel(*args
, **kwargs
):
10182 """GetLabel(self) -> String"""
10183 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
10185 def GetText(*args
, **kwargs
):
10186 """GetText(self) -> String"""
10187 return _core_
.MenuItem_GetText(*args
, **kwargs
)
10189 def GetLabelFromText(*args
, **kwargs
):
10190 """GetLabelFromText(String text) -> String"""
10191 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10193 GetLabelFromText
= staticmethod(GetLabelFromText
)
10194 def GetKind(*args
, **kwargs
):
10195 """GetKind(self) -> int"""
10196 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
10198 def SetKind(*args
, **kwargs
):
10199 """SetKind(self, int kind)"""
10200 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
10202 def SetCheckable(*args
, **kwargs
):
10203 """SetCheckable(self, bool checkable)"""
10204 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
10206 def IsCheckable(*args
, **kwargs
):
10207 """IsCheckable(self) -> bool"""
10208 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
10210 def IsSubMenu(*args
, **kwargs
):
10211 """IsSubMenu(self) -> bool"""
10212 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
10214 def SetSubMenu(*args
, **kwargs
):
10215 """SetSubMenu(self, Menu menu)"""
10216 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
10218 def GetSubMenu(*args
, **kwargs
):
10219 """GetSubMenu(self) -> Menu"""
10220 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
10222 def Enable(*args
, **kwargs
):
10223 """Enable(self, bool enable=True)"""
10224 return _core_
.MenuItem_Enable(*args
, **kwargs
)
10226 def IsEnabled(*args
, **kwargs
):
10227 """IsEnabled(self) -> bool"""
10228 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
10230 def Check(*args
, **kwargs
):
10231 """Check(self, bool check=True)"""
10232 return _core_
.MenuItem_Check(*args
, **kwargs
)
10234 def IsChecked(*args
, **kwargs
):
10235 """IsChecked(self) -> bool"""
10236 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
10238 def Toggle(*args
, **kwargs
):
10240 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
10242 def SetHelp(*args
, **kwargs
):
10243 """SetHelp(self, String str)"""
10244 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
10246 def GetHelp(*args
, **kwargs
):
10247 """GetHelp(self) -> String"""
10248 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
10250 def GetAccel(*args
, **kwargs
):
10251 """GetAccel(self) -> AcceleratorEntry"""
10252 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
10254 def SetAccel(*args
, **kwargs
):
10255 """SetAccel(self, AcceleratorEntry accel)"""
10256 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
10258 def SetBitmap(*args
, **kwargs
):
10259 """SetBitmap(self, Bitmap bitmap)"""
10260 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
10262 def GetBitmap(*args
, **kwargs
):
10263 """GetBitmap(self) -> Bitmap"""
10264 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
10266 def SetFont(*args
, **kwargs
):
10267 """SetFont(self, Font font)"""
10268 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
10270 def GetFont(*args
, **kwargs
):
10271 """GetFont(self) -> Font"""
10272 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
10274 def SetTextColour(*args
, **kwargs
):
10275 """SetTextColour(self, Colour colText)"""
10276 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
10278 def GetTextColour(*args
, **kwargs
):
10279 """GetTextColour(self) -> Colour"""
10280 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
10282 def SetBackgroundColour(*args
, **kwargs
):
10283 """SetBackgroundColour(self, Colour colBack)"""
10284 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
10286 def GetBackgroundColour(*args
, **kwargs
):
10287 """GetBackgroundColour(self) -> Colour"""
10288 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
10290 def SetBitmaps(*args
, **kwargs
):
10291 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10292 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
10294 def SetDisabledBitmap(*args
, **kwargs
):
10295 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10296 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
10298 def GetDisabledBitmap(*args
, **kwargs
):
10299 """GetDisabledBitmap(self) -> Bitmap"""
10300 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
10302 def SetMarginWidth(*args
, **kwargs
):
10303 """SetMarginWidth(self, int nWidth)"""
10304 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
10306 def GetMarginWidth(*args
, **kwargs
):
10307 """GetMarginWidth(self) -> int"""
10308 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
10310 def GetDefaultMarginWidth(*args
, **kwargs
):
10311 """GetDefaultMarginWidth() -> int"""
10312 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10314 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
10315 def IsOwnerDrawn(*args
, **kwargs
):
10316 """IsOwnerDrawn(self) -> bool"""
10317 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
10319 def SetOwnerDrawn(*args
, **kwargs
):
10320 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10321 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
10323 def ResetOwnerDrawn(*args
, **kwargs
):
10324 """ResetOwnerDrawn(self)"""
10325 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
10327 _core_
.MenuItem_swigregister(MenuItem
)
10329 def MenuItem_GetLabelFromText(*args
, **kwargs
):
10330 """MenuItem_GetLabelFromText(String text) -> String"""
10331 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10333 def MenuItem_GetDefaultMarginWidth(*args
):
10334 """MenuItem_GetDefaultMarginWidth() -> int"""
10335 return _core_
.MenuItem_GetDefaultMarginWidth(*args
)
10337 #---------------------------------------------------------------------------
10339 class Control(Window
):
10341 This is the base class for a control or 'widget'.
10343 A control is generally a small window which processes user input
10344 and/or displays one or more item of data.
10346 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10347 __repr__
= _swig_repr
10348 def __init__(self
, *args
, **kwargs
):
10350 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10351 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10352 String name=ControlNameStr) -> Control
10354 Create a Control. Normally you should only call this from a subclass'
10355 __init__ as a plain old wx.Control is not very useful.
10357 _core_
.Control_swiginit(self
,_core_
.new_Control(*args
, **kwargs
))
10358 self
._setOORInfo
(self
)
10360 def Create(*args
, **kwargs
):
10362 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10363 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10364 String name=ControlNameStr) -> bool
10366 Do the 2nd phase and create the GUI control.
10368 return _core_
.Control_Create(*args
, **kwargs
)
10370 def Command(*args
, **kwargs
):
10372 Command(self, CommandEvent event)
10374 Simulates the effect of the user issuing a command to the item.
10376 :see: `wx.CommandEvent`
10379 return _core_
.Control_Command(*args
, **kwargs
)
10381 def GetLabel(*args
, **kwargs
):
10383 GetLabel(self) -> String
10385 Return a control's text.
10387 return _core_
.Control_GetLabel(*args
, **kwargs
)
10389 def GetClassDefaultAttributes(*args
, **kwargs
):
10391 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10393 Get the default attributes for this class. This is useful if you want
10394 to use the same font or colour in your own control as in a standard
10395 control -- which is a much better idea than hard coding specific
10396 colours or fonts which might look completely out of place on the
10397 user's system, especially if it uses themes.
10399 The variant parameter is only relevant under Mac currently and is
10400 ignore under other platforms. Under Mac, it will change the size of
10401 the returned font. See `wx.Window.SetWindowVariant` for more about
10404 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10406 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
10407 _core_
.Control_swigregister(Control
)
10408 ControlNameStr
= cvar
.ControlNameStr
10410 def PreControl(*args
, **kwargs
):
10412 PreControl() -> Control
10414 Precreate a Control control for 2-phase creation
10416 val
= _core_
.new_PreControl(*args
, **kwargs
)
10419 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
10421 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10423 Get the default attributes for this class. This is useful if you want
10424 to use the same font or colour in your own control as in a standard
10425 control -- which is a much better idea than hard coding specific
10426 colours or fonts which might look completely out of place on the
10427 user's system, especially if it uses themes.
10429 The variant parameter is only relevant under Mac currently and is
10430 ignore under other platforms. Under Mac, it will change the size of
10431 the returned font. See `wx.Window.SetWindowVariant` for more about
10434 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10436 #---------------------------------------------------------------------------
10438 class ItemContainer(object):
10440 The wx.ItemContainer class defines an interface which is implemented
10441 by all controls which have string subitems, each of which may be
10442 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10443 as `wx.ComboBox` which implements an extended interface deriving from
10446 It defines the methods for accessing the control's items and although
10447 each of the derived classes implements them differently, they still
10448 all conform to the same interface.
10450 The items in a wx.ItemContainer have (non empty) string labels and,
10451 optionally, client data associated with them.
10454 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10455 def __init__(self
): raise AttributeError, "No constructor defined"
10456 __repr__
= _swig_repr
10457 def Append(*args
, **kwargs
):
10459 Append(self, String item, PyObject clientData=None) -> int
10461 Adds the item to the control, associating the given data with the item
10462 if not None. The return value is the index of the newly added item
10463 which may be different from the last one if the control is sorted (e.g.
10464 has wx.LB_SORT or wx.CB_SORT style).
10466 return _core_
.ItemContainer_Append(*args
, **kwargs
)
10468 def AppendItems(*args
, **kwargs
):
10470 AppendItems(self, List strings)
10472 Apend several items at once to the control. Notice that calling this
10473 method may be much faster than appending the items one by one if you
10474 need to add a lot of items.
10476 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
10478 def Insert(*args
, **kwargs
):
10480 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
10482 Insert an item into the control before the item at the ``pos`` index,
10483 optionally associating some data object with the item.
10485 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
10487 def Clear(*args
, **kwargs
):
10491 Removes all items from the control.
10493 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
10495 def Delete(*args
, **kwargs
):
10497 Delete(self, unsigned int n)
10499 Deletes the item at the zero-based index 'n' from the control. Note
10500 that it is an error (signalled by a `wx.PyAssertionError` exception if
10501 enabled) to remove an item with the index negative or greater or equal
10502 than the number of items in the control.
10504 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
10506 def GetClientData(*args
, **kwargs
):
10508 GetClientData(self, unsigned int n) -> PyObject
10510 Returns the client data associated with the given item, (if any.)
10512 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
10514 def SetClientData(*args
, **kwargs
):
10516 SetClientData(self, unsigned int n, PyObject clientData)
10518 Associate the given client data with the item at position n.
10520 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
10522 def GetCount(*args
, **kwargs
):
10524 GetCount(self) -> unsigned int
10526 Returns the number of items in the control.
10528 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
10530 def IsEmpty(*args
, **kwargs
):
10532 IsEmpty(self) -> bool
10534 Returns True if the control is empty or False if it has some items.
10536 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
10538 def GetString(*args
, **kwargs
):
10540 GetString(self, unsigned int n) -> String
10542 Returns the label of the item with the given index.
10544 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
10546 def GetStrings(*args
, **kwargs
):
10547 """GetStrings(self) -> wxArrayString"""
10548 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
10550 def SetString(*args
, **kwargs
):
10552 SetString(self, unsigned int n, String s)
10554 Sets the label for the given item.
10556 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
10558 def FindString(*args
, **kwargs
):
10560 FindString(self, String s) -> int
10562 Finds an item whose label matches the given string. Returns the
10563 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10566 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
10568 def SetSelection(*args
, **kwargs
):
10570 SetSelection(self, int n)
10572 Sets the item at index 'n' to be the selected item.
10574 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
10576 def GetSelection(*args
, **kwargs
):
10578 GetSelection(self) -> int
10580 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10583 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
10585 def SetStringSelection(*args
, **kwargs
):
10586 """SetStringSelection(self, String s) -> bool"""
10587 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
10589 def GetStringSelection(*args
, **kwargs
):
10591 GetStringSelection(self) -> String
10593 Returns the label of the selected item or an empty string if no item
10596 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
10598 def Select(*args
, **kwargs
):
10600 Select(self, int n)
10602 This is the same as `SetSelection` and exists only because it is
10603 slightly more natural for controls which support multiple selection.
10605 return _core_
.ItemContainer_Select(*args
, **kwargs
)
10607 _core_
.ItemContainer_swigregister(ItemContainer
)
10609 #---------------------------------------------------------------------------
10611 class ControlWithItems(Control
,ItemContainer
):
10613 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10614 wx.Control class, and is used for the base class of various controls
10617 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10618 def __init__(self
): raise AttributeError, "No constructor defined"
10619 __repr__
= _swig_repr
10620 _core_
.ControlWithItems_swigregister(ControlWithItems
)
10622 #---------------------------------------------------------------------------
10624 class SizerItem(Object
):
10626 The wx.SizerItem class is used to track the position, size and other
10627 attributes of each item managed by a `wx.Sizer`. It is not usually
10628 necessary to use this class because the sizer elements can also be
10629 identified by their positions or window or sizer references but
10630 sometimes it may be more convenient to use wx.SizerItem directly.
10631 Also, custom classes derived from `wx.PySizer` will probably need to
10632 use the collection of wx.SizerItems held by wx.Sizer when calculating
10635 :see: `wx.Sizer`, `wx.GBSizerItem`
10637 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10638 __repr__
= _swig_repr
10639 def __init__(self
, *args
, **kwargs
):
10641 __init__(self) -> SizerItem
10643 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10644 size will need to be set before this item can be used in a Sizer.
10646 You will probably never need to create a wx.SizerItem directly as they
10647 are created automatically when the sizer's Add, Insert or Prepend
10648 methods are called.
10650 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10652 _core_
.SizerItem_swiginit(self
,_core_
.new_SizerItem(*args
, **kwargs
))
10653 __swig_destroy__
= _core_
.delete_SizerItem
10654 __del__
= lambda self
: None;
10655 def DeleteWindows(*args
, **kwargs
):
10657 DeleteWindows(self)
10659 Destroy the window or the windows in a subsizer, depending on the type
10662 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
10664 def DetachSizer(*args
, **kwargs
):
10668 Enable deleting the SizerItem without destroying the contained sizer.
10670 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
10672 def GetSize(*args
, **kwargs
):
10674 GetSize(self) -> Size
10676 Get the current size of the item, as set in the last Layout.
10678 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
10680 def CalcMin(*args
, **kwargs
):
10682 CalcMin(self) -> Size
10684 Calculates the minimum desired size for the item, including any space
10687 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
10689 def SetDimension(*args
, **kwargs
):
10691 SetDimension(self, Point pos, Size size)
10693 Set the position and size of the space allocated for this item by the
10694 sizer, and adjust the position and size of the item (window or
10695 subsizer) to be within that space taking alignment and borders into
10698 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
10700 def GetMinSize(*args
, **kwargs
):
10702 GetMinSize(self) -> Size
10704 Get the minimum size needed for the item.
10706 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
10708 def GetMinSizeWithBorder(*args
, **kwargs
):
10710 GetMinSizeWithBorder(self) -> Size
10712 Get the minimum size needed for the item with space for the borders
10715 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
10717 def SetInitSize(*args
, **kwargs
):
10718 """SetInitSize(self, int x, int y)"""
10719 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
10721 def SetRatioWH(*args
, **kwargs
):
10723 SetRatioWH(self, int width, int height)
10725 Set the ratio item attribute.
10727 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
10729 def SetRatioSize(*args
, **kwargs
):
10731 SetRatioSize(self, Size size)
10733 Set the ratio item attribute.
10735 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
10737 def SetRatio(*args
, **kwargs
):
10739 SetRatio(self, float ratio)
10741 Set the ratio item attribute.
10743 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
10745 def GetRatio(*args
, **kwargs
):
10747 GetRatio(self) -> float
10749 Set the ratio item attribute.
10751 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
10753 def GetRect(*args
, **kwargs
):
10755 GetRect(self) -> Rect
10757 Returns the rectangle that the sizer item should occupy
10759 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
10761 def IsWindow(*args
, **kwargs
):
10763 IsWindow(self) -> bool
10765 Is this sizer item a window?
10767 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
10769 def IsSizer(*args
, **kwargs
):
10771 IsSizer(self) -> bool
10773 Is this sizer item a subsizer?
10775 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
10777 def IsSpacer(*args
, **kwargs
):
10779 IsSpacer(self) -> bool
10781 Is this sizer item a spacer?
10783 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
10785 def SetProportion(*args
, **kwargs
):
10787 SetProportion(self, int proportion)
10789 Set the proportion value for this item.
10791 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
10793 def GetProportion(*args
, **kwargs
):
10795 GetProportion(self) -> int
10797 Get the proportion value for this item.
10799 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
10801 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
10802 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
10803 def SetFlag(*args
, **kwargs
):
10805 SetFlag(self, int flag)
10807 Set the flag value for this item.
10809 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
10811 def GetFlag(*args
, **kwargs
):
10813 GetFlag(self) -> int
10815 Get the flag value for this item.
10817 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
10819 def SetBorder(*args
, **kwargs
):
10821 SetBorder(self, int border)
10823 Set the border value for this item.
10825 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
10827 def GetBorder(*args
, **kwargs
):
10829 GetBorder(self) -> int
10831 Get the border value for this item.
10833 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
10835 def GetWindow(*args
, **kwargs
):
10837 GetWindow(self) -> Window
10839 Get the window (if any) that is managed by this sizer item.
10841 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
10843 def SetWindow(*args
, **kwargs
):
10845 SetWindow(self, Window window)
10847 Set the window to be managed by this sizer item.
10849 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
10851 def GetSizer(*args
, **kwargs
):
10853 GetSizer(self) -> Sizer
10855 Get the subsizer (if any) that is managed by this sizer item.
10857 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
10859 def SetSizer(*args
, **kwargs
):
10861 SetSizer(self, Sizer sizer)
10863 Set the subsizer to be managed by this sizer item.
10865 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
10867 def GetSpacer(*args
, **kwargs
):
10869 GetSpacer(self) -> Size
10871 Get the size of the spacer managed by this sizer item.
10873 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
10875 def SetSpacer(*args
, **kwargs
):
10877 SetSpacer(self, Size size)
10879 Set the size of the spacer to be managed by this sizer item.
10881 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
10883 def Show(*args
, **kwargs
):
10885 Show(self, bool show)
10887 Set the show item attribute, which sizers use to determine if the item
10888 is to be made part of the layout or not. If the item is tracking a
10889 window then it is shown or hidden as needed.
10891 return _core_
.SizerItem_Show(*args
, **kwargs
)
10893 def IsShown(*args
, **kwargs
):
10895 IsShown(self) -> bool
10897 Is the item to be shown in the layout?
10899 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
10901 def GetPosition(*args
, **kwargs
):
10903 GetPosition(self) -> Point
10905 Returns the current position of the item, as set in the last Layout.
10907 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
10909 def GetUserData(*args
, **kwargs
):
10911 GetUserData(self) -> PyObject
10913 Returns the userData associated with this sizer item, or None if there
10916 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
10918 def SetUserData(*args
, **kwargs
):
10920 SetUserData(self, PyObject userData)
10922 Associate a Python object with this sizer item.
10924 return _core_
.SizerItem_SetUserData(*args
, **kwargs
)
10926 _core_
.SizerItem_swigregister(SizerItem
)
10928 def SizerItemWindow(*args
, **kwargs
):
10930 SizerItemWindow(Window window, int proportion, int flag, int border,
10931 PyObject userData=None) -> SizerItem
10933 Constructs a `wx.SizerItem` for tracking a window.
10935 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
10938 def SizerItemSpacer(*args
, **kwargs
):
10940 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10941 PyObject userData=None) -> SizerItem
10943 Constructs a `wx.SizerItem` for tracking a spacer.
10945 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
10948 def SizerItemSizer(*args
, **kwargs
):
10950 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10951 PyObject userData=None) -> SizerItem
10953 Constructs a `wx.SizerItem` for tracking a subsizer
10955 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
10958 class Sizer(Object
):
10960 wx.Sizer is the abstract base class used for laying out subwindows in
10961 a window. You cannot use wx.Sizer directly; instead, you will have to
10962 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10963 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10964 and `wx.GridBagSizer`.
10966 The concept implemented by sizers in wxWidgets is closely related to
10967 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10968 toolkit or the Qt toolkit. It is based upon the idea of the individual
10969 subwindows reporting their minimal required size and their ability to
10970 get stretched if the size of the parent window has changed. This will
10971 most often mean that the programmer does not set the original size of
10972 a dialog in the beginning, rather the dialog will assigned a sizer and
10973 this sizer will be queried about the recommended size. The sizer in
10974 turn will query its children, which can be normal windows or contorls,
10975 empty space or other sizers, so that a hierarchy of sizers can be
10976 constructed. Note that wxSizer does not derive from wxWindow and thus
10977 do not interfere with tab ordering and requires very little resources
10978 compared to a real window on screen.
10980 What makes sizers so well fitted for use in wxWidgets is the fact that
10981 every control reports its own minimal size and the algorithm can
10982 handle differences in font sizes or different window (dialog item)
10983 sizes on different platforms without problems. If for example the
10984 standard font as well as the overall design of Mac widgets requires
10985 more space than on Windows, then the initial size of a dialog using a
10986 sizer will automatically be bigger on Mac than on Windows.
10988 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
10989 def __init__(self
): raise AttributeError, "No constructor defined"
10990 __repr__
= _swig_repr
10991 __swig_destroy__
= _core_
.delete_Sizer
10992 __del__
= lambda self
: None;
10993 def _setOORInfo(*args
, **kwargs
):
10994 """_setOORInfo(self, PyObject _self)"""
10995 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
10997 def Add(*args
, **kwargs
):
10999 Add(self, item, int proportion=0, int flag=0, int border=0,
11000 PyObject userData=None) -> wx.SizerItem
11002 Appends a child item to the sizer.
11004 return _core_
.Sizer_Add(*args
, **kwargs
)
11006 def Insert(*args
, **kwargs
):
11008 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11009 PyObject userData=None) -> wx.SizerItem
11011 Inserts a new item into the list of items managed by this sizer before
11012 the item at index *before*. See `Add` for a description of the parameters.
11014 return _core_
.Sizer_Insert(*args
, **kwargs
)
11016 def Prepend(*args
, **kwargs
):
11018 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11019 PyObject userData=None) -> wx.SizerItem
11021 Adds a new item to the begining of the list of sizer items managed by
11022 this sizer. See `Add` for a description of the parameters.
11024 return _core_
.Sizer_Prepend(*args
, **kwargs
)
11026 def Remove(*args
, **kwargs
):
11028 Remove(self, item) -> bool
11030 Removes an item from the sizer and destroys it. This method does not
11031 cause any layout or resizing to take place, call `Layout` to update
11032 the layout on screen after removing a child from the sizer. The
11033 *item* parameter can be either a window, a sizer, or the zero-based
11034 index of an item to remove. Returns True if the child item was found
11037 return _core_
.Sizer_Remove(*args
, **kwargs
)
11039 def Detach(*args
, **kwargs
):
11041 Detach(self, item) -> bool
11043 Detaches an item from the sizer without destroying it. This method
11044 does not cause any layout or resizing to take place, call `Layout` to
11045 do so. The *item* parameter can be either a window, a sizer, or the
11046 zero-based index of the item to be detached. Returns True if the child item
11047 was found and detached.
11049 return _core_
.Sizer_Detach(*args
, **kwargs
)
11051 def GetItem(*args
, **kwargs
):
11053 GetItem(self, item) -> wx.SizerItem
11055 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11056 parameter can be either a window, a sizer, or the zero-based index of
11057 the item to be found.
11059 return _core_
.Sizer_GetItem(*args
, **kwargs
)
11061 def _SetItemMinSize(*args
, **kwargs
):
11062 """_SetItemMinSize(self, PyObject item, Size size)"""
11063 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
11065 def SetItemMinSize(self
, item
, *args
):
11067 SetItemMinSize(self, item, Size size)
11069 Sets the minimum size that will be allocated for an item in the sizer.
11070 The *item* parameter can be either a window, a sizer, or the
11071 zero-based index of the item. If a window or sizer is given then it
11072 will be searched for recursivly in subsizers if neccessary.
11075 # for backward compatibility accept separate width,height args too
11076 return self
._SetItemMinSize
(item
, args
)
11078 return self
._SetItemMinSize
(item
, args
[0])
11080 def AddItem(*args
, **kwargs
):
11082 AddItem(self, SizerItem item)
11084 Adds a `wx.SizerItem` to the sizer.
11086 return _core_
.Sizer_AddItem(*args
, **kwargs
)
11088 def InsertItem(*args
, **kwargs
):
11090 InsertItem(self, int index, SizerItem item)
11092 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11094 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
11096 def PrependItem(*args
, **kwargs
):
11098 PrependItem(self, SizerItem item)
11100 Prepends a `wx.SizerItem` to the sizer.
11102 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
11104 def AddMany(self
, items
):
11106 AddMany is a convenience method for adding several items
11107 to a sizer at one time. Simply pass it a list of tuples,
11108 where each tuple consists of the parameters that you
11109 would normally pass to the `Add` method.
11112 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
11116 # for backwards compatibility only, please do not use in new code
11117 def AddWindow(self
, *args
, **kw
):
11118 """Compatibility alias for `Add`."""
11119 return self
.Add(*args
, **kw
)
11120 def AddSizer(self
, *args
, **kw
):
11121 """Compatibility alias for `Add`."""
11122 return self
.Add(*args
, **kw
)
11123 def AddSpacer(self
, *args
, **kw
):
11124 """Compatibility alias for `Add`."""
11125 return self
.Add(*args
, **kw
)
11127 def PrependWindow(self
, *args
, **kw
):
11128 """Compatibility alias for `Prepend`."""
11129 return self
.Prepend(*args
, **kw
)
11130 def PrependSizer(self
, *args
, **kw
):
11131 """Compatibility alias for `Prepend`."""
11132 return self
.Prepend(*args
, **kw
)
11133 def PrependSpacer(self
, *args
, **kw
):
11134 """Compatibility alias for `Prepend`."""
11135 return self
.Prepend(*args
, **kw
)
11137 def InsertWindow(self
, *args
, **kw
):
11138 """Compatibility alias for `Insert`."""
11139 return self
.Insert(*args
, **kw
)
11140 def InsertSizer(self
, *args
, **kw
):
11141 """Compatibility alias for `Insert`."""
11142 return self
.Insert(*args
, **kw
)
11143 def InsertSpacer(self
, *args
, **kw
):
11144 """Compatibility alias for `Insert`."""
11145 return self
.Insert(*args
, **kw
)
11147 def RemoveWindow(self
, *args
, **kw
):
11148 """Compatibility alias for `Remove`."""
11149 return self
.Remove(*args
, **kw
)
11150 def RemoveSizer(self
, *args
, **kw
):
11151 """Compatibility alias for `Remove`."""
11152 return self
.Remove(*args
, **kw
)
11153 def RemovePos(self
, *args
, **kw
):
11154 """Compatibility alias for `Remove`."""
11155 return self
.Remove(*args
, **kw
)
11158 def SetDimension(*args
, **kwargs
):
11160 SetDimension(self, int x, int y, int width, int height)
11162 Call this to force the sizer to take the given dimension and thus
11163 force the items owned by the sizer to resize themselves according to
11164 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11167 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
11169 def SetMinSize(*args
, **kwargs
):
11171 SetMinSize(self, Size size)
11173 Call this to give the sizer a minimal size. Normally, the sizer will
11174 calculate its minimal size based purely on how much space its children
11175 need. After calling this method `GetMinSize` will return either the
11176 minimal size as requested by its children or the minimal size set
11177 here, depending on which is bigger.
11179 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
11181 def GetSize(*args
, **kwargs
):
11183 GetSize(self) -> Size
11185 Returns the current size of the space managed by the sizer.
11187 return _core_
.Sizer_GetSize(*args
, **kwargs
)
11189 def GetPosition(*args
, **kwargs
):
11191 GetPosition(self) -> Point
11193 Returns the current position of the sizer's managed space.
11195 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
11197 def GetMinSize(*args
, **kwargs
):
11199 GetMinSize(self) -> Size
11201 Returns the minimal size of the sizer. This is either the combined
11202 minimal size of all the children and their borders or the minimal size
11203 set by SetMinSize, depending on which is bigger.
11205 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
11207 def GetSizeTuple(self
):
11208 return self
.GetSize().Get()
11209 def GetPositionTuple(self
):
11210 return self
.GetPosition().Get()
11211 def GetMinSizeTuple(self
):
11212 return self
.GetMinSize().Get()
11214 def RecalcSizes(*args
, **kwargs
):
11218 Using the sizes calculated by `CalcMin` reposition and resize all the
11219 items managed by this sizer. You should not need to call this directly as
11220 it is called by `Layout`.
11222 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
11224 def CalcMin(*args
, **kwargs
):
11226 CalcMin(self) -> Size
11228 This method is where the sizer will do the actual calculation of its
11229 children's minimal sizes. You should not need to call this directly as
11230 it is called by `Layout`.
11232 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
11234 def Layout(*args
, **kwargs
):
11238 This method will force the recalculation and layout of the items
11239 controlled by the sizer using the current space allocated to the
11240 sizer. Normally this is called automatically from the owning window's
11241 EVT_SIZE handler, but it is also useful to call it from user code when
11242 one of the items in a sizer change size, or items are added or
11245 return _core_
.Sizer_Layout(*args
, **kwargs
)
11247 def Fit(*args
, **kwargs
):
11249 Fit(self, Window window) -> Size
11251 Tell the sizer to resize the *window* to match the sizer's minimal
11252 size. This is commonly done in the constructor of the window itself in
11253 order to set its initial size to match the needs of the children as
11254 determined by the sizer. Returns the new size.
11256 For a top level window this is the total window size, not the client size.
11258 return _core_
.Sizer_Fit(*args
, **kwargs
)
11260 def FitInside(*args
, **kwargs
):
11262 FitInside(self, Window window)
11264 Tell the sizer to resize the *virtual size* of the *window* to match the
11265 sizer's minimal size. This will not alter the on screen size of the
11266 window, but may cause the addition/removal/alteration of scrollbars
11267 required to view the virtual area in windows which manage it.
11269 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11272 return _core_
.Sizer_FitInside(*args
, **kwargs
)
11274 def SetSizeHints(*args
, **kwargs
):
11276 SetSizeHints(self, Window window)
11278 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11279 match the sizer's minimal size. This is commonly done in the
11280 constructor of the window itself if the window is resizable (as are
11281 many dialogs under Unix and frames on probably all platforms) in order
11282 to prevent the window from being sized smaller than the minimal size
11283 required by the sizer.
11285 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
11287 def SetVirtualSizeHints(*args
, **kwargs
):
11289 SetVirtualSizeHints(self, Window window)
11291 Tell the sizer to set the minimal size of the window virtual area to
11292 match the sizer's minimal size. For windows with managed scrollbars
11293 this will set them appropriately.
11295 :see: `wx.ScrolledWindow.SetScrollbars`
11298 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
11300 def Clear(*args
, **kwargs
):
11302 Clear(self, bool deleteWindows=False)
11304 Clear all items from the sizer, optionally destroying the window items
11307 return _core_
.Sizer_Clear(*args
, **kwargs
)
11309 def DeleteWindows(*args
, **kwargs
):
11311 DeleteWindows(self)
11313 Destroy all windows managed by the sizer.
11315 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
11317 def GetChildren(*args
, **kwargs
):
11319 GetChildren(self) -> list
11321 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11323 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
11325 def Show(*args
, **kwargs
):
11327 Show(self, item, bool show=True, bool recursive=false) -> bool
11329 Shows or hides an item managed by the sizer. To make a sizer item
11330 disappear or reappear, use Show followed by `Layout`. The *item*
11331 parameter can be either a window, a sizer, or the zero-based index of
11332 the item. Use the recursive parameter to show or hide an item in a
11333 subsizer. Returns True if the item was found.
11335 return _core_
.Sizer_Show(*args
, **kwargs
)
11337 def IsShown(*args
, **kwargs
):
11339 IsShown(self, item)
11341 Determines if the item is currently shown. To make a sizer
11342 item disappear or reappear, use Show followed by `Layout`. The *item*
11343 parameter can be either a window, a sizer, or the zero-based index of
11346 return _core_
.Sizer_IsShown(*args
, **kwargs
)
11348 def Hide(self
, item
, recursive
=False):
11350 A convenience method for `Show` (item, False, recursive).
11352 return self
.Show(item
, False, recursive
)
11354 def ShowItems(*args
, **kwargs
):
11356 ShowItems(self, bool show)
11358 Recursively call `wx.SizerItem.Show` on all sizer items.
11360 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
11362 _core_
.Sizer_swigregister(Sizer
)
11364 class PySizer(Sizer
):
11366 wx.PySizer is a special version of `wx.Sizer` that has been
11367 instrumented to allow the C++ virtual methods to be overloaded in
11368 Python derived classes. You would derive from this class if you are
11369 wanting to implement a custom sizer in Python code. Simply implement
11370 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11373 class MySizer(wx.PySizer):
11374 def __init__(self):
11375 wx.PySizer.__init__(self)
11378 for item in self.GetChildren():
11379 # calculate the total minimum width and height needed
11380 # by all items in the sizer according to this sizer's
11381 # layout algorithm.
11383 return wx.Size(width, height)
11385 def RecalcSizes(self):
11386 # find the space allotted to this sizer
11387 pos = self.GetPosition()
11388 size = self.GetSize()
11389 for item in self.GetChildren():
11390 # Recalculate (if necessary) the position and size of
11391 # each item and then call item.SetDimension to do the
11392 # actual positioning and sizing of the items within the
11393 # space alloted to this sizer.
11395 item.SetDimension(itemPos, itemSize)
11398 When `Layout` is called it first calls `CalcMin` followed by
11399 `RecalcSizes` so you can optimize a bit by saving the results of
11400 `CalcMin` and reusing them in `RecalcSizes`.
11402 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11406 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11407 __repr__
= _swig_repr
11408 def __init__(self
, *args
, **kwargs
):
11410 __init__(self) -> PySizer
11412 Creates a wx.PySizer. Must be called from the __init__ in the derived
11415 _core_
.PySizer_swiginit(self
,_core_
.new_PySizer(*args
, **kwargs
))
11416 self
._setCallbackInfo
(self
, PySizer
);self
._setOORInfo
(self
)
11418 def _setCallbackInfo(*args
, **kwargs
):
11419 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11420 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
11422 _core_
.PySizer_swigregister(PySizer
)
11424 #---------------------------------------------------------------------------
11426 class BoxSizer(Sizer
):
11428 The basic idea behind a box sizer is that windows will most often be
11429 laid out in rather simple basic geometry, typically in a row or a
11430 column or nested hierarchies of either. A wx.BoxSizer will lay out
11431 its items in a simple row or column, depending on the orientation
11432 parameter passed to the constructor.
11434 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11435 __repr__
= _swig_repr
11436 def __init__(self
, *args
, **kwargs
):
11438 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11440 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11441 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11444 _core_
.BoxSizer_swiginit(self
,_core_
.new_BoxSizer(*args
, **kwargs
))
11445 self
._setOORInfo
(self
)
11447 def GetOrientation(*args
, **kwargs
):
11449 GetOrientation(self) -> int
11451 Returns the current orientation of the sizer.
11453 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
11455 def SetOrientation(*args
, **kwargs
):
11457 SetOrientation(self, int orient)
11459 Resets the orientation of the sizer.
11461 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
11463 _core_
.BoxSizer_swigregister(BoxSizer
)
11465 #---------------------------------------------------------------------------
11467 class StaticBoxSizer(BoxSizer
):
11469 wx.StaticBoxSizer derives from and functions identically to the
11470 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11471 manages. Note that this static box must be created separately and
11472 passed to the sizer constructor.
11474 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11475 __repr__
= _swig_repr
11476 def __init__(self
, *args
, **kwargs
):
11478 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11480 Constructor. It takes an associated static box and the orientation
11481 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11484 _core_
.StaticBoxSizer_swiginit(self
,_core_
.new_StaticBoxSizer(*args
, **kwargs
))
11485 self
._setOORInfo
(self
)
11487 def GetStaticBox(*args
, **kwargs
):
11489 GetStaticBox(self) -> StaticBox
11491 Returns the static box associated with this sizer.
11493 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
11495 _core_
.StaticBoxSizer_swigregister(StaticBoxSizer
)
11497 #---------------------------------------------------------------------------
11499 class GridSizer(Sizer
):
11501 A grid sizer is a sizer which lays out its children in a
11502 two-dimensional table with all cells having the same size. In other
11503 words, the width of each cell within the grid is the width of the
11504 widest item added to the sizer and the height of each grid cell is the
11505 height of the tallest item. An optional vertical and/or horizontal
11506 gap between items can also be specified (in pixels.)
11508 Items are placed in the cells of the grid in the order they are added,
11509 in row-major order. In other words, the first row is filled first,
11510 then the second, and so on until all items have been added. (If
11511 neccessary, additional rows will be added as items are added.) If you
11512 need to have greater control over the cells that items are placed in
11513 then use the `wx.GridBagSizer`.
11516 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11517 __repr__
= _swig_repr
11518 def __init__(self
, *args
, **kwargs
):
11520 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11522 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11523 of columns and rows in the sizer - if either of the parameters is
11524 zero, it will be calculated to from the total number of children in
11525 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11526 define extra space between all children.
11528 _core_
.GridSizer_swiginit(self
,_core_
.new_GridSizer(*args
, **kwargs
))
11529 self
._setOORInfo
(self
)
11531 def SetCols(*args
, **kwargs
):
11533 SetCols(self, int cols)
11535 Sets the number of columns in the sizer.
11537 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
11539 def SetRows(*args
, **kwargs
):
11541 SetRows(self, int rows)
11543 Sets the number of rows in the sizer.
11545 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
11547 def SetVGap(*args
, **kwargs
):
11549 SetVGap(self, int gap)
11551 Sets the vertical gap (in pixels) between the cells in the sizer.
11553 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
11555 def SetHGap(*args
, **kwargs
):
11557 SetHGap(self, int gap)
11559 Sets the horizontal gap (in pixels) between cells in the sizer
11561 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
11563 def GetCols(*args
, **kwargs
):
11565 GetCols(self) -> int
11567 Returns the number of columns in the sizer.
11569 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
11571 def GetRows(*args
, **kwargs
):
11573 GetRows(self) -> int
11575 Returns the number of rows in the sizer.
11577 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
11579 def GetVGap(*args
, **kwargs
):
11581 GetVGap(self) -> int
11583 Returns the vertical gap (in pixels) between the cells in the sizer.
11585 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
11587 def GetHGap(*args
, **kwargs
):
11589 GetHGap(self) -> int
11591 Returns the horizontal gap (in pixels) between cells in the sizer.
11593 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
11595 def CalcRowsCols(self
):
11597 CalcRowsCols() -> (rows, cols)
11599 Calculates how many rows and columns will be in the sizer based
11600 on the current number of items and also the rows, cols specified
11601 in the constructor.
11603 nitems
= len(self
.GetChildren())
11604 rows
= self
.GetRows()
11605 cols
= self
.GetCols()
11606 assert rows
!= 0 or cols
!= 0, "Grid sizer must have either rows or columns fixed"
11608 rows
= (nitems
+ cols
- 1) / cols
11610 cols
= (nitems
+ rows
- 1) / rows
11611 return (rows
, cols
)
11613 _core_
.GridSizer_swigregister(GridSizer
)
11615 #---------------------------------------------------------------------------
11617 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
11618 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
11619 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
11620 class FlexGridSizer(GridSizer
):
11622 A flex grid sizer is a sizer which lays out its children in a
11623 two-dimensional table with all table cells in one row having the same
11624 height and all cells in one column having the same width, but all
11625 rows or all columns are not necessarily the same height or width as in
11626 the `wx.GridSizer`.
11628 wx.FlexGridSizer can also size items equally in one direction but
11629 unequally ("flexibly") in the other. If the sizer is only flexible
11630 in one direction (this can be changed using `SetFlexibleDirection`), it
11631 needs to be decided how the sizer should grow in the other ("non
11632 flexible") direction in order to fill the available space. The
11633 `SetNonFlexibleGrowMode` method serves this purpose.
11637 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11638 __repr__
= _swig_repr
11639 def __init__(self
, *args
, **kwargs
):
11641 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11643 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11644 number of columns and rows in the sizer - if either of the parameters
11645 is zero, it will be calculated to from the total number of children in
11646 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11647 define extra space between all children.
11649 _core_
.FlexGridSizer_swiginit(self
,_core_
.new_FlexGridSizer(*args
, **kwargs
))
11650 self
._setOORInfo
(self
)
11652 def AddGrowableRow(*args
, **kwargs
):
11654 AddGrowableRow(self, size_t idx, int proportion=0)
11656 Specifies that row *idx* (starting from zero) should be grown if there
11657 is extra space available to the sizer.
11659 The *proportion* parameter has the same meaning as the stretch factor
11660 for the box sizers except that if all proportions are 0, then all
11661 columns are resized equally (instead of not being resized at all).
11663 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
11665 def RemoveGrowableRow(*args
, **kwargs
):
11667 RemoveGrowableRow(self, size_t idx)
11669 Specifies that row *idx* is no longer growable.
11671 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
11673 def AddGrowableCol(*args
, **kwargs
):
11675 AddGrowableCol(self, size_t idx, int proportion=0)
11677 Specifies that column *idx* (starting from zero) should be grown if
11678 there is extra space available to the sizer.
11680 The *proportion* parameter has the same meaning as the stretch factor
11681 for the box sizers except that if all proportions are 0, then all
11682 columns are resized equally (instead of not being resized at all).
11684 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
11686 def RemoveGrowableCol(*args
, **kwargs
):
11688 RemoveGrowableCol(self, size_t idx)
11690 Specifies that column *idx* is no longer growable.
11692 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
11694 def SetFlexibleDirection(*args
, **kwargs
):
11696 SetFlexibleDirection(self, int direction)
11698 Specifies whether the sizer should flexibly resize its columns, rows,
11699 or both. Argument *direction* can be one of the following values. Any
11700 other value is ignored.
11702 ============== =======================================
11703 wx.VERTICAL Rows are flexibly sized.
11704 wx.HORIZONTAL Columns are flexibly sized.
11705 wx.BOTH Both rows and columns are flexibly sized
11706 (this is the default value).
11707 ============== =======================================
11709 Note that this method does not trigger relayout.
11712 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
11714 def GetFlexibleDirection(*args
, **kwargs
):
11716 GetFlexibleDirection(self) -> int
11718 Returns a value that specifies whether the sizer
11719 flexibly resizes its columns, rows, or both (default).
11721 :see: `SetFlexibleDirection`
11723 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
11725 def SetNonFlexibleGrowMode(*args
, **kwargs
):
11727 SetNonFlexibleGrowMode(self, int mode)
11729 Specifies how the sizer should grow in the non-flexible direction if
11730 there is one (so `SetFlexibleDirection` must have been called
11731 previously). Argument *mode* can be one of the following values:
11733 ========================== =================================================
11734 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11735 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11736 `AddGrowableCol` and `AddGrowableRow`. In this
11737 case equal sizing applies to minimum sizes of
11738 columns or rows (this is the default value).
11739 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11740 the non flexible direction, whether they are
11741 growable or not in the flexbile direction.
11742 ========================== =================================================
11744 Note that this method does not trigger relayout.
11748 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
11750 def GetNonFlexibleGrowMode(*args
, **kwargs
):
11752 GetNonFlexibleGrowMode(self) -> int
11754 Returns the value that specifies how the sizer grows in the
11755 non-flexible direction if there is one.
11757 :see: `SetNonFlexibleGrowMode`
11759 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
11761 def GetRowHeights(*args
, **kwargs
):
11763 GetRowHeights(self) -> list
11765 Returns a list of integers representing the heights of each of the
11768 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
11770 def GetColWidths(*args
, **kwargs
):
11772 GetColWidths(self) -> list
11774 Returns a list of integers representing the widths of each of the
11775 columns in the sizer.
11777 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
11779 _core_
.FlexGridSizer_swigregister(FlexGridSizer
)
11781 class StdDialogButtonSizer(BoxSizer
):
11783 A special sizer that knows how to order and position standard buttons
11784 in order to conform to the current platform's standards. You simply
11785 need to add each `wx.Button` to the sizer, and be sure to create the
11786 buttons using the standard ID's. Then call `Realize` and the sizer
11787 will take care of the rest.
11790 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11791 __repr__
= _swig_repr
11792 def __init__(self
, *args
, **kwargs
):
11793 """__init__(self) -> StdDialogButtonSizer"""
11794 _core_
.StdDialogButtonSizer_swiginit(self
,_core_
.new_StdDialogButtonSizer(*args
, **kwargs
))
11795 def AddButton(*args
, **kwargs
):
11797 AddButton(self, wxButton button)
11799 Use this to add the buttons to this sizer. Do not use the `Add`
11800 method in the base class.
11802 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
11804 def Realize(*args
, **kwargs
):
11808 This funciton needs to be called after all the buttons have been added
11809 to the sizer. It will reorder them and position them in a platform
11812 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
11814 def SetAffirmativeButton(*args
, **kwargs
):
11815 """SetAffirmativeButton(self, wxButton button)"""
11816 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
11818 def SetNegativeButton(*args
, **kwargs
):
11819 """SetNegativeButton(self, wxButton button)"""
11820 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
11822 def SetCancelButton(*args
, **kwargs
):
11823 """SetCancelButton(self, wxButton button)"""
11824 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
11826 def GetAffirmativeButton(*args
, **kwargs
):
11827 """GetAffirmativeButton(self) -> wxButton"""
11828 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
11830 def GetApplyButton(*args
, **kwargs
):
11831 """GetApplyButton(self) -> wxButton"""
11832 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
11834 def GetNegativeButton(*args
, **kwargs
):
11835 """GetNegativeButton(self) -> wxButton"""
11836 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
11838 def GetCancelButton(*args
, **kwargs
):
11839 """GetCancelButton(self) -> wxButton"""
11840 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
11842 def GetHelpButton(*args
, **kwargs
):
11843 """GetHelpButton(self) -> wxButton"""
11844 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
11846 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizer
)
11848 #---------------------------------------------------------------------------
11850 class GBPosition(object):
11852 This class represents the position of an item in a virtual grid of
11853 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11854 typemaps that will automatically convert from a 2-element sequence of
11855 integers to a wx.GBPosition, so you can use the more pythonic
11856 representation of the position nearly transparently in Python code.
11858 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11859 __repr__
= _swig_repr
11860 def __init__(self
, *args
, **kwargs
):
11862 __init__(self, int row=0, int col=0) -> GBPosition
11864 This class represents the position of an item in a virtual grid of
11865 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11866 typemaps that will automatically convert from a 2-element sequence of
11867 integers to a wx.GBPosition, so you can use the more pythonic
11868 representation of the position nearly transparently in Python code.
11870 _core_
.GBPosition_swiginit(self
,_core_
.new_GBPosition(*args
, **kwargs
))
11871 __swig_destroy__
= _core_
.delete_GBPosition
11872 __del__
= lambda self
: None;
11873 def GetRow(*args
, **kwargs
):
11874 """GetRow(self) -> int"""
11875 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
11877 def GetCol(*args
, **kwargs
):
11878 """GetCol(self) -> int"""
11879 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
11881 def SetRow(*args
, **kwargs
):
11882 """SetRow(self, int row)"""
11883 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
11885 def SetCol(*args
, **kwargs
):
11886 """SetCol(self, int col)"""
11887 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
11889 def __eq__(*args
, **kwargs
):
11891 __eq__(self, PyObject other) -> bool
11893 Compare GBPosition for equality.
11895 return _core_
.GBPosition___eq__(*args
, **kwargs
)
11897 def __ne__(*args
, **kwargs
):
11899 __ne__(self, PyObject other) -> bool
11901 Compare GBPosition for inequality.
11903 return _core_
.GBPosition___ne__(*args
, **kwargs
)
11905 def Set(*args
, **kwargs
):
11906 """Set(self, int row=0, int col=0)"""
11907 return _core_
.GBPosition_Set(*args
, **kwargs
)
11909 def Get(*args
, **kwargs
):
11910 """Get(self) -> PyObject"""
11911 return _core_
.GBPosition_Get(*args
, **kwargs
)
11913 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
11914 def __str__(self
): return str(self
.Get())
11915 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
11916 def __len__(self
): return len(self
.Get())
11917 def __getitem__(self
, index
): return self
.Get()[index
]
11918 def __setitem__(self
, index
, val
):
11919 if index
== 0: self
.SetRow(val
)
11920 elif index
== 1: self
.SetCol(val
)
11921 else: raise IndexError
11922 def __nonzero__(self
): return self
.Get() != (0,0)
11923 __safe_for_unpickling__
= True
11924 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
11926 row
= property(GetRow
, SetRow
)
11927 col
= property(GetCol
, SetCol
)
11929 _core_
.GBPosition_swigregister(GBPosition
)
11931 class GBSpan(object):
11933 This class is used to hold the row and column spanning attributes of
11934 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11935 automatically convert from a 2-element sequence of integers to a
11936 wx.GBSpan, so you can use the more pythonic representation of the span
11937 nearly transparently in Python code.
11940 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
11941 __repr__
= _swig_repr
11942 def __init__(self
, *args
, **kwargs
):
11944 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11946 Construct a new wxGBSpan, optionally setting the rowspan and
11947 colspan. The default is (1,1). (Meaning that the item occupies one
11948 cell in each direction.
11950 _core_
.GBSpan_swiginit(self
,_core_
.new_GBSpan(*args
, **kwargs
))
11951 __swig_destroy__
= _core_
.delete_GBSpan
11952 __del__
= lambda self
: None;
11953 def GetRowspan(*args
, **kwargs
):
11954 """GetRowspan(self) -> int"""
11955 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
11957 def GetColspan(*args
, **kwargs
):
11958 """GetColspan(self) -> int"""
11959 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
11961 def SetRowspan(*args
, **kwargs
):
11962 """SetRowspan(self, int rowspan)"""
11963 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
11965 def SetColspan(*args
, **kwargs
):
11966 """SetColspan(self, int colspan)"""
11967 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
11969 def __eq__(*args
, **kwargs
):
11971 __eq__(self, PyObject other) -> bool
11973 Compare wxGBSpan for equality.
11975 return _core_
.GBSpan___eq__(*args
, **kwargs
)
11977 def __ne__(*args
, **kwargs
):
11979 __ne__(self, PyObject other) -> bool
11981 Compare GBSpan for inequality.
11983 return _core_
.GBSpan___ne__(*args
, **kwargs
)
11985 def Set(*args
, **kwargs
):
11986 """Set(self, int rowspan=1, int colspan=1)"""
11987 return _core_
.GBSpan_Set(*args
, **kwargs
)
11989 def Get(*args
, **kwargs
):
11990 """Get(self) -> PyObject"""
11991 return _core_
.GBSpan_Get(*args
, **kwargs
)
11993 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
11994 def __str__(self
): return str(self
.Get())
11995 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
11996 def __len__(self
): return len(self
.Get())
11997 def __getitem__(self
, index
): return self
.Get()[index
]
11998 def __setitem__(self
, index
, val
):
11999 if index
== 0: self
.SetRowspan(val
)
12000 elif index
== 1: self
.SetColspan(val
)
12001 else: raise IndexError
12002 def __nonzero__(self
): return self
.Get() != (0,0)
12003 __safe_for_unpickling__
= True
12004 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
12006 rowspan
= property(GetRowspan
, SetRowspan
)
12007 colspan
= property(GetColspan
, SetColspan
)
12009 _core_
.GBSpan_swigregister(GBSpan
)
12011 class GBSizerItem(SizerItem
):
12013 The wx.GBSizerItem class is used to track the additional data about
12014 items in a `wx.GridBagSizer` such as the item's position in the grid
12015 and how many rows or columns it spans.
12018 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12019 __repr__
= _swig_repr
12020 def __init__(self
, *args
, **kwargs
):
12022 __init__(self) -> GBSizerItem
12024 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12025 size will need to be set, as well as a position and span before this
12026 item can be used in a Sizer.
12028 You will probably never need to create a wx.GBSizerItem directly as they
12029 are created automatically when the sizer's Add method is called.
12031 _core_
.GBSizerItem_swiginit(self
,_core_
.new_GBSizerItem(*args
, **kwargs
))
12032 __swig_destroy__
= _core_
.delete_GBSizerItem
12033 __del__
= lambda self
: None;
12034 def GetPos(*args
, **kwargs
):
12036 GetPos(self) -> GBPosition
12038 Get the grid position of the item
12040 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
12042 def GetPosTuple(self
): return self
.GetPos().Get()
12043 def GetSpan(*args
, **kwargs
):
12045 GetSpan(self) -> GBSpan
12047 Get the row and column spanning of the item
12049 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
12051 def GetSpanTuple(self
): return self
.GetSpan().Get()
12052 def SetPos(*args
, **kwargs
):
12054 SetPos(self, GBPosition pos) -> bool
12056 If the item is already a member of a sizer then first ensure that
12057 there is no other item that would intersect with this one at the new
12058 position, then set the new position. Returns True if the change is
12059 successful and after the next Layout() the item will be moved.
12061 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
12063 def SetSpan(*args
, **kwargs
):
12065 SetSpan(self, GBSpan span) -> bool
12067 If the item is already a member of a sizer then first ensure that
12068 there is no other item that would intersect with this one with its new
12069 spanning size, then set the new spanning. Returns True if the change
12070 is successful and after the next Layout() the item will be resized.
12073 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
12075 def Intersects(*args
, **kwargs
):
12077 Intersects(self, GBSizerItem other) -> bool
12079 Returns True if this item and the other item instersect.
12081 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
12083 def IntersectsPos(*args
, **kwargs
):
12085 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12087 Returns True if the given pos/span would intersect with this item.
12089 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
12091 def GetEndPos(*args
, **kwargs
):
12093 GetEndPos(self) -> GBPosition
12095 Get the row and column of the endpoint of this item.
12097 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
12099 def GetGBSizer(*args
, **kwargs
):
12101 GetGBSizer(self) -> GridBagSizer
12103 Get the sizer this item is a member of.
12105 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
12107 def SetGBSizer(*args
, **kwargs
):
12109 SetGBSizer(self, GridBagSizer sizer)
12111 Set the sizer this item is a member of.
12113 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
12115 _core_
.GBSizerItem_swigregister(GBSizerItem
)
12116 DefaultSpan
= cvar
.DefaultSpan
12118 def GBSizerItemWindow(*args
, **kwargs
):
12120 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12121 int border, PyObject userData=None) -> GBSizerItem
12123 Construct a `wx.GBSizerItem` for a window.
12125 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
12128 def GBSizerItemSizer(*args
, **kwargs
):
12130 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12131 int border, PyObject userData=None) -> GBSizerItem
12133 Construct a `wx.GBSizerItem` for a sizer
12135 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
12138 def GBSizerItemSpacer(*args
, **kwargs
):
12140 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12141 int flag, int border, PyObject userData=None) -> GBSizerItem
12143 Construct a `wx.GBSizerItem` for a spacer.
12145 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
12148 class GridBagSizer(FlexGridSizer
):
12150 A `wx.Sizer` that can lay out items in a virtual grid like a
12151 `wx.FlexGridSizer` but in this case explicit positioning of the items
12152 is allowed using `wx.GBPosition`, and items can optionally span more
12153 than one row and/or column using `wx.GBSpan`. The total size of the
12154 virtual grid is determined by the largest row and column that items are
12155 positioned at, adjusted for spanning.
12158 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12159 __repr__
= _swig_repr
12160 def __init__(self
, *args
, **kwargs
):
12162 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12164 Constructor, with optional parameters to specify the gap between the
12167 _core_
.GridBagSizer_swiginit(self
,_core_
.new_GridBagSizer(*args
, **kwargs
))
12168 self
._setOORInfo
(self
)
12170 def Add(*args
, **kwargs
):
12172 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12173 int border=0, userData=None) -> wx.GBSizerItem
12175 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12176 more than one row or column as specified with *span*. The remaining
12177 args behave similarly to `wx.Sizer.Add`.
12179 Returns True if the item was successfully placed at the given cell
12180 position, False if something was already there.
12183 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
12185 def AddItem(*args
, **kwargs
):
12187 Add(self, GBSizerItem item) -> wx.GBSizerItem
12189 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12190 the item was successfully placed at its given cell position, False if
12191 something was already there.
12193 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
12195 def GetCellSize(*args
, **kwargs
):
12197 GetCellSize(self, int row, int col) -> Size
12199 Get the size of the specified cell, including hgap and
12200 vgap. Only valid after a Layout.
12202 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
12204 def GetEmptyCellSize(*args
, **kwargs
):
12206 GetEmptyCellSize(self) -> Size
12208 Get the size used for cells in the grid with no item.
12210 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
12212 def SetEmptyCellSize(*args
, **kwargs
):
12214 SetEmptyCellSize(self, Size sz)
12216 Set the size used for cells in the grid with no item.
12218 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
12220 def GetItemPosition(*args
):
12222 GetItemPosition(self, item) -> GBPosition
12224 Get the grid position of the specified *item* where *item* is either a
12225 window or subsizer that is a member of this sizer, or a zero-based
12228 return _core_
.GridBagSizer_GetItemPosition(*args
)
12230 def SetItemPosition(*args
):
12232 SetItemPosition(self, item, GBPosition pos) -> bool
12234 Set the grid position of the specified *item* where *item* is either a
12235 window or subsizer that is a member of this sizer, or a zero-based
12236 index of an item. Returns True on success. If the move is not
12237 allowed (because an item is already there) then False is returned.
12240 return _core_
.GridBagSizer_SetItemPosition(*args
)
12242 def GetItemSpan(*args
):
12244 GetItemSpan(self, item) -> GBSpan
12246 Get the row/col spanning of the specified *item* where *item* is
12247 either a window or subsizer that is a member of this sizer, or a
12248 zero-based index of an item.
12250 return _core_
.GridBagSizer_GetItemSpan(*args
)
12252 def SetItemSpan(*args
):
12254 SetItemSpan(self, item, GBSpan span) -> bool
12256 Set the row/col spanning of the specified *item* where *item* is
12257 either a window or subsizer that is a member of this sizer, or a
12258 zero-based index of an item. Returns True on success. If the move is
12259 not allowed (because an item is already there) then False is returned.
12261 return _core_
.GridBagSizer_SetItemSpan(*args
)
12263 def FindItem(*args
):
12265 FindItem(self, item) -> GBSizerItem
12267 Find the sizer item for the given window or subsizer, returns None if
12268 not found. (non-recursive)
12270 return _core_
.GridBagSizer_FindItem(*args
)
12272 def FindItemAtPosition(*args
, **kwargs
):
12274 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12276 Return the sizer item for the given grid cell, or None if there is no
12277 item at that position. (non-recursive)
12279 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
12281 def FindItemAtPoint(*args
, **kwargs
):
12283 FindItemAtPoint(self, Point pt) -> GBSizerItem
12285 Return the sizer item located at the point given in *pt*, or None if
12286 there is no item at that point. The (x,y) coordinates in pt correspond
12287 to the client coordinates of the window using the sizer for
12288 layout. (non-recursive)
12290 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
12292 def CheckForIntersection(*args
, **kwargs
):
12294 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12296 Look at all items and see if any intersect (or would overlap) the
12297 given *item*. Returns True if so, False if there would be no overlap.
12298 If an *excludeItem* is given then it will not be checked for
12299 intersection, for example it may be the item we are checking the
12303 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
12305 def CheckForIntersectionPos(*args
, **kwargs
):
12307 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12309 Look at all items and see if any intersect (or would overlap) the
12310 given position and span. Returns True if so, False if there would be
12311 no overlap. If an *excludeItem* is given then it will not be checked
12312 for intersection, for example it may be the item we are checking the
12315 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
12317 _core_
.GridBagSizer_swigregister(GridBagSizer
)
12319 #---------------------------------------------------------------------------
12323 Right
= _core_
.Right
12324 Bottom
= _core_
.Bottom
12325 Width
= _core_
.Width
12326 Height
= _core_
.Height
12327 Centre
= _core_
.Centre
12328 Center
= _core_
.Center
12329 CentreX
= _core_
.CentreX
12330 CentreY
= _core_
.CentreY
12331 Unconstrained
= _core_
.Unconstrained
12333 PercentOf
= _core_
.PercentOf
12334 Above
= _core_
.Above
12335 Below
= _core_
.Below
12336 LeftOf
= _core_
.LeftOf
12337 RightOf
= _core_
.RightOf
12338 SameAs
= _core_
.SameAs
12339 Absolute
= _core_
.Absolute
12340 class IndividualLayoutConstraint(Object
):
12342 Objects of this class are stored in the `wx.LayoutConstraints` class as
12343 one of eight possible constraints that a window can be involved in.
12344 You will never need to create an instance of
12345 wx.IndividualLayoutConstraint, rather you should create a
12346 `wx.LayoutConstraints` instance and use the individual contstraints
12349 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12350 def __init__(self
): raise AttributeError, "No constructor defined"
12351 __repr__
= _swig_repr
12352 def Set(*args
, **kwargs
):
12354 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12356 Sets the properties of the constraint. Normally called by one of the
12357 convenience functions such as Above, RightOf, SameAs.
12359 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
12361 def LeftOf(*args
, **kwargs
):
12363 LeftOf(self, Window sibling, int marg=0)
12365 Constrains this edge to be to the left of the given window, with an
12366 optional margin. Implicitly, this is relative to the left edge of the
12369 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
12371 def RightOf(*args
, **kwargs
):
12373 RightOf(self, Window sibling, int marg=0)
12375 Constrains this edge to be to the right of the given window, with an
12376 optional margin. Implicitly, this is relative to the right edge of the
12379 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
12381 def Above(*args
, **kwargs
):
12383 Above(self, Window sibling, int marg=0)
12385 Constrains this edge to be above the given window, with an optional
12386 margin. Implicitly, this is relative to the top edge of the other
12389 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
12391 def Below(*args
, **kwargs
):
12393 Below(self, Window sibling, int marg=0)
12395 Constrains this edge to be below the given window, with an optional
12396 margin. Implicitly, this is relative to the bottom edge of the other
12399 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
12401 def SameAs(*args
, **kwargs
):
12403 SameAs(self, Window otherW, int edge, int marg=0)
12405 Constrains this edge or dimension to be to the same as the edge of the
12406 given window, with an optional margin.
12408 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
12410 def PercentOf(*args
, **kwargs
):
12412 PercentOf(self, Window otherW, int wh, int per)
12414 Constrains this edge or dimension to be to a percentage of the given
12415 window, with an optional margin.
12417 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
12419 def Absolute(*args
, **kwargs
):
12421 Absolute(self, int val)
12423 Constrains this edge or dimension to be the given absolute value.
12425 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
12427 def Unconstrained(*args
, **kwargs
):
12429 Unconstrained(self)
12431 Sets this edge or dimension to be unconstrained, that is, dependent on
12432 other edges and dimensions from which this value can be deduced.
12434 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
12436 def AsIs(*args
, **kwargs
):
12440 Sets this edge or constraint to be whatever the window's value is at
12441 the moment. If either of the width and height constraints are *as is*,
12442 the window will not be resized, but moved instead. This is important
12443 when considering panel items which are intended to have a default
12444 size, such as a button, which may take its size from the size of the
12447 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
12449 def GetOtherWindow(*args
, **kwargs
):
12450 """GetOtherWindow(self) -> Window"""
12451 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
12453 def GetMyEdge(*args
, **kwargs
):
12454 """GetMyEdge(self) -> int"""
12455 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
12457 def SetEdge(*args
, **kwargs
):
12458 """SetEdge(self, int which)"""
12459 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
12461 def SetValue(*args
, **kwargs
):
12462 """SetValue(self, int v)"""
12463 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
12465 def GetMargin(*args
, **kwargs
):
12466 """GetMargin(self) -> int"""
12467 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
12469 def SetMargin(*args
, **kwargs
):
12470 """SetMargin(self, int m)"""
12471 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
12473 def GetValue(*args
, **kwargs
):
12474 """GetValue(self) -> int"""
12475 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
12477 def GetPercent(*args
, **kwargs
):
12478 """GetPercent(self) -> int"""
12479 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
12481 def GetOtherEdge(*args
, **kwargs
):
12482 """GetOtherEdge(self) -> int"""
12483 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
12485 def GetDone(*args
, **kwargs
):
12486 """GetDone(self) -> bool"""
12487 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
12489 def SetDone(*args
, **kwargs
):
12490 """SetDone(self, bool d)"""
12491 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
12493 def GetRelationship(*args
, **kwargs
):
12494 """GetRelationship(self) -> int"""
12495 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
12497 def SetRelationship(*args
, **kwargs
):
12498 """SetRelationship(self, int r)"""
12499 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
12501 def ResetIfWin(*args
, **kwargs
):
12503 ResetIfWin(self, Window otherW) -> bool
12505 Reset constraint if it mentions otherWin
12507 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
12509 def SatisfyConstraint(*args
, **kwargs
):
12511 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12513 Try to satisfy constraint
12515 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
12517 def GetEdge(*args
, **kwargs
):
12519 GetEdge(self, int which, Window thisWin, Window other) -> int
12521 Get the value of this edge or dimension, or if this
12522 is not determinable, -1.
12524 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
12526 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint
)
12528 class LayoutConstraints(Object
):
12530 **Note:** constraints are now deprecated and you should use sizers
12533 Objects of this class can be associated with a window to define its
12534 layout constraints, with respect to siblings or its parent.
12536 The class consists of the following eight constraints of class
12537 wx.IndividualLayoutConstraint, some or all of which should be accessed
12538 directly to set the appropriate constraints.
12540 * left: represents the left hand edge of the window
12541 * right: represents the right hand edge of the window
12542 * top: represents the top edge of the window
12543 * bottom: represents the bottom edge of the window
12544 * width: represents the width of the window
12545 * height: represents the height of the window
12546 * centreX: represents the horizontal centre point of the window
12547 * centreY: represents the vertical centre point of the window
12549 Most constraints are initially set to have the relationship
12550 wxUnconstrained, which means that their values should be calculated by
12551 looking at known constraints. The exceptions are width and height,
12552 which are set to wxAsIs to ensure that if the user does not specify a
12553 constraint, the existing width and height will be used, to be
12554 compatible with panel items which often have take a default size. If
12555 the constraint is ``wx.AsIs``, the dimension will not be changed.
12557 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12560 thisown
= property(lambda x
: x
.this
.own(), lambda x
, v
: x
.this
.own(v
), doc
='The membership flag')
12561 __repr__
= _swig_repr
12562 left
= property(_core_
.LayoutConstraints_left_get
)
12563 top
= property(_core_
.LayoutConstraints_top_get
)
12564 right
= property(_core_
.LayoutConstraints_right_get
)
12565 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
12566 width
= property(_core_
.LayoutConstraints_width_get
)
12567 height
= property(_core_
.LayoutConstraints_height_get
)
12568 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
12569 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
12570 def __init__(self
, *args
, **kwargs
):
12571 """__init__(self) -> LayoutConstraints"""
12572 _core_
.LayoutConstraints_swiginit(self
,_core_
.new_LayoutConstraints(*args
, **kwargs
))
12573 __swig_destroy__
= _core_
.delete_LayoutConstraints
12574 __del__
= lambda self
: None;
12575 def SatisfyConstraints(*args
, **kwargs
):
12576 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12577 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
12579 def AreSatisfied(*args
, **kwargs
):
12580 """AreSatisfied(self) -> bool"""
12581 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
12583 _core_
.LayoutConstraints_swigregister(LayoutConstraints
)
12585 #----------------------------------------------------------------------------
12587 # Use Python's bool constants if available, make some if not
12591 __builtins__
.True = 1==1
12592 __builtins__
.False = 1==0
12593 def bool(value
): return not not value
12594 __builtins__
.bool = bool
12598 # workarounds for bad wxRTTI names
12599 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
12600 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
12601 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
12604 #----------------------------------------------------------------------------
12605 # Load version numbers from __version__... Ensure that major and minor
12606 # versions are the same for both wxPython and wxWidgets.
12608 from __version__
import *
12609 __version__
= VERSION_STRING
12611 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
12612 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
12613 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
12615 warnings
.warn("wxPython/wxWidgets release number mismatch")
12617 #----------------------------------------------------------------------------
12619 # Set wxPython's default string<-->unicode conversion encoding from
12620 # the locale, but only if Python's default hasn't been changed. (We
12621 # assume that if the user has customized it already then that is the
12622 # encoding we need to use as well.)
12624 # The encoding selected here is used when string or unicode objects
12625 # need to be converted in order to pass them to wxWidgets. Please be
12626 # aware that the default encoding within the same locale may be
12627 # slightly different on different platforms. For example, please see
12628 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12629 # between the common latin/roman encodings.
12631 default
= _sys
.getdefaultencoding()
12632 if default
== 'ascii':
12636 default
= locale
.getdefaultlocale()[1]
12637 codecs
.lookup(default
)
12638 except (ValueError, LookupError, TypeError):
12639 default
= _sys
.getdefaultencoding()
12643 wx
.SetDefaultPyEncoding(default
)
12646 #----------------------------------------------------------------------------
12648 class PyDeadObjectError(AttributeError):
12651 class _wxPyDeadObject(object):
12653 Instances of wx objects that are OOR capable will have their __class__
12654 changed to this class when the C++ object is deleted. This should help
12655 prevent crashes due to referencing a bogus C++ pointer.
12657 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12658 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12660 def __repr__(self
):
12661 if not hasattr(self
, "_name"):
12662 self
._name
= "[unknown]"
12663 return self
.reprStr
% self
._name
12665 def __getattr__(self
, *args
):
12666 if not hasattr(self
, "_name"):
12667 self
._name
= "[unknown]"
12668 raise PyDeadObjectError(self
.attrStr
% self
._name
)
12670 def __nonzero__(self
):
12675 class PyUnbornObjectError(AttributeError):
12678 class _wxPyUnbornObject(object):
12680 Some stock objects are created when the wx._core module is
12681 imported, but their C++ instance is not created until the wx.App
12682 object is created and initialized. These object instances will
12683 temporarily have their __class__ changed to this class so an
12684 exception will be raised if they are used before the C++ instance
12688 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12689 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
12691 def __repr__(self
):
12692 #if not hasattr(self, "_name"):
12693 # self._name = "[unknown]"
12694 return self
.reprStr
#% self._name
12696 def __getattr__(self
, *args
):
12697 #if not hasattr(self, "_name"):
12698 # self._name = "[unknown]"
12699 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
12701 def __nonzero__(self
):
12705 #----------------------------------------------------------------------------
12707 def CallAfter(callable, *args
, **kw
):
12709 Call the specified function after the current and pending event
12710 handlers have been completed. This is also good for making GUI
12711 method calls from non-GUI threads. Any extra positional or
12712 keyword args are passed on to the callable when it is called.
12714 :see: `wx.FutureCall`
12717 assert app
is not None, 'No wx.App created yet'
12719 if not hasattr(app
, "_CallAfterId"):
12720 app
._CallAfterId
= wx
.NewEventType()
12721 app
.Connect(-1, -1, app
._CallAfterId
,
12722 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
12724 evt
.SetEventType(app
._CallAfterId
)
12725 evt
.callable = callable
12728 wx
.PostEvent(app
, evt
)
12730 #----------------------------------------------------------------------------
12735 A convenience class for `wx.Timer`, that calls the given callable
12736 object once after the given amount of milliseconds, passing any
12737 positional or keyword args. The return value of the callable is
12738 availbale after it has been run with the `GetResult` method.
12740 If you don't need to get the return value or restart the timer
12741 then there is no need to hold a reference to this object. It will
12742 hold a reference to itself while the timer is running (the timer
12743 has a reference to self.Notify) but the cycle will be broken when
12744 the timer completes, automatically cleaning up the wx.FutureCall
12747 :see: `wx.CallAfter`
12749 def __init__(self
, millis
, callable, *args
, **kwargs
):
12750 self
.millis
= millis
12751 self
.callable = callable
12752 self
.SetArgs(*args
, **kwargs
)
12754 self
.running
= False
12755 self
.hasRun
= False
12764 def Start(self
, millis
=None, *args
, **kwargs
):
12766 (Re)start the timer
12768 self
.hasRun
= False
12769 if millis
is not None:
12770 self
.millis
= millis
12772 self
.SetArgs(*args
, **kwargs
)
12774 self
.timer
= wx
.PyTimer(self
.Notify
)
12775 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
12776 self
.running
= True
12782 Stop and destroy the timer.
12784 if self
.timer
is not None:
12789 def GetInterval(self
):
12790 if self
.timer
is not None:
12791 return self
.timer
.GetInterval()
12796 def IsRunning(self
):
12797 return self
.timer
is not None and self
.timer
.IsRunning()
12800 def SetArgs(self
, *args
, **kwargs
):
12802 (Re)set the args passed to the callable object. This is
12803 useful in conjunction with Restart if you want to schedule a
12804 new call to the same callable object but with different
12808 self
.kwargs
= kwargs
12814 def GetResult(self
):
12819 The timer has expired so call the callable.
12821 if self
.callable and getattr(self
.callable, 'im_self', True):
12823 self
.running
= False
12824 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
12826 if not self
.running
:
12827 # if it wasn't restarted, then cleanup
12828 wx
.CallAfter(self
.Stop
)
12832 #----------------------------------------------------------------------------
12833 # Control which items in this module should be documented by epydoc.
12834 # We allow only classes and functions, which will help reduce the size
12835 # of the docs by filtering out the zillions of constants, EVT objects,
12836 # and etc that don't make much sense by themselves, but are instead
12837 # documented (or will be) as part of the classes/functions/methods
12838 # where they should be used.
12842 A filter for epydoc that only allows non-Ptr classes and
12843 fucntions, in order to reduce the clutter in the API docs.
12845 def __init__(self
, globals):
12846 self
._globals
= globals
12848 def __call__(self
, name
):
12850 obj
= self
._globals
.get(name
, None)
12851 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
12853 if name
.startswith('_') or name
.startswith('EVT') or name
.endswith('_swigregister') or name
.endswith('Ptr') :
12857 #----------------------------------------------------------------------------
12858 #----------------------------------------------------------------------------
12860 # Import other modules in this package that should show up in the
12861 # "core" wx namespace
12863 from _windows
import *
12864 from _controls
import *
12865 from _misc
import *
12867 #----------------------------------------------------------------------------
12868 #----------------------------------------------------------------------------