1 # This file was created automatically by SWIG.
2 # Don't modify this file, modify the SWIG interface instead.
6 def _swig_setattr_nondynamic(self
,class_type
,name
,value
,static
=1):
8 if isinstance(value
, class_type
):
9 self
.__dict
__[name
] = value
.this
10 if hasattr(value
,"thisown"): self
.__dict
__["thisown"] = value
.thisown
13 method
= class_type
.__swig
_setmethods
__.get(name
,None)
14 if method
: return method(self
,value
)
15 if (not static
) or hasattr(self
,name
) or (name
== "thisown"):
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 method
= class_type
.__swig
_getmethods
__.get(name
,None)
25 if method
: return method(self
)
26 raise AttributeError,name
30 _object
= types
.ObjectType
32 except AttributeError:
38 def _swig_setattr_nondynamic_method(set):
39 def set_attr(self
,name
,value
):
40 if hasattr(self
,name
) or (name
in ("this", "thisown")):
43 raise AttributeError("You cannot add attributes to %s" % self
)
47 #// Give a reference to the dictionary of this module to the C++ extension
49 _core_
._wxPySetDictionary
(vars())
51 #// A little trick to make 'wx' be a reference to this module so wx.Names can
54 wx
= _sys
.modules
[__name__
]
57 #----------------------------------------------------------------------------
59 def _deprecated(callable, msg
=None):
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
65 msg
= "%s is deprecated" % callable
66 def deprecatedWrapper(*args
, **kwargs
):
68 warnings
.warn(msg
, DeprecationWarning, stacklevel
=2)
69 return callable(*args
, **kwargs
)
70 deprecatedWrapper
.__doc
__ = msg
71 return deprecatedWrapper
74 #----------------------------------------------------------------------------
76 NOT_FOUND
= _core_
.NOT_FOUND
77 VSCROLL
= _core_
.VSCROLL
78 HSCROLL
= _core_
.HSCROLL
79 CAPTION
= _core_
.CAPTION
80 DOUBLE_BORDER
= _core_
.DOUBLE_BORDER
81 SUNKEN_BORDER
= _core_
.SUNKEN_BORDER
82 RAISED_BORDER
= _core_
.RAISED_BORDER
83 BORDER
= _core_
.BORDER
84 SIMPLE_BORDER
= _core_
.SIMPLE_BORDER
85 STATIC_BORDER
= _core_
.STATIC_BORDER
86 TRANSPARENT_WINDOW
= _core_
.TRANSPARENT_WINDOW
87 NO_BORDER
= _core_
.NO_BORDER
88 DEFAULT_CONTROL_BORDER
= _core_
.DEFAULT_CONTROL_BORDER
89 DEFAULT_STATUSBAR_STYLE
= _core_
.DEFAULT_STATUSBAR_STYLE
90 TAB_TRAVERSAL
= _core_
.TAB_TRAVERSAL
91 WANTS_CHARS
= _core_
.WANTS_CHARS
92 POPUP_WINDOW
= _core_
.POPUP_WINDOW
93 CENTER_FRAME
= _core_
.CENTER_FRAME
94 CENTRE_ON_SCREEN
= _core_
.CENTRE_ON_SCREEN
95 CENTER_ON_SCREEN
= _core_
.CENTER_ON_SCREEN
96 CLIP_CHILDREN
= _core_
.CLIP_CHILDREN
97 CLIP_SIBLINGS
= _core_
.CLIP_SIBLINGS
98 ALWAYS_SHOW_SB
= _core_
.ALWAYS_SHOW_SB
99 RETAINED
= _core_
.RETAINED
100 BACKINGSTORE
= _core_
.BACKINGSTORE
101 COLOURED
= _core_
.COLOURED
102 FIXED_LENGTH
= _core_
.FIXED_LENGTH
103 LB_NEEDED_SB
= _core_
.LB_NEEDED_SB
104 LB_ALWAYS_SB
= _core_
.LB_ALWAYS_SB
105 LB_SORT
= _core_
.LB_SORT
106 LB_SINGLE
= _core_
.LB_SINGLE
107 LB_MULTIPLE
= _core_
.LB_MULTIPLE
108 LB_EXTENDED
= _core_
.LB_EXTENDED
109 LB_OWNERDRAW
= _core_
.LB_OWNERDRAW
110 LB_HSCROLL
= _core_
.LB_HSCROLL
111 PROCESS_ENTER
= _core_
.PROCESS_ENTER
112 PASSWORD
= _core_
.PASSWORD
113 CB_SIMPLE
= _core_
.CB_SIMPLE
114 CB_DROPDOWN
= _core_
.CB_DROPDOWN
115 CB_SORT
= _core_
.CB_SORT
116 CB_READONLY
= _core_
.CB_READONLY
117 RA_HORIZONTAL
= _core_
.RA_HORIZONTAL
118 RA_VERTICAL
= _core_
.RA_VERTICAL
119 RA_SPECIFY_ROWS
= _core_
.RA_SPECIFY_ROWS
120 RA_SPECIFY_COLS
= _core_
.RA_SPECIFY_COLS
121 RA_USE_CHECKBOX
= _core_
.RA_USE_CHECKBOX
122 RB_GROUP
= _core_
.RB_GROUP
123 RB_SINGLE
= _core_
.RB_SINGLE
124 SB_HORIZONTAL
= _core_
.SB_HORIZONTAL
125 SB_VERTICAL
= _core_
.SB_VERTICAL
126 RB_USE_CHECKBOX
= _core_
.RB_USE_CHECKBOX
127 ST_SIZEGRIP
= _core_
.ST_SIZEGRIP
128 ST_NO_AUTORESIZE
= _core_
.ST_NO_AUTORESIZE
129 FLOOD_SURFACE
= _core_
.FLOOD_SURFACE
130 FLOOD_BORDER
= _core_
.FLOOD_BORDER
131 ODDEVEN_RULE
= _core_
.ODDEVEN_RULE
132 WINDING_RULE
= _core_
.WINDING_RULE
133 TOOL_TOP
= _core_
.TOOL_TOP
134 TOOL_BOTTOM
= _core_
.TOOL_BOTTOM
135 TOOL_LEFT
= _core_
.TOOL_LEFT
136 TOOL_RIGHT
= _core_
.TOOL_RIGHT
138 YES_NO
= _core_
.YES_NO
139 CANCEL
= _core_
.CANCEL
142 NO_DEFAULT
= _core_
.NO_DEFAULT
143 YES_DEFAULT
= _core_
.YES_DEFAULT
144 ICON_EXCLAMATION
= _core_
.ICON_EXCLAMATION
145 ICON_HAND
= _core_
.ICON_HAND
146 ICON_QUESTION
= _core_
.ICON_QUESTION
147 ICON_INFORMATION
= _core_
.ICON_INFORMATION
148 ICON_STOP
= _core_
.ICON_STOP
149 ICON_ASTERISK
= _core_
.ICON_ASTERISK
150 ICON_MASK
= _core_
.ICON_MASK
151 ICON_WARNING
= _core_
.ICON_WARNING
152 ICON_ERROR
= _core_
.ICON_ERROR
153 FORWARD
= _core_
.FORWARD
154 BACKWARD
= _core_
.BACKWARD
159 SIZE_AUTO_WIDTH
= _core_
.SIZE_AUTO_WIDTH
160 SIZE_AUTO_HEIGHT
= _core_
.SIZE_AUTO_HEIGHT
161 SIZE_AUTO
= _core_
.SIZE_AUTO
162 SIZE_USE_EXISTING
= _core_
.SIZE_USE_EXISTING
163 SIZE_ALLOW_MINUS_ONE
= _core_
.SIZE_ALLOW_MINUS_ONE
164 PORTRAIT
= _core_
.PORTRAIT
165 LANDSCAPE
= _core_
.LANDSCAPE
166 PRINT_QUALITY_HIGH
= _core_
.PRINT_QUALITY_HIGH
167 PRINT_QUALITY_MEDIUM
= _core_
.PRINT_QUALITY_MEDIUM
168 PRINT_QUALITY_LOW
= _core_
.PRINT_QUALITY_LOW
169 PRINT_QUALITY_DRAFT
= _core_
.PRINT_QUALITY_DRAFT
170 ID_ANY
= _core_
.ID_ANY
171 ID_SEPARATOR
= _core_
.ID_SEPARATOR
172 ID_LOWEST
= _core_
.ID_LOWEST
173 ID_OPEN
= _core_
.ID_OPEN
174 ID_CLOSE
= _core_
.ID_CLOSE
175 ID_NEW
= _core_
.ID_NEW
176 ID_SAVE
= _core_
.ID_SAVE
177 ID_SAVEAS
= _core_
.ID_SAVEAS
178 ID_REVERT
= _core_
.ID_REVERT
179 ID_EXIT
= _core_
.ID_EXIT
180 ID_UNDO
= _core_
.ID_UNDO
181 ID_REDO
= _core_
.ID_REDO
182 ID_HELP
= _core_
.ID_HELP
183 ID_PRINT
= _core_
.ID_PRINT
184 ID_PRINT_SETUP
= _core_
.ID_PRINT_SETUP
185 ID_PREVIEW
= _core_
.ID_PREVIEW
186 ID_ABOUT
= _core_
.ID_ABOUT
187 ID_HELP_CONTENTS
= _core_
.ID_HELP_CONTENTS
188 ID_HELP_COMMANDS
= _core_
.ID_HELP_COMMANDS
189 ID_HELP_PROCEDURES
= _core_
.ID_HELP_PROCEDURES
190 ID_HELP_CONTEXT
= _core_
.ID_HELP_CONTEXT
191 ID_CLOSE_ALL
= _core_
.ID_CLOSE_ALL
192 ID_PREFERENCES
= _core_
.ID_PREFERENCES
193 ID_CUT
= _core_
.ID_CUT
194 ID_COPY
= _core_
.ID_COPY
195 ID_PASTE
= _core_
.ID_PASTE
196 ID_CLEAR
= _core_
.ID_CLEAR
197 ID_FIND
= _core_
.ID_FIND
198 ID_DUPLICATE
= _core_
.ID_DUPLICATE
199 ID_SELECTALL
= _core_
.ID_SELECTALL
200 ID_DELETE
= _core_
.ID_DELETE
201 ID_REPLACE
= _core_
.ID_REPLACE
202 ID_REPLACE_ALL
= _core_
.ID_REPLACE_ALL
203 ID_PROPERTIES
= _core_
.ID_PROPERTIES
204 ID_VIEW_DETAILS
= _core_
.ID_VIEW_DETAILS
205 ID_VIEW_LARGEICONS
= _core_
.ID_VIEW_LARGEICONS
206 ID_VIEW_SMALLICONS
= _core_
.ID_VIEW_SMALLICONS
207 ID_VIEW_LIST
= _core_
.ID_VIEW_LIST
208 ID_VIEW_SORTDATE
= _core_
.ID_VIEW_SORTDATE
209 ID_VIEW_SORTNAME
= _core_
.ID_VIEW_SORTNAME
210 ID_VIEW_SORTSIZE
= _core_
.ID_VIEW_SORTSIZE
211 ID_VIEW_SORTTYPE
= _core_
.ID_VIEW_SORTTYPE
212 ID_FILE1
= _core_
.ID_FILE1
213 ID_FILE2
= _core_
.ID_FILE2
214 ID_FILE3
= _core_
.ID_FILE3
215 ID_FILE4
= _core_
.ID_FILE4
216 ID_FILE5
= _core_
.ID_FILE5
217 ID_FILE6
= _core_
.ID_FILE6
218 ID_FILE7
= _core_
.ID_FILE7
219 ID_FILE8
= _core_
.ID_FILE8
220 ID_FILE9
= _core_
.ID_FILE9
222 ID_CANCEL
= _core_
.ID_CANCEL
223 ID_APPLY
= _core_
.ID_APPLY
224 ID_YES
= _core_
.ID_YES
226 ID_STATIC
= _core_
.ID_STATIC
227 ID_FORWARD
= _core_
.ID_FORWARD
228 ID_BACKWARD
= _core_
.ID_BACKWARD
229 ID_DEFAULT
= _core_
.ID_DEFAULT
230 ID_MORE
= _core_
.ID_MORE
231 ID_SETUP
= _core_
.ID_SETUP
232 ID_RESET
= _core_
.ID_RESET
233 ID_CONTEXT_HELP
= _core_
.ID_CONTEXT_HELP
234 ID_YESTOALL
= _core_
.ID_YESTOALL
235 ID_NOTOALL
= _core_
.ID_NOTOALL
236 ID_ABORT
= _core_
.ID_ABORT
237 ID_RETRY
= _core_
.ID_RETRY
238 ID_IGNORE
= _core_
.ID_IGNORE
239 ID_ADD
= _core_
.ID_ADD
240 ID_REMOVE
= _core_
.ID_REMOVE
242 ID_DOWN
= _core_
.ID_DOWN
243 ID_HOME
= _core_
.ID_HOME
244 ID_REFRESH
= _core_
.ID_REFRESH
245 ID_STOP
= _core_
.ID_STOP
246 ID_INDEX
= _core_
.ID_INDEX
247 ID_BOLD
= _core_
.ID_BOLD
248 ID_ITALIC
= _core_
.ID_ITALIC
249 ID_JUSTIFY_CENTER
= _core_
.ID_JUSTIFY_CENTER
250 ID_JUSTIFY_FILL
= _core_
.ID_JUSTIFY_FILL
251 ID_JUSTIFY_RIGHT
= _core_
.ID_JUSTIFY_RIGHT
252 ID_JUSTIFY_LEFT
= _core_
.ID_JUSTIFY_LEFT
253 ID_UNDERLINE
= _core_
.ID_UNDERLINE
254 ID_INDENT
= _core_
.ID_INDENT
255 ID_UNINDENT
= _core_
.ID_UNINDENT
256 ID_ZOOM_100
= _core_
.ID_ZOOM_100
257 ID_ZOOM_FIT
= _core_
.ID_ZOOM_FIT
258 ID_ZOOM_IN
= _core_
.ID_ZOOM_IN
259 ID_ZOOM_OUT
= _core_
.ID_ZOOM_OUT
260 ID_UNDELETE
= _core_
.ID_UNDELETE
261 ID_REVERT_TO_SAVED
= _core_
.ID_REVERT_TO_SAVED
262 ID_HIGHEST
= _core_
.ID_HIGHEST
265 HIDE_READONLY
= _core_
.HIDE_READONLY
266 OVERWRITE_PROMPT
= _core_
.OVERWRITE_PROMPT
267 FILE_MUST_EXIST
= _core_
.FILE_MUST_EXIST
268 MULTIPLE
= _core_
.MULTIPLE
269 CHANGE_DIR
= _core_
.CHANGE_DIR
270 ACCEL_ALT
= _core_
.ACCEL_ALT
271 ACCEL_CTRL
= _core_
.ACCEL_CTRL
272 ACCEL_SHIFT
= _core_
.ACCEL_SHIFT
273 ACCEL_NORMAL
= _core_
.ACCEL_NORMAL
274 PD_AUTO_HIDE
= _core_
.PD_AUTO_HIDE
275 PD_APP_MODAL
= _core_
.PD_APP_MODAL
276 PD_CAN_ABORT
= _core_
.PD_CAN_ABORT
277 PD_ELAPSED_TIME
= _core_
.PD_ELAPSED_TIME
278 PD_ESTIMATED_TIME
= _core_
.PD_ESTIMATED_TIME
279 PD_REMAINING_TIME
= _core_
.PD_REMAINING_TIME
280 PD_SMOOTH
= _core_
.PD_SMOOTH
281 PD_CAN_SKIP
= _core_
.PD_CAN_SKIP
282 DD_NEW_DIR_BUTTON
= _core_
.DD_NEW_DIR_BUTTON
283 DD_DEFAULT_STYLE
= _core_
.DD_DEFAULT_STYLE
284 MENU_TEAROFF
= _core_
.MENU_TEAROFF
285 MB_DOCKABLE
= _core_
.MB_DOCKABLE
286 NO_FULL_REPAINT_ON_RESIZE
= _core_
.NO_FULL_REPAINT_ON_RESIZE
287 FULL_REPAINT_ON_RESIZE
= _core_
.FULL_REPAINT_ON_RESIZE
288 LI_HORIZONTAL
= _core_
.LI_HORIZONTAL
289 LI_VERTICAL
= _core_
.LI_VERTICAL
290 WS_EX_VALIDATE_RECURSIVELY
= _core_
.WS_EX_VALIDATE_RECURSIVELY
291 WS_EX_BLOCK_EVENTS
= _core_
.WS_EX_BLOCK_EVENTS
292 WS_EX_TRANSIENT
= _core_
.WS_EX_TRANSIENT
293 WS_EX_THEMED_BACKGROUND
= _core_
.WS_EX_THEMED_BACKGROUND
294 WS_EX_PROCESS_IDLE
= _core_
.WS_EX_PROCESS_IDLE
295 WS_EX_PROCESS_UI_UPDATES
= _core_
.WS_EX_PROCESS_UI_UPDATES
296 MM_TEXT
= _core_
.MM_TEXT
297 MM_LOMETRIC
= _core_
.MM_LOMETRIC
298 MM_HIMETRIC
= _core_
.MM_HIMETRIC
299 MM_LOENGLISH
= _core_
.MM_LOENGLISH
300 MM_HIENGLISH
= _core_
.MM_HIENGLISH
301 MM_TWIPS
= _core_
.MM_TWIPS
302 MM_ISOTROPIC
= _core_
.MM_ISOTROPIC
303 MM_ANISOTROPIC
= _core_
.MM_ANISOTROPIC
304 MM_POINTS
= _core_
.MM_POINTS
305 MM_METRIC
= _core_
.MM_METRIC
306 CENTRE
= _core_
.CENTRE
307 CENTER
= _core_
.CENTER
308 HORIZONTAL
= _core_
.HORIZONTAL
309 VERTICAL
= _core_
.VERTICAL
316 BOTTOM
= _core_
.BOTTOM
322 ALIGN_NOT
= _core_
.ALIGN_NOT
323 ALIGN_CENTER_HORIZONTAL
= _core_
.ALIGN_CENTER_HORIZONTAL
324 ALIGN_CENTRE_HORIZONTAL
= _core_
.ALIGN_CENTRE_HORIZONTAL
325 ALIGN_LEFT
= _core_
.ALIGN_LEFT
326 ALIGN_TOP
= _core_
.ALIGN_TOP
327 ALIGN_RIGHT
= _core_
.ALIGN_RIGHT
328 ALIGN_BOTTOM
= _core_
.ALIGN_BOTTOM
329 ALIGN_CENTER_VERTICAL
= _core_
.ALIGN_CENTER_VERTICAL
330 ALIGN_CENTRE_VERTICAL
= _core_
.ALIGN_CENTRE_VERTICAL
331 ALIGN_CENTER
= _core_
.ALIGN_CENTER
332 ALIGN_CENTRE
= _core_
.ALIGN_CENTRE
333 ALIGN_MASK
= _core_
.ALIGN_MASK
334 STRETCH_NOT
= _core_
.STRETCH_NOT
335 SHRINK
= _core_
.SHRINK
337 EXPAND
= _core_
.EXPAND
338 SHAPED
= _core_
.SHAPED
339 FIXED_MINSIZE
= _core_
.FIXED_MINSIZE
341 ADJUST_MINSIZE
= _core_
.ADJUST_MINSIZE
342 BORDER_DEFAULT
= _core_
.BORDER_DEFAULT
343 BORDER_NONE
= _core_
.BORDER_NONE
344 BORDER_STATIC
= _core_
.BORDER_STATIC
345 BORDER_SIMPLE
= _core_
.BORDER_SIMPLE
346 BORDER_RAISED
= _core_
.BORDER_RAISED
347 BORDER_SUNKEN
= _core_
.BORDER_SUNKEN
348 BORDER_DOUBLE
= _core_
.BORDER_DOUBLE
349 BORDER_MASK
= _core_
.BORDER_MASK
350 BG_STYLE_SYSTEM
= _core_
.BG_STYLE_SYSTEM
351 BG_STYLE_COLOUR
= _core_
.BG_STYLE_COLOUR
352 BG_STYLE_CUSTOM
= _core_
.BG_STYLE_CUSTOM
353 DEFAULT
= _core_
.DEFAULT
354 DECORATIVE
= _core_
.DECORATIVE
356 SCRIPT
= _core_
.SCRIPT
358 MODERN
= _core_
.MODERN
359 TELETYPE
= _core_
.TELETYPE
360 VARIABLE
= _core_
.VARIABLE
362 NORMAL
= _core_
.NORMAL
365 ITALIC
= _core_
.ITALIC
369 LONG_DASH
= _core_
.LONG_DASH
370 SHORT_DASH
= _core_
.SHORT_DASH
371 DOT_DASH
= _core_
.DOT_DASH
372 USER_DASH
= _core_
.USER_DASH
373 TRANSPARENT
= _core_
.TRANSPARENT
374 STIPPLE
= _core_
.STIPPLE
375 STIPPLE_MASK
= _core_
.STIPPLE_MASK
376 STIPPLE_MASK_OPAQUE
= _core_
.STIPPLE_MASK_OPAQUE
377 BDIAGONAL_HATCH
= _core_
.BDIAGONAL_HATCH
378 CROSSDIAG_HATCH
= _core_
.CROSSDIAG_HATCH
379 FDIAGONAL_HATCH
= _core_
.FDIAGONAL_HATCH
380 CROSS_HATCH
= _core_
.CROSS_HATCH
381 HORIZONTAL_HATCH
= _core_
.HORIZONTAL_HATCH
382 VERTICAL_HATCH
= _core_
.VERTICAL_HATCH
383 JOIN_BEVEL
= _core_
.JOIN_BEVEL
384 JOIN_MITER
= _core_
.JOIN_MITER
385 JOIN_ROUND
= _core_
.JOIN_ROUND
386 CAP_ROUND
= _core_
.CAP_ROUND
387 CAP_PROJECTING
= _core_
.CAP_PROJECTING
388 CAP_BUTT
= _core_
.CAP_BUTT
391 INVERT
= _core_
.INVERT
392 OR_REVERSE
= _core_
.OR_REVERSE
393 AND_REVERSE
= _core_
.AND_REVERSE
396 AND_INVERT
= _core_
.AND_INVERT
400 SRC_INVERT
= _core_
.SRC_INVERT
401 OR_INVERT
= _core_
.OR_INVERT
405 WXK_BACK
= _core_
.WXK_BACK
406 WXK_TAB
= _core_
.WXK_TAB
407 WXK_RETURN
= _core_
.WXK_RETURN
408 WXK_ESCAPE
= _core_
.WXK_ESCAPE
409 WXK_SPACE
= _core_
.WXK_SPACE
410 WXK_DELETE
= _core_
.WXK_DELETE
411 WXK_START
= _core_
.WXK_START
412 WXK_LBUTTON
= _core_
.WXK_LBUTTON
413 WXK_RBUTTON
= _core_
.WXK_RBUTTON
414 WXK_CANCEL
= _core_
.WXK_CANCEL
415 WXK_MBUTTON
= _core_
.WXK_MBUTTON
416 WXK_CLEAR
= _core_
.WXK_CLEAR
417 WXK_SHIFT
= _core_
.WXK_SHIFT
418 WXK_ALT
= _core_
.WXK_ALT
419 WXK_CONTROL
= _core_
.WXK_CONTROL
420 WXK_MENU
= _core_
.WXK_MENU
421 WXK_PAUSE
= _core_
.WXK_PAUSE
422 WXK_CAPITAL
= _core_
.WXK_CAPITAL
423 WXK_PRIOR
= _core_
.WXK_PRIOR
424 WXK_NEXT
= _core_
.WXK_NEXT
425 WXK_END
= _core_
.WXK_END
426 WXK_HOME
= _core_
.WXK_HOME
427 WXK_LEFT
= _core_
.WXK_LEFT
428 WXK_UP
= _core_
.WXK_UP
429 WXK_RIGHT
= _core_
.WXK_RIGHT
430 WXK_DOWN
= _core_
.WXK_DOWN
431 WXK_SELECT
= _core_
.WXK_SELECT
432 WXK_PRINT
= _core_
.WXK_PRINT
433 WXK_EXECUTE
= _core_
.WXK_EXECUTE
434 WXK_SNAPSHOT
= _core_
.WXK_SNAPSHOT
435 WXK_INSERT
= _core_
.WXK_INSERT
436 WXK_HELP
= _core_
.WXK_HELP
437 WXK_NUMPAD0
= _core_
.WXK_NUMPAD0
438 WXK_NUMPAD1
= _core_
.WXK_NUMPAD1
439 WXK_NUMPAD2
= _core_
.WXK_NUMPAD2
440 WXK_NUMPAD3
= _core_
.WXK_NUMPAD3
441 WXK_NUMPAD4
= _core_
.WXK_NUMPAD4
442 WXK_NUMPAD5
= _core_
.WXK_NUMPAD5
443 WXK_NUMPAD6
= _core_
.WXK_NUMPAD6
444 WXK_NUMPAD7
= _core_
.WXK_NUMPAD7
445 WXK_NUMPAD8
= _core_
.WXK_NUMPAD8
446 WXK_NUMPAD9
= _core_
.WXK_NUMPAD9
447 WXK_MULTIPLY
= _core_
.WXK_MULTIPLY
448 WXK_ADD
= _core_
.WXK_ADD
449 WXK_SEPARATOR
= _core_
.WXK_SEPARATOR
450 WXK_SUBTRACT
= _core_
.WXK_SUBTRACT
451 WXK_DECIMAL
= _core_
.WXK_DECIMAL
452 WXK_DIVIDE
= _core_
.WXK_DIVIDE
453 WXK_F1
= _core_
.WXK_F1
454 WXK_F2
= _core_
.WXK_F2
455 WXK_F3
= _core_
.WXK_F3
456 WXK_F4
= _core_
.WXK_F4
457 WXK_F5
= _core_
.WXK_F5
458 WXK_F6
= _core_
.WXK_F6
459 WXK_F7
= _core_
.WXK_F7
460 WXK_F8
= _core_
.WXK_F8
461 WXK_F9
= _core_
.WXK_F9
462 WXK_F10
= _core_
.WXK_F10
463 WXK_F11
= _core_
.WXK_F11
464 WXK_F12
= _core_
.WXK_F12
465 WXK_F13
= _core_
.WXK_F13
466 WXK_F14
= _core_
.WXK_F14
467 WXK_F15
= _core_
.WXK_F15
468 WXK_F16
= _core_
.WXK_F16
469 WXK_F17
= _core_
.WXK_F17
470 WXK_F18
= _core_
.WXK_F18
471 WXK_F19
= _core_
.WXK_F19
472 WXK_F20
= _core_
.WXK_F20
473 WXK_F21
= _core_
.WXK_F21
474 WXK_F22
= _core_
.WXK_F22
475 WXK_F23
= _core_
.WXK_F23
476 WXK_F24
= _core_
.WXK_F24
477 WXK_NUMLOCK
= _core_
.WXK_NUMLOCK
478 WXK_SCROLL
= _core_
.WXK_SCROLL
479 WXK_PAGEUP
= _core_
.WXK_PAGEUP
480 WXK_PAGEDOWN
= _core_
.WXK_PAGEDOWN
481 WXK_NUMPAD_SPACE
= _core_
.WXK_NUMPAD_SPACE
482 WXK_NUMPAD_TAB
= _core_
.WXK_NUMPAD_TAB
483 WXK_NUMPAD_ENTER
= _core_
.WXK_NUMPAD_ENTER
484 WXK_NUMPAD_F1
= _core_
.WXK_NUMPAD_F1
485 WXK_NUMPAD_F2
= _core_
.WXK_NUMPAD_F2
486 WXK_NUMPAD_F3
= _core_
.WXK_NUMPAD_F3
487 WXK_NUMPAD_F4
= _core_
.WXK_NUMPAD_F4
488 WXK_NUMPAD_HOME
= _core_
.WXK_NUMPAD_HOME
489 WXK_NUMPAD_LEFT
= _core_
.WXK_NUMPAD_LEFT
490 WXK_NUMPAD_UP
= _core_
.WXK_NUMPAD_UP
491 WXK_NUMPAD_RIGHT
= _core_
.WXK_NUMPAD_RIGHT
492 WXK_NUMPAD_DOWN
= _core_
.WXK_NUMPAD_DOWN
493 WXK_NUMPAD_PRIOR
= _core_
.WXK_NUMPAD_PRIOR
494 WXK_NUMPAD_PAGEUP
= _core_
.WXK_NUMPAD_PAGEUP
495 WXK_NUMPAD_NEXT
= _core_
.WXK_NUMPAD_NEXT
496 WXK_NUMPAD_PAGEDOWN
= _core_
.WXK_NUMPAD_PAGEDOWN
497 WXK_NUMPAD_END
= _core_
.WXK_NUMPAD_END
498 WXK_NUMPAD_BEGIN
= _core_
.WXK_NUMPAD_BEGIN
499 WXK_NUMPAD_INSERT
= _core_
.WXK_NUMPAD_INSERT
500 WXK_NUMPAD_DELETE
= _core_
.WXK_NUMPAD_DELETE
501 WXK_NUMPAD_EQUAL
= _core_
.WXK_NUMPAD_EQUAL
502 WXK_NUMPAD_MULTIPLY
= _core_
.WXK_NUMPAD_MULTIPLY
503 WXK_NUMPAD_ADD
= _core_
.WXK_NUMPAD_ADD
504 WXK_NUMPAD_SEPARATOR
= _core_
.WXK_NUMPAD_SEPARATOR
505 WXK_NUMPAD_SUBTRACT
= _core_
.WXK_NUMPAD_SUBTRACT
506 WXK_NUMPAD_DECIMAL
= _core_
.WXK_NUMPAD_DECIMAL
507 WXK_NUMPAD_DIVIDE
= _core_
.WXK_NUMPAD_DIVIDE
508 WXK_WINDOWS_LEFT
= _core_
.WXK_WINDOWS_LEFT
509 WXK_WINDOWS_RIGHT
= _core_
.WXK_WINDOWS_RIGHT
510 WXK_WINDOWS_MENU
= _core_
.WXK_WINDOWS_MENU
511 WXK_COMMAND
= _core_
.WXK_COMMAND
512 WXK_SPECIAL1
= _core_
.WXK_SPECIAL1
513 WXK_SPECIAL2
= _core_
.WXK_SPECIAL2
514 WXK_SPECIAL3
= _core_
.WXK_SPECIAL3
515 WXK_SPECIAL4
= _core_
.WXK_SPECIAL4
516 WXK_SPECIAL5
= _core_
.WXK_SPECIAL5
517 WXK_SPECIAL6
= _core_
.WXK_SPECIAL6
518 WXK_SPECIAL7
= _core_
.WXK_SPECIAL7
519 WXK_SPECIAL8
= _core_
.WXK_SPECIAL8
520 WXK_SPECIAL9
= _core_
.WXK_SPECIAL9
521 WXK_SPECIAL10
= _core_
.WXK_SPECIAL10
522 WXK_SPECIAL11
= _core_
.WXK_SPECIAL11
523 WXK_SPECIAL12
= _core_
.WXK_SPECIAL12
524 WXK_SPECIAL13
= _core_
.WXK_SPECIAL13
525 WXK_SPECIAL14
= _core_
.WXK_SPECIAL14
526 WXK_SPECIAL15
= _core_
.WXK_SPECIAL15
527 WXK_SPECIAL16
= _core_
.WXK_SPECIAL16
528 WXK_SPECIAL17
= _core_
.WXK_SPECIAL17
529 WXK_SPECIAL18
= _core_
.WXK_SPECIAL18
530 WXK_SPECIAL19
= _core_
.WXK_SPECIAL19
531 WXK_SPECIAL20
= _core_
.WXK_SPECIAL20
532 PAPER_NONE
= _core_
.PAPER_NONE
533 PAPER_LETTER
= _core_
.PAPER_LETTER
534 PAPER_LEGAL
= _core_
.PAPER_LEGAL
535 PAPER_A4
= _core_
.PAPER_A4
536 PAPER_CSHEET
= _core_
.PAPER_CSHEET
537 PAPER_DSHEET
= _core_
.PAPER_DSHEET
538 PAPER_ESHEET
= _core_
.PAPER_ESHEET
539 PAPER_LETTERSMALL
= _core_
.PAPER_LETTERSMALL
540 PAPER_TABLOID
= _core_
.PAPER_TABLOID
541 PAPER_LEDGER
= _core_
.PAPER_LEDGER
542 PAPER_STATEMENT
= _core_
.PAPER_STATEMENT
543 PAPER_EXECUTIVE
= _core_
.PAPER_EXECUTIVE
544 PAPER_A3
= _core_
.PAPER_A3
545 PAPER_A4SMALL
= _core_
.PAPER_A4SMALL
546 PAPER_A5
= _core_
.PAPER_A5
547 PAPER_B4
= _core_
.PAPER_B4
548 PAPER_B5
= _core_
.PAPER_B5
549 PAPER_FOLIO
= _core_
.PAPER_FOLIO
550 PAPER_QUARTO
= _core_
.PAPER_QUARTO
551 PAPER_10X14
= _core_
.PAPER_10X14
552 PAPER_11X17
= _core_
.PAPER_11X17
553 PAPER_NOTE
= _core_
.PAPER_NOTE
554 PAPER_ENV_9
= _core_
.PAPER_ENV_9
555 PAPER_ENV_10
= _core_
.PAPER_ENV_10
556 PAPER_ENV_11
= _core_
.PAPER_ENV_11
557 PAPER_ENV_12
= _core_
.PAPER_ENV_12
558 PAPER_ENV_14
= _core_
.PAPER_ENV_14
559 PAPER_ENV_DL
= _core_
.PAPER_ENV_DL
560 PAPER_ENV_C5
= _core_
.PAPER_ENV_C5
561 PAPER_ENV_C3
= _core_
.PAPER_ENV_C3
562 PAPER_ENV_C4
= _core_
.PAPER_ENV_C4
563 PAPER_ENV_C6
= _core_
.PAPER_ENV_C6
564 PAPER_ENV_C65
= _core_
.PAPER_ENV_C65
565 PAPER_ENV_B4
= _core_
.PAPER_ENV_B4
566 PAPER_ENV_B5
= _core_
.PAPER_ENV_B5
567 PAPER_ENV_B6
= _core_
.PAPER_ENV_B6
568 PAPER_ENV_ITALY
= _core_
.PAPER_ENV_ITALY
569 PAPER_ENV_MONARCH
= _core_
.PAPER_ENV_MONARCH
570 PAPER_ENV_PERSONAL
= _core_
.PAPER_ENV_PERSONAL
571 PAPER_FANFOLD_US
= _core_
.PAPER_FANFOLD_US
572 PAPER_FANFOLD_STD_GERMAN
= _core_
.PAPER_FANFOLD_STD_GERMAN
573 PAPER_FANFOLD_LGL_GERMAN
= _core_
.PAPER_FANFOLD_LGL_GERMAN
574 PAPER_ISO_B4
= _core_
.PAPER_ISO_B4
575 PAPER_JAPANESE_POSTCARD
= _core_
.PAPER_JAPANESE_POSTCARD
576 PAPER_9X11
= _core_
.PAPER_9X11
577 PAPER_10X11
= _core_
.PAPER_10X11
578 PAPER_15X11
= _core_
.PAPER_15X11
579 PAPER_ENV_INVITE
= _core_
.PAPER_ENV_INVITE
580 PAPER_LETTER_EXTRA
= _core_
.PAPER_LETTER_EXTRA
581 PAPER_LEGAL_EXTRA
= _core_
.PAPER_LEGAL_EXTRA
582 PAPER_TABLOID_EXTRA
= _core_
.PAPER_TABLOID_EXTRA
583 PAPER_A4_EXTRA
= _core_
.PAPER_A4_EXTRA
584 PAPER_LETTER_TRANSVERSE
= _core_
.PAPER_LETTER_TRANSVERSE
585 PAPER_A4_TRANSVERSE
= _core_
.PAPER_A4_TRANSVERSE
586 PAPER_LETTER_EXTRA_TRANSVERSE
= _core_
.PAPER_LETTER_EXTRA_TRANSVERSE
587 PAPER_A_PLUS
= _core_
.PAPER_A_PLUS
588 PAPER_B_PLUS
= _core_
.PAPER_B_PLUS
589 PAPER_LETTER_PLUS
= _core_
.PAPER_LETTER_PLUS
590 PAPER_A4_PLUS
= _core_
.PAPER_A4_PLUS
591 PAPER_A5_TRANSVERSE
= _core_
.PAPER_A5_TRANSVERSE
592 PAPER_B5_TRANSVERSE
= _core_
.PAPER_B5_TRANSVERSE
593 PAPER_A3_EXTRA
= _core_
.PAPER_A3_EXTRA
594 PAPER_A5_EXTRA
= _core_
.PAPER_A5_EXTRA
595 PAPER_B5_EXTRA
= _core_
.PAPER_B5_EXTRA
596 PAPER_A2
= _core_
.PAPER_A2
597 PAPER_A3_TRANSVERSE
= _core_
.PAPER_A3_TRANSVERSE
598 PAPER_A3_EXTRA_TRANSVERSE
= _core_
.PAPER_A3_EXTRA_TRANSVERSE
599 PAPER_DBL_JAPANESE_POSTCARD
= _core_
.PAPER_DBL_JAPANESE_POSTCARD
600 PAPER_A6
= _core_
.PAPER_A6
601 PAPER_JENV_KAKU2
= _core_
.PAPER_JENV_KAKU2
602 PAPER_JENV_KAKU3
= _core_
.PAPER_JENV_KAKU3
603 PAPER_JENV_CHOU3
= _core_
.PAPER_JENV_CHOU3
604 PAPER_JENV_CHOU4
= _core_
.PAPER_JENV_CHOU4
605 PAPER_LETTER_ROTATED
= _core_
.PAPER_LETTER_ROTATED
606 PAPER_A3_ROTATED
= _core_
.PAPER_A3_ROTATED
607 PAPER_A4_ROTATED
= _core_
.PAPER_A4_ROTATED
608 PAPER_A5_ROTATED
= _core_
.PAPER_A5_ROTATED
609 PAPER_B4_JIS_ROTATED
= _core_
.PAPER_B4_JIS_ROTATED
610 PAPER_B5_JIS_ROTATED
= _core_
.PAPER_B5_JIS_ROTATED
611 PAPER_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_JAPANESE_POSTCARD_ROTATED
612 PAPER_DBL_JAPANESE_POSTCARD_ROTATED
= _core_
.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
613 PAPER_A6_ROTATED
= _core_
.PAPER_A6_ROTATED
614 PAPER_JENV_KAKU2_ROTATED
= _core_
.PAPER_JENV_KAKU2_ROTATED
615 PAPER_JENV_KAKU3_ROTATED
= _core_
.PAPER_JENV_KAKU3_ROTATED
616 PAPER_JENV_CHOU3_ROTATED
= _core_
.PAPER_JENV_CHOU3_ROTATED
617 PAPER_JENV_CHOU4_ROTATED
= _core_
.PAPER_JENV_CHOU4_ROTATED
618 PAPER_B6_JIS
= _core_
.PAPER_B6_JIS
619 PAPER_B6_JIS_ROTATED
= _core_
.PAPER_B6_JIS_ROTATED
620 PAPER_12X11
= _core_
.PAPER_12X11
621 PAPER_JENV_YOU4
= _core_
.PAPER_JENV_YOU4
622 PAPER_JENV_YOU4_ROTATED
= _core_
.PAPER_JENV_YOU4_ROTATED
623 PAPER_P16K
= _core_
.PAPER_P16K
624 PAPER_P32K
= _core_
.PAPER_P32K
625 PAPER_P32KBIG
= _core_
.PAPER_P32KBIG
626 PAPER_PENV_1
= _core_
.PAPER_PENV_1
627 PAPER_PENV_2
= _core_
.PAPER_PENV_2
628 PAPER_PENV_3
= _core_
.PAPER_PENV_3
629 PAPER_PENV_4
= _core_
.PAPER_PENV_4
630 PAPER_PENV_5
= _core_
.PAPER_PENV_5
631 PAPER_PENV_6
= _core_
.PAPER_PENV_6
632 PAPER_PENV_7
= _core_
.PAPER_PENV_7
633 PAPER_PENV_8
= _core_
.PAPER_PENV_8
634 PAPER_PENV_9
= _core_
.PAPER_PENV_9
635 PAPER_PENV_10
= _core_
.PAPER_PENV_10
636 PAPER_P16K_ROTATED
= _core_
.PAPER_P16K_ROTATED
637 PAPER_P32K_ROTATED
= _core_
.PAPER_P32K_ROTATED
638 PAPER_P32KBIG_ROTATED
= _core_
.PAPER_P32KBIG_ROTATED
639 PAPER_PENV_1_ROTATED
= _core_
.PAPER_PENV_1_ROTATED
640 PAPER_PENV_2_ROTATED
= _core_
.PAPER_PENV_2_ROTATED
641 PAPER_PENV_3_ROTATED
= _core_
.PAPER_PENV_3_ROTATED
642 PAPER_PENV_4_ROTATED
= _core_
.PAPER_PENV_4_ROTATED
643 PAPER_PENV_5_ROTATED
= _core_
.PAPER_PENV_5_ROTATED
644 PAPER_PENV_6_ROTATED
= _core_
.PAPER_PENV_6_ROTATED
645 PAPER_PENV_7_ROTATED
= _core_
.PAPER_PENV_7_ROTATED
646 PAPER_PENV_8_ROTATED
= _core_
.PAPER_PENV_8_ROTATED
647 PAPER_PENV_9_ROTATED
= _core_
.PAPER_PENV_9_ROTATED
648 PAPER_PENV_10_ROTATED
= _core_
.PAPER_PENV_10_ROTATED
649 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
650 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
651 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
652 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
653 ITEM_NORMAL
= _core_
.ITEM_NORMAL
654 ITEM_CHECK
= _core_
.ITEM_CHECK
655 ITEM_RADIO
= _core_
.ITEM_RADIO
656 ITEM_MAX
= _core_
.ITEM_MAX
657 HT_NOWHERE
= _core_
.HT_NOWHERE
658 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
659 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
660 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
661 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
662 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
663 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
664 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
665 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
666 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
667 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
668 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
669 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
670 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
671 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
672 HT_MAX
= _core_
.HT_MAX
673 MOD_NONE
= _core_
.MOD_NONE
674 MOD_ALT
= _core_
.MOD_ALT
675 MOD_CONTROL
= _core_
.MOD_CONTROL
676 MOD_SHIFT
= _core_
.MOD_SHIFT
677 MOD_WIN
= _core_
.MOD_WIN
678 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
679 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
680 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
681 #---------------------------------------------------------------------------
683 class Object(object):
685 The base class for most wx objects, although in wxPython not
686 much functionality is needed nor exposed.
688 def __init__(self
): raise RuntimeError, "No constructor defined"
690 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
691 def GetClassName(*args
, **kwargs
):
693 GetClassName(self) -> String
695 Returns the class name of the C++ class using wxRTTI.
697 return _core_
.Object_GetClassName(*args
, **kwargs
)
699 def Destroy(*args
, **kwargs
):
703 Deletes the C++ object this Python object is a proxy for.
705 return _core_
.Object_Destroy(*args
, **kwargs
)
708 class ObjectPtr(Object
):
709 def __init__(self
, this
):
711 if not hasattr(self
,"thisown"): self
.thisown
= 0
712 self
.__class
__ = Object
713 _core_
.Object_swigregister(ObjectPtr
)
714 _wxPySetDictionary
= _core_
._wxPySetDictionary
716 _wxPyFixStockObjects
= _core_
._wxPyFixStockObjects
719 EmptyString
= cvar
.EmptyString
721 #---------------------------------------------------------------------------
723 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
724 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
725 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
726 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
727 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
728 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
729 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
730 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
731 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
732 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
733 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
734 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
735 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
736 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
737 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
738 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
739 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
740 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
741 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
742 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
743 CURSOR_NONE
= _core_
.CURSOR_NONE
744 CURSOR_ARROW
= _core_
.CURSOR_ARROW
745 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
746 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
747 CURSOR_CHAR
= _core_
.CURSOR_CHAR
748 CURSOR_CROSS
= _core_
.CURSOR_CROSS
749 CURSOR_HAND
= _core_
.CURSOR_HAND
750 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
751 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
752 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
753 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
754 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
755 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
756 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
757 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
758 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
759 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
760 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
761 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
762 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
763 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
764 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
765 CURSOR_SIZING
= _core_
.CURSOR_SIZING
766 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
767 CURSOR_WAIT
= _core_
.CURSOR_WAIT
768 CURSOR_WATCH
= _core_
.CURSOR_WATCH
769 CURSOR_BLANK
= _core_
.CURSOR_BLANK
770 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
771 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
772 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
773 CURSOR_MAX
= _core_
.CURSOR_MAX
774 #---------------------------------------------------------------------------
778 wx.Size is a useful data structure used to represent the size of
779 something. It simply contians integer width and height
780 proprtites. In most places in wxPython where a wx.Size is
781 expected a (width, height) tuple can be used instead.
784 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
785 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
786 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
787 x
= width
; y
= height
788 def __init__(self
, *args
, **kwargs
):
790 __init__(self, int w=0, int h=0) -> Size
792 Creates a size object.
794 newobj
= _core_
.new_Size(*args
, **kwargs
)
795 self
.this
= newobj
.this
798 def __del__(self
, destroy
=_core_
.delete_Size
):
801 if self
.thisown
: destroy(self
)
804 def __eq__(*args
, **kwargs
):
806 __eq__(self, Size sz) -> bool
808 Test for equality of wx.Size objects.
810 return _core_
.Size___eq__(*args
, **kwargs
)
812 def __ne__(*args
, **kwargs
):
814 __ne__(self, Size sz) -> bool
818 return _core_
.Size___ne__(*args
, **kwargs
)
820 def __add__(*args
, **kwargs
):
822 __add__(self, Size sz) -> Size
824 Add sz's proprties to this and return the result.
826 return _core_
.Size___add__(*args
, **kwargs
)
828 def __sub__(*args
, **kwargs
):
830 __sub__(self, Size sz) -> Size
832 Subtract sz's properties from this and return the result.
834 return _core_
.Size___sub__(*args
, **kwargs
)
836 def IncTo(*args
, **kwargs
):
840 Increments this object so that both of its dimensions are not less
841 than the corresponding dimensions of the size.
843 return _core_
.Size_IncTo(*args
, **kwargs
)
845 def DecTo(*args
, **kwargs
):
849 Decrements this object so that both of its dimensions are not greater
850 than the corresponding dimensions of the size.
852 return _core_
.Size_DecTo(*args
, **kwargs
)
854 def Set(*args
, **kwargs
):
856 Set(self, int w, int h)
858 Set both width and height.
860 return _core_
.Size_Set(*args
, **kwargs
)
862 def SetWidth(*args
, **kwargs
):
863 """SetWidth(self, int w)"""
864 return _core_
.Size_SetWidth(*args
, **kwargs
)
866 def SetHeight(*args
, **kwargs
):
867 """SetHeight(self, int h)"""
868 return _core_
.Size_SetHeight(*args
, **kwargs
)
870 def GetWidth(*args
, **kwargs
):
871 """GetWidth(self) -> int"""
872 return _core_
.Size_GetWidth(*args
, **kwargs
)
874 def GetHeight(*args
, **kwargs
):
875 """GetHeight(self) -> int"""
876 return _core_
.Size_GetHeight(*args
, **kwargs
)
878 def IsFullySpecified(*args
, **kwargs
):
880 IsFullySpecified(self) -> bool
882 Returns True if both components of the size are non-default values.
884 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
886 def SetDefaults(*args
, **kwargs
):
888 SetDefaults(self, Size size)
890 Combine this size with the other one replacing the default components
891 of this object (i.e. equal to -1) with those of the other.
893 return _core_
.Size_SetDefaults(*args
, **kwargs
)
895 def Get(*args
, **kwargs
):
897 Get() -> (width,height)
899 Returns the width and height properties as a tuple.
901 return _core_
.Size_Get(*args
, **kwargs
)
903 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
904 def __str__(self
): return str(self
.Get())
905 def __repr__(self
): return 'wx.Size'+str(self
.Get())
906 def __len__(self
): return len(self
.Get())
907 def __getitem__(self
, index
): return self
.Get()[index
]
908 def __setitem__(self
, index
, val
):
909 if index
== 0: self
.width
= val
910 elif index
== 1: self
.height
= val
911 else: raise IndexError
912 def __nonzero__(self
): return self
.Get() != (0,0)
913 __safe_for_unpickling__
= True
914 def __reduce__(self
): return (wx
.Size
, self
.Get())
918 def __init__(self
, this
):
920 if not hasattr(self
,"thisown"): self
.thisown
= 0
921 self
.__class
__ = Size
922 _core_
.Size_swigregister(SizePtr
)
924 #---------------------------------------------------------------------------
926 class RealPoint(object):
928 A data structure for representing a point or position with floating
929 point x and y properties. In wxPython most places that expect a
930 wx.RealPoint can also accept a (x,y) tuple.
933 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
934 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
935 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
936 def __init__(self
, *args
, **kwargs
):
938 __init__(self, double x=0.0, double y=0.0) -> RealPoint
940 Create a wx.RealPoint object
942 newobj
= _core_
.new_RealPoint(*args
, **kwargs
)
943 self
.this
= newobj
.this
946 def __del__(self
, destroy
=_core_
.delete_RealPoint
):
949 if self
.thisown
: destroy(self
)
952 def __eq__(*args
, **kwargs
):
954 __eq__(self, RealPoint pt) -> bool
956 Test for equality of wx.RealPoint objects.
958 return _core_
.RealPoint___eq__(*args
, **kwargs
)
960 def __ne__(*args
, **kwargs
):
962 __ne__(self, RealPoint pt) -> bool
964 Test for inequality of wx.RealPoint objects.
966 return _core_
.RealPoint___ne__(*args
, **kwargs
)
968 def __add__(*args
, **kwargs
):
970 __add__(self, RealPoint pt) -> RealPoint
972 Add pt's proprties to this and return the result.
974 return _core_
.RealPoint___add__(*args
, **kwargs
)
976 def __sub__(*args
, **kwargs
):
978 __sub__(self, RealPoint pt) -> RealPoint
980 Subtract pt's proprties from this and return the result
982 return _core_
.RealPoint___sub__(*args
, **kwargs
)
984 def Set(*args
, **kwargs
):
986 Set(self, double x, double y)
988 Set both the x and y properties
990 return _core_
.RealPoint_Set(*args
, **kwargs
)
992 def Get(*args
, **kwargs
):
996 Return the x and y properties as a tuple.
998 return _core_
.RealPoint_Get(*args
, **kwargs
)
1000 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1001 def __str__(self
): return str(self
.Get())
1002 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
1003 def __len__(self
): return len(self
.Get())
1004 def __getitem__(self
, index
): return self
.Get()[index
]
1005 def __setitem__(self
, index
, val
):
1006 if index
== 0: self
.x
= val
1007 elif index
== 1: self
.y
= val
1008 else: raise IndexError
1009 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1010 __safe_for_unpickling__
= True
1011 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
1014 class RealPointPtr(RealPoint
):
1015 def __init__(self
, this
):
1017 if not hasattr(self
,"thisown"): self
.thisown
= 0
1018 self
.__class
__ = RealPoint
1019 _core_
.RealPoint_swigregister(RealPointPtr
)
1021 #---------------------------------------------------------------------------
1023 class Point(object):
1025 A data structure for representing a point or position with integer x
1026 and y properties. Most places in wxPython that expect a wx.Point can
1027 also accept a (x,y) tuple.
1030 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1031 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
1032 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
1033 def __init__(self
, *args
, **kwargs
):
1035 __init__(self, int x=0, int y=0) -> Point
1037 Create a wx.Point object
1039 newobj
= _core_
.new_Point(*args
, **kwargs
)
1040 self
.this
= newobj
.this
1043 def __del__(self
, destroy
=_core_
.delete_Point
):
1046 if self
.thisown
: destroy(self
)
1049 def __eq__(*args
, **kwargs
):
1051 __eq__(self, Point pt) -> bool
1053 Test for equality of wx.Point objects.
1055 return _core_
.Point___eq__(*args
, **kwargs
)
1057 def __ne__(*args
, **kwargs
):
1059 __ne__(self, Point pt) -> bool
1061 Test for inequality of wx.Point objects.
1063 return _core_
.Point___ne__(*args
, **kwargs
)
1065 def __add__(*args
, **kwargs
):
1067 __add__(self, Point pt) -> Point
1069 Add pt's proprties to this and return the result.
1071 return _core_
.Point___add__(*args
, **kwargs
)
1073 def __sub__(*args
, **kwargs
):
1075 __sub__(self, Point pt) -> Point
1077 Subtract pt's proprties from this and return the result
1079 return _core_
.Point___sub__(*args
, **kwargs
)
1081 def __iadd__(*args
, **kwargs
):
1083 __iadd__(self, Point pt) -> Point
1085 Add pt to this object.
1087 return _core_
.Point___iadd__(*args
, **kwargs
)
1089 def __isub__(*args
, **kwargs
):
1091 __isub__(self, Point pt) -> Point
1093 Subtract pt from this object.
1095 return _core_
.Point___isub__(*args
, **kwargs
)
1097 def Set(*args
, **kwargs
):
1099 Set(self, long x, long y)
1101 Set both the x and y properties
1103 return _core_
.Point_Set(*args
, **kwargs
)
1105 def Get(*args
, **kwargs
):
1109 Return the x and y properties as a tuple.
1111 return _core_
.Point_Get(*args
, **kwargs
)
1113 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1114 def __str__(self
): return str(self
.Get())
1115 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1116 def __len__(self
): return len(self
.Get())
1117 def __getitem__(self
, index
): return self
.Get()[index
]
1118 def __setitem__(self
, index
, val
):
1119 if index
== 0: self
.x
= val
1120 elif index
== 1: self
.y
= val
1121 else: raise IndexError
1122 def __nonzero__(self
): return self
.Get() != (0,0)
1123 __safe_for_unpickling__
= True
1124 def __reduce__(self
): return (wx
.Point
, self
.Get())
1127 class PointPtr(Point
):
1128 def __init__(self
, this
):
1130 if not hasattr(self
,"thisown"): self
.thisown
= 0
1131 self
.__class
__ = Point
1132 _core_
.Point_swigregister(PointPtr
)
1134 #---------------------------------------------------------------------------
1138 A class for representing and manipulating rectangles. It has x, y,
1139 width and height properties. In wxPython most palces that expect a
1140 wx.Rect can also accept a (x,y,width,height) tuple.
1143 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1144 def __init__(self
, *args
, **kwargs
):
1146 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1148 Create a new Rect object.
1150 newobj
= _core_
.new_Rect(*args
, **kwargs
)
1151 self
.this
= newobj
.this
1154 def __del__(self
, destroy
=_core_
.delete_Rect
):
1157 if self
.thisown
: destroy(self
)
1160 def GetX(*args
, **kwargs
):
1161 """GetX(self) -> int"""
1162 return _core_
.Rect_GetX(*args
, **kwargs
)
1164 def SetX(*args
, **kwargs
):
1165 """SetX(self, int x)"""
1166 return _core_
.Rect_SetX(*args
, **kwargs
)
1168 def GetY(*args
, **kwargs
):
1169 """GetY(self) -> int"""
1170 return _core_
.Rect_GetY(*args
, **kwargs
)
1172 def SetY(*args
, **kwargs
):
1173 """SetY(self, int y)"""
1174 return _core_
.Rect_SetY(*args
, **kwargs
)
1176 def GetWidth(*args
, **kwargs
):
1177 """GetWidth(self) -> int"""
1178 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1180 def SetWidth(*args
, **kwargs
):
1181 """SetWidth(self, int w)"""
1182 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1184 def GetHeight(*args
, **kwargs
):
1185 """GetHeight(self) -> int"""
1186 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1188 def SetHeight(*args
, **kwargs
):
1189 """SetHeight(self, int h)"""
1190 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1192 def GetPosition(*args
, **kwargs
):
1193 """GetPosition(self) -> Point"""
1194 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1196 def SetPosition(*args
, **kwargs
):
1197 """SetPosition(self, Point p)"""
1198 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1200 def GetSize(*args
, **kwargs
):
1201 """GetSize(self) -> Size"""
1202 return _core_
.Rect_GetSize(*args
, **kwargs
)
1204 def SetSize(*args
, **kwargs
):
1205 """SetSize(self, Size s)"""
1206 return _core_
.Rect_SetSize(*args
, **kwargs
)
1208 def IsEmpty(*args
, **kwargs
):
1209 """IsEmpty(self) -> bool"""
1210 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1212 def GetTopLeft(*args
, **kwargs
):
1213 """GetTopLeft(self) -> Point"""
1214 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1216 def SetTopLeft(*args
, **kwargs
):
1217 """SetTopLeft(self, Point p)"""
1218 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1220 def GetBottomRight(*args
, **kwargs
):
1221 """GetBottomRight(self) -> Point"""
1222 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1224 def SetBottomRight(*args
, **kwargs
):
1225 """SetBottomRight(self, Point p)"""
1226 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1228 def GetLeft(*args
, **kwargs
):
1229 """GetLeft(self) -> int"""
1230 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1232 def GetTop(*args
, **kwargs
):
1233 """GetTop(self) -> int"""
1234 return _core_
.Rect_GetTop(*args
, **kwargs
)
1236 def GetBottom(*args
, **kwargs
):
1237 """GetBottom(self) -> int"""
1238 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1240 def GetRight(*args
, **kwargs
):
1241 """GetRight(self) -> int"""
1242 return _core_
.Rect_GetRight(*args
, **kwargs
)
1244 def SetLeft(*args
, **kwargs
):
1245 """SetLeft(self, int left)"""
1246 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1248 def SetRight(*args
, **kwargs
):
1249 """SetRight(self, int right)"""
1250 return _core_
.Rect_SetRight(*args
, **kwargs
)
1252 def SetTop(*args
, **kwargs
):
1253 """SetTop(self, int top)"""
1254 return _core_
.Rect_SetTop(*args
, **kwargs
)
1256 def SetBottom(*args
, **kwargs
):
1257 """SetBottom(self, int bottom)"""
1258 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1260 position
= property(GetPosition
, SetPosition
)
1261 size
= property(GetSize
, SetSize
)
1262 left
= property(GetLeft
, SetLeft
)
1263 right
= property(GetRight
, SetRight
)
1264 top
= property(GetTop
, SetTop
)
1265 bottom
= property(GetBottom
, SetBottom
)
1267 def Inflate(*args
, **kwargs
):
1269 Inflate(self, int dx, int dy) -> Rect
1271 Increases the size of the rectangle.
1273 The left border is moved farther left and the right border is moved
1274 farther right by ``dx``. The upper border is moved farther up and the
1275 bottom border is moved farther down by ``dy``. (Note the the width and
1276 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1277 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1278 opposite happens: the rectangle size decreases in the respective
1281 The change is made to the rectangle inplace, if instead you need a
1282 copy that is inflated, preserving the original then make the copy
1285 copy = wx.Rect(*original)
1290 return _core_
.Rect_Inflate(*args
, **kwargs
)
1292 def Deflate(*args
, **kwargs
):
1294 Deflate(self, int dx, int dy) -> Rect
1296 Decrease the rectangle size. This method is the opposite of `Inflate`
1297 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1298 `Inflate` for a full description.
1300 return _core_
.Rect_Deflate(*args
, **kwargs
)
1302 def OffsetXY(*args
, **kwargs
):
1304 OffsetXY(self, int dx, int dy)
1306 Moves the rectangle by the specified offset. If dx is positive, the
1307 rectangle is moved to the right, if dy is positive, it is moved to the
1308 bottom, otherwise it is moved to the left or top respectively.
1310 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1312 def Offset(*args
, **kwargs
):
1314 Offset(self, Point pt)
1316 Same as OffsetXY but uses dx,dy from Point
1318 return _core_
.Rect_Offset(*args
, **kwargs
)
1320 def Intersect(*args
, **kwargs
):
1322 Intersect(self, Rect rect) -> Rect
1324 Returns the intersectsion of this rectangle and rect.
1326 return _core_
.Rect_Intersect(*args
, **kwargs
)
1328 def Union(*args
, **kwargs
):
1330 Union(self, Rect rect) -> Rect
1332 Returns the union of this rectangle and rect.
1334 return _core_
.Rect_Union(*args
, **kwargs
)
1336 def __add__(*args
, **kwargs
):
1338 __add__(self, Rect rect) -> Rect
1340 Add the properties of rect to this rectangle and return the result.
1342 return _core_
.Rect___add__(*args
, **kwargs
)
1344 def __iadd__(*args
, **kwargs
):
1346 __iadd__(self, Rect rect) -> Rect
1348 Add the properties of rect to this rectangle, updating this rectangle.
1350 return _core_
.Rect___iadd__(*args
, **kwargs
)
1352 def __eq__(*args
, **kwargs
):
1354 __eq__(self, Rect rect) -> bool
1358 return _core_
.Rect___eq__(*args
, **kwargs
)
1360 def __ne__(*args
, **kwargs
):
1362 __ne__(self, Rect rect) -> bool
1364 Test for inequality.
1366 return _core_
.Rect___ne__(*args
, **kwargs
)
1368 def InsideXY(*args
, **kwargs
):
1370 InsideXY(self, int x, int y) -> bool
1372 Return True if the point is (not strcitly) inside the rect.
1374 return _core_
.Rect_InsideXY(*args
, **kwargs
)
1376 def Inside(*args
, **kwargs
):
1378 Inside(self, Point pt) -> bool
1380 Return True if the point is (not strcitly) inside the rect.
1382 return _core_
.Rect_Inside(*args
, **kwargs
)
1384 def Intersects(*args
, **kwargs
):
1386 Intersects(self, Rect rect) -> bool
1388 Returns True if the rectangles have a non empty intersection.
1390 return _core_
.Rect_Intersects(*args
, **kwargs
)
1392 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1393 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1394 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1395 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1396 def Set(*args
, **kwargs
):
1398 Set(self, int x=0, int y=0, int width=0, int height=0)
1400 Set all rectangle properties.
1402 return _core_
.Rect_Set(*args
, **kwargs
)
1404 def Get(*args
, **kwargs
):
1406 Get() -> (x,y,width,height)
1408 Return the rectangle properties as a tuple.
1410 return _core_
.Rect_Get(*args
, **kwargs
)
1412 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1413 def __str__(self
): return str(self
.Get())
1414 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1415 def __len__(self
): return len(self
.Get())
1416 def __getitem__(self
, index
): return self
.Get()[index
]
1417 def __setitem__(self
, index
, val
):
1418 if index
== 0: self
.x
= val
1419 elif index
== 1: self
.y
= val
1420 elif index
== 2: self
.width
= val
1421 elif index
== 3: self
.height
= val
1422 else: raise IndexError
1423 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1424 __safe_for_unpickling__
= True
1425 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1428 class RectPtr(Rect
):
1429 def __init__(self
, this
):
1431 if not hasattr(self
,"thisown"): self
.thisown
= 0
1432 self
.__class
__ = Rect
1433 _core_
.Rect_swigregister(RectPtr
)
1435 def RectPP(*args
, **kwargs
):
1437 RectPP(Point topLeft, Point bottomRight) -> Rect
1439 Create a new Rect object from Points representing two corners.
1441 val
= _core_
.new_RectPP(*args
, **kwargs
)
1445 def RectPS(*args
, **kwargs
):
1447 RectPS(Point pos, Size size) -> Rect
1449 Create a new Rect from a position and size.
1451 val
= _core_
.new_RectPS(*args
, **kwargs
)
1455 def RectS(*args
, **kwargs
):
1457 RectS(Size size) -> Rect
1459 Create a new Rect from a size only.
1461 val
= _core_
.new_RectS(*args
, **kwargs
)
1466 def IntersectRect(*args
, **kwargs
):
1468 IntersectRect(Rect r1, Rect r2) -> Rect
1470 Calculate and return the intersection of r1 and r2.
1472 return _core_
.IntersectRect(*args
, **kwargs
)
1473 #---------------------------------------------------------------------------
1475 class Point2D(object):
1477 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1478 with floating point values.
1481 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1482 def __init__(self
, *args
, **kwargs
):
1484 __init__(self, double x=0.0, double y=0.0) -> Point2D
1486 Create a w.Point2D object.
1488 newobj
= _core_
.new_Point2D(*args
, **kwargs
)
1489 self
.this
= newobj
.this
1492 def GetFloor(*args
, **kwargs
):
1498 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1500 def GetRounded(*args
, **kwargs
):
1502 GetRounded() -> (x,y)
1506 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1508 def GetVectorLength(*args
, **kwargs
):
1509 """GetVectorLength(self) -> double"""
1510 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1512 def GetVectorAngle(*args
, **kwargs
):
1513 """GetVectorAngle(self) -> double"""
1514 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1516 def SetVectorLength(*args
, **kwargs
):
1517 """SetVectorLength(self, double length)"""
1518 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1520 def SetVectorAngle(*args
, **kwargs
):
1521 """SetVectorAngle(self, double degrees)"""
1522 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1524 def SetPolarCoordinates(self
, angle
, length
):
1525 self
.SetVectorLength(length
)
1526 self
.SetVectorAngle(angle
)
1527 def Normalize(self
):
1528 self
.SetVectorLength(1.0)
1530 def GetDistance(*args
, **kwargs
):
1531 """GetDistance(self, Point2D pt) -> double"""
1532 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1534 def GetDistanceSquare(*args
, **kwargs
):
1535 """GetDistanceSquare(self, Point2D pt) -> double"""
1536 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1538 def GetDotProduct(*args
, **kwargs
):
1539 """GetDotProduct(self, Point2D vec) -> double"""
1540 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1542 def GetCrossProduct(*args
, **kwargs
):
1543 """GetCrossProduct(self, Point2D vec) -> double"""
1544 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1546 def __neg__(*args
, **kwargs
):
1548 __neg__(self) -> Point2D
1550 the reflection of this point
1552 return _core_
.Point2D___neg__(*args
, **kwargs
)
1554 def __iadd__(*args
, **kwargs
):
1555 """__iadd__(self, Point2D pt) -> Point2D"""
1556 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1558 def __isub__(*args
, **kwargs
):
1559 """__isub__(self, Point2D pt) -> Point2D"""
1560 return _core_
.Point2D___isub__(*args
, **kwargs
)
1562 def __imul__(*args
, **kwargs
):
1563 """__imul__(self, Point2D pt) -> Point2D"""
1564 return _core_
.Point2D___imul__(*args
, **kwargs
)
1566 def __idiv__(*args
, **kwargs
):
1567 """__idiv__(self, Point2D pt) -> Point2D"""
1568 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1570 def __eq__(*args
, **kwargs
):
1572 __eq__(self, Point2D pt) -> bool
1576 return _core_
.Point2D___eq__(*args
, **kwargs
)
1578 def __ne__(*args
, **kwargs
):
1580 __ne__(self, Point2D pt) -> bool
1584 return _core_
.Point2D___ne__(*args
, **kwargs
)
1586 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1587 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1588 def Set(*args
, **kwargs
):
1589 """Set(self, double x=0, double y=0)"""
1590 return _core_
.Point2D_Set(*args
, **kwargs
)
1592 def Get(*args
, **kwargs
):
1596 Return x and y properties as a tuple.
1598 return _core_
.Point2D_Get(*args
, **kwargs
)
1600 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1601 def __str__(self
): return str(self
.Get())
1602 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1603 def __len__(self
): return len(self
.Get())
1604 def __getitem__(self
, index
): return self
.Get()[index
]
1605 def __setitem__(self
, index
, val
):
1606 if index
== 0: self
.x
= val
1607 elif index
== 1: self
.y
= val
1608 else: raise IndexError
1609 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1610 __safe_for_unpickling__
= True
1611 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1614 class Point2DPtr(Point2D
):
1615 def __init__(self
, this
):
1617 if not hasattr(self
,"thisown"): self
.thisown
= 0
1618 self
.__class
__ = Point2D
1619 _core_
.Point2D_swigregister(Point2DPtr
)
1621 def Point2DCopy(*args
, **kwargs
):
1623 Point2DCopy(Point2D pt) -> Point2D
1625 Create a w.Point2D object.
1627 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1631 def Point2DFromPoint(*args
, **kwargs
):
1633 Point2DFromPoint(Point pt) -> Point2D
1635 Create a w.Point2D object.
1637 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1641 #---------------------------------------------------------------------------
1643 FromStart
= _core_
.FromStart
1644 FromCurrent
= _core_
.FromCurrent
1645 FromEnd
= _core_
.FromEnd
1646 class InputStream(object):
1647 """Proxy of C++ InputStream class"""
1649 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1650 def __init__(self
, *args
, **kwargs
):
1651 """__init__(self, PyObject p) -> InputStream"""
1652 newobj
= _core_
.new_InputStream(*args
, **kwargs
)
1653 self
.this
= newobj
.this
1656 def __del__(self
, destroy
=_core_
.delete_InputStream
):
1659 if self
.thisown
: destroy(self
)
1662 def close(*args
, **kwargs
):
1664 return _core_
.InputStream_close(*args
, **kwargs
)
1666 def flush(*args
, **kwargs
):
1668 return _core_
.InputStream_flush(*args
, **kwargs
)
1670 def eof(*args
, **kwargs
):
1671 """eof(self) -> bool"""
1672 return _core_
.InputStream_eof(*args
, **kwargs
)
1674 def read(*args
, **kwargs
):
1675 """read(self, int size=-1) -> PyObject"""
1676 return _core_
.InputStream_read(*args
, **kwargs
)
1678 def readline(*args
, **kwargs
):
1679 """readline(self, int size=-1) -> PyObject"""
1680 return _core_
.InputStream_readline(*args
, **kwargs
)
1682 def readlines(*args
, **kwargs
):
1683 """readlines(self, int sizehint=-1) -> PyObject"""
1684 return _core_
.InputStream_readlines(*args
, **kwargs
)
1686 def seek(*args
, **kwargs
):
1687 """seek(self, int offset, int whence=0)"""
1688 return _core_
.InputStream_seek(*args
, **kwargs
)
1690 def tell(*args
, **kwargs
):
1691 """tell(self) -> int"""
1692 return _core_
.InputStream_tell(*args
, **kwargs
)
1694 def Peek(*args
, **kwargs
):
1695 """Peek(self) -> char"""
1696 return _core_
.InputStream_Peek(*args
, **kwargs
)
1698 def GetC(*args
, **kwargs
):
1699 """GetC(self) -> char"""
1700 return _core_
.InputStream_GetC(*args
, **kwargs
)
1702 def LastRead(*args
, **kwargs
):
1703 """LastRead(self) -> size_t"""
1704 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1706 def CanRead(*args
, **kwargs
):
1707 """CanRead(self) -> bool"""
1708 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1710 def Eof(*args
, **kwargs
):
1711 """Eof(self) -> bool"""
1712 return _core_
.InputStream_Eof(*args
, **kwargs
)
1714 def Ungetch(*args
, **kwargs
):
1715 """Ungetch(self, char c) -> bool"""
1716 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1718 def SeekI(*args
, **kwargs
):
1719 """SeekI(self, long pos, int mode=FromStart) -> long"""
1720 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1722 def TellI(*args
, **kwargs
):
1723 """TellI(self) -> long"""
1724 return _core_
.InputStream_TellI(*args
, **kwargs
)
1727 class InputStreamPtr(InputStream
):
1728 def __init__(self
, this
):
1730 if not hasattr(self
,"thisown"): self
.thisown
= 0
1731 self
.__class
__ = InputStream
1732 _core_
.InputStream_swigregister(InputStreamPtr
)
1733 DefaultPosition
= cvar
.DefaultPosition
1734 DefaultSize
= cvar
.DefaultSize
1736 class OutputStream(object):
1737 """Proxy of C++ OutputStream class"""
1738 def __init__(self
): raise RuntimeError, "No constructor defined"
1740 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1741 def write(*args
, **kwargs
):
1742 """write(self, PyObject obj)"""
1743 return _core_
.OutputStream_write(*args
, **kwargs
)
1746 class OutputStreamPtr(OutputStream
):
1747 def __init__(self
, this
):
1749 if not hasattr(self
,"thisown"): self
.thisown
= 0
1750 self
.__class
__ = OutputStream
1751 _core_
.OutputStream_swigregister(OutputStreamPtr
)
1753 #---------------------------------------------------------------------------
1755 class FSFile(Object
):
1756 """Proxy of C++ FSFile class"""
1758 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1759 def __init__(self
, *args
, **kwargs
):
1761 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1762 DateTime modif) -> FSFile
1764 newobj
= _core_
.new_FSFile(*args
, **kwargs
)
1765 self
.this
= newobj
.this
1768 self
.thisown
= 0 # It will normally be deleted by the user of the wx.FileSystem
1770 def __del__(self
, destroy
=_core_
.delete_FSFile
):
1773 if self
.thisown
: destroy(self
)
1776 def GetStream(*args
, **kwargs
):
1777 """GetStream(self) -> InputStream"""
1778 return _core_
.FSFile_GetStream(*args
, **kwargs
)
1780 def GetMimeType(*args
, **kwargs
):
1781 """GetMimeType(self) -> String"""
1782 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
1784 def GetLocation(*args
, **kwargs
):
1785 """GetLocation(self) -> String"""
1786 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
1788 def GetAnchor(*args
, **kwargs
):
1789 """GetAnchor(self) -> String"""
1790 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
1792 def GetModificationTime(*args
, **kwargs
):
1793 """GetModificationTime(self) -> DateTime"""
1794 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
1797 class FSFilePtr(FSFile
):
1798 def __init__(self
, this
):
1800 if not hasattr(self
,"thisown"): self
.thisown
= 0
1801 self
.__class
__ = FSFile
1802 _core_
.FSFile_swigregister(FSFilePtr
)
1804 class CPPFileSystemHandler(object):
1805 """Proxy of C++ CPPFileSystemHandler class"""
1806 def __init__(self
): raise RuntimeError, "No constructor defined"
1808 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1810 class CPPFileSystemHandlerPtr(CPPFileSystemHandler
):
1811 def __init__(self
, this
):
1813 if not hasattr(self
,"thisown"): self
.thisown
= 0
1814 self
.__class
__ = CPPFileSystemHandler
1815 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr
)
1817 class FileSystemHandler(CPPFileSystemHandler
):
1818 """Proxy of C++ FileSystemHandler class"""
1820 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1821 def __init__(self
, *args
, **kwargs
):
1822 """__init__(self) -> FileSystemHandler"""
1823 newobj
= _core_
.new_FileSystemHandler(*args
, **kwargs
)
1824 self
.this
= newobj
.this
1827 self
._setCallbackInfo
(self
, FileSystemHandler
)
1829 def _setCallbackInfo(*args
, **kwargs
):
1830 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1831 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
1833 def CanOpen(*args
, **kwargs
):
1834 """CanOpen(self, String location) -> bool"""
1835 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
1837 def OpenFile(*args
, **kwargs
):
1838 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1839 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
1841 def FindFirst(*args
, **kwargs
):
1842 """FindFirst(self, String spec, int flags=0) -> String"""
1843 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
1845 def FindNext(*args
, **kwargs
):
1846 """FindNext(self) -> String"""
1847 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
1849 def GetProtocol(*args
, **kwargs
):
1850 """GetProtocol(self, String location) -> String"""
1851 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
1853 def GetLeftLocation(*args
, **kwargs
):
1854 """GetLeftLocation(self, String location) -> String"""
1855 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
1857 def GetAnchor(*args
, **kwargs
):
1858 """GetAnchor(self, String location) -> String"""
1859 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
1861 def GetRightLocation(*args
, **kwargs
):
1862 """GetRightLocation(self, String location) -> String"""
1863 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
1865 def GetMimeTypeFromExt(*args
, **kwargs
):
1866 """GetMimeTypeFromExt(self, String location) -> String"""
1867 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
1870 class FileSystemHandlerPtr(FileSystemHandler
):
1871 def __init__(self
, this
):
1873 if not hasattr(self
,"thisown"): self
.thisown
= 0
1874 self
.__class
__ = FileSystemHandler
1875 _core_
.FileSystemHandler_swigregister(FileSystemHandlerPtr
)
1877 class FileSystem(Object
):
1878 """Proxy of C++ FileSystem class"""
1880 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1881 def __init__(self
, *args
, **kwargs
):
1882 """__init__(self) -> FileSystem"""
1883 newobj
= _core_
.new_FileSystem(*args
, **kwargs
)
1884 self
.this
= newobj
.this
1887 def __del__(self
, destroy
=_core_
.delete_FileSystem
):
1890 if self
.thisown
: destroy(self
)
1893 def ChangePathTo(*args
, **kwargs
):
1894 """ChangePathTo(self, String location, bool is_dir=False)"""
1895 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
1897 def GetPath(*args
, **kwargs
):
1898 """GetPath(self) -> String"""
1899 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
1901 def OpenFile(*args
, **kwargs
):
1902 """OpenFile(self, String location) -> FSFile"""
1903 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
1905 def FindFirst(*args
, **kwargs
):
1906 """FindFirst(self, String spec, int flags=0) -> String"""
1907 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
1909 def FindNext(*args
, **kwargs
):
1910 """FindNext(self) -> String"""
1911 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
1913 def AddHandler(*args
, **kwargs
):
1914 """AddHandler(CPPFileSystemHandler handler)"""
1915 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1917 AddHandler
= staticmethod(AddHandler
)
1918 def CleanUpHandlers(*args
, **kwargs
):
1919 """CleanUpHandlers()"""
1920 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1922 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
1923 def FileNameToURL(*args
, **kwargs
):
1924 """FileNameToURL(String filename) -> String"""
1925 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1927 FileNameToURL
= staticmethod(FileNameToURL
)
1928 def URLToFileName(*args
, **kwargs
):
1929 """URLToFileName(String url) -> String"""
1930 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1932 URLToFileName
= staticmethod(URLToFileName
)
1934 class FileSystemPtr(FileSystem
):
1935 def __init__(self
, this
):
1937 if not hasattr(self
,"thisown"): self
.thisown
= 0
1938 self
.__class
__ = FileSystem
1939 _core_
.FileSystem_swigregister(FileSystemPtr
)
1941 def FileSystem_AddHandler(*args
, **kwargs
):
1942 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1943 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1945 def FileSystem_CleanUpHandlers(*args
, **kwargs
):
1946 """FileSystem_CleanUpHandlers()"""
1947 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1949 def FileSystem_FileNameToURL(*args
, **kwargs
):
1950 """FileSystem_FileNameToURL(String filename) -> String"""
1951 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1953 def FileSystem_URLToFileName(*args
, **kwargs
):
1954 """FileSystem_URLToFileName(String url) -> String"""
1955 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1957 class InternetFSHandler(CPPFileSystemHandler
):
1958 """Proxy of C++ InternetFSHandler class"""
1960 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1961 def __init__(self
, *args
, **kwargs
):
1962 """__init__(self) -> InternetFSHandler"""
1963 newobj
= _core_
.new_InternetFSHandler(*args
, **kwargs
)
1964 self
.this
= newobj
.this
1967 def CanOpen(*args
, **kwargs
):
1968 """CanOpen(self, String location) -> bool"""
1969 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
1971 def OpenFile(*args
, **kwargs
):
1972 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1973 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
1976 class InternetFSHandlerPtr(InternetFSHandler
):
1977 def __init__(self
, this
):
1979 if not hasattr(self
,"thisown"): self
.thisown
= 0
1980 self
.__class
__ = InternetFSHandler
1981 _core_
.InternetFSHandler_swigregister(InternetFSHandlerPtr
)
1983 class ZipFSHandler(CPPFileSystemHandler
):
1984 """Proxy of C++ ZipFSHandler class"""
1986 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1987 def __init__(self
, *args
, **kwargs
):
1988 """__init__(self) -> ZipFSHandler"""
1989 newobj
= _core_
.new_ZipFSHandler(*args
, **kwargs
)
1990 self
.this
= newobj
.this
1993 def CanOpen(*args
, **kwargs
):
1994 """CanOpen(self, String location) -> bool"""
1995 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
1997 def OpenFile(*args
, **kwargs
):
1998 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1999 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
2001 def FindFirst(*args
, **kwargs
):
2002 """FindFirst(self, String spec, int flags=0) -> String"""
2003 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
2005 def FindNext(*args
, **kwargs
):
2006 """FindNext(self) -> String"""
2007 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
2010 class ZipFSHandlerPtr(ZipFSHandler
):
2011 def __init__(self
, this
):
2013 if not hasattr(self
,"thisown"): self
.thisown
= 0
2014 self
.__class
__ = ZipFSHandler
2015 _core_
.ZipFSHandler_swigregister(ZipFSHandlerPtr
)
2018 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
2019 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2020 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
2022 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
2023 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2024 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
2026 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
2027 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2028 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
2029 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
2031 Add 'file' to the memory filesystem. The dataItem parameter can
2032 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2033 arbitrary data. If a bitmap or image is used then the imgType
2034 parameter should specify what kind of image file it should be
2035 written as, wx.BITMAP_TYPE_PNG, etc.
2037 if isinstance(dataItem
, wx
.Image
):
2038 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
2039 elif isinstance(dataItem
, wx
.Bitmap
):
2040 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
2041 elif type(dataItem
) == str:
2042 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
2044 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
2046 class MemoryFSHandler(CPPFileSystemHandler
):
2047 """Proxy of C++ MemoryFSHandler class"""
2049 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2050 def __init__(self
, *args
, **kwargs
):
2051 """__init__(self) -> MemoryFSHandler"""
2052 newobj
= _core_
.new_MemoryFSHandler(*args
, **kwargs
)
2053 self
.this
= newobj
.this
2056 def RemoveFile(*args
, **kwargs
):
2057 """RemoveFile(String filename)"""
2058 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2060 RemoveFile
= staticmethod(RemoveFile
)
2061 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
2062 def CanOpen(*args
, **kwargs
):
2063 """CanOpen(self, String location) -> bool"""
2064 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
2066 def OpenFile(*args
, **kwargs
):
2067 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2068 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
2070 def FindFirst(*args
, **kwargs
):
2071 """FindFirst(self, String spec, int flags=0) -> String"""
2072 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
2074 def FindNext(*args
, **kwargs
):
2075 """FindNext(self) -> String"""
2076 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
2079 class MemoryFSHandlerPtr(MemoryFSHandler
):
2080 def __init__(self
, this
):
2082 if not hasattr(self
,"thisown"): self
.thisown
= 0
2083 self
.__class
__ = MemoryFSHandler
2084 _core_
.MemoryFSHandler_swigregister(MemoryFSHandlerPtr
)
2086 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
2087 """MemoryFSHandler_RemoveFile(String filename)"""
2088 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2090 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
2091 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
2092 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
2093 #---------------------------------------------------------------------------
2095 class ImageHandler(Object
):
2097 This is the base class for implementing image file loading/saving, and
2098 image creation from data. It is used within `wx.Image` and is not
2099 normally seen by the application.
2101 def __init__(self
): raise RuntimeError, "No constructor defined"
2103 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2104 def GetName(*args
, **kwargs
):
2105 """GetName(self) -> String"""
2106 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
2108 def GetExtension(*args
, **kwargs
):
2109 """GetExtension(self) -> String"""
2110 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
2112 def GetType(*args
, **kwargs
):
2113 """GetType(self) -> long"""
2114 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2116 def GetMimeType(*args
, **kwargs
):
2117 """GetMimeType(self) -> String"""
2118 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2120 def CanRead(*args
, **kwargs
):
2121 """CanRead(self, String name) -> bool"""
2122 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2124 def SetName(*args
, **kwargs
):
2125 """SetName(self, String name)"""
2126 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2128 def SetExtension(*args
, **kwargs
):
2129 """SetExtension(self, String extension)"""
2130 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2132 def SetType(*args
, **kwargs
):
2133 """SetType(self, long type)"""
2134 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2136 def SetMimeType(*args
, **kwargs
):
2137 """SetMimeType(self, String mimetype)"""
2138 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2141 class ImageHandlerPtr(ImageHandler
):
2142 def __init__(self
, this
):
2144 if not hasattr(self
,"thisown"): self
.thisown
= 0
2145 self
.__class
__ = ImageHandler
2146 _core_
.ImageHandler_swigregister(ImageHandlerPtr
)
2148 class ImageHistogram(object):
2149 """Proxy of C++ ImageHistogram class"""
2151 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2152 def __init__(self
, *args
, **kwargs
):
2153 """__init__(self) -> ImageHistogram"""
2154 newobj
= _core_
.new_ImageHistogram(*args
, **kwargs
)
2155 self
.this
= newobj
.this
2158 def MakeKey(*args
, **kwargs
):
2160 MakeKey(byte r, byte g, byte b) -> unsigned long
2162 Get the key in the histogram for the given RGB values
2164 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2166 MakeKey
= staticmethod(MakeKey
)
2167 def FindFirstUnusedColour(*args
, **kwargs
):
2169 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2171 Find first colour that is not used in the image and has higher RGB
2172 values than startR, startG, startB. Returns a tuple consisting of a
2173 success flag and rgb values.
2175 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2177 def GetCount(*args
, **kwargs
):
2179 GetCount(self, unsigned long key) -> unsigned long
2181 Returns the pixel count for the given key. Use `MakeKey` to create a
2182 key value from a RGB tripple.
2184 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2186 def GetCountRGB(*args
, **kwargs
):
2188 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2190 Returns the pixel count for the given RGB values.
2192 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2194 def GetCountColour(*args
, **kwargs
):
2196 GetCountColour(self, Colour colour) -> unsigned long
2198 Returns the pixel count for the given `wx.Colour` value.
2200 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2203 class ImageHistogramPtr(ImageHistogram
):
2204 def __init__(self
, this
):
2206 if not hasattr(self
,"thisown"): self
.thisown
= 0
2207 self
.__class
__ = ImageHistogram
2208 _core_
.ImageHistogram_swigregister(ImageHistogramPtr
)
2210 def ImageHistogram_MakeKey(*args
, **kwargs
):
2212 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2214 Get the key in the histogram for the given RGB values
2216 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2218 class Image(Object
):
2220 A platform-independent image class. An image can be created from
2221 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2222 variety of formats. Functions are available to set and get image
2223 bits, so it can be used for basic image manipulation.
2225 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2226 platform-specific `wx.Bitmap` object must be created from it using the
2227 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2228 device context, using `wx.DC.DrawBitmap`.
2230 One colour value of the image may be used as a mask colour which will
2231 lead to the automatic creation of a `wx.Mask` object associated to the
2234 wx.Image supports alpha channel data, that is in addition to a byte
2235 for the red, green and blue colour components for each pixel it also
2236 stores a byte representing the pixel opacity. An alpha value of 0
2237 corresponds to a transparent pixel (null opacity) while a value of 255
2238 means that the pixel is 100% opaque.
2240 Unlike RGB data, not all images have an alpha channel and before using
2241 `GetAlpha` you should check if this image contains an alpha channel
2242 with `HasAlpha`. Note that currently only images loaded from PNG files
2243 with transparency information will have an alpha channel.
2246 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2247 def __init__(self
, *args
, **kwargs
):
2249 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2251 Loads an image from a file.
2253 newobj
= _core_
.new_Image(*args
, **kwargs
)
2254 self
.this
= newobj
.this
2257 def __del__(self
, destroy
=_core_
.delete_Image
):
2260 if self
.thisown
: destroy(self
)
2263 def Create(*args
, **kwargs
):
2265 Create(self, int width, int height, bool clear=True)
2267 Creates a fresh image. If clear is ``True``, the new image will be
2268 initialized to black. Otherwise, the image data will be uninitialized.
2270 return _core_
.Image_Create(*args
, **kwargs
)
2272 def Destroy(*args
, **kwargs
):
2276 Destroys the image data.
2278 return _core_
.Image_Destroy(*args
, **kwargs
)
2280 def Scale(*args
, **kwargs
):
2282 Scale(self, int width, int height) -> Image
2284 Returns a scaled version of the image. This is also useful for scaling
2285 bitmaps in general as the only other way to scale bitmaps is to blit a
2286 `wx.MemoryDC` into another `wx.MemoryDC`.
2288 return _core_
.Image_Scale(*args
, **kwargs
)
2290 def ShrinkBy(*args
, **kwargs
):
2292 ShrinkBy(self, int xFactor, int yFactor) -> Image
2294 Return a version of the image scaled smaller by the given factors.
2296 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2298 def Rescale(*args
, **kwargs
):
2300 Rescale(self, int width, int height) -> Image
2302 Changes the size of the image in-place by scaling it: after a call to
2303 this function, the image will have the given width and height.
2305 Returns the (modified) image itself.
2307 return _core_
.Image_Rescale(*args
, **kwargs
)
2309 def Resize(*args
, **kwargs
):
2311 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2313 Changes the size of the image in-place without scaling it, by adding
2314 either a border with the given colour or cropping as necessary. The
2315 image is pasted into a new image with the given size and background
2316 colour at the position pos relative to the upper left of the new
2317 image. If red = green = blue = -1 then use either the current mask
2318 colour if set or find, use, and set a suitable mask colour for any
2319 newly exposed areas.
2321 Returns the (modified) image itself.
2323 return _core_
.Image_Resize(*args
, **kwargs
)
2325 def SetRGB(*args
, **kwargs
):
2327 SetRGB(self, int x, int y, byte r, byte g, byte b)
2329 Sets the pixel at the given coordinate. This routine performs
2330 bounds-checks for the coordinate so it can be considered a safe way to
2331 manipulate the data, but in some cases this might be too slow so that
2332 the data will have to be set directly. In that case you will have to
2333 get access to the image data using the `GetData` method.
2335 return _core_
.Image_SetRGB(*args
, **kwargs
)
2337 def SetRGBRect(*args
, **kwargs
):
2339 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2341 Sets the colour of the pixels within the given rectangle. This routine
2342 performs bounds-checks for the rectangle so it can be considered a
2343 safe way to manipulate the data.
2345 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2347 def GetRed(*args
, **kwargs
):
2349 GetRed(self, int x, int y) -> byte
2351 Returns the red intensity at the given coordinate.
2353 return _core_
.Image_GetRed(*args
, **kwargs
)
2355 def GetGreen(*args
, **kwargs
):
2357 GetGreen(self, int x, int y) -> byte
2359 Returns the green intensity at the given coordinate.
2361 return _core_
.Image_GetGreen(*args
, **kwargs
)
2363 def GetBlue(*args
, **kwargs
):
2365 GetBlue(self, int x, int y) -> byte
2367 Returns the blue intensity at the given coordinate.
2369 return _core_
.Image_GetBlue(*args
, **kwargs
)
2371 def SetAlpha(*args
, **kwargs
):
2373 SetAlpha(self, int x, int y, byte alpha)
2375 Sets the alpha value for the given pixel. This function should only be
2376 called if the image has alpha channel data, use `HasAlpha` to check
2379 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2381 def GetAlpha(*args
, **kwargs
):
2383 GetAlpha(self, int x, int y) -> byte
2385 Returns the alpha value for the given pixel. This function may only be
2386 called for the images with alpha channel, use `HasAlpha` to check for
2389 The returned value is the *opacity* of the image, i.e. the value of 0
2390 corresponds to the fully transparent pixels while the value of 255 to
2391 the fully opaque pixels.
2393 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2395 def HasAlpha(*args
, **kwargs
):
2397 HasAlpha(self) -> bool
2399 Returns true if this image has alpha channel, false otherwise.
2401 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2403 def InitAlpha(*args
, **kwargs
):
2407 Initializes the image alpha channel data. It is an error to call it if
2408 the image already has alpha data. If it doesn't, alpha data will be by
2409 default initialized to all pixels being fully opaque. But if the image
2410 has a a mask colour, all mask pixels will be completely transparent.
2412 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2414 def IsTransparent(*args
, **kwargs
):
2416 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2418 Returns ``True`` if this pixel is masked or has an alpha value less
2419 than the spcified threshold.
2421 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2423 def FindFirstUnusedColour(*args
, **kwargs
):
2425 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2427 Find first colour that is not used in the image and has higher RGB
2428 values than startR, startG, startB. Returns a tuple consisting of a
2429 success flag and rgb values.
2431 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2433 def ConvertAlphaToMask(*args
, **kwargs
):
2435 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2437 If the image has alpha channel, this method converts it to mask. All
2438 pixels with alpha value less than ``threshold`` are replaced with the
2439 mask colour and the alpha channel is removed. The mask colour is
2440 chosen automatically using `FindFirstUnusedColour`.
2442 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2445 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2447 def ConvertColourToAlpha(*args
, **kwargs
):
2449 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2451 This method converts an image where the original alpha information is
2452 only available as a shades of a colour (actually shades of grey)
2453 typically when you draw anti-aliased text into a bitmap. The DC
2454 drawing routines draw grey values on the black background although
2455 they actually mean to draw white with differnt alpha values. This
2456 method reverses it, assuming a black (!) background and white text.
2457 The method will then fill up the whole image with the colour given.
2459 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2461 def SetMaskFromImage(*args
, **kwargs
):
2463 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2465 Sets the image's mask so that the pixels that have RGB value of
2466 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2467 by first finding an unused colour in the image, setting this colour as
2468 the mask colour and then using this colour to draw all pixels in the
2469 image who corresponding pixel in mask has given RGB value.
2471 Returns ``False`` if ``mask`` does not have same dimensions as the
2472 image or if there is no unused colour left. Returns ``True`` if the
2473 mask was successfully applied.
2475 Note that this method involves computing the histogram, which is
2476 computationally intensive operation.
2478 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2480 def CanRead(*args
, **kwargs
):
2482 CanRead(String filename) -> bool
2484 Returns True if the image handlers can read this file.
2486 return _core_
.Image_CanRead(*args
, **kwargs
)
2488 CanRead
= staticmethod(CanRead
)
2489 def GetImageCount(*args
, **kwargs
):
2491 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2493 If the image file contains more than one image and the image handler
2494 is capable of retrieving these individually, this function will return
2495 the number of available images.
2497 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2499 GetImageCount
= staticmethod(GetImageCount
)
2500 def LoadFile(*args
, **kwargs
):
2502 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2504 Loads an image from a file. If no handler type is provided, the
2505 library will try to autodetect the format.
2507 return _core_
.Image_LoadFile(*args
, **kwargs
)
2509 def LoadMimeFile(*args
, **kwargs
):
2511 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2513 Loads an image from a file, specifying the image type with a MIME type
2516 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2518 def SaveFile(*args
, **kwargs
):
2520 SaveFile(self, String name, int type) -> bool
2522 Saves an image in the named file.
2524 return _core_
.Image_SaveFile(*args
, **kwargs
)
2526 def SaveMimeFile(*args
, **kwargs
):
2528 SaveMimeFile(self, String name, String mimetype) -> bool
2530 Saves an image in the named file.
2532 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2534 def CanReadStream(*args
, **kwargs
):
2536 CanReadStream(InputStream stream) -> bool
2538 Returns True if the image handlers can read an image file from the
2539 data currently on the input stream, or a readable Python file-like
2542 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2544 CanReadStream
= staticmethod(CanReadStream
)
2545 def LoadStream(*args
, **kwargs
):
2547 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2549 Loads an image from an input stream or a readable Python file-like
2550 object. If no handler type is provided, the library will try to
2551 autodetect the format.
2553 return _core_
.Image_LoadStream(*args
, **kwargs
)
2555 def LoadMimeStream(*args
, **kwargs
):
2557 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2559 Loads an image from an input stream or a readable Python file-like
2560 object, using a MIME type string to specify the image file format.
2562 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2564 def Ok(*args
, **kwargs
):
2568 Returns true if image data is present.
2570 return _core_
.Image_Ok(*args
, **kwargs
)
2572 def GetWidth(*args
, **kwargs
):
2574 GetWidth(self) -> int
2576 Gets the width of the image in pixels.
2578 return _core_
.Image_GetWidth(*args
, **kwargs
)
2580 def GetHeight(*args
, **kwargs
):
2582 GetHeight(self) -> int
2584 Gets the height of the image in pixels.
2586 return _core_
.Image_GetHeight(*args
, **kwargs
)
2588 def GetSize(*args
, **kwargs
):
2590 GetSize(self) -> Size
2592 Returns the size of the image in pixels.
2594 return _core_
.Image_GetSize(*args
, **kwargs
)
2596 def GetSubImage(*args
, **kwargs
):
2598 GetSubImage(self, Rect rect) -> Image
2600 Returns a sub image of the current one as long as the rect belongs
2601 entirely to the image.
2603 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2605 def Size(*args
, **kwargs
):
2607 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2609 Returns a resized version of this image without scaling it by adding
2610 either a border with the given colour or cropping as necessary. The
2611 image is pasted into a new image with the given size and background
2612 colour at the position ``pos`` relative to the upper left of the new
2613 image. If red = green = blue = -1 then use either the current mask
2614 colour if set or find, use, and set a suitable mask colour for any
2615 newly exposed areas.
2617 return _core_
.Image_Size(*args
, **kwargs
)
2619 def Copy(*args
, **kwargs
):
2623 Returns an identical copy of the image.
2625 return _core_
.Image_Copy(*args
, **kwargs
)
2627 def Paste(*args
, **kwargs
):
2629 Paste(self, Image image, int x, int y)
2631 Pastes ``image`` into this instance and takes care of the mask colour
2632 and any out of bounds problems.
2634 return _core_
.Image_Paste(*args
, **kwargs
)
2636 def GetData(*args
, **kwargs
):
2638 GetData(self) -> PyObject
2640 Returns a string containing a copy of the RGB bytes of the image.
2642 return _core_
.Image_GetData(*args
, **kwargs
)
2644 def SetData(*args
, **kwargs
):
2646 SetData(self, buffer data)
2648 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2649 either a string or a buffer object holding the data and the length of
2650 the data must be width*height*3.
2652 return _core_
.Image_SetData(*args
, **kwargs
)
2654 def GetDataBuffer(*args
, **kwargs
):
2656 GetDataBuffer(self) -> PyObject
2658 Returns a writable Python buffer object that is pointing at the RGB
2659 image data buffer inside the wx.Image. You need to ensure that you do
2660 not use this buffer object after the image has been destroyed.
2662 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
2664 def SetDataBuffer(*args
, **kwargs
):
2666 SetDataBuffer(self, buffer data)
2668 Sets the internal image data pointer to point at a Python buffer
2669 object. This can save making an extra copy of the data but you must
2670 ensure that the buffer object lives longer than the wx.Image does.
2672 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
2674 def GetAlphaData(*args
, **kwargs
):
2676 GetAlphaData(self) -> PyObject
2678 Returns a string containing a copy of the alpha bytes of the image.
2680 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
2682 def SetAlphaData(*args
, **kwargs
):
2684 SetAlphaData(self, buffer alpha)
2686 Resets the Image's alpha data from a buffer of bytes. Accepts either
2687 a string or a buffer object holding the data and the length of the
2688 data must be width*height.
2690 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
2692 def GetAlphaBuffer(*args
, **kwargs
):
2693 """GetAlphaBuffer(self) -> PyObject"""
2694 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
2696 def SetAlphaBuffer(*args
, **kwargs
):
2697 """SetAlphaBuffer(self, buffer alpha)"""
2698 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
2700 def SetMaskColour(*args
, **kwargs
):
2702 SetMaskColour(self, byte r, byte g, byte b)
2704 Sets the mask colour for this image (and tells the image to use the
2707 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
2709 def GetOrFindMaskColour(*args
, **kwargs
):
2711 GetOrFindMaskColour() -> (r,g,b)
2713 Get the current mask colour or find a suitable colour.
2715 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
2717 def GetMaskRed(*args
, **kwargs
):
2719 GetMaskRed(self) -> byte
2721 Gets the red component of the mask colour.
2723 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
2725 def GetMaskGreen(*args
, **kwargs
):
2727 GetMaskGreen(self) -> byte
2729 Gets the green component of the mask colour.
2731 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
2733 def GetMaskBlue(*args
, **kwargs
):
2735 GetMaskBlue(self) -> byte
2737 Gets the blue component of the mask colour.
2739 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
2741 def SetMask(*args
, **kwargs
):
2743 SetMask(self, bool mask=True)
2745 Specifies whether there is a mask or not. The area of the mask is
2746 determined by the current mask colour.
2748 return _core_
.Image_SetMask(*args
, **kwargs
)
2750 def HasMask(*args
, **kwargs
):
2752 HasMask(self) -> bool
2754 Returns ``True`` if there is a mask active, ``False`` otherwise.
2756 return _core_
.Image_HasMask(*args
, **kwargs
)
2758 def Rotate(*args
, **kwargs
):
2760 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2761 Point offset_after_rotation=None) -> Image
2763 Rotates the image about the given point, by ``angle`` radians. Passing
2764 ``True`` to ``interpolating`` results in better image quality, but is
2765 slower. If the image has a mask, then the mask colour is used for the
2766 uncovered pixels in the rotated image background. Otherwise, black
2767 will be used as the fill colour.
2769 Returns the rotated image, leaving this image intact.
2771 return _core_
.Image_Rotate(*args
, **kwargs
)
2773 def Rotate90(*args
, **kwargs
):
2775 Rotate90(self, bool clockwise=True) -> Image
2777 Returns a copy of the image rotated 90 degrees in the direction
2778 indicated by ``clockwise``.
2780 return _core_
.Image_Rotate90(*args
, **kwargs
)
2782 def Mirror(*args
, **kwargs
):
2784 Mirror(self, bool horizontally=True) -> Image
2786 Returns a mirrored copy of the image. The parameter ``horizontally``
2787 indicates the orientation.
2789 return _core_
.Image_Mirror(*args
, **kwargs
)
2791 def Replace(*args
, **kwargs
):
2793 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2795 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2798 return _core_
.Image_Replace(*args
, **kwargs
)
2800 def ConvertToMono(*args
, **kwargs
):
2802 ConvertToMono(self, byte r, byte g, byte b) -> Image
2804 Returns monochromatic version of the image. The returned image has
2805 white colour where the original has ``(r,g,b)`` colour and black
2806 colour everywhere else.
2808 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
2810 def SetOption(*args
, **kwargs
):
2812 SetOption(self, String name, String value)
2814 Sets an image handler defined option. For example, when saving as a
2815 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2816 number between 0 and 100 (0 is terrible, 100 is very good).
2818 return _core_
.Image_SetOption(*args
, **kwargs
)
2820 def SetOptionInt(*args
, **kwargs
):
2822 SetOptionInt(self, String name, int value)
2824 Sets an image option as an integer.
2826 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
2828 def GetOption(*args
, **kwargs
):
2830 GetOption(self, String name) -> String
2832 Gets the value of an image handler option.
2834 return _core_
.Image_GetOption(*args
, **kwargs
)
2836 def GetOptionInt(*args
, **kwargs
):
2838 GetOptionInt(self, String name) -> int
2840 Gets the value of an image handler option as an integer. If the given
2841 option is not present, the function returns 0.
2843 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
2845 def HasOption(*args
, **kwargs
):
2847 HasOption(self, String name) -> bool
2849 Returns true if the given option is present.
2851 return _core_
.Image_HasOption(*args
, **kwargs
)
2853 def CountColours(*args
, **kwargs
):
2854 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2855 return _core_
.Image_CountColours(*args
, **kwargs
)
2857 def ComputeHistogram(*args
, **kwargs
):
2858 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2859 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
2861 def AddHandler(*args
, **kwargs
):
2862 """AddHandler(ImageHandler handler)"""
2863 return _core_
.Image_AddHandler(*args
, **kwargs
)
2865 AddHandler
= staticmethod(AddHandler
)
2866 def InsertHandler(*args
, **kwargs
):
2867 """InsertHandler(ImageHandler handler)"""
2868 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2870 InsertHandler
= staticmethod(InsertHandler
)
2871 def RemoveHandler(*args
, **kwargs
):
2872 """RemoveHandler(String name) -> bool"""
2873 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2875 RemoveHandler
= staticmethod(RemoveHandler
)
2876 def GetImageExtWildcard(*args
, **kwargs
):
2878 GetImageExtWildcard() -> String
2880 Iterates all registered wxImageHandler objects, and returns a string
2881 containing file extension masks suitable for passing to file open/save
2884 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2886 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
2887 def ConvertToBitmap(*args
, **kwargs
):
2888 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2889 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
2891 def ConvertToMonoBitmap(*args
, **kwargs
):
2892 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2893 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
2895 def __nonzero__(self
): return self
.Ok()
2897 class ImagePtr(Image
):
2898 def __init__(self
, this
):
2900 if not hasattr(self
,"thisown"): self
.thisown
= 0
2901 self
.__class
__ = Image
2902 _core_
.Image_swigregister(ImagePtr
)
2904 def ImageFromMime(*args
, **kwargs
):
2906 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2908 Loads an image from a file, using a MIME type string (such as
2909 'image/jpeg') to specify image type.
2911 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
2915 def ImageFromStream(*args
, **kwargs
):
2917 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2919 Loads an image from an input stream, or any readable Python file-like
2922 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
2926 def ImageFromStreamMime(*args
, **kwargs
):
2928 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2930 Loads an image from an input stream, or any readable Python file-like
2931 object, specifying the image format with a MIME type string.
2933 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
2937 def EmptyImage(*args
, **kwargs
):
2939 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2941 Construct an empty image of a given size, optionally setting all
2944 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
2948 def ImageFromBitmap(*args
, **kwargs
):
2950 ImageFromBitmap(Bitmap bitmap) -> Image
2952 Construct an Image from a `wx.Bitmap`.
2954 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
2958 def ImageFromData(*args
, **kwargs
):
2960 ImageFromData(int width, int height, buffer data) -> Image
2962 Construct an Image from a buffer of RGB bytes. Accepts either a
2963 string or a buffer object holding the data and the length of the data
2964 must be width*height*3.
2966 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
2970 def ImageFromDataWithAlpha(*args
, **kwargs
):
2972 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2974 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2975 Accepts either a string or a buffer object holding the data and the
2976 length of the data must be width*height*3 bytes, and the length of the
2977 alpha data must be width*height bytes.
2979 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
2983 def Image_CanRead(*args
, **kwargs
):
2985 Image_CanRead(String filename) -> bool
2987 Returns True if the image handlers can read this file.
2989 return _core_
.Image_CanRead(*args
, **kwargs
)
2991 def Image_GetImageCount(*args
, **kwargs
):
2993 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2995 If the image file contains more than one image and the image handler
2996 is capable of retrieving these individually, this function will return
2997 the number of available images.
2999 return _core_
.Image_GetImageCount(*args
, **kwargs
)
3001 def Image_CanReadStream(*args
, **kwargs
):
3003 Image_CanReadStream(InputStream stream) -> bool
3005 Returns True if the image handlers can read an image file from the
3006 data currently on the input stream, or a readable Python file-like
3009 return _core_
.Image_CanReadStream(*args
, **kwargs
)
3011 def Image_AddHandler(*args
, **kwargs
):
3012 """Image_AddHandler(ImageHandler handler)"""
3013 return _core_
.Image_AddHandler(*args
, **kwargs
)
3015 def Image_InsertHandler(*args
, **kwargs
):
3016 """Image_InsertHandler(ImageHandler handler)"""
3017 return _core_
.Image_InsertHandler(*args
, **kwargs
)
3019 def Image_RemoveHandler(*args
, **kwargs
):
3020 """Image_RemoveHandler(String name) -> bool"""
3021 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
3023 def Image_GetImageExtWildcard(*args
, **kwargs
):
3025 Image_GetImageExtWildcard() -> String
3027 Iterates all registered wxImageHandler objects, and returns a string
3028 containing file extension masks suitable for passing to file open/save
3031 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
3033 def InitAllImageHandlers():
3035 The former functionality of InitAllImageHanders is now done internal to
3036 the _core_ extension module and so this function has become a simple NOP.
3040 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
3041 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
3042 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
3043 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
3044 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
3045 BMP_24BPP
= _core_
.BMP_24BPP
3046 BMP_8BPP
= _core_
.BMP_8BPP
3047 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
3048 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
3049 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3050 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3051 BMP_4BPP
= _core_
.BMP_4BPP
3052 BMP_1BPP
= _core_
.BMP_1BPP
3053 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3054 class BMPHandler(ImageHandler
):
3055 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3057 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3058 def __init__(self
, *args
, **kwargs
):
3060 __init__(self) -> BMPHandler
3062 A `wx.ImageHandler` for \*.bmp bitmap files.
3064 newobj
= _core_
.new_BMPHandler(*args
, **kwargs
)
3065 self
.this
= newobj
.this
3069 class BMPHandlerPtr(BMPHandler
):
3070 def __init__(self
, this
):
3072 if not hasattr(self
,"thisown"): self
.thisown
= 0
3073 self
.__class
__ = BMPHandler
3074 _core_
.BMPHandler_swigregister(BMPHandlerPtr
)
3075 NullImage
= cvar
.NullImage
3076 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3077 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3078 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3079 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3080 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3081 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3082 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3083 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3084 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3085 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3086 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3087 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3088 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3089 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3090 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3092 class ICOHandler(BMPHandler
):
3093 """A `wx.ImageHandler` for \*.ico icon files."""
3095 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3096 def __init__(self
, *args
, **kwargs
):
3098 __init__(self) -> ICOHandler
3100 A `wx.ImageHandler` for \*.ico icon files.
3102 newobj
= _core_
.new_ICOHandler(*args
, **kwargs
)
3103 self
.this
= newobj
.this
3107 class ICOHandlerPtr(ICOHandler
):
3108 def __init__(self
, this
):
3110 if not hasattr(self
,"thisown"): self
.thisown
= 0
3111 self
.__class
__ = ICOHandler
3112 _core_
.ICOHandler_swigregister(ICOHandlerPtr
)
3114 class CURHandler(ICOHandler
):
3115 """A `wx.ImageHandler` for \*.cur cursor files."""
3117 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3118 def __init__(self
, *args
, **kwargs
):
3120 __init__(self) -> CURHandler
3122 A `wx.ImageHandler` for \*.cur cursor files.
3124 newobj
= _core_
.new_CURHandler(*args
, **kwargs
)
3125 self
.this
= newobj
.this
3129 class CURHandlerPtr(CURHandler
):
3130 def __init__(self
, this
):
3132 if not hasattr(self
,"thisown"): self
.thisown
= 0
3133 self
.__class
__ = CURHandler
3134 _core_
.CURHandler_swigregister(CURHandlerPtr
)
3136 class ANIHandler(CURHandler
):
3137 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3139 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3140 def __init__(self
, *args
, **kwargs
):
3142 __init__(self) -> ANIHandler
3144 A `wx.ImageHandler` for \*.ani animated cursor files.
3146 newobj
= _core_
.new_ANIHandler(*args
, **kwargs
)
3147 self
.this
= newobj
.this
3151 class ANIHandlerPtr(ANIHandler
):
3152 def __init__(self
, this
):
3154 if not hasattr(self
,"thisown"): self
.thisown
= 0
3155 self
.__class
__ = ANIHandler
3156 _core_
.ANIHandler_swigregister(ANIHandlerPtr
)
3158 class PNGHandler(ImageHandler
):
3159 """A `wx.ImageHandler` for PNG image files."""
3161 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3162 def __init__(self
, *args
, **kwargs
):
3164 __init__(self) -> PNGHandler
3166 A `wx.ImageHandler` for PNG image files.
3168 newobj
= _core_
.new_PNGHandler(*args
, **kwargs
)
3169 self
.this
= newobj
.this
3173 class PNGHandlerPtr(PNGHandler
):
3174 def __init__(self
, this
):
3176 if not hasattr(self
,"thisown"): self
.thisown
= 0
3177 self
.__class
__ = PNGHandler
3178 _core_
.PNGHandler_swigregister(PNGHandlerPtr
)
3180 class GIFHandler(ImageHandler
):
3181 """A `wx.ImageHandler` for GIF image files."""
3183 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3184 def __init__(self
, *args
, **kwargs
):
3186 __init__(self) -> GIFHandler
3188 A `wx.ImageHandler` for GIF image files.
3190 newobj
= _core_
.new_GIFHandler(*args
, **kwargs
)
3191 self
.this
= newobj
.this
3195 class GIFHandlerPtr(GIFHandler
):
3196 def __init__(self
, this
):
3198 if not hasattr(self
,"thisown"): self
.thisown
= 0
3199 self
.__class
__ = GIFHandler
3200 _core_
.GIFHandler_swigregister(GIFHandlerPtr
)
3202 class PCXHandler(ImageHandler
):
3203 """A `wx.ImageHandler` for PCX imager files."""
3205 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3206 def __init__(self
, *args
, **kwargs
):
3208 __init__(self) -> PCXHandler
3210 A `wx.ImageHandler` for PCX imager files.
3212 newobj
= _core_
.new_PCXHandler(*args
, **kwargs
)
3213 self
.this
= newobj
.this
3217 class PCXHandlerPtr(PCXHandler
):
3218 def __init__(self
, this
):
3220 if not hasattr(self
,"thisown"): self
.thisown
= 0
3221 self
.__class
__ = PCXHandler
3222 _core_
.PCXHandler_swigregister(PCXHandlerPtr
)
3224 class JPEGHandler(ImageHandler
):
3225 """A `wx.ImageHandler` for JPEG/JPG image files."""
3227 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3228 def __init__(self
, *args
, **kwargs
):
3230 __init__(self) -> JPEGHandler
3232 A `wx.ImageHandler` for JPEG/JPG image files.
3234 newobj
= _core_
.new_JPEGHandler(*args
, **kwargs
)
3235 self
.this
= newobj
.this
3239 class JPEGHandlerPtr(JPEGHandler
):
3240 def __init__(self
, this
):
3242 if not hasattr(self
,"thisown"): self
.thisown
= 0
3243 self
.__class
__ = JPEGHandler
3244 _core_
.JPEGHandler_swigregister(JPEGHandlerPtr
)
3246 class PNMHandler(ImageHandler
):
3247 """A `wx.ImageHandler` for PNM image files."""
3249 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3250 def __init__(self
, *args
, **kwargs
):
3252 __init__(self) -> PNMHandler
3254 A `wx.ImageHandler` for PNM image files.
3256 newobj
= _core_
.new_PNMHandler(*args
, **kwargs
)
3257 self
.this
= newobj
.this
3261 class PNMHandlerPtr(PNMHandler
):
3262 def __init__(self
, this
):
3264 if not hasattr(self
,"thisown"): self
.thisown
= 0
3265 self
.__class
__ = PNMHandler
3266 _core_
.PNMHandler_swigregister(PNMHandlerPtr
)
3268 class XPMHandler(ImageHandler
):
3269 """A `wx.ImageHandler` for XPM image."""
3271 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3272 def __init__(self
, *args
, **kwargs
):
3274 __init__(self) -> XPMHandler
3276 A `wx.ImageHandler` for XPM image.
3278 newobj
= _core_
.new_XPMHandler(*args
, **kwargs
)
3279 self
.this
= newobj
.this
3283 class XPMHandlerPtr(XPMHandler
):
3284 def __init__(self
, this
):
3286 if not hasattr(self
,"thisown"): self
.thisown
= 0
3287 self
.__class
__ = XPMHandler
3288 _core_
.XPMHandler_swigregister(XPMHandlerPtr
)
3290 class TIFFHandler(ImageHandler
):
3291 """A `wx.ImageHandler` for TIFF image files."""
3293 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3294 def __init__(self
, *args
, **kwargs
):
3296 __init__(self) -> TIFFHandler
3298 A `wx.ImageHandler` for TIFF image files.
3300 newobj
= _core_
.new_TIFFHandler(*args
, **kwargs
)
3301 self
.this
= newobj
.this
3305 class TIFFHandlerPtr(TIFFHandler
):
3306 def __init__(self
, this
):
3308 if not hasattr(self
,"thisown"): self
.thisown
= 0
3309 self
.__class
__ = TIFFHandler
3310 _core_
.TIFFHandler_swigregister(TIFFHandlerPtr
)
3312 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3313 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3314 class Quantize(object):
3315 """Performs quantization, or colour reduction, on a wxImage."""
3316 def __init__(self
): raise RuntimeError, "No constructor defined"
3318 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3319 def Quantize(*args
, **kwargs
):
3321 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3323 Reduce the colours in the source image and put the result into the
3324 destination image, setting the palette in the destination if
3325 needed. Both images may be the same, to overwrite the source image.
3327 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3329 Quantize
= staticmethod(Quantize
)
3331 class QuantizePtr(Quantize
):
3332 def __init__(self
, this
):
3334 if not hasattr(self
,"thisown"): self
.thisown
= 0
3335 self
.__class
__ = Quantize
3336 _core_
.Quantize_swigregister(QuantizePtr
)
3338 def Quantize_Quantize(*args
, **kwargs
):
3340 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3342 Reduce the colours in the source image and put the result into the
3343 destination image, setting the palette in the destination if
3344 needed. Both images may be the same, to overwrite the source image.
3346 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3348 #---------------------------------------------------------------------------
3350 class EvtHandler(Object
):
3351 """Proxy of C++ EvtHandler class"""
3353 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3354 def __init__(self
, *args
, **kwargs
):
3355 """__init__(self) -> EvtHandler"""
3356 newobj
= _core_
.new_EvtHandler(*args
, **kwargs
)
3357 self
.this
= newobj
.this
3360 def GetNextHandler(*args
, **kwargs
):
3361 """GetNextHandler(self) -> EvtHandler"""
3362 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3364 def GetPreviousHandler(*args
, **kwargs
):
3365 """GetPreviousHandler(self) -> EvtHandler"""
3366 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3368 def SetNextHandler(*args
, **kwargs
):
3369 """SetNextHandler(self, EvtHandler handler)"""
3370 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3372 def SetPreviousHandler(*args
, **kwargs
):
3373 """SetPreviousHandler(self, EvtHandler handler)"""
3374 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3376 def GetEvtHandlerEnabled(*args
, **kwargs
):
3377 """GetEvtHandlerEnabled(self) -> bool"""
3378 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3380 def SetEvtHandlerEnabled(*args
, **kwargs
):
3381 """SetEvtHandlerEnabled(self, bool enabled)"""
3382 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3384 def ProcessEvent(*args
, **kwargs
):
3385 """ProcessEvent(self, Event event) -> bool"""
3386 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3388 def AddPendingEvent(*args
, **kwargs
):
3389 """AddPendingEvent(self, Event event)"""
3390 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3392 def ProcessPendingEvents(*args
, **kwargs
):
3393 """ProcessPendingEvents(self)"""
3394 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3396 def Connect(*args
, **kwargs
):
3397 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3398 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3400 def Disconnect(*args
, **kwargs
):
3401 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
3402 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3404 def _setOORInfo(*args
, **kwargs
):
3405 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3406 return _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3408 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3410 Bind an event to an event handler.
3412 :param event: One of the EVT_* objects that specifies the
3413 type of event to bind,
3415 :param handler: A callable object to be invoked when the
3416 event is delivered to self. Pass None to
3417 disconnect an event handler.
3419 :param source: Sometimes the event originates from a
3420 different window than self, but you still
3421 want to catch it in self. (For example, a
3422 button event delivered to a frame.) By
3423 passing the source of the event, the event
3424 handling system is able to differentiate
3425 between the same event type from different
3428 :param id: Used to spcify the event source by ID instead
3431 :param id2: Used when it is desirable to bind a handler
3432 to a range of IDs, such as with EVT_MENU_RANGE.
3434 if source
is not None:
3436 event
.Bind(self
, id, id2
, handler
)
3438 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3440 Disconencts the event handler binding for event from self.
3441 Returns True if successful.
3443 if source
is not None:
3445 return event
.Unbind(self
, id, id2
)
3448 class EvtHandlerPtr(EvtHandler
):
3449 def __init__(self
, this
):
3451 if not hasattr(self
,"thisown"): self
.thisown
= 0
3452 self
.__class
__ = EvtHandler
3453 _core_
.EvtHandler_swigregister(EvtHandlerPtr
)
3455 #---------------------------------------------------------------------------
3457 class PyEventBinder(object):
3459 Instances of this class are used to bind specific events to event
3462 def __init__(self
, evtType
, expectedIDs
=0):
3463 if expectedIDs
not in [0, 1, 2]:
3464 raise ValueError, "Invalid number of expectedIDs"
3465 self
.expectedIDs
= expectedIDs
3467 if type(evtType
) == list or type(evtType
) == tuple:
3468 self
.evtType
= evtType
3470 self
.evtType
= [evtType
]
3473 def Bind(self
, target
, id1
, id2
, function
):
3474 """Bind this set of event types to target."""
3475 for et
in self
.evtType
:
3476 target
.Connect(id1
, id2
, et
, function
)
3479 def Unbind(self
, target
, id1
, id2
):
3480 """Remove an event binding."""
3482 for et
in self
.evtType
:
3483 success
+= target
.Disconnect(id1
, id2
, et
)
3487 def __call__(self
, *args
):
3489 For backwards compatibility with the old EVT_* functions.
3490 Should be called with either (window, func), (window, ID,
3491 func) or (window, ID1, ID2, func) parameters depending on the
3494 assert len(args
) == 2 + self
.expectedIDs
3498 if self
.expectedIDs
== 0:
3500 elif self
.expectedIDs
== 1:
3503 elif self
.expectedIDs
== 2:
3508 raise ValueError, "Unexpected number of IDs"
3510 self
.Bind(target
, id1
, id2
, func
)
3513 # These two are square pegs that don't fit the PyEventBinder hole...
3514 def EVT_COMMAND(win
, id, cmd
, func
):
3515 win
.Connect(id, -1, cmd
, func
)
3516 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3517 win
.Connect(id1
, id2
, cmd
, func
)
3520 #---------------------------------------------------------------------------
3522 #---------------------------------------------------------------------------
3524 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3525 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3527 def NewEventType(*args
, **kwargs
):
3528 """NewEventType() -> wxEventType"""
3529 return _core_
.NewEventType(*args
, **kwargs
)
3530 wxEVT_NULL
= _core_
.wxEVT_NULL
3531 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3532 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3533 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3534 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3535 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3536 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3537 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3538 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3539 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3540 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3541 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3542 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3543 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3544 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3545 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3546 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3547 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3548 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3549 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3550 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3551 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3552 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3553 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3554 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3555 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3556 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3557 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3558 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3559 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3560 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3561 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3562 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3563 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3564 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3565 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3566 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3567 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3568 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3569 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3570 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3571 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3572 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3573 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3574 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3575 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3576 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3577 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3578 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3579 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3580 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3581 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3582 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3583 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3584 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3585 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3586 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3587 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3588 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3589 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3590 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3591 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3592 wxEVT_SCROLL_ENDSCROLL
= _core_
.wxEVT_SCROLL_ENDSCROLL
3593 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3594 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3595 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3596 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3597 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3598 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3599 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3600 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3601 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3602 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3603 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3604 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3605 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3606 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3607 wxEVT_POWER
= _core_
.wxEVT_POWER
3608 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3609 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3610 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3611 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3612 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3613 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3614 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3615 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3616 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3617 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3618 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3619 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3620 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3621 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3622 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3623 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3624 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3625 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3626 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3627 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3628 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
3629 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
3630 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
3631 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
3632 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
3633 wxEVT_IDLE
= _core_
.wxEVT_IDLE
3634 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
3635 wxEVT_SIZING
= _core_
.wxEVT_SIZING
3636 wxEVT_MOVING
= _core_
.wxEVT_MOVING
3637 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
3638 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
3639 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
3640 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
3641 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
3642 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
3643 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
3644 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
3646 # Create some event binders
3647 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
3648 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
3649 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
3650 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
3651 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
3652 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3653 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3654 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
3655 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
3656 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
3657 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
3658 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
3659 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
3660 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
3661 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
3662 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
3663 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
3664 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
3665 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
3666 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
3667 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
3668 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
3669 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
3670 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
3671 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
3672 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3673 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3674 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
3675 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
3676 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
3677 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
3678 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
3679 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
3680 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
3681 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
3682 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
3683 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
3684 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
3685 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
3686 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
3687 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
3689 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
3690 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
3691 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
3692 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
3693 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
3694 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
3695 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
3696 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
3697 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
3698 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
3699 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
3700 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
3701 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
3703 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
3711 wxEVT_MIDDLE_DCLICK
,
3719 # Scrolling from wxWindow (sent to wxScrolledWindow)
3720 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
3721 wxEVT_SCROLLWIN_BOTTOM
,
3722 wxEVT_SCROLLWIN_LINEUP
,
3723 wxEVT_SCROLLWIN_LINEDOWN
,
3724 wxEVT_SCROLLWIN_PAGEUP
,
3725 wxEVT_SCROLLWIN_PAGEDOWN
,
3726 wxEVT_SCROLLWIN_THUMBTRACK
,
3727 wxEVT_SCROLLWIN_THUMBRELEASE
,
3730 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
3731 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
3732 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
3733 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
3734 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
3735 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
3736 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
3737 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
3739 # Scrolling from wx.Slider and wx.ScrollBar
3740 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3741 wxEVT_SCROLL_BOTTOM
,
3742 wxEVT_SCROLL_LINEUP
,
3743 wxEVT_SCROLL_LINEDOWN
,
3744 wxEVT_SCROLL_PAGEUP
,
3745 wxEVT_SCROLL_PAGEDOWN
,
3746 wxEVT_SCROLL_THUMBTRACK
,
3747 wxEVT_SCROLL_THUMBRELEASE
,
3748 wxEVT_SCROLL_ENDSCROLL
,
3751 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
3752 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
3753 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
3754 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
3755 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
3756 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
3757 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
3758 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
3759 EVT_SCROLL_ENDSCROLL
= wx
.PyEventBinder( wxEVT_SCROLL_ENDSCROLL
)
3761 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3762 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3763 wxEVT_SCROLL_BOTTOM
,
3764 wxEVT_SCROLL_LINEUP
,
3765 wxEVT_SCROLL_LINEDOWN
,
3766 wxEVT_SCROLL_PAGEUP
,
3767 wxEVT_SCROLL_PAGEDOWN
,
3768 wxEVT_SCROLL_THUMBTRACK
,
3769 wxEVT_SCROLL_THUMBRELEASE
,
3770 wxEVT_SCROLL_ENDSCROLL
,
3773 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
3774 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
3775 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
3776 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
3777 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
3778 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
3779 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
3780 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
3781 EVT_COMMAND_SCROLL_ENDSCROLL
= wx
.PyEventBinder( wxEVT_SCROLL_ENDSCROLL
, 1)
3783 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
3784 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
3785 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
3786 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
3787 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
3788 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
3789 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
3790 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
3791 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
3792 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
3794 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
3795 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
3796 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
3797 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
3798 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
3799 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
3800 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
3801 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
3802 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
3805 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
3806 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
3807 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
3808 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
3809 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
3810 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
3811 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
3813 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
3815 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
3816 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
3818 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
3822 #---------------------------------------------------------------------------
3824 class Event(Object
):
3826 An event is a structure holding information about an event passed to a
3827 callback or member function. wx.Event is an abstract base class for
3830 def __init__(self
): raise RuntimeError, "No constructor defined"
3832 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3833 def __del__(self
, destroy
=_core_
.delete_Event
):
3836 if self
.thisown
: destroy(self
)
3839 def SetEventType(*args
, **kwargs
):
3841 SetEventType(self, wxEventType typ)
3843 Sets the specific type of the event.
3845 return _core_
.Event_SetEventType(*args
, **kwargs
)
3847 def GetEventType(*args
, **kwargs
):
3849 GetEventType(self) -> wxEventType
3851 Returns the identifier of the given event type, such as
3852 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3854 return _core_
.Event_GetEventType(*args
, **kwargs
)
3856 def GetEventObject(*args
, **kwargs
):
3858 GetEventObject(self) -> Object
3860 Returns the object (usually a window) associated with the event, if
3863 return _core_
.Event_GetEventObject(*args
, **kwargs
)
3865 def SetEventObject(*args
, **kwargs
):
3867 SetEventObject(self, Object obj)
3869 Sets the originating object, or in other words, obj is normally the
3870 object that is sending the event.
3872 return _core_
.Event_SetEventObject(*args
, **kwargs
)
3874 def GetTimestamp(*args
, **kwargs
):
3875 """GetTimestamp(self) -> long"""
3876 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
3878 def SetTimestamp(*args
, **kwargs
):
3879 """SetTimestamp(self, long ts=0)"""
3880 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
3882 def GetId(*args
, **kwargs
):
3886 Returns the identifier associated with this event, such as a button
3889 return _core_
.Event_GetId(*args
, **kwargs
)
3891 def SetId(*args
, **kwargs
):
3895 Set's the ID for the event. This is usually the ID of the window that
3896 is sending the event, but it can also be a command id from a menu
3899 return _core_
.Event_SetId(*args
, **kwargs
)
3901 def IsCommandEvent(*args
, **kwargs
):
3903 IsCommandEvent(self) -> bool
3905 Returns true if the event is or is derived from `wx.CommandEvent` else
3906 it returns false. Note: Exists only for optimization purposes.
3908 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
3910 def Skip(*args
, **kwargs
):
3912 Skip(self, bool skip=True)
3914 Called by an event handler, it controls whether additional event
3915 handlers bound to this event will be called after the current event
3916 handler returns. Skip(false) (the default setting) will prevent
3917 additional event handlers from being called and control will be
3918 returned to the sender of the event immediately after the current
3919 handler has finished. Skip(True) will cause the event processing
3920 system to continue searching for a handler function for this event.
3923 return _core_
.Event_Skip(*args
, **kwargs
)
3925 def GetSkipped(*args
, **kwargs
):
3927 GetSkipped(self) -> bool
3929 Returns true if the event handler should be skipped, false otherwise.
3932 return _core_
.Event_GetSkipped(*args
, **kwargs
)
3934 def ShouldPropagate(*args
, **kwargs
):
3936 ShouldPropagate(self) -> bool
3938 Test if this event should be propagated to the parent window or not,
3939 i.e. if the propagation level is currently greater than 0.
3941 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
3943 def StopPropagation(*args
, **kwargs
):
3945 StopPropagation(self) -> int
3947 Stop the event from propagating to its parent window. Returns the old
3948 propagation level value which may be later passed to
3949 `ResumePropagation` to allow propagating the event again.
3951 return _core_
.Event_StopPropagation(*args
, **kwargs
)
3953 def ResumePropagation(*args
, **kwargs
):
3955 ResumePropagation(self, int propagationLevel)
3957 Resume the event propagation by restoring the propagation level. (For
3958 example, you can use the value returned by an earlier call to
3962 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
3964 def Clone(*args
, **kwargs
):
3965 """Clone(self) -> Event"""
3966 return _core_
.Event_Clone(*args
, **kwargs
)
3969 class EventPtr(Event
):
3970 def __init__(self
, this
):
3972 if not hasattr(self
,"thisown"): self
.thisown
= 0
3973 self
.__class
__ = Event
3974 _core_
.Event_swigregister(EventPtr
)
3976 #---------------------------------------------------------------------------
3978 class PropagationDisabler(object):
3980 Helper class to temporarily change an event not to propagate. Simply
3981 create an instance of this class and then whe it is destroyed the
3982 propogation of the event will be restored.
3985 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3986 def __init__(self
, *args
, **kwargs
):
3988 __init__(self, Event event) -> PropagationDisabler
3990 Helper class to temporarily change an event not to propagate. Simply
3991 create an instance of this class and then whe it is destroyed the
3992 propogation of the event will be restored.
3994 newobj
= _core_
.new_PropagationDisabler(*args
, **kwargs
)
3995 self
.this
= newobj
.this
3998 def __del__(self
, destroy
=_core_
.delete_PropagationDisabler
):
4001 if self
.thisown
: destroy(self
)
4005 class PropagationDisablerPtr(PropagationDisabler
):
4006 def __init__(self
, this
):
4008 if not hasattr(self
,"thisown"): self
.thisown
= 0
4009 self
.__class
__ = PropagationDisabler
4010 _core_
.PropagationDisabler_swigregister(PropagationDisablerPtr
)
4012 class PropagateOnce(object):
4014 A helper class that will temporarily lower propagation level of an
4015 event. Simply create an instance of this class and then whe it is
4016 destroyed the propogation of the event will be restored.
4019 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4020 def __init__(self
, *args
, **kwargs
):
4022 __init__(self, Event event) -> PropagateOnce
4024 A helper class that will temporarily lower propagation level of an
4025 event. Simply create an instance of this class and then whe it is
4026 destroyed the propogation of the event will be restored.
4028 newobj
= _core_
.new_PropagateOnce(*args
, **kwargs
)
4029 self
.this
= newobj
.this
4032 def __del__(self
, destroy
=_core_
.delete_PropagateOnce
):
4035 if self
.thisown
: destroy(self
)
4039 class PropagateOncePtr(PropagateOnce
):
4040 def __init__(self
, this
):
4042 if not hasattr(self
,"thisown"): self
.thisown
= 0
4043 self
.__class
__ = PropagateOnce
4044 _core_
.PropagateOnce_swigregister(PropagateOncePtr
)
4046 #---------------------------------------------------------------------------
4048 class CommandEvent(Event
):
4050 This event class contains information about command events, which
4051 originate from a variety of simple controls, as well as menus and
4055 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4056 def __init__(self
, *args
, **kwargs
):
4058 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4060 This event class contains information about command events, which
4061 originate from a variety of simple controls, as well as menus and
4064 newobj
= _core_
.new_CommandEvent(*args
, **kwargs
)
4065 self
.this
= newobj
.this
4068 def GetSelection(*args
, **kwargs
):
4070 GetSelection(self) -> int
4072 Returns item index for a listbox or choice selection event (not valid
4075 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
4077 def SetString(*args
, **kwargs
):
4078 """SetString(self, String s)"""
4079 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
4081 def GetString(*args
, **kwargs
):
4083 GetString(self) -> String
4085 Returns item string for a listbox or choice selection event (not valid
4088 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
4090 def IsChecked(*args
, **kwargs
):
4092 IsChecked(self) -> bool
4094 This method can be used with checkbox and menu events: for the
4095 checkboxes, the method returns true for a selection event and false
4096 for a deselection one. For the menu events, this method indicates if
4097 the menu item just has become checked or unchecked (and thus only
4098 makes sense for checkable menu items).
4100 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
4103 def IsSelection(*args
, **kwargs
):
4105 IsSelection(self) -> bool
4107 For a listbox or similar event, returns true if it is a selection,
4108 false if it is a deselection.
4110 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4112 def SetExtraLong(*args
, **kwargs
):
4113 """SetExtraLong(self, long extraLong)"""
4114 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4116 def GetExtraLong(*args
, **kwargs
):
4118 GetExtraLong(self) -> long
4120 Returns extra information dependant on the event objects type. If the
4121 event comes from a listbox selection, it is a boolean determining
4122 whether the event was a selection (true) or a deselection (false). A
4123 listbox deselection only occurs for multiple-selection boxes, and in
4124 this case the index and string values are indeterminate and the
4125 listbox must be examined by the application.
4127 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4129 def SetInt(*args
, **kwargs
):
4130 """SetInt(self, int i)"""
4131 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4133 def GetInt(*args
, **kwargs
):
4135 GetInt(self) -> long
4137 Returns the integer identifier corresponding to a listbox, choice or
4138 radiobox selection (only if the event was a selection, not a
4139 deselection), or a boolean value representing the value of a checkbox.
4141 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4143 def Clone(*args
, **kwargs
):
4144 """Clone(self) -> Event"""
4145 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4148 class CommandEventPtr(CommandEvent
):
4149 def __init__(self
, this
):
4151 if not hasattr(self
,"thisown"): self
.thisown
= 0
4152 self
.__class
__ = CommandEvent
4153 _core_
.CommandEvent_swigregister(CommandEventPtr
)
4155 #---------------------------------------------------------------------------
4157 class NotifyEvent(CommandEvent
):
4159 An instance of this class (or one of its derived classes) is sent from
4160 a control when the control's state is being changed and the control
4161 allows that change to be prevented from happening. The event handler
4162 can call `Veto` or `Allow` to tell the control what to do.
4165 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4166 def __init__(self
, *args
, **kwargs
):
4168 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4170 An instance of this class (or one of its derived classes) is sent from
4171 a control when the control's state is being changed and the control
4172 allows that change to be prevented from happening. The event handler
4173 can call `Veto` or `Allow` to tell the control what to do.
4175 newobj
= _core_
.new_NotifyEvent(*args
, **kwargs
)
4176 self
.this
= newobj
.this
4179 def Veto(*args
, **kwargs
):
4183 Prevents the change announced by this event from happening.
4185 It is in general a good idea to notify the user about the reasons for
4186 vetoing the change because otherwise the applications behaviour (which
4187 just refuses to do what the user wants) might be quite surprising.
4189 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4191 def Allow(*args
, **kwargs
):
4195 This is the opposite of `Veto`: it explicitly allows the event to be
4196 processed. For most events it is not necessary to call this method as
4197 the events are allowed anyhow but some are forbidden by default (this
4198 will be mentioned in the corresponding event description).
4200 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4202 def IsAllowed(*args
, **kwargs
):
4204 IsAllowed(self) -> bool
4206 Returns true if the change is allowed (`Veto` hasn't been called) or
4207 false otherwise (if it was).
4209 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4212 class NotifyEventPtr(NotifyEvent
):
4213 def __init__(self
, this
):
4215 if not hasattr(self
,"thisown"): self
.thisown
= 0
4216 self
.__class
__ = NotifyEvent
4217 _core_
.NotifyEvent_swigregister(NotifyEventPtr
)
4219 #---------------------------------------------------------------------------
4221 class ScrollEvent(CommandEvent
):
4223 A scroll event holds information about events sent from stand-alone
4224 scrollbars and sliders. Note that scrolled windows do not send
4225 instnaces of this event class, but send the `wx.ScrollWinEvent`
4229 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4230 def __init__(self
, *args
, **kwargs
):
4232 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4233 int orient=0) -> ScrollEvent
4235 newobj
= _core_
.new_ScrollEvent(*args
, **kwargs
)
4236 self
.this
= newobj
.this
4239 def GetOrientation(*args
, **kwargs
):
4241 GetOrientation(self) -> int
4243 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4246 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4248 def GetPosition(*args
, **kwargs
):
4250 GetPosition(self) -> int
4252 Returns the position of the scrollbar.
4254 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4256 def SetOrientation(*args
, **kwargs
):
4257 """SetOrientation(self, int orient)"""
4258 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4260 def SetPosition(*args
, **kwargs
):
4261 """SetPosition(self, int pos)"""
4262 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4265 class ScrollEventPtr(ScrollEvent
):
4266 def __init__(self
, this
):
4268 if not hasattr(self
,"thisown"): self
.thisown
= 0
4269 self
.__class
__ = ScrollEvent
4270 _core_
.ScrollEvent_swigregister(ScrollEventPtr
)
4272 #---------------------------------------------------------------------------
4274 class ScrollWinEvent(Event
):
4276 A wx.ScrollWinEvent holds information about scrolling and is sent from
4280 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4281 def __init__(self
, *args
, **kwargs
):
4283 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4285 A wx.ScrollWinEvent holds information about scrolling and is sent from
4288 newobj
= _core_
.new_ScrollWinEvent(*args
, **kwargs
)
4289 self
.this
= newobj
.this
4292 def GetOrientation(*args
, **kwargs
):
4294 GetOrientation(self) -> int
4296 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4299 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4301 def GetPosition(*args
, **kwargs
):
4303 GetPosition(self) -> int
4305 Returns the position of the scrollbar for the thumb track and release
4306 events. Note that this field can't be used for the other events, you
4307 need to query the window itself for the current position in that case.
4309 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4311 def SetOrientation(*args
, **kwargs
):
4312 """SetOrientation(self, int orient)"""
4313 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4315 def SetPosition(*args
, **kwargs
):
4316 """SetPosition(self, int pos)"""
4317 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4320 class ScrollWinEventPtr(ScrollWinEvent
):
4321 def __init__(self
, this
):
4323 if not hasattr(self
,"thisown"): self
.thisown
= 0
4324 self
.__class
__ = ScrollWinEvent
4325 _core_
.ScrollWinEvent_swigregister(ScrollWinEventPtr
)
4327 #---------------------------------------------------------------------------
4329 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4330 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4331 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4332 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4333 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4334 class MouseEvent(Event
):
4336 This event class contains information about the events generated by
4337 the mouse: they include mouse buttons press and release events and
4340 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4341 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4342 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4343 a middle button so a portable application should avoid relying on the
4346 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4347 the former returns true when the event corresponds to the left mouse
4348 button click while the latter returns true if the left mouse button is
4349 currently being pressed. For example, when the user is dragging the
4350 mouse you can use `LeftIsDown` to test whether the left mouse button
4351 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4352 `LeftIsDown` will also return true in wxWidgets whatever the
4353 underlying GUI behaviour is (which is platform-dependent). The same
4354 applies, of course, to other mouse buttons as well.
4357 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4358 def __init__(self
, *args
, **kwargs
):
4360 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4362 Constructs a wx.MouseEvent. Valid event types are:
4364 * wxEVT_ENTER_WINDOW
4365 * wxEVT_LEAVE_WINDOW
4371 * wxEVT_MIDDLE_DCLICK
4374 * wxEVT_RIGHT_DCLICK
4378 newobj
= _core_
.new_MouseEvent(*args
, **kwargs
)
4379 self
.this
= newobj
.this
4382 def IsButton(*args
, **kwargs
):
4384 IsButton(self) -> bool
4386 Returns true if the event was a mouse button event (not necessarily a
4387 button down event - that may be tested using `ButtonDown`).
4389 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4391 def ButtonDown(*args
, **kwargs
):
4393 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4395 If the argument is omitted, this returns true if the event was any
4396 mouse button down event. Otherwise the argument specifies which
4397 button-down event shold be checked for (see `Button` for the possible
4400 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4402 def ButtonDClick(*args
, **kwargs
):
4404 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4406 If the argument is omitted, this returns true if the event was any
4407 mouse double click event. Otherwise the argument specifies which
4408 double click event to check for (see `Button` for the possible
4411 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4413 def ButtonUp(*args
, **kwargs
):
4415 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4417 If the argument is omitted, this returns true if the event was any
4418 mouse button up event. Otherwise the argument specifies which button
4419 up event to check for (see `Button` for the possible values).
4421 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4423 def Button(*args
, **kwargs
):
4425 Button(self, int button) -> bool
4427 Returns true if the identified mouse button is changing state. Valid
4428 values of button are:
4430 ==================== =====================================
4431 wx.MOUSE_BTN_LEFT check if left button was pressed
4432 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4433 wx.MOUSE_BTN_RIGHT check if right button was pressed
4434 wx.MOUSE_BTN_ANY check if any button was pressed
4435 ==================== =====================================
4438 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4440 def ButtonIsDown(*args
, **kwargs
):
4441 """ButtonIsDown(self, int but) -> bool"""
4442 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4444 def GetButton(*args
, **kwargs
):
4446 GetButton(self) -> int
4448 Returns the mouse button which generated this event or
4449 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4450 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4451 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4452 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4453 right buttons respectively.
4455 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4457 def ControlDown(*args
, **kwargs
):
4459 ControlDown(self) -> bool
4461 Returns true if the control key was down at the time of the event.
4463 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4465 def MetaDown(*args
, **kwargs
):
4467 MetaDown(self) -> bool
4469 Returns true if the Meta key was down at the time of the event.
4471 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4473 def AltDown(*args
, **kwargs
):
4475 AltDown(self) -> bool
4477 Returns true if the Alt key was down at the time of the event.
4479 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4481 def ShiftDown(*args
, **kwargs
):
4483 ShiftDown(self) -> bool
4485 Returns true if the Shift key was down at the time of the event.
4487 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4489 def CmdDown(*args
, **kwargs
):
4491 CmdDown(self) -> bool
4493 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4494 platforms but the special "Apple" (a.k.a as "Command") key on
4495 Macs. It often makes sense to use it instead of, say, `ControlDown`
4496 because Cmd key is used for the same thing under Mac as Ctrl
4497 elsewhere. The Ctrl key still exists, it's just not used for this
4498 purpose. So for non-Mac platforms this is the same as `ControlDown`
4499 and Macs this is the same as `MetaDown`.
4501 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4503 def LeftDown(*args
, **kwargs
):
4505 LeftDown(self) -> bool
4507 Returns true if the left mouse button state changed to down.
4509 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4511 def MiddleDown(*args
, **kwargs
):
4513 MiddleDown(self) -> bool
4515 Returns true if the middle mouse button state changed to down.
4517 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4519 def RightDown(*args
, **kwargs
):
4521 RightDown(self) -> bool
4523 Returns true if the right mouse button state changed to down.
4525 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4527 def LeftUp(*args
, **kwargs
):
4529 LeftUp(self) -> bool
4531 Returns true if the left mouse button state changed to up.
4533 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4535 def MiddleUp(*args
, **kwargs
):
4537 MiddleUp(self) -> bool
4539 Returns true if the middle mouse button state changed to up.
4541 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4543 def RightUp(*args
, **kwargs
):
4545 RightUp(self) -> bool
4547 Returns true if the right mouse button state changed to up.
4549 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4551 def LeftDClick(*args
, **kwargs
):
4553 LeftDClick(self) -> bool
4555 Returns true if the event was a left button double click.
4557 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4559 def MiddleDClick(*args
, **kwargs
):
4561 MiddleDClick(self) -> bool
4563 Returns true if the event was a middle button double click.
4565 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4567 def RightDClick(*args
, **kwargs
):
4569 RightDClick(self) -> bool
4571 Returns true if the event was a right button double click.
4573 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4575 def LeftIsDown(*args
, **kwargs
):
4577 LeftIsDown(self) -> bool
4579 Returns true if the left mouse button is currently down, independent
4580 of the current event type.
4582 Please notice that it is not the same as LeftDown which returns true
4583 if the left mouse button was just pressed. Rather, it describes the
4584 state of the mouse button before the event happened.
4586 This event is usually used in the mouse event handlers which process
4587 "move mouse" messages to determine whether the user is (still)
4590 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4592 def MiddleIsDown(*args
, **kwargs
):
4594 MiddleIsDown(self) -> bool
4596 Returns true if the middle mouse button is currently down, independent
4597 of the current event type.
4599 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4601 def RightIsDown(*args
, **kwargs
):
4603 RightIsDown(self) -> bool
4605 Returns true if the right mouse button is currently down, independent
4606 of the current event type.
4608 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4610 def Dragging(*args
, **kwargs
):
4612 Dragging(self) -> bool
4614 Returns true if this was a dragging event (motion while a button is
4617 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4619 def Moving(*args
, **kwargs
):
4621 Moving(self) -> bool
4623 Returns true if this was a motion event and no mouse buttons were
4624 pressed. If any mouse button is held pressed, then this method returns
4625 false and Dragging returns true.
4627 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4629 def Entering(*args
, **kwargs
):
4631 Entering(self) -> bool
4633 Returns true if the mouse was entering the window.
4635 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4637 def Leaving(*args
, **kwargs
):
4639 Leaving(self) -> bool
4641 Returns true if the mouse was leaving the window.
4643 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4645 def GetPosition(*args
, **kwargs
):
4647 GetPosition(self) -> Point
4649 Returns the pixel position of the mouse in window coordinates when the
4652 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4654 def GetPositionTuple(*args
, **kwargs
):
4656 GetPositionTuple() -> (x,y)
4658 Returns the pixel position of the mouse in window coordinates when the
4661 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
4663 def GetLogicalPosition(*args
, **kwargs
):
4665 GetLogicalPosition(self, DC dc) -> Point
4667 Returns the logical mouse position in pixels (i.e. translated
4668 according to the translation set for the DC, which usually indicates
4669 that the window has been scrolled).
4671 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
4673 def GetX(*args
, **kwargs
):
4677 Returns X coordinate of the physical mouse event position.
4679 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
4681 def GetY(*args
, **kwargs
):
4685 Returns Y coordinate of the physical mouse event position.
4687 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
4689 def GetWheelRotation(*args
, **kwargs
):
4691 GetWheelRotation(self) -> int
4693 Get wheel rotation, positive or negative indicates direction of
4694 rotation. Current devices all send an event when rotation is equal to
4695 +/-WheelDelta, but this allows for finer resolution devices to be
4696 created in the future. Because of this you shouldn't assume that one
4697 event is equal to 1 line or whatever, but you should be able to either
4698 do partial line scrolling or wait until +/-WheelDelta rotation values
4699 have been accumulated before scrolling.
4701 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
4703 def GetWheelDelta(*args
, **kwargs
):
4705 GetWheelDelta(self) -> int
4707 Get wheel delta, normally 120. This is the threshold for action to be
4708 taken, and one such action (for example, scrolling one increment)
4709 should occur for each delta.
4711 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
4713 def GetLinesPerAction(*args
, **kwargs
):
4715 GetLinesPerAction(self) -> int
4717 Returns the configured number of lines (or whatever) to be scrolled
4718 per wheel action. Defaults to three.
4720 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
4722 def IsPageScroll(*args
, **kwargs
):
4724 IsPageScroll(self) -> bool
4726 Returns true if the system has been setup to do page scrolling with
4727 the mouse wheel instead of line scrolling.
4729 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
4731 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
4732 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
4733 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
4734 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
4735 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
4736 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
4737 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
4738 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
4739 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
4740 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
4741 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
4742 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
4744 class MouseEventPtr(MouseEvent
):
4745 def __init__(self
, this
):
4747 if not hasattr(self
,"thisown"): self
.thisown
= 0
4748 self
.__class
__ = MouseEvent
4749 _core_
.MouseEvent_swigregister(MouseEventPtr
)
4751 #---------------------------------------------------------------------------
4753 class SetCursorEvent(Event
):
4755 A SetCursorEvent is generated when the mouse cursor is about to be set
4756 as a result of mouse motion. This event gives the application the
4757 chance to perform specific mouse cursor processing based on the
4758 current position of the mouse within the window. Use the `SetCursor`
4759 method to specify the cursor you want to be displayed.
4762 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4763 def __init__(self
, *args
, **kwargs
):
4765 __init__(self, int x=0, int y=0) -> SetCursorEvent
4767 Construct a new `wx.SetCursorEvent`.
4769 newobj
= _core_
.new_SetCursorEvent(*args
, **kwargs
)
4770 self
.this
= newobj
.this
4773 def GetX(*args
, **kwargs
):
4777 Returns the X coordinate of the mouse in client coordinates.
4779 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
4781 def GetY(*args
, **kwargs
):
4785 Returns the Y coordinate of the mouse in client coordinates.
4787 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
4789 def SetCursor(*args
, **kwargs
):
4791 SetCursor(self, Cursor cursor)
4793 Sets the cursor associated with this event.
4795 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
4797 def GetCursor(*args
, **kwargs
):
4799 GetCursor(self) -> Cursor
4801 Returns a reference to the cursor specified by this event.
4803 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
4805 def HasCursor(*args
, **kwargs
):
4807 HasCursor(self) -> bool
4809 Returns true if the cursor specified by this event is a valid cursor.
4811 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
4814 class SetCursorEventPtr(SetCursorEvent
):
4815 def __init__(self
, this
):
4817 if not hasattr(self
,"thisown"): self
.thisown
= 0
4818 self
.__class
__ = SetCursorEvent
4819 _core_
.SetCursorEvent_swigregister(SetCursorEventPtr
)
4821 #---------------------------------------------------------------------------
4823 class KeyEvent(Event
):
4825 This event class contains information about keypress and character
4826 events. These events are only sent to the widget that currently has
4829 Notice that there are three different kinds of keyboard events in
4830 wxWidgets: key down and up events and char events. The difference
4831 between the first two is clear - the first corresponds to a key press
4832 and the second to a key release - otherwise they are identical. Just
4833 note that if the key is maintained in a pressed state you will
4834 typically get a lot of (automatically generated) down events but only
4835 one up so it is wrong to assume that there is one up event
4836 corresponding to each down one.
4838 Both key events provide untranslated key codes while the char event
4839 carries the translated one. The untranslated code for alphanumeric
4840 keys is always an upper case value. For the other keys it is one of
4841 WXK_XXX values from the keycodes table. The translated key is, in
4842 general, the character the user expects to appear as the result of the
4843 key combination when typing the text into a text entry zone, for
4846 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4847 and the standard US keyboard): when the 'A' key is pressed, the key
4848 down event key code is equal to ASCII A == 65. But the char event key
4849 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4850 'A' keys simultaneously , the key code in key down event will still be
4851 just 'A' while the char event key code parameter will now be 'A' as
4854 Although in this simple case it is clear that the correct key code
4855 could be found in the key down event handler by checking the value
4856 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4857 as for non alphanumeric keys or non-US keyboard layouts the
4858 translation is keyboard-layout dependent and can only be done properly
4859 by the system itself.
4861 Another kind of translation is done when the control key is pressed:
4862 for example, for CTRL-A key press the key down event still carries the
4863 same key code 'A' as usual but the char event will have key code of 1,
4864 the ASCII value of this key combination.
4866 You may discover how the other keys on your system behave
4867 interactively by running the KeyEvents sample in the wxPython demo and
4868 pressing some keys while the blue box at the top has the keyboard
4871 **Note**: If a key down event is caught and the event handler does not
4872 call event.Skip() then the coresponding char event will not
4873 happen. This is by design and enables the programs that handle both
4874 types of events to be a bit simpler.
4876 **Note for Windows programmers**: The key and char events in wxWidgets
4877 are similar to but slightly different from Windows WM_KEYDOWN and
4878 WM_CHAR events. In particular, Alt-x combination will generate a char
4879 event in wxWidgets (unless it is used as an accelerator).
4881 **Tip**: be sure to call event.Skip() for events that you don't
4882 process in key event function, otherwise menu shortcuts may cease to
4887 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4888 def __init__(self
, *args
, **kwargs
):
4890 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
4892 Construct a new `wx.KeyEvent`. Valid event types are:
4895 newobj
= _core_
.new_KeyEvent(*args
, **kwargs
)
4896 self
.this
= newobj
.this
4899 def ControlDown(*args
, **kwargs
):
4901 ControlDown(self) -> bool
4903 Returns ``True`` if the Control key was down at the time of the event.
4905 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
4907 def MetaDown(*args
, **kwargs
):
4909 MetaDown(self) -> bool
4911 Returns ``True`` if the Meta key was down at the time of the event.
4913 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
4915 def AltDown(*args
, **kwargs
):
4917 AltDown(self) -> bool
4919 Returns ``True`` if the Alt key was down at the time of the event.
4921 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
4923 def ShiftDown(*args
, **kwargs
):
4925 ShiftDown(self) -> bool
4927 Returns ``True`` if the Shift key was down at the time of the event.
4929 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
4931 def CmdDown(*args
, **kwargs
):
4933 CmdDown(self) -> bool
4935 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4936 platforms but the special "Apple" (a.k.a as "Command") key on
4937 Macs. It makes often sense to use it instead of, say, `ControlDown`
4938 because Cmd key is used for the same thing under Mac as Ctrl
4939 elsewhere. The Ctrl still exists, it's just not used for this
4940 purpose. So for non-Mac platforms this is the same as `ControlDown`
4941 and Macs this is the same as `MetaDown`.
4943 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
4945 def HasModifiers(*args
, **kwargs
):
4947 HasModifiers(self) -> bool
4949 Returns true if either CTRL or ALT keys was down at the time of the
4950 key event. Note that this function does not take into account neither
4951 SHIFT nor META key states (the reason for ignoring the latter is that
4952 it is common for NUMLOCK key to be configured as META under X but the
4953 key presses even while NUMLOCK is on should be still processed
4956 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
4958 def GetKeyCode(*args
, **kwargs
):
4960 GetKeyCode(self) -> int
4962 Returns the virtual key code. ASCII events return normal ASCII values,
4963 while non-ASCII events return values such as WXK_LEFT for the left
4964 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4967 Note that in Unicode build, the returned value is meaningful only if
4968 the user entered a character that can be represented in current
4969 locale's default charset. You can obtain the corresponding Unicode
4970 character using `GetUnicodeKey`.
4972 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
4974 KeyCode
= GetKeyCode
4975 def GetUnicodeKey(*args
, **kwargs
):
4977 GetUnicodeKey(self) -> int
4979 Returns the Unicode character corresponding to this key event. This
4980 function is only meaningfule in a Unicode build of wxPython.
4982 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
4984 GetUniChar
= GetUnicodeKey
4985 def GetRawKeyCode(*args
, **kwargs
):
4987 GetRawKeyCode(self) -> unsigned int
4989 Returns the raw key code for this event. This is a platform-dependent
4990 scan code which should only be used in advanced
4991 applications. Currently the raw key codes are not supported by all
4994 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
4996 def GetRawKeyFlags(*args
, **kwargs
):
4998 GetRawKeyFlags(self) -> unsigned int
5000 Returns the low level key flags for this event. The flags are
5001 platform-dependent and should only be used in advanced applications.
5002 Currently the raw key flags are not supported by all ports.
5004 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
5006 def GetPosition(*args
, **kwargs
):
5008 GetPosition(self) -> Point
5010 Find the position of the event, if applicable.
5012 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
5014 def GetPositionTuple(*args
, **kwargs
):
5016 GetPositionTuple() -> (x,y)
5018 Find the position of the event, if applicable.
5020 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
5022 def GetX(*args
, **kwargs
):
5026 Returns the X position (in client coordinates) of the event, if
5029 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
5031 def GetY(*args
, **kwargs
):
5035 Returns the Y position (in client coordinates) of the event, if
5038 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
5040 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
5041 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
5042 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
5043 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
5044 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
5045 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
5046 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
5047 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
5048 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
5049 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
5051 class KeyEventPtr(KeyEvent
):
5052 def __init__(self
, this
):
5054 if not hasattr(self
,"thisown"): self
.thisown
= 0
5055 self
.__class
__ = KeyEvent
5056 _core_
.KeyEvent_swigregister(KeyEventPtr
)
5058 #---------------------------------------------------------------------------
5060 class SizeEvent(Event
):
5062 A size event holds information about size change events. The EVT_SIZE
5063 handler function will be called when the window it is bound to has
5066 Note that the size passed is of the whole window: call
5067 `wx.Window.GetClientSize` for the area which may be used by the
5070 When a window is resized, usually only a small part of the window is
5071 damaged and and that area is all that is in the update region for the
5072 next paint event. However, if your drawing depends on the size of the
5073 window, you may need to clear the DC explicitly and repaint the whole
5074 window. In which case, you may need to call `wx.Window.Refresh` to
5075 invalidate the entire window.
5079 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5080 def __init__(self
, *args
, **kwargs
):
5082 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5084 Construct a new ``wx.SizeEvent``.
5086 newobj
= _core_
.new_SizeEvent(*args
, **kwargs
)
5087 self
.this
= newobj
.this
5090 def GetSize(*args
, **kwargs
):
5092 GetSize(self) -> Size
5094 Returns the entire size of the window generating the size change
5097 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
5099 def GetRect(*args
, **kwargs
):
5100 """GetRect(self) -> Rect"""
5101 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
5103 def SetRect(*args
, **kwargs
):
5104 """SetRect(self, Rect rect)"""
5105 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
5107 def SetSize(*args
, **kwargs
):
5108 """SetSize(self, Size size)"""
5109 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
5111 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
5112 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
5114 class SizeEventPtr(SizeEvent
):
5115 def __init__(self
, this
):
5117 if not hasattr(self
,"thisown"): self
.thisown
= 0
5118 self
.__class
__ = SizeEvent
5119 _core_
.SizeEvent_swigregister(SizeEventPtr
)
5121 #---------------------------------------------------------------------------
5123 class MoveEvent(Event
):
5125 This event object is sent for EVT_MOVE event bindings when a window is
5126 moved to a new position.
5129 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5130 def __init__(self
, *args
, **kwargs
):
5132 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5136 newobj
= _core_
.new_MoveEvent(*args
, **kwargs
)
5137 self
.this
= newobj
.this
5140 def GetPosition(*args
, **kwargs
):
5142 GetPosition(self) -> Point
5144 Returns the position of the window generating the move change event.
5146 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
5148 def GetRect(*args
, **kwargs
):
5149 """GetRect(self) -> Rect"""
5150 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
5152 def SetRect(*args
, **kwargs
):
5153 """SetRect(self, Rect rect)"""
5154 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
5156 def SetPosition(*args
, **kwargs
):
5157 """SetPosition(self, Point pos)"""
5158 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
5160 m_pos
= property(GetPosition
, SetPosition
)
5161 m_rect
= property(GetRect
, SetRect
)
5164 class MoveEventPtr(MoveEvent
):
5165 def __init__(self
, this
):
5167 if not hasattr(self
,"thisown"): self
.thisown
= 0
5168 self
.__class
__ = MoveEvent
5169 _core_
.MoveEvent_swigregister(MoveEventPtr
)
5171 #---------------------------------------------------------------------------
5173 class PaintEvent(Event
):
5175 A paint event is sent when a window's contents needs to be repainted.
5176 Note that in an EVT_PAINT handler the application must *always* create
5177 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5178 Windows assumes that the window has not been painted yet and will send
5179 the event again, causing endless refreshes.
5181 You can optimize painting by retrieving the rectangles that have been
5182 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5183 and only repainting these rectangles. The rectangles are in terms of
5184 the client area, and are unscrolled, so you will need to do some
5185 calculations using the current view position to obtain logical,
5190 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5191 def __init__(self
, *args
, **kwargs
):
5192 """__init__(self, int Id=0) -> PaintEvent"""
5193 newobj
= _core_
.new_PaintEvent(*args
, **kwargs
)
5194 self
.this
= newobj
.this
5198 class PaintEventPtr(PaintEvent
):
5199 def __init__(self
, this
):
5201 if not hasattr(self
,"thisown"): self
.thisown
= 0
5202 self
.__class
__ = PaintEvent
5203 _core_
.PaintEvent_swigregister(PaintEventPtr
)
5205 class NcPaintEvent(Event
):
5206 """Proxy of C++ NcPaintEvent class"""
5208 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5209 def __init__(self
, *args
, **kwargs
):
5210 """__init__(self, int winid=0) -> NcPaintEvent"""
5211 newobj
= _core_
.new_NcPaintEvent(*args
, **kwargs
)
5212 self
.this
= newobj
.this
5216 class NcPaintEventPtr(NcPaintEvent
):
5217 def __init__(self
, this
):
5219 if not hasattr(self
,"thisown"): self
.thisown
= 0
5220 self
.__class
__ = NcPaintEvent
5221 _core_
.NcPaintEvent_swigregister(NcPaintEventPtr
)
5223 #---------------------------------------------------------------------------
5225 class EraseEvent(Event
):
5227 An erase event is sent whenever the background of a window needs to be
5228 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5229 binder. On some platforms, such as GTK+, this event is simulated
5230 (simply generated just before the paint event) and may cause flicker.
5232 To paint a custom background use the `GetDC` method and use the returned
5233 device context if it is not ``None``, otherwise create a temporary
5234 `wx.ClientDC` and draw on that.
5238 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5239 def __init__(self
, *args
, **kwargs
):
5241 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5245 newobj
= _core_
.new_EraseEvent(*args
, **kwargs
)
5246 self
.this
= newobj
.this
5249 def GetDC(*args
, **kwargs
):
5253 Returns the device context the event handler should draw upon. If
5254 ``None`` is returned then create a temporary `wx.ClientDC` and use
5257 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
5260 class EraseEventPtr(EraseEvent
):
5261 def __init__(self
, this
):
5263 if not hasattr(self
,"thisown"): self
.thisown
= 0
5264 self
.__class
__ = EraseEvent
5265 _core_
.EraseEvent_swigregister(EraseEventPtr
)
5267 #---------------------------------------------------------------------------
5269 class FocusEvent(Event
):
5271 A focus event is sent when a window's focus changes. The window losing
5272 focus receives an EVT_KILL_FOCUS event while the window gaining it
5273 gets an EVT_SET_FOCUS event.
5275 Notice that the set focus event happens both when the user gives focus
5276 to the window (whether using the mouse or keyboard) and when it is
5277 done from the program itself using `wx.Window.SetFocus`.
5281 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5282 def __init__(self
, *args
, **kwargs
):
5284 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5288 newobj
= _core_
.new_FocusEvent(*args
, **kwargs
)
5289 self
.this
= newobj
.this
5292 def GetWindow(*args
, **kwargs
):
5294 GetWindow(self) -> Window
5296 Returns the other window associated with this event, that is the
5297 window which had the focus before for the EVT_SET_FOCUS event and the
5298 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5300 Warning: the window returned may be None!
5302 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5304 def SetWindow(*args
, **kwargs
):
5305 """SetWindow(self, Window win)"""
5306 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5309 class FocusEventPtr(FocusEvent
):
5310 def __init__(self
, this
):
5312 if not hasattr(self
,"thisown"): self
.thisown
= 0
5313 self
.__class
__ = FocusEvent
5314 _core_
.FocusEvent_swigregister(FocusEventPtr
)
5316 #---------------------------------------------------------------------------
5318 class ChildFocusEvent(CommandEvent
):
5320 wx.ChildFocusEvent notifies the parent that a child has received the
5321 focus. Unlike `wx.FocusEvent` it is propagated up the window
5325 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5326 def __init__(self
, *args
, **kwargs
):
5328 __init__(self, Window win=None) -> ChildFocusEvent
5332 newobj
= _core_
.new_ChildFocusEvent(*args
, **kwargs
)
5333 self
.this
= newobj
.this
5336 def GetWindow(*args
, **kwargs
):
5338 GetWindow(self) -> Window
5340 The window which has just received the focus.
5342 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5345 class ChildFocusEventPtr(ChildFocusEvent
):
5346 def __init__(self
, this
):
5348 if not hasattr(self
,"thisown"): self
.thisown
= 0
5349 self
.__class
__ = ChildFocusEvent
5350 _core_
.ChildFocusEvent_swigregister(ChildFocusEventPtr
)
5352 #---------------------------------------------------------------------------
5354 class ActivateEvent(Event
):
5356 An activate event is sent when a top-level window or the entire
5357 application is being activated or deactivated.
5359 A top-level window (a dialog or frame) receives an activate event when
5360 is being activated or deactivated. This is indicated visually by the
5361 title bar changing colour, and a subwindow gaining the keyboard focus.
5362 An application is activated or deactivated when one of its frames
5363 becomes activated, or a frame becomes inactivate resulting in all
5364 application frames being inactive.
5366 Please note that usually you should call event.Skip() in your handlers
5367 for these events so the default handlers will still be called, as not
5368 doing so can result in strange effects.
5372 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5373 def __init__(self
, *args
, **kwargs
):
5375 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5379 newobj
= _core_
.new_ActivateEvent(*args
, **kwargs
)
5380 self
.this
= newobj
.this
5383 def GetActive(*args
, **kwargs
):
5385 GetActive(self) -> bool
5387 Returns true if the application or window is being activated, false
5390 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5393 class ActivateEventPtr(ActivateEvent
):
5394 def __init__(self
, this
):
5396 if not hasattr(self
,"thisown"): self
.thisown
= 0
5397 self
.__class
__ = ActivateEvent
5398 _core_
.ActivateEvent_swigregister(ActivateEventPtr
)
5400 #---------------------------------------------------------------------------
5402 class InitDialogEvent(Event
):
5404 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5405 any window when `wx.Window.InitDialog` is called. Handlers for this
5406 event can transfer data to the window, or anything else that should be
5407 done before the user begins editing the form. The default handler
5408 calls `wx.Window.TransferDataToWindow`.
5411 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5412 def __init__(self
, *args
, **kwargs
):
5414 __init__(self, int Id=0) -> InitDialogEvent
5418 newobj
= _core_
.new_InitDialogEvent(*args
, **kwargs
)
5419 self
.this
= newobj
.this
5423 class InitDialogEventPtr(InitDialogEvent
):
5424 def __init__(self
, this
):
5426 if not hasattr(self
,"thisown"): self
.thisown
= 0
5427 self
.__class
__ = InitDialogEvent
5428 _core_
.InitDialogEvent_swigregister(InitDialogEventPtr
)
5430 #---------------------------------------------------------------------------
5432 class MenuEvent(Event
):
5434 This class is used for a variety of menu-related events. Note that
5435 these do not include menu command events, which are handled by sending
5436 `wx.CommandEvent` objects.
5438 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5439 text in the first field of the status bar.
5442 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5443 def __init__(self
, *args
, **kwargs
):
5445 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5449 newobj
= _core_
.new_MenuEvent(*args
, **kwargs
)
5450 self
.this
= newobj
.this
5453 def GetMenuId(*args
, **kwargs
):
5455 GetMenuId(self) -> int
5457 Returns the menu identifier associated with the event. This method
5458 should be only used with the HIGHLIGHT events.
5460 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5462 def IsPopup(*args
, **kwargs
):
5464 IsPopup(self) -> bool
5466 Returns ``True`` if the menu which is being opened or closed is a
5467 popup menu, ``False`` if it is a normal one. This method should only
5468 be used with the OPEN and CLOSE events.
5470 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5472 def GetMenu(*args
, **kwargs
):
5474 GetMenu(self) -> Menu
5476 Returns the menu which is being opened or closed. This method should
5477 only be used with the OPEN and CLOSE events.
5479 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5482 class MenuEventPtr(MenuEvent
):
5483 def __init__(self
, this
):
5485 if not hasattr(self
,"thisown"): self
.thisown
= 0
5486 self
.__class
__ = MenuEvent
5487 _core_
.MenuEvent_swigregister(MenuEventPtr
)
5489 #---------------------------------------------------------------------------
5491 class CloseEvent(Event
):
5493 This event class contains information about window and session close
5496 The handler function for EVT_CLOSE is called when the user has tried
5497 to close a a frame or dialog box using the window manager controls or
5498 the system menu. It can also be invoked by the application itself
5499 programmatically, for example by calling the `wx.Window.Close`
5502 You should check whether the application is forcing the deletion of
5503 the window using `CanVeto`. If it returns ``False``, you must destroy
5504 the window using `wx.Window.Destroy`. If the return value is ``True``,
5505 it is up to you whether you respond by destroying the window or not.
5506 For example you may wish to display a message dialog prompting to save
5507 files or to cancel the close.
5509 If you don't destroy the window, you should call `Veto` to let the
5510 calling code know that you did not destroy the window. This allows the
5511 `wx.Window.Close` function to return ``True`` or ``False`` depending
5512 on whether the close instruction was honored or not.
5515 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5516 def __init__(self
, *args
, **kwargs
):
5518 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5522 newobj
= _core_
.new_CloseEvent(*args
, **kwargs
)
5523 self
.this
= newobj
.this
5526 def SetLoggingOff(*args
, **kwargs
):
5528 SetLoggingOff(self, bool logOff)
5530 Sets the 'logging off' flag.
5532 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5534 def GetLoggingOff(*args
, **kwargs
):
5536 GetLoggingOff(self) -> bool
5538 Returns ``True`` if the user is logging off or ``False`` if the
5539 system is shutting down. This method can only be called for end
5540 session and query end session events, it doesn't make sense for close
5543 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5545 def Veto(*args
, **kwargs
):
5547 Veto(self, bool veto=True)
5549 Call this from your event handler to veto a system shutdown or to
5550 signal to the calling application that a window close did not happen.
5552 You can only veto a shutdown or close if `CanVeto` returns true.
5554 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5556 def GetVeto(*args
, **kwargs
):
5557 """GetVeto(self) -> bool"""
5558 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5560 def SetCanVeto(*args
, **kwargs
):
5562 SetCanVeto(self, bool canVeto)
5564 Sets the 'can veto' flag.
5566 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5568 def CanVeto(*args
, **kwargs
):
5570 CanVeto(self) -> bool
5572 Returns true if you can veto a system shutdown or a window close
5573 event. Vetoing a window close event is not possible if the calling
5574 code wishes to force the application to exit, and so this function
5575 must be called to check this.
5577 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5580 class CloseEventPtr(CloseEvent
):
5581 def __init__(self
, this
):
5583 if not hasattr(self
,"thisown"): self
.thisown
= 0
5584 self
.__class
__ = CloseEvent
5585 _core_
.CloseEvent_swigregister(CloseEventPtr
)
5587 #---------------------------------------------------------------------------
5589 class ShowEvent(Event
):
5590 """An EVT_SHOW event is sent when a window is shown or hidden."""
5592 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5593 def __init__(self
, *args
, **kwargs
):
5595 __init__(self, int winid=0, bool show=False) -> ShowEvent
5597 An EVT_SHOW event is sent when a window is shown or hidden.
5599 newobj
= _core_
.new_ShowEvent(*args
, **kwargs
)
5600 self
.this
= newobj
.this
5603 def SetShow(*args
, **kwargs
):
5604 """SetShow(self, bool show)"""
5605 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5607 def GetShow(*args
, **kwargs
):
5608 """GetShow(self) -> bool"""
5609 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5612 class ShowEventPtr(ShowEvent
):
5613 def __init__(self
, this
):
5615 if not hasattr(self
,"thisown"): self
.thisown
= 0
5616 self
.__class
__ = ShowEvent
5617 _core_
.ShowEvent_swigregister(ShowEventPtr
)
5619 #---------------------------------------------------------------------------
5621 class IconizeEvent(Event
):
5623 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5627 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5628 def __init__(self
, *args
, **kwargs
):
5630 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5632 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5635 newobj
= _core_
.new_IconizeEvent(*args
, **kwargs
)
5636 self
.this
= newobj
.this
5639 def Iconized(*args
, **kwargs
):
5641 Iconized(self) -> bool
5643 Returns ``True`` if the frame has been iconized, ``False`` if it has
5646 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5649 class IconizeEventPtr(IconizeEvent
):
5650 def __init__(self
, this
):
5652 if not hasattr(self
,"thisown"): self
.thisown
= 0
5653 self
.__class
__ = IconizeEvent
5654 _core_
.IconizeEvent_swigregister(IconizeEventPtr
)
5656 #---------------------------------------------------------------------------
5658 class MaximizeEvent(Event
):
5659 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
5661 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5662 def __init__(self
, *args
, **kwargs
):
5664 __init__(self, int id=0) -> MaximizeEvent
5666 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5668 newobj
= _core_
.new_MaximizeEvent(*args
, **kwargs
)
5669 self
.this
= newobj
.this
5673 class MaximizeEventPtr(MaximizeEvent
):
5674 def __init__(self
, this
):
5676 if not hasattr(self
,"thisown"): self
.thisown
= 0
5677 self
.__class
__ = MaximizeEvent
5678 _core_
.MaximizeEvent_swigregister(MaximizeEventPtr
)
5680 #---------------------------------------------------------------------------
5682 class DropFilesEvent(Event
):
5684 This class is used for drop files events, that is, when files have
5685 been dropped onto the window. This functionality is only available
5686 under Windows. The window must have previously been enabled for
5687 dropping by calling `wx.Window.DragAcceptFiles`.
5689 Important note: this is a separate implementation to the more general
5690 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5691 implementation uses the older, Windows message-based approach of
5694 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5698 def __init__(self
): raise RuntimeError, "No constructor defined"
5700 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5701 def GetPosition(*args
, **kwargs
):
5703 GetPosition(self) -> Point
5705 Returns the position at which the files were dropped.
5707 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5709 def GetNumberOfFiles(*args
, **kwargs
):
5711 GetNumberOfFiles(self) -> int
5713 Returns the number of files dropped.
5715 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5717 def GetFiles(*args
, **kwargs
):
5719 GetFiles(self) -> PyObject
5721 Returns a list of the filenames that were dropped.
5723 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5726 class DropFilesEventPtr(DropFilesEvent
):
5727 def __init__(self
, this
):
5729 if not hasattr(self
,"thisown"): self
.thisown
= 0
5730 self
.__class
__ = DropFilesEvent
5731 _core_
.DropFilesEvent_swigregister(DropFilesEventPtr
)
5733 #---------------------------------------------------------------------------
5735 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5736 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5737 class UpdateUIEvent(CommandEvent
):
5739 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5740 wxWidgets to give an application the chance to update various user
5743 Without update UI events, an application has to work hard to
5744 check/uncheck, enable/disable, and set the text for elements such as
5745 menu items and toolbar buttons. The code for doing this has to be
5746 mixed up with the code that is invoked when an action is invoked for a
5747 menu item or button.
5749 With update UI events, you define an event handler to look at the
5750 state of the application and change UI elements accordingly. wxWidgets
5751 will call your handler functions in idle time, so you don't have to
5752 worry where to call this code. In addition to being a clearer and more
5753 declarative method, it also means you don't have to worry whether
5754 you're updating a toolbar or menubar identifier. The same handler can
5755 update a menu item and toolbar button, if the ID values are the same.
5757 Instead of directly manipulating the menu or button, you call
5758 functions in the event object, such as `Check`. wxWidgets will
5759 determine whether such a call has been made, and which UI element to
5762 These events will work for popup menus as well as menubars. Just
5763 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5764 any UI events for the window that owns the menu.
5766 If you find that the overhead of UI update processing is affecting
5767 your application, you can do one or both of the following:
5769 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5770 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5771 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5772 receive update events. No other windows will receive update
5775 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5776 value to set the delay between updates. You may need to call
5777 `wx.Window.UpdateWindowUI` at critical points, for example when
5778 a dialog is about to be shown, in case the user sees a slight
5779 delay before windows are updated.
5781 Note that although events are sent in idle time, defining a EVT_IDLE
5782 handler for a window does not affect this because the events are sent
5783 from an internal idle handler.
5785 wxWidgets tries to optimize update events on some platforms. On
5786 Windows and GTK+, events for menubar items are only sent when the menu
5787 is about to be shown, and not in idle time.
5791 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5792 def __init__(self
, *args
, **kwargs
):
5794 __init__(self, int commandId=0) -> UpdateUIEvent
5798 newobj
= _core_
.new_UpdateUIEvent(*args
, **kwargs
)
5799 self
.this
= newobj
.this
5802 def GetChecked(*args
, **kwargs
):
5804 GetChecked(self) -> bool
5806 Returns ``True`` if the UI element should be checked.
5808 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
5810 def GetEnabled(*args
, **kwargs
):
5812 GetEnabled(self) -> bool
5814 Returns ``True`` if the UI element should be enabled.
5816 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
5818 def GetText(*args
, **kwargs
):
5820 GetText(self) -> String
5822 Returns the text that should be set for the UI element.
5824 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
5826 def GetSetText(*args
, **kwargs
):
5828 GetSetText(self) -> bool
5830 Returns ``True`` if the application has called `SetText`. For
5831 wxWidgets internal use only.
5833 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
5835 def GetSetChecked(*args
, **kwargs
):
5837 GetSetChecked(self) -> bool
5839 Returns ``True`` if the application has called `Check`. For wxWidgets
5842 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
5844 def GetSetEnabled(*args
, **kwargs
):
5846 GetSetEnabled(self) -> bool
5848 Returns ``True`` if the application has called `Enable`. For wxWidgets
5851 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
5853 def Check(*args
, **kwargs
):
5855 Check(self, bool check)
5857 Check or uncheck the UI element.
5859 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
5861 def Enable(*args
, **kwargs
):
5863 Enable(self, bool enable)
5865 Enable or disable the UI element.
5867 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
5869 def SetText(*args
, **kwargs
):
5871 SetText(self, String text)
5873 Sets the text for this UI element.
5875 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
5877 def SetUpdateInterval(*args
, **kwargs
):
5879 SetUpdateInterval(long updateInterval)
5881 Sets the interval between updates in milliseconds. Set to -1 to
5882 disable updates, or to 0 to update as frequently as possible. The
5885 Use this to reduce the overhead of UI update events if your
5886 application has a lot of windows. If you set the value to -1 or
5887 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5888 at appropriate points in your application, such as when a dialog is
5891 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5893 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
5894 def GetUpdateInterval(*args
, **kwargs
):
5896 GetUpdateInterval() -> long
5898 Returns the current interval between updates in milliseconds. -1
5899 disables updates, 0 updates as frequently as possible.
5901 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5903 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
5904 def CanUpdate(*args
, **kwargs
):
5906 CanUpdate(Window win) -> bool
5908 Returns ``True`` if it is appropriate to update (send UI update events
5911 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5912 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5913 events were last sent in idle time, and the update interval, to
5914 determine whether events should be sent to this window now. By default
5915 this will always return true because the update mode is initially
5916 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5917 events will be sent as often as possible. You can reduce the frequency
5918 that events are sent by changing the mode and/or setting an update
5922 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5924 CanUpdate
= staticmethod(CanUpdate
)
5925 def ResetUpdateTime(*args
, **kwargs
):
5929 Used internally to reset the last-updated time to the current time. It
5930 is assumed that update events are normally sent in idle time, so this
5931 is called at the end of idle processing.
5933 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5935 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
5936 def SetMode(*args
, **kwargs
):
5940 Specify how wxWidgets will send update events: to all windows, or only
5941 to those which specify that they will process the events.
5943 The mode may be one of the following values:
5945 ============================= ==========================================
5946 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5947 is the default setting.
5948 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5949 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5951 ============================= ==========================================
5954 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5956 SetMode
= staticmethod(SetMode
)
5957 def GetMode(*args
, **kwargs
):
5961 Returns a value specifying how wxWidgets will send update events: to
5962 all windows, or only to those which specify that they will process the
5965 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5967 GetMode
= staticmethod(GetMode
)
5969 class UpdateUIEventPtr(UpdateUIEvent
):
5970 def __init__(self
, this
):
5972 if not hasattr(self
,"thisown"): self
.thisown
= 0
5973 self
.__class
__ = UpdateUIEvent
5974 _core_
.UpdateUIEvent_swigregister(UpdateUIEventPtr
)
5976 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
5978 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5980 Sets the interval between updates in milliseconds. Set to -1 to
5981 disable updates, or to 0 to update as frequently as possible. The
5984 Use this to reduce the overhead of UI update events if your
5985 application has a lot of windows. If you set the value to -1 or
5986 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5987 at appropriate points in your application, such as when a dialog is
5990 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5992 def UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
):
5994 UpdateUIEvent_GetUpdateInterval() -> long
5996 Returns the current interval between updates in milliseconds. -1
5997 disables updates, 0 updates as frequently as possible.
5999 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
6001 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
6003 UpdateUIEvent_CanUpdate(Window win) -> bool
6005 Returns ``True`` if it is appropriate to update (send UI update events
6008 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6009 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6010 events were last sent in idle time, and the update interval, to
6011 determine whether events should be sent to this window now. By default
6012 this will always return true because the update mode is initially
6013 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6014 events will be sent as often as possible. You can reduce the frequency
6015 that events are sent by changing the mode and/or setting an update
6019 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
6021 def UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
):
6023 UpdateUIEvent_ResetUpdateTime()
6025 Used internally to reset the last-updated time to the current time. It
6026 is assumed that update events are normally sent in idle time, so this
6027 is called at the end of idle processing.
6029 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
6031 def UpdateUIEvent_SetMode(*args
, **kwargs
):
6033 UpdateUIEvent_SetMode(int mode)
6035 Specify how wxWidgets will send update events: to all windows, or only
6036 to those which specify that they will process the events.
6038 The mode may be one of the following values:
6040 ============================= ==========================================
6041 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6042 is the default setting.
6043 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6044 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6046 ============================= ==========================================
6049 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
6051 def UpdateUIEvent_GetMode(*args
, **kwargs
):
6053 UpdateUIEvent_GetMode() -> int
6055 Returns a value specifying how wxWidgets will send update events: to
6056 all windows, or only to those which specify that they will process the
6059 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
6061 #---------------------------------------------------------------------------
6063 class SysColourChangedEvent(Event
):
6065 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6066 when the user changes the colour settings using the control
6067 panel. This is only applicable under Windows.
6069 The default event handler for this event propagates the event to child
6070 windows, since Windows only sends the events to top-level windows. If
6071 intercepting this event for a top-level window, remember to call
6072 `Skip` so the the base class handler will still be executed, or to
6073 pass the event on to the window's children explicitly.
6077 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6078 def __init__(self
, *args
, **kwargs
):
6080 __init__(self) -> SysColourChangedEvent
6084 newobj
= _core_
.new_SysColourChangedEvent(*args
, **kwargs
)
6085 self
.this
= newobj
.this
6089 class SysColourChangedEventPtr(SysColourChangedEvent
):
6090 def __init__(self
, this
):
6092 if not hasattr(self
,"thisown"): self
.thisown
= 0
6093 self
.__class
__ = SysColourChangedEvent
6094 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEventPtr
)
6096 #---------------------------------------------------------------------------
6098 class MouseCaptureChangedEvent(Event
):
6100 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6101 a window that loses its mouse capture. This is called even if
6102 `wx.Window.ReleaseMouse` was called by the application code. Handling
6103 this event allows an application to cater for unexpected capture
6104 releases which might otherwise confuse mouse handling code.
6106 This event is implemented under Windows only.
6109 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6110 def __init__(self
, *args
, **kwargs
):
6112 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6116 newobj
= _core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
)
6117 self
.this
= newobj
.this
6120 def GetCapturedWindow(*args
, **kwargs
):
6122 GetCapturedWindow(self) -> Window
6124 Returns the window that gained the capture, or ``None`` if it was a
6125 non-wxWidgets window.
6127 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
6130 class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent
):
6131 def __init__(self
, this
):
6133 if not hasattr(self
,"thisown"): self
.thisown
= 0
6134 self
.__class
__ = MouseCaptureChangedEvent
6135 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr
)
6137 #---------------------------------------------------------------------------
6139 class DisplayChangedEvent(Event
):
6141 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6142 resolution has changed.
6144 This event is implemented under Windows only.
6147 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6148 def __init__(self
, *args
, **kwargs
):
6149 """__init__(self) -> DisplayChangedEvent"""
6150 newobj
= _core_
.new_DisplayChangedEvent(*args
, **kwargs
)
6151 self
.this
= newobj
.this
6155 class DisplayChangedEventPtr(DisplayChangedEvent
):
6156 def __init__(self
, this
):
6158 if not hasattr(self
,"thisown"): self
.thisown
= 0
6159 self
.__class
__ = DisplayChangedEvent
6160 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEventPtr
)
6162 #---------------------------------------------------------------------------
6164 class PaletteChangedEvent(Event
):
6166 An EVT_PALETTE_CHANGED event is sent when the system palette has
6167 changed, thereby giving each window a chance to redo their own to
6170 This event is implemented under Windows only.
6173 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6174 def __init__(self
, *args
, **kwargs
):
6176 __init__(self, int id=0) -> PaletteChangedEvent
6178 An EVT_PALETTE_CHANGED event is sent when the system palette has
6179 changed, thereby giving each window a chance to redo their own to
6182 This event is implemented under Windows only.
6184 newobj
= _core_
.new_PaletteChangedEvent(*args
, **kwargs
)
6185 self
.this
= newobj
.this
6188 def SetChangedWindow(*args
, **kwargs
):
6189 """SetChangedWindow(self, Window win)"""
6190 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
6192 def GetChangedWindow(*args
, **kwargs
):
6193 """GetChangedWindow(self) -> Window"""
6194 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
6197 class PaletteChangedEventPtr(PaletteChangedEvent
):
6198 def __init__(self
, this
):
6200 if not hasattr(self
,"thisown"): self
.thisown
= 0
6201 self
.__class
__ = PaletteChangedEvent
6202 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEventPtr
)
6204 #---------------------------------------------------------------------------
6206 class QueryNewPaletteEvent(Event
):
6208 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6209 focus and should re-do its palette.
6211 This event is implemented under Windows only.
6214 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6215 def __init__(self
, *args
, **kwargs
):
6217 __init__(self, int winid=0) -> QueryNewPaletteEvent
6221 newobj
= _core_
.new_QueryNewPaletteEvent(*args
, **kwargs
)
6222 self
.this
= newobj
.this
6225 def SetPaletteRealized(*args
, **kwargs
):
6227 SetPaletteRealized(self, bool realized)
6229 App should set this if it changes the palette.
6231 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
6233 def GetPaletteRealized(*args
, **kwargs
):
6234 """GetPaletteRealized(self) -> bool"""
6235 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
6238 class QueryNewPaletteEventPtr(QueryNewPaletteEvent
):
6239 def __init__(self
, this
):
6241 if not hasattr(self
,"thisown"): self
.thisown
= 0
6242 self
.__class
__ = QueryNewPaletteEvent
6243 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr
)
6245 #---------------------------------------------------------------------------
6247 class NavigationKeyEvent(Event
):
6249 EVT_NAVIGATION_KEY events are used to control moving the focus between
6250 widgets, otherwise known as tab-traversal. You woudl normally not
6251 catch navigation events in applications as there are already
6252 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6253 it useful to send navigation events in certain situations to change
6254 the focus in certain ways, although it's probably easier to just call
6255 `wx.Window.Navigate`.
6258 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6259 def __init__(self
, *args
, **kwargs
):
6260 """__init__(self) -> NavigationKeyEvent"""
6261 newobj
= _core_
.new_NavigationKeyEvent(*args
, **kwargs
)
6262 self
.this
= newobj
.this
6265 def GetDirection(*args
, **kwargs
):
6267 GetDirection(self) -> bool
6269 Returns ``True`` if the direction is forward, ``False`` otherwise.
6271 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
6273 def SetDirection(*args
, **kwargs
):
6275 SetDirection(self, bool forward)
6277 Specify the direction that the navigation should take. Usually the
6278 difference between using Tab and Shift-Tab.
6280 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
6282 def IsWindowChange(*args
, **kwargs
):
6284 IsWindowChange(self) -> bool
6286 Returns ``True`` if window change is allowed.
6288 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
6290 def SetWindowChange(*args
, **kwargs
):
6292 SetWindowChange(self, bool ischange)
6294 Specify if the navigation should be able to change parent windows.
6295 For example, changing notebook pages, etc. This is usually implemented
6296 by using Control-Tab.
6298 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
6300 def IsFromTab(*args
, **kwargs
):
6302 IsFromTab(self) -> bool
6304 Returns ``True`` if the navigation event is originated from the Tab
6307 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
6309 def SetFromTab(*args
, **kwargs
):
6311 SetFromTab(self, bool bIs)
6313 Set to true under MSW if the event was generated using the tab key.
6314 This is required for proper navogation over radio buttons.
6316 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
6318 def SetFlags(*args
, **kwargs
):
6320 SetFlags(self, long flags)
6322 Set the navigation flags to a combination of the following:
6324 * wx.NavigationKeyEvent.IsBackward
6325 * wx.NavigationKeyEvent.IsForward
6326 * wx.NavigationKeyEvent.WinChange
6327 * wx.NavigationKeyEvent.FromTab
6330 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
6332 def GetCurrentFocus(*args
, **kwargs
):
6334 GetCurrentFocus(self) -> Window
6336 Returns the child window which currenty has the focus. May be
6339 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
6341 def SetCurrentFocus(*args
, **kwargs
):
6343 SetCurrentFocus(self, Window win)
6345 Set the window that has the focus.
6347 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
6349 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
6350 IsForward
= _core_
.NavigationKeyEvent_IsForward
6351 WinChange
= _core_
.NavigationKeyEvent_WinChange
6352 FromTab
= _core_
.NavigationKeyEvent_FromTab
6354 class NavigationKeyEventPtr(NavigationKeyEvent
):
6355 def __init__(self
, this
):
6357 if not hasattr(self
,"thisown"): self
.thisown
= 0
6358 self
.__class
__ = NavigationKeyEvent
6359 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEventPtr
)
6361 #---------------------------------------------------------------------------
6363 class WindowCreateEvent(CommandEvent
):
6365 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6366 underlying GUI object) exists.
6369 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6370 def __init__(self
, *args
, **kwargs
):
6372 __init__(self, Window win=None) -> WindowCreateEvent
6374 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6375 underlying GUI object) exists.
6377 newobj
= _core_
.new_WindowCreateEvent(*args
, **kwargs
)
6378 self
.this
= newobj
.this
6381 def GetWindow(*args
, **kwargs
):
6383 GetWindow(self) -> Window
6385 Returns the window that this event refers to.
6387 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
6390 class WindowCreateEventPtr(WindowCreateEvent
):
6391 def __init__(self
, this
):
6393 if not hasattr(self
,"thisown"): self
.thisown
= 0
6394 self
.__class
__ = WindowCreateEvent
6395 _core_
.WindowCreateEvent_swigregister(WindowCreateEventPtr
)
6397 class WindowDestroyEvent(CommandEvent
):
6399 The EVT_WINDOW_DESTROY event is sent right before the window is
6403 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6404 def __init__(self
, *args
, **kwargs
):
6406 __init__(self, Window win=None) -> WindowDestroyEvent
6408 The EVT_WINDOW_DESTROY event is sent right before the window is
6411 newobj
= _core_
.new_WindowDestroyEvent(*args
, **kwargs
)
6412 self
.this
= newobj
.this
6415 def GetWindow(*args
, **kwargs
):
6417 GetWindow(self) -> Window
6419 Returns the window that this event refers to.
6421 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
6424 class WindowDestroyEventPtr(WindowDestroyEvent
):
6425 def __init__(self
, this
):
6427 if not hasattr(self
,"thisown"): self
.thisown
= 0
6428 self
.__class
__ = WindowDestroyEvent
6429 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEventPtr
)
6431 #---------------------------------------------------------------------------
6433 class ContextMenuEvent(CommandEvent
):
6435 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6436 give the application a chance to show a context (popup) menu.
6439 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6440 def __init__(self
, *args
, **kwargs
):
6442 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6446 newobj
= _core_
.new_ContextMenuEvent(*args
, **kwargs
)
6447 self
.this
= newobj
.this
6450 def GetPosition(*args
, **kwargs
):
6452 GetPosition(self) -> Point
6454 Returns the position (in screen coordinants) at which the menu should
6457 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
6459 def SetPosition(*args
, **kwargs
):
6461 SetPosition(self, Point pos)
6463 Sets the position at which the menu should be shown.
6465 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
6468 class ContextMenuEventPtr(ContextMenuEvent
):
6469 def __init__(self
, this
):
6471 if not hasattr(self
,"thisown"): self
.thisown
= 0
6472 self
.__class
__ = ContextMenuEvent
6473 _core_
.ContextMenuEvent_swigregister(ContextMenuEventPtr
)
6475 #---------------------------------------------------------------------------
6477 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
6478 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
6479 class IdleEvent(Event
):
6481 This class is used for EVT_IDLE events, which are generated and sent
6482 when the application *becomes* idle. In other words, the when the
6483 event queue becomes empty then idle events are sent to all windows (by
6484 default) and as long as none of them call `RequestMore` then there are
6485 no more idle events until after the system event queue has some normal
6486 events and then becomes empty again.
6488 By default, idle events are sent to all windows. If this is causing a
6489 significant overhead in your application, you can call
6490 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6491 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6492 which should receive idle events. Then idle events will only be sent
6493 to those windows and not to any others.
6496 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6497 def __init__(self
, *args
, **kwargs
):
6499 __init__(self) -> IdleEvent
6503 newobj
= _core_
.new_IdleEvent(*args
, **kwargs
)
6504 self
.this
= newobj
.this
6507 def RequestMore(*args
, **kwargs
):
6509 RequestMore(self, bool needMore=True)
6511 Tells wxWidgets that more processing is required. This function can be
6512 called by an EVT_IDLE handler for a window to indicate that the
6513 application should forward the EVT_IDLE event once more to the
6514 application windows. If no window calls this function during its
6515 EVT_IDLE handler, then the application will remain in a passive event
6516 loop until a new event is posted to the application by the windowing
6519 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
6521 def MoreRequested(*args
, **kwargs
):
6523 MoreRequested(self) -> bool
6525 Returns ``True`` if the OnIdle function processing this event
6526 requested more processing time.
6528 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
6530 def SetMode(*args
, **kwargs
):
6534 Static method for specifying how wxWidgets will send idle events: to
6535 all windows, or only to those which specify that they will process the
6538 The mode can be one of the following values:
6540 ========================= ========================================
6541 wx.IDLE_PROCESS_ALL Send idle events to all windows
6542 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6543 the wx.WS_EX_PROCESS_IDLE extra style
6545 ========================= ========================================
6548 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6550 SetMode
= staticmethod(SetMode
)
6551 def GetMode(*args
, **kwargs
):
6555 Static method returning a value specifying how wxWidgets will send
6556 idle events: to all windows, or only to those which specify that they
6557 will process the events.
6559 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6561 GetMode
= staticmethod(GetMode
)
6562 def CanSend(*args
, **kwargs
):
6564 CanSend(Window win) -> bool
6566 Returns ``True`` if it is appropriate to send idle events to this
6569 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6570 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6571 events should be sent to this window now. By default this will always
6572 return ``True`` because the update mode is initially
6573 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6574 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6576 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6578 CanSend
= staticmethod(CanSend
)
6580 class IdleEventPtr(IdleEvent
):
6581 def __init__(self
, this
):
6583 if not hasattr(self
,"thisown"): self
.thisown
= 0
6584 self
.__class
__ = IdleEvent
6585 _core_
.IdleEvent_swigregister(IdleEventPtr
)
6587 def IdleEvent_SetMode(*args
, **kwargs
):
6589 IdleEvent_SetMode(int mode)
6591 Static method for specifying how wxWidgets will send idle events: to
6592 all windows, or only to those which specify that they will process the
6595 The mode can be one of the following values:
6597 ========================= ========================================
6598 wx.IDLE_PROCESS_ALL Send idle events to all windows
6599 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6600 the wx.WS_EX_PROCESS_IDLE extra style
6602 ========================= ========================================
6605 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
6607 def IdleEvent_GetMode(*args
, **kwargs
):
6609 IdleEvent_GetMode() -> int
6611 Static method returning a value specifying how wxWidgets will send
6612 idle events: to all windows, or only to those which specify that they
6613 will process the events.
6615 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
6617 def IdleEvent_CanSend(*args
, **kwargs
):
6619 IdleEvent_CanSend(Window win) -> bool
6621 Returns ``True`` if it is appropriate to send idle events to this
6624 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6625 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6626 events should be sent to this window now. By default this will always
6627 return ``True`` because the update mode is initially
6628 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6629 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6631 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
6633 #---------------------------------------------------------------------------
6635 class PyEvent(Event
):
6637 wx.PyEvent can be used as a base class for implementing custom event
6638 types in Python. You should derived from this class instead of
6639 `wx.Event` because this class is Python-aware and is able to transport
6640 its Python bits safely through the wxWidgets event system and have
6641 them still be there when the event handler is invoked.
6643 :see: `wx.PyCommandEvent`
6647 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6648 def __init__(self
, *args
, **kwargs
):
6649 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
6650 newobj
= _core_
.new_PyEvent(*args
, **kwargs
)
6651 self
.this
= newobj
.this
6656 def __del__(self
, destroy
=_core_
.delete_PyEvent
):
6659 if self
.thisown
: destroy(self
)
6662 def _SetSelf(*args
, **kwargs
):
6663 """_SetSelf(self, PyObject self)"""
6664 return _core_
.PyEvent__SetSelf(*args
, **kwargs
)
6666 def _GetSelf(*args
, **kwargs
):
6667 """_GetSelf(self) -> PyObject"""
6668 return _core_
.PyEvent__GetSelf(*args
, **kwargs
)
6671 class PyEventPtr(PyEvent
):
6672 def __init__(self
, this
):
6674 if not hasattr(self
,"thisown"): self
.thisown
= 0
6675 self
.__class
__ = PyEvent
6676 _core_
.PyEvent_swigregister(PyEventPtr
)
6678 class PyCommandEvent(CommandEvent
):
6680 wx.PyCommandEvent can be used as a base class for implementing custom
6681 event types in Python, where the event shoudl travel up to parent
6682 windows looking for a handler. You should derived from this class
6683 instead of `wx.CommandEvent` because this class is Python-aware and is
6684 able to transport its Python bits safely through the wxWidgets event
6685 system and have them still be there when the event handler is invoked.
6691 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6692 def __init__(self
, *args
, **kwargs
):
6693 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
6694 newobj
= _core_
.new_PyCommandEvent(*args
, **kwargs
)
6695 self
.this
= newobj
.this
6700 def __del__(self
, destroy
=_core_
.delete_PyCommandEvent
):
6703 if self
.thisown
: destroy(self
)
6706 def _SetSelf(*args
, **kwargs
):
6707 """_SetSelf(self, PyObject self)"""
6708 return _core_
.PyCommandEvent__SetSelf(*args
, **kwargs
)
6710 def _GetSelf(*args
, **kwargs
):
6711 """_GetSelf(self) -> PyObject"""
6712 return _core_
.PyCommandEvent__GetSelf(*args
, **kwargs
)
6715 class PyCommandEventPtr(PyCommandEvent
):
6716 def __init__(self
, this
):
6718 if not hasattr(self
,"thisown"): self
.thisown
= 0
6719 self
.__class
__ = PyCommandEvent
6720 _core_
.PyCommandEvent_swigregister(PyCommandEventPtr
)
6722 class DateEvent(CommandEvent
):
6724 This event class holds information about a date change event and is
6725 used together with `wx.DatePickerCtrl`. It also serves as a base class
6726 for `wx.calendar.CalendarEvent`. Bind these event types with
6730 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6731 def __init__(self
, *args
, **kwargs
):
6732 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6733 newobj
= _core_
.new_DateEvent(*args
, **kwargs
)
6734 self
.this
= newobj
.this
6737 def GetDate(*args
, **kwargs
):
6739 GetDate(self) -> DateTime
6743 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
6745 def SetDate(*args
, **kwargs
):
6747 SetDate(self, DateTime date)
6749 Sets the date carried by the event, normally only used by the library
6752 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
6755 class DateEventPtr(DateEvent
):
6756 def __init__(self
, this
):
6758 if not hasattr(self
,"thisown"): self
.thisown
= 0
6759 self
.__class
__ = DateEvent
6760 _core_
.DateEvent_swigregister(DateEventPtr
)
6762 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
6763 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
6765 #---------------------------------------------------------------------------
6767 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
6768 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
6769 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
6770 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
6771 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
6772 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
6773 class PyApp(EvtHandler
):
6775 The ``wx.PyApp`` class is an *implementation detail*, please use the
6776 `wx.App` class (or some other derived class) instead.
6779 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6780 def __init__(self
, *args
, **kwargs
):
6782 __init__(self) -> PyApp
6784 Create a new application object, starting the bootstrap process.
6786 newobj
= _core_
.new_PyApp(*args
, **kwargs
)
6787 self
.this
= newobj
.this
6790 self
._setCallbackInfo
(self
, PyApp
, False)
6791 self
._setOORInfo
(self
, False)
6793 def __del__(self
, destroy
=_core_
.delete_PyApp
):
6796 if self
.thisown
: destroy(self
)
6799 def _setCallbackInfo(*args
, **kwargs
):
6800 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
6801 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
6803 def GetAppName(*args
, **kwargs
):
6805 GetAppName(self) -> String
6807 Get the application name.
6809 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
6811 def SetAppName(*args
, **kwargs
):
6813 SetAppName(self, String name)
6815 Set the application name. This value may be used automatically by
6816 `wx.Config` and such.
6818 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
6820 def GetClassName(*args
, **kwargs
):
6822 GetClassName(self) -> String
6824 Get the application's class name.
6826 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
6828 def SetClassName(*args
, **kwargs
):
6830 SetClassName(self, String name)
6832 Set the application's class name. This value may be used for
6833 X-resources if applicable for the platform
6835 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
6837 def GetVendorName(*args
, **kwargs
):
6839 GetVendorName(self) -> String
6841 Get the application's vendor name.
6843 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
6845 def SetVendorName(*args
, **kwargs
):
6847 SetVendorName(self, String name)
6849 Set the application's vendor name. This value may be used
6850 automatically by `wx.Config` and such.
6852 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
6854 def GetTraits(*args
, **kwargs
):
6856 GetTraits(self) -> wxAppTraits
6858 Return (and create if necessary) the app traits object to which we
6859 delegate for everything which either should be configurable by the
6860 user (then he can change the default behaviour simply by overriding
6861 CreateTraits() and returning his own traits object) or which is
6862 GUI/console dependent as then wx.AppTraits allows us to abstract the
6863 differences behind the common facade.
6865 :todo: Add support for overriding CreateAppTraits in wxPython.
6867 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
6869 def ProcessPendingEvents(*args
, **kwargs
):
6871 ProcessPendingEvents(self)
6873 Process all events in the Pending Events list -- it is necessary to
6874 call this function to process posted events. This normally happens
6875 during each event loop iteration.
6877 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
6879 def Yield(*args
, **kwargs
):
6881 Yield(self, bool onlyIfNeeded=False) -> bool
6883 Process all currently pending events right now, instead of waiting
6884 until return to the event loop. It is an error to call ``Yield``
6885 recursively unless the value of ``onlyIfNeeded`` is True.
6887 :warning: This function is dangerous as it can lead to unexpected
6888 reentrancies (i.e. when called from an event handler it may
6889 result in calling the same event handler again), use with
6890 extreme care or, better, don't use at all!
6892 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
6895 return _core_
.PyApp_Yield(*args
, **kwargs
)
6897 def WakeUpIdle(*args
, **kwargs
):
6901 Make sure that idle events are sent again.
6902 :see: `wx.WakeUpIdle`
6904 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
6906 def IsMainLoopRunning(*args
, **kwargs
):
6908 IsMainLoopRunning() -> bool
6910 Returns True if we're running the main loop, i.e. if the events can
6911 currently be dispatched.
6913 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
6915 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
6916 def MainLoop(*args
, **kwargs
):
6918 MainLoop(self) -> int
6920 Execute the main GUI loop, the function doesn't normally return until
6921 all top level windows have been closed and destroyed.
6923 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
6925 def Exit(*args
, **kwargs
):
6929 Exit the main loop thus terminating the application.
6932 return _core_
.PyApp_Exit(*args
, **kwargs
)
6934 def ExitMainLoop(*args
, **kwargs
):
6938 Exit the main GUI loop during the next iteration of the main
6939 loop, (i.e. it does not stop the program immediately!)
6941 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
6943 def Pending(*args
, **kwargs
):
6945 Pending(self) -> bool
6947 Returns True if there are unprocessed events in the event queue.
6949 return _core_
.PyApp_Pending(*args
, **kwargs
)
6951 def Dispatch(*args
, **kwargs
):
6953 Dispatch(self) -> bool
6955 Process the first event in the event queue (blocks until an event
6956 appears if there are none currently)
6958 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
6960 def ProcessIdle(*args
, **kwargs
):
6962 ProcessIdle(self) -> bool
6964 Called from the MainLoop when the application becomes idle (there are
6965 no pending events) and sends a `wx.IdleEvent` to all interested
6966 parties. Returns True if more idle events are needed, False if not.
6968 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
6970 def SendIdleEvents(*args
, **kwargs
):
6972 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6974 Send idle event to window and all subwindows. Returns True if more
6975 idle time is requested.
6977 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
6979 def IsActive(*args
, **kwargs
):
6981 IsActive(self) -> bool
6983 Return True if our app has focus.
6985 return _core_
.PyApp_IsActive(*args
, **kwargs
)
6987 def SetTopWindow(*args
, **kwargs
):
6989 SetTopWindow(self, Window win)
6991 Set the *main* top level window
6993 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
6995 def GetTopWindow(*args
, **kwargs
):
6997 GetTopWindow(self) -> Window
6999 Return the *main* top level window (if it hadn't been set previously
7000 with SetTopWindow(), will return just some top level window and, if
7001 there not any, will return None)
7003 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
7005 def SetExitOnFrameDelete(*args
, **kwargs
):
7007 SetExitOnFrameDelete(self, bool flag)
7009 Control the exit behaviour: by default, the program will exit the main
7010 loop (and so, usually, terminate) when the last top-level program
7011 window is deleted. Beware that if you disable this behaviour (with
7012 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7013 explicitly from somewhere.
7015 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
7017 def GetExitOnFrameDelete(*args
, **kwargs
):
7019 GetExitOnFrameDelete(self) -> bool
7021 Get the current exit behaviour setting.
7023 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
7025 def SetUseBestVisual(*args
, **kwargs
):
7027 SetUseBestVisual(self, bool flag)
7029 Set whether the app should try to use the best available visual on
7030 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
7032 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
7034 def GetUseBestVisual(*args
, **kwargs
):
7036 GetUseBestVisual(self) -> bool
7038 Get current UseBestVisual setting.
7040 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
7042 def SetPrintMode(*args
, **kwargs
):
7043 """SetPrintMode(self, int mode)"""
7044 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
7046 def GetPrintMode(*args
, **kwargs
):
7047 """GetPrintMode(self) -> int"""
7048 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
7050 def SetAssertMode(*args
, **kwargs
):
7052 SetAssertMode(self, int mode)
7054 Set the OnAssert behaviour for debug and hybrid builds.
7056 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
7058 def GetAssertMode(*args
, **kwargs
):
7060 GetAssertMode(self) -> int
7062 Get the current OnAssert behaviour setting.
7064 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
7066 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7067 """GetMacSupportPCMenuShortcuts() -> bool"""
7068 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7070 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
7071 def GetMacAboutMenuItemId(*args
, **kwargs
):
7072 """GetMacAboutMenuItemId() -> long"""
7073 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
7075 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
7076 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
7077 """GetMacPreferencesMenuItemId() -> long"""
7078 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
7080 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
7081 def GetMacExitMenuItemId(*args
, **kwargs
):
7082 """GetMacExitMenuItemId() -> long"""
7083 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
7085 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
7086 def GetMacHelpMenuTitleName(*args
, **kwargs
):
7087 """GetMacHelpMenuTitleName() -> String"""
7088 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
7090 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
7091 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7092 """SetMacSupportPCMenuShortcuts(bool val)"""
7093 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7095 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
7096 def SetMacAboutMenuItemId(*args
, **kwargs
):
7097 """SetMacAboutMenuItemId(long val)"""
7098 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7100 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
7101 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
7102 """SetMacPreferencesMenuItemId(long val)"""
7103 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7105 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
7106 def SetMacExitMenuItemId(*args
, **kwargs
):
7107 """SetMacExitMenuItemId(long val)"""
7108 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7110 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
7111 def SetMacHelpMenuTitleName(*args
, **kwargs
):
7112 """SetMacHelpMenuTitleName(String val)"""
7113 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7115 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
7116 def _BootstrapApp(*args
, **kwargs
):
7120 For internal use only
7122 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
7124 def GetComCtl32Version(*args
, **kwargs
):
7126 GetComCtl32Version() -> int
7128 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7129 it wasn't found at all. Raises an exception on non-Windows platforms.
7131 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
7133 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
7135 class PyAppPtr(PyApp
):
7136 def __init__(self
, this
):
7138 if not hasattr(self
,"thisown"): self
.thisown
= 0
7139 self
.__class
__ = PyApp
7140 _core_
.PyApp_swigregister(PyAppPtr
)
7142 def PyApp_IsMainLoopRunning(*args
, **kwargs
):
7144 PyApp_IsMainLoopRunning() -> bool
7146 Returns True if we're running the main loop, i.e. if the events can
7147 currently be dispatched.
7149 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
7151 def PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7152 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7153 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7155 def PyApp_GetMacAboutMenuItemId(*args
, **kwargs
):
7156 """PyApp_GetMacAboutMenuItemId() -> long"""
7157 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
7159 def PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
):
7160 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7161 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
7163 def PyApp_GetMacExitMenuItemId(*args
, **kwargs
):
7164 """PyApp_GetMacExitMenuItemId() -> long"""
7165 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
7167 def PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
):
7168 """PyApp_GetMacHelpMenuTitleName() -> String"""
7169 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
7171 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
7172 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7173 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
7175 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
7176 """PyApp_SetMacAboutMenuItemId(long val)"""
7177 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
7179 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
7180 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7181 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
7183 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
7184 """PyApp_SetMacExitMenuItemId(long val)"""
7185 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
7187 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
7188 """PyApp_SetMacHelpMenuTitleName(String val)"""
7189 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
7191 def PyApp_GetComCtl32Version(*args
, **kwargs
):
7193 PyApp_GetComCtl32Version() -> int
7195 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7196 it wasn't found at all. Raises an exception on non-Windows platforms.
7198 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
7200 #---------------------------------------------------------------------------
7203 def Exit(*args
, **kwargs
):
7207 Force an exit of the application. Convenience for wx.GetApp().Exit()
7209 return _core_
.Exit(*args
, **kwargs
)
7211 def Yield(*args
, **kwargs
):
7215 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7217 return _core_
.Yield(*args
, **kwargs
)
7219 def YieldIfNeeded(*args
, **kwargs
):
7221 YieldIfNeeded() -> bool
7223 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7225 return _core_
.YieldIfNeeded(*args
, **kwargs
)
7227 def SafeYield(*args
, **kwargs
):
7229 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7231 This function is similar to `wx.Yield`, except that it disables the
7232 user input to all program windows before calling `wx.Yield` and
7233 re-enables it again afterwards. If ``win`` is not None, this window
7234 will remain enabled, allowing the implementation of some limited user
7237 :Returns: the result of the call to `wx.Yield`.
7239 return _core_
.SafeYield(*args
, **kwargs
)
7241 def WakeUpIdle(*args
, **kwargs
):
7245 Cause the message queue to become empty again, so idle events will be
7248 return _core_
.WakeUpIdle(*args
, **kwargs
)
7250 def PostEvent(*args
, **kwargs
):
7252 PostEvent(EvtHandler dest, Event event)
7254 Send an event to a window or other wx.EvtHandler to be processed
7257 return _core_
.PostEvent(*args
, **kwargs
)
7259 def App_CleanUp(*args
, **kwargs
):
7263 For internal use only, it is used to cleanup after wxWidgets when
7266 return _core_
.App_CleanUp(*args
, **kwargs
)
7268 def GetApp(*args
, **kwargs
):
7272 Return a reference to the current wx.App object.
7274 return _core_
.GetApp(*args
, **kwargs
)
7276 def SetDefaultPyEncoding(*args
, **kwargs
):
7278 SetDefaultPyEncoding(string encoding)
7280 Sets the encoding that wxPython will use when it needs to convert a
7281 Python string or unicode object to or from a wxString.
7283 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7284 but please be aware that the default encoding within the same locale
7285 may be slightly different on different platforms. For example, please
7286 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7287 between the common latin/roman encodings.
7289 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
7291 def GetDefaultPyEncoding(*args
, **kwargs
):
7293 GetDefaultPyEncoding() -> string
7295 Gets the current encoding that wxPython will use when it needs to
7296 convert a Python string or unicode object to or from a wxString.
7298 return _core_
.GetDefaultPyEncoding(*args
, **kwargs
)
7299 #----------------------------------------------------------------------
7301 class PyOnDemandOutputWindow
:
7303 A class that can be used for redirecting Python's stdout and
7304 stderr streams. It will do nothing until something is wrriten to
7305 the stream at which point it will create a Frame with a text area
7306 and write the text there.
7308 def __init__(self
, title
= "wxPython: stdout/stderr"):
7311 self
.pos
= wx
.DefaultPosition
7312 self
.size
= (450, 300)
7315 def SetParent(self
, parent
):
7316 """Set the window to be used as the popup Frame's parent."""
7317 self
.parent
= parent
7320 def CreateOutputWindow(self
, st
):
7321 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
7322 style
=wx
.DEFAULT_FRAME_STYLE
)
7323 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
7324 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
7325 self
.text
.AppendText(st
)
7326 self
.frame
.Show(True)
7327 EVT_CLOSE(self
.frame
, self
.OnCloseWindow
)
7330 def OnCloseWindow(self
, event
):
7331 if self
.frame
is not None:
7332 self
.frame
.Destroy()
7337 # These methods provide the file-like output behaviour.
7338 def write(self
, text
):
7340 Create the output window if needed and write the string to it.
7341 If not called in the context of the gui thread then uses
7342 CallAfter to do the work there.
7344 if self
.frame
is None:
7345 if not wx
.Thread_IsMain():
7346 wx
.CallAfter(self
.CreateOutputWindow
, text
)
7348 self
.CreateOutputWindow(text
)
7350 if not wx
.Thread_IsMain():
7351 wx
.CallAfter(self
.text
.AppendText
, text
)
7353 self
.text
.AppendText(text
)
7357 if self
.frame
is not None:
7358 wx
.CallAfter(self
.frame
.Close
)
7366 #----------------------------------------------------------------------
7368 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
7370 class App(wx
.PyApp
):
7372 The ``wx.App`` class represents the application and is used to:
7374 * bootstrap the wxPython system and initialize the underlying
7376 * set and get application-wide properties
7377 * implement the windowing system main message or event loop,
7378 and to dispatch events to window instances
7381 Every application must have a ``wx.App`` instance, and all
7382 creation of UI objects should be delayed until after the
7383 ``wx.App`` object has been created in order to ensure that the gui
7384 platform and wxWidgets have been fully initialized.
7386 Normally you would derive from this class and implement an
7387 ``OnInit`` method that creates a frame and then calls
7388 ``self.SetTopWindow(frame)``.
7390 :see: `wx.PySimpleApp` for a simpler app class that can be used
7394 outputWindowClass
= PyOnDemandOutputWindow
7396 def __init__(self
, redirect
=_defRedirect
, filename
=None,
7397 useBestVisual
=False, clearSigInt
=True):
7399 Construct a ``wx.App`` object.
7401 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7402 redirected? Defaults to True on Windows and Mac, False
7403 otherwise. If `filename` is None then output will be
7404 redirected to a window that pops up as needed. (You can
7405 control what kind of window is created for the output by
7406 resetting the class variable ``outputWindowClass`` to a
7407 class of your choosing.)
7409 :param filename: The name of a file to redirect output to, if
7412 :param useBestVisual: Should the app try to use the best
7413 available visual provided by the system (only relevant on
7414 systems that have more than one visual.) This parameter
7415 must be used instead of calling `SetUseBestVisual` later
7416 on because it must be set before the underlying GUI
7417 toolkit is initialized.
7419 :param clearSigInt: Should SIGINT be cleared? This allows the
7420 app to terminate upon a Ctrl-C in the console like other
7423 :note: You should override OnInit to do applicaition
7424 initialization to ensure that the system, toolkit and
7425 wxWidgets are fully initialized.
7427 wx
.PyApp
.__init
__(self
)
7429 if wx
.Platform
== "__WXMAC__":
7432 if not MacOS
.WMAvailable():
7434 This program needs access to the screen. Please run with 'pythonw',
7435 not 'python', and only when you are logged in on the main display of
7443 # This has to be done before OnInit
7444 self
.SetUseBestVisual(useBestVisual
)
7446 # Set the default handler for SIGINT. This fixes a problem
7447 # where if Ctrl-C is pressed in the console that started this
7448 # app then it will not appear to do anything, (not even send
7449 # KeyboardInterrupt???) but will later segfault on exit. By
7450 # setting the default handler then the app will exit, as
7451 # expected (depending on platform.)
7455 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
7459 # Save and redirect the stdio to a window?
7460 self
.stdioWin
= None
7461 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
7463 self
.RedirectStdio(filename
)
7465 # Use Python's install prefix as the default
7466 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
7468 # This finishes the initialization of wxWindows and then calls
7469 # the OnInit that should be present in the derived class
7470 self
._BootstrapApp
()
7473 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
7474 self
.RestoreStdio() # Just in case the MainLoop was overridden
7478 wx
.PyApp
.Destroy(self
)
7481 def SetTopWindow(self
, frame
):
7482 """Set the \"main\" top level window"""
7484 self
.stdioWin
.SetParent(frame
)
7485 wx
.PyApp
.SetTopWindow(self
, frame
)
7489 """Execute the main GUI event loop"""
7490 wx
.PyApp
.MainLoop(self
)
7494 def RedirectStdio(self
, filename
=None):
7495 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7497 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
7499 self
.stdioWin
= self
.outputWindowClass()
7500 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
7503 def RestoreStdio(self
):
7505 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
7510 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
7512 Set the title, position and/or size of the output window if
7513 the stdio has been redirected. This should be called before
7514 any output would cause the output window to be created.
7517 if title
is not None:
7518 self
.stdioWin
.title
= title
7520 self
.stdioWin
.pos
= pos
7521 if size
is not None:
7522 self
.stdioWin
.size
= size
7527 # change from wx.PyApp_XX to wx.App_XX
7528 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
7529 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
7530 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
7531 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
7532 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
7533 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
7534 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
7535 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
7536 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
7537 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
7538 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
7540 #----------------------------------------------------------------------------
7542 class PySimpleApp(wx
.App
):
7544 A simple application class. You can just create one of these and
7545 then then make your top level windows later, and not have to worry
7546 about OnInit. For example::
7548 app = wx.PySimpleApp()
7549 frame = wx.Frame(None, title='Hello World')
7556 def __init__(self
, redirect
=False, filename
=None,
7557 useBestVisual
=False, clearSigInt
=True):
7559 :see: `wx.App.__init__`
7561 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
7568 # Is anybody using this one?
7569 class PyWidgetTester(wx
.App
):
7570 def __init__(self
, size
= (250, 100)):
7572 wx
.App
.__init
__(self
, 0)
7575 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
7576 self
.SetTopWindow(self
.frame
)
7579 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
7580 w
= widgetClass(self
.frame
, *args
, **kwargs
)
7581 self
.frame
.Show(True)
7583 #----------------------------------------------------------------------------
7584 # DO NOT hold any other references to this object. This is how we
7585 # know when to cleanup system resources that wxWidgets is holding. When
7586 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
7587 # goes to zero and it calls the wx.App_CleanUp function.
7589 class __wxPyCleanup
:
7591 self
.cleanup
= _core_
.App_CleanUp
7595 _sys
.__wxPythonCleanup
= __wxPyCleanup()
7597 ## # another possible solution, but it gets called too early...
7599 ## atexit.register(_core_.wxApp_CleanUp)
7602 #----------------------------------------------------------------------------
7604 #---------------------------------------------------------------------------
7606 class EventLoop(object):
7607 """Proxy of C++ EventLoop class"""
7609 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7610 def __init__(self
, *args
, **kwargs
):
7611 """__init__(self) -> EventLoop"""
7612 newobj
= _core_
.new_EventLoop(*args
, **kwargs
)
7613 self
.this
= newobj
.this
7616 def __del__(self
, destroy
=_core_
.delete_EventLoop
):
7619 if self
.thisown
: destroy(self
)
7622 def Run(*args
, **kwargs
):
7623 """Run(self) -> int"""
7624 return _core_
.EventLoop_Run(*args
, **kwargs
)
7626 def Exit(*args
, **kwargs
):
7627 """Exit(self, int rc=0)"""
7628 return _core_
.EventLoop_Exit(*args
, **kwargs
)
7630 def Pending(*args
, **kwargs
):
7631 """Pending(self) -> bool"""
7632 return _core_
.EventLoop_Pending(*args
, **kwargs
)
7634 def Dispatch(*args
, **kwargs
):
7635 """Dispatch(self) -> bool"""
7636 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
7638 def IsRunning(*args
, **kwargs
):
7639 """IsRunning(self) -> bool"""
7640 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
7642 def GetActive(*args
, **kwargs
):
7643 """GetActive() -> EventLoop"""
7644 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7646 GetActive
= staticmethod(GetActive
)
7647 def SetActive(*args
, **kwargs
):
7648 """SetActive(EventLoop loop)"""
7649 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7651 SetActive
= staticmethod(SetActive
)
7653 class EventLoopPtr(EventLoop
):
7654 def __init__(self
, this
):
7656 if not hasattr(self
,"thisown"): self
.thisown
= 0
7657 self
.__class
__ = EventLoop
7658 _core_
.EventLoop_swigregister(EventLoopPtr
)
7660 def EventLoop_GetActive(*args
, **kwargs
):
7661 """EventLoop_GetActive() -> EventLoop"""
7662 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
7664 def EventLoop_SetActive(*args
, **kwargs
):
7665 """EventLoop_SetActive(EventLoop loop)"""
7666 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
7668 #---------------------------------------------------------------------------
7670 class AcceleratorEntry(object):
7672 A class used to define items in an `wx.AcceleratorTable`. wxPython
7673 programs can choose to use wx.AcceleratorEntry objects, but using a
7674 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
7675 as well. See `__init__` for of the tuple values.
7677 :see: `wx.AcceleratorTable`
7680 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7681 def __init__(self
, *args
, **kwargs
):
7683 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7685 Construct a wx.AcceleratorEntry.
7687 newobj
= _core_
.new_AcceleratorEntry(*args
, **kwargs
)
7688 self
.this
= newobj
.this
7691 def __del__(self
, destroy
=_core_
.delete_AcceleratorEntry
):
7694 if self
.thisown
: destroy(self
)
7697 def Set(*args
, **kwargs
):
7699 Set(self, int flags, int keyCode, int cmd)
7701 (Re)set the attributes of a wx.AcceleratorEntry.
7704 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
7706 def GetFlags(*args
, **kwargs
):
7708 GetFlags(self) -> int
7710 Get the AcceleratorEntry's flags.
7712 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
7714 def GetKeyCode(*args
, **kwargs
):
7716 GetKeyCode(self) -> int
7718 Get the AcceleratorEntry's keycode.
7720 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
7722 def GetCommand(*args
, **kwargs
):
7724 GetCommand(self) -> int
7726 Get the AcceleratorEntry's command ID.
7728 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
7731 class AcceleratorEntryPtr(AcceleratorEntry
):
7732 def __init__(self
, this
):
7734 if not hasattr(self
,"thisown"): self
.thisown
= 0
7735 self
.__class
__ = AcceleratorEntry
7736 _core_
.AcceleratorEntry_swigregister(AcceleratorEntryPtr
)
7738 class AcceleratorTable(Object
):
7740 An accelerator table allows the application to specify a table of
7741 keyboard shortcuts for menus or other commands. On Windows, menu or
7742 button commands are supported; on GTK, only menu commands are
7746 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7747 def __init__(self
, *args
, **kwargs
):
7749 __init__(entries) -> AcceleratorTable
7751 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7752 items or or of 3-tuples (flags, keyCode, cmdID)
7754 :see: `wx.AcceleratorEntry`
7756 newobj
= _core_
.new_AcceleratorTable(*args
, **kwargs
)
7757 self
.this
= newobj
.this
7760 def __del__(self
, destroy
=_core_
.delete_AcceleratorTable
):
7763 if self
.thisown
: destroy(self
)
7766 def Ok(*args
, **kwargs
):
7767 """Ok(self) -> bool"""
7768 return _core_
.AcceleratorTable_Ok(*args
, **kwargs
)
7771 class AcceleratorTablePtr(AcceleratorTable
):
7772 def __init__(self
, this
):
7774 if not hasattr(self
,"thisown"): self
.thisown
= 0
7775 self
.__class
__ = AcceleratorTable
7776 _core_
.AcceleratorTable_swigregister(AcceleratorTablePtr
)
7779 def GetAccelFromString(*args
, **kwargs
):
7780 """GetAccelFromString(String label) -> AcceleratorEntry"""
7781 return _core_
.GetAccelFromString(*args
, **kwargs
)
7782 #---------------------------------------------------------------------------
7784 class VisualAttributes(object):
7785 """struct containing all the visual attributes of a control"""
7787 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7788 def __init__(self
, *args
, **kwargs
):
7790 __init__(self) -> VisualAttributes
7792 struct containing all the visual attributes of a control
7794 newobj
= _core_
.new_VisualAttributes(*args
, **kwargs
)
7795 self
.this
= newobj
.this
7798 def __del__(self
, destroy
=_core_
.delete_VisualAttributes
):
7801 if self
.thisown
: destroy(self
)
7804 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
7805 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
7806 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
7808 class VisualAttributesPtr(VisualAttributes
):
7809 def __init__(self
, this
):
7811 if not hasattr(self
,"thisown"): self
.thisown
= 0
7812 self
.__class
__ = VisualAttributes
7813 _core_
.VisualAttributes_swigregister(VisualAttributesPtr
)
7814 NullAcceleratorTable
= cvar
.NullAcceleratorTable
7815 PanelNameStr
= cvar
.PanelNameStr
7817 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
7818 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
7819 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
7820 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
7821 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
7822 class Window(EvtHandler
):
7824 wx.Window is the base class for all windows and represents any visible
7825 object on the screen. All controls, top level windows and so on are
7826 wx.Windows. Sizers and device contexts are not however, as they don't
7827 appear on screen themselves.
7831 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
7832 def __init__(self
, *args
, **kwargs
):
7834 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7835 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7837 Construct and show a generic Window.
7839 newobj
= _core_
.new_Window(*args
, **kwargs
)
7840 self
.this
= newobj
.this
7843 self
._setOORInfo
(self
)
7845 def Create(*args
, **kwargs
):
7847 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7848 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7850 Create the GUI part of the Window for 2-phase creation mode.
7852 return _core_
.Window_Create(*args
, **kwargs
)
7854 def Close(*args
, **kwargs
):
7856 Close(self, bool force=False) -> bool
7858 This function simply generates a EVT_CLOSE event whose handler usually
7859 tries to close the window. It doesn't close the window itself,
7860 however. If force is False (the default) then the window's close
7861 handler will be allowed to veto the destruction of the window.
7863 return _core_
.Window_Close(*args
, **kwargs
)
7865 def Destroy(*args
, **kwargs
):
7867 Destroy(self) -> bool
7869 Destroys the window safely. Frames and dialogs are not destroyed
7870 immediately when this function is called -- they are added to a list
7871 of windows to be deleted on idle time, when all the window's events
7872 have been processed. This prevents problems with events being sent to
7873 non-existent windows.
7875 Returns True if the window has either been successfully deleted, or it
7876 has been added to the list of windows pending real deletion.
7878 return _core_
.Window_Destroy(*args
, **kwargs
)
7880 def DestroyChildren(*args
, **kwargs
):
7882 DestroyChildren(self) -> bool
7884 Destroys all children of a window. Called automatically by the
7887 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
7889 def IsBeingDeleted(*args
, **kwargs
):
7891 IsBeingDeleted(self) -> bool
7893 Is the window in the process of being deleted?
7895 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
7897 def SetTitle(*args
, **kwargs
):
7899 SetTitle(self, String title)
7901 Sets the window's title. Applicable only to frames and dialogs.
7903 return _core_
.Window_SetTitle(*args
, **kwargs
)
7905 def GetTitle(*args
, **kwargs
):
7907 GetTitle(self) -> String
7909 Gets the window's title. Applicable only to frames and dialogs.
7911 return _core_
.Window_GetTitle(*args
, **kwargs
)
7913 def SetLabel(*args
, **kwargs
):
7915 SetLabel(self, String label)
7917 Set the text which the window shows in its label if applicable.
7919 return _core_
.Window_SetLabel(*args
, **kwargs
)
7921 def GetLabel(*args
, **kwargs
):
7923 GetLabel(self) -> String
7925 Generic way of getting a label from any window, for identification
7926 purposes. The interpretation of this function differs from class to
7927 class. For frames and dialogs, the value returned is the title. For
7928 buttons or static text controls, it is the button text. This function
7929 can be useful for meta-programs such as testing tools or special-needs
7930 access programs)which need to identify windows by name.
7932 return _core_
.Window_GetLabel(*args
, **kwargs
)
7934 def SetName(*args
, **kwargs
):
7936 SetName(self, String name)
7938 Sets the window's name. The window name is used for ressource setting
7939 in X, it is not the same as the window title/label
7941 return _core_
.Window_SetName(*args
, **kwargs
)
7943 def GetName(*args
, **kwargs
):
7945 GetName(self) -> String
7947 Returns the windows name. This name is not guaranteed to be unique;
7948 it is up to the programmer to supply an appropriate name in the window
7949 constructor or via wx.Window.SetName.
7951 return _core_
.Window_GetName(*args
, **kwargs
)
7953 def SetWindowVariant(*args
, **kwargs
):
7955 SetWindowVariant(self, int variant)
7957 Sets the variant of the window/font size to use for this window, if
7958 the platform supports variants, for example, wxMac.
7960 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
7962 def GetWindowVariant(*args
, **kwargs
):
7963 """GetWindowVariant(self) -> int"""
7964 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
7966 def SetId(*args
, **kwargs
):
7968 SetId(self, int winid)
7970 Sets the identifier of the window. Each window has an integer
7971 identifier. If the application has not provided one, an identifier
7972 will be generated. Normally, the identifier should be provided on
7973 creation and should not be modified subsequently.
7975 return _core_
.Window_SetId(*args
, **kwargs
)
7977 def GetId(*args
, **kwargs
):
7981 Returns the identifier of the window. Each window has an integer
7982 identifier. If the application has not provided one (or the default Id
7983 -1 is used) then an unique identifier with a negative value will be
7986 return _core_
.Window_GetId(*args
, **kwargs
)
7988 def NewControlId(*args
, **kwargs
):
7990 NewControlId() -> int
7992 Generate a control id for the controls which were not given one.
7994 return _core_
.Window_NewControlId(*args
, **kwargs
)
7996 NewControlId
= staticmethod(NewControlId
)
7997 def NextControlId(*args
, **kwargs
):
7999 NextControlId(int winid) -> int
8001 Get the id of the control following the one with the given
8004 return _core_
.Window_NextControlId(*args
, **kwargs
)
8006 NextControlId
= staticmethod(NextControlId
)
8007 def PrevControlId(*args
, **kwargs
):
8009 PrevControlId(int winid) -> int
8011 Get the id of the control preceding the one with the given
8014 return _core_
.Window_PrevControlId(*args
, **kwargs
)
8016 PrevControlId
= staticmethod(PrevControlId
)
8017 def SetSize(*args
, **kwargs
):
8019 SetSize(self, Size size)
8021 Sets the size of the window in pixels.
8023 return _core_
.Window_SetSize(*args
, **kwargs
)
8025 def SetDimensions(*args
, **kwargs
):
8027 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8029 Sets the position and size of the window in pixels. The sizeFlags
8030 parameter indicates the interpretation of the other params if they are
8033 ======================== ======================================
8034 wx.SIZE_AUTO A -1 indicates that a class-specific
8035 default should be used.
8036 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8037 -1 values are supplied.
8038 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8039 interpreted as real dimensions, not
8041 ======================== ======================================
8044 return _core_
.Window_SetDimensions(*args
, **kwargs
)
8046 def SetRect(*args
, **kwargs
):
8048 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8050 Sets the position and size of the window in pixels using a wx.Rect.
8052 return _core_
.Window_SetRect(*args
, **kwargs
)
8054 def SetSizeWH(*args
, **kwargs
):
8056 SetSizeWH(self, int width, int height)
8058 Sets the size of the window in pixels.
8060 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
8062 def Move(*args
, **kwargs
):
8064 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8066 Moves the window to the given position.
8068 return _core_
.Window_Move(*args
, **kwargs
)
8071 def MoveXY(*args
, **kwargs
):
8073 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8075 Moves the window to the given position.
8077 return _core_
.Window_MoveXY(*args
, **kwargs
)
8079 def SetBestFittingSize(*args
, **kwargs
):
8081 SetBestFittingSize(self, Size size=DefaultSize)
8083 A 'Smart' SetSize that will fill in default size components with the
8084 window's *best size* values. Also set's the minsize for use with sizers.
8086 return _core_
.Window_SetBestFittingSize(*args
, **kwargs
)
8088 def Raise(*args
, **kwargs
):
8092 Raises the window to the top of the window hierarchy if it is a
8093 managed window (dialog or frame).
8095 return _core_
.Window_Raise(*args
, **kwargs
)
8097 def Lower(*args
, **kwargs
):
8101 Lowers the window to the bottom of the window hierarchy if it is a
8102 managed window (dialog or frame).
8104 return _core_
.Window_Lower(*args
, **kwargs
)
8106 def SetClientSize(*args
, **kwargs
):
8108 SetClientSize(self, Size size)
8110 This sets the size of the window client area in pixels. Using this
8111 function to size a window tends to be more device-independent than
8112 wx.Window.SetSize, since the application need not worry about what
8113 dimensions the border or title bar have when trying to fit the window
8114 around panel items, for example.
8116 return _core_
.Window_SetClientSize(*args
, **kwargs
)
8118 def SetClientSizeWH(*args
, **kwargs
):
8120 SetClientSizeWH(self, int width, int height)
8122 This sets the size of the window client area in pixels. Using this
8123 function to size a window tends to be more device-independent than
8124 wx.Window.SetSize, since the application need not worry about what
8125 dimensions the border or title bar have when trying to fit the window
8126 around panel items, for example.
8128 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
8130 def SetClientRect(*args
, **kwargs
):
8132 SetClientRect(self, Rect rect)
8134 This sets the size of the window client area in pixels. Using this
8135 function to size a window tends to be more device-independent than
8136 wx.Window.SetSize, since the application need not worry about what
8137 dimensions the border or title bar have when trying to fit the window
8138 around panel items, for example.
8140 return _core_
.Window_SetClientRect(*args
, **kwargs
)
8142 def GetPosition(*args
, **kwargs
):
8144 GetPosition(self) -> Point
8146 Get the window's position.
8148 return _core_
.Window_GetPosition(*args
, **kwargs
)
8150 def GetPositionTuple(*args
, **kwargs
):
8152 GetPositionTuple() -> (x,y)
8154 Get the window's position.
8156 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
8158 def GetSize(*args
, **kwargs
):
8160 GetSize(self) -> Size
8162 Get the window size.
8164 return _core_
.Window_GetSize(*args
, **kwargs
)
8166 def GetSizeTuple(*args
, **kwargs
):
8168 GetSizeTuple() -> (width, height)
8170 Get the window size.
8172 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
8174 def GetRect(*args
, **kwargs
):
8176 GetRect(self) -> Rect
8178 Returns the size and position of the window as a wx.Rect object.
8180 return _core_
.Window_GetRect(*args
, **kwargs
)
8182 def GetClientSize(*args
, **kwargs
):
8184 GetClientSize(self) -> Size
8186 This gets the size of the window's 'client area' in pixels. The client
8187 area is the area which may be drawn on by the programmer, excluding
8188 title bar, border, scrollbars, etc.
8190 return _core_
.Window_GetClientSize(*args
, **kwargs
)
8192 def GetClientSizeTuple(*args
, **kwargs
):
8194 GetClientSizeTuple() -> (width, height)
8196 This gets the size of the window's 'client area' in pixels. The client
8197 area is the area which may be drawn on by the programmer, excluding
8198 title bar, border, scrollbars, etc.
8200 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
8202 def GetClientAreaOrigin(*args
, **kwargs
):
8204 GetClientAreaOrigin(self) -> Point
8206 Get the origin of the client area of the window relative to the
8207 window's top left corner (the client area may be shifted because of
8208 the borders, scrollbars, other decorations...)
8210 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
8212 def GetClientRect(*args
, **kwargs
):
8214 GetClientRect(self) -> Rect
8216 Get the client area position and size as a `wx.Rect` object.
8218 return _core_
.Window_GetClientRect(*args
, **kwargs
)
8220 def GetBestSize(*args
, **kwargs
):
8222 GetBestSize(self) -> Size
8224 This function returns the best acceptable minimal size for the
8225 window, if applicable. For example, for a static text control, it will
8226 be the minimal size such that the control label is not truncated. For
8227 windows containing subwindows (suzh aswx.Panel), the size returned by
8228 this function will be the same as the size the window would have had
8231 return _core_
.Window_GetBestSize(*args
, **kwargs
)
8233 def GetBestSizeTuple(*args
, **kwargs
):
8235 GetBestSizeTuple() -> (width, height)
8237 This function returns the best acceptable minimal size for the
8238 window, if applicable. For example, for a static text control, it will
8239 be the minimal size such that the control label is not truncated. For
8240 windows containing subwindows (suzh aswx.Panel), the size returned by
8241 this function will be the same as the size the window would have had
8244 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
8246 def InvalidateBestSize(*args
, **kwargs
):
8248 InvalidateBestSize(self)
8250 Reset the cached best size value so it will be recalculated the next
8253 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
8255 def CacheBestSize(*args
, **kwargs
):
8257 CacheBestSize(self, Size size)
8259 Cache the best size so it doesn't need to be calculated again, (at least until
8260 some properties of the window change.)
8262 return _core_
.Window_CacheBestSize(*args
, **kwargs
)
8264 def GetBestFittingSize(*args
, **kwargs
):
8266 GetBestFittingSize(self) -> Size
8268 This function will merge the window's best size into the window's
8269 minimum size, giving priority to the min size components, and returns
8273 return _core_
.Window_GetBestFittingSize(*args
, **kwargs
)
8275 def GetAdjustedBestSize(*args
, **kwargs
):
8277 GetAdjustedBestSize(self) -> Size
8279 This method is similar to GetBestSize, except in one
8280 thing. GetBestSize should return the minimum untruncated size of the
8281 window, while this method will return the largest of BestSize and any
8282 user specified minimum size. ie. it is the minimum size the window
8283 should currently be drawn at, not the minimal size it can possibly
8286 return _core_
.Window_GetAdjustedBestSize(*args
, **kwargs
)
8288 def Center(*args
, **kwargs
):
8290 Center(self, int direction=BOTH)
8292 Centers the window. The parameter specifies the direction for
8293 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8294 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8295 on the entire screen and not on its parent window. If it is a
8296 top-level window and has no parent then it will always be centered
8297 relative to the screen.
8299 return _core_
.Window_Center(*args
, **kwargs
)
8302 def CenterOnScreen(*args
, **kwargs
):
8304 CenterOnScreen(self, int dir=BOTH)
8306 Center on screen (only works for top level windows)
8308 return _core_
.Window_CenterOnScreen(*args
, **kwargs
)
8310 CentreOnScreen
= CenterOnScreen
8311 def CenterOnParent(*args
, **kwargs
):
8313 CenterOnParent(self, int dir=BOTH)
8315 Center with respect to the the parent window
8317 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
8319 CentreOnParent
= CenterOnParent
8320 def Fit(*args
, **kwargs
):
8324 Sizes the window so that it fits around its subwindows. This function
8325 won't do anything if there are no subwindows and will only really work
8326 correctly if sizers are used for the subwindows layout. Also, if the
8327 window has exactly one subwindow it is better (faster and the result
8328 is more precise as Fit adds some margin to account for fuzziness of
8329 its calculations) to call window.SetClientSize(child.GetSize())
8330 instead of calling Fit.
8332 return _core_
.Window_Fit(*args
, **kwargs
)
8334 def FitInside(*args
, **kwargs
):
8338 Similar to Fit, but sizes the interior (virtual) size of a
8339 window. Mainly useful with scrolled windows to reset scrollbars after
8340 sizing changes that do not trigger a size event, and/or scrolled
8341 windows without an interior sizer. This function similarly won't do
8342 anything if there are no subwindows.
8344 return _core_
.Window_FitInside(*args
, **kwargs
)
8346 def SetSizeHints(*args
, **kwargs
):
8348 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8351 Allows specification of minimum and maximum window sizes, and window
8352 size increments. If a pair of values is not set (or set to -1), the
8353 default values will be used. If this function is called, the user
8354 will not be able to size the window outside the given bounds (if it is
8355 a top-level window.) Sizers will also inspect the minimum window size
8356 and will use that value if set when calculating layout.
8358 The resizing increments are only significant under Motif or Xt.
8360 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
8362 def SetSizeHintsSz(*args
, **kwargs
):
8364 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8366 Allows specification of minimum and maximum window sizes, and window
8367 size increments. If a pair of values is not set (or set to -1), the
8368 default values will be used. If this function is called, the user
8369 will not be able to size the window outside the given bounds (if it is
8370 a top-level window.) Sizers will also inspect the minimum window size
8371 and will use that value if set when calculating layout.
8373 The resizing increments are only significant under Motif or Xt.
8375 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
8377 def SetVirtualSizeHints(*args
, **kwargs
):
8379 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
8381 Allows specification of minimum and maximum virtual window sizes. If a
8382 pair of values is not set (or set to -1), the default values will be
8383 used. If this function is called, the user will not be able to size
8384 the virtual area of the window outside the given bounds.
8386 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
8388 def SetVirtualSizeHintsSz(*args
, **kwargs
):
8390 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8392 Allows specification of minimum and maximum virtual window sizes. If a
8393 pair of values is not set (or set to -1), the default values will be
8394 used. If this function is called, the user will not be able to size
8395 the virtual area of the window outside the given bounds.
8397 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
8399 def GetMaxSize(*args
, **kwargs
):
8400 """GetMaxSize(self) -> Size"""
8401 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
8403 def GetMinSize(*args
, **kwargs
):
8404 """GetMinSize(self) -> Size"""
8405 return _core_
.Window_GetMinSize(*args
, **kwargs
)
8407 def SetMinSize(*args
, **kwargs
):
8409 SetMinSize(self, Size minSize)
8411 A more convenient method than `SetSizeHints` for setting just the
8414 return _core_
.Window_SetMinSize(*args
, **kwargs
)
8416 def SetMaxSize(*args
, **kwargs
):
8418 SetMaxSize(self, Size maxSize)
8420 A more convenient method than `SetSizeHints` for setting just the
8423 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
8425 def GetMinWidth(*args
, **kwargs
):
8426 """GetMinWidth(self) -> int"""
8427 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
8429 def GetMinHeight(*args
, **kwargs
):
8430 """GetMinHeight(self) -> int"""
8431 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
8433 def GetMaxWidth(*args
, **kwargs
):
8434 """GetMaxWidth(self) -> int"""
8435 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
8437 def GetMaxHeight(*args
, **kwargs
):
8438 """GetMaxHeight(self) -> int"""
8439 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
8441 def SetVirtualSize(*args
, **kwargs
):
8443 SetVirtualSize(self, Size size)
8445 Set the the virtual size of a window in pixels. For most windows this
8446 is just the client area of the window, but for some like scrolled
8447 windows it is more or less independent of the screen window size.
8449 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
8451 def SetVirtualSizeWH(*args
, **kwargs
):
8453 SetVirtualSizeWH(self, int w, int h)
8455 Set the the virtual size of a window in pixels. For most windows this
8456 is just the client area of the window, but for some like scrolled
8457 windows it is more or less independent of the screen window size.
8459 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
8461 def GetVirtualSize(*args
, **kwargs
):
8463 GetVirtualSize(self) -> Size
8465 Get the the virtual size of the window in pixels. For most windows
8466 this is just the client area of the window, but for some like scrolled
8467 windows it is more or less independent of the screen window size.
8469 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
8471 def GetVirtualSizeTuple(*args
, **kwargs
):
8473 GetVirtualSizeTuple() -> (width, height)
8475 Get the the virtual size of the window in pixels. For most windows
8476 this is just the client area of the window, but for some like scrolled
8477 windows it is more or less independent of the screen window size.
8479 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
8481 def GetBestVirtualSize(*args
, **kwargs
):
8483 GetBestVirtualSize(self) -> Size
8485 Return the largest of ClientSize and BestSize (as determined by a
8486 sizer, interior children, or other means)
8488 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
8490 def Show(*args
, **kwargs
):
8492 Show(self, bool show=True) -> bool
8494 Shows or hides the window. You may need to call Raise for a top level
8495 window if you want to bring it to top, although this is not needed if
8496 Show is called immediately after the frame creation. Returns True if
8497 the window has been shown or hidden or False if nothing was done
8498 because it already was in the requested state.
8500 return _core_
.Window_Show(*args
, **kwargs
)
8502 def Hide(*args
, **kwargs
):
8506 Equivalent to calling Show(False).
8508 return _core_
.Window_Hide(*args
, **kwargs
)
8510 def Enable(*args
, **kwargs
):
8512 Enable(self, bool enable=True) -> bool
8514 Enable or disable the window for user input. Note that when a parent
8515 window is disabled, all of its children are disabled as well and they
8516 are reenabled again when the parent is. Returns true if the window
8517 has been enabled or disabled, false if nothing was done, i.e. if the
8518 window had already been in the specified state.
8520 return _core_
.Window_Enable(*args
, **kwargs
)
8522 def Disable(*args
, **kwargs
):
8524 Disable(self) -> bool
8526 Disables the window, same as Enable(false).
8528 return _core_
.Window_Disable(*args
, **kwargs
)
8530 def IsShown(*args
, **kwargs
):
8532 IsShown(self) -> bool
8534 Returns true if the window is shown, false if it has been hidden.
8536 return _core_
.Window_IsShown(*args
, **kwargs
)
8538 def IsEnabled(*args
, **kwargs
):
8540 IsEnabled(self) -> bool
8542 Returns true if the window is enabled for input, false otherwise.
8544 return _core_
.Window_IsEnabled(*args
, **kwargs
)
8546 def SetWindowStyleFlag(*args
, **kwargs
):
8548 SetWindowStyleFlag(self, long style)
8550 Sets the style of the window. Please note that some styles cannot be
8551 changed after the window creation and that Refresh() might need to be
8552 called after changing the others for the change to take place
8555 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
8557 def GetWindowStyleFlag(*args
, **kwargs
):
8559 GetWindowStyleFlag(self) -> long
8561 Gets the window style that was passed to the constructor or Create
8564 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
8566 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
8567 def HasFlag(*args
, **kwargs
):
8569 HasFlag(self, int flag) -> bool
8571 Test if the given style is set for this window.
8573 return _core_
.Window_HasFlag(*args
, **kwargs
)
8575 def IsRetained(*args
, **kwargs
):
8577 IsRetained(self) -> bool
8579 Returns true if the window is retained, false otherwise. Retained
8580 windows are only available on X platforms.
8582 return _core_
.Window_IsRetained(*args
, **kwargs
)
8584 def SetExtraStyle(*args
, **kwargs
):
8586 SetExtraStyle(self, long exStyle)
8588 Sets the extra style bits for the window. Extra styles are the less
8589 often used style bits which can't be set with the constructor or with
8590 SetWindowStyleFlag()
8592 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
8594 def GetExtraStyle(*args
, **kwargs
):
8596 GetExtraStyle(self) -> long
8598 Returns the extra style bits for the window.
8600 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
8602 def MakeModal(*args
, **kwargs
):
8604 MakeModal(self, bool modal=True)
8606 Disables all other windows in the application so that the user can
8607 only interact with this window. Passing False will reverse this
8610 return _core_
.Window_MakeModal(*args
, **kwargs
)
8612 def SetThemeEnabled(*args
, **kwargs
):
8614 SetThemeEnabled(self, bool enableTheme)
8616 This function tells a window if it should use the system's "theme"
8617 code to draw the windows' background instead if its own background
8618 drawing code. This will only have an effect on platforms that support
8619 the notion of themes in user defined windows. One such platform is
8620 GTK+ where windows can have (very colourful) backgrounds defined by a
8621 user's selected theme.
8623 Dialogs, notebook pages and the status bar have this flag set to true
8624 by default so that the default look and feel is simulated best.
8626 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
8628 def GetThemeEnabled(*args
, **kwargs
):
8630 GetThemeEnabled(self) -> bool
8632 Return the themeEnabled flag.
8634 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
8636 def SetFocus(*args
, **kwargs
):
8640 Set's the focus to this window, allowing it to receive keyboard input.
8642 return _core_
.Window_SetFocus(*args
, **kwargs
)
8644 def SetFocusFromKbd(*args
, **kwargs
):
8646 SetFocusFromKbd(self)
8648 Set focus to this window as the result of a keyboard action. Normally
8649 only called internally.
8651 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
8653 def FindFocus(*args
, **kwargs
):
8655 FindFocus() -> Window
8657 Returns the window or control that currently has the keyboard focus,
8660 return _core_
.Window_FindFocus(*args
, **kwargs
)
8662 FindFocus
= staticmethod(FindFocus
)
8663 def AcceptsFocus(*args
, **kwargs
):
8665 AcceptsFocus(self) -> bool
8667 Can this window have focus?
8669 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
8671 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
8673 AcceptsFocusFromKeyboard(self) -> bool
8675 Can this window be given focus by keyboard navigation? if not, the
8676 only way to give it focus (provided it accepts it at all) is to click
8679 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
8681 def GetDefaultItem(*args
, **kwargs
):
8683 GetDefaultItem(self) -> Window
8685 Get the default child of this parent, i.e. the one which is activated
8686 by pressing <Enter> such as the OK button on a wx.Dialog.
8688 return _core_
.Window_GetDefaultItem(*args
, **kwargs
)
8690 def SetDefaultItem(*args
, **kwargs
):
8692 SetDefaultItem(self, Window child) -> Window
8694 Set this child as default, return the old default.
8696 return _core_
.Window_SetDefaultItem(*args
, **kwargs
)
8698 def SetTmpDefaultItem(*args
, **kwargs
):
8700 SetTmpDefaultItem(self, Window win)
8702 Set this child as temporary default
8704 return _core_
.Window_SetTmpDefaultItem(*args
, **kwargs
)
8706 def Navigate(*args
, **kwargs
):
8708 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8710 Does keyboard navigation from this window to another, by sending a
8711 `wx.NavigationKeyEvent`.
8713 return _core_
.Window_Navigate(*args
, **kwargs
)
8715 def MoveAfterInTabOrder(*args
, **kwargs
):
8717 MoveAfterInTabOrder(self, Window win)
8719 Moves this window in the tab navigation order after the specified
8720 sibling window. This means that when the user presses the TAB key on
8721 that other window, the focus switches to this window.
8723 The default tab order is the same as creation order. This function
8724 and `MoveBeforeInTabOrder` allow to change it after creating all the
8728 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
8730 def MoveBeforeInTabOrder(*args
, **kwargs
):
8732 MoveBeforeInTabOrder(self, Window win)
8734 Same as `MoveAfterInTabOrder` except that it inserts this window just
8735 before win instead of putting it right after it.
8737 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
8739 def GetChildren(*args
, **kwargs
):
8741 GetChildren(self) -> PyObject
8743 Returns a list of the window's children. NOTE: Currently this is a
8744 copy of the child window list maintained by the window, so the return
8745 value of this function is only valid as long as the window's children
8748 return _core_
.Window_GetChildren(*args
, **kwargs
)
8750 def GetParent(*args
, **kwargs
):
8752 GetParent(self) -> Window
8754 Returns the parent window of this window, or None if there isn't one.
8756 return _core_
.Window_GetParent(*args
, **kwargs
)
8758 def GetGrandParent(*args
, **kwargs
):
8760 GetGrandParent(self) -> Window
8762 Returns the parent of the parent of this window, or None if there
8765 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
8767 def IsTopLevel(*args
, **kwargs
):
8769 IsTopLevel(self) -> bool
8771 Returns true if the given window is a top-level one. Currently all
8772 frames and dialogs are always considered to be top-level windows (even
8773 if they have a parent window).
8775 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
8777 def Reparent(*args
, **kwargs
):
8779 Reparent(self, Window newParent) -> bool
8781 Reparents the window, i.e the window will be removed from its current
8782 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8783 re-inserted into another. Available on Windows and GTK. Returns True
8784 if the parent was changed, False otherwise (error or newParent ==
8787 return _core_
.Window_Reparent(*args
, **kwargs
)
8789 def AddChild(*args
, **kwargs
):
8791 AddChild(self, Window child)
8793 Adds a child window. This is called automatically by window creation
8794 functions so should not be required by the application programmer.
8796 return _core_
.Window_AddChild(*args
, **kwargs
)
8798 def RemoveChild(*args
, **kwargs
):
8800 RemoveChild(self, Window child)
8802 Removes a child window. This is called automatically by window
8803 deletion functions so should not be required by the application
8806 return _core_
.Window_RemoveChild(*args
, **kwargs
)
8808 def FindWindowById(*args
, **kwargs
):
8810 FindWindowById(self, long winid) -> Window
8812 Find a chld of this window by window ID
8814 return _core_
.Window_FindWindowById(*args
, **kwargs
)
8816 def FindWindowByName(*args
, **kwargs
):
8818 FindWindowByName(self, String name) -> Window
8820 Find a child of this window by name
8822 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
8824 def GetEventHandler(*args
, **kwargs
):
8826 GetEventHandler(self) -> EvtHandler
8828 Returns the event handler for this window. By default, the window is
8829 its own event handler.
8831 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
8833 def SetEventHandler(*args
, **kwargs
):
8835 SetEventHandler(self, EvtHandler handler)
8837 Sets the event handler for this window. An event handler is an object
8838 that is capable of processing the events sent to a window. By default,
8839 the window is its own event handler, but an application may wish to
8840 substitute another, for example to allow central implementation of
8841 event-handling for a variety of different window classes.
8843 It is usually better to use `wx.Window.PushEventHandler` since this sets
8844 up a chain of event handlers, where an event not handled by one event
8845 handler is handed to the next one in the chain.
8847 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
8849 def PushEventHandler(*args
, **kwargs
):
8851 PushEventHandler(self, EvtHandler handler)
8853 Pushes this event handler onto the event handler stack for the window.
8854 An event handler is an object that is capable of processing the events
8855 sent to a window. By default, the window is its own event handler, but
8856 an application may wish to substitute another, for example to allow
8857 central implementation of event-handling for a variety of different
8860 wx.Window.PushEventHandler allows an application to set up a chain of
8861 event handlers, where an event not handled by one event handler is
8862 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
8863 remove the event handler.
8865 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
8867 def PopEventHandler(*args
, **kwargs
):
8869 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8871 Removes and returns the top-most event handler on the event handler
8872 stack. If deleteHandler is True then the wx.EvtHandler object will be
8873 destroyed after it is popped.
8875 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
8877 def RemoveEventHandler(*args
, **kwargs
):
8879 RemoveEventHandler(self, EvtHandler handler) -> bool
8881 Find the given handler in the event handler chain and remove (but not
8882 delete) it from the event handler chain, return True if it was found
8883 and False otherwise (this also results in an assert failure so this
8884 function should only be called when the handler is supposed to be
8887 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
8889 def SetValidator(*args
, **kwargs
):
8891 SetValidator(self, Validator validator)
8893 Deletes the current validator (if any) and sets the window validator,
8894 having called wx.Validator.Clone to create a new validator of this
8897 return _core_
.Window_SetValidator(*args
, **kwargs
)
8899 def GetValidator(*args
, **kwargs
):
8901 GetValidator(self) -> Validator
8903 Returns a pointer to the current validator for the window, or None if
8906 return _core_
.Window_GetValidator(*args
, **kwargs
)
8908 def Validate(*args
, **kwargs
):
8910 Validate(self) -> bool
8912 Validates the current values of the child controls using their
8913 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8914 style flag set, the method will also call Validate() of all child
8915 windows. Returns false if any of the validations failed.
8917 return _core_
.Window_Validate(*args
, **kwargs
)
8919 def TransferDataToWindow(*args
, **kwargs
):
8921 TransferDataToWindow(self) -> bool
8923 Transfers values to child controls from data areas specified by their
8924 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8925 style flag set, the method will also call TransferDataToWindow() of
8928 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
8930 def TransferDataFromWindow(*args
, **kwargs
):
8932 TransferDataFromWindow(self) -> bool
8934 Transfers values from child controls to data areas specified by their
8935 validators. Returns false if a transfer failed. If the window has
8936 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8937 also call TransferDataFromWindow() of all child windows.
8939 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
8941 def InitDialog(*args
, **kwargs
):
8945 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8946 to the dialog via validators.
8948 return _core_
.Window_InitDialog(*args
, **kwargs
)
8950 def SetAcceleratorTable(*args
, **kwargs
):
8952 SetAcceleratorTable(self, AcceleratorTable accel)
8954 Sets the accelerator table for this window.
8956 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
8958 def GetAcceleratorTable(*args
, **kwargs
):
8960 GetAcceleratorTable(self) -> AcceleratorTable
8962 Gets the accelerator table for this window.
8964 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
8966 def RegisterHotKey(*args
, **kwargs
):
8968 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8970 Registers a system wide hotkey. Every time the user presses the hotkey
8971 registered here, this window will receive a hotkey event. It will
8972 receive the event even if the application is in the background and
8973 does not have the input focus because the user is working with some
8974 other application. To bind an event handler function to this hotkey
8975 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8976 hotkey was registered successfully.
8978 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
8980 def UnregisterHotKey(*args
, **kwargs
):
8982 UnregisterHotKey(self, int hotkeyId) -> bool
8984 Unregisters a system wide hotkey.
8986 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
8988 def ConvertDialogPointToPixels(*args
, **kwargs
):
8990 ConvertDialogPointToPixels(self, Point pt) -> Point
8992 Converts a point or size from dialog units to pixels. Dialog units
8993 are used for maintaining a dialog's proportions even if the font
8994 changes. For the x dimension, the dialog units are multiplied by the
8995 average character width and then divided by 4. For the y dimension,
8996 the dialog units are multiplied by the average character height and
8999 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
9001 def ConvertDialogSizeToPixels(*args
, **kwargs
):
9003 ConvertDialogSizeToPixels(self, Size sz) -> Size
9005 Converts a point or size from dialog units to pixels. Dialog units
9006 are used for maintaining a dialog's proportions even if the font
9007 changes. For the x dimension, the dialog units are multiplied by the
9008 average character width and then divided by 4. For the y dimension,
9009 the dialog units are multiplied by the average character height and
9012 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
9014 def DLG_PNT(*args
, **kwargs
):
9016 DLG_PNT(self, Point pt) -> Point
9018 Converts a point or size from dialog units to pixels. Dialog units
9019 are used for maintaining a dialog's proportions even if the font
9020 changes. For the x dimension, the dialog units are multiplied by the
9021 average character width and then divided by 4. For the y dimension,
9022 the dialog units are multiplied by the average character height and
9025 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
9027 def DLG_SZE(*args
, **kwargs
):
9029 DLG_SZE(self, Size sz) -> Size
9031 Converts a point or size from dialog units to pixels. Dialog units
9032 are used for maintaining a dialog's proportions even if the font
9033 changes. For the x dimension, the dialog units are multiplied by the
9034 average character width and then divided by 4. For the y dimension,
9035 the dialog units are multiplied by the average character height and
9038 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
9040 def ConvertPixelPointToDialog(*args
, **kwargs
):
9041 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9042 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
9044 def ConvertPixelSizeToDialog(*args
, **kwargs
):
9045 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9046 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
9048 def WarpPointer(*args
, **kwargs
):
9050 WarpPointer(self, int x, int y)
9052 Moves the pointer to the given position on the window.
9054 NOTE: This function is not supported under Mac because Apple Human
9055 Interface Guidelines forbid moving the mouse cursor programmatically.
9057 return _core_
.Window_WarpPointer(*args
, **kwargs
)
9059 def CaptureMouse(*args
, **kwargs
):
9063 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9064 release the capture.
9066 Note that wxWindows maintains the stack of windows having captured the
9067 mouse and when the mouse is released the capture returns to the window
9068 which had had captured it previously and it is only really released if
9069 there were no previous window. In particular, this means that you must
9070 release the mouse as many times as you capture it.
9072 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
9074 def ReleaseMouse(*args
, **kwargs
):
9078 Releases mouse input captured with wx.Window.CaptureMouse.
9080 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
9082 def GetCapture(*args
, **kwargs
):
9084 GetCapture() -> Window
9086 Returns the window which currently captures the mouse or None
9088 return _core_
.Window_GetCapture(*args
, **kwargs
)
9090 GetCapture
= staticmethod(GetCapture
)
9091 def HasCapture(*args
, **kwargs
):
9093 HasCapture(self) -> bool
9095 Returns true if this window has the current mouse capture.
9097 return _core_
.Window_HasCapture(*args
, **kwargs
)
9099 def Refresh(*args
, **kwargs
):
9101 Refresh(self, bool eraseBackground=True, Rect rect=None)
9103 Mark the specified rectangle (or the whole window) as "dirty" so it
9104 will be repainted. Causes an EVT_PAINT event to be generated and sent
9107 return _core_
.Window_Refresh(*args
, **kwargs
)
9109 def RefreshRect(*args
, **kwargs
):
9111 RefreshRect(self, Rect rect, bool eraseBackground=True)
9113 Redraws the contents of the given rectangle: the area inside it will
9114 be repainted. This is the same as Refresh but has a nicer syntax.
9116 return _core_
.Window_RefreshRect(*args
, **kwargs
)
9118 def Update(*args
, **kwargs
):
9122 Calling this method immediately repaints the invalidated area of the
9123 window instead of waiting for the EVT_PAINT event to happen, (normally
9124 this would usually only happen when the flow of control returns to the
9125 event loop.) Notice that this function doesn't refresh the window and
9126 does nothing if the window has been already repainted. Use Refresh
9127 first if you want to immediately redraw the window (or some portion of
9128 it) unconditionally.
9130 return _core_
.Window_Update(*args
, **kwargs
)
9132 def ClearBackground(*args
, **kwargs
):
9134 ClearBackground(self)
9136 Clears the window by filling it with the current background
9137 colour. Does not cause an erase background event to be generated.
9139 return _core_
.Window_ClearBackground(*args
, **kwargs
)
9141 def Freeze(*args
, **kwargs
):
9145 Freezes the window or, in other words, prevents any updates from
9146 taking place on screen, the window is not redrawn at all. Thaw must be
9147 called to reenable window redrawing. Calls to Freeze/Thaw may be
9148 nested, with the actual Thaw being delayed until all the nesting has
9151 This method is useful for visual appearance optimization (for example,
9152 it is a good idea to use it before inserting large amount of text into
9153 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9154 for all controls so it is mostly just a hint to wxWindows and not a
9155 mandatory directive.
9157 return _core_
.Window_Freeze(*args
, **kwargs
)
9159 def Thaw(*args
, **kwargs
):
9163 Reenables window updating after a previous call to Freeze. Calls to
9164 Freeze/Thaw may be nested, so Thaw must be called the same number of
9165 times that Freeze was before the window will be updated.
9167 return _core_
.Window_Thaw(*args
, **kwargs
)
9169 def PrepareDC(*args
, **kwargs
):
9171 PrepareDC(self, DC dc)
9173 Call this function to prepare the device context for drawing a
9174 scrolled image. It sets the device origin according to the current
9177 return _core_
.Window_PrepareDC(*args
, **kwargs
)
9179 def GetUpdateRegion(*args
, **kwargs
):
9181 GetUpdateRegion(self) -> Region
9183 Returns the region specifying which parts of the window have been
9184 damaged. Should only be called within an EVT_PAINT handler.
9186 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
9188 def GetUpdateClientRect(*args
, **kwargs
):
9190 GetUpdateClientRect(self) -> Rect
9192 Get the update rectangle region bounding box in client coords.
9194 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
9196 def IsExposed(*args
, **kwargs
):
9198 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9200 Returns true if the given point or rectangle area has been exposed
9201 since the last repaint. Call this in an paint event handler to
9202 optimize redrawing by only redrawing those areas, which have been
9205 return _core_
.Window_IsExposed(*args
, **kwargs
)
9207 def IsExposedPoint(*args
, **kwargs
):
9209 IsExposedPoint(self, Point pt) -> bool
9211 Returns true if the given point or rectangle area has been exposed
9212 since the last repaint. Call this in an paint event handler to
9213 optimize redrawing by only redrawing those areas, which have been
9216 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
9218 def IsExposedRect(*args
, **kwargs
):
9220 IsExposedRect(self, Rect rect) -> bool
9222 Returns true if the given point or rectangle area has been exposed
9223 since the last repaint. Call this in an paint event handler to
9224 optimize redrawing by only redrawing those areas, which have been
9227 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
9229 def GetDefaultAttributes(*args
, **kwargs
):
9231 GetDefaultAttributes(self) -> VisualAttributes
9233 Get the default attributes for an instance of this class. This is
9234 useful if you want to use the same font or colour in your own control
9235 as in a standard control -- which is a much better idea than hard
9236 coding specific colours or fonts which might look completely out of
9237 place on the user's system, especially if it uses themes.
9239 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
9241 def GetClassDefaultAttributes(*args
, **kwargs
):
9243 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9245 Get the default attributes for this class. This is useful if you want
9246 to use the same font or colour in your own control as in a standard
9247 control -- which is a much better idea than hard coding specific
9248 colours or fonts which might look completely out of place on the
9249 user's system, especially if it uses themes.
9251 The variant parameter is only relevant under Mac currently and is
9252 ignore under other platforms. Under Mac, it will change the size of
9253 the returned font. See `wx.Window.SetWindowVariant` for more about
9256 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9258 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
9259 def SetBackgroundColour(*args
, **kwargs
):
9261 SetBackgroundColour(self, Colour colour) -> bool
9263 Sets the background colour of the window. Returns True if the colour
9264 was changed. The background colour is usually painted by the default
9265 EVT_ERASE_BACKGROUND event handler function under Windows and
9266 automatically under GTK. Using `wx.NullColour` will reset the window
9267 to the default background colour.
9269 Note that setting the background colour may not cause an immediate
9270 refresh, so you may wish to call `ClearBackground` or `Refresh` after
9271 calling this function.
9273 Using this function will disable attempts to use themes for this
9274 window, if the system supports them. Use with care since usually the
9275 themes represent the appearance chosen by the user to be used for all
9276 applications on the system.
9278 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
9280 def SetOwnBackgroundColour(*args
, **kwargs
):
9281 """SetOwnBackgroundColour(self, Colour colour)"""
9282 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
9284 def SetForegroundColour(*args
, **kwargs
):
9286 SetForegroundColour(self, Colour colour) -> bool
9288 Sets the foreground colour of the window. Returns True is the colour
9289 was changed. The interpretation of foreground colour is dependent on
9290 the window class; it may be the text colour or other colour, or it may
9293 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
9295 def SetOwnForegroundColour(*args
, **kwargs
):
9296 """SetOwnForegroundColour(self, Colour colour)"""
9297 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
9299 def GetBackgroundColour(*args
, **kwargs
):
9301 GetBackgroundColour(self) -> Colour
9303 Returns the background colour of the window.
9305 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
9307 def GetForegroundColour(*args
, **kwargs
):
9309 GetForegroundColour(self) -> Colour
9311 Returns the foreground colour of the window. The interpretation of
9312 foreground colour is dependent on the window class; it may be the text
9313 colour or other colour, or it may not be used at all.
9315 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
9317 def InheritsBackgroundColour(*args
, **kwargs
):
9318 """InheritsBackgroundColour(self) -> bool"""
9319 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
9321 def UseBgCol(*args
, **kwargs
):
9322 """UseBgCol(self) -> bool"""
9323 return _core_
.Window_UseBgCol(*args
, **kwargs
)
9325 def SetBackgroundStyle(*args
, **kwargs
):
9327 SetBackgroundStyle(self, int style) -> bool
9329 Returns the background style of the window. The background style
9330 indicates how the background of the window is drawn.
9332 ====================== ========================================
9333 wx.BG_STYLE_SYSTEM The background colour or pattern should
9334 be determined by the system
9335 wx.BG_STYLE_COLOUR The background should be a solid colour
9336 wx.BG_STYLE_CUSTOM The background will be implemented by the
9338 ====================== ========================================
9340 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9341 a custom background, such as a tiled bitmap. Currently the style has
9342 no effect on other platforms.
9344 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9346 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
9348 def GetBackgroundStyle(*args
, **kwargs
):
9350 GetBackgroundStyle(self) -> int
9352 Returns the background style of the window.
9354 :see: `SetBackgroundStyle`
9356 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
9358 def HasTransparentBackground(*args
, **kwargs
):
9360 HasTransparentBackground(self) -> bool
9362 Returns True if this window's background is transparent (as, for
9363 example, for `wx.StaticText`) and should show the parent window's
9366 This method is mostly used internally by the library itself and you
9367 normally shouldn't have to call it. You may, however, have to override
9368 it in your custom control classes to ensure that background is painted
9371 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
9373 def SetCursor(*args
, **kwargs
):
9375 SetCursor(self, Cursor cursor) -> bool
9377 Sets the window's cursor. Notice that the window cursor also sets it
9378 for the children of the window implicitly.
9380 The cursor may be wx.NullCursor in which case the window cursor will
9381 be reset back to default.
9383 return _core_
.Window_SetCursor(*args
, **kwargs
)
9385 def GetCursor(*args
, **kwargs
):
9387 GetCursor(self) -> Cursor
9389 Return the cursor associated with this window.
9391 return _core_
.Window_GetCursor(*args
, **kwargs
)
9393 def SetFont(*args
, **kwargs
):
9395 SetFont(self, Font font) -> bool
9397 Sets the font for this window.
9399 return _core_
.Window_SetFont(*args
, **kwargs
)
9401 def SetOwnFont(*args
, **kwargs
):
9402 """SetOwnFont(self, Font font)"""
9403 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
9405 def GetFont(*args
, **kwargs
):
9407 GetFont(self) -> Font
9409 Returns the default font used for this window.
9411 return _core_
.Window_GetFont(*args
, **kwargs
)
9413 def SetCaret(*args
, **kwargs
):
9415 SetCaret(self, Caret caret)
9417 Sets the caret associated with the window.
9419 return _core_
.Window_SetCaret(*args
, **kwargs
)
9421 def GetCaret(*args
, **kwargs
):
9423 GetCaret(self) -> Caret
9425 Returns the caret associated with the window.
9427 return _core_
.Window_GetCaret(*args
, **kwargs
)
9429 def GetCharHeight(*args
, **kwargs
):
9431 GetCharHeight(self) -> int
9433 Get the (average) character size for the current font.
9435 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
9437 def GetCharWidth(*args
, **kwargs
):
9439 GetCharWidth(self) -> int
9441 Get the (average) character size for the current font.
9443 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
9445 def GetTextExtent(*args
, **kwargs
):
9447 GetTextExtent(String string) -> (width, height)
9449 Get the width and height of the text using the current font.
9451 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
9453 def GetFullTextExtent(*args
, **kwargs
):
9455 GetFullTextExtent(String string, Font font=None) ->
9456 (width, height, descent, externalLeading)
9458 Get the width, height, decent and leading of the text using the
9459 current or specified font.
9461 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
9463 def ClientToScreenXY(*args
, **kwargs
):
9465 ClientToScreenXY(int x, int y) -> (x,y)
9467 Converts to screen coordinates from coordinates relative to this window.
9469 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
9471 def ScreenToClientXY(*args
, **kwargs
):
9473 ScreenToClientXY(int x, int y) -> (x,y)
9475 Converts from screen to client window coordinates.
9477 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
9479 def ClientToScreen(*args
, **kwargs
):
9481 ClientToScreen(self, Point pt) -> Point
9483 Converts to screen coordinates from coordinates relative to this window.
9485 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
9487 def ScreenToClient(*args
, **kwargs
):
9489 ScreenToClient(self, Point pt) -> Point
9491 Converts from screen to client window coordinates.
9493 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
9495 def HitTestXY(*args
, **kwargs
):
9497 HitTestXY(self, int x, int y) -> int
9499 Test where the given (in client coords) point lies
9501 return _core_
.Window_HitTestXY(*args
, **kwargs
)
9503 def HitTest(*args
, **kwargs
):
9505 HitTest(self, Point pt) -> int
9507 Test where the given (in client coords) point lies
9509 return _core_
.Window_HitTest(*args
, **kwargs
)
9511 def GetBorder(*args
):
9513 GetBorder(self, long flags) -> int
9514 GetBorder(self) -> int
9516 Get border for the flags of this window
9518 return _core_
.Window_GetBorder(*args
)
9520 def UpdateWindowUI(*args
, **kwargs
):
9522 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9524 This function sends EVT_UPDATE_UI events to the window. The particular
9525 implementation depends on the window; for example a wx.ToolBar will
9526 send an update UI event for each toolbar button, and a wx.Frame will
9527 send an update UI event for each menubar menu item. You can call this
9528 function from your application to ensure that your UI is up-to-date at
9529 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9530 concerned). This may be necessary if you have called
9531 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
9532 limit the overhead that wxWindows incurs by sending update UI events
9535 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
9537 def PopupMenuXY(*args
, **kwargs
):
9539 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
9541 Pops up the given menu at the specified coordinates, relative to this window,
9542 and returns control when the user has dismissed the menu. If a menu item is
9543 selected, the corresponding menu event is generated and will be processed as
9544 usual. If the default position is given then the current position of the
9545 mouse cursor will be used.
9547 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
9549 def PopupMenu(*args
, **kwargs
):
9551 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
9553 Pops up the given menu at the specified coordinates, relative to this window,
9554 and returns control when the user has dismissed the menu. If a menu item is
9555 selected, the corresponding menu event is generated and will be processed as
9556 usual. If the default position is given then the current position of the
9557 mouse cursor will be used.
9559 return _core_
.Window_PopupMenu(*args
, **kwargs
)
9561 def GetHandle(*args
, **kwargs
):
9563 GetHandle(self) -> long
9565 Returns the platform-specific handle (as a long integer) of the
9566 physical window. Currently on wxMac it returns the handle of the
9567 toplevel parent of the window.
9569 return _core_
.Window_GetHandle(*args
, **kwargs
)
9571 def AssociateHandle(*args
, **kwargs
):
9573 AssociateHandle(self, long handle)
9575 Associate the window with a new native handle
9577 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
9579 def DissociateHandle(*args
, **kwargs
):
9581 DissociateHandle(self)
9583 Dissociate the current native handle from the window
9585 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
9587 def OnPaint(*args
, **kwargs
):
9588 """OnPaint(self, PaintEvent event)"""
9589 return _core_
.Window_OnPaint(*args
, **kwargs
)
9591 def HasScrollbar(*args
, **kwargs
):
9593 HasScrollbar(self, int orient) -> bool
9595 Does the window have the scrollbar for this orientation?
9597 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
9599 def SetScrollbar(*args
, **kwargs
):
9601 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
9604 Sets the scrollbar properties of a built-in scrollbar.
9606 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
9608 def SetScrollPos(*args
, **kwargs
):
9610 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9612 Sets the position of one of the built-in scrollbars.
9614 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
9616 def GetScrollPos(*args
, **kwargs
):
9618 GetScrollPos(self, int orientation) -> int
9620 Returns the built-in scrollbar position.
9622 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
9624 def GetScrollThumb(*args
, **kwargs
):
9626 GetScrollThumb(self, int orientation) -> int
9628 Returns the built-in scrollbar thumb size.
9630 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
9632 def GetScrollRange(*args
, **kwargs
):
9634 GetScrollRange(self, int orientation) -> int
9636 Returns the built-in scrollbar range.
9638 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
9640 def ScrollWindow(*args
, **kwargs
):
9642 ScrollWindow(self, int dx, int dy, Rect rect=None)
9644 Physically scrolls the pixels in the window and move child windows
9645 accordingly. Use this function to optimise your scrolling
9646 implementations, to minimise the area that must be redrawn. Note that
9647 it is rarely required to call this function from a user program.
9649 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
9651 def ScrollLines(*args
, **kwargs
):
9653 ScrollLines(self, int lines) -> bool
9655 If the platform and window class supports it, scrolls the window by
9656 the given number of lines down, if lines is positive, or up if lines
9657 is negative. Returns True if the window was scrolled, False if it was
9658 already on top/bottom and nothing was done.
9660 return _core_
.Window_ScrollLines(*args
, **kwargs
)
9662 def ScrollPages(*args
, **kwargs
):
9664 ScrollPages(self, int pages) -> bool
9666 If the platform and window class supports it, scrolls the window by
9667 the given number of pages down, if pages is positive, or up if pages
9668 is negative. Returns True if the window was scrolled, False if it was
9669 already on top/bottom and nothing was done.
9671 return _core_
.Window_ScrollPages(*args
, **kwargs
)
9673 def LineUp(*args
, **kwargs
):
9675 LineUp(self) -> bool
9677 This is just a wrapper for ScrollLines(-1).
9679 return _core_
.Window_LineUp(*args
, **kwargs
)
9681 def LineDown(*args
, **kwargs
):
9683 LineDown(self) -> bool
9685 This is just a wrapper for ScrollLines(1).
9687 return _core_
.Window_LineDown(*args
, **kwargs
)
9689 def PageUp(*args
, **kwargs
):
9691 PageUp(self) -> bool
9693 This is just a wrapper for ScrollPages(-1).
9695 return _core_
.Window_PageUp(*args
, **kwargs
)
9697 def PageDown(*args
, **kwargs
):
9699 PageDown(self) -> bool
9701 This is just a wrapper for ScrollPages(1).
9703 return _core_
.Window_PageDown(*args
, **kwargs
)
9705 def SetHelpText(*args
, **kwargs
):
9707 SetHelpText(self, String text)
9709 Sets the help text to be used as context-sensitive help for this
9710 window. Note that the text is actually stored by the current
9711 wxHelpProvider implementation, and not in the window object itself.
9713 return _core_
.Window_SetHelpText(*args
, **kwargs
)
9715 def SetHelpTextForId(*args
, **kwargs
):
9717 SetHelpTextForId(self, String text)
9719 Associate this help text with all windows with the same id as this
9722 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
9724 def GetHelpText(*args
, **kwargs
):
9726 GetHelpText(self) -> String
9728 Gets the help text to be used as context-sensitive help for this
9729 window. Note that the text is actually stored by the current
9730 wxHelpProvider implementation, and not in the window object itself.
9732 return _core_
.Window_GetHelpText(*args
, **kwargs
)
9734 def SetToolTipString(*args
, **kwargs
):
9736 SetToolTipString(self, String tip)
9738 Attach a tooltip to the window.
9740 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
9742 def SetToolTip(*args
, **kwargs
):
9744 SetToolTip(self, ToolTip tip)
9746 Attach a tooltip to the window.
9748 return _core_
.Window_SetToolTip(*args
, **kwargs
)
9750 def GetToolTip(*args
, **kwargs
):
9752 GetToolTip(self) -> ToolTip
9754 get the associated tooltip or None if none
9756 return _core_
.Window_GetToolTip(*args
, **kwargs
)
9758 def SetDropTarget(*args
, **kwargs
):
9760 SetDropTarget(self, DropTarget dropTarget)
9762 Associates a drop target with this window. If the window already has
9763 a drop target, it is deleted.
9765 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
9767 def GetDropTarget(*args
, **kwargs
):
9769 GetDropTarget(self) -> DropTarget
9771 Returns the associated drop target, which may be None.
9773 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
9775 def DragAcceptFiles(*args
, **kwargs
):
9777 DragAcceptFiles(self, bool accept)
9779 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9780 Only functional on Windows.
9782 return _core_
.Window_DragAcceptFiles(*args
, **kwargs
)
9784 def SetConstraints(*args
, **kwargs
):
9786 SetConstraints(self, LayoutConstraints constraints)
9788 Sets the window to have the given layout constraints. If an existing
9789 layout constraints object is already owned by the window, it will be
9790 deleted. Pass None to disassociate and delete the window's current
9793 You must call SetAutoLayout to tell a window to use the constraints
9794 automatically in its default EVT_SIZE handler; otherwise, you must
9795 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9796 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9799 return _core_
.Window_SetConstraints(*args
, **kwargs
)
9801 def GetConstraints(*args
, **kwargs
):
9803 GetConstraints(self) -> LayoutConstraints
9805 Returns a pointer to the window's layout constraints, or None if there
9808 return _core_
.Window_GetConstraints(*args
, **kwargs
)
9810 def SetAutoLayout(*args
, **kwargs
):
9812 SetAutoLayout(self, bool autoLayout)
9814 Determines whether the Layout function will be called automatically
9815 when the window is resized. It is called implicitly by SetSizer but
9816 if you use SetConstraints you should call it manually or otherwise the
9817 window layout won't be correctly updated when its size changes.
9819 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
9821 def GetAutoLayout(*args
, **kwargs
):
9823 GetAutoLayout(self) -> bool
9825 Returns the current autoLayout setting
9827 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
9829 def Layout(*args
, **kwargs
):
9831 Layout(self) -> bool
9833 Invokes the constraint-based layout algorithm or the sizer-based
9834 algorithm for this window. See SetAutoLayout: when auto layout is on,
9835 this function gets called automatically by the default EVT_SIZE
9836 handler when the window is resized.
9838 return _core_
.Window_Layout(*args
, **kwargs
)
9840 def SetSizer(*args
, **kwargs
):
9842 SetSizer(self, Sizer sizer, bool deleteOld=True)
9844 Sets the window to have the given layout sizer. The window will then
9845 own the object, and will take care of its deletion. If an existing
9846 layout sizer object is already owned by the window, it will be deleted
9847 if the deleteOld parameter is true. Note that this function will also
9848 call SetAutoLayout implicitly with a True parameter if the sizer is
9849 non-None, and False otherwise.
9851 return _core_
.Window_SetSizer(*args
, **kwargs
)
9853 def SetSizerAndFit(*args
, **kwargs
):
9855 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9857 The same as SetSizer, except it also sets the size hints for the
9858 window based on the sizer's minimum size.
9860 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
9862 def GetSizer(*args
, **kwargs
):
9864 GetSizer(self) -> Sizer
9866 Return the sizer associated with the window by a previous call to
9867 SetSizer or None if there isn't one.
9869 return _core_
.Window_GetSizer(*args
, **kwargs
)
9871 def SetContainingSizer(*args
, **kwargs
):
9873 SetContainingSizer(self, Sizer sizer)
9875 This normally does not need to be called by application code. It is
9876 called internally when a window is added to a sizer, and is used so
9877 the window can remove itself from the sizer when it is destroyed.
9879 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
9881 def GetContainingSizer(*args
, **kwargs
):
9883 GetContainingSizer(self) -> Sizer
9885 Return the sizer that this window is a member of, if any, otherwise None.
9887 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
9889 def InheritAttributes(*args
, **kwargs
):
9891 InheritAttributes(self)
9893 This function is (or should be, in case of custom controls) called
9894 during window creation to intelligently set up the window visual
9895 attributes, that is the font and the foreground and background
9898 By 'intelligently' the following is meant: by default, all windows use
9899 their own default attributes. However if some of the parent's
9900 attributes are explicitly changed (that is, using SetFont and not
9901 SetOwnFont) and if the corresponding attribute hadn't been
9902 explicitly set for this window itself, then this window takes the same
9903 value as used by the parent. In addition, if the window overrides
9904 ShouldInheritColours to return false, the colours will not be changed
9905 no matter what and only the font might.
9907 This rather complicated logic is necessary in order to accommodate the
9908 different usage scenarios. The most common one is when all default
9909 attributes are used and in this case, nothing should be inherited as
9910 in modern GUIs different controls use different fonts (and colours)
9911 than their siblings so they can't inherit the same value from the
9912 parent. However it was also deemed desirable to allow to simply change
9913 the attributes of all children at once by just changing the font or
9914 colour of their common parent, hence in this case we do inherit the
9918 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
9920 def ShouldInheritColours(*args
, **kwargs
):
9922 ShouldInheritColours(self) -> bool
9924 Return true from here to allow the colours of this window to be
9925 changed by InheritAttributes, returning false forbids inheriting them
9926 from the parent window.
9928 The base class version returns false, but this method is overridden in
9929 wxControl where it returns true.
9931 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
9933 def PostCreate(self
, pre
):
9935 Phase 3 of the 2-phase create <wink!>
9936 Call this method after precreating the window with the 2-phase create method.
9938 self
.this
= pre
.this
9939 self
.thisown
= pre
.thisown
9941 if hasattr(self
, '_setOORInfo'):
9942 self
._setOORInfo
(self
)
9943 if hasattr(self
, '_setCallbackInfo'):
9944 self
._setCallbackInfo
(self
, self
.__class
__)
9947 class WindowPtr(Window
):
9948 def __init__(self
, this
):
9950 if not hasattr(self
,"thisown"): self
.thisown
= 0
9951 self
.__class
__ = Window
9952 _core_
.Window_swigregister(WindowPtr
)
9954 def PreWindow(*args
, **kwargs
):
9956 PreWindow() -> Window
9958 Precreate a Window for 2-phase creation.
9960 val
= _core_
.new_PreWindow(*args
, **kwargs
)
9964 def Window_NewControlId(*args
, **kwargs
):
9966 Window_NewControlId() -> int
9968 Generate a control id for the controls which were not given one.
9970 return _core_
.Window_NewControlId(*args
, **kwargs
)
9972 def Window_NextControlId(*args
, **kwargs
):
9974 Window_NextControlId(int winid) -> int
9976 Get the id of the control following the one with the given
9979 return _core_
.Window_NextControlId(*args
, **kwargs
)
9981 def Window_PrevControlId(*args
, **kwargs
):
9983 Window_PrevControlId(int winid) -> int
9985 Get the id of the control preceding the one with the given
9988 return _core_
.Window_PrevControlId(*args
, **kwargs
)
9990 def Window_FindFocus(*args
, **kwargs
):
9992 Window_FindFocus() -> Window
9994 Returns the window or control that currently has the keyboard focus,
9997 return _core_
.Window_FindFocus(*args
, **kwargs
)
9999 def Window_GetCapture(*args
, **kwargs
):
10001 Window_GetCapture() -> Window
10003 Returns the window which currently captures the mouse or None
10005 return _core_
.Window_GetCapture(*args
, **kwargs
)
10007 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
10009 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10011 Get the default attributes for this class. This is useful if you want
10012 to use the same font or colour in your own control as in a standard
10013 control -- which is a much better idea than hard coding specific
10014 colours or fonts which might look completely out of place on the
10015 user's system, especially if it uses themes.
10017 The variant parameter is only relevant under Mac currently and is
10018 ignore under other platforms. Under Mac, it will change the size of
10019 the returned font. See `wx.Window.SetWindowVariant` for more about
10022 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
10024 def DLG_PNT(win
, point_or_x
, y
=None):
10026 Convenience function for converting a Point or (x,y) in
10027 dialog units to pixel units.
10030 return win
.ConvertDialogPointToPixels(point_or_x
)
10032 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
10034 def DLG_SZE(win
, size_width
, height
=None):
10036 Convenience function for converting a Size or (w,h) in
10037 dialog units to pixel units.
10040 return win
.ConvertDialogSizeToPixels(size_width
)
10042 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
10045 def FindWindowById(*args
, **kwargs
):
10047 FindWindowById(long id, Window parent=None) -> Window
10049 Find the first window in the application with the given id. If parent
10050 is None, the search will start from all top-level frames and dialog
10051 boxes; if non-None, the search will be limited to the given window
10052 hierarchy. The search is recursive in both cases.
10054 return _core_
.FindWindowById(*args
, **kwargs
)
10056 def FindWindowByName(*args
, **kwargs
):
10058 FindWindowByName(String name, Window parent=None) -> Window
10060 Find a window by its name (as given in a window constructor or Create
10061 function call). If parent is None, the search will start from all
10062 top-level frames and dialog boxes; if non-None, the search will be
10063 limited to the given window hierarchy. The search is recursive in both
10066 If no window with such name is found, wx.FindWindowByLabel is called.
10068 return _core_
.FindWindowByName(*args
, **kwargs
)
10070 def FindWindowByLabel(*args
, **kwargs
):
10072 FindWindowByLabel(String label, Window parent=None) -> Window
10074 Find a window by its label. Depending on the type of window, the label
10075 may be a window title or panel item label. If parent is None, the
10076 search will start from all top-level frames and dialog boxes; if
10077 non-None, the search will be limited to the given window
10078 hierarchy. The search is recursive in both cases.
10080 return _core_
.FindWindowByLabel(*args
, **kwargs
)
10082 def Window_FromHWND(*args
, **kwargs
):
10083 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10084 return _core_
.Window_FromHWND(*args
, **kwargs
)
10086 def GetTopLevelWindows(*args
, **kwargs
):
10088 GetTopLevelWindows() -> PyObject
10090 Returns a list of the the application's top-level windows, (frames,
10091 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10092 by wxWidgets, and so it is only valid as long as no top-level windows
10093 are closed or new top-level windows are created.
10096 return _core_
.GetTopLevelWindows(*args
, **kwargs
)
10097 #---------------------------------------------------------------------------
10099 class Validator(EvtHandler
):
10100 """Proxy of C++ Validator class"""
10101 def __repr__(self
):
10102 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10103 def __init__(self
, *args
, **kwargs
):
10104 """__init__(self) -> Validator"""
10105 newobj
= _core_
.new_Validator(*args
, **kwargs
)
10106 self
.this
= newobj
.this
10109 self
._setOORInfo
(self
)
10111 def Clone(*args
, **kwargs
):
10112 """Clone(self) -> Validator"""
10113 return _core_
.Validator_Clone(*args
, **kwargs
)
10115 def Validate(*args
, **kwargs
):
10116 """Validate(self, Window parent) -> bool"""
10117 return _core_
.Validator_Validate(*args
, **kwargs
)
10119 def TransferToWindow(*args
, **kwargs
):
10120 """TransferToWindow(self) -> bool"""
10121 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
10123 def TransferFromWindow(*args
, **kwargs
):
10124 """TransferFromWindow(self) -> bool"""
10125 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
10127 def GetWindow(*args
, **kwargs
):
10128 """GetWindow(self) -> Window"""
10129 return _core_
.Validator_GetWindow(*args
, **kwargs
)
10131 def SetWindow(*args
, **kwargs
):
10132 """SetWindow(self, Window window)"""
10133 return _core_
.Validator_SetWindow(*args
, **kwargs
)
10135 def IsSilent(*args
, **kwargs
):
10136 """IsSilent() -> bool"""
10137 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10139 IsSilent
= staticmethod(IsSilent
)
10140 def SetBellOnError(*args
, **kwargs
):
10141 """SetBellOnError(int doIt=True)"""
10142 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10144 SetBellOnError
= staticmethod(SetBellOnError
)
10146 class ValidatorPtr(Validator
):
10147 def __init__(self
, this
):
10149 if not hasattr(self
,"thisown"): self
.thisown
= 0
10150 self
.__class
__ = Validator
10151 _core_
.Validator_swigregister(ValidatorPtr
)
10153 def Validator_IsSilent(*args
, **kwargs
):
10154 """Validator_IsSilent() -> bool"""
10155 return _core_
.Validator_IsSilent(*args
, **kwargs
)
10157 def Validator_SetBellOnError(*args
, **kwargs
):
10158 """Validator_SetBellOnError(int doIt=True)"""
10159 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
10161 class PyValidator(Validator
):
10162 """Proxy of C++ PyValidator class"""
10163 def __repr__(self
):
10164 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10165 def __init__(self
, *args
, **kwargs
):
10166 """__init__(self) -> PyValidator"""
10167 newobj
= _core_
.new_PyValidator(*args
, **kwargs
)
10168 self
.this
= newobj
.this
10172 self
._setCallbackInfo
(self
, PyValidator
, 1)
10173 self
._setOORInfo
(self
)
10175 def _setCallbackInfo(*args
, **kwargs
):
10176 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10177 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
10180 class PyValidatorPtr(PyValidator
):
10181 def __init__(self
, this
):
10183 if not hasattr(self
,"thisown"): self
.thisown
= 0
10184 self
.__class
__ = PyValidator
10185 _core_
.PyValidator_swigregister(PyValidatorPtr
)
10187 #---------------------------------------------------------------------------
10189 class Menu(EvtHandler
):
10190 """Proxy of C++ Menu class"""
10191 def __repr__(self
):
10192 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10193 def __init__(self
, *args
, **kwargs
):
10194 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10195 newobj
= _core_
.new_Menu(*args
, **kwargs
)
10196 self
.this
= newobj
.this
10199 self
._setOORInfo
(self
)
10201 def Append(*args
, **kwargs
):
10202 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10203 return _core_
.Menu_Append(*args
, **kwargs
)
10205 def AppendSeparator(*args
, **kwargs
):
10206 """AppendSeparator(self) -> MenuItem"""
10207 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
10209 def AppendCheckItem(*args
, **kwargs
):
10210 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10211 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
10213 def AppendRadioItem(*args
, **kwargs
):
10214 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10215 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
10217 def AppendMenu(*args
, **kwargs
):
10218 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10219 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
10221 def AppendItem(*args
, **kwargs
):
10222 """AppendItem(self, MenuItem item) -> MenuItem"""
10223 return _core_
.Menu_AppendItem(*args
, **kwargs
)
10225 def Break(*args
, **kwargs
):
10227 return _core_
.Menu_Break(*args
, **kwargs
)
10229 def InsertItem(*args
, **kwargs
):
10230 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10231 return _core_
.Menu_InsertItem(*args
, **kwargs
)
10233 def Insert(*args
, **kwargs
):
10235 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10236 int kind=ITEM_NORMAL) -> MenuItem
10238 return _core_
.Menu_Insert(*args
, **kwargs
)
10240 def InsertSeparator(*args
, **kwargs
):
10241 """InsertSeparator(self, size_t pos) -> MenuItem"""
10242 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
10244 def InsertCheckItem(*args
, **kwargs
):
10245 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10246 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
10248 def InsertRadioItem(*args
, **kwargs
):
10249 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10250 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
10252 def InsertMenu(*args
, **kwargs
):
10253 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10254 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
10256 def PrependItem(*args
, **kwargs
):
10257 """PrependItem(self, MenuItem item) -> MenuItem"""
10258 return _core_
.Menu_PrependItem(*args
, **kwargs
)
10260 def Prepend(*args
, **kwargs
):
10261 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10262 return _core_
.Menu_Prepend(*args
, **kwargs
)
10264 def PrependSeparator(*args
, **kwargs
):
10265 """PrependSeparator(self) -> MenuItem"""
10266 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
10268 def PrependCheckItem(*args
, **kwargs
):
10269 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10270 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
10272 def PrependRadioItem(*args
, **kwargs
):
10273 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10274 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
10276 def PrependMenu(*args
, **kwargs
):
10277 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10278 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
10280 def Remove(*args
, **kwargs
):
10281 """Remove(self, int id) -> MenuItem"""
10282 return _core_
.Menu_Remove(*args
, **kwargs
)
10284 def RemoveItem(*args
, **kwargs
):
10285 """RemoveItem(self, MenuItem item) -> MenuItem"""
10286 return _core_
.Menu_RemoveItem(*args
, **kwargs
)
10288 def Delete(*args
, **kwargs
):
10289 """Delete(self, int id) -> bool"""
10290 return _core_
.Menu_Delete(*args
, **kwargs
)
10292 def DeleteItem(*args
, **kwargs
):
10293 """DeleteItem(self, MenuItem item) -> bool"""
10294 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
10296 def Destroy(*args
, **kwargs
):
10300 Deletes the C++ object this Python object is a proxy for.
10302 return _core_
.Menu_Destroy(*args
, **kwargs
)
10304 def DestroyId(*args
, **kwargs
):
10306 DestroyId(self, int id) -> bool
10308 Deletes the C++ object this Python object is a proxy for.
10310 return _core_
.Menu_DestroyId(*args
, **kwargs
)
10312 def DestroyItem(*args
, **kwargs
):
10314 DestroyItem(self, MenuItem item) -> bool
10316 Deletes the C++ object this Python object is a proxy for.
10318 return _core_
.Menu_DestroyItem(*args
, **kwargs
)
10320 def GetMenuItemCount(*args
, **kwargs
):
10321 """GetMenuItemCount(self) -> size_t"""
10322 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
10324 def GetMenuItems(*args
, **kwargs
):
10325 """GetMenuItems(self) -> PyObject"""
10326 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
10328 def FindItem(*args
, **kwargs
):
10329 """FindItem(self, String item) -> int"""
10330 return _core_
.Menu_FindItem(*args
, **kwargs
)
10332 def FindItemById(*args
, **kwargs
):
10333 """FindItemById(self, int id) -> MenuItem"""
10334 return _core_
.Menu_FindItemById(*args
, **kwargs
)
10336 def FindItemByPosition(*args
, **kwargs
):
10337 """FindItemByPosition(self, size_t position) -> MenuItem"""
10338 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
10340 def Enable(*args
, **kwargs
):
10341 """Enable(self, int id, bool enable)"""
10342 return _core_
.Menu_Enable(*args
, **kwargs
)
10344 def IsEnabled(*args
, **kwargs
):
10345 """IsEnabled(self, int id) -> bool"""
10346 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
10348 def Check(*args
, **kwargs
):
10349 """Check(self, int id, bool check)"""
10350 return _core_
.Menu_Check(*args
, **kwargs
)
10352 def IsChecked(*args
, **kwargs
):
10353 """IsChecked(self, int id) -> bool"""
10354 return _core_
.Menu_IsChecked(*args
, **kwargs
)
10356 def SetLabel(*args
, **kwargs
):
10357 """SetLabel(self, int id, String label)"""
10358 return _core_
.Menu_SetLabel(*args
, **kwargs
)
10360 def GetLabel(*args
, **kwargs
):
10361 """GetLabel(self, int id) -> String"""
10362 return _core_
.Menu_GetLabel(*args
, **kwargs
)
10364 def SetHelpString(*args
, **kwargs
):
10365 """SetHelpString(self, int id, String helpString)"""
10366 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
10368 def GetHelpString(*args
, **kwargs
):
10369 """GetHelpString(self, int id) -> String"""
10370 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
10372 def SetTitle(*args
, **kwargs
):
10373 """SetTitle(self, String title)"""
10374 return _core_
.Menu_SetTitle(*args
, **kwargs
)
10376 def GetTitle(*args
, **kwargs
):
10377 """GetTitle(self) -> String"""
10378 return _core_
.Menu_GetTitle(*args
, **kwargs
)
10380 def SetEventHandler(*args
, **kwargs
):
10381 """SetEventHandler(self, EvtHandler handler)"""
10382 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
10384 def GetEventHandler(*args
, **kwargs
):
10385 """GetEventHandler(self) -> EvtHandler"""
10386 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
10388 def SetInvokingWindow(*args
, **kwargs
):
10389 """SetInvokingWindow(self, Window win)"""
10390 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
10392 def GetInvokingWindow(*args
, **kwargs
):
10393 """GetInvokingWindow(self) -> Window"""
10394 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
10396 def GetStyle(*args
, **kwargs
):
10397 """GetStyle(self) -> long"""
10398 return _core_
.Menu_GetStyle(*args
, **kwargs
)
10400 def UpdateUI(*args
, **kwargs
):
10401 """UpdateUI(self, EvtHandler source=None)"""
10402 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
10404 def GetMenuBar(*args
, **kwargs
):
10405 """GetMenuBar(self) -> MenuBar"""
10406 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
10408 def Attach(*args
, **kwargs
):
10409 """Attach(self, wxMenuBarBase menubar)"""
10410 return _core_
.Menu_Attach(*args
, **kwargs
)
10412 def Detach(*args
, **kwargs
):
10414 return _core_
.Menu_Detach(*args
, **kwargs
)
10416 def IsAttached(*args
, **kwargs
):
10417 """IsAttached(self) -> bool"""
10418 return _core_
.Menu_IsAttached(*args
, **kwargs
)
10420 def SetParent(*args
, **kwargs
):
10421 """SetParent(self, Menu parent)"""
10422 return _core_
.Menu_SetParent(*args
, **kwargs
)
10424 def GetParent(*args
, **kwargs
):
10425 """GetParent(self) -> Menu"""
10426 return _core_
.Menu_GetParent(*args
, **kwargs
)
10429 class MenuPtr(Menu
):
10430 def __init__(self
, this
):
10432 if not hasattr(self
,"thisown"): self
.thisown
= 0
10433 self
.__class
__ = Menu
10434 _core_
.Menu_swigregister(MenuPtr
)
10435 DefaultValidator
= cvar
.DefaultValidator
10437 #---------------------------------------------------------------------------
10439 class MenuBar(Window
):
10440 """Proxy of C++ MenuBar class"""
10441 def __repr__(self
):
10442 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10443 def __init__(self
, *args
, **kwargs
):
10444 """__init__(self, long style=0) -> MenuBar"""
10445 newobj
= _core_
.new_MenuBar(*args
, **kwargs
)
10446 self
.this
= newobj
.this
10449 self
._setOORInfo
(self
)
10451 def Append(*args
, **kwargs
):
10452 """Append(self, Menu menu, String title) -> bool"""
10453 return _core_
.MenuBar_Append(*args
, **kwargs
)
10455 def Insert(*args
, **kwargs
):
10456 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10457 return _core_
.MenuBar_Insert(*args
, **kwargs
)
10459 def GetMenuCount(*args
, **kwargs
):
10460 """GetMenuCount(self) -> size_t"""
10461 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
10463 def GetMenu(*args
, **kwargs
):
10464 """GetMenu(self, size_t pos) -> Menu"""
10465 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
10467 def Replace(*args
, **kwargs
):
10468 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10469 return _core_
.MenuBar_Replace(*args
, **kwargs
)
10471 def Remove(*args
, **kwargs
):
10472 """Remove(self, size_t pos) -> Menu"""
10473 return _core_
.MenuBar_Remove(*args
, **kwargs
)
10475 def EnableTop(*args
, **kwargs
):
10476 """EnableTop(self, size_t pos, bool enable)"""
10477 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
10479 def IsEnabledTop(*args
, **kwargs
):
10480 """IsEnabledTop(self, size_t pos) -> bool"""
10481 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
10483 def SetLabelTop(*args
, **kwargs
):
10484 """SetLabelTop(self, size_t pos, String label)"""
10485 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
10487 def GetLabelTop(*args
, **kwargs
):
10488 """GetLabelTop(self, size_t pos) -> String"""
10489 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
10491 def FindMenuItem(*args
, **kwargs
):
10492 """FindMenuItem(self, String menu, String item) -> int"""
10493 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
10495 def FindItemById(*args
, **kwargs
):
10496 """FindItemById(self, int id) -> MenuItem"""
10497 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
10499 def FindMenu(*args
, **kwargs
):
10500 """FindMenu(self, String title) -> int"""
10501 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
10503 def Enable(*args
, **kwargs
):
10504 """Enable(self, int id, bool enable)"""
10505 return _core_
.MenuBar_Enable(*args
, **kwargs
)
10507 def Check(*args
, **kwargs
):
10508 """Check(self, int id, bool check)"""
10509 return _core_
.MenuBar_Check(*args
, **kwargs
)
10511 def IsChecked(*args
, **kwargs
):
10512 """IsChecked(self, int id) -> bool"""
10513 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
10515 def IsEnabled(*args
, **kwargs
):
10516 """IsEnabled(self, int id) -> bool"""
10517 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
10519 def SetLabel(*args
, **kwargs
):
10520 """SetLabel(self, int id, String label)"""
10521 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
10523 def GetLabel(*args
, **kwargs
):
10524 """GetLabel(self, int id) -> String"""
10525 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
10527 def SetHelpString(*args
, **kwargs
):
10528 """SetHelpString(self, int id, String helpString)"""
10529 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
10531 def GetHelpString(*args
, **kwargs
):
10532 """GetHelpString(self, int id) -> String"""
10533 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
10535 def GetFrame(*args
, **kwargs
):
10536 """GetFrame(self) -> wxFrame"""
10537 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
10539 def IsAttached(*args
, **kwargs
):
10540 """IsAttached(self) -> bool"""
10541 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
10543 def Attach(*args
, **kwargs
):
10544 """Attach(self, wxFrame frame)"""
10545 return _core_
.MenuBar_Attach(*args
, **kwargs
)
10547 def Detach(*args
, **kwargs
):
10549 return _core_
.MenuBar_Detach(*args
, **kwargs
)
10552 class MenuBarPtr(MenuBar
):
10553 def __init__(self
, this
):
10555 if not hasattr(self
,"thisown"): self
.thisown
= 0
10556 self
.__class
__ = MenuBar
10557 _core_
.MenuBar_swigregister(MenuBarPtr
)
10559 #---------------------------------------------------------------------------
10561 class MenuItem(Object
):
10562 """Proxy of C++ MenuItem class"""
10563 def __repr__(self
):
10564 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10565 def __init__(self
, *args
, **kwargs
):
10567 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10568 String help=EmptyString, int kind=ITEM_NORMAL,
10569 Menu subMenu=None) -> MenuItem
10571 newobj
= _core_
.new_MenuItem(*args
, **kwargs
)
10572 self
.this
= newobj
.this
10575 def GetMenu(*args
, **kwargs
):
10576 """GetMenu(self) -> Menu"""
10577 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
10579 def SetMenu(*args
, **kwargs
):
10580 """SetMenu(self, Menu menu)"""
10581 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
10583 def SetId(*args
, **kwargs
):
10584 """SetId(self, int id)"""
10585 return _core_
.MenuItem_SetId(*args
, **kwargs
)
10587 def GetId(*args
, **kwargs
):
10588 """GetId(self) -> int"""
10589 return _core_
.MenuItem_GetId(*args
, **kwargs
)
10591 def IsSeparator(*args
, **kwargs
):
10592 """IsSeparator(self) -> bool"""
10593 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
10595 def SetText(*args
, **kwargs
):
10596 """SetText(self, String str)"""
10597 return _core_
.MenuItem_SetText(*args
, **kwargs
)
10599 def GetLabel(*args
, **kwargs
):
10600 """GetLabel(self) -> String"""
10601 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
10603 def GetText(*args
, **kwargs
):
10604 """GetText(self) -> String"""
10605 return _core_
.MenuItem_GetText(*args
, **kwargs
)
10607 def GetLabelFromText(*args
, **kwargs
):
10608 """GetLabelFromText(String text) -> String"""
10609 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10611 GetLabelFromText
= staticmethod(GetLabelFromText
)
10612 def GetKind(*args
, **kwargs
):
10613 """GetKind(self) -> int"""
10614 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
10616 def SetKind(*args
, **kwargs
):
10617 """SetKind(self, int kind)"""
10618 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
10620 def SetCheckable(*args
, **kwargs
):
10621 """SetCheckable(self, bool checkable)"""
10622 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
10624 def IsCheckable(*args
, **kwargs
):
10625 """IsCheckable(self) -> bool"""
10626 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
10628 def IsSubMenu(*args
, **kwargs
):
10629 """IsSubMenu(self) -> bool"""
10630 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
10632 def SetSubMenu(*args
, **kwargs
):
10633 """SetSubMenu(self, Menu menu)"""
10634 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
10636 def GetSubMenu(*args
, **kwargs
):
10637 """GetSubMenu(self) -> Menu"""
10638 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
10640 def Enable(*args
, **kwargs
):
10641 """Enable(self, bool enable=True)"""
10642 return _core_
.MenuItem_Enable(*args
, **kwargs
)
10644 def IsEnabled(*args
, **kwargs
):
10645 """IsEnabled(self) -> bool"""
10646 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
10648 def Check(*args
, **kwargs
):
10649 """Check(self, bool check=True)"""
10650 return _core_
.MenuItem_Check(*args
, **kwargs
)
10652 def IsChecked(*args
, **kwargs
):
10653 """IsChecked(self) -> bool"""
10654 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
10656 def Toggle(*args
, **kwargs
):
10658 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
10660 def SetHelp(*args
, **kwargs
):
10661 """SetHelp(self, String str)"""
10662 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
10664 def GetHelp(*args
, **kwargs
):
10665 """GetHelp(self) -> String"""
10666 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
10668 def GetAccel(*args
, **kwargs
):
10669 """GetAccel(self) -> AcceleratorEntry"""
10670 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
10672 def SetAccel(*args
, **kwargs
):
10673 """SetAccel(self, AcceleratorEntry accel)"""
10674 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
10676 def SetFont(*args
, **kwargs
):
10677 """SetFont(self, Font font)"""
10678 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
10680 def GetFont(*args
, **kwargs
):
10681 """GetFont(self) -> Font"""
10682 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
10684 def SetTextColour(*args
, **kwargs
):
10685 """SetTextColour(self, Colour colText)"""
10686 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
10688 def GetTextColour(*args
, **kwargs
):
10689 """GetTextColour(self) -> Colour"""
10690 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
10692 def SetBackgroundColour(*args
, **kwargs
):
10693 """SetBackgroundColour(self, Colour colBack)"""
10694 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
10696 def GetBackgroundColour(*args
, **kwargs
):
10697 """GetBackgroundColour(self) -> Colour"""
10698 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
10700 def SetBitmaps(*args
, **kwargs
):
10701 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10702 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
10704 def SetDisabledBitmap(*args
, **kwargs
):
10705 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10706 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
10708 def GetDisabledBitmap(*args
, **kwargs
):
10709 """GetDisabledBitmap(self) -> Bitmap"""
10710 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
10712 def SetMarginWidth(*args
, **kwargs
):
10713 """SetMarginWidth(self, int nWidth)"""
10714 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
10716 def GetMarginWidth(*args
, **kwargs
):
10717 """GetMarginWidth(self) -> int"""
10718 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
10720 def GetDefaultMarginWidth(*args
, **kwargs
):
10721 """GetDefaultMarginWidth() -> int"""
10722 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10724 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
10725 def IsOwnerDrawn(*args
, **kwargs
):
10726 """IsOwnerDrawn(self) -> bool"""
10727 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
10729 def SetOwnerDrawn(*args
, **kwargs
):
10730 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10731 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
10733 def ResetOwnerDrawn(*args
, **kwargs
):
10734 """ResetOwnerDrawn(self)"""
10735 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
10737 def SetBitmap(*args
, **kwargs
):
10738 """SetBitmap(self, Bitmap bitmap)"""
10739 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
10741 def GetBitmap(*args
, **kwargs
):
10742 """GetBitmap(self) -> Bitmap"""
10743 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
10746 class MenuItemPtr(MenuItem
):
10747 def __init__(self
, this
):
10749 if not hasattr(self
,"thisown"): self
.thisown
= 0
10750 self
.__class
__ = MenuItem
10751 _core_
.MenuItem_swigregister(MenuItemPtr
)
10753 def MenuItem_GetLabelFromText(*args
, **kwargs
):
10754 """MenuItem_GetLabelFromText(String text) -> String"""
10755 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
10757 def MenuItem_GetDefaultMarginWidth(*args
, **kwargs
):
10758 """MenuItem_GetDefaultMarginWidth() -> int"""
10759 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
10761 #---------------------------------------------------------------------------
10763 class Control(Window
):
10765 This is the base class for a control or 'widget'.
10767 A control is generally a small window which processes user input
10768 and/or displays one or more item of data.
10770 def __repr__(self
):
10771 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10772 def __init__(self
, *args
, **kwargs
):
10774 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10775 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10776 String name=ControlNameStr) -> Control
10778 Create a Control. Normally you should only call this from a subclass'
10779 __init__ as a plain old wx.Control is not very useful.
10781 newobj
= _core_
.new_Control(*args
, **kwargs
)
10782 self
.this
= newobj
.this
10785 self
._setOORInfo
(self
)
10787 def Create(*args
, **kwargs
):
10789 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10790 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10791 String name=ControlNameStr) -> bool
10793 Do the 2nd phase and create the GUI control.
10795 return _core_
.Control_Create(*args
, **kwargs
)
10797 def Command(*args
, **kwargs
):
10799 Command(self, CommandEvent event)
10801 Simulates the effect of the user issuing a command to the item.
10803 :see: `wx.CommandEvent`
10806 return _core_
.Control_Command(*args
, **kwargs
)
10808 def GetLabel(*args
, **kwargs
):
10810 GetLabel(self) -> String
10812 Return a control's text.
10814 return _core_
.Control_GetLabel(*args
, **kwargs
)
10816 def SetLabel(*args
, **kwargs
):
10818 SetLabel(self, String label)
10820 Sets the item's text.
10822 return _core_
.Control_SetLabel(*args
, **kwargs
)
10824 def GetClassDefaultAttributes(*args
, **kwargs
):
10826 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10828 Get the default attributes for this class. This is useful if you want
10829 to use the same font or colour in your own control as in a standard
10830 control -- which is a much better idea than hard coding specific
10831 colours or fonts which might look completely out of place on the
10832 user's system, especially if it uses themes.
10834 The variant parameter is only relevant under Mac currently and is
10835 ignore under other platforms. Under Mac, it will change the size of
10836 the returned font. See `wx.Window.SetWindowVariant` for more about
10839 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10841 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
10843 class ControlPtr(Control
):
10844 def __init__(self
, this
):
10846 if not hasattr(self
,"thisown"): self
.thisown
= 0
10847 self
.__class
__ = Control
10848 _core_
.Control_swigregister(ControlPtr
)
10849 ControlNameStr
= cvar
.ControlNameStr
10851 def PreControl(*args
, **kwargs
):
10853 PreControl() -> Control
10855 Precreate a Control control for 2-phase creation
10857 val
= _core_
.new_PreControl(*args
, **kwargs
)
10861 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
10863 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10865 Get the default attributes for this class. This is useful if you want
10866 to use the same font or colour in your own control as in a standard
10867 control -- which is a much better idea than hard coding specific
10868 colours or fonts which might look completely out of place on the
10869 user's system, especially if it uses themes.
10871 The variant parameter is only relevant under Mac currently and is
10872 ignore under other platforms. Under Mac, it will change the size of
10873 the returned font. See `wx.Window.SetWindowVariant` for more about
10876 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
10878 #---------------------------------------------------------------------------
10880 class ItemContainer(object):
10882 The wx.ItemContainer class defines an interface which is implemented
10883 by all controls which have string subitems, each of which may be
10884 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10885 as `wx.ComboBox` which implements an extended interface deriving from
10888 It defines the methods for accessing the control's items and although
10889 each of the derived classes implements them differently, they still
10890 all conform to the same interface.
10892 The items in a wx.ItemContainer have (non empty) string labels and,
10893 optionally, client data associated with them.
10896 def __init__(self
): raise RuntimeError, "No constructor defined"
10897 def __repr__(self
):
10898 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10899 def Append(*args
, **kwargs
):
10901 Append(self, String item, PyObject clientData=None) -> int
10903 Adds the item to the control, associating the given data with the item
10904 if not None. The return value is the index of the newly added item
10905 which may be different from the last one if the control is sorted (e.g.
10906 has wx.LB_SORT or wx.CB_SORT style).
10908 return _core_
.ItemContainer_Append(*args
, **kwargs
)
10910 def AppendItems(*args
, **kwargs
):
10912 AppendItems(self, List strings)
10914 Apend several items at once to the control. Notice that calling this
10915 method may be much faster than appending the items one by one if you
10916 need to add a lot of items.
10918 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
10920 def Insert(*args
, **kwargs
):
10922 Insert(self, String item, int pos, PyObject clientData=None) -> int
10924 Insert an item into the control before the item at the ``pos`` index,
10925 optionally associating some data object with the item.
10927 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
10929 def Clear(*args
, **kwargs
):
10933 Removes all items from the control.
10935 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
10937 def Delete(*args
, **kwargs
):
10939 Delete(self, int n)
10941 Deletes the item at the zero-based index 'n' from the control. Note
10942 that it is an error (signalled by a `wx.PyAssertionError` exception if
10943 enabled) to remove an item with the index negative or greater or equal
10944 than the number of items in the control.
10946 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
10948 def GetClientData(*args
, **kwargs
):
10950 GetClientData(self, int n) -> PyObject
10952 Returns the client data associated with the given item, (if any.)
10954 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
10956 def SetClientData(*args
, **kwargs
):
10958 SetClientData(self, int n, PyObject clientData)
10960 Associate the given client data with the item at position n.
10962 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
10964 def GetCount(*args
, **kwargs
):
10966 GetCount(self) -> int
10968 Returns the number of items in the control.
10970 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
10972 def IsEmpty(*args
, **kwargs
):
10974 IsEmpty(self) -> bool
10976 Returns True if the control is empty or False if it has some items.
10978 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
10980 def GetString(*args
, **kwargs
):
10982 GetString(self, int n) -> String
10984 Returns the label of the item with the given index.
10986 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
10988 def GetStrings(*args
, **kwargs
):
10989 """GetStrings(self) -> wxArrayString"""
10990 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
10992 def SetString(*args
, **kwargs
):
10994 SetString(self, int n, String s)
10996 Sets the label for the given item.
10998 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
11000 def FindString(*args
, **kwargs
):
11002 FindString(self, String s) -> int
11004 Finds an item whose label matches the given string. Returns the
11005 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11008 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
11010 def SetSelection(*args
, **kwargs
):
11012 SetSelection(self, int n)
11014 Sets the item at index 'n' to be the selected item.
11016 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
11018 def GetSelection(*args
, **kwargs
):
11020 GetSelection(self) -> int
11022 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11025 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
11027 def SetStringSelection(*args
, **kwargs
):
11028 """SetStringSelection(self, String s) -> bool"""
11029 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
11031 def GetStringSelection(*args
, **kwargs
):
11033 GetStringSelection(self) -> String
11035 Returns the label of the selected item or an empty string if no item
11038 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
11040 def Select(*args
, **kwargs
):
11042 Select(self, int n)
11044 This is the same as `SetSelection` and exists only because it is
11045 slightly more natural for controls which support multiple selection.
11047 return _core_
.ItemContainer_Select(*args
, **kwargs
)
11050 class ItemContainerPtr(ItemContainer
):
11051 def __init__(self
, this
):
11053 if not hasattr(self
,"thisown"): self
.thisown
= 0
11054 self
.__class
__ = ItemContainer
11055 _core_
.ItemContainer_swigregister(ItemContainerPtr
)
11057 #---------------------------------------------------------------------------
11059 class ControlWithItems(Control
,ItemContainer
):
11061 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11062 wx.Control class, and is used for the base class of various controls
11065 def __init__(self
): raise RuntimeError, "No constructor defined"
11066 def __repr__(self
):
11067 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11069 class ControlWithItemsPtr(ControlWithItems
):
11070 def __init__(self
, this
):
11072 if not hasattr(self
,"thisown"): self
.thisown
= 0
11073 self
.__class
__ = ControlWithItems
11074 _core_
.ControlWithItems_swigregister(ControlWithItemsPtr
)
11076 #---------------------------------------------------------------------------
11078 class SizerItem(Object
):
11080 The wx.SizerItem class is used to track the position, size and other
11081 attributes of each item managed by a `wx.Sizer`. In normal usage user
11082 code should never need to deal directly with a wx.SizerItem, but
11083 custom classes derived from `wx.PySizer` will probably need to use the
11084 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11086 :see: `wx.Sizer`, `wx.GBSizerItem`
11088 def __repr__(self
):
11089 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11090 def __init__(self
, *args
, **kwargs
):
11092 __init__(self) -> SizerItem
11094 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11095 size will need to be set before this item can be used in a Sizer.
11097 You will probably never need to create a wx.SizerItem directly as they
11098 are created automatically when the sizer's Add, Insert or Prepend
11099 methods are called.
11101 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11103 newobj
= _core_
.new_SizerItem(*args
, **kwargs
)
11104 self
.this
= newobj
.this
11107 def DeleteWindows(*args
, **kwargs
):
11109 DeleteWindows(self)
11111 Destroy the window or the windows in a subsizer, depending on the type
11114 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
11116 def DetachSizer(*args
, **kwargs
):
11120 Enable deleting the SizerItem without destroying the contained sizer.
11122 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
11124 def GetSize(*args
, **kwargs
):
11126 GetSize(self) -> Size
11128 Get the current size of the item, as set in the last Layout.
11130 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
11132 def CalcMin(*args
, **kwargs
):
11134 CalcMin(self) -> Size
11136 Calculates the minimum desired size for the item, including any space
11139 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
11141 def SetDimension(*args
, **kwargs
):
11143 SetDimension(self, Point pos, Size size)
11145 Set the position and size of the space allocated for this item by the
11146 sizer, and adjust the position and size of the item (window or
11147 subsizer) to be within that space taking alignment and borders into
11150 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
11152 def GetMinSize(*args
, **kwargs
):
11154 GetMinSize(self) -> Size
11156 Get the minimum size needed for the item.
11158 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
11160 def GetMinSizeWithBorder(*args
, **kwargs
):
11162 GetMinSizeWithBorder(self) -> Size
11164 Get the minimum size needed for the item with space for the borders
11167 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
11169 def SetInitSize(*args
, **kwargs
):
11170 """SetInitSize(self, int x, int y)"""
11171 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
11173 def SetRatioWH(*args
, **kwargs
):
11175 SetRatioWH(self, int width, int height)
11177 Set the ratio item attribute.
11179 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
11181 def SetRatioSize(*args
, **kwargs
):
11183 SetRatioSize(self, Size size)
11185 Set the ratio item attribute.
11187 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
11189 def SetRatio(*args
, **kwargs
):
11191 SetRatio(self, float ratio)
11193 Set the ratio item attribute.
11195 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
11197 def GetRatio(*args
, **kwargs
):
11199 GetRatio(self) -> float
11201 Set the ratio item attribute.
11203 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
11205 def GetRect(*args
, **kwargs
):
11207 GetRect(self) -> Rect
11209 Returns the rectangle that the sizer item should occupy
11211 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
11213 def IsWindow(*args
, **kwargs
):
11215 IsWindow(self) -> bool
11217 Is this sizer item a window?
11219 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
11221 def IsSizer(*args
, **kwargs
):
11223 IsSizer(self) -> bool
11225 Is this sizer item a subsizer?
11227 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
11229 def IsSpacer(*args
, **kwargs
):
11231 IsSpacer(self) -> bool
11233 Is this sizer item a spacer?
11235 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
11237 def SetProportion(*args
, **kwargs
):
11239 SetProportion(self, int proportion)
11241 Set the proportion value for this item.
11243 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
11245 def GetProportion(*args
, **kwargs
):
11247 GetProportion(self) -> int
11249 Get the proportion value for this item.
11251 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
11253 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
11254 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
11255 def SetFlag(*args
, **kwargs
):
11257 SetFlag(self, int flag)
11259 Set the flag value for this item.
11261 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
11263 def GetFlag(*args
, **kwargs
):
11265 GetFlag(self) -> int
11267 Get the flag value for this item.
11269 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
11271 def SetBorder(*args
, **kwargs
):
11273 SetBorder(self, int border)
11275 Set the border value for this item.
11277 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
11279 def GetBorder(*args
, **kwargs
):
11281 GetBorder(self) -> int
11283 Get the border value for this item.
11285 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
11287 def GetWindow(*args
, **kwargs
):
11289 GetWindow(self) -> Window
11291 Get the window (if any) that is managed by this sizer item.
11293 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
11295 def SetWindow(*args
, **kwargs
):
11297 SetWindow(self, Window window)
11299 Set the window to be managed by this sizer item.
11301 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
11303 def GetSizer(*args
, **kwargs
):
11305 GetSizer(self) -> Sizer
11307 Get the subsizer (if any) that is managed by this sizer item.
11309 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
11311 def SetSizer(*args
, **kwargs
):
11313 SetSizer(self, Sizer sizer)
11315 Set the subsizer to be managed by this sizer item.
11317 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
11319 def GetSpacer(*args
, **kwargs
):
11321 GetSpacer(self) -> Size
11323 Get the size of the spacer managed by this sizer item.
11325 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
11327 def SetSpacer(*args
, **kwargs
):
11329 SetSpacer(self, Size size)
11331 Set the size of the spacer to be managed by this sizer item.
11333 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
11335 def Show(*args
, **kwargs
):
11337 Show(self, bool show)
11339 Set the show item attribute, which sizers use to determine if the item
11340 is to be made part of the layout or not. If the item is tracking a
11341 window then it is shown or hidden as needed.
11343 return _core_
.SizerItem_Show(*args
, **kwargs
)
11345 def IsShown(*args
, **kwargs
):
11347 IsShown(self) -> bool
11349 Is the item to be shown in the layout?
11351 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
11353 def GetPosition(*args
, **kwargs
):
11355 GetPosition(self) -> Point
11357 Returns the current position of the item, as set in the last Layout.
11359 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
11361 def GetUserData(*args
, **kwargs
):
11363 GetUserData(self) -> PyObject
11365 Returns the userData associated with this sizer item, or None if there
11368 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
11371 class SizerItemPtr(SizerItem
):
11372 def __init__(self
, this
):
11374 if not hasattr(self
,"thisown"): self
.thisown
= 0
11375 self
.__class
__ = SizerItem
11376 _core_
.SizerItem_swigregister(SizerItemPtr
)
11378 def SizerItemWindow(*args
, **kwargs
):
11380 SizerItemWindow(Window window, int proportion, int flag, int border,
11381 PyObject userData=None) -> SizerItem
11383 Constructs a `wx.SizerItem` for tracking a window.
11385 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
11389 def SizerItemSpacer(*args
, **kwargs
):
11391 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11392 PyObject userData=None) -> SizerItem
11394 Constructs a `wx.SizerItem` for tracking a spacer.
11396 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
11400 def SizerItemSizer(*args
, **kwargs
):
11402 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11403 PyObject userData=None) -> SizerItem
11405 Constructs a `wx.SizerItem` for tracking a subsizer
11407 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
11411 class Sizer(Object
):
11413 wx.Sizer is the abstract base class used for laying out subwindows in
11414 a window. You cannot use wx.Sizer directly; instead, you will have to
11415 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11416 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11417 and `wx.GridBagSizer`.
11419 The concept implemented by sizers in wxWidgets is closely related to
11420 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11421 toolkit or the Qt toolkit. It is based upon the idea of the individual
11422 subwindows reporting their minimal required size and their ability to
11423 get stretched if the size of the parent window has changed. This will
11424 most often mean that the programmer does not set the original size of
11425 a dialog in the beginning, rather the dialog will assigned a sizer and
11426 this sizer will be queried about the recommended size. The sizer in
11427 turn will query its children, which can be normal windows or contorls,
11428 empty space or other sizers, so that a hierarchy of sizers can be
11429 constructed. Note that wxSizer does not derive from wxWindow and thus
11430 do not interfere with tab ordering and requires very little resources
11431 compared to a real window on screen.
11433 What makes sizers so well fitted for use in wxWidgets is the fact that
11434 every control reports its own minimal size and the algorithm can
11435 handle differences in font sizes or different window (dialog item)
11436 sizes on different platforms without problems. If for example the
11437 standard font as well as the overall design of Mac widgets requires
11438 more space than on Windows, then the initial size of a dialog using a
11439 sizer will automatically be bigger on Mac than on Windows.
11441 def __init__(self
): raise RuntimeError, "No constructor defined"
11442 def __repr__(self
):
11443 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11444 def _setOORInfo(*args
, **kwargs
):
11445 """_setOORInfo(self, PyObject _self)"""
11446 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
11448 def Add(*args
, **kwargs
):
11450 Add(self, item, int proportion=0, int flag=0, int border=0,
11451 PyObject userData=None) -> wx.SizerItem
11453 Appends a child item to the sizer.
11455 return _core_
.Sizer_Add(*args
, **kwargs
)
11457 def Insert(*args
, **kwargs
):
11459 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
11460 PyObject userData=None) -> wx.SizerItem
11462 Inserts a new item into the list of items managed by this sizer before
11463 the item at index *before*. See `Add` for a description of the parameters.
11465 return _core_
.Sizer_Insert(*args
, **kwargs
)
11467 def Prepend(*args
, **kwargs
):
11469 Prepend(self, item, int proportion=0, int flag=0, int border=0,
11470 PyObject userData=None) -> wx.SizerItem
11472 Adds a new item to the begining of the list of sizer items managed by
11473 this sizer. See `Add` for a description of the parameters.
11475 return _core_
.Sizer_Prepend(*args
, **kwargs
)
11477 def Remove(*args
, **kwargs
):
11479 Remove(self, item) -> bool
11481 Removes an item from the sizer and destroys it. This method does not
11482 cause any layout or resizing to take place, call `Layout` to update
11483 the layout on screen after removing a child from the sizer. The
11484 *item* parameter can be either a window, a sizer, or the zero-based
11485 index of an item to remove. Returns True if the child item was found
11488 return _core_
.Sizer_Remove(*args
, **kwargs
)
11490 def Detach(*args
, **kwargs
):
11492 Detach(self, item) -> bool
11494 Detaches an item from the sizer without destroying it. This method
11495 does not cause any layout or resizing to take place, call `Layout` to
11496 do so. The *item* parameter can be either a window, a sizer, or the
11497 zero-based index of the item to be detached. Returns True if the child item
11498 was found and detached.
11500 return _core_
.Sizer_Detach(*args
, **kwargs
)
11502 def GetItem(*args
, **kwargs
):
11504 GetItem(self, item) -> wx.SizerItem
11506 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11507 parameter can be either a window, a sizer, or the zero-based index of
11508 the item to be detached.
11510 return _core_
.Sizer_GetItem(*args
, **kwargs
)
11512 def _SetItemMinSize(*args
, **kwargs
):
11513 """_SetItemMinSize(self, PyObject item, Size size)"""
11514 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
11516 def SetItemMinSize(self
, item
, *args
):
11518 SetItemMinSize(self, item, Size size)
11520 Sets the minimum size that will be allocated for an item in the sizer.
11521 The *item* parameter can be either a window, a sizer, or the
11522 zero-based index of the item. If a window or sizer is given then it
11523 will be searched for recursivly in subsizers if neccessary.
11526 # for backward compatibility accept separate width,height args too
11527 return self
._SetItemMinSize
(item
, args
)
11529 return self
._SetItemMinSize
(item
, args
[0])
11531 def AddItem(*args
, **kwargs
):
11533 AddItem(self, SizerItem item)
11535 Adds a `wx.SizerItem` to the sizer.
11537 return _core_
.Sizer_AddItem(*args
, **kwargs
)
11539 def InsertItem(*args
, **kwargs
):
11541 InsertItem(self, int index, SizerItem item)
11543 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11545 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
11547 def PrependItem(*args
, **kwargs
):
11549 PrependItem(self, SizerItem item)
11551 Prepends a `wx.SizerItem` to the sizer.
11553 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
11555 def AddMany(self
, items
):
11557 AddMany is a convenience method for adding several items
11558 to a sizer at one time. Simply pass it a list of tuples,
11559 where each tuple consists of the parameters that you
11560 would normally pass to the `Add` method.
11563 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
11567 # for backwards compatibility only, please do not use in new code
11568 def AddWindow(self
, *args
, **kw
):
11569 """Compatibility alias for `Add`."""
11570 return self
.Add(*args
, **kw
)
11571 def AddSizer(self
, *args
, **kw
):
11572 """Compatibility alias for `Add`."""
11573 return self
.Add(*args
, **kw
)
11574 def AddSpacer(self
, *args
, **kw
):
11575 """Compatibility alias for `Add`."""
11576 return self
.Add(*args
, **kw
)
11578 def PrependWindow(self
, *args
, **kw
):
11579 """Compatibility alias for `Prepend`."""
11580 return self
.Prepend(*args
, **kw
)
11581 def PrependSizer(self
, *args
, **kw
):
11582 """Compatibility alias for `Prepend`."""
11583 return self
.Prepend(*args
, **kw
)
11584 def PrependSpacer(self
, *args
, **kw
):
11585 """Compatibility alias for `Prepend`."""
11586 return self
.Prepend(*args
, **kw
)
11588 def InsertWindow(self
, *args
, **kw
):
11589 """Compatibility alias for `Insert`."""
11590 return self
.Insert(*args
, **kw
)
11591 def InsertSizer(self
, *args
, **kw
):
11592 """Compatibility alias for `Insert`."""
11593 return self
.Insert(*args
, **kw
)
11594 def InsertSpacer(self
, *args
, **kw
):
11595 """Compatibility alias for `Insert`."""
11596 return self
.Insert(*args
, **kw
)
11598 def RemoveWindow(self
, *args
, **kw
):
11599 """Compatibility alias for `Remove`."""
11600 return self
.Remove(*args
, **kw
)
11601 def RemoveSizer(self
, *args
, **kw
):
11602 """Compatibility alias for `Remove`."""
11603 return self
.Remove(*args
, **kw
)
11604 def RemovePos(self
, *args
, **kw
):
11605 """Compatibility alias for `Remove`."""
11606 return self
.Remove(*args
, **kw
)
11609 def SetDimension(*args
, **kwargs
):
11611 SetDimension(self, int x, int y, int width, int height)
11613 Call this to force the sizer to take the given dimension and thus
11614 force the items owned by the sizer to resize themselves according to
11615 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11618 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
11620 def SetMinSize(*args
, **kwargs
):
11622 SetMinSize(self, Size size)
11624 Call this to give the sizer a minimal size. Normally, the sizer will
11625 calculate its minimal size based purely on how much space its children
11626 need. After calling this method `GetMinSize` will return either the
11627 minimal size as requested by its children or the minimal size set
11628 here, depending on which is bigger.
11630 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
11632 def GetSize(*args
, **kwargs
):
11634 GetSize(self) -> Size
11636 Returns the current size of the space managed by the sizer.
11638 return _core_
.Sizer_GetSize(*args
, **kwargs
)
11640 def GetPosition(*args
, **kwargs
):
11642 GetPosition(self) -> Point
11644 Returns the current position of the sizer's managed space.
11646 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
11648 def GetMinSize(*args
, **kwargs
):
11650 GetMinSize(self) -> Size
11652 Returns the minimal size of the sizer. This is either the combined
11653 minimal size of all the children and their borders or the minimal size
11654 set by SetMinSize, depending on which is bigger.
11656 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
11658 def GetSizeTuple(self
):
11659 return self
.GetSize().Get()
11660 def GetPositionTuple(self
):
11661 return self
.GetPosition().Get()
11662 def GetMinSizeTuple(self
):
11663 return self
.GetMinSize().Get()
11665 def RecalcSizes(*args
, **kwargs
):
11669 Using the sizes calculated by `CalcMin` reposition and resize all the
11670 items managed by this sizer. You should not need to call this directly as
11671 it is called by `Layout`.
11673 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
11675 def CalcMin(*args
, **kwargs
):
11677 CalcMin(self) -> Size
11679 This method is where the sizer will do the actual calculation of its
11680 children's minimal sizes. You should not need to call this directly as
11681 it is called by `Layout`.
11683 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
11685 def Layout(*args
, **kwargs
):
11689 This method will force the recalculation and layout of the items
11690 controlled by the sizer using the current space allocated to the
11691 sizer. Normally this is called automatically from the owning window's
11692 EVT_SIZE handler, but it is also useful to call it from user code when
11693 one of the items in a sizer change size, or items are added or
11696 return _core_
.Sizer_Layout(*args
, **kwargs
)
11698 def Fit(*args
, **kwargs
):
11700 Fit(self, Window window) -> Size
11702 Tell the sizer to resize the *window* to match the sizer's minimal
11703 size. This is commonly done in the constructor of the window itself in
11704 order to set its initial size to match the needs of the children as
11705 determined by the sizer. Returns the new size.
11707 For a top level window this is the total window size, not the client size.
11709 return _core_
.Sizer_Fit(*args
, **kwargs
)
11711 def FitInside(*args
, **kwargs
):
11713 FitInside(self, Window window)
11715 Tell the sizer to resize the *virtual size* of the *window* to match the
11716 sizer's minimal size. This will not alter the on screen size of the
11717 window, but may cause the addition/removal/alteration of scrollbars
11718 required to view the virtual area in windows which manage it.
11720 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11723 return _core_
.Sizer_FitInside(*args
, **kwargs
)
11725 def SetSizeHints(*args
, **kwargs
):
11727 SetSizeHints(self, Window window)
11729 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11730 match the sizer's minimal size. This is commonly done in the
11731 constructor of the window itself if the window is resizable (as are
11732 many dialogs under Unix and frames on probably all platforms) in order
11733 to prevent the window from being sized smaller than the minimal size
11734 required by the sizer.
11736 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
11738 def SetVirtualSizeHints(*args
, **kwargs
):
11740 SetVirtualSizeHints(self, Window window)
11742 Tell the sizer to set the minimal size of the window virtual area to
11743 match the sizer's minimal size. For windows with managed scrollbars
11744 this will set them appropriately.
11746 :see: `wx.ScrolledWindow.SetScrollbars`
11749 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
11751 def Clear(*args
, **kwargs
):
11753 Clear(self, bool deleteWindows=False)
11755 Clear all items from the sizer, optionally destroying the window items
11758 return _core_
.Sizer_Clear(*args
, **kwargs
)
11760 def DeleteWindows(*args
, **kwargs
):
11762 DeleteWindows(self)
11764 Destroy all windows managed by the sizer.
11766 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
11768 def GetChildren(*args
, **kwargs
):
11770 GetChildren(self) -> list
11772 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11774 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
11776 def Show(*args
, **kwargs
):
11778 Show(self, item, bool show=True, bool recursive=false) -> bool
11780 Shows or hides an item managed by the sizer. To make a sizer item
11781 disappear or reappear, use Show followed by `Layout`. The *item*
11782 parameter can be either a window, a sizer, or the zero-based index of
11783 the item. Use the recursive parameter to show or hide an item in a
11784 subsizer. Returns True if the item was found.
11786 return _core_
.Sizer_Show(*args
, **kwargs
)
11788 def IsShown(*args
, **kwargs
):
11790 IsShown(self, item)
11792 Determines if the item is currently shown. sizer. To make a sizer
11793 item disappear or reappear, use Show followed by `Layout`. The *item*
11794 parameter can be either a window, a sizer, or the zero-based index of
11797 return _core_
.Sizer_IsShown(*args
, **kwargs
)
11799 def Hide(self
, item
, recursive
=False):
11801 A convenience method for `Show` (item, False, recursive).
11803 return self
.Show(item
, False, recursive
)
11805 def ShowItems(*args
, **kwargs
):
11807 ShowItems(self, bool show)
11809 Recursively call `wx.SizerItem.Show` on all sizer items.
11811 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
11814 class SizerPtr(Sizer
):
11815 def __init__(self
, this
):
11817 if not hasattr(self
,"thisown"): self
.thisown
= 0
11818 self
.__class
__ = Sizer
11819 _core_
.Sizer_swigregister(SizerPtr
)
11821 class PySizer(Sizer
):
11823 wx.PySizer is a special version of `wx.Sizer` that has been
11824 instrumented to allow the C++ virtual methods to be overloaded in
11825 Python derived classes. You would derive from this class if you are
11826 wanting to implement a custom sizer in Python code. Simply implement
11827 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11830 class MySizer(wx.PySizer):
11831 def __init__(self):
11832 wx.PySizer.__init__(self)
11835 for item in self.GetChildren():
11836 # calculate the total minimum width and height needed
11837 # by all items in the sizer according to this sizer's
11838 # layout algorithm.
11840 return wx.Size(width, height)
11842 def RecalcSizes(self):
11843 # find the space allotted to this sizer
11844 pos = self.GetPosition()
11845 size = self.GetSize()
11846 for item in self.GetChildren():
11847 # Recalculate (if necessary) the position and size of
11848 # each item and then call item.SetDimension to do the
11849 # actual positioning and sizing of the items within the
11850 # space alloted to this sizer.
11852 item.SetDimension(itemPos, itemSize)
11855 When `Layout` is called it first calls `CalcMin` followed by
11856 `RecalcSizes` so you can optimize a bit by saving the results of
11857 `CalcMin` and reusing them in `RecalcSizes`.
11859 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11863 def __repr__(self
):
11864 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11865 def __init__(self
, *args
, **kwargs
):
11867 __init__(self) -> PySizer
11869 Creates a wx.PySizer. Must be called from the __init__ in the derived
11872 newobj
= _core_
.new_PySizer(*args
, **kwargs
)
11873 self
.this
= newobj
.this
11876 self
._setCallbackInfo
(self
, PySizer
);self
._setOORInfo
(self
)
11878 def _setCallbackInfo(*args
, **kwargs
):
11879 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11880 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
11883 class PySizerPtr(PySizer
):
11884 def __init__(self
, this
):
11886 if not hasattr(self
,"thisown"): self
.thisown
= 0
11887 self
.__class
__ = PySizer
11888 _core_
.PySizer_swigregister(PySizerPtr
)
11890 #---------------------------------------------------------------------------
11892 class BoxSizer(Sizer
):
11894 The basic idea behind a box sizer is that windows will most often be
11895 laid out in rather simple basic geometry, typically in a row or a
11896 column or nested hierarchies of either. A wx.BoxSizer will lay out
11897 its items in a simple row or column, depending on the orientation
11898 parameter passed to the constructor.
11900 def __repr__(self
):
11901 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11902 def __init__(self
, *args
, **kwargs
):
11904 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11906 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11907 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11910 newobj
= _core_
.new_BoxSizer(*args
, **kwargs
)
11911 self
.this
= newobj
.this
11914 self
._setOORInfo
(self
)
11916 def GetOrientation(*args
, **kwargs
):
11918 GetOrientation(self) -> int
11920 Returns the current orientation of the sizer.
11922 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
11924 def SetOrientation(*args
, **kwargs
):
11926 SetOrientation(self, int orient)
11928 Resets the orientation of the sizer.
11930 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
11933 class BoxSizerPtr(BoxSizer
):
11934 def __init__(self
, this
):
11936 if not hasattr(self
,"thisown"): self
.thisown
= 0
11937 self
.__class
__ = BoxSizer
11938 _core_
.BoxSizer_swigregister(BoxSizerPtr
)
11940 #---------------------------------------------------------------------------
11942 class StaticBoxSizer(BoxSizer
):
11944 wx.StaticBoxSizer derives from and functions identically to the
11945 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11946 manages. Note that this static box must be created separately and
11947 passed to the sizer constructor.
11949 def __repr__(self
):
11950 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11951 def __init__(self
, *args
, **kwargs
):
11953 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11955 Constructor. It takes an associated static box and the orientation
11956 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11959 newobj
= _core_
.new_StaticBoxSizer(*args
, **kwargs
)
11960 self
.this
= newobj
.this
11963 self
._setOORInfo
(self
)
11965 def GetStaticBox(*args
, **kwargs
):
11967 GetStaticBox(self) -> StaticBox
11969 Returns the static box associated with this sizer.
11971 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
11974 class StaticBoxSizerPtr(StaticBoxSizer
):
11975 def __init__(self
, this
):
11977 if not hasattr(self
,"thisown"): self
.thisown
= 0
11978 self
.__class
__ = StaticBoxSizer
11979 _core_
.StaticBoxSizer_swigregister(StaticBoxSizerPtr
)
11981 #---------------------------------------------------------------------------
11983 class GridSizer(Sizer
):
11985 A grid sizer is a sizer which lays out its children in a
11986 two-dimensional table with all cells having the same size. In other
11987 words, the width of each cell within the grid is the width of the
11988 widest item added to the sizer and the height of each grid cell is the
11989 height of the tallest item. An optional vertical and/or horizontal
11990 gap between items can also be specified (in pixels.)
11992 Items are placed in the cells of the grid in the order they are added,
11993 in row-major order. In other words, the first row is filled first,
11994 then the second, and so on until all items have been added. (If
11995 neccessary, additional rows will be added as items are added.) If you
11996 need to have greater control over the cells that items are placed in
11997 then use the `wx.GridBagSizer`.
12000 def __repr__(self
):
12001 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12002 def __init__(self
, *args
, **kwargs
):
12004 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12006 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12007 of columns and rows in the sizer - if either of the parameters is
12008 zero, it will be calculated to from the total number of children in
12009 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12010 define extra space between all children.
12012 newobj
= _core_
.new_GridSizer(*args
, **kwargs
)
12013 self
.this
= newobj
.this
12016 self
._setOORInfo
(self
)
12018 def SetCols(*args
, **kwargs
):
12020 SetCols(self, int cols)
12022 Sets the number of columns in the sizer.
12024 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
12026 def SetRows(*args
, **kwargs
):
12028 SetRows(self, int rows)
12030 Sets the number of rows in the sizer.
12032 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
12034 def SetVGap(*args
, **kwargs
):
12036 SetVGap(self, int gap)
12038 Sets the vertical gap (in pixels) between the cells in the sizer.
12040 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
12042 def SetHGap(*args
, **kwargs
):
12044 SetHGap(self, int gap)
12046 Sets the horizontal gap (in pixels) between cells in the sizer
12048 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
12050 def GetCols(*args
, **kwargs
):
12052 GetCols(self) -> int
12054 Returns the number of columns in the sizer.
12056 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
12058 def GetRows(*args
, **kwargs
):
12060 GetRows(self) -> int
12062 Returns the number of rows in the sizer.
12064 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
12066 def GetVGap(*args
, **kwargs
):
12068 GetVGap(self) -> int
12070 Returns the vertical gap (in pixels) between the cells in the sizer.
12072 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
12074 def GetHGap(*args
, **kwargs
):
12076 GetHGap(self) -> int
12078 Returns the horizontal gap (in pixels) between cells in the sizer.
12080 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
12083 class GridSizerPtr(GridSizer
):
12084 def __init__(self
, this
):
12086 if not hasattr(self
,"thisown"): self
.thisown
= 0
12087 self
.__class
__ = GridSizer
12088 _core_
.GridSizer_swigregister(GridSizerPtr
)
12090 #---------------------------------------------------------------------------
12092 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
12093 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
12094 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
12095 class FlexGridSizer(GridSizer
):
12097 A flex grid sizer is a sizer which lays out its children in a
12098 two-dimensional table with all table cells in one row having the same
12099 height and all cells in one column having the same width, but all
12100 rows or all columns are not necessarily the same height or width as in
12101 the `wx.GridSizer`.
12103 wx.FlexGridSizer can also size items equally in one direction but
12104 unequally ("flexibly") in the other. If the sizer is only flexible
12105 in one direction (this can be changed using `SetFlexibleDirection`), it
12106 needs to be decided how the sizer should grow in the other ("non
12107 flexible") direction in order to fill the available space. The
12108 `SetNonFlexibleGrowMode` method serves this purpose.
12112 def __repr__(self
):
12113 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12114 def __init__(self
, *args
, **kwargs
):
12116 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12118 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12119 number of columns and rows in the sizer - if either of the parameters
12120 is zero, it will be calculated to from the total number of children in
12121 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12122 define extra space between all children.
12124 newobj
= _core_
.new_FlexGridSizer(*args
, **kwargs
)
12125 self
.this
= newobj
.this
12128 self
._setOORInfo
(self
)
12130 def AddGrowableRow(*args
, **kwargs
):
12132 AddGrowableRow(self, size_t idx, int proportion=0)
12134 Specifies that row *idx* (starting from zero) should be grown if there
12135 is extra space available to the sizer.
12137 The *proportion* parameter has the same meaning as the stretch factor
12138 for the box sizers except that if all proportions are 0, then all
12139 columns are resized equally (instead of not being resized at all).
12141 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
12143 def RemoveGrowableRow(*args
, **kwargs
):
12145 RemoveGrowableRow(self, size_t idx)
12147 Specifies that row *idx* is no longer growable.
12149 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
12151 def AddGrowableCol(*args
, **kwargs
):
12153 AddGrowableCol(self, size_t idx, int proportion=0)
12155 Specifies that column *idx* (starting from zero) should be grown if
12156 there is extra space available to the sizer.
12158 The *proportion* parameter has the same meaning as the stretch factor
12159 for the box sizers except that if all proportions are 0, then all
12160 columns are resized equally (instead of not being resized at all).
12162 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
12164 def RemoveGrowableCol(*args
, **kwargs
):
12166 RemoveGrowableCol(self, size_t idx)
12168 Specifies that column *idx* is no longer growable.
12170 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
12172 def SetFlexibleDirection(*args
, **kwargs
):
12174 SetFlexibleDirection(self, int direction)
12176 Specifies whether the sizer should flexibly resize its columns, rows,
12177 or both. Argument *direction* can be one of the following values. Any
12178 other value is ignored.
12180 ============== =======================================
12181 wx.VERTICAL Rows are flexibly sized.
12182 wx.HORIZONTAL Columns are flexibly sized.
12183 wx.BOTH Both rows and columns are flexibly sized
12184 (this is the default value).
12185 ============== =======================================
12187 Note that this method does not trigger relayout.
12190 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
12192 def GetFlexibleDirection(*args
, **kwargs
):
12194 GetFlexibleDirection(self) -> int
12196 Returns a value that specifies whether the sizer
12197 flexibly resizes its columns, rows, or both (default).
12199 :see: `SetFlexibleDirection`
12201 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
12203 def SetNonFlexibleGrowMode(*args
, **kwargs
):
12205 SetNonFlexibleGrowMode(self, int mode)
12207 Specifies how the sizer should grow in the non-flexible direction if
12208 there is one (so `SetFlexibleDirection` must have been called
12209 previously). Argument *mode* can be one of the following values:
12211 ========================== =================================================
12212 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12213 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12214 `AddGrowableCol` and `AddGrowableRow`. In this
12215 case equal sizing applies to minimum sizes of
12216 columns or rows (this is the default value).
12217 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12218 the non flexible direction, whether they are
12219 growable or not in the flexbile direction.
12220 ========================== =================================================
12222 Note that this method does not trigger relayout.
12226 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
12228 def GetNonFlexibleGrowMode(*args
, **kwargs
):
12230 GetNonFlexibleGrowMode(self) -> int
12232 Returns the value that specifies how the sizer grows in the
12233 non-flexible direction if there is one.
12235 :see: `SetNonFlexibleGrowMode`
12237 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
12239 def GetRowHeights(*args
, **kwargs
):
12241 GetRowHeights(self) -> list
12243 Returns a list of integers representing the heights of each of the
12246 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
12248 def GetColWidths(*args
, **kwargs
):
12250 GetColWidths(self) -> list
12252 Returns a list of integers representing the widths of each of the
12253 columns in the sizer.
12255 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
12258 class FlexGridSizerPtr(FlexGridSizer
):
12259 def __init__(self
, this
):
12261 if not hasattr(self
,"thisown"): self
.thisown
= 0
12262 self
.__class
__ = FlexGridSizer
12263 _core_
.FlexGridSizer_swigregister(FlexGridSizerPtr
)
12265 class StdDialogButtonSizer(BoxSizer
):
12267 A special sizer that knows how to order and position standard buttons
12268 in order to conform to the current platform's standards. You simply
12269 need to add each `wx.Button` to the sizer, and be sure to create the
12270 buttons using the standard ID's. Then call `Realize` and the sizer
12271 will take care of the rest.
12274 def __repr__(self
):
12275 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12276 def __init__(self
, *args
, **kwargs
):
12277 """__init__(self) -> StdDialogButtonSizer"""
12278 newobj
= _core_
.new_StdDialogButtonSizer(*args
, **kwargs
)
12279 self
.this
= newobj
.this
12282 def AddButton(*args
, **kwargs
):
12284 AddButton(self, wxButton button)
12286 Use this to add the buttons to this sizer. Do not use the `Add`
12287 method in the base class.
12289 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
12291 def Realize(*args
, **kwargs
):
12295 This funciton needs to be called after all the buttons have been added
12296 to the sizer. It will reorder them and position them in a platform
12299 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
12301 def SetAffirmativeButton(*args
, **kwargs
):
12302 """SetAffirmativeButton(self, wxButton button)"""
12303 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
12305 def SetNegativeButton(*args
, **kwargs
):
12306 """SetNegativeButton(self, wxButton button)"""
12307 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
12309 def SetCancelButton(*args
, **kwargs
):
12310 """SetCancelButton(self, wxButton button)"""
12311 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
12313 def GetAffirmativeButton(*args
, **kwargs
):
12314 """GetAffirmativeButton(self) -> wxButton"""
12315 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
12317 def GetApplyButton(*args
, **kwargs
):
12318 """GetApplyButton(self) -> wxButton"""
12319 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
12321 def GetNegativeButton(*args
, **kwargs
):
12322 """GetNegativeButton(self) -> wxButton"""
12323 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
12325 def GetCancelButton(*args
, **kwargs
):
12326 """GetCancelButton(self) -> wxButton"""
12327 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
12329 def GetHelpButton(*args
, **kwargs
):
12330 """GetHelpButton(self) -> wxButton"""
12331 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
12334 class StdDialogButtonSizerPtr(StdDialogButtonSizer
):
12335 def __init__(self
, this
):
12337 if not hasattr(self
,"thisown"): self
.thisown
= 0
12338 self
.__class
__ = StdDialogButtonSizer
12339 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr
)
12341 #---------------------------------------------------------------------------
12343 class GBPosition(object):
12345 This class represents the position of an item in a virtual grid of
12346 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12347 typemaps that will automatically convert from a 2-element sequence of
12348 integers to a wx.GBPosition, so you can use the more pythonic
12349 representation of the position nearly transparently in Python code.
12351 def __repr__(self
):
12352 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12353 def __init__(self
, *args
, **kwargs
):
12355 __init__(self, int row=0, int col=0) -> GBPosition
12357 This class represents the position of an item in a virtual grid of
12358 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12359 typemaps that will automatically convert from a 2-element sequence of
12360 integers to a wx.GBPosition, so you can use the more pythonic
12361 representation of the position nearly transparently in Python code.
12363 newobj
= _core_
.new_GBPosition(*args
, **kwargs
)
12364 self
.this
= newobj
.this
12367 def GetRow(*args
, **kwargs
):
12368 """GetRow(self) -> int"""
12369 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
12371 def GetCol(*args
, **kwargs
):
12372 """GetCol(self) -> int"""
12373 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
12375 def SetRow(*args
, **kwargs
):
12376 """SetRow(self, int row)"""
12377 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
12379 def SetCol(*args
, **kwargs
):
12380 """SetCol(self, int col)"""
12381 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
12383 def __eq__(*args
, **kwargs
):
12384 """__eq__(self, GBPosition other) -> bool"""
12385 return _core_
.GBPosition___eq__(*args
, **kwargs
)
12387 def __ne__(*args
, **kwargs
):
12388 """__ne__(self, GBPosition other) -> bool"""
12389 return _core_
.GBPosition___ne__(*args
, **kwargs
)
12391 def Set(*args
, **kwargs
):
12392 """Set(self, int row=0, int col=0)"""
12393 return _core_
.GBPosition_Set(*args
, **kwargs
)
12395 def Get(*args
, **kwargs
):
12396 """Get(self) -> PyObject"""
12397 return _core_
.GBPosition_Get(*args
, **kwargs
)
12399 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12400 def __str__(self
): return str(self
.Get())
12401 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
12402 def __len__(self
): return len(self
.Get())
12403 def __getitem__(self
, index
): return self
.Get()[index
]
12404 def __setitem__(self
, index
, val
):
12405 if index
== 0: self
.SetRow(val
)
12406 elif index
== 1: self
.SetCol(val
)
12407 else: raise IndexError
12408 def __nonzero__(self
): return self
.Get() != (0,0)
12409 __safe_for_unpickling__
= True
12410 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
12412 row
= property(GetRow
, SetRow
)
12413 col
= property(GetCol
, SetCol
)
12416 class GBPositionPtr(GBPosition
):
12417 def __init__(self
, this
):
12419 if not hasattr(self
,"thisown"): self
.thisown
= 0
12420 self
.__class
__ = GBPosition
12421 _core_
.GBPosition_swigregister(GBPositionPtr
)
12423 class GBSpan(object):
12425 This class is used to hold the row and column spanning attributes of
12426 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12427 automatically convert from a 2-element sequence of integers to a
12428 wx.GBSpan, so you can use the more pythonic representation of the span
12429 nearly transparently in Python code.
12432 def __repr__(self
):
12433 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12434 def __init__(self
, *args
, **kwargs
):
12436 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12438 Construct a new wxGBSpan, optionally setting the rowspan and
12439 colspan. The default is (1,1). (Meaning that the item occupies one
12440 cell in each direction.
12442 newobj
= _core_
.new_GBSpan(*args
, **kwargs
)
12443 self
.this
= newobj
.this
12446 def GetRowspan(*args
, **kwargs
):
12447 """GetRowspan(self) -> int"""
12448 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
12450 def GetColspan(*args
, **kwargs
):
12451 """GetColspan(self) -> int"""
12452 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
12454 def SetRowspan(*args
, **kwargs
):
12455 """SetRowspan(self, int rowspan)"""
12456 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
12458 def SetColspan(*args
, **kwargs
):
12459 """SetColspan(self, int colspan)"""
12460 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
12462 def __eq__(*args
, **kwargs
):
12463 """__eq__(self, GBSpan other) -> bool"""
12464 return _core_
.GBSpan___eq__(*args
, **kwargs
)
12466 def __ne__(*args
, **kwargs
):
12467 """__ne__(self, GBSpan other) -> bool"""
12468 return _core_
.GBSpan___ne__(*args
, **kwargs
)
12470 def Set(*args
, **kwargs
):
12471 """Set(self, int rowspan=1, int colspan=1)"""
12472 return _core_
.GBSpan_Set(*args
, **kwargs
)
12474 def Get(*args
, **kwargs
):
12475 """Get(self) -> PyObject"""
12476 return _core_
.GBSpan_Get(*args
, **kwargs
)
12478 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
12479 def __str__(self
): return str(self
.Get())
12480 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
12481 def __len__(self
): return len(self
.Get())
12482 def __getitem__(self
, index
): return self
.Get()[index
]
12483 def __setitem__(self
, index
, val
):
12484 if index
== 0: self
.SetRowspan(val
)
12485 elif index
== 1: self
.SetColspan(val
)
12486 else: raise IndexError
12487 def __nonzero__(self
): return self
.Get() != (0,0)
12488 __safe_for_unpickling__
= True
12489 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
12491 rowspan
= property(GetRowspan
, SetRowspan
)
12492 colspan
= property(GetColspan
, SetColspan
)
12495 class GBSpanPtr(GBSpan
):
12496 def __init__(self
, this
):
12498 if not hasattr(self
,"thisown"): self
.thisown
= 0
12499 self
.__class
__ = GBSpan
12500 _core_
.GBSpan_swigregister(GBSpanPtr
)
12502 class GBSizerItem(SizerItem
):
12504 The wx.GBSizerItem class is used to track the additional data about
12505 items in a `wx.GridBagSizer` such as the item's position in the grid
12506 and how many rows or columns it spans.
12509 def __repr__(self
):
12510 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12511 def __init__(self
, *args
, **kwargs
):
12513 __init__(self) -> GBSizerItem
12515 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12516 size will need to be set, as well as a position and span before this
12517 item can be used in a Sizer.
12519 You will probably never need to create a wx.GBSizerItem directly as they
12520 are created automatically when the sizer's Add method is called.
12522 newobj
= _core_
.new_GBSizerItem(*args
, **kwargs
)
12523 self
.this
= newobj
.this
12526 def GetPos(*args
, **kwargs
):
12528 GetPos(self) -> GBPosition
12530 Get the grid position of the item
12532 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
12534 def GetPosTuple(self
): return self
.GetPos().Get()
12535 def GetSpan(*args
, **kwargs
):
12537 GetSpan(self) -> GBSpan
12539 Get the row and column spanning of the item
12541 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
12543 def GetSpanTuple(self
): return self
.GetSpan().Get()
12544 def SetPos(*args
, **kwargs
):
12546 SetPos(self, GBPosition pos) -> bool
12548 If the item is already a member of a sizer then first ensure that
12549 there is no other item that would intersect with this one at the new
12550 position, then set the new position. Returns True if the change is
12551 successful and after the next Layout() the item will be moved.
12553 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
12555 def SetSpan(*args
, **kwargs
):
12557 SetSpan(self, GBSpan span) -> bool
12559 If the item is already a member of a sizer then first ensure that
12560 there is no other item that would intersect with this one with its new
12561 spanning size, then set the new spanning. Returns True if the change
12562 is successful and after the next Layout() the item will be resized.
12565 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
12567 def Intersects(*args
, **kwargs
):
12569 Intersects(self, GBSizerItem other) -> bool
12571 Returns True if this item and the other item instersect.
12573 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
12575 def IntersectsPos(*args
, **kwargs
):
12577 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12579 Returns True if the given pos/span would intersect with this item.
12581 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
12583 def GetEndPos(*args
, **kwargs
):
12585 GetEndPos(self) -> GBPosition
12587 Get the row and column of the endpoint of this item.
12589 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
12591 def GetGBSizer(*args
, **kwargs
):
12593 GetGBSizer(self) -> GridBagSizer
12595 Get the sizer this item is a member of.
12597 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
12599 def SetGBSizer(*args
, **kwargs
):
12601 SetGBSizer(self, GridBagSizer sizer)
12603 Set the sizer this item is a member of.
12605 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
12608 class GBSizerItemPtr(GBSizerItem
):
12609 def __init__(self
, this
):
12611 if not hasattr(self
,"thisown"): self
.thisown
= 0
12612 self
.__class
__ = GBSizerItem
12613 _core_
.GBSizerItem_swigregister(GBSizerItemPtr
)
12614 DefaultSpan
= cvar
.DefaultSpan
12616 def GBSizerItemWindow(*args
, **kwargs
):
12618 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12619 int border, PyObject userData=None) -> GBSizerItem
12621 Construct a `wx.GBSizerItem` for a window.
12623 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
12627 def GBSizerItemSizer(*args
, **kwargs
):
12629 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12630 int border, PyObject userData=None) -> GBSizerItem
12632 Construct a `wx.GBSizerItem` for a sizer
12634 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
12638 def GBSizerItemSpacer(*args
, **kwargs
):
12640 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12641 int flag, int border, PyObject userData=None) -> GBSizerItem
12643 Construct a `wx.GBSizerItem` for a spacer.
12645 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
12649 class GridBagSizer(FlexGridSizer
):
12651 A `wx.Sizer` that can lay out items in a virtual grid like a
12652 `wx.FlexGridSizer` but in this case explicit positioning of the items
12653 is allowed using `wx.GBPosition`, and items can optionally span more
12654 than one row and/or column using `wx.GBSpan`. The total size of the
12655 virtual grid is determined by the largest row and column that items are
12656 positioned at, adjusted for spanning.
12659 def __repr__(self
):
12660 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12661 def __init__(self
, *args
, **kwargs
):
12663 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12665 Constructor, with optional parameters to specify the gap between the
12668 newobj
= _core_
.new_GridBagSizer(*args
, **kwargs
)
12669 self
.this
= newobj
.this
12672 self
._setOORInfo
(self
)
12674 def Add(*args
, **kwargs
):
12676 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
12677 int border=0, userData=None) -> wx.GBSizerItem
12679 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12680 more than one row or column as specified with *span*. The remaining
12681 args behave similarly to `wx.Sizer.Add`.
12683 Returns True if the item was successfully placed at the given cell
12684 position, False if something was already there.
12687 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
12689 def AddItem(*args
, **kwargs
):
12691 Add(self, GBSizerItem item) -> wx.GBSizerItem
12693 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12694 the item was successfully placed at its given cell position, False if
12695 something was already there.
12697 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
12699 def GetCellSize(*args
, **kwargs
):
12701 GetCellSize(self, int row, int col) -> Size
12703 Get the size of the specified cell, including hgap and
12704 vgap. Only valid after a Layout.
12706 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
12708 def GetEmptyCellSize(*args
, **kwargs
):
12710 GetEmptyCellSize(self) -> Size
12712 Get the size used for cells in the grid with no item.
12714 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
12716 def SetEmptyCellSize(*args
, **kwargs
):
12718 SetEmptyCellSize(self, Size sz)
12720 Set the size used for cells in the grid with no item.
12722 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
12724 def GetItemPosition(*args
):
12726 GetItemPosition(self, item) -> GBPosition
12728 Get the grid position of the specified *item* where *item* is either a
12729 window or subsizer that is a member of this sizer, or a zero-based
12732 return _core_
.GridBagSizer_GetItemPosition(*args
)
12734 def SetItemPosition(*args
):
12736 SetItemPosition(self, item, GBPosition pos) -> bool
12738 Set the grid position of the specified *item* where *item* is either a
12739 window or subsizer that is a member of this sizer, or a zero-based
12740 index of an item. Returns True on success. If the move is not
12741 allowed (because an item is already there) then False is returned.
12744 return _core_
.GridBagSizer_SetItemPosition(*args
)
12746 def GetItemSpan(*args
):
12748 GetItemSpan(self, item) -> GBSpan
12750 Get the row/col spanning of the specified *item* where *item* is
12751 either a window or subsizer that is a member of this sizer, or a
12752 zero-based index of an item.
12754 return _core_
.GridBagSizer_GetItemSpan(*args
)
12756 def SetItemSpan(*args
):
12758 SetItemSpan(self, item, GBSpan span) -> bool
12760 Set the row/col spanning of the specified *item* where *item* is
12761 either a window or subsizer that is a member of this sizer, or a
12762 zero-based index of an item. Returns True on success. If the move is
12763 not allowed (because an item is already there) then False is returned.
12765 return _core_
.GridBagSizer_SetItemSpan(*args
)
12767 def FindItem(*args
):
12769 FindItem(self, item) -> GBSizerItem
12771 Find the sizer item for the given window or subsizer, returns None if
12772 not found. (non-recursive)
12774 return _core_
.GridBagSizer_FindItem(*args
)
12776 def FindItemAtPosition(*args
, **kwargs
):
12778 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12780 Return the sizer item for the given grid cell, or None if there is no
12781 item at that position. (non-recursive)
12783 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
12785 def FindItemAtPoint(*args
, **kwargs
):
12787 FindItemAtPoint(self, Point pt) -> GBSizerItem
12789 Return the sizer item located at the point given in *pt*, or None if
12790 there is no item at that point. The (x,y) coordinates in pt correspond
12791 to the client coordinates of the window using the sizer for
12792 layout. (non-recursive)
12794 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
12796 def CheckForIntersection(*args
, **kwargs
):
12798 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
12800 Look at all items and see if any intersect (or would overlap) the
12801 given *item*. Returns True if so, False if there would be no overlap.
12802 If an *excludeItem* is given then it will not be checked for
12803 intersection, for example it may be the item we are checking the
12807 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
12809 def CheckForIntersectionPos(*args
, **kwargs
):
12811 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12813 Look at all items and see if any intersect (or would overlap) the
12814 given position and span. Returns True if so, False if there would be
12815 no overlap. If an *excludeItem* is given then it will not be checked
12816 for intersection, for example it may be the item we are checking the
12819 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
12822 class GridBagSizerPtr(GridBagSizer
):
12823 def __init__(self
, this
):
12825 if not hasattr(self
,"thisown"): self
.thisown
= 0
12826 self
.__class
__ = GridBagSizer
12827 _core_
.GridBagSizer_swigregister(GridBagSizerPtr
)
12829 #---------------------------------------------------------------------------
12833 Right
= _core_
.Right
12834 Bottom
= _core_
.Bottom
12835 Width
= _core_
.Width
12836 Height
= _core_
.Height
12837 Centre
= _core_
.Centre
12838 Center
= _core_
.Center
12839 CentreX
= _core_
.CentreX
12840 CentreY
= _core_
.CentreY
12841 Unconstrained
= _core_
.Unconstrained
12843 PercentOf
= _core_
.PercentOf
12844 Above
= _core_
.Above
12845 Below
= _core_
.Below
12846 LeftOf
= _core_
.LeftOf
12847 RightOf
= _core_
.RightOf
12848 SameAs
= _core_
.SameAs
12849 Absolute
= _core_
.Absolute
12850 class IndividualLayoutConstraint(Object
):
12852 Objects of this class are stored in the `wx.LayoutConstraints` class as
12853 one of eight possible constraints that a window can be involved in.
12854 You will never need to create an instance of
12855 wx.IndividualLayoutConstraint, rather you should create a
12856 `wx.LayoutConstraints` instance and use the individual contstraints
12859 def __init__(self
): raise RuntimeError, "No constructor defined"
12860 def __repr__(self
):
12861 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12862 def Set(*args
, **kwargs
):
12864 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12866 Sets the properties of the constraint. Normally called by one of the
12867 convenience functions such as Above, RightOf, SameAs.
12869 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
12871 def LeftOf(*args
, **kwargs
):
12873 LeftOf(self, Window sibling, int marg=0)
12875 Constrains this edge to be to the left of the given window, with an
12876 optional margin. Implicitly, this is relative to the left edge of the
12879 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
12881 def RightOf(*args
, **kwargs
):
12883 RightOf(self, Window sibling, int marg=0)
12885 Constrains this edge to be to the right of the given window, with an
12886 optional margin. Implicitly, this is relative to the right edge of the
12889 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
12891 def Above(*args
, **kwargs
):
12893 Above(self, Window sibling, int marg=0)
12895 Constrains this edge to be above the given window, with an optional
12896 margin. Implicitly, this is relative to the top edge of the other
12899 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
12901 def Below(*args
, **kwargs
):
12903 Below(self, Window sibling, int marg=0)
12905 Constrains this edge to be below the given window, with an optional
12906 margin. Implicitly, this is relative to the bottom edge of the other
12909 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
12911 def SameAs(*args
, **kwargs
):
12913 SameAs(self, Window otherW, int edge, int marg=0)
12915 Constrains this edge or dimension to be to the same as the edge of the
12916 given window, with an optional margin.
12918 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
12920 def PercentOf(*args
, **kwargs
):
12922 PercentOf(self, Window otherW, int wh, int per)
12924 Constrains this edge or dimension to be to a percentage of the given
12925 window, with an optional margin.
12927 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
12929 def Absolute(*args
, **kwargs
):
12931 Absolute(self, int val)
12933 Constrains this edge or dimension to be the given absolute value.
12935 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
12937 def Unconstrained(*args
, **kwargs
):
12939 Unconstrained(self)
12941 Sets this edge or dimension to be unconstrained, that is, dependent on
12942 other edges and dimensions from which this value can be deduced.
12944 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
12946 def AsIs(*args
, **kwargs
):
12950 Sets this edge or constraint to be whatever the window's value is at
12951 the moment. If either of the width and height constraints are *as is*,
12952 the window will not be resized, but moved instead. This is important
12953 when considering panel items which are intended to have a default
12954 size, such as a button, which may take its size from the size of the
12957 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
12959 def GetOtherWindow(*args
, **kwargs
):
12960 """GetOtherWindow(self) -> Window"""
12961 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
12963 def GetMyEdge(*args
, **kwargs
):
12964 """GetMyEdge(self) -> int"""
12965 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
12967 def SetEdge(*args
, **kwargs
):
12968 """SetEdge(self, int which)"""
12969 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
12971 def SetValue(*args
, **kwargs
):
12972 """SetValue(self, int v)"""
12973 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
12975 def GetMargin(*args
, **kwargs
):
12976 """GetMargin(self) -> int"""
12977 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
12979 def SetMargin(*args
, **kwargs
):
12980 """SetMargin(self, int m)"""
12981 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
12983 def GetValue(*args
, **kwargs
):
12984 """GetValue(self) -> int"""
12985 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
12987 def GetPercent(*args
, **kwargs
):
12988 """GetPercent(self) -> int"""
12989 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
12991 def GetOtherEdge(*args
, **kwargs
):
12992 """GetOtherEdge(self) -> int"""
12993 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
12995 def GetDone(*args
, **kwargs
):
12996 """GetDone(self) -> bool"""
12997 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
12999 def SetDone(*args
, **kwargs
):
13000 """SetDone(self, bool d)"""
13001 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
13003 def GetRelationship(*args
, **kwargs
):
13004 """GetRelationship(self) -> int"""
13005 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
13007 def SetRelationship(*args
, **kwargs
):
13008 """SetRelationship(self, int r)"""
13009 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
13011 def ResetIfWin(*args
, **kwargs
):
13013 ResetIfWin(self, Window otherW) -> bool
13015 Reset constraint if it mentions otherWin
13017 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
13019 def SatisfyConstraint(*args
, **kwargs
):
13021 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13023 Try to satisfy constraint
13025 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
13027 def GetEdge(*args
, **kwargs
):
13029 GetEdge(self, int which, Window thisWin, Window other) -> int
13031 Get the value of this edge or dimension, or if this
13032 is not determinable, -1.
13034 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
13037 class IndividualLayoutConstraintPtr(IndividualLayoutConstraint
):
13038 def __init__(self
, this
):
13040 if not hasattr(self
,"thisown"): self
.thisown
= 0
13041 self
.__class
__ = IndividualLayoutConstraint
13042 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr
)
13044 class LayoutConstraints(Object
):
13046 **Note:** constraints are now deprecated and you should use sizers
13049 Objects of this class can be associated with a window to define its
13050 layout constraints, with respect to siblings or its parent.
13052 The class consists of the following eight constraints of class
13053 wx.IndividualLayoutConstraint, some or all of which should be accessed
13054 directly to set the appropriate constraints.
13056 * left: represents the left hand edge of the window
13057 * right: represents the right hand edge of the window
13058 * top: represents the top edge of the window
13059 * bottom: represents the bottom edge of the window
13060 * width: represents the width of the window
13061 * height: represents the height of the window
13062 * centreX: represents the horizontal centre point of the window
13063 * centreY: represents the vertical centre point of the window
13065 Most constraints are initially set to have the relationship
13066 wxUnconstrained, which means that their values should be calculated by
13067 looking at known constraints. The exceptions are width and height,
13068 which are set to wxAsIs to ensure that if the user does not specify a
13069 constraint, the existing width and height will be used, to be
13070 compatible with panel items which often have take a default size. If
13071 the constraint is ``wx.AsIs``, the dimension will not be changed.
13073 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
13076 def __repr__(self
):
13077 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
13078 left
= property(_core_
.LayoutConstraints_left_get
)
13079 top
= property(_core_
.LayoutConstraints_top_get
)
13080 right
= property(_core_
.LayoutConstraints_right_get
)
13081 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
13082 width
= property(_core_
.LayoutConstraints_width_get
)
13083 height
= property(_core_
.LayoutConstraints_height_get
)
13084 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
13085 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
13086 def __init__(self
, *args
, **kwargs
):
13087 """__init__(self) -> LayoutConstraints"""
13088 newobj
= _core_
.new_LayoutConstraints(*args
, **kwargs
)
13089 self
.this
= newobj
.this
13092 def SatisfyConstraints(*args
, **kwargs
):
13093 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13094 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
13096 def AreSatisfied(*args
, **kwargs
):
13097 """AreSatisfied(self) -> bool"""
13098 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
13101 class LayoutConstraintsPtr(LayoutConstraints
):
13102 def __init__(self
, this
):
13104 if not hasattr(self
,"thisown"): self
.thisown
= 0
13105 self
.__class
__ = LayoutConstraints
13106 _core_
.LayoutConstraints_swigregister(LayoutConstraintsPtr
)
13108 #----------------------------------------------------------------------------
13110 # Use Python's bool constants if available, make some if not
13114 __builtins__
.True = 1==1
13115 __builtins__
.False = 1==0
13116 def bool(value
): return not not value
13117 __builtins__
.bool = bool
13121 # workarounds for bad wxRTTI names
13122 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
13123 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
13124 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
13127 #----------------------------------------------------------------------------
13128 # Load version numbers from __version__... Ensure that major and minor
13129 # versions are the same for both wxPython and wxWidgets.
13131 from __version__
import *
13132 __version__
= VERSION_STRING
13134 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
13135 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
13136 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
13138 warnings
.warn("wxPython/wxWidgets release number mismatch")
13140 #----------------------------------------------------------------------------
13142 # Set wxPython's default string<-->unicode conversion encoding from
13143 # the locale, but only if Python's default hasn't been changed. (We
13144 # assume that if the user has customized it already then that is the
13145 # encoding we need to use as well.)
13147 # The encoding selected here is used when string or unicode objects
13148 # need to be converted in order to pass them to wxWidgets. Please be
13149 # aware that the default encoding within the same locale may be
13150 # slightly different on different platforms. For example, please see
13151 # http://www.alanwood.net/demos/charsetdiffs.html for differences
13152 # between the common latin/roman encodings.
13154 default
= _sys
.getdefaultencoding()
13155 if default
== 'ascii':
13159 default
= locale
.getdefaultlocale()[1]
13160 codecs
.lookup(default
)
13161 except (ValueError, LookupError, TypeError):
13162 default
= _sys
.getdefaultencoding()
13166 wx
.SetDefaultPyEncoding(default
)
13169 #----------------------------------------------------------------------------
13171 class PyDeadObjectError(AttributeError):
13174 class _wxPyDeadObject(object):
13176 Instances of wx objects that are OOR capable will have their __class__
13177 changed to this class when the C++ object is deleted. This should help
13178 prevent crashes due to referencing a bogus C++ pointer.
13180 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13181 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13183 def __repr__(self
):
13184 if not hasattr(self
, "_name"):
13185 self
._name
= "[unknown]"
13186 return self
.reprStr
% self
._name
13188 def __getattr__(self
, *args
):
13189 if not hasattr(self
, "_name"):
13190 self
._name
= "[unknown]"
13191 raise PyDeadObjectError(self
.attrStr
% self
._name
)
13193 def __nonzero__(self
):
13198 class PyUnbornObjectError(AttributeError):
13201 class _wxPyUnbornObject(object):
13203 Some stock objects are created when the wx._core module is
13204 imported, but their C++ instance is not created until the wx.App
13205 object is created and initialized. These object instances will
13206 temporarily have their __class__ changed to this class so an
13207 exception will be raised if they are used before the C++ instance
13211 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13212 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
13214 def __repr__(self
):
13215 #if not hasattr(self, "_name"):
13216 # self._name = "[unknown]"
13217 return self
.reprStr
#% self._name
13219 def __getattr__(self
, *args
):
13220 #if not hasattr(self, "_name"):
13221 # self._name = "[unknown]"
13222 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
13224 def __nonzero__(self
):
13228 #----------------------------------------------------------------------------
13230 def CallAfter(callable, *args
, **kw
):
13232 Call the specified function after the current and pending event
13233 handlers have been completed. This is also good for making GUI
13234 method calls from non-GUI threads. Any extra positional or
13235 keyword args are passed on to the callable when it is called.
13237 :see: `wx.FutureCall`
13240 assert app
is not None, 'No wx.App created yet'
13242 if not hasattr(app
, "_CallAfterId"):
13243 app
._CallAfterId
= wx
.NewEventType()
13244 app
.Connect(-1, -1, app
._CallAfterId
,
13245 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
13247 evt
.SetEventType(app
._CallAfterId
)
13248 evt
.callable = callable
13251 wx
.PostEvent(app
, evt
)
13253 #----------------------------------------------------------------------------
13258 A convenience class for `wx.Timer`, that calls the given callable
13259 object once after the given amount of milliseconds, passing any
13260 positional or keyword args. The return value of the callable is
13261 availbale after it has been run with the `GetResult` method.
13263 If you don't need to get the return value or restart the timer
13264 then there is no need to hold a reference to this object. It will
13265 hold a reference to itself while the timer is running (the timer
13266 has a reference to self.Notify) but the cycle will be broken when
13267 the timer completes, automatically cleaning up the wx.FutureCall
13270 :see: `wx.CallAfter`
13272 def __init__(self
, millis
, callable, *args
, **kwargs
):
13273 self
.millis
= millis
13274 self
.callable = callable
13275 self
.SetArgs(*args
, **kwargs
)
13277 self
.running
= False
13278 self
.hasRun
= False
13287 def Start(self
, millis
=None, *args
, **kwargs
):
13289 (Re)start the timer
13291 self
.hasRun
= False
13292 if millis
is not None:
13293 self
.millis
= millis
13295 self
.SetArgs(*args
, **kwargs
)
13297 self
.timer
= wx
.PyTimer(self
.Notify
)
13298 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
13299 self
.running
= True
13305 Stop and destroy the timer.
13307 if self
.timer
is not None:
13312 def GetInterval(self
):
13313 if self
.timer
is not None:
13314 return self
.timer
.GetInterval()
13319 def IsRunning(self
):
13320 return self
.timer
is not None and self
.timer
.IsRunning()
13323 def SetArgs(self
, *args
, **kwargs
):
13325 (Re)set the args passed to the callable object. This is
13326 useful in conjunction with Restart if you want to schedule a
13327 new call to the same callable object but with different
13331 self
.kwargs
= kwargs
13337 def GetResult(self
):
13342 The timer has expired so call the callable.
13344 if self
.callable and getattr(self
.callable, 'im_self', True):
13346 self
.running
= False
13347 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
13349 if not self
.running
:
13350 # if it wasn't restarted, then cleanup
13351 wx
.CallAfter(self
.Stop
)
13355 #----------------------------------------------------------------------------
13356 # Control which items in this module should be documented by epydoc.
13357 # We allow only classes and functions, which will help reduce the size
13358 # of the docs by filtering out the zillions of constants, EVT objects,
13359 # and etc that don't make much sense by themselves, but are instead
13360 # documented (or will be) as part of the classes/functions/methods
13361 # where they should be used.
13365 A filter for epydoc that only allows non-Ptr classes and
13366 fucntions, in order to reduce the clutter in the API docs.
13368 def __init__(self
, globals):
13369 self
._globals
= globals
13371 def __call__(self
, name
):
13373 obj
= self
._globals
.get(name
, None)
13374 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
13376 if name
.startswith('_') or name
.endswith('Ptr') or name
.startswith('EVT'):
13380 #----------------------------------------------------------------------------
13381 #----------------------------------------------------------------------------
13383 # Import other modules in this package that should show up in the
13384 # "core" wx namespace
13386 from _windows
import *
13387 from _controls
import *
13388 from _misc
import *
13391 # Fixup the stock objects since they can't be used yet. (They will be
13392 # restored in wx.PyApp.OnInit.)
13393 _core_
._wxPyFixStockObjects
()
13395 #----------------------------------------------------------------------------
13396 #----------------------------------------------------------------------------