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 DUPLEX_SIMPLEX
= _core_
.DUPLEX_SIMPLEX
600 DUPLEX_HORIZONTAL
= _core_
.DUPLEX_HORIZONTAL
601 DUPLEX_VERTICAL
= _core_
.DUPLEX_VERTICAL
602 ITEM_SEPARATOR
= _core_
.ITEM_SEPARATOR
603 ITEM_NORMAL
= _core_
.ITEM_NORMAL
604 ITEM_CHECK
= _core_
.ITEM_CHECK
605 ITEM_RADIO
= _core_
.ITEM_RADIO
606 ITEM_MAX
= _core_
.ITEM_MAX
607 HT_NOWHERE
= _core_
.HT_NOWHERE
608 HT_SCROLLBAR_FIRST
= _core_
.HT_SCROLLBAR_FIRST
609 HT_SCROLLBAR_ARROW_LINE_1
= _core_
.HT_SCROLLBAR_ARROW_LINE_1
610 HT_SCROLLBAR_ARROW_LINE_2
= _core_
.HT_SCROLLBAR_ARROW_LINE_2
611 HT_SCROLLBAR_ARROW_PAGE_1
= _core_
.HT_SCROLLBAR_ARROW_PAGE_1
612 HT_SCROLLBAR_ARROW_PAGE_2
= _core_
.HT_SCROLLBAR_ARROW_PAGE_2
613 HT_SCROLLBAR_THUMB
= _core_
.HT_SCROLLBAR_THUMB
614 HT_SCROLLBAR_BAR_1
= _core_
.HT_SCROLLBAR_BAR_1
615 HT_SCROLLBAR_BAR_2
= _core_
.HT_SCROLLBAR_BAR_2
616 HT_SCROLLBAR_LAST
= _core_
.HT_SCROLLBAR_LAST
617 HT_WINDOW_OUTSIDE
= _core_
.HT_WINDOW_OUTSIDE
618 HT_WINDOW_INSIDE
= _core_
.HT_WINDOW_INSIDE
619 HT_WINDOW_VERT_SCROLLBAR
= _core_
.HT_WINDOW_VERT_SCROLLBAR
620 HT_WINDOW_HORZ_SCROLLBAR
= _core_
.HT_WINDOW_HORZ_SCROLLBAR
621 HT_WINDOW_CORNER
= _core_
.HT_WINDOW_CORNER
622 HT_MAX
= _core_
.HT_MAX
623 MOD_NONE
= _core_
.MOD_NONE
624 MOD_ALT
= _core_
.MOD_ALT
625 MOD_CONTROL
= _core_
.MOD_CONTROL
626 MOD_SHIFT
= _core_
.MOD_SHIFT
627 MOD_WIN
= _core_
.MOD_WIN
628 UPDATE_UI_NONE
= _core_
.UPDATE_UI_NONE
629 UPDATE_UI_RECURSE
= _core_
.UPDATE_UI_RECURSE
630 UPDATE_UI_FROMIDLE
= _core_
.UPDATE_UI_FROMIDLE
631 #---------------------------------------------------------------------------
633 class Object(object):
635 The base class for most wx objects, although in wxPython not
636 much functionality is needed nor exposed.
638 def __init__(self
): raise RuntimeError, "No constructor defined"
640 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
641 def GetClassName(*args
, **kwargs
):
643 GetClassName(self) -> String
645 Returns the class name of the C++ class using wxRTTI.
647 return _core_
.Object_GetClassName(*args
, **kwargs
)
649 def Destroy(*args
, **kwargs
):
653 Deletes the C++ object this Python object is a proxy for.
655 return _core_
.Object_Destroy(*args
, **kwargs
)
658 class ObjectPtr(Object
):
659 def __init__(self
, this
):
661 if not hasattr(self
,"thisown"): self
.thisown
= 0
662 self
.__class
__ = Object
663 _core_
.Object_swigregister(ObjectPtr
)
664 _wxPySetDictionary
= _core_
._wxPySetDictionary
666 _wxPyFixStockObjects
= _core_
._wxPyFixStockObjects
669 EmptyString
= cvar
.EmptyString
671 #---------------------------------------------------------------------------
673 BITMAP_TYPE_INVALID
= _core_
.BITMAP_TYPE_INVALID
674 BITMAP_TYPE_BMP
= _core_
.BITMAP_TYPE_BMP
675 BITMAP_TYPE_ICO
= _core_
.BITMAP_TYPE_ICO
676 BITMAP_TYPE_CUR
= _core_
.BITMAP_TYPE_CUR
677 BITMAP_TYPE_XBM
= _core_
.BITMAP_TYPE_XBM
678 BITMAP_TYPE_XBM_DATA
= _core_
.BITMAP_TYPE_XBM_DATA
679 BITMAP_TYPE_XPM
= _core_
.BITMAP_TYPE_XPM
680 BITMAP_TYPE_XPM_DATA
= _core_
.BITMAP_TYPE_XPM_DATA
681 BITMAP_TYPE_TIF
= _core_
.BITMAP_TYPE_TIF
682 BITMAP_TYPE_GIF
= _core_
.BITMAP_TYPE_GIF
683 BITMAP_TYPE_PNG
= _core_
.BITMAP_TYPE_PNG
684 BITMAP_TYPE_JPEG
= _core_
.BITMAP_TYPE_JPEG
685 BITMAP_TYPE_PNM
= _core_
.BITMAP_TYPE_PNM
686 BITMAP_TYPE_PCX
= _core_
.BITMAP_TYPE_PCX
687 BITMAP_TYPE_PICT
= _core_
.BITMAP_TYPE_PICT
688 BITMAP_TYPE_ICON
= _core_
.BITMAP_TYPE_ICON
689 BITMAP_TYPE_ANI
= _core_
.BITMAP_TYPE_ANI
690 BITMAP_TYPE_IFF
= _core_
.BITMAP_TYPE_IFF
691 BITMAP_TYPE_MACCURSOR
= _core_
.BITMAP_TYPE_MACCURSOR
692 BITMAP_TYPE_ANY
= _core_
.BITMAP_TYPE_ANY
693 CURSOR_NONE
= _core_
.CURSOR_NONE
694 CURSOR_ARROW
= _core_
.CURSOR_ARROW
695 CURSOR_RIGHT_ARROW
= _core_
.CURSOR_RIGHT_ARROW
696 CURSOR_BULLSEYE
= _core_
.CURSOR_BULLSEYE
697 CURSOR_CHAR
= _core_
.CURSOR_CHAR
698 CURSOR_CROSS
= _core_
.CURSOR_CROSS
699 CURSOR_HAND
= _core_
.CURSOR_HAND
700 CURSOR_IBEAM
= _core_
.CURSOR_IBEAM
701 CURSOR_LEFT_BUTTON
= _core_
.CURSOR_LEFT_BUTTON
702 CURSOR_MAGNIFIER
= _core_
.CURSOR_MAGNIFIER
703 CURSOR_MIDDLE_BUTTON
= _core_
.CURSOR_MIDDLE_BUTTON
704 CURSOR_NO_ENTRY
= _core_
.CURSOR_NO_ENTRY
705 CURSOR_PAINT_BRUSH
= _core_
.CURSOR_PAINT_BRUSH
706 CURSOR_PENCIL
= _core_
.CURSOR_PENCIL
707 CURSOR_POINT_LEFT
= _core_
.CURSOR_POINT_LEFT
708 CURSOR_POINT_RIGHT
= _core_
.CURSOR_POINT_RIGHT
709 CURSOR_QUESTION_ARROW
= _core_
.CURSOR_QUESTION_ARROW
710 CURSOR_RIGHT_BUTTON
= _core_
.CURSOR_RIGHT_BUTTON
711 CURSOR_SIZENESW
= _core_
.CURSOR_SIZENESW
712 CURSOR_SIZENS
= _core_
.CURSOR_SIZENS
713 CURSOR_SIZENWSE
= _core_
.CURSOR_SIZENWSE
714 CURSOR_SIZEWE
= _core_
.CURSOR_SIZEWE
715 CURSOR_SIZING
= _core_
.CURSOR_SIZING
716 CURSOR_SPRAYCAN
= _core_
.CURSOR_SPRAYCAN
717 CURSOR_WAIT
= _core_
.CURSOR_WAIT
718 CURSOR_WATCH
= _core_
.CURSOR_WATCH
719 CURSOR_BLANK
= _core_
.CURSOR_BLANK
720 CURSOR_DEFAULT
= _core_
.CURSOR_DEFAULT
721 CURSOR_COPY_ARROW
= _core_
.CURSOR_COPY_ARROW
722 CURSOR_ARROWWAIT
= _core_
.CURSOR_ARROWWAIT
723 CURSOR_MAX
= _core_
.CURSOR_MAX
724 #---------------------------------------------------------------------------
728 wx.Size is a useful data structure used to represent the size of
729 something. It simply contians integer width and height
730 proprtites. In most places in wxPython where a wx.Size is
731 expected a (width, height) tuple can be used instead.
734 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
735 width
= property(_core_
.Size_width_get
, _core_
.Size_width_set
)
736 height
= property(_core_
.Size_height_get
, _core_
.Size_height_set
)
737 x
= width
; y
= height
738 def __init__(self
, *args
, **kwargs
):
740 __init__(self, int w=0, int h=0) -> Size
742 Creates a size object.
744 newobj
= _core_
.new_Size(*args
, **kwargs
)
745 self
.this
= newobj
.this
748 def __del__(self
, destroy
=_core_
.delete_Size
):
751 if self
.thisown
: destroy(self
)
754 def __eq__(*args
, **kwargs
):
756 __eq__(self, Size sz) -> bool
758 Test for equality of wx.Size objects.
760 return _core_
.Size___eq__(*args
, **kwargs
)
762 def __ne__(*args
, **kwargs
):
764 __ne__(self, Size sz) -> bool
768 return _core_
.Size___ne__(*args
, **kwargs
)
770 def __add__(*args
, **kwargs
):
772 __add__(self, Size sz) -> Size
774 Add sz's proprties to this and return the result.
776 return _core_
.Size___add__(*args
, **kwargs
)
778 def __sub__(*args
, **kwargs
):
780 __sub__(self, Size sz) -> Size
782 Subtract sz's properties from this and return the result.
784 return _core_
.Size___sub__(*args
, **kwargs
)
786 def IncTo(*args
, **kwargs
):
790 Increments this object so that both of its dimensions are not less
791 than the corresponding dimensions of the size.
793 return _core_
.Size_IncTo(*args
, **kwargs
)
795 def DecTo(*args
, **kwargs
):
799 Decrements this object so that both of its dimensions are not greater
800 than the corresponding dimensions of the size.
802 return _core_
.Size_DecTo(*args
, **kwargs
)
804 def Set(*args
, **kwargs
):
806 Set(self, int w, int h)
808 Set both width and height.
810 return _core_
.Size_Set(*args
, **kwargs
)
812 def SetWidth(*args
, **kwargs
):
813 """SetWidth(self, int w)"""
814 return _core_
.Size_SetWidth(*args
, **kwargs
)
816 def SetHeight(*args
, **kwargs
):
817 """SetHeight(self, int h)"""
818 return _core_
.Size_SetHeight(*args
, **kwargs
)
820 def GetWidth(*args
, **kwargs
):
821 """GetWidth(self) -> int"""
822 return _core_
.Size_GetWidth(*args
, **kwargs
)
824 def GetHeight(*args
, **kwargs
):
825 """GetHeight(self) -> int"""
826 return _core_
.Size_GetHeight(*args
, **kwargs
)
828 def IsFullySpecified(*args
, **kwargs
):
830 IsFullySpecified(self) -> bool
832 Returns True if both components of the size are non-default values.
834 return _core_
.Size_IsFullySpecified(*args
, **kwargs
)
836 def SetDefaults(*args
, **kwargs
):
838 SetDefaults(self, Size size)
840 Combine this size with the other one replacing the default components
841 of this object (i.e. equal to -1) with those of the other.
843 return _core_
.Size_SetDefaults(*args
, **kwargs
)
845 def Get(*args
, **kwargs
):
847 Get() -> (width,height)
849 Returns the width and height properties as a tuple.
851 return _core_
.Size_Get(*args
, **kwargs
)
853 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
854 def __str__(self
): return str(self
.Get())
855 def __repr__(self
): return 'wx.Size'+str(self
.Get())
856 def __len__(self
): return len(self
.Get())
857 def __getitem__(self
, index
): return self
.Get()[index
]
858 def __setitem__(self
, index
, val
):
859 if index
== 0: self
.width
= val
860 elif index
== 1: self
.height
= val
861 else: raise IndexError
862 def __nonzero__(self
): return self
.Get() != (0,0)
863 __safe_for_unpickling__
= True
864 def __reduce__(self
): return (wx
.Size
, self
.Get())
868 def __init__(self
, this
):
870 if not hasattr(self
,"thisown"): self
.thisown
= 0
871 self
.__class
__ = Size
872 _core_
.Size_swigregister(SizePtr
)
874 #---------------------------------------------------------------------------
876 class RealPoint(object):
878 A data structure for representing a point or position with floating
879 point x and y properties. In wxPython most places that expect a
880 wx.RealPoint can also accept a (x,y) tuple.
883 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
884 x
= property(_core_
.RealPoint_x_get
, _core_
.RealPoint_x_set
)
885 y
= property(_core_
.RealPoint_y_get
, _core_
.RealPoint_y_set
)
886 def __init__(self
, *args
, **kwargs
):
888 __init__(self, double x=0.0, double y=0.0) -> RealPoint
890 Create a wx.RealPoint object
892 newobj
= _core_
.new_RealPoint(*args
, **kwargs
)
893 self
.this
= newobj
.this
896 def __del__(self
, destroy
=_core_
.delete_RealPoint
):
899 if self
.thisown
: destroy(self
)
902 def __eq__(*args
, **kwargs
):
904 __eq__(self, RealPoint pt) -> bool
906 Test for equality of wx.RealPoint objects.
908 return _core_
.RealPoint___eq__(*args
, **kwargs
)
910 def __ne__(*args
, **kwargs
):
912 __ne__(self, RealPoint pt) -> bool
914 Test for inequality of wx.RealPoint objects.
916 return _core_
.RealPoint___ne__(*args
, **kwargs
)
918 def __add__(*args
, **kwargs
):
920 __add__(self, RealPoint pt) -> RealPoint
922 Add pt's proprties to this and return the result.
924 return _core_
.RealPoint___add__(*args
, **kwargs
)
926 def __sub__(*args
, **kwargs
):
928 __sub__(self, RealPoint pt) -> RealPoint
930 Subtract pt's proprties from this and return the result
932 return _core_
.RealPoint___sub__(*args
, **kwargs
)
934 def Set(*args
, **kwargs
):
936 Set(self, double x, double y)
938 Set both the x and y properties
940 return _core_
.RealPoint_Set(*args
, **kwargs
)
942 def Get(*args
, **kwargs
):
946 Return the x and y properties as a tuple.
948 return _core_
.RealPoint_Get(*args
, **kwargs
)
950 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
951 def __str__(self
): return str(self
.Get())
952 def __repr__(self
): return 'wx.RealPoint'+str(self
.Get())
953 def __len__(self
): return len(self
.Get())
954 def __getitem__(self
, index
): return self
.Get()[index
]
955 def __setitem__(self
, index
, val
):
956 if index
== 0: self
.x
= val
957 elif index
== 1: self
.y
= val
958 else: raise IndexError
959 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
960 __safe_for_unpickling__
= True
961 def __reduce__(self
): return (wx
.RealPoint
, self
.Get())
964 class RealPointPtr(RealPoint
):
965 def __init__(self
, this
):
967 if not hasattr(self
,"thisown"): self
.thisown
= 0
968 self
.__class
__ = RealPoint
969 _core_
.RealPoint_swigregister(RealPointPtr
)
971 #---------------------------------------------------------------------------
975 A data structure for representing a point or position with integer x
976 and y properties. Most places in wxPython that expect a wx.Point can
977 also accept a (x,y) tuple.
980 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
981 x
= property(_core_
.Point_x_get
, _core_
.Point_x_set
)
982 y
= property(_core_
.Point_y_get
, _core_
.Point_y_set
)
983 def __init__(self
, *args
, **kwargs
):
985 __init__(self, int x=0, int y=0) -> Point
987 Create a wx.Point object
989 newobj
= _core_
.new_Point(*args
, **kwargs
)
990 self
.this
= newobj
.this
993 def __del__(self
, destroy
=_core_
.delete_Point
):
996 if self
.thisown
: destroy(self
)
999 def __eq__(*args
, **kwargs
):
1001 __eq__(self, Point pt) -> bool
1003 Test for equality of wx.Point objects.
1005 return _core_
.Point___eq__(*args
, **kwargs
)
1007 def __ne__(*args
, **kwargs
):
1009 __ne__(self, Point pt) -> bool
1011 Test for inequality of wx.Point objects.
1013 return _core_
.Point___ne__(*args
, **kwargs
)
1015 def __add__(*args
, **kwargs
):
1017 __add__(self, Point pt) -> Point
1019 Add pt's proprties to this and return the result.
1021 return _core_
.Point___add__(*args
, **kwargs
)
1023 def __sub__(*args
, **kwargs
):
1025 __sub__(self, Point pt) -> Point
1027 Subtract pt's proprties from this and return the result
1029 return _core_
.Point___sub__(*args
, **kwargs
)
1031 def __iadd__(*args
, **kwargs
):
1033 __iadd__(self, Point pt) -> Point
1035 Add pt to this object.
1037 return _core_
.Point___iadd__(*args
, **kwargs
)
1039 def __isub__(*args
, **kwargs
):
1041 __isub__(self, Point pt) -> Point
1043 Subtract pt from this object.
1045 return _core_
.Point___isub__(*args
, **kwargs
)
1047 def Set(*args
, **kwargs
):
1049 Set(self, long x, long y)
1051 Set both the x and y properties
1053 return _core_
.Point_Set(*args
, **kwargs
)
1055 def Get(*args
, **kwargs
):
1059 Return the x and y properties as a tuple.
1061 return _core_
.Point_Get(*args
, **kwargs
)
1063 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1064 def __str__(self
): return str(self
.Get())
1065 def __repr__(self
): return 'wx.Point'+str(self
.Get())
1066 def __len__(self
): return len(self
.Get())
1067 def __getitem__(self
, index
): return self
.Get()[index
]
1068 def __setitem__(self
, index
, val
):
1069 if index
== 0: self
.x
= val
1070 elif index
== 1: self
.y
= val
1071 else: raise IndexError
1072 def __nonzero__(self
): return self
.Get() != (0,0)
1073 __safe_for_unpickling__
= True
1074 def __reduce__(self
): return (wx
.Point
, self
.Get())
1077 class PointPtr(Point
):
1078 def __init__(self
, this
):
1080 if not hasattr(self
,"thisown"): self
.thisown
= 0
1081 self
.__class
__ = Point
1082 _core_
.Point_swigregister(PointPtr
)
1084 #---------------------------------------------------------------------------
1088 A class for representing and manipulating rectangles. It has x, y,
1089 width and height properties. In wxPython most palces that expect a
1090 wx.Rect can also accept a (x,y,width,height) tuple.
1093 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1094 def __init__(self
, *args
, **kwargs
):
1096 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1098 Create a new Rect object.
1100 newobj
= _core_
.new_Rect(*args
, **kwargs
)
1101 self
.this
= newobj
.this
1104 def __del__(self
, destroy
=_core_
.delete_Rect
):
1107 if self
.thisown
: destroy(self
)
1110 def GetX(*args
, **kwargs
):
1111 """GetX(self) -> int"""
1112 return _core_
.Rect_GetX(*args
, **kwargs
)
1114 def SetX(*args
, **kwargs
):
1115 """SetX(self, int x)"""
1116 return _core_
.Rect_SetX(*args
, **kwargs
)
1118 def GetY(*args
, **kwargs
):
1119 """GetY(self) -> int"""
1120 return _core_
.Rect_GetY(*args
, **kwargs
)
1122 def SetY(*args
, **kwargs
):
1123 """SetY(self, int y)"""
1124 return _core_
.Rect_SetY(*args
, **kwargs
)
1126 def GetWidth(*args
, **kwargs
):
1127 """GetWidth(self) -> int"""
1128 return _core_
.Rect_GetWidth(*args
, **kwargs
)
1130 def SetWidth(*args
, **kwargs
):
1131 """SetWidth(self, int w)"""
1132 return _core_
.Rect_SetWidth(*args
, **kwargs
)
1134 def GetHeight(*args
, **kwargs
):
1135 """GetHeight(self) -> int"""
1136 return _core_
.Rect_GetHeight(*args
, **kwargs
)
1138 def SetHeight(*args
, **kwargs
):
1139 """SetHeight(self, int h)"""
1140 return _core_
.Rect_SetHeight(*args
, **kwargs
)
1142 def GetPosition(*args
, **kwargs
):
1143 """GetPosition(self) -> Point"""
1144 return _core_
.Rect_GetPosition(*args
, **kwargs
)
1146 def SetPosition(*args
, **kwargs
):
1147 """SetPosition(self, Point p)"""
1148 return _core_
.Rect_SetPosition(*args
, **kwargs
)
1150 def GetSize(*args
, **kwargs
):
1151 """GetSize(self) -> Size"""
1152 return _core_
.Rect_GetSize(*args
, **kwargs
)
1154 def SetSize(*args
, **kwargs
):
1155 """SetSize(self, Size s)"""
1156 return _core_
.Rect_SetSize(*args
, **kwargs
)
1158 def IsEmpty(*args
, **kwargs
):
1159 """IsEmpty(self) -> bool"""
1160 return _core_
.Rect_IsEmpty(*args
, **kwargs
)
1162 def GetTopLeft(*args
, **kwargs
):
1163 """GetTopLeft(self) -> Point"""
1164 return _core_
.Rect_GetTopLeft(*args
, **kwargs
)
1166 def SetTopLeft(*args
, **kwargs
):
1167 """SetTopLeft(self, Point p)"""
1168 return _core_
.Rect_SetTopLeft(*args
, **kwargs
)
1170 def GetBottomRight(*args
, **kwargs
):
1171 """GetBottomRight(self) -> Point"""
1172 return _core_
.Rect_GetBottomRight(*args
, **kwargs
)
1174 def SetBottomRight(*args
, **kwargs
):
1175 """SetBottomRight(self, Point p)"""
1176 return _core_
.Rect_SetBottomRight(*args
, **kwargs
)
1178 def GetLeft(*args
, **kwargs
):
1179 """GetLeft(self) -> int"""
1180 return _core_
.Rect_GetLeft(*args
, **kwargs
)
1182 def GetTop(*args
, **kwargs
):
1183 """GetTop(self) -> int"""
1184 return _core_
.Rect_GetTop(*args
, **kwargs
)
1186 def GetBottom(*args
, **kwargs
):
1187 """GetBottom(self) -> int"""
1188 return _core_
.Rect_GetBottom(*args
, **kwargs
)
1190 def GetRight(*args
, **kwargs
):
1191 """GetRight(self) -> int"""
1192 return _core_
.Rect_GetRight(*args
, **kwargs
)
1194 def SetLeft(*args
, **kwargs
):
1195 """SetLeft(self, int left)"""
1196 return _core_
.Rect_SetLeft(*args
, **kwargs
)
1198 def SetRight(*args
, **kwargs
):
1199 """SetRight(self, int right)"""
1200 return _core_
.Rect_SetRight(*args
, **kwargs
)
1202 def SetTop(*args
, **kwargs
):
1203 """SetTop(self, int top)"""
1204 return _core_
.Rect_SetTop(*args
, **kwargs
)
1206 def SetBottom(*args
, **kwargs
):
1207 """SetBottom(self, int bottom)"""
1208 return _core_
.Rect_SetBottom(*args
, **kwargs
)
1210 position
= property(GetPosition
, SetPosition
)
1211 size
= property(GetSize
, SetSize
)
1212 left
= property(GetLeft
, SetLeft
)
1213 right
= property(GetRight
, SetRight
)
1214 top
= property(GetTop
, SetTop
)
1215 bottom
= property(GetBottom
, SetBottom
)
1217 def Inflate(*args
, **kwargs
):
1219 Inflate(self, int dx, int dy) -> Rect
1221 Increases the size of the rectangle.
1223 The left border is moved farther left and the right border is moved
1224 farther right by ``dx``. The upper border is moved farther up and the
1225 bottom border is moved farther down by ``dy``. (Note the the width and
1226 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1227 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1228 opposite happens: the rectangle size decreases in the respective
1231 The change is made to the rectangle inplace, if instead you need a
1232 copy that is inflated, preserving the original then make the copy
1235 copy = wx.Rect(*original)
1240 return _core_
.Rect_Inflate(*args
, **kwargs
)
1242 def Deflate(*args
, **kwargs
):
1244 Deflate(self, int dx, int dy) -> Rect
1246 Decrease the rectangle size. This method is the opposite of `Inflate`
1247 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1248 `Inflate` for a full description.
1250 return _core_
.Rect_Deflate(*args
, **kwargs
)
1252 def OffsetXY(*args
, **kwargs
):
1254 OffsetXY(self, int dx, int dy)
1256 Moves the rectangle by the specified offset. If dx is positive, the
1257 rectangle is moved to the right, if dy is positive, it is moved to the
1258 bottom, otherwise it is moved to the left or top respectively.
1260 return _core_
.Rect_OffsetXY(*args
, **kwargs
)
1262 def Offset(*args
, **kwargs
):
1264 Offset(self, Point pt)
1266 Same as OffsetXY but uses dx,dy from Point
1268 return _core_
.Rect_Offset(*args
, **kwargs
)
1270 def Intersect(*args
, **kwargs
):
1272 Intersect(self, Rect rect) -> Rect
1274 Returns the intersectsion of this rectangle and rect.
1276 return _core_
.Rect_Intersect(*args
, **kwargs
)
1278 def Union(*args
, **kwargs
):
1280 Union(self, Rect rect) -> Rect
1282 Returns the union of this rectangle and rect.
1284 return _core_
.Rect_Union(*args
, **kwargs
)
1286 def __add__(*args
, **kwargs
):
1288 __add__(self, Rect rect) -> Rect
1290 Add the properties of rect to this rectangle and return the result.
1292 return _core_
.Rect___add__(*args
, **kwargs
)
1294 def __iadd__(*args
, **kwargs
):
1296 __iadd__(self, Rect rect) -> Rect
1298 Add the properties of rect to this rectangle, updating this rectangle.
1300 return _core_
.Rect___iadd__(*args
, **kwargs
)
1302 def __eq__(*args
, **kwargs
):
1304 __eq__(self, Rect rect) -> bool
1308 return _core_
.Rect___eq__(*args
, **kwargs
)
1310 def __ne__(*args
, **kwargs
):
1312 __ne__(self, Rect rect) -> bool
1314 Test for inequality.
1316 return _core_
.Rect___ne__(*args
, **kwargs
)
1318 def InsideXY(*args
, **kwargs
):
1320 InsideXY(self, int x, int y) -> bool
1322 Return True if the point is (not strcitly) inside the rect.
1324 return _core_
.Rect_InsideXY(*args
, **kwargs
)
1326 def Inside(*args
, **kwargs
):
1328 Inside(self, Point pt) -> bool
1330 Return True if the point is (not strcitly) inside the rect.
1332 return _core_
.Rect_Inside(*args
, **kwargs
)
1334 def Intersects(*args
, **kwargs
):
1336 Intersects(self, Rect rect) -> bool
1338 Returns True if the rectangles have a non empty intersection.
1340 return _core_
.Rect_Intersects(*args
, **kwargs
)
1342 x
= property(_core_
.Rect_x_get
, _core_
.Rect_x_set
)
1343 y
= property(_core_
.Rect_y_get
, _core_
.Rect_y_set
)
1344 width
= property(_core_
.Rect_width_get
, _core_
.Rect_width_set
)
1345 height
= property(_core_
.Rect_height_get
, _core_
.Rect_height_set
)
1346 def Set(*args
, **kwargs
):
1348 Set(self, int x=0, int y=0, int width=0, int height=0)
1350 Set all rectangle properties.
1352 return _core_
.Rect_Set(*args
, **kwargs
)
1354 def Get(*args
, **kwargs
):
1356 Get() -> (x,y,width,height)
1358 Return the rectangle properties as a tuple.
1360 return _core_
.Rect_Get(*args
, **kwargs
)
1362 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1363 def __str__(self
): return str(self
.Get())
1364 def __repr__(self
): return 'wx.Rect'+str(self
.Get())
1365 def __len__(self
): return len(self
.Get())
1366 def __getitem__(self
, index
): return self
.Get()[index
]
1367 def __setitem__(self
, index
, val
):
1368 if index
== 0: self
.x
= val
1369 elif index
== 1: self
.y
= val
1370 elif index
== 2: self
.width
= val
1371 elif index
== 3: self
.height
= val
1372 else: raise IndexError
1373 def __nonzero__(self
): return self
.Get() != (0,0,0,0)
1374 __safe_for_unpickling__
= True
1375 def __reduce__(self
): return (wx
.Rect
, self
.Get())
1378 class RectPtr(Rect
):
1379 def __init__(self
, this
):
1381 if not hasattr(self
,"thisown"): self
.thisown
= 0
1382 self
.__class
__ = Rect
1383 _core_
.Rect_swigregister(RectPtr
)
1385 def RectPP(*args
, **kwargs
):
1387 RectPP(Point topLeft, Point bottomRight) -> Rect
1389 Create a new Rect object from Points representing two corners.
1391 val
= _core_
.new_RectPP(*args
, **kwargs
)
1395 def RectPS(*args
, **kwargs
):
1397 RectPS(Point pos, Size size) -> Rect
1399 Create a new Rect from a position and size.
1401 val
= _core_
.new_RectPS(*args
, **kwargs
)
1405 def RectS(*args
, **kwargs
):
1407 RectS(Size size) -> Rect
1409 Create a new Rect from a size only.
1411 val
= _core_
.new_RectS(*args
, **kwargs
)
1416 def IntersectRect(*args
, **kwargs
):
1418 IntersectRect(Rect r1, Rect r2) -> Rect
1420 Calculate and return the intersection of r1 and r2.
1422 return _core_
.IntersectRect(*args
, **kwargs
)
1423 #---------------------------------------------------------------------------
1425 class Point2D(object):
1427 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1428 with floating point values.
1431 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1432 def __init__(self
, *args
, **kwargs
):
1434 __init__(self, double x=0.0, double y=0.0) -> Point2D
1436 Create a w.Point2D object.
1438 newobj
= _core_
.new_Point2D(*args
, **kwargs
)
1439 self
.this
= newobj
.this
1442 def GetFloor(*args
, **kwargs
):
1448 return _core_
.Point2D_GetFloor(*args
, **kwargs
)
1450 def GetRounded(*args
, **kwargs
):
1452 GetRounded() -> (x,y)
1456 return _core_
.Point2D_GetRounded(*args
, **kwargs
)
1458 def GetVectorLength(*args
, **kwargs
):
1459 """GetVectorLength(self) -> double"""
1460 return _core_
.Point2D_GetVectorLength(*args
, **kwargs
)
1462 def GetVectorAngle(*args
, **kwargs
):
1463 """GetVectorAngle(self) -> double"""
1464 return _core_
.Point2D_GetVectorAngle(*args
, **kwargs
)
1466 def SetVectorLength(*args
, **kwargs
):
1467 """SetVectorLength(self, double length)"""
1468 return _core_
.Point2D_SetVectorLength(*args
, **kwargs
)
1470 def SetVectorAngle(*args
, **kwargs
):
1471 """SetVectorAngle(self, double degrees)"""
1472 return _core_
.Point2D_SetVectorAngle(*args
, **kwargs
)
1474 def SetPolarCoordinates(self
, angle
, length
):
1475 self
.SetVectorLength(length
)
1476 self
.SetVectorAngle(angle
)
1477 def Normalize(self
):
1478 self
.SetVectorLength(1.0)
1480 def GetDistance(*args
, **kwargs
):
1481 """GetDistance(self, Point2D pt) -> double"""
1482 return _core_
.Point2D_GetDistance(*args
, **kwargs
)
1484 def GetDistanceSquare(*args
, **kwargs
):
1485 """GetDistanceSquare(self, Point2D pt) -> double"""
1486 return _core_
.Point2D_GetDistanceSquare(*args
, **kwargs
)
1488 def GetDotProduct(*args
, **kwargs
):
1489 """GetDotProduct(self, Point2D vec) -> double"""
1490 return _core_
.Point2D_GetDotProduct(*args
, **kwargs
)
1492 def GetCrossProduct(*args
, **kwargs
):
1493 """GetCrossProduct(self, Point2D vec) -> double"""
1494 return _core_
.Point2D_GetCrossProduct(*args
, **kwargs
)
1496 def __neg__(*args
, **kwargs
):
1498 __neg__(self) -> Point2D
1500 the reflection of this point
1502 return _core_
.Point2D___neg__(*args
, **kwargs
)
1504 def __iadd__(*args
, **kwargs
):
1505 """__iadd__(self, Point2D pt) -> Point2D"""
1506 return _core_
.Point2D___iadd__(*args
, **kwargs
)
1508 def __isub__(*args
, **kwargs
):
1509 """__isub__(self, Point2D pt) -> Point2D"""
1510 return _core_
.Point2D___isub__(*args
, **kwargs
)
1512 def __imul__(*args
, **kwargs
):
1513 """__imul__(self, Point2D pt) -> Point2D"""
1514 return _core_
.Point2D___imul__(*args
, **kwargs
)
1516 def __idiv__(*args
, **kwargs
):
1517 """__idiv__(self, Point2D pt) -> Point2D"""
1518 return _core_
.Point2D___idiv__(*args
, **kwargs
)
1520 def __eq__(*args
, **kwargs
):
1522 __eq__(self, Point2D pt) -> bool
1526 return _core_
.Point2D___eq__(*args
, **kwargs
)
1528 def __ne__(*args
, **kwargs
):
1530 __ne__(self, Point2D pt) -> bool
1534 return _core_
.Point2D___ne__(*args
, **kwargs
)
1536 x
= property(_core_
.Point2D_x_get
, _core_
.Point2D_x_set
)
1537 y
= property(_core_
.Point2D_y_get
, _core_
.Point2D_y_set
)
1538 def Set(*args
, **kwargs
):
1539 """Set(self, double x=0, double y=0)"""
1540 return _core_
.Point2D_Set(*args
, **kwargs
)
1542 def Get(*args
, **kwargs
):
1546 Return x and y properties as a tuple.
1548 return _core_
.Point2D_Get(*args
, **kwargs
)
1550 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
1551 def __str__(self
): return str(self
.Get())
1552 def __repr__(self
): return 'wx.Point2D'+str(self
.Get())
1553 def __len__(self
): return len(self
.Get())
1554 def __getitem__(self
, index
): return self
.Get()[index
]
1555 def __setitem__(self
, index
, val
):
1556 if index
== 0: self
.x
= val
1557 elif index
== 1: self
.y
= val
1558 else: raise IndexError
1559 def __nonzero__(self
): return self
.Get() != (0.0, 0.0)
1560 __safe_for_unpickling__
= True
1561 def __reduce__(self
): return (wx
.Point2D
, self
.Get())
1564 class Point2DPtr(Point2D
):
1565 def __init__(self
, this
):
1567 if not hasattr(self
,"thisown"): self
.thisown
= 0
1568 self
.__class
__ = Point2D
1569 _core_
.Point2D_swigregister(Point2DPtr
)
1571 def Point2DCopy(*args
, **kwargs
):
1573 Point2DCopy(Point2D pt) -> Point2D
1575 Create a w.Point2D object.
1577 val
= _core_
.new_Point2DCopy(*args
, **kwargs
)
1581 def Point2DFromPoint(*args
, **kwargs
):
1583 Point2DFromPoint(Point pt) -> Point2D
1585 Create a w.Point2D object.
1587 val
= _core_
.new_Point2DFromPoint(*args
, **kwargs
)
1591 #---------------------------------------------------------------------------
1593 FromStart
= _core_
.FromStart
1594 FromCurrent
= _core_
.FromCurrent
1595 FromEnd
= _core_
.FromEnd
1596 class InputStream(object):
1597 """Proxy of C++ InputStream class"""
1599 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1600 def __init__(self
, *args
, **kwargs
):
1601 """__init__(self, PyObject p) -> InputStream"""
1602 newobj
= _core_
.new_InputStream(*args
, **kwargs
)
1603 self
.this
= newobj
.this
1606 def __del__(self
, destroy
=_core_
.delete_InputStream
):
1609 if self
.thisown
: destroy(self
)
1612 def close(*args
, **kwargs
):
1614 return _core_
.InputStream_close(*args
, **kwargs
)
1616 def flush(*args
, **kwargs
):
1618 return _core_
.InputStream_flush(*args
, **kwargs
)
1620 def eof(*args
, **kwargs
):
1621 """eof(self) -> bool"""
1622 return _core_
.InputStream_eof(*args
, **kwargs
)
1624 def read(*args
, **kwargs
):
1625 """read(self, int size=-1) -> PyObject"""
1626 return _core_
.InputStream_read(*args
, **kwargs
)
1628 def readline(*args
, **kwargs
):
1629 """readline(self, int size=-1) -> PyObject"""
1630 return _core_
.InputStream_readline(*args
, **kwargs
)
1632 def readlines(*args
, **kwargs
):
1633 """readlines(self, int sizehint=-1) -> PyObject"""
1634 return _core_
.InputStream_readlines(*args
, **kwargs
)
1636 def seek(*args
, **kwargs
):
1637 """seek(self, int offset, int whence=0)"""
1638 return _core_
.InputStream_seek(*args
, **kwargs
)
1640 def tell(*args
, **kwargs
):
1641 """tell(self) -> int"""
1642 return _core_
.InputStream_tell(*args
, **kwargs
)
1644 def Peek(*args
, **kwargs
):
1645 """Peek(self) -> char"""
1646 return _core_
.InputStream_Peek(*args
, **kwargs
)
1648 def GetC(*args
, **kwargs
):
1649 """GetC(self) -> char"""
1650 return _core_
.InputStream_GetC(*args
, **kwargs
)
1652 def LastRead(*args
, **kwargs
):
1653 """LastRead(self) -> size_t"""
1654 return _core_
.InputStream_LastRead(*args
, **kwargs
)
1656 def CanRead(*args
, **kwargs
):
1657 """CanRead(self) -> bool"""
1658 return _core_
.InputStream_CanRead(*args
, **kwargs
)
1660 def Eof(*args
, **kwargs
):
1661 """Eof(self) -> bool"""
1662 return _core_
.InputStream_Eof(*args
, **kwargs
)
1664 def Ungetch(*args
, **kwargs
):
1665 """Ungetch(self, char c) -> bool"""
1666 return _core_
.InputStream_Ungetch(*args
, **kwargs
)
1668 def SeekI(*args
, **kwargs
):
1669 """SeekI(self, long pos, int mode=FromStart) -> long"""
1670 return _core_
.InputStream_SeekI(*args
, **kwargs
)
1672 def TellI(*args
, **kwargs
):
1673 """TellI(self) -> long"""
1674 return _core_
.InputStream_TellI(*args
, **kwargs
)
1677 class InputStreamPtr(InputStream
):
1678 def __init__(self
, this
):
1680 if not hasattr(self
,"thisown"): self
.thisown
= 0
1681 self
.__class
__ = InputStream
1682 _core_
.InputStream_swigregister(InputStreamPtr
)
1683 DefaultPosition
= cvar
.DefaultPosition
1684 DefaultSize
= cvar
.DefaultSize
1686 class OutputStream(object):
1687 """Proxy of C++ OutputStream class"""
1688 def __init__(self
): raise RuntimeError, "No constructor defined"
1690 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1691 def write(*args
, **kwargs
):
1692 """write(self, PyObject obj)"""
1693 return _core_
.OutputStream_write(*args
, **kwargs
)
1696 class OutputStreamPtr(OutputStream
):
1697 def __init__(self
, this
):
1699 if not hasattr(self
,"thisown"): self
.thisown
= 0
1700 self
.__class
__ = OutputStream
1701 _core_
.OutputStream_swigregister(OutputStreamPtr
)
1703 #---------------------------------------------------------------------------
1705 class FSFile(Object
):
1706 """Proxy of C++ FSFile class"""
1708 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1709 def __init__(self
, *args
, **kwargs
):
1711 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1712 DateTime modif) -> FSFile
1714 newobj
= _core_
.new_FSFile(*args
, **kwargs
)
1715 self
.this
= newobj
.this
1718 self
.thisown
= 0 # It will normally be deleted by the user of the wx.FileSystem
1720 def __del__(self
, destroy
=_core_
.delete_FSFile
):
1723 if self
.thisown
: destroy(self
)
1726 def GetStream(*args
, **kwargs
):
1727 """GetStream(self) -> InputStream"""
1728 return _core_
.FSFile_GetStream(*args
, **kwargs
)
1730 def GetMimeType(*args
, **kwargs
):
1731 """GetMimeType(self) -> String"""
1732 return _core_
.FSFile_GetMimeType(*args
, **kwargs
)
1734 def GetLocation(*args
, **kwargs
):
1735 """GetLocation(self) -> String"""
1736 return _core_
.FSFile_GetLocation(*args
, **kwargs
)
1738 def GetAnchor(*args
, **kwargs
):
1739 """GetAnchor(self) -> String"""
1740 return _core_
.FSFile_GetAnchor(*args
, **kwargs
)
1742 def GetModificationTime(*args
, **kwargs
):
1743 """GetModificationTime(self) -> DateTime"""
1744 return _core_
.FSFile_GetModificationTime(*args
, **kwargs
)
1747 class FSFilePtr(FSFile
):
1748 def __init__(self
, this
):
1750 if not hasattr(self
,"thisown"): self
.thisown
= 0
1751 self
.__class
__ = FSFile
1752 _core_
.FSFile_swigregister(FSFilePtr
)
1754 class CPPFileSystemHandler(object):
1755 """Proxy of C++ CPPFileSystemHandler class"""
1756 def __init__(self
): raise RuntimeError, "No constructor defined"
1758 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1760 class CPPFileSystemHandlerPtr(CPPFileSystemHandler
):
1761 def __init__(self
, this
):
1763 if not hasattr(self
,"thisown"): self
.thisown
= 0
1764 self
.__class
__ = CPPFileSystemHandler
1765 _core_
.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr
)
1767 class FileSystemHandler(CPPFileSystemHandler
):
1768 """Proxy of C++ FileSystemHandler class"""
1770 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1771 def __init__(self
, *args
, **kwargs
):
1772 """__init__(self) -> FileSystemHandler"""
1773 newobj
= _core_
.new_FileSystemHandler(*args
, **kwargs
)
1774 self
.this
= newobj
.this
1777 self
._setCallbackInfo
(self
, FileSystemHandler
)
1779 def _setCallbackInfo(*args
, **kwargs
):
1780 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1781 return _core_
.FileSystemHandler__setCallbackInfo(*args
, **kwargs
)
1783 def CanOpen(*args
, **kwargs
):
1784 """CanOpen(self, String location) -> bool"""
1785 return _core_
.FileSystemHandler_CanOpen(*args
, **kwargs
)
1787 def OpenFile(*args
, **kwargs
):
1788 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1789 return _core_
.FileSystemHandler_OpenFile(*args
, **kwargs
)
1791 def FindFirst(*args
, **kwargs
):
1792 """FindFirst(self, String spec, int flags=0) -> String"""
1793 return _core_
.FileSystemHandler_FindFirst(*args
, **kwargs
)
1795 def FindNext(*args
, **kwargs
):
1796 """FindNext(self) -> String"""
1797 return _core_
.FileSystemHandler_FindNext(*args
, **kwargs
)
1799 def GetProtocol(*args
, **kwargs
):
1800 """GetProtocol(self, String location) -> String"""
1801 return _core_
.FileSystemHandler_GetProtocol(*args
, **kwargs
)
1803 def GetLeftLocation(*args
, **kwargs
):
1804 """GetLeftLocation(self, String location) -> String"""
1805 return _core_
.FileSystemHandler_GetLeftLocation(*args
, **kwargs
)
1807 def GetAnchor(*args
, **kwargs
):
1808 """GetAnchor(self, String location) -> String"""
1809 return _core_
.FileSystemHandler_GetAnchor(*args
, **kwargs
)
1811 def GetRightLocation(*args
, **kwargs
):
1812 """GetRightLocation(self, String location) -> String"""
1813 return _core_
.FileSystemHandler_GetRightLocation(*args
, **kwargs
)
1815 def GetMimeTypeFromExt(*args
, **kwargs
):
1816 """GetMimeTypeFromExt(self, String location) -> String"""
1817 return _core_
.FileSystemHandler_GetMimeTypeFromExt(*args
, **kwargs
)
1820 class FileSystemHandlerPtr(FileSystemHandler
):
1821 def __init__(self
, this
):
1823 if not hasattr(self
,"thisown"): self
.thisown
= 0
1824 self
.__class
__ = FileSystemHandler
1825 _core_
.FileSystemHandler_swigregister(FileSystemHandlerPtr
)
1827 class FileSystem(Object
):
1828 """Proxy of C++ FileSystem class"""
1830 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1831 def __init__(self
, *args
, **kwargs
):
1832 """__init__(self) -> FileSystem"""
1833 newobj
= _core_
.new_FileSystem(*args
, **kwargs
)
1834 self
.this
= newobj
.this
1837 def __del__(self
, destroy
=_core_
.delete_FileSystem
):
1840 if self
.thisown
: destroy(self
)
1843 def ChangePathTo(*args
, **kwargs
):
1844 """ChangePathTo(self, String location, bool is_dir=False)"""
1845 return _core_
.FileSystem_ChangePathTo(*args
, **kwargs
)
1847 def GetPath(*args
, **kwargs
):
1848 """GetPath(self) -> String"""
1849 return _core_
.FileSystem_GetPath(*args
, **kwargs
)
1851 def OpenFile(*args
, **kwargs
):
1852 """OpenFile(self, String location) -> FSFile"""
1853 return _core_
.FileSystem_OpenFile(*args
, **kwargs
)
1855 def FindFirst(*args
, **kwargs
):
1856 """FindFirst(self, String spec, int flags=0) -> String"""
1857 return _core_
.FileSystem_FindFirst(*args
, **kwargs
)
1859 def FindNext(*args
, **kwargs
):
1860 """FindNext(self) -> String"""
1861 return _core_
.FileSystem_FindNext(*args
, **kwargs
)
1863 def AddHandler(*args
, **kwargs
):
1864 """AddHandler(CPPFileSystemHandler handler)"""
1865 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1867 AddHandler
= staticmethod(AddHandler
)
1868 def CleanUpHandlers(*args
, **kwargs
):
1869 """CleanUpHandlers()"""
1870 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1872 CleanUpHandlers
= staticmethod(CleanUpHandlers
)
1873 def FileNameToURL(*args
, **kwargs
):
1874 """FileNameToURL(String filename) -> String"""
1875 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1877 FileNameToURL
= staticmethod(FileNameToURL
)
1878 def URLToFileName(*args
, **kwargs
):
1879 """URLToFileName(String url) -> String"""
1880 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1882 URLToFileName
= staticmethod(URLToFileName
)
1884 class FileSystemPtr(FileSystem
):
1885 def __init__(self
, this
):
1887 if not hasattr(self
,"thisown"): self
.thisown
= 0
1888 self
.__class
__ = FileSystem
1889 _core_
.FileSystem_swigregister(FileSystemPtr
)
1891 def FileSystem_AddHandler(*args
, **kwargs
):
1892 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1893 return _core_
.FileSystem_AddHandler(*args
, **kwargs
)
1895 def FileSystem_CleanUpHandlers(*args
, **kwargs
):
1896 """FileSystem_CleanUpHandlers()"""
1897 return _core_
.FileSystem_CleanUpHandlers(*args
, **kwargs
)
1899 def FileSystem_FileNameToURL(*args
, **kwargs
):
1900 """FileSystem_FileNameToURL(String filename) -> String"""
1901 return _core_
.FileSystem_FileNameToURL(*args
, **kwargs
)
1903 def FileSystem_URLToFileName(*args
, **kwargs
):
1904 """FileSystem_URLToFileName(String url) -> String"""
1905 return _core_
.FileSystem_URLToFileName(*args
, **kwargs
)
1907 class InternetFSHandler(CPPFileSystemHandler
):
1908 """Proxy of C++ InternetFSHandler class"""
1910 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1911 def __init__(self
, *args
, **kwargs
):
1912 """__init__(self) -> InternetFSHandler"""
1913 newobj
= _core_
.new_InternetFSHandler(*args
, **kwargs
)
1914 self
.this
= newobj
.this
1917 def CanOpen(*args
, **kwargs
):
1918 """CanOpen(self, String location) -> bool"""
1919 return _core_
.InternetFSHandler_CanOpen(*args
, **kwargs
)
1921 def OpenFile(*args
, **kwargs
):
1922 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1923 return _core_
.InternetFSHandler_OpenFile(*args
, **kwargs
)
1926 class InternetFSHandlerPtr(InternetFSHandler
):
1927 def __init__(self
, this
):
1929 if not hasattr(self
,"thisown"): self
.thisown
= 0
1930 self
.__class
__ = InternetFSHandler
1931 _core_
.InternetFSHandler_swigregister(InternetFSHandlerPtr
)
1933 class ZipFSHandler(CPPFileSystemHandler
):
1934 """Proxy of C++ ZipFSHandler class"""
1936 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
1937 def __init__(self
, *args
, **kwargs
):
1938 """__init__(self) -> ZipFSHandler"""
1939 newobj
= _core_
.new_ZipFSHandler(*args
, **kwargs
)
1940 self
.this
= newobj
.this
1943 def CanOpen(*args
, **kwargs
):
1944 """CanOpen(self, String location) -> bool"""
1945 return _core_
.ZipFSHandler_CanOpen(*args
, **kwargs
)
1947 def OpenFile(*args
, **kwargs
):
1948 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1949 return _core_
.ZipFSHandler_OpenFile(*args
, **kwargs
)
1951 def FindFirst(*args
, **kwargs
):
1952 """FindFirst(self, String spec, int flags=0) -> String"""
1953 return _core_
.ZipFSHandler_FindFirst(*args
, **kwargs
)
1955 def FindNext(*args
, **kwargs
):
1956 """FindNext(self) -> String"""
1957 return _core_
.ZipFSHandler_FindNext(*args
, **kwargs
)
1960 class ZipFSHandlerPtr(ZipFSHandler
):
1961 def __init__(self
, this
):
1963 if not hasattr(self
,"thisown"): self
.thisown
= 0
1964 self
.__class
__ = ZipFSHandler
1965 _core_
.ZipFSHandler_swigregister(ZipFSHandlerPtr
)
1968 def __wxMemoryFSHandler_AddFile_wxImage(*args
, **kwargs
):
1969 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1970 return _core_
.__wxMemoryFSHandler
_AddFile
_wxImage
(*args
, **kwargs
)
1972 def __wxMemoryFSHandler_AddFile_wxBitmap(*args
, **kwargs
):
1973 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1974 return _core_
.__wxMemoryFSHandler
_AddFile
_wxBitmap
(*args
, **kwargs
)
1976 def __wxMemoryFSHandler_AddFile_Data(*args
, **kwargs
):
1977 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1978 return _core_
.__wxMemoryFSHandler
_AddFile
_Data
(*args
, **kwargs
)
1979 def MemoryFSHandler_AddFile(filename
, dataItem
, imgType
=-1):
1981 Add 'file' to the memory filesystem. The dataItem parameter can
1982 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1983 arbitrary data. If a bitmap or image is used then the imgType
1984 parameter should specify what kind of image file it should be
1985 written as, wx.BITMAP_TYPE_PNG, etc.
1987 if isinstance(dataItem
, wx
.Image
):
1988 __wxMemoryFSHandler_AddFile_wxImage(filename
, dataItem
, imgType
)
1989 elif isinstance(dataItem
, wx
.Bitmap
):
1990 __wxMemoryFSHandler_AddFile_wxBitmap(filename
, dataItem
, imgType
)
1991 elif type(dataItem
) == str:
1992 __wxMemoryFSHandler_AddFile_Data(filename
, dataItem
)
1994 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1996 class MemoryFSHandler(CPPFileSystemHandler
):
1997 """Proxy of C++ MemoryFSHandler class"""
1999 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2000 def __init__(self
, *args
, **kwargs
):
2001 """__init__(self) -> MemoryFSHandler"""
2002 newobj
= _core_
.new_MemoryFSHandler(*args
, **kwargs
)
2003 self
.this
= newobj
.this
2006 def RemoveFile(*args
, **kwargs
):
2007 """RemoveFile(String filename)"""
2008 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2010 RemoveFile
= staticmethod(RemoveFile
)
2011 AddFile
= staticmethod(MemoryFSHandler_AddFile
)
2012 def CanOpen(*args
, **kwargs
):
2013 """CanOpen(self, String location) -> bool"""
2014 return _core_
.MemoryFSHandler_CanOpen(*args
, **kwargs
)
2016 def OpenFile(*args
, **kwargs
):
2017 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2018 return _core_
.MemoryFSHandler_OpenFile(*args
, **kwargs
)
2020 def FindFirst(*args
, **kwargs
):
2021 """FindFirst(self, String spec, int flags=0) -> String"""
2022 return _core_
.MemoryFSHandler_FindFirst(*args
, **kwargs
)
2024 def FindNext(*args
, **kwargs
):
2025 """FindNext(self) -> String"""
2026 return _core_
.MemoryFSHandler_FindNext(*args
, **kwargs
)
2029 class MemoryFSHandlerPtr(MemoryFSHandler
):
2030 def __init__(self
, this
):
2032 if not hasattr(self
,"thisown"): self
.thisown
= 0
2033 self
.__class
__ = MemoryFSHandler
2034 _core_
.MemoryFSHandler_swigregister(MemoryFSHandlerPtr
)
2036 def MemoryFSHandler_RemoveFile(*args
, **kwargs
):
2037 """MemoryFSHandler_RemoveFile(String filename)"""
2038 return _core_
.MemoryFSHandler_RemoveFile(*args
, **kwargs
)
2040 IMAGE_ALPHA_TRANSPARENT
= _core_
.IMAGE_ALPHA_TRANSPARENT
2041 IMAGE_ALPHA_THRESHOLD
= _core_
.IMAGE_ALPHA_THRESHOLD
2042 IMAGE_ALPHA_OPAQUE
= _core_
.IMAGE_ALPHA_OPAQUE
2043 #---------------------------------------------------------------------------
2045 class ImageHandler(Object
):
2047 This is the base class for implementing image file loading/saving, and
2048 image creation from data. It is used within `wx.Image` and is not
2049 normally seen by the application.
2051 def __init__(self
): raise RuntimeError, "No constructor defined"
2053 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2054 def GetName(*args
, **kwargs
):
2055 """GetName(self) -> String"""
2056 return _core_
.ImageHandler_GetName(*args
, **kwargs
)
2058 def GetExtension(*args
, **kwargs
):
2059 """GetExtension(self) -> String"""
2060 return _core_
.ImageHandler_GetExtension(*args
, **kwargs
)
2062 def GetType(*args
, **kwargs
):
2063 """GetType(self) -> long"""
2064 return _core_
.ImageHandler_GetType(*args
, **kwargs
)
2066 def GetMimeType(*args
, **kwargs
):
2067 """GetMimeType(self) -> String"""
2068 return _core_
.ImageHandler_GetMimeType(*args
, **kwargs
)
2070 def CanRead(*args
, **kwargs
):
2071 """CanRead(self, String name) -> bool"""
2072 return _core_
.ImageHandler_CanRead(*args
, **kwargs
)
2074 def SetName(*args
, **kwargs
):
2075 """SetName(self, String name)"""
2076 return _core_
.ImageHandler_SetName(*args
, **kwargs
)
2078 def SetExtension(*args
, **kwargs
):
2079 """SetExtension(self, String extension)"""
2080 return _core_
.ImageHandler_SetExtension(*args
, **kwargs
)
2082 def SetType(*args
, **kwargs
):
2083 """SetType(self, long type)"""
2084 return _core_
.ImageHandler_SetType(*args
, **kwargs
)
2086 def SetMimeType(*args
, **kwargs
):
2087 """SetMimeType(self, String mimetype)"""
2088 return _core_
.ImageHandler_SetMimeType(*args
, **kwargs
)
2091 class ImageHandlerPtr(ImageHandler
):
2092 def __init__(self
, this
):
2094 if not hasattr(self
,"thisown"): self
.thisown
= 0
2095 self
.__class
__ = ImageHandler
2096 _core_
.ImageHandler_swigregister(ImageHandlerPtr
)
2098 class ImageHistogram(object):
2099 """Proxy of C++ ImageHistogram class"""
2101 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2102 def __init__(self
, *args
, **kwargs
):
2103 """__init__(self) -> ImageHistogram"""
2104 newobj
= _core_
.new_ImageHistogram(*args
, **kwargs
)
2105 self
.this
= newobj
.this
2108 def MakeKey(*args
, **kwargs
):
2110 MakeKey(byte r, byte g, byte b) -> unsigned long
2112 Get the key in the histogram for the given RGB values
2114 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2116 MakeKey
= staticmethod(MakeKey
)
2117 def FindFirstUnusedColour(*args
, **kwargs
):
2119 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2121 Find first colour that is not used in the image and has higher RGB
2122 values than startR, startG, startB. Returns a tuple consisting of a
2123 success flag and rgb values.
2125 return _core_
.ImageHistogram_FindFirstUnusedColour(*args
, **kwargs
)
2127 def GetCount(*args
, **kwargs
):
2129 GetCount(self, unsigned long key) -> unsigned long
2131 Returns the pixel count for the given key. Use `MakeKey` to create a
2132 key value from a RGB tripple.
2134 return _core_
.ImageHistogram_GetCount(*args
, **kwargs
)
2136 def GetCountRGB(*args
, **kwargs
):
2138 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
2140 Returns the pixel count for the given RGB values.
2142 return _core_
.ImageHistogram_GetCountRGB(*args
, **kwargs
)
2144 def GetCountColour(*args
, **kwargs
):
2146 GetCountColour(self, Colour colour) -> unsigned long
2148 Returns the pixel count for the given `wx.Colour` value.
2150 return _core_
.ImageHistogram_GetCountColour(*args
, **kwargs
)
2153 class ImageHistogramPtr(ImageHistogram
):
2154 def __init__(self
, this
):
2156 if not hasattr(self
,"thisown"): self
.thisown
= 0
2157 self
.__class
__ = ImageHistogram
2158 _core_
.ImageHistogram_swigregister(ImageHistogramPtr
)
2160 def ImageHistogram_MakeKey(*args
, **kwargs
):
2162 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
2164 Get the key in the histogram for the given RGB values
2166 return _core_
.ImageHistogram_MakeKey(*args
, **kwargs
)
2168 class Image(Object
):
2170 A platform-independent image class. An image can be created from
2171 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2172 variety of formats. Functions are available to set and get image
2173 bits, so it can be used for basic image manipulation.
2175 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2176 platform-specific `wx.Bitmap` object must be created from it using the
2177 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2178 device context, using `wx.DC.DrawBitmap`.
2180 One colour value of the image may be used as a mask colour which will
2181 lead to the automatic creation of a `wx.Mask` object associated to the
2184 wx.Image supports alpha channel data, that is in addition to a byte
2185 for the red, green and blue colour components for each pixel it also
2186 stores a byte representing the pixel opacity. An alpha value of 0
2187 corresponds to a transparent pixel (null opacity) while a value of 255
2188 means that the pixel is 100% opaque.
2190 Unlike RGB data, not all images have an alpha channel and before using
2191 `GetAlpha` you should check if this image contains an alpha channel
2192 with `HasAlpha`. Note that currently only images loaded from PNG files
2193 with transparency information will have an alpha channel.
2196 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
2197 def __init__(self
, *args
, **kwargs
):
2199 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2201 Loads an image from a file.
2203 newobj
= _core_
.new_Image(*args
, **kwargs
)
2204 self
.this
= newobj
.this
2207 def __del__(self
, destroy
=_core_
.delete_Image
):
2210 if self
.thisown
: destroy(self
)
2213 def Create(*args
, **kwargs
):
2215 Create(self, int width, int height, bool clear=True)
2217 Creates a fresh image. If clear is ``True``, the new image will be
2218 initialized to black. Otherwise, the image data will be uninitialized.
2220 return _core_
.Image_Create(*args
, **kwargs
)
2222 def Destroy(*args
, **kwargs
):
2226 Destroys the image data.
2228 return _core_
.Image_Destroy(*args
, **kwargs
)
2230 def Scale(*args
, **kwargs
):
2232 Scale(self, int width, int height) -> Image
2234 Returns a scaled version of the image. This is also useful for scaling
2235 bitmaps in general as the only other way to scale bitmaps is to blit a
2236 `wx.MemoryDC` into another `wx.MemoryDC`.
2238 return _core_
.Image_Scale(*args
, **kwargs
)
2240 def ShrinkBy(*args
, **kwargs
):
2242 ShrinkBy(self, int xFactor, int yFactor) -> Image
2244 Return a version of the image scaled smaller by the given factors.
2246 return _core_
.Image_ShrinkBy(*args
, **kwargs
)
2248 def Rescale(*args
, **kwargs
):
2250 Rescale(self, int width, int height) -> Image
2252 Changes the size of the image in-place by scaling it: after a call to
2253 this function, the image will have the given width and height.
2255 Returns the (modified) image itself.
2257 return _core_
.Image_Rescale(*args
, **kwargs
)
2259 def Resize(*args
, **kwargs
):
2261 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2263 Changes the size of the image in-place without scaling it, by adding
2264 either a border with the given colour or cropping as necessary. The
2265 image is pasted into a new image with the given size and background
2266 colour at the position pos relative to the upper left of the new
2267 image. If red = green = blue = -1 then use either the current mask
2268 colour if set or find, use, and set a suitable mask colour for any
2269 newly exposed areas.
2271 Returns the (modified) image itself.
2273 return _core_
.Image_Resize(*args
, **kwargs
)
2275 def SetRGB(*args
, **kwargs
):
2277 SetRGB(self, int x, int y, byte r, byte g, byte b)
2279 Sets the pixel at the given coordinate. This routine performs
2280 bounds-checks for the coordinate so it can be considered a safe way to
2281 manipulate the data, but in some cases this might be too slow so that
2282 the data will have to be set directly. In that case you will have to
2283 get access to the image data using the `GetData` method.
2285 return _core_
.Image_SetRGB(*args
, **kwargs
)
2287 def SetRGBRect(*args
, **kwargs
):
2289 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2291 Sets the colour of the pixels within the given rectangle. This routine
2292 performs bounds-checks for the rectangle so it can be considered a
2293 safe way to manipulate the data.
2295 return _core_
.Image_SetRGBRect(*args
, **kwargs
)
2297 def GetRed(*args
, **kwargs
):
2299 GetRed(self, int x, int y) -> byte
2301 Returns the red intensity at the given coordinate.
2303 return _core_
.Image_GetRed(*args
, **kwargs
)
2305 def GetGreen(*args
, **kwargs
):
2307 GetGreen(self, int x, int y) -> byte
2309 Returns the green intensity at the given coordinate.
2311 return _core_
.Image_GetGreen(*args
, **kwargs
)
2313 def GetBlue(*args
, **kwargs
):
2315 GetBlue(self, int x, int y) -> byte
2317 Returns the blue intensity at the given coordinate.
2319 return _core_
.Image_GetBlue(*args
, **kwargs
)
2321 def SetAlpha(*args
, **kwargs
):
2323 SetAlpha(self, int x, int y, byte alpha)
2325 Sets the alpha value for the given pixel. This function should only be
2326 called if the image has alpha channel data, use `HasAlpha` to check
2329 return _core_
.Image_SetAlpha(*args
, **kwargs
)
2331 def GetAlpha(*args
, **kwargs
):
2333 GetAlpha(self, int x, int y) -> byte
2335 Returns the alpha value for the given pixel. This function may only be
2336 called for the images with alpha channel, use `HasAlpha` to check for
2339 The returned value is the *opacity* of the image, i.e. the value of 0
2340 corresponds to the fully transparent pixels while the value of 255 to
2341 the fully opaque pixels.
2343 return _core_
.Image_GetAlpha(*args
, **kwargs
)
2345 def HasAlpha(*args
, **kwargs
):
2347 HasAlpha(self) -> bool
2349 Returns true if this image has alpha channel, false otherwise.
2351 return _core_
.Image_HasAlpha(*args
, **kwargs
)
2353 def InitAlpha(*args
, **kwargs
):
2357 Initializes the image alpha channel data. It is an error to call it if
2358 the image already has alpha data. If it doesn't, alpha data will be by
2359 default initialized to all pixels being fully opaque. But if the image
2360 has a a mask colour, all mask pixels will be completely transparent.
2362 return _core_
.Image_InitAlpha(*args
, **kwargs
)
2364 def IsTransparent(*args
, **kwargs
):
2366 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2368 Returns ``True`` if this pixel is masked or has an alpha value less
2369 than the spcified threshold.
2371 return _core_
.Image_IsTransparent(*args
, **kwargs
)
2373 def FindFirstUnusedColour(*args
, **kwargs
):
2375 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2377 Find first colour that is not used in the image and has higher RGB
2378 values than startR, startG, startB. Returns a tuple consisting of a
2379 success flag and rgb values.
2381 return _core_
.Image_FindFirstUnusedColour(*args
, **kwargs
)
2383 def ConvertAlphaToMask(*args
, **kwargs
):
2385 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2387 If the image has alpha channel, this method converts it to mask. All
2388 pixels with alpha value less than ``threshold`` are replaced with the
2389 mask colour and the alpha channel is removed. The mask colour is
2390 chosen automatically using `FindFirstUnusedColour`.
2392 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2395 return _core_
.Image_ConvertAlphaToMask(*args
, **kwargs
)
2397 def ConvertColourToAlpha(*args
, **kwargs
):
2399 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
2401 This method converts an image where the original alpha information is
2402 only available as a shades of a colour (actually shades of grey)
2403 typically when you draw anti-aliased text into a bitmap. The DC
2404 drawing routines draw grey values on the black background although
2405 they actually mean to draw white with differnt alpha values. This
2406 method reverses it, assuming a black (!) background and white text.
2407 The method will then fill up the whole image with the colour given.
2409 return _core_
.Image_ConvertColourToAlpha(*args
, **kwargs
)
2411 def SetMaskFromImage(*args
, **kwargs
):
2413 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2415 Sets the image's mask so that the pixels that have RGB value of
2416 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2417 by first finding an unused colour in the image, setting this colour as
2418 the mask colour and then using this colour to draw all pixels in the
2419 image who corresponding pixel in mask has given RGB value.
2421 Returns ``False`` if ``mask`` does not have same dimensions as the
2422 image or if there is no unused colour left. Returns ``True`` if the
2423 mask was successfully applied.
2425 Note that this method involves computing the histogram, which is
2426 computationally intensive operation.
2428 return _core_
.Image_SetMaskFromImage(*args
, **kwargs
)
2430 def CanRead(*args
, **kwargs
):
2432 CanRead(String filename) -> bool
2434 Returns True if the image handlers can read this file.
2436 return _core_
.Image_CanRead(*args
, **kwargs
)
2438 CanRead
= staticmethod(CanRead
)
2439 def GetImageCount(*args
, **kwargs
):
2441 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2443 If the image file contains more than one image and the image handler
2444 is capable of retrieving these individually, this function will return
2445 the number of available images.
2447 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2449 GetImageCount
= staticmethod(GetImageCount
)
2450 def LoadFile(*args
, **kwargs
):
2452 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2454 Loads an image from a file. If no handler type is provided, the
2455 library will try to autodetect the format.
2457 return _core_
.Image_LoadFile(*args
, **kwargs
)
2459 def LoadMimeFile(*args
, **kwargs
):
2461 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2463 Loads an image from a file, specifying the image type with a MIME type
2466 return _core_
.Image_LoadMimeFile(*args
, **kwargs
)
2468 def SaveFile(*args
, **kwargs
):
2470 SaveFile(self, String name, int type) -> bool
2472 Saves an image in the named file.
2474 return _core_
.Image_SaveFile(*args
, **kwargs
)
2476 def SaveMimeFile(*args
, **kwargs
):
2478 SaveMimeFile(self, String name, String mimetype) -> bool
2480 Saves an image in the named file.
2482 return _core_
.Image_SaveMimeFile(*args
, **kwargs
)
2484 def CanReadStream(*args
, **kwargs
):
2486 CanReadStream(InputStream stream) -> bool
2488 Returns True if the image handlers can read an image file from the
2489 data currently on the input stream, or a readable Python file-like
2492 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2494 CanReadStream
= staticmethod(CanReadStream
)
2495 def LoadStream(*args
, **kwargs
):
2497 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2499 Loads an image from an input stream or a readable Python file-like
2500 object. If no handler type is provided, the library will try to
2501 autodetect the format.
2503 return _core_
.Image_LoadStream(*args
, **kwargs
)
2505 def LoadMimeStream(*args
, **kwargs
):
2507 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2509 Loads an image from an input stream or a readable Python file-like
2510 object, using a MIME type string to specify the image file format.
2512 return _core_
.Image_LoadMimeStream(*args
, **kwargs
)
2514 def Ok(*args
, **kwargs
):
2518 Returns true if image data is present.
2520 return _core_
.Image_Ok(*args
, **kwargs
)
2522 def GetWidth(*args
, **kwargs
):
2524 GetWidth(self) -> int
2526 Gets the width of the image in pixels.
2528 return _core_
.Image_GetWidth(*args
, **kwargs
)
2530 def GetHeight(*args
, **kwargs
):
2532 GetHeight(self) -> int
2534 Gets the height of the image in pixels.
2536 return _core_
.Image_GetHeight(*args
, **kwargs
)
2538 def GetSize(*args
, **kwargs
):
2540 GetSize(self) -> Size
2542 Returns the size of the image in pixels.
2544 return _core_
.Image_GetSize(*args
, **kwargs
)
2546 def GetSubImage(*args
, **kwargs
):
2548 GetSubImage(self, Rect rect) -> Image
2550 Returns a sub image of the current one as long as the rect belongs
2551 entirely to the image.
2553 return _core_
.Image_GetSubImage(*args
, **kwargs
)
2555 def Size(*args
, **kwargs
):
2557 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2559 Returns a resized version of this image without scaling it by adding
2560 either a border with the given colour or cropping as necessary. The
2561 image is pasted into a new image with the given size and background
2562 colour at the position ``pos`` relative to the upper left of the new
2563 image. If red = green = blue = -1 then use either the current mask
2564 colour if set or find, use, and set a suitable mask colour for any
2565 newly exposed areas.
2567 return _core_
.Image_Size(*args
, **kwargs
)
2569 def Copy(*args
, **kwargs
):
2573 Returns an identical copy of the image.
2575 return _core_
.Image_Copy(*args
, **kwargs
)
2577 def Paste(*args
, **kwargs
):
2579 Paste(self, Image image, int x, int y)
2581 Pastes ``image`` into this instance and takes care of the mask colour
2582 and any out of bounds problems.
2584 return _core_
.Image_Paste(*args
, **kwargs
)
2586 def GetData(*args
, **kwargs
):
2588 GetData(self) -> PyObject
2590 Returns a string containing a copy of the RGB bytes of the image.
2592 return _core_
.Image_GetData(*args
, **kwargs
)
2594 def SetData(*args
, **kwargs
):
2596 SetData(self, buffer data)
2598 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2599 either a string or a buffer object holding the data and the length of
2600 the data must be width*height*3.
2602 return _core_
.Image_SetData(*args
, **kwargs
)
2604 def GetDataBuffer(*args
, **kwargs
):
2606 GetDataBuffer(self) -> PyObject
2608 Returns a writable Python buffer object that is pointing at the RGB
2609 image data buffer inside the wx.Image. You need to ensure that you do
2610 not use this buffer object after the image has been destroyed.
2612 return _core_
.Image_GetDataBuffer(*args
, **kwargs
)
2614 def SetDataBuffer(*args
, **kwargs
):
2616 SetDataBuffer(self, buffer data)
2618 Sets the internal image data pointer to point at a Python buffer
2619 object. This can save making an extra copy of the data but you must
2620 ensure that the buffer object lives longer than the wx.Image does.
2622 return _core_
.Image_SetDataBuffer(*args
, **kwargs
)
2624 def GetAlphaData(*args
, **kwargs
):
2626 GetAlphaData(self) -> PyObject
2628 Returns a string containing a copy of the alpha bytes of the image.
2630 return _core_
.Image_GetAlphaData(*args
, **kwargs
)
2632 def SetAlphaData(*args
, **kwargs
):
2634 SetAlphaData(self, buffer alpha)
2636 Resets the Image's alpha data from a buffer of bytes. Accepts either
2637 a string or a buffer object holding the data and the length of the
2638 data must be width*height.
2640 return _core_
.Image_SetAlphaData(*args
, **kwargs
)
2642 def GetAlphaBuffer(*args
, **kwargs
):
2643 """GetAlphaBuffer(self) -> PyObject"""
2644 return _core_
.Image_GetAlphaBuffer(*args
, **kwargs
)
2646 def SetAlphaBuffer(*args
, **kwargs
):
2647 """SetAlphaBuffer(self, buffer alpha)"""
2648 return _core_
.Image_SetAlphaBuffer(*args
, **kwargs
)
2650 def SetMaskColour(*args
, **kwargs
):
2652 SetMaskColour(self, byte r, byte g, byte b)
2654 Sets the mask colour for this image (and tells the image to use the
2657 return _core_
.Image_SetMaskColour(*args
, **kwargs
)
2659 def GetOrFindMaskColour(*args
, **kwargs
):
2661 GetOrFindMaskColour() -> (r,g,b)
2663 Get the current mask colour or find a suitable colour.
2665 return _core_
.Image_GetOrFindMaskColour(*args
, **kwargs
)
2667 def GetMaskRed(*args
, **kwargs
):
2669 GetMaskRed(self) -> byte
2671 Gets the red component of the mask colour.
2673 return _core_
.Image_GetMaskRed(*args
, **kwargs
)
2675 def GetMaskGreen(*args
, **kwargs
):
2677 GetMaskGreen(self) -> byte
2679 Gets the green component of the mask colour.
2681 return _core_
.Image_GetMaskGreen(*args
, **kwargs
)
2683 def GetMaskBlue(*args
, **kwargs
):
2685 GetMaskBlue(self) -> byte
2687 Gets the blue component of the mask colour.
2689 return _core_
.Image_GetMaskBlue(*args
, **kwargs
)
2691 def SetMask(*args
, **kwargs
):
2693 SetMask(self, bool mask=True)
2695 Specifies whether there is a mask or not. The area of the mask is
2696 determined by the current mask colour.
2698 return _core_
.Image_SetMask(*args
, **kwargs
)
2700 def HasMask(*args
, **kwargs
):
2702 HasMask(self) -> bool
2704 Returns ``True`` if there is a mask active, ``False`` otherwise.
2706 return _core_
.Image_HasMask(*args
, **kwargs
)
2708 def Rotate(*args
, **kwargs
):
2710 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2711 Point offset_after_rotation=None) -> Image
2713 Rotates the image about the given point, by ``angle`` radians. Passing
2714 ``True`` to ``interpolating`` results in better image quality, but is
2715 slower. If the image has a mask, then the mask colour is used for the
2716 uncovered pixels in the rotated image background. Otherwise, black
2717 will be used as the fill colour.
2719 Returns the rotated image, leaving this image intact.
2721 return _core_
.Image_Rotate(*args
, **kwargs
)
2723 def Rotate90(*args
, **kwargs
):
2725 Rotate90(self, bool clockwise=True) -> Image
2727 Returns a copy of the image rotated 90 degrees in the direction
2728 indicated by ``clockwise``.
2730 return _core_
.Image_Rotate90(*args
, **kwargs
)
2732 def Mirror(*args
, **kwargs
):
2734 Mirror(self, bool horizontally=True) -> Image
2736 Returns a mirrored copy of the image. The parameter ``horizontally``
2737 indicates the orientation.
2739 return _core_
.Image_Mirror(*args
, **kwargs
)
2741 def Replace(*args
, **kwargs
):
2743 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2745 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2748 return _core_
.Image_Replace(*args
, **kwargs
)
2750 def ConvertToMono(*args
, **kwargs
):
2752 ConvertToMono(self, byte r, byte g, byte b) -> Image
2754 Returns monochromatic version of the image. The returned image has
2755 white colour where the original has ``(r,g,b)`` colour and black
2756 colour everywhere else.
2758 return _core_
.Image_ConvertToMono(*args
, **kwargs
)
2760 def SetOption(*args
, **kwargs
):
2762 SetOption(self, String name, String value)
2764 Sets an image handler defined option. For example, when saving as a
2765 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2766 number between 0 and 100 (0 is terrible, 100 is very good).
2768 return _core_
.Image_SetOption(*args
, **kwargs
)
2770 def SetOptionInt(*args
, **kwargs
):
2772 SetOptionInt(self, String name, int value)
2774 Sets an image option as an integer.
2776 return _core_
.Image_SetOptionInt(*args
, **kwargs
)
2778 def GetOption(*args
, **kwargs
):
2780 GetOption(self, String name) -> String
2782 Gets the value of an image handler option.
2784 return _core_
.Image_GetOption(*args
, **kwargs
)
2786 def GetOptionInt(*args
, **kwargs
):
2788 GetOptionInt(self, String name) -> int
2790 Gets the value of an image handler option as an integer. If the given
2791 option is not present, the function returns 0.
2793 return _core_
.Image_GetOptionInt(*args
, **kwargs
)
2795 def HasOption(*args
, **kwargs
):
2797 HasOption(self, String name) -> bool
2799 Returns true if the given option is present.
2801 return _core_
.Image_HasOption(*args
, **kwargs
)
2803 def CountColours(*args
, **kwargs
):
2804 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2805 return _core_
.Image_CountColours(*args
, **kwargs
)
2807 def ComputeHistogram(*args
, **kwargs
):
2808 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2809 return _core_
.Image_ComputeHistogram(*args
, **kwargs
)
2811 def AddHandler(*args
, **kwargs
):
2812 """AddHandler(ImageHandler handler)"""
2813 return _core_
.Image_AddHandler(*args
, **kwargs
)
2815 AddHandler
= staticmethod(AddHandler
)
2816 def InsertHandler(*args
, **kwargs
):
2817 """InsertHandler(ImageHandler handler)"""
2818 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2820 InsertHandler
= staticmethod(InsertHandler
)
2821 def RemoveHandler(*args
, **kwargs
):
2822 """RemoveHandler(String name) -> bool"""
2823 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2825 RemoveHandler
= staticmethod(RemoveHandler
)
2826 def GetImageExtWildcard(*args
, **kwargs
):
2828 GetImageExtWildcard() -> String
2830 Iterates all registered wxImageHandler objects, and returns a string
2831 containing file extension masks suitable for passing to file open/save
2834 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2836 GetImageExtWildcard
= staticmethod(GetImageExtWildcard
)
2837 def ConvertToBitmap(*args
, **kwargs
):
2838 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2839 return _core_
.Image_ConvertToBitmap(*args
, **kwargs
)
2841 def ConvertToMonoBitmap(*args
, **kwargs
):
2842 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
2843 return _core_
.Image_ConvertToMonoBitmap(*args
, **kwargs
)
2845 def __nonzero__(self
): return self
.Ok()
2847 class ImagePtr(Image
):
2848 def __init__(self
, this
):
2850 if not hasattr(self
,"thisown"): self
.thisown
= 0
2851 self
.__class
__ = Image
2852 _core_
.Image_swigregister(ImagePtr
)
2854 def ImageFromMime(*args
, **kwargs
):
2856 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2858 Loads an image from a file, using a MIME type string (such as
2859 'image/jpeg') to specify image type.
2861 val
= _core_
.new_ImageFromMime(*args
, **kwargs
)
2865 def ImageFromStream(*args
, **kwargs
):
2867 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2869 Loads an image from an input stream, or any readable Python file-like
2872 val
= _core_
.new_ImageFromStream(*args
, **kwargs
)
2876 def ImageFromStreamMime(*args
, **kwargs
):
2878 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2880 Loads an image from an input stream, or any readable Python file-like
2881 object, specifying the image format with a MIME type string.
2883 val
= _core_
.new_ImageFromStreamMime(*args
, **kwargs
)
2887 def EmptyImage(*args
, **kwargs
):
2889 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2891 Construct an empty image of a given size, optionally setting all
2894 val
= _core_
.new_EmptyImage(*args
, **kwargs
)
2898 def ImageFromBitmap(*args
, **kwargs
):
2900 ImageFromBitmap(Bitmap bitmap) -> Image
2902 Construct an Image from a `wx.Bitmap`.
2904 val
= _core_
.new_ImageFromBitmap(*args
, **kwargs
)
2908 def ImageFromData(*args
, **kwargs
):
2910 ImageFromData(int width, int height, buffer data) -> Image
2912 Construct an Image from a buffer of RGB bytes. Accepts either a
2913 string or a buffer object holding the data and the length of the data
2914 must be width*height*3.
2916 val
= _core_
.new_ImageFromData(*args
, **kwargs
)
2920 def ImageFromDataWithAlpha(*args
, **kwargs
):
2922 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2924 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2925 Accepts either a string or a buffer object holding the data and the
2926 length of the data must be width*height*3 bytes, and the length of the
2927 alpha data must be width*height bytes.
2929 val
= _core_
.new_ImageFromDataWithAlpha(*args
, **kwargs
)
2933 def Image_CanRead(*args
, **kwargs
):
2935 Image_CanRead(String filename) -> bool
2937 Returns True if the image handlers can read this file.
2939 return _core_
.Image_CanRead(*args
, **kwargs
)
2941 def Image_GetImageCount(*args
, **kwargs
):
2943 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2945 If the image file contains more than one image and the image handler
2946 is capable of retrieving these individually, this function will return
2947 the number of available images.
2949 return _core_
.Image_GetImageCount(*args
, **kwargs
)
2951 def Image_CanReadStream(*args
, **kwargs
):
2953 Image_CanReadStream(InputStream stream) -> bool
2955 Returns True if the image handlers can read an image file from the
2956 data currently on the input stream, or a readable Python file-like
2959 return _core_
.Image_CanReadStream(*args
, **kwargs
)
2961 def Image_AddHandler(*args
, **kwargs
):
2962 """Image_AddHandler(ImageHandler handler)"""
2963 return _core_
.Image_AddHandler(*args
, **kwargs
)
2965 def Image_InsertHandler(*args
, **kwargs
):
2966 """Image_InsertHandler(ImageHandler handler)"""
2967 return _core_
.Image_InsertHandler(*args
, **kwargs
)
2969 def Image_RemoveHandler(*args
, **kwargs
):
2970 """Image_RemoveHandler(String name) -> bool"""
2971 return _core_
.Image_RemoveHandler(*args
, **kwargs
)
2973 def Image_GetImageExtWildcard(*args
, **kwargs
):
2975 Image_GetImageExtWildcard() -> String
2977 Iterates all registered wxImageHandler objects, and returns a string
2978 containing file extension masks suitable for passing to file open/save
2981 return _core_
.Image_GetImageExtWildcard(*args
, **kwargs
)
2983 def InitAllImageHandlers():
2985 The former functionality of InitAllImageHanders is now done internal to
2986 the _core_ extension module and so this function has become a simple NOP.
2990 IMAGE_RESOLUTION_INCHES
= _core_
.IMAGE_RESOLUTION_INCHES
2991 IMAGE_RESOLUTION_CM
= _core_
.IMAGE_RESOLUTION_CM
2992 PNG_TYPE_COLOUR
= _core_
.PNG_TYPE_COLOUR
2993 PNG_TYPE_GREY
= _core_
.PNG_TYPE_GREY
2994 PNG_TYPE_GREY_RED
= _core_
.PNG_TYPE_GREY_RED
2995 BMP_24BPP
= _core_
.BMP_24BPP
2996 BMP_8BPP
= _core_
.BMP_8BPP
2997 BMP_8BPP_GREY
= _core_
.BMP_8BPP_GREY
2998 BMP_8BPP_GRAY
= _core_
.BMP_8BPP_GRAY
2999 BMP_8BPP_RED
= _core_
.BMP_8BPP_RED
3000 BMP_8BPP_PALETTE
= _core_
.BMP_8BPP_PALETTE
3001 BMP_4BPP
= _core_
.BMP_4BPP
3002 BMP_1BPP
= _core_
.BMP_1BPP
3003 BMP_1BPP_BW
= _core_
.BMP_1BPP_BW
3004 class BMPHandler(ImageHandler
):
3005 """A `wx.ImageHandler` for \*.bmp bitmap files."""
3007 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3008 def __init__(self
, *args
, **kwargs
):
3010 __init__(self) -> BMPHandler
3012 A `wx.ImageHandler` for \*.bmp bitmap files.
3014 newobj
= _core_
.new_BMPHandler(*args
, **kwargs
)
3015 self
.this
= newobj
.this
3019 class BMPHandlerPtr(BMPHandler
):
3020 def __init__(self
, this
):
3022 if not hasattr(self
,"thisown"): self
.thisown
= 0
3023 self
.__class
__ = BMPHandler
3024 _core_
.BMPHandler_swigregister(BMPHandlerPtr
)
3025 NullImage
= cvar
.NullImage
3026 IMAGE_OPTION_FILENAME
= cvar
.IMAGE_OPTION_FILENAME
3027 IMAGE_OPTION_BMP_FORMAT
= cvar
.IMAGE_OPTION_BMP_FORMAT
3028 IMAGE_OPTION_CUR_HOTSPOT_X
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_X
3029 IMAGE_OPTION_CUR_HOTSPOT_Y
= cvar
.IMAGE_OPTION_CUR_HOTSPOT_Y
3030 IMAGE_OPTION_RESOLUTION
= cvar
.IMAGE_OPTION_RESOLUTION
3031 IMAGE_OPTION_RESOLUTIONX
= cvar
.IMAGE_OPTION_RESOLUTIONX
3032 IMAGE_OPTION_RESOLUTIONY
= cvar
.IMAGE_OPTION_RESOLUTIONY
3033 IMAGE_OPTION_RESOLUTIONUNIT
= cvar
.IMAGE_OPTION_RESOLUTIONUNIT
3034 IMAGE_OPTION_QUALITY
= cvar
.IMAGE_OPTION_QUALITY
3035 IMAGE_OPTION_BITSPERSAMPLE
= cvar
.IMAGE_OPTION_BITSPERSAMPLE
3036 IMAGE_OPTION_SAMPLESPERPIXEL
= cvar
.IMAGE_OPTION_SAMPLESPERPIXEL
3037 IMAGE_OPTION_COMPRESSION
= cvar
.IMAGE_OPTION_COMPRESSION
3038 IMAGE_OPTION_IMAGEDESCRIPTOR
= cvar
.IMAGE_OPTION_IMAGEDESCRIPTOR
3039 IMAGE_OPTION_PNG_FORMAT
= cvar
.IMAGE_OPTION_PNG_FORMAT
3040 IMAGE_OPTION_PNG_BITDEPTH
= cvar
.IMAGE_OPTION_PNG_BITDEPTH
3042 class ICOHandler(BMPHandler
):
3043 """A `wx.ImageHandler` for \*.ico icon files."""
3045 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3046 def __init__(self
, *args
, **kwargs
):
3048 __init__(self) -> ICOHandler
3050 A `wx.ImageHandler` for \*.ico icon files.
3052 newobj
= _core_
.new_ICOHandler(*args
, **kwargs
)
3053 self
.this
= newobj
.this
3057 class ICOHandlerPtr(ICOHandler
):
3058 def __init__(self
, this
):
3060 if not hasattr(self
,"thisown"): self
.thisown
= 0
3061 self
.__class
__ = ICOHandler
3062 _core_
.ICOHandler_swigregister(ICOHandlerPtr
)
3064 class CURHandler(ICOHandler
):
3065 """A `wx.ImageHandler` for \*.cur cursor files."""
3067 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3068 def __init__(self
, *args
, **kwargs
):
3070 __init__(self) -> CURHandler
3072 A `wx.ImageHandler` for \*.cur cursor files.
3074 newobj
= _core_
.new_CURHandler(*args
, **kwargs
)
3075 self
.this
= newobj
.this
3079 class CURHandlerPtr(CURHandler
):
3080 def __init__(self
, this
):
3082 if not hasattr(self
,"thisown"): self
.thisown
= 0
3083 self
.__class
__ = CURHandler
3084 _core_
.CURHandler_swigregister(CURHandlerPtr
)
3086 class ANIHandler(CURHandler
):
3087 """A `wx.ImageHandler` for \*.ani animated cursor files."""
3089 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3090 def __init__(self
, *args
, **kwargs
):
3092 __init__(self) -> ANIHandler
3094 A `wx.ImageHandler` for \*.ani animated cursor files.
3096 newobj
= _core_
.new_ANIHandler(*args
, **kwargs
)
3097 self
.this
= newobj
.this
3101 class ANIHandlerPtr(ANIHandler
):
3102 def __init__(self
, this
):
3104 if not hasattr(self
,"thisown"): self
.thisown
= 0
3105 self
.__class
__ = ANIHandler
3106 _core_
.ANIHandler_swigregister(ANIHandlerPtr
)
3108 class PNGHandler(ImageHandler
):
3109 """A `wx.ImageHandler` for PNG image files."""
3111 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3112 def __init__(self
, *args
, **kwargs
):
3114 __init__(self) -> PNGHandler
3116 A `wx.ImageHandler` for PNG image files.
3118 newobj
= _core_
.new_PNGHandler(*args
, **kwargs
)
3119 self
.this
= newobj
.this
3123 class PNGHandlerPtr(PNGHandler
):
3124 def __init__(self
, this
):
3126 if not hasattr(self
,"thisown"): self
.thisown
= 0
3127 self
.__class
__ = PNGHandler
3128 _core_
.PNGHandler_swigregister(PNGHandlerPtr
)
3130 class GIFHandler(ImageHandler
):
3131 """A `wx.ImageHandler` for GIF image files."""
3133 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3134 def __init__(self
, *args
, **kwargs
):
3136 __init__(self) -> GIFHandler
3138 A `wx.ImageHandler` for GIF image files.
3140 newobj
= _core_
.new_GIFHandler(*args
, **kwargs
)
3141 self
.this
= newobj
.this
3145 class GIFHandlerPtr(GIFHandler
):
3146 def __init__(self
, this
):
3148 if not hasattr(self
,"thisown"): self
.thisown
= 0
3149 self
.__class
__ = GIFHandler
3150 _core_
.GIFHandler_swigregister(GIFHandlerPtr
)
3152 class PCXHandler(ImageHandler
):
3153 """A `wx.ImageHandler` for PCX imager files."""
3155 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3156 def __init__(self
, *args
, **kwargs
):
3158 __init__(self) -> PCXHandler
3160 A `wx.ImageHandler` for PCX imager files.
3162 newobj
= _core_
.new_PCXHandler(*args
, **kwargs
)
3163 self
.this
= newobj
.this
3167 class PCXHandlerPtr(PCXHandler
):
3168 def __init__(self
, this
):
3170 if not hasattr(self
,"thisown"): self
.thisown
= 0
3171 self
.__class
__ = PCXHandler
3172 _core_
.PCXHandler_swigregister(PCXHandlerPtr
)
3174 class JPEGHandler(ImageHandler
):
3175 """A `wx.ImageHandler` for JPEG/JPG image files."""
3177 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3178 def __init__(self
, *args
, **kwargs
):
3180 __init__(self) -> JPEGHandler
3182 A `wx.ImageHandler` for JPEG/JPG image files.
3184 newobj
= _core_
.new_JPEGHandler(*args
, **kwargs
)
3185 self
.this
= newobj
.this
3189 class JPEGHandlerPtr(JPEGHandler
):
3190 def __init__(self
, this
):
3192 if not hasattr(self
,"thisown"): self
.thisown
= 0
3193 self
.__class
__ = JPEGHandler
3194 _core_
.JPEGHandler_swigregister(JPEGHandlerPtr
)
3196 class PNMHandler(ImageHandler
):
3197 """A `wx.ImageHandler` for PNM image files."""
3199 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3200 def __init__(self
, *args
, **kwargs
):
3202 __init__(self) -> PNMHandler
3204 A `wx.ImageHandler` for PNM image files.
3206 newobj
= _core_
.new_PNMHandler(*args
, **kwargs
)
3207 self
.this
= newobj
.this
3211 class PNMHandlerPtr(PNMHandler
):
3212 def __init__(self
, this
):
3214 if not hasattr(self
,"thisown"): self
.thisown
= 0
3215 self
.__class
__ = PNMHandler
3216 _core_
.PNMHandler_swigregister(PNMHandlerPtr
)
3218 class XPMHandler(ImageHandler
):
3219 """A `wx.ImageHandler` for XPM image."""
3221 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3222 def __init__(self
, *args
, **kwargs
):
3224 __init__(self) -> XPMHandler
3226 A `wx.ImageHandler` for XPM image.
3228 newobj
= _core_
.new_XPMHandler(*args
, **kwargs
)
3229 self
.this
= newobj
.this
3233 class XPMHandlerPtr(XPMHandler
):
3234 def __init__(self
, this
):
3236 if not hasattr(self
,"thisown"): self
.thisown
= 0
3237 self
.__class
__ = XPMHandler
3238 _core_
.XPMHandler_swigregister(XPMHandlerPtr
)
3240 class TIFFHandler(ImageHandler
):
3241 """A `wx.ImageHandler` for TIFF image files."""
3243 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3244 def __init__(self
, *args
, **kwargs
):
3246 __init__(self) -> TIFFHandler
3248 A `wx.ImageHandler` for TIFF image files.
3250 newobj
= _core_
.new_TIFFHandler(*args
, **kwargs
)
3251 self
.this
= newobj
.this
3255 class TIFFHandlerPtr(TIFFHandler
):
3256 def __init__(self
, this
):
3258 if not hasattr(self
,"thisown"): self
.thisown
= 0
3259 self
.__class
__ = TIFFHandler
3260 _core_
.TIFFHandler_swigregister(TIFFHandlerPtr
)
3262 QUANTIZE_INCLUDE_WINDOWS_COLOURS
= _core_
.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3263 QUANTIZE_FILL_DESTINATION_IMAGE
= _core_
.QUANTIZE_FILL_DESTINATION_IMAGE
3264 class Quantize(object):
3265 """Performs quantization, or colour reduction, on a wxImage."""
3266 def __init__(self
): raise RuntimeError, "No constructor defined"
3268 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3269 def Quantize(*args
, **kwargs
):
3271 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3273 Reduce the colours in the source image and put the result into the
3274 destination image, setting the palette in the destination if
3275 needed. Both images may be the same, to overwrite the source image.
3277 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3279 Quantize
= staticmethod(Quantize
)
3281 class QuantizePtr(Quantize
):
3282 def __init__(self
, this
):
3284 if not hasattr(self
,"thisown"): self
.thisown
= 0
3285 self
.__class
__ = Quantize
3286 _core_
.Quantize_swigregister(QuantizePtr
)
3288 def Quantize_Quantize(*args
, **kwargs
):
3290 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3292 Reduce the colours in the source image and put the result into the
3293 destination image, setting the palette in the destination if
3294 needed. Both images may be the same, to overwrite the source image.
3296 return _core_
.Quantize_Quantize(*args
, **kwargs
)
3298 #---------------------------------------------------------------------------
3300 class EvtHandler(Object
):
3301 """Proxy of C++ EvtHandler class"""
3303 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3304 def __init__(self
, *args
, **kwargs
):
3305 """__init__(self) -> EvtHandler"""
3306 newobj
= _core_
.new_EvtHandler(*args
, **kwargs
)
3307 self
.this
= newobj
.this
3310 def GetNextHandler(*args
, **kwargs
):
3311 """GetNextHandler(self) -> EvtHandler"""
3312 return _core_
.EvtHandler_GetNextHandler(*args
, **kwargs
)
3314 def GetPreviousHandler(*args
, **kwargs
):
3315 """GetPreviousHandler(self) -> EvtHandler"""
3316 return _core_
.EvtHandler_GetPreviousHandler(*args
, **kwargs
)
3318 def SetNextHandler(*args
, **kwargs
):
3319 """SetNextHandler(self, EvtHandler handler)"""
3320 return _core_
.EvtHandler_SetNextHandler(*args
, **kwargs
)
3322 def SetPreviousHandler(*args
, **kwargs
):
3323 """SetPreviousHandler(self, EvtHandler handler)"""
3324 return _core_
.EvtHandler_SetPreviousHandler(*args
, **kwargs
)
3326 def GetEvtHandlerEnabled(*args
, **kwargs
):
3327 """GetEvtHandlerEnabled(self) -> bool"""
3328 return _core_
.EvtHandler_GetEvtHandlerEnabled(*args
, **kwargs
)
3330 def SetEvtHandlerEnabled(*args
, **kwargs
):
3331 """SetEvtHandlerEnabled(self, bool enabled)"""
3332 return _core_
.EvtHandler_SetEvtHandlerEnabled(*args
, **kwargs
)
3334 def ProcessEvent(*args
, **kwargs
):
3335 """ProcessEvent(self, Event event) -> bool"""
3336 return _core_
.EvtHandler_ProcessEvent(*args
, **kwargs
)
3338 def AddPendingEvent(*args
, **kwargs
):
3339 """AddPendingEvent(self, Event event)"""
3340 return _core_
.EvtHandler_AddPendingEvent(*args
, **kwargs
)
3342 def ProcessPendingEvents(*args
, **kwargs
):
3343 """ProcessPendingEvents(self)"""
3344 return _core_
.EvtHandler_ProcessPendingEvents(*args
, **kwargs
)
3346 def Connect(*args
, **kwargs
):
3347 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3348 return _core_
.EvtHandler_Connect(*args
, **kwargs
)
3350 def Disconnect(*args
, **kwargs
):
3351 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
3352 return _core_
.EvtHandler_Disconnect(*args
, **kwargs
)
3354 def _setOORInfo(*args
, **kwargs
):
3355 """_setOORInfo(self, PyObject _self, bool incref=True)"""
3356 return _core_
.EvtHandler__setOORInfo(*args
, **kwargs
)
3358 def Bind(self
, event
, handler
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3360 Bind an event to an event handler.
3362 :param event: One of the EVT_* objects that specifies the
3363 type of event to bind,
3365 :param handler: A callable object to be invoked when the
3366 event is delivered to self. Pass None to
3367 disconnect an event handler.
3369 :param source: Sometimes the event originates from a
3370 different window than self, but you still
3371 want to catch it in self. (For example, a
3372 button event delivered to a frame.) By
3373 passing the source of the event, the event
3374 handling system is able to differentiate
3375 between the same event type from different
3378 :param id: Used to spcify the event source by ID instead
3381 :param id2: Used when it is desirable to bind a handler
3382 to a range of IDs, such as with EVT_MENU_RANGE.
3384 if source
is not None:
3386 event
.Bind(self
, id, id2
, handler
)
3388 def Unbind(self
, event
, source
=None, id=wx
.ID_ANY
, id2
=wx
.ID_ANY
):
3390 Disconencts the event handler binding for event from self.
3391 Returns True if successful.
3393 if source
is not None:
3395 return event
.Unbind(self
, id, id2
)
3398 class EvtHandlerPtr(EvtHandler
):
3399 def __init__(self
, this
):
3401 if not hasattr(self
,"thisown"): self
.thisown
= 0
3402 self
.__class
__ = EvtHandler
3403 _core_
.EvtHandler_swigregister(EvtHandlerPtr
)
3405 #---------------------------------------------------------------------------
3407 class PyEventBinder(object):
3409 Instances of this class are used to bind specific events to event
3412 def __init__(self
, evtType
, expectedIDs
=0):
3413 if expectedIDs
not in [0, 1, 2]:
3414 raise ValueError, "Invalid number of expectedIDs"
3415 self
.expectedIDs
= expectedIDs
3417 if type(evtType
) == list or type(evtType
) == tuple:
3418 self
.evtType
= evtType
3420 self
.evtType
= [evtType
]
3423 def Bind(self
, target
, id1
, id2
, function
):
3424 """Bind this set of event types to target."""
3425 for et
in self
.evtType
:
3426 target
.Connect(id1
, id2
, et
, function
)
3429 def Unbind(self
, target
, id1
, id2
):
3430 """Remove an event binding."""
3432 for et
in self
.evtType
:
3433 success
+= target
.Disconnect(id1
, id2
, et
)
3437 def __call__(self
, *args
):
3439 For backwards compatibility with the old EVT_* functions.
3440 Should be called with either (window, func), (window, ID,
3441 func) or (window, ID1, ID2, func) parameters depending on the
3444 assert len(args
) == 2 + self
.expectedIDs
3448 if self
.expectedIDs
== 0:
3450 elif self
.expectedIDs
== 1:
3453 elif self
.expectedIDs
== 2:
3458 raise ValueError, "Unexpected number of IDs"
3460 self
.Bind(target
, id1
, id2
, func
)
3463 # These two are square pegs that don't fit the PyEventBinder hole...
3464 def EVT_COMMAND(win
, id, cmd
, func
):
3465 win
.Connect(id, -1, cmd
, func
)
3466 def EVT_COMMAND_RANGE(win
, id1
, id2
, cmd
, func
):
3467 win
.Connect(id1
, id2
, cmd
, func
)
3470 #---------------------------------------------------------------------------
3472 #---------------------------------------------------------------------------
3474 EVENT_PROPAGATE_NONE
= _core_
.EVENT_PROPAGATE_NONE
3475 EVENT_PROPAGATE_MAX
= _core_
.EVENT_PROPAGATE_MAX
3477 def NewEventType(*args
, **kwargs
):
3478 """NewEventType() -> wxEventType"""
3479 return _core_
.NewEventType(*args
, **kwargs
)
3480 wxEVT_NULL
= _core_
.wxEVT_NULL
3481 wxEVT_FIRST
= _core_
.wxEVT_FIRST
3482 wxEVT_USER_FIRST
= _core_
.wxEVT_USER_FIRST
3483 wxEVT_COMMAND_BUTTON_CLICKED
= _core_
.wxEVT_COMMAND_BUTTON_CLICKED
3484 wxEVT_COMMAND_CHECKBOX_CLICKED
= _core_
.wxEVT_COMMAND_CHECKBOX_CLICKED
3485 wxEVT_COMMAND_CHOICE_SELECTED
= _core_
.wxEVT_COMMAND_CHOICE_SELECTED
3486 wxEVT_COMMAND_LISTBOX_SELECTED
= _core_
.wxEVT_COMMAND_LISTBOX_SELECTED
3487 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= _core_
.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3488 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= _core_
.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3489 wxEVT_COMMAND_MENU_SELECTED
= _core_
.wxEVT_COMMAND_MENU_SELECTED
3490 wxEVT_COMMAND_TOOL_CLICKED
= _core_
.wxEVT_COMMAND_TOOL_CLICKED
3491 wxEVT_COMMAND_SLIDER_UPDATED
= _core_
.wxEVT_COMMAND_SLIDER_UPDATED
3492 wxEVT_COMMAND_RADIOBOX_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBOX_SELECTED
3493 wxEVT_COMMAND_RADIOBUTTON_SELECTED
= _core_
.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3494 wxEVT_COMMAND_SCROLLBAR_UPDATED
= _core_
.wxEVT_COMMAND_SCROLLBAR_UPDATED
3495 wxEVT_COMMAND_VLBOX_SELECTED
= _core_
.wxEVT_COMMAND_VLBOX_SELECTED
3496 wxEVT_COMMAND_COMBOBOX_SELECTED
= _core_
.wxEVT_COMMAND_COMBOBOX_SELECTED
3497 wxEVT_COMMAND_TOOL_RCLICKED
= _core_
.wxEVT_COMMAND_TOOL_RCLICKED
3498 wxEVT_COMMAND_TOOL_ENTER
= _core_
.wxEVT_COMMAND_TOOL_ENTER
3499 wxEVT_LEFT_DOWN
= _core_
.wxEVT_LEFT_DOWN
3500 wxEVT_LEFT_UP
= _core_
.wxEVT_LEFT_UP
3501 wxEVT_MIDDLE_DOWN
= _core_
.wxEVT_MIDDLE_DOWN
3502 wxEVT_MIDDLE_UP
= _core_
.wxEVT_MIDDLE_UP
3503 wxEVT_RIGHT_DOWN
= _core_
.wxEVT_RIGHT_DOWN
3504 wxEVT_RIGHT_UP
= _core_
.wxEVT_RIGHT_UP
3505 wxEVT_MOTION
= _core_
.wxEVT_MOTION
3506 wxEVT_ENTER_WINDOW
= _core_
.wxEVT_ENTER_WINDOW
3507 wxEVT_LEAVE_WINDOW
= _core_
.wxEVT_LEAVE_WINDOW
3508 wxEVT_LEFT_DCLICK
= _core_
.wxEVT_LEFT_DCLICK
3509 wxEVT_MIDDLE_DCLICK
= _core_
.wxEVT_MIDDLE_DCLICK
3510 wxEVT_RIGHT_DCLICK
= _core_
.wxEVT_RIGHT_DCLICK
3511 wxEVT_SET_FOCUS
= _core_
.wxEVT_SET_FOCUS
3512 wxEVT_KILL_FOCUS
= _core_
.wxEVT_KILL_FOCUS
3513 wxEVT_CHILD_FOCUS
= _core_
.wxEVT_CHILD_FOCUS
3514 wxEVT_MOUSEWHEEL
= _core_
.wxEVT_MOUSEWHEEL
3515 wxEVT_NC_LEFT_DOWN
= _core_
.wxEVT_NC_LEFT_DOWN
3516 wxEVT_NC_LEFT_UP
= _core_
.wxEVT_NC_LEFT_UP
3517 wxEVT_NC_MIDDLE_DOWN
= _core_
.wxEVT_NC_MIDDLE_DOWN
3518 wxEVT_NC_MIDDLE_UP
= _core_
.wxEVT_NC_MIDDLE_UP
3519 wxEVT_NC_RIGHT_DOWN
= _core_
.wxEVT_NC_RIGHT_DOWN
3520 wxEVT_NC_RIGHT_UP
= _core_
.wxEVT_NC_RIGHT_UP
3521 wxEVT_NC_MOTION
= _core_
.wxEVT_NC_MOTION
3522 wxEVT_NC_ENTER_WINDOW
= _core_
.wxEVT_NC_ENTER_WINDOW
3523 wxEVT_NC_LEAVE_WINDOW
= _core_
.wxEVT_NC_LEAVE_WINDOW
3524 wxEVT_NC_LEFT_DCLICK
= _core_
.wxEVT_NC_LEFT_DCLICK
3525 wxEVT_NC_MIDDLE_DCLICK
= _core_
.wxEVT_NC_MIDDLE_DCLICK
3526 wxEVT_NC_RIGHT_DCLICK
= _core_
.wxEVT_NC_RIGHT_DCLICK
3527 wxEVT_CHAR
= _core_
.wxEVT_CHAR
3528 wxEVT_CHAR_HOOK
= _core_
.wxEVT_CHAR_HOOK
3529 wxEVT_NAVIGATION_KEY
= _core_
.wxEVT_NAVIGATION_KEY
3530 wxEVT_KEY_DOWN
= _core_
.wxEVT_KEY_DOWN
3531 wxEVT_KEY_UP
= _core_
.wxEVT_KEY_UP
3532 wxEVT_HOTKEY
= _core_
.wxEVT_HOTKEY
3533 wxEVT_SET_CURSOR
= _core_
.wxEVT_SET_CURSOR
3534 wxEVT_SCROLL_TOP
= _core_
.wxEVT_SCROLL_TOP
3535 wxEVT_SCROLL_BOTTOM
= _core_
.wxEVT_SCROLL_BOTTOM
3536 wxEVT_SCROLL_LINEUP
= _core_
.wxEVT_SCROLL_LINEUP
3537 wxEVT_SCROLL_LINEDOWN
= _core_
.wxEVT_SCROLL_LINEDOWN
3538 wxEVT_SCROLL_PAGEUP
= _core_
.wxEVT_SCROLL_PAGEUP
3539 wxEVT_SCROLL_PAGEDOWN
= _core_
.wxEVT_SCROLL_PAGEDOWN
3540 wxEVT_SCROLL_THUMBTRACK
= _core_
.wxEVT_SCROLL_THUMBTRACK
3541 wxEVT_SCROLL_THUMBRELEASE
= _core_
.wxEVT_SCROLL_THUMBRELEASE
3542 wxEVT_SCROLL_ENDSCROLL
= _core_
.wxEVT_SCROLL_ENDSCROLL
3543 wxEVT_SCROLLWIN_TOP
= _core_
.wxEVT_SCROLLWIN_TOP
3544 wxEVT_SCROLLWIN_BOTTOM
= _core_
.wxEVT_SCROLLWIN_BOTTOM
3545 wxEVT_SCROLLWIN_LINEUP
= _core_
.wxEVT_SCROLLWIN_LINEUP
3546 wxEVT_SCROLLWIN_LINEDOWN
= _core_
.wxEVT_SCROLLWIN_LINEDOWN
3547 wxEVT_SCROLLWIN_PAGEUP
= _core_
.wxEVT_SCROLLWIN_PAGEUP
3548 wxEVT_SCROLLWIN_PAGEDOWN
= _core_
.wxEVT_SCROLLWIN_PAGEDOWN
3549 wxEVT_SCROLLWIN_THUMBTRACK
= _core_
.wxEVT_SCROLLWIN_THUMBTRACK
3550 wxEVT_SCROLLWIN_THUMBRELEASE
= _core_
.wxEVT_SCROLLWIN_THUMBRELEASE
3551 wxEVT_SIZE
= _core_
.wxEVT_SIZE
3552 wxEVT_MOVE
= _core_
.wxEVT_MOVE
3553 wxEVT_CLOSE_WINDOW
= _core_
.wxEVT_CLOSE_WINDOW
3554 wxEVT_END_SESSION
= _core_
.wxEVT_END_SESSION
3555 wxEVT_QUERY_END_SESSION
= _core_
.wxEVT_QUERY_END_SESSION
3556 wxEVT_ACTIVATE_APP
= _core_
.wxEVT_ACTIVATE_APP
3557 wxEVT_POWER
= _core_
.wxEVT_POWER
3558 wxEVT_ACTIVATE
= _core_
.wxEVT_ACTIVATE
3559 wxEVT_CREATE
= _core_
.wxEVT_CREATE
3560 wxEVT_DESTROY
= _core_
.wxEVT_DESTROY
3561 wxEVT_SHOW
= _core_
.wxEVT_SHOW
3562 wxEVT_ICONIZE
= _core_
.wxEVT_ICONIZE
3563 wxEVT_MAXIMIZE
= _core_
.wxEVT_MAXIMIZE
3564 wxEVT_MOUSE_CAPTURE_CHANGED
= _core_
.wxEVT_MOUSE_CAPTURE_CHANGED
3565 wxEVT_PAINT
= _core_
.wxEVT_PAINT
3566 wxEVT_ERASE_BACKGROUND
= _core_
.wxEVT_ERASE_BACKGROUND
3567 wxEVT_NC_PAINT
= _core_
.wxEVT_NC_PAINT
3568 wxEVT_PAINT_ICON
= _core_
.wxEVT_PAINT_ICON
3569 wxEVT_MENU_OPEN
= _core_
.wxEVT_MENU_OPEN
3570 wxEVT_MENU_CLOSE
= _core_
.wxEVT_MENU_CLOSE
3571 wxEVT_MENU_HIGHLIGHT
= _core_
.wxEVT_MENU_HIGHLIGHT
3572 wxEVT_CONTEXT_MENU
= _core_
.wxEVT_CONTEXT_MENU
3573 wxEVT_SYS_COLOUR_CHANGED
= _core_
.wxEVT_SYS_COLOUR_CHANGED
3574 wxEVT_DISPLAY_CHANGED
= _core_
.wxEVT_DISPLAY_CHANGED
3575 wxEVT_SETTING_CHANGED
= _core_
.wxEVT_SETTING_CHANGED
3576 wxEVT_QUERY_NEW_PALETTE
= _core_
.wxEVT_QUERY_NEW_PALETTE
3577 wxEVT_PALETTE_CHANGED
= _core_
.wxEVT_PALETTE_CHANGED
3578 wxEVT_DROP_FILES
= _core_
.wxEVT_DROP_FILES
3579 wxEVT_DRAW_ITEM
= _core_
.wxEVT_DRAW_ITEM
3580 wxEVT_MEASURE_ITEM
= _core_
.wxEVT_MEASURE_ITEM
3581 wxEVT_COMPARE_ITEM
= _core_
.wxEVT_COMPARE_ITEM
3582 wxEVT_INIT_DIALOG
= _core_
.wxEVT_INIT_DIALOG
3583 wxEVT_IDLE
= _core_
.wxEVT_IDLE
3584 wxEVT_UPDATE_UI
= _core_
.wxEVT_UPDATE_UI
3585 wxEVT_SIZING
= _core_
.wxEVT_SIZING
3586 wxEVT_MOVING
= _core_
.wxEVT_MOVING
3587 wxEVT_HIBERNATE
= _core_
.wxEVT_HIBERNATE
3588 wxEVT_COMMAND_LEFT_CLICK
= _core_
.wxEVT_COMMAND_LEFT_CLICK
3589 wxEVT_COMMAND_LEFT_DCLICK
= _core_
.wxEVT_COMMAND_LEFT_DCLICK
3590 wxEVT_COMMAND_RIGHT_CLICK
= _core_
.wxEVT_COMMAND_RIGHT_CLICK
3591 wxEVT_COMMAND_RIGHT_DCLICK
= _core_
.wxEVT_COMMAND_RIGHT_DCLICK
3592 wxEVT_COMMAND_SET_FOCUS
= _core_
.wxEVT_COMMAND_SET_FOCUS
3593 wxEVT_COMMAND_KILL_FOCUS
= _core_
.wxEVT_COMMAND_KILL_FOCUS
3594 wxEVT_COMMAND_ENTER
= _core_
.wxEVT_COMMAND_ENTER
3596 # Create some event binders
3597 EVT_SIZE
= wx
.PyEventBinder( wxEVT_SIZE
)
3598 EVT_SIZING
= wx
.PyEventBinder( wxEVT_SIZING
)
3599 EVT_MOVE
= wx
.PyEventBinder( wxEVT_MOVE
)
3600 EVT_MOVING
= wx
.PyEventBinder( wxEVT_MOVING
)
3601 EVT_CLOSE
= wx
.PyEventBinder( wxEVT_CLOSE_WINDOW
)
3602 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3603 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3604 EVT_PAINT
= wx
.PyEventBinder( wxEVT_PAINT
)
3605 EVT_NC_PAINT
= wx
.PyEventBinder( wxEVT_NC_PAINT
)
3606 EVT_ERASE_BACKGROUND
= wx
.PyEventBinder( wxEVT_ERASE_BACKGROUND
)
3607 EVT_CHAR
= wx
.PyEventBinder( wxEVT_CHAR
)
3608 EVT_KEY_DOWN
= wx
.PyEventBinder( wxEVT_KEY_DOWN
)
3609 EVT_KEY_UP
= wx
.PyEventBinder( wxEVT_KEY_UP
)
3610 EVT_HOTKEY
= wx
.PyEventBinder( wxEVT_HOTKEY
, 1)
3611 EVT_CHAR_HOOK
= wx
.PyEventBinder( wxEVT_CHAR_HOOK
)
3612 EVT_MENU_OPEN
= wx
.PyEventBinder( wxEVT_MENU_OPEN
)
3613 EVT_MENU_CLOSE
= wx
.PyEventBinder( wxEVT_MENU_CLOSE
)
3614 EVT_MENU_HIGHLIGHT
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
, 1)
3615 EVT_MENU_HIGHLIGHT_ALL
= wx
.PyEventBinder( wxEVT_MENU_HIGHLIGHT
)
3616 EVT_SET_FOCUS
= wx
.PyEventBinder( wxEVT_SET_FOCUS
)
3617 EVT_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_KILL_FOCUS
)
3618 EVT_CHILD_FOCUS
= wx
.PyEventBinder( wxEVT_CHILD_FOCUS
)
3619 EVT_ACTIVATE
= wx
.PyEventBinder( wxEVT_ACTIVATE
)
3620 EVT_ACTIVATE_APP
= wx
.PyEventBinder( wxEVT_ACTIVATE_APP
)
3621 EVT_HIBERNATE
= wx
.PyEventBinder( wxEVT_HIBERNATE
)
3622 EVT_END_SESSION
= wx
.PyEventBinder( wxEVT_END_SESSION
)
3623 EVT_QUERY_END_SESSION
= wx
.PyEventBinder( wxEVT_QUERY_END_SESSION
)
3624 EVT_DROP_FILES
= wx
.PyEventBinder( wxEVT_DROP_FILES
)
3625 EVT_INIT_DIALOG
= wx
.PyEventBinder( wxEVT_INIT_DIALOG
)
3626 EVT_SYS_COLOUR_CHANGED
= wx
.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED
)
3627 EVT_DISPLAY_CHANGED
= wx
.PyEventBinder( wxEVT_DISPLAY_CHANGED
)
3628 EVT_SHOW
= wx
.PyEventBinder( wxEVT_SHOW
)
3629 EVT_MAXIMIZE
= wx
.PyEventBinder( wxEVT_MAXIMIZE
)
3630 EVT_ICONIZE
= wx
.PyEventBinder( wxEVT_ICONIZE
)
3631 EVT_NAVIGATION_KEY
= wx
.PyEventBinder( wxEVT_NAVIGATION_KEY
)
3632 EVT_PALETTE_CHANGED
= wx
.PyEventBinder( wxEVT_PALETTE_CHANGED
)
3633 EVT_QUERY_NEW_PALETTE
= wx
.PyEventBinder( wxEVT_QUERY_NEW_PALETTE
)
3634 EVT_WINDOW_CREATE
= wx
.PyEventBinder( wxEVT_CREATE
)
3635 EVT_WINDOW_DESTROY
= wx
.PyEventBinder( wxEVT_DESTROY
)
3636 EVT_SET_CURSOR
= wx
.PyEventBinder( wxEVT_SET_CURSOR
)
3637 EVT_MOUSE_CAPTURE_CHANGED
= wx
.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED
)
3639 EVT_LEFT_DOWN
= wx
.PyEventBinder( wxEVT_LEFT_DOWN
)
3640 EVT_LEFT_UP
= wx
.PyEventBinder( wxEVT_LEFT_UP
)
3641 EVT_MIDDLE_DOWN
= wx
.PyEventBinder( wxEVT_MIDDLE_DOWN
)
3642 EVT_MIDDLE_UP
= wx
.PyEventBinder( wxEVT_MIDDLE_UP
)
3643 EVT_RIGHT_DOWN
= wx
.PyEventBinder( wxEVT_RIGHT_DOWN
)
3644 EVT_RIGHT_UP
= wx
.PyEventBinder( wxEVT_RIGHT_UP
)
3645 EVT_MOTION
= wx
.PyEventBinder( wxEVT_MOTION
)
3646 EVT_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_LEFT_DCLICK
)
3647 EVT_MIDDLE_DCLICK
= wx
.PyEventBinder( wxEVT_MIDDLE_DCLICK
)
3648 EVT_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_RIGHT_DCLICK
)
3649 EVT_LEAVE_WINDOW
= wx
.PyEventBinder( wxEVT_LEAVE_WINDOW
)
3650 EVT_ENTER_WINDOW
= wx
.PyEventBinder( wxEVT_ENTER_WINDOW
)
3651 EVT_MOUSEWHEEL
= wx
.PyEventBinder( wxEVT_MOUSEWHEEL
)
3653 EVT_MOUSE_EVENTS
= wx
.PyEventBinder([ wxEVT_LEFT_DOWN
,
3661 wxEVT_MIDDLE_DCLICK
,
3669 # Scrolling from wxWindow (sent to wxScrolledWindow)
3670 EVT_SCROLLWIN
= wx
.PyEventBinder([ wxEVT_SCROLLWIN_TOP
,
3671 wxEVT_SCROLLWIN_BOTTOM
,
3672 wxEVT_SCROLLWIN_LINEUP
,
3673 wxEVT_SCROLLWIN_LINEDOWN
,
3674 wxEVT_SCROLLWIN_PAGEUP
,
3675 wxEVT_SCROLLWIN_PAGEDOWN
,
3676 wxEVT_SCROLLWIN_THUMBTRACK
,
3677 wxEVT_SCROLLWIN_THUMBRELEASE
,
3680 EVT_SCROLLWIN_TOP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_TOP
)
3681 EVT_SCROLLWIN_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM
)
3682 EVT_SCROLLWIN_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEUP
)
3683 EVT_SCROLLWIN_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN
)
3684 EVT_SCROLLWIN_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP
)
3685 EVT_SCROLLWIN_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN
)
3686 EVT_SCROLLWIN_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK
)
3687 EVT_SCROLLWIN_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE
)
3689 # Scrolling from wx.Slider and wx.ScrollBar
3690 EVT_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3691 wxEVT_SCROLL_BOTTOM
,
3692 wxEVT_SCROLL_LINEUP
,
3693 wxEVT_SCROLL_LINEDOWN
,
3694 wxEVT_SCROLL_PAGEUP
,
3695 wxEVT_SCROLL_PAGEDOWN
,
3696 wxEVT_SCROLL_THUMBTRACK
,
3697 wxEVT_SCROLL_THUMBRELEASE
,
3698 wxEVT_SCROLL_ENDSCROLL
,
3701 EVT_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
)
3702 EVT_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
)
3703 EVT_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
)
3704 EVT_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
)
3705 EVT_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
)
3706 EVT_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
)
3707 EVT_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
)
3708 EVT_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
)
3709 EVT_SCROLL_ENDSCROLL
= wx
.PyEventBinder( wxEVT_SCROLL_ENDSCROLL
)
3711 # Scrolling from wx.Slider and wx.ScrollBar, with an id
3712 EVT_COMMAND_SCROLL
= wx
.PyEventBinder([ wxEVT_SCROLL_TOP
,
3713 wxEVT_SCROLL_BOTTOM
,
3714 wxEVT_SCROLL_LINEUP
,
3715 wxEVT_SCROLL_LINEDOWN
,
3716 wxEVT_SCROLL_PAGEUP
,
3717 wxEVT_SCROLL_PAGEDOWN
,
3718 wxEVT_SCROLL_THUMBTRACK
,
3719 wxEVT_SCROLL_THUMBRELEASE
,
3720 wxEVT_SCROLL_ENDSCROLL
,
3723 EVT_COMMAND_SCROLL_TOP
= wx
.PyEventBinder( wxEVT_SCROLL_TOP
, 1)
3724 EVT_COMMAND_SCROLL_BOTTOM
= wx
.PyEventBinder( wxEVT_SCROLL_BOTTOM
, 1)
3725 EVT_COMMAND_SCROLL_LINEUP
= wx
.PyEventBinder( wxEVT_SCROLL_LINEUP
, 1)
3726 EVT_COMMAND_SCROLL_LINEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_LINEDOWN
, 1)
3727 EVT_COMMAND_SCROLL_PAGEUP
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEUP
, 1)
3728 EVT_COMMAND_SCROLL_PAGEDOWN
= wx
.PyEventBinder( wxEVT_SCROLL_PAGEDOWN
, 1)
3729 EVT_COMMAND_SCROLL_THUMBTRACK
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBTRACK
, 1)
3730 EVT_COMMAND_SCROLL_THUMBRELEASE
= wx
.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE
, 1)
3731 EVT_COMMAND_SCROLL_ENDSCROLL
= wx
.PyEventBinder( wxEVT_SCROLL_ENDSCROLL
, 1)
3733 EVT_BUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED
, 1)
3734 EVT_CHECKBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED
, 1)
3735 EVT_CHOICE
= wx
.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED
, 1)
3736 EVT_LISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED
, 1)
3737 EVT_LISTBOX_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, 1)
3738 EVT_MENU
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 1)
3739 EVT_MENU_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED
, 2)
3740 EVT_SLIDER
= wx
.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED
, 1)
3741 EVT_RADIOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED
, 1)
3742 EVT_RADIOBUTTON
= wx
.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED
, 1)
3744 EVT_SCROLLBAR
= wx
.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED
, 1)
3745 EVT_VLBOX
= wx
.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED
, 1)
3746 EVT_COMBOBOX
= wx
.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED
, 1)
3747 EVT_TOOL
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 1)
3748 EVT_TOOL_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED
, 2)
3749 EVT_TOOL_RCLICKED
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 1)
3750 EVT_TOOL_RCLICKED_RANGE
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED
, 2)
3751 EVT_TOOL_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER
, 1)
3752 EVT_CHECKLISTBOX
= wx
.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, 1)
3755 EVT_COMMAND_LEFT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK
, 1)
3756 EVT_COMMAND_LEFT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK
, 1)
3757 EVT_COMMAND_RIGHT_CLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK
, 1)
3758 EVT_COMMAND_RIGHT_DCLICK
= wx
.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK
, 1)
3759 EVT_COMMAND_SET_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_SET_FOCUS
, 1)
3760 EVT_COMMAND_KILL_FOCUS
= wx
.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS
, 1)
3761 EVT_COMMAND_ENTER
= wx
.PyEventBinder( wxEVT_COMMAND_ENTER
, 1)
3763 EVT_IDLE
= wx
.PyEventBinder( wxEVT_IDLE
)
3765 EVT_UPDATE_UI
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 1)
3766 EVT_UPDATE_UI_RANGE
= wx
.PyEventBinder( wxEVT_UPDATE_UI
, 2)
3768 EVT_CONTEXT_MENU
= wx
.PyEventBinder( wxEVT_CONTEXT_MENU
)
3772 #---------------------------------------------------------------------------
3774 class Event(Object
):
3776 An event is a structure holding information about an event passed to a
3777 callback or member function. wx.Event is an abstract base class for
3780 def __init__(self
): raise RuntimeError, "No constructor defined"
3782 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3783 def __del__(self
, destroy
=_core_
.delete_Event
):
3786 if self
.thisown
: destroy(self
)
3789 def SetEventType(*args
, **kwargs
):
3791 SetEventType(self, wxEventType typ)
3793 Sets the specific type of the event.
3795 return _core_
.Event_SetEventType(*args
, **kwargs
)
3797 def GetEventType(*args
, **kwargs
):
3799 GetEventType(self) -> wxEventType
3801 Returns the identifier of the given event type, such as
3802 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3804 return _core_
.Event_GetEventType(*args
, **kwargs
)
3806 def GetEventObject(*args
, **kwargs
):
3808 GetEventObject(self) -> Object
3810 Returns the object (usually a window) associated with the event, if
3813 return _core_
.Event_GetEventObject(*args
, **kwargs
)
3815 def SetEventObject(*args
, **kwargs
):
3817 SetEventObject(self, Object obj)
3819 Sets the originating object, or in other words, obj is normally the
3820 object that is sending the event.
3822 return _core_
.Event_SetEventObject(*args
, **kwargs
)
3824 def GetTimestamp(*args
, **kwargs
):
3825 """GetTimestamp(self) -> long"""
3826 return _core_
.Event_GetTimestamp(*args
, **kwargs
)
3828 def SetTimestamp(*args
, **kwargs
):
3829 """SetTimestamp(self, long ts=0)"""
3830 return _core_
.Event_SetTimestamp(*args
, **kwargs
)
3832 def GetId(*args
, **kwargs
):
3836 Returns the identifier associated with this event, such as a button
3839 return _core_
.Event_GetId(*args
, **kwargs
)
3841 def SetId(*args
, **kwargs
):
3845 Set's the ID for the event. This is usually the ID of the window that
3846 is sending the event, but it can also be a command id from a menu
3849 return _core_
.Event_SetId(*args
, **kwargs
)
3851 def IsCommandEvent(*args
, **kwargs
):
3853 IsCommandEvent(self) -> bool
3855 Returns true if the event is or is derived from `wx.CommandEvent` else
3856 it returns false. Note: Exists only for optimization purposes.
3858 return _core_
.Event_IsCommandEvent(*args
, **kwargs
)
3860 def Skip(*args
, **kwargs
):
3862 Skip(self, bool skip=True)
3864 Called by an event handler, it controls whether additional event
3865 handlers bound to this event will be called after the current event
3866 handler returns. Skip(false) (the default setting) will prevent
3867 additional event handlers from being called and control will be
3868 returned to the sender of the event immediately after the current
3869 handler has finished. Skip(True) will cause the event processing
3870 system to continue searching for a handler function for this event.
3873 return _core_
.Event_Skip(*args
, **kwargs
)
3875 def GetSkipped(*args
, **kwargs
):
3877 GetSkipped(self) -> bool
3879 Returns true if the event handler should be skipped, false otherwise.
3882 return _core_
.Event_GetSkipped(*args
, **kwargs
)
3884 def ShouldPropagate(*args
, **kwargs
):
3886 ShouldPropagate(self) -> bool
3888 Test if this event should be propagated to the parent window or not,
3889 i.e. if the propagation level is currently greater than 0.
3891 return _core_
.Event_ShouldPropagate(*args
, **kwargs
)
3893 def StopPropagation(*args
, **kwargs
):
3895 StopPropagation(self) -> int
3897 Stop the event from propagating to its parent window. Returns the old
3898 propagation level value which may be later passed to
3899 `ResumePropagation` to allow propagating the event again.
3901 return _core_
.Event_StopPropagation(*args
, **kwargs
)
3903 def ResumePropagation(*args
, **kwargs
):
3905 ResumePropagation(self, int propagationLevel)
3907 Resume the event propagation by restoring the propagation level. (For
3908 example, you can use the value returned by an earlier call to
3912 return _core_
.Event_ResumePropagation(*args
, **kwargs
)
3914 def Clone(*args
, **kwargs
):
3915 """Clone(self) -> Event"""
3916 return _core_
.Event_Clone(*args
, **kwargs
)
3919 class EventPtr(Event
):
3920 def __init__(self
, this
):
3922 if not hasattr(self
,"thisown"): self
.thisown
= 0
3923 self
.__class
__ = Event
3924 _core_
.Event_swigregister(EventPtr
)
3926 #---------------------------------------------------------------------------
3928 class PropagationDisabler(object):
3930 Helper class to temporarily change an event not to propagate. Simply
3931 create an instance of this class and then whe it is destroyed the
3932 propogation of the event will be restored.
3935 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3936 def __init__(self
, *args
, **kwargs
):
3938 __init__(self, Event event) -> PropagationDisabler
3940 Helper class to temporarily change an event not to propagate. Simply
3941 create an instance of this class and then whe it is destroyed the
3942 propogation of the event will be restored.
3944 newobj
= _core_
.new_PropagationDisabler(*args
, **kwargs
)
3945 self
.this
= newobj
.this
3948 def __del__(self
, destroy
=_core_
.delete_PropagationDisabler
):
3951 if self
.thisown
: destroy(self
)
3955 class PropagationDisablerPtr(PropagationDisabler
):
3956 def __init__(self
, this
):
3958 if not hasattr(self
,"thisown"): self
.thisown
= 0
3959 self
.__class
__ = PropagationDisabler
3960 _core_
.PropagationDisabler_swigregister(PropagationDisablerPtr
)
3962 class PropagateOnce(object):
3964 A helper class that will temporarily lower propagation level of an
3965 event. Simply create an instance of this class and then whe it is
3966 destroyed the propogation of the event will be restored.
3969 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
3970 def __init__(self
, *args
, **kwargs
):
3972 __init__(self, Event event) -> PropagateOnce
3974 A helper class that will temporarily lower propagation level of an
3975 event. Simply create an instance of this class and then whe it is
3976 destroyed the propogation of the event will be restored.
3978 newobj
= _core_
.new_PropagateOnce(*args
, **kwargs
)
3979 self
.this
= newobj
.this
3982 def __del__(self
, destroy
=_core_
.delete_PropagateOnce
):
3985 if self
.thisown
: destroy(self
)
3989 class PropagateOncePtr(PropagateOnce
):
3990 def __init__(self
, this
):
3992 if not hasattr(self
,"thisown"): self
.thisown
= 0
3993 self
.__class
__ = PropagateOnce
3994 _core_
.PropagateOnce_swigregister(PropagateOncePtr
)
3996 #---------------------------------------------------------------------------
3998 class CommandEvent(Event
):
4000 This event class contains information about command events, which
4001 originate from a variety of simple controls, as well as menus and
4005 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4006 def __init__(self
, *args
, **kwargs
):
4008 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4010 This event class contains information about command events, which
4011 originate from a variety of simple controls, as well as menus and
4014 newobj
= _core_
.new_CommandEvent(*args
, **kwargs
)
4015 self
.this
= newobj
.this
4018 def GetSelection(*args
, **kwargs
):
4020 GetSelection(self) -> int
4022 Returns item index for a listbox or choice selection event (not valid
4025 return _core_
.CommandEvent_GetSelection(*args
, **kwargs
)
4027 def SetString(*args
, **kwargs
):
4028 """SetString(self, String s)"""
4029 return _core_
.CommandEvent_SetString(*args
, **kwargs
)
4031 def GetString(*args
, **kwargs
):
4033 GetString(self) -> String
4035 Returns item string for a listbox or choice selection event (not valid
4038 return _core_
.CommandEvent_GetString(*args
, **kwargs
)
4040 def IsChecked(*args
, **kwargs
):
4042 IsChecked(self) -> bool
4044 This method can be used with checkbox and menu events: for the
4045 checkboxes, the method returns true for a selection event and false
4046 for a deselection one. For the menu events, this method indicates if
4047 the menu item just has become checked or unchecked (and thus only
4048 makes sense for checkable menu items).
4050 return _core_
.CommandEvent_IsChecked(*args
, **kwargs
)
4053 def IsSelection(*args
, **kwargs
):
4055 IsSelection(self) -> bool
4057 For a listbox or similar event, returns true if it is a selection,
4058 false if it is a deselection.
4060 return _core_
.CommandEvent_IsSelection(*args
, **kwargs
)
4062 def SetExtraLong(*args
, **kwargs
):
4063 """SetExtraLong(self, long extraLong)"""
4064 return _core_
.CommandEvent_SetExtraLong(*args
, **kwargs
)
4066 def GetExtraLong(*args
, **kwargs
):
4068 GetExtraLong(self) -> long
4070 Returns extra information dependant on the event objects type. If the event
4071 comes from a listbox selection, it is a boolean determining whether the event
4072 was a selection (true) or a deselection (false). A listbox deselection only
4073 occurs for multiple-selection boxes, and in this case the index and string
4074 values are indeterminate and the listbox must be examined by the application.
4076 return _core_
.CommandEvent_GetExtraLong(*args
, **kwargs
)
4078 def SetInt(*args
, **kwargs
):
4079 """SetInt(self, int i)"""
4080 return _core_
.CommandEvent_SetInt(*args
, **kwargs
)
4082 def GetInt(*args
, **kwargs
):
4084 GetInt(self) -> long
4086 Returns the integer identifier corresponding to a listbox, choice or radiobox
4087 selection (only if the event was a selection, not a deselection), or a boolean
4088 value representing the value of a checkbox.
4090 return _core_
.CommandEvent_GetInt(*args
, **kwargs
)
4092 def Clone(*args
, **kwargs
):
4093 """Clone(self) -> Event"""
4094 return _core_
.CommandEvent_Clone(*args
, **kwargs
)
4097 class CommandEventPtr(CommandEvent
):
4098 def __init__(self
, this
):
4100 if not hasattr(self
,"thisown"): self
.thisown
= 0
4101 self
.__class
__ = CommandEvent
4102 _core_
.CommandEvent_swigregister(CommandEventPtr
)
4104 #---------------------------------------------------------------------------
4106 class NotifyEvent(CommandEvent
):
4108 An instance of this class (or one of its derived classes) is sent from
4109 a control when the control's state is being changed and the control
4110 allows that change to be prevented from happening. The event handler
4111 can call `Veto` or `Allow` to tell the control what to do.
4114 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4115 def __init__(self
, *args
, **kwargs
):
4117 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4119 An instance of this class (or one of its derived classes) is sent from
4120 a control when the control's state is being changed and the control
4121 allows that change to be prevented from happening. The event handler
4122 can call `Veto` or `Allow` to tell the control what to do.
4124 newobj
= _core_
.new_NotifyEvent(*args
, **kwargs
)
4125 self
.this
= newobj
.this
4128 def Veto(*args
, **kwargs
):
4132 Prevents the change announced by this event from happening.
4134 It is in general a good idea to notify the user about the reasons for
4135 vetoing the change because otherwise the applications behaviour (which
4136 just refuses to do what the user wants) might be quite surprising.
4138 return _core_
.NotifyEvent_Veto(*args
, **kwargs
)
4140 def Allow(*args
, **kwargs
):
4144 This is the opposite of `Veto`: it explicitly allows the event to be
4145 processed. For most events it is not necessary to call this method as
4146 the events are allowed anyhow but some are forbidden by default (this
4147 will be mentioned in the corresponding event description).
4149 return _core_
.NotifyEvent_Allow(*args
, **kwargs
)
4151 def IsAllowed(*args
, **kwargs
):
4153 IsAllowed(self) -> bool
4155 Returns true if the change is allowed (`Veto` hasn't been called) or
4156 false otherwise (if it was).
4158 return _core_
.NotifyEvent_IsAllowed(*args
, **kwargs
)
4161 class NotifyEventPtr(NotifyEvent
):
4162 def __init__(self
, this
):
4164 if not hasattr(self
,"thisown"): self
.thisown
= 0
4165 self
.__class
__ = NotifyEvent
4166 _core_
.NotifyEvent_swigregister(NotifyEventPtr
)
4168 #---------------------------------------------------------------------------
4170 class ScrollEvent(CommandEvent
):
4172 A scroll event holds information about events sent from stand-alone
4173 scrollbars and sliders. Note that scrolled windows do not send
4174 instnaces of this event class, but send the `wx.ScrollWinEvent`
4178 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4179 def __init__(self
, *args
, **kwargs
):
4181 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4182 int orient=0) -> ScrollEvent
4184 newobj
= _core_
.new_ScrollEvent(*args
, **kwargs
)
4185 self
.this
= newobj
.this
4188 def GetOrientation(*args
, **kwargs
):
4190 GetOrientation(self) -> int
4192 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4195 return _core_
.ScrollEvent_GetOrientation(*args
, **kwargs
)
4197 def GetPosition(*args
, **kwargs
):
4199 GetPosition(self) -> int
4201 Returns the position of the scrollbar.
4203 return _core_
.ScrollEvent_GetPosition(*args
, **kwargs
)
4205 def SetOrientation(*args
, **kwargs
):
4206 """SetOrientation(self, int orient)"""
4207 return _core_
.ScrollEvent_SetOrientation(*args
, **kwargs
)
4209 def SetPosition(*args
, **kwargs
):
4210 """SetPosition(self, int pos)"""
4211 return _core_
.ScrollEvent_SetPosition(*args
, **kwargs
)
4214 class ScrollEventPtr(ScrollEvent
):
4215 def __init__(self
, this
):
4217 if not hasattr(self
,"thisown"): self
.thisown
= 0
4218 self
.__class
__ = ScrollEvent
4219 _core_
.ScrollEvent_swigregister(ScrollEventPtr
)
4221 #---------------------------------------------------------------------------
4223 class ScrollWinEvent(Event
):
4225 A wx.ScrollWinEvent holds information about scrolling and is sent from
4229 return "<%s.%s; proxy of C++ wxScrollWinEvent 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 pos=0, int orient=0) -> ScrollWinEvent
4234 A wx.ScrollWinEvent holds information about scrolling and is sent from
4237 newobj
= _core_
.new_ScrollWinEvent(*args
, **kwargs
)
4238 self
.this
= newobj
.this
4241 def GetOrientation(*args
, **kwargs
):
4243 GetOrientation(self) -> int
4245 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4248 return _core_
.ScrollWinEvent_GetOrientation(*args
, **kwargs
)
4250 def GetPosition(*args
, **kwargs
):
4252 GetPosition(self) -> int
4254 Returns the position of the scrollbar for the thumb track and release
4255 events. Note that this field can't be used for the other events, you
4256 need to query the window itself for the current position in that case.
4258 return _core_
.ScrollWinEvent_GetPosition(*args
, **kwargs
)
4260 def SetOrientation(*args
, **kwargs
):
4261 """SetOrientation(self, int orient)"""
4262 return _core_
.ScrollWinEvent_SetOrientation(*args
, **kwargs
)
4264 def SetPosition(*args
, **kwargs
):
4265 """SetPosition(self, int pos)"""
4266 return _core_
.ScrollWinEvent_SetPosition(*args
, **kwargs
)
4269 class ScrollWinEventPtr(ScrollWinEvent
):
4270 def __init__(self
, this
):
4272 if not hasattr(self
,"thisown"): self
.thisown
= 0
4273 self
.__class
__ = ScrollWinEvent
4274 _core_
.ScrollWinEvent_swigregister(ScrollWinEventPtr
)
4276 #---------------------------------------------------------------------------
4278 MOUSE_BTN_ANY
= _core_
.MOUSE_BTN_ANY
4279 MOUSE_BTN_NONE
= _core_
.MOUSE_BTN_NONE
4280 MOUSE_BTN_LEFT
= _core_
.MOUSE_BTN_LEFT
4281 MOUSE_BTN_MIDDLE
= _core_
.MOUSE_BTN_MIDDLE
4282 MOUSE_BTN_RIGHT
= _core_
.MOUSE_BTN_RIGHT
4283 class MouseEvent(Event
):
4285 This event class contains information about the events generated by
4286 the mouse: they include mouse buttons press and release events and
4289 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4290 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4291 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4292 a middle button so a portable application should avoid relying on the
4295 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4296 the former returns true when the event corresponds to the left mouse
4297 button click while the latter returns true if the left mouse button is
4298 currently being pressed. For example, when the user is dragging the
4299 mouse you can use `LeftIsDown` to test whether the left mouse button
4300 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4301 `LeftIsDown` will also return true in wxWidgets whatever the
4302 underlying GUI behaviour is (which is platform-dependent). The same
4303 applies, of course, to other mouse buttons as well.
4306 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4307 def __init__(self
, *args
, **kwargs
):
4309 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4311 Constructs a wx.MouseEvent. Valid event types are:
4313 * wxEVT_ENTER_WINDOW
4314 * wxEVT_LEAVE_WINDOW
4320 * wxEVT_MIDDLE_DCLICK
4323 * wxEVT_RIGHT_DCLICK
4327 newobj
= _core_
.new_MouseEvent(*args
, **kwargs
)
4328 self
.this
= newobj
.this
4331 def IsButton(*args
, **kwargs
):
4333 IsButton(self) -> bool
4335 Returns true if the event was a mouse button event (not necessarily a
4336 button down event - that may be tested using `ButtonDown`).
4338 return _core_
.MouseEvent_IsButton(*args
, **kwargs
)
4340 def ButtonDown(*args
, **kwargs
):
4342 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4344 If the argument is omitted, this returns true if the event was any mouse
4345 button down event. Otherwise the argument specifies which button-down
4346 event shold be checked for (see `Button` for the possible values).
4348 return _core_
.MouseEvent_ButtonDown(*args
, **kwargs
)
4350 def ButtonDClick(*args
, **kwargs
):
4352 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4354 If the argument is omitted, this returns true if the event was any
4355 mouse double click event. Otherwise the argument specifies which
4356 double click event to check for (see `Button` for the possible
4359 return _core_
.MouseEvent_ButtonDClick(*args
, **kwargs
)
4361 def ButtonUp(*args
, **kwargs
):
4363 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4365 If the argument is omitted, this returns true if the event was any
4366 mouse button up event. Otherwise the argument specifies which
4367 button up event to check for (see `Button` for the possible values).
4369 return _core_
.MouseEvent_ButtonUp(*args
, **kwargs
)
4371 def Button(*args
, **kwargs
):
4373 Button(self, int button) -> bool
4375 Returns true if the identified mouse button is changing state. Valid
4376 values of button are:
4378 ==================== =====================================
4379 wx.MOUSE_BTN_LEFT check if left button was pressed
4380 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4381 wx.MOUSE_BTN_RIGHT check if right button was pressed
4382 wx.MOUSE_BTN_ANY check if any button was pressed
4383 ==================== =====================================
4386 return _core_
.MouseEvent_Button(*args
, **kwargs
)
4388 def ButtonIsDown(*args
, **kwargs
):
4389 """ButtonIsDown(self, int but) -> bool"""
4390 return _core_
.MouseEvent_ButtonIsDown(*args
, **kwargs
)
4392 def GetButton(*args
, **kwargs
):
4394 GetButton(self) -> int
4396 Returns the mouse button which generated this event or
4397 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4398 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4399 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4400 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4401 right buttons respectively.
4403 return _core_
.MouseEvent_GetButton(*args
, **kwargs
)
4405 def ControlDown(*args
, **kwargs
):
4407 ControlDown(self) -> bool
4409 Returns true if the control key was down at the time of the event.
4411 return _core_
.MouseEvent_ControlDown(*args
, **kwargs
)
4413 def MetaDown(*args
, **kwargs
):
4415 MetaDown(self) -> bool
4417 Returns true if the Meta key was down at the time of the event.
4419 return _core_
.MouseEvent_MetaDown(*args
, **kwargs
)
4421 def AltDown(*args
, **kwargs
):
4423 AltDown(self) -> bool
4425 Returns true if the Alt key was down at the time of the event.
4427 return _core_
.MouseEvent_AltDown(*args
, **kwargs
)
4429 def ShiftDown(*args
, **kwargs
):
4431 ShiftDown(self) -> bool
4433 Returns true if the Shift key was down at the time of the event.
4435 return _core_
.MouseEvent_ShiftDown(*args
, **kwargs
)
4437 def CmdDown(*args
, **kwargs
):
4439 CmdDown(self) -> bool
4441 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4442 platforms but the special "Apple" (a.k.a as "Command") key on
4443 Macs: it often makes sense to use it instead of, say, `ControlDown`
4444 because Cmd key is used for the same thing under Mac as Ctrl
4445 elsewhere. The Ctrl key still exists, it's just not used for this
4446 purpose. So for non-Mac platforms this is the same as `ControlDown`
4447 and Macs this is the same as `MetaDown`.
4449 return _core_
.MouseEvent_CmdDown(*args
, **kwargs
)
4451 def LeftDown(*args
, **kwargs
):
4453 LeftDown(self) -> bool
4455 Returns true if the left mouse button state changed to down.
4457 return _core_
.MouseEvent_LeftDown(*args
, **kwargs
)
4459 def MiddleDown(*args
, **kwargs
):
4461 MiddleDown(self) -> bool
4463 Returns true if the middle mouse button state changed to down.
4465 return _core_
.MouseEvent_MiddleDown(*args
, **kwargs
)
4467 def RightDown(*args
, **kwargs
):
4469 RightDown(self) -> bool
4471 Returns true if the right mouse button state changed to down.
4473 return _core_
.MouseEvent_RightDown(*args
, **kwargs
)
4475 def LeftUp(*args
, **kwargs
):
4477 LeftUp(self) -> bool
4479 Returns true if the left mouse button state changed to up.
4481 return _core_
.MouseEvent_LeftUp(*args
, **kwargs
)
4483 def MiddleUp(*args
, **kwargs
):
4485 MiddleUp(self) -> bool
4487 Returns true if the middle mouse button state changed to up.
4489 return _core_
.MouseEvent_MiddleUp(*args
, **kwargs
)
4491 def RightUp(*args
, **kwargs
):
4493 RightUp(self) -> bool
4495 Returns true if the right mouse button state changed to up.
4497 return _core_
.MouseEvent_RightUp(*args
, **kwargs
)
4499 def LeftDClick(*args
, **kwargs
):
4501 LeftDClick(self) -> bool
4503 Returns true if the event was a left button double click.
4505 return _core_
.MouseEvent_LeftDClick(*args
, **kwargs
)
4507 def MiddleDClick(*args
, **kwargs
):
4509 MiddleDClick(self) -> bool
4511 Returns true if the event was a middle button double click.
4513 return _core_
.MouseEvent_MiddleDClick(*args
, **kwargs
)
4515 def RightDClick(*args
, **kwargs
):
4517 RightDClick(self) -> bool
4519 Returns true if the event was a right button double click.
4521 return _core_
.MouseEvent_RightDClick(*args
, **kwargs
)
4523 def LeftIsDown(*args
, **kwargs
):
4525 LeftIsDown(self) -> bool
4527 Returns true if the left mouse button is currently down, independent
4528 of the current event type.
4530 Please notice that it is not the same as LeftDown which returns true
4531 if the left mouse button was just pressed. Rather, it describes the
4532 state of the mouse button before the event happened.
4534 This event is usually used in the mouse event handlers which process
4535 "move mouse" messages to determine whether the user is (still)
4538 return _core_
.MouseEvent_LeftIsDown(*args
, **kwargs
)
4540 def MiddleIsDown(*args
, **kwargs
):
4542 MiddleIsDown(self) -> bool
4544 Returns true if the middle mouse button is currently down, independent
4545 of the current event type.
4547 return _core_
.MouseEvent_MiddleIsDown(*args
, **kwargs
)
4549 def RightIsDown(*args
, **kwargs
):
4551 RightIsDown(self) -> bool
4553 Returns true if the right mouse button is currently down, independent
4554 of the current event type.
4556 return _core_
.MouseEvent_RightIsDown(*args
, **kwargs
)
4558 def Dragging(*args
, **kwargs
):
4560 Dragging(self) -> bool
4562 Returns true if this was a dragging event (motion while a button is
4565 return _core_
.MouseEvent_Dragging(*args
, **kwargs
)
4567 def Moving(*args
, **kwargs
):
4569 Moving(self) -> bool
4571 Returns true if this was a motion event and no mouse buttons were
4572 pressed. If any mouse button is held pressed, then this method returns
4573 false and Dragging returns true.
4575 return _core_
.MouseEvent_Moving(*args
, **kwargs
)
4577 def Entering(*args
, **kwargs
):
4579 Entering(self) -> bool
4581 Returns true if the mouse was entering the window.
4583 return _core_
.MouseEvent_Entering(*args
, **kwargs
)
4585 def Leaving(*args
, **kwargs
):
4587 Leaving(self) -> bool
4589 Returns true if the mouse was leaving the window.
4591 return _core_
.MouseEvent_Leaving(*args
, **kwargs
)
4593 def GetPosition(*args
, **kwargs
):
4595 GetPosition(self) -> Point
4597 Returns the pixel position of the mouse in window coordinates when the
4600 return _core_
.MouseEvent_GetPosition(*args
, **kwargs
)
4602 def GetPositionTuple(*args
, **kwargs
):
4604 GetPositionTuple() -> (x,y)
4606 Returns the pixel position of the mouse in window coordinates when the
4609 return _core_
.MouseEvent_GetPositionTuple(*args
, **kwargs
)
4611 def GetLogicalPosition(*args
, **kwargs
):
4613 GetLogicalPosition(self, DC dc) -> Point
4615 Returns the logical mouse position in pixels (i.e. translated
4616 according to the translation set for the DC, which usually indicates
4617 that the window has been scrolled).
4619 return _core_
.MouseEvent_GetLogicalPosition(*args
, **kwargs
)
4621 def GetX(*args
, **kwargs
):
4625 Returns X coordinate of the physical mouse event position.
4627 return _core_
.MouseEvent_GetX(*args
, **kwargs
)
4629 def GetY(*args
, **kwargs
):
4633 Returns Y coordinate of the physical mouse event position.
4635 return _core_
.MouseEvent_GetY(*args
, **kwargs
)
4637 def GetWheelRotation(*args
, **kwargs
):
4639 GetWheelRotation(self) -> int
4641 Get wheel rotation, positive or negative indicates direction of
4642 rotation. Current devices all send an event when rotation is equal to
4643 +/-WheelDelta, but this allows for finer resolution devices to be
4644 created in the future. Because of this you shouldn't assume that one
4645 event is equal to 1 line or whatever, but you should be able to either
4646 do partial line scrolling or wait until +/-WheelDelta rotation values
4647 have been accumulated before scrolling.
4649 return _core_
.MouseEvent_GetWheelRotation(*args
, **kwargs
)
4651 def GetWheelDelta(*args
, **kwargs
):
4653 GetWheelDelta(self) -> int
4655 Get wheel delta, normally 120. This is the threshold for action to be
4656 taken, and one such action (for example, scrolling one increment)
4657 should occur for each delta.
4659 return _core_
.MouseEvent_GetWheelDelta(*args
, **kwargs
)
4661 def GetLinesPerAction(*args
, **kwargs
):
4663 GetLinesPerAction(self) -> int
4665 Returns the configured number of lines (or whatever) to be scrolled
4666 per wheel action. Defaults to three.
4668 return _core_
.MouseEvent_GetLinesPerAction(*args
, **kwargs
)
4670 def IsPageScroll(*args
, **kwargs
):
4672 IsPageScroll(self) -> bool
4674 Returns true if the system has been setup to do page scrolling with
4675 the mouse wheel instead of line scrolling.
4677 return _core_
.MouseEvent_IsPageScroll(*args
, **kwargs
)
4679 m_x
= property(_core_
.MouseEvent_m_x_get
, _core_
.MouseEvent_m_x_set
)
4680 m_y
= property(_core_
.MouseEvent_m_y_get
, _core_
.MouseEvent_m_y_set
)
4681 m_leftDown
= property(_core_
.MouseEvent_m_leftDown_get
, _core_
.MouseEvent_m_leftDown_set
)
4682 m_middleDown
= property(_core_
.MouseEvent_m_middleDown_get
, _core_
.MouseEvent_m_middleDown_set
)
4683 m_rightDown
= property(_core_
.MouseEvent_m_rightDown_get
, _core_
.MouseEvent_m_rightDown_set
)
4684 m_controlDown
= property(_core_
.MouseEvent_m_controlDown_get
, _core_
.MouseEvent_m_controlDown_set
)
4685 m_shiftDown
= property(_core_
.MouseEvent_m_shiftDown_get
, _core_
.MouseEvent_m_shiftDown_set
)
4686 m_altDown
= property(_core_
.MouseEvent_m_altDown_get
, _core_
.MouseEvent_m_altDown_set
)
4687 m_metaDown
= property(_core_
.MouseEvent_m_metaDown_get
, _core_
.MouseEvent_m_metaDown_set
)
4688 m_wheelRotation
= property(_core_
.MouseEvent_m_wheelRotation_get
, _core_
.MouseEvent_m_wheelRotation_set
)
4689 m_wheelDelta
= property(_core_
.MouseEvent_m_wheelDelta_get
, _core_
.MouseEvent_m_wheelDelta_set
)
4690 m_linesPerAction
= property(_core_
.MouseEvent_m_linesPerAction_get
, _core_
.MouseEvent_m_linesPerAction_set
)
4692 class MouseEventPtr(MouseEvent
):
4693 def __init__(self
, this
):
4695 if not hasattr(self
,"thisown"): self
.thisown
= 0
4696 self
.__class
__ = MouseEvent
4697 _core_
.MouseEvent_swigregister(MouseEventPtr
)
4699 #---------------------------------------------------------------------------
4701 class SetCursorEvent(Event
):
4702 """Proxy of C++ SetCursorEvent class"""
4704 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4705 def __init__(self
, *args
, **kwargs
):
4706 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
4707 newobj
= _core_
.new_SetCursorEvent(*args
, **kwargs
)
4708 self
.this
= newobj
.this
4711 def GetX(*args
, **kwargs
):
4712 """GetX(self) -> int"""
4713 return _core_
.SetCursorEvent_GetX(*args
, **kwargs
)
4715 def GetY(*args
, **kwargs
):
4716 """GetY(self) -> int"""
4717 return _core_
.SetCursorEvent_GetY(*args
, **kwargs
)
4719 def SetCursor(*args
, **kwargs
):
4720 """SetCursor(self, Cursor cursor)"""
4721 return _core_
.SetCursorEvent_SetCursor(*args
, **kwargs
)
4723 def GetCursor(*args
, **kwargs
):
4724 """GetCursor(self) -> Cursor"""
4725 return _core_
.SetCursorEvent_GetCursor(*args
, **kwargs
)
4727 def HasCursor(*args
, **kwargs
):
4728 """HasCursor(self) -> bool"""
4729 return _core_
.SetCursorEvent_HasCursor(*args
, **kwargs
)
4732 class SetCursorEventPtr(SetCursorEvent
):
4733 def __init__(self
, this
):
4735 if not hasattr(self
,"thisown"): self
.thisown
= 0
4736 self
.__class
__ = SetCursorEvent
4737 _core_
.SetCursorEvent_swigregister(SetCursorEventPtr
)
4739 #---------------------------------------------------------------------------
4741 class KeyEvent(Event
):
4742 """Proxy of C++ KeyEvent class"""
4744 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4745 def __init__(self
, *args
, **kwargs
):
4746 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
4747 newobj
= _core_
.new_KeyEvent(*args
, **kwargs
)
4748 self
.this
= newobj
.this
4751 def ControlDown(*args
, **kwargs
):
4752 """ControlDown(self) -> bool"""
4753 return _core_
.KeyEvent_ControlDown(*args
, **kwargs
)
4755 def MetaDown(*args
, **kwargs
):
4756 """MetaDown(self) -> bool"""
4757 return _core_
.KeyEvent_MetaDown(*args
, **kwargs
)
4759 def AltDown(*args
, **kwargs
):
4760 """AltDown(self) -> bool"""
4761 return _core_
.KeyEvent_AltDown(*args
, **kwargs
)
4763 def ShiftDown(*args
, **kwargs
):
4764 """ShiftDown(self) -> bool"""
4765 return _core_
.KeyEvent_ShiftDown(*args
, **kwargs
)
4767 def CmdDown(*args
, **kwargs
):
4769 CmdDown(self) -> bool
4771 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4772 platforms but the special "Apple" (a.k.a as "Command") key on
4773 Macs: it makes often sense to use it instead of, say, `ControlDown`
4774 because Cmd key is used for the same thing under Mac as Ctrl
4775 elsewhere. The Ctrl still exists, it's just not used for this
4776 purpose. So for non-Mac platforms this is the same as `ControlDown`
4777 and Macs this is the same as `MetaDown`.
4779 return _core_
.KeyEvent_CmdDown(*args
, **kwargs
)
4781 def HasModifiers(*args
, **kwargs
):
4782 """HasModifiers(self) -> bool"""
4783 return _core_
.KeyEvent_HasModifiers(*args
, **kwargs
)
4785 def GetKeyCode(*args
, **kwargs
):
4786 """GetKeyCode(self) -> int"""
4787 return _core_
.KeyEvent_GetKeyCode(*args
, **kwargs
)
4789 KeyCode
= GetKeyCode
4790 def GetUnicodeKey(*args
, **kwargs
):
4791 """GetUnicodeKey(self) -> int"""
4792 return _core_
.KeyEvent_GetUnicodeKey(*args
, **kwargs
)
4794 GetUniChar
= GetUnicodeKey
4795 def GetRawKeyCode(*args
, **kwargs
):
4796 """GetRawKeyCode(self) -> unsigned int"""
4797 return _core_
.KeyEvent_GetRawKeyCode(*args
, **kwargs
)
4799 def GetRawKeyFlags(*args
, **kwargs
):
4800 """GetRawKeyFlags(self) -> unsigned int"""
4801 return _core_
.KeyEvent_GetRawKeyFlags(*args
, **kwargs
)
4803 def GetPosition(*args
, **kwargs
):
4805 GetPosition(self) -> Point
4807 Find the position of the event.
4809 return _core_
.KeyEvent_GetPosition(*args
, **kwargs
)
4811 def GetPositionTuple(*args
, **kwargs
):
4813 GetPositionTuple() -> (x,y)
4815 Find the position of the event.
4817 return _core_
.KeyEvent_GetPositionTuple(*args
, **kwargs
)
4819 def GetX(*args
, **kwargs
):
4820 """GetX(self) -> int"""
4821 return _core_
.KeyEvent_GetX(*args
, **kwargs
)
4823 def GetY(*args
, **kwargs
):
4824 """GetY(self) -> int"""
4825 return _core_
.KeyEvent_GetY(*args
, **kwargs
)
4827 m_x
= property(_core_
.KeyEvent_m_x_get
, _core_
.KeyEvent_m_x_set
)
4828 m_y
= property(_core_
.KeyEvent_m_y_get
, _core_
.KeyEvent_m_y_set
)
4829 m_keyCode
= property(_core_
.KeyEvent_m_keyCode_get
, _core_
.KeyEvent_m_keyCode_set
)
4830 m_controlDown
= property(_core_
.KeyEvent_m_controlDown_get
, _core_
.KeyEvent_m_controlDown_set
)
4831 m_shiftDown
= property(_core_
.KeyEvent_m_shiftDown_get
, _core_
.KeyEvent_m_shiftDown_set
)
4832 m_altDown
= property(_core_
.KeyEvent_m_altDown_get
, _core_
.KeyEvent_m_altDown_set
)
4833 m_metaDown
= property(_core_
.KeyEvent_m_metaDown_get
, _core_
.KeyEvent_m_metaDown_set
)
4834 m_scanCode
= property(_core_
.KeyEvent_m_scanCode_get
, _core_
.KeyEvent_m_scanCode_set
)
4835 m_rawCode
= property(_core_
.KeyEvent_m_rawCode_get
, _core_
.KeyEvent_m_rawCode_set
)
4836 m_rawFlags
= property(_core_
.KeyEvent_m_rawFlags_get
, _core_
.KeyEvent_m_rawFlags_set
)
4838 class KeyEventPtr(KeyEvent
):
4839 def __init__(self
, this
):
4841 if not hasattr(self
,"thisown"): self
.thisown
= 0
4842 self
.__class
__ = KeyEvent
4843 _core_
.KeyEvent_swigregister(KeyEventPtr
)
4845 #---------------------------------------------------------------------------
4847 class SizeEvent(Event
):
4848 """Proxy of C++ SizeEvent class"""
4850 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4851 def __init__(self
, *args
, **kwargs
):
4852 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
4853 newobj
= _core_
.new_SizeEvent(*args
, **kwargs
)
4854 self
.this
= newobj
.this
4857 def GetSize(*args
, **kwargs
):
4858 """GetSize(self) -> Size"""
4859 return _core_
.SizeEvent_GetSize(*args
, **kwargs
)
4861 def GetRect(*args
, **kwargs
):
4862 """GetRect(self) -> Rect"""
4863 return _core_
.SizeEvent_GetRect(*args
, **kwargs
)
4865 def SetRect(*args
, **kwargs
):
4866 """SetRect(self, Rect rect)"""
4867 return _core_
.SizeEvent_SetRect(*args
, **kwargs
)
4869 def SetSize(*args
, **kwargs
):
4870 """SetSize(self, Size size)"""
4871 return _core_
.SizeEvent_SetSize(*args
, **kwargs
)
4873 m_size
= property(_core_
.SizeEvent_m_size_get
, _core_
.SizeEvent_m_size_set
)
4874 m_rect
= property(_core_
.SizeEvent_m_rect_get
, _core_
.SizeEvent_m_rect_set
)
4876 class SizeEventPtr(SizeEvent
):
4877 def __init__(self
, this
):
4879 if not hasattr(self
,"thisown"): self
.thisown
= 0
4880 self
.__class
__ = SizeEvent
4881 _core_
.SizeEvent_swigregister(SizeEventPtr
)
4883 #---------------------------------------------------------------------------
4885 class MoveEvent(Event
):
4886 """Proxy of C++ MoveEvent class"""
4888 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4889 def __init__(self
, *args
, **kwargs
):
4890 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
4891 newobj
= _core_
.new_MoveEvent(*args
, **kwargs
)
4892 self
.this
= newobj
.this
4895 def GetPosition(*args
, **kwargs
):
4896 """GetPosition(self) -> Point"""
4897 return _core_
.MoveEvent_GetPosition(*args
, **kwargs
)
4899 def GetRect(*args
, **kwargs
):
4900 """GetRect(self) -> Rect"""
4901 return _core_
.MoveEvent_GetRect(*args
, **kwargs
)
4903 def SetRect(*args
, **kwargs
):
4904 """SetRect(self, Rect rect)"""
4905 return _core_
.MoveEvent_SetRect(*args
, **kwargs
)
4907 def SetPosition(*args
, **kwargs
):
4908 """SetPosition(self, Point pos)"""
4909 return _core_
.MoveEvent_SetPosition(*args
, **kwargs
)
4911 m_pos
= property(GetPosition
, SetPosition
)
4912 m_rect
= property(GetRect
, SetRect
)
4915 class MoveEventPtr(MoveEvent
):
4916 def __init__(self
, this
):
4918 if not hasattr(self
,"thisown"): self
.thisown
= 0
4919 self
.__class
__ = MoveEvent
4920 _core_
.MoveEvent_swigregister(MoveEventPtr
)
4922 #---------------------------------------------------------------------------
4924 class PaintEvent(Event
):
4925 """Proxy of C++ PaintEvent class"""
4927 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4928 def __init__(self
, *args
, **kwargs
):
4929 """__init__(self, int Id=0) -> PaintEvent"""
4930 newobj
= _core_
.new_PaintEvent(*args
, **kwargs
)
4931 self
.this
= newobj
.this
4935 class PaintEventPtr(PaintEvent
):
4936 def __init__(self
, this
):
4938 if not hasattr(self
,"thisown"): self
.thisown
= 0
4939 self
.__class
__ = PaintEvent
4940 _core_
.PaintEvent_swigregister(PaintEventPtr
)
4942 class NcPaintEvent(Event
):
4943 """Proxy of C++ NcPaintEvent class"""
4945 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4946 def __init__(self
, *args
, **kwargs
):
4947 """__init__(self, int winid=0) -> NcPaintEvent"""
4948 newobj
= _core_
.new_NcPaintEvent(*args
, **kwargs
)
4949 self
.this
= newobj
.this
4953 class NcPaintEventPtr(NcPaintEvent
):
4954 def __init__(self
, this
):
4956 if not hasattr(self
,"thisown"): self
.thisown
= 0
4957 self
.__class
__ = NcPaintEvent
4958 _core_
.NcPaintEvent_swigregister(NcPaintEventPtr
)
4960 #---------------------------------------------------------------------------
4962 class EraseEvent(Event
):
4963 """Proxy of C++ EraseEvent class"""
4965 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4966 def __init__(self
, *args
, **kwargs
):
4967 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
4968 newobj
= _core_
.new_EraseEvent(*args
, **kwargs
)
4969 self
.this
= newobj
.this
4972 def GetDC(*args
, **kwargs
):
4973 """GetDC(self) -> DC"""
4974 return _core_
.EraseEvent_GetDC(*args
, **kwargs
)
4977 class EraseEventPtr(EraseEvent
):
4978 def __init__(self
, this
):
4980 if not hasattr(self
,"thisown"): self
.thisown
= 0
4981 self
.__class
__ = EraseEvent
4982 _core_
.EraseEvent_swigregister(EraseEventPtr
)
4984 #---------------------------------------------------------------------------
4986 class FocusEvent(Event
):
4987 """Proxy of C++ FocusEvent class"""
4989 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
4990 def __init__(self
, *args
, **kwargs
):
4991 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
4992 newobj
= _core_
.new_FocusEvent(*args
, **kwargs
)
4993 self
.this
= newobj
.this
4996 def GetWindow(*args
, **kwargs
):
4997 """GetWindow(self) -> Window"""
4998 return _core_
.FocusEvent_GetWindow(*args
, **kwargs
)
5000 def SetWindow(*args
, **kwargs
):
5001 """SetWindow(self, Window win)"""
5002 return _core_
.FocusEvent_SetWindow(*args
, **kwargs
)
5005 class FocusEventPtr(FocusEvent
):
5006 def __init__(self
, this
):
5008 if not hasattr(self
,"thisown"): self
.thisown
= 0
5009 self
.__class
__ = FocusEvent
5010 _core_
.FocusEvent_swigregister(FocusEventPtr
)
5012 #---------------------------------------------------------------------------
5014 class ChildFocusEvent(CommandEvent
):
5015 """Proxy of C++ ChildFocusEvent class"""
5017 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5018 def __init__(self
, *args
, **kwargs
):
5019 """__init__(self, Window win=None) -> ChildFocusEvent"""
5020 newobj
= _core_
.new_ChildFocusEvent(*args
, **kwargs
)
5021 self
.this
= newobj
.this
5024 def GetWindow(*args
, **kwargs
):
5025 """GetWindow(self) -> Window"""
5026 return _core_
.ChildFocusEvent_GetWindow(*args
, **kwargs
)
5029 class ChildFocusEventPtr(ChildFocusEvent
):
5030 def __init__(self
, this
):
5032 if not hasattr(self
,"thisown"): self
.thisown
= 0
5033 self
.__class
__ = ChildFocusEvent
5034 _core_
.ChildFocusEvent_swigregister(ChildFocusEventPtr
)
5036 #---------------------------------------------------------------------------
5038 class ActivateEvent(Event
):
5039 """Proxy of C++ ActivateEvent class"""
5041 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5042 def __init__(self
, *args
, **kwargs
):
5043 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
5044 newobj
= _core_
.new_ActivateEvent(*args
, **kwargs
)
5045 self
.this
= newobj
.this
5048 def GetActive(*args
, **kwargs
):
5049 """GetActive(self) -> bool"""
5050 return _core_
.ActivateEvent_GetActive(*args
, **kwargs
)
5053 class ActivateEventPtr(ActivateEvent
):
5054 def __init__(self
, this
):
5056 if not hasattr(self
,"thisown"): self
.thisown
= 0
5057 self
.__class
__ = ActivateEvent
5058 _core_
.ActivateEvent_swigregister(ActivateEventPtr
)
5060 #---------------------------------------------------------------------------
5062 class InitDialogEvent(Event
):
5063 """Proxy of C++ InitDialogEvent class"""
5065 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5066 def __init__(self
, *args
, **kwargs
):
5067 """__init__(self, int Id=0) -> InitDialogEvent"""
5068 newobj
= _core_
.new_InitDialogEvent(*args
, **kwargs
)
5069 self
.this
= newobj
.this
5073 class InitDialogEventPtr(InitDialogEvent
):
5074 def __init__(self
, this
):
5076 if not hasattr(self
,"thisown"): self
.thisown
= 0
5077 self
.__class
__ = InitDialogEvent
5078 _core_
.InitDialogEvent_swigregister(InitDialogEventPtr
)
5080 #---------------------------------------------------------------------------
5082 class MenuEvent(Event
):
5083 """Proxy of C++ MenuEvent class"""
5085 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5086 def __init__(self
, *args
, **kwargs
):
5087 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
5088 newobj
= _core_
.new_MenuEvent(*args
, **kwargs
)
5089 self
.this
= newobj
.this
5092 def GetMenuId(*args
, **kwargs
):
5093 """GetMenuId(self) -> int"""
5094 return _core_
.MenuEvent_GetMenuId(*args
, **kwargs
)
5096 def IsPopup(*args
, **kwargs
):
5097 """IsPopup(self) -> bool"""
5098 return _core_
.MenuEvent_IsPopup(*args
, **kwargs
)
5100 def GetMenu(*args
, **kwargs
):
5101 """GetMenu(self) -> Menu"""
5102 return _core_
.MenuEvent_GetMenu(*args
, **kwargs
)
5105 class MenuEventPtr(MenuEvent
):
5106 def __init__(self
, this
):
5108 if not hasattr(self
,"thisown"): self
.thisown
= 0
5109 self
.__class
__ = MenuEvent
5110 _core_
.MenuEvent_swigregister(MenuEventPtr
)
5112 #---------------------------------------------------------------------------
5114 class CloseEvent(Event
):
5115 """Proxy of C++ CloseEvent class"""
5117 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5118 def __init__(self
, *args
, **kwargs
):
5119 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
5120 newobj
= _core_
.new_CloseEvent(*args
, **kwargs
)
5121 self
.this
= newobj
.this
5124 def SetLoggingOff(*args
, **kwargs
):
5125 """SetLoggingOff(self, bool logOff)"""
5126 return _core_
.CloseEvent_SetLoggingOff(*args
, **kwargs
)
5128 def GetLoggingOff(*args
, **kwargs
):
5129 """GetLoggingOff(self) -> bool"""
5130 return _core_
.CloseEvent_GetLoggingOff(*args
, **kwargs
)
5132 def Veto(*args
, **kwargs
):
5133 """Veto(self, bool veto=True)"""
5134 return _core_
.CloseEvent_Veto(*args
, **kwargs
)
5136 def SetCanVeto(*args
, **kwargs
):
5137 """SetCanVeto(self, bool canVeto)"""
5138 return _core_
.CloseEvent_SetCanVeto(*args
, **kwargs
)
5140 def CanVeto(*args
, **kwargs
):
5141 """CanVeto(self) -> bool"""
5142 return _core_
.CloseEvent_CanVeto(*args
, **kwargs
)
5144 def GetVeto(*args
, **kwargs
):
5145 """GetVeto(self) -> bool"""
5146 return _core_
.CloseEvent_GetVeto(*args
, **kwargs
)
5149 class CloseEventPtr(CloseEvent
):
5150 def __init__(self
, this
):
5152 if not hasattr(self
,"thisown"): self
.thisown
= 0
5153 self
.__class
__ = CloseEvent
5154 _core_
.CloseEvent_swigregister(CloseEventPtr
)
5156 #---------------------------------------------------------------------------
5158 class ShowEvent(Event
):
5159 """Proxy of C++ ShowEvent class"""
5161 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5162 def __init__(self
, *args
, **kwargs
):
5163 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
5164 newobj
= _core_
.new_ShowEvent(*args
, **kwargs
)
5165 self
.this
= newobj
.this
5168 def SetShow(*args
, **kwargs
):
5169 """SetShow(self, bool show)"""
5170 return _core_
.ShowEvent_SetShow(*args
, **kwargs
)
5172 def GetShow(*args
, **kwargs
):
5173 """GetShow(self) -> bool"""
5174 return _core_
.ShowEvent_GetShow(*args
, **kwargs
)
5177 class ShowEventPtr(ShowEvent
):
5178 def __init__(self
, this
):
5180 if not hasattr(self
,"thisown"): self
.thisown
= 0
5181 self
.__class
__ = ShowEvent
5182 _core_
.ShowEvent_swigregister(ShowEventPtr
)
5184 #---------------------------------------------------------------------------
5186 class IconizeEvent(Event
):
5187 """Proxy of C++ IconizeEvent class"""
5189 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5190 def __init__(self
, *args
, **kwargs
):
5191 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
5192 newobj
= _core_
.new_IconizeEvent(*args
, **kwargs
)
5193 self
.this
= newobj
.this
5196 def Iconized(*args
, **kwargs
):
5197 """Iconized(self) -> bool"""
5198 return _core_
.IconizeEvent_Iconized(*args
, **kwargs
)
5201 class IconizeEventPtr(IconizeEvent
):
5202 def __init__(self
, this
):
5204 if not hasattr(self
,"thisown"): self
.thisown
= 0
5205 self
.__class
__ = IconizeEvent
5206 _core_
.IconizeEvent_swigregister(IconizeEventPtr
)
5208 #---------------------------------------------------------------------------
5210 class MaximizeEvent(Event
):
5211 """Proxy of C++ MaximizeEvent class"""
5213 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5214 def __init__(self
, *args
, **kwargs
):
5215 """__init__(self, int id=0) -> MaximizeEvent"""
5216 newobj
= _core_
.new_MaximizeEvent(*args
, **kwargs
)
5217 self
.this
= newobj
.this
5221 class MaximizeEventPtr(MaximizeEvent
):
5222 def __init__(self
, this
):
5224 if not hasattr(self
,"thisown"): self
.thisown
= 0
5225 self
.__class
__ = MaximizeEvent
5226 _core_
.MaximizeEvent_swigregister(MaximizeEventPtr
)
5228 #---------------------------------------------------------------------------
5230 class DropFilesEvent(Event
):
5231 """Proxy of C++ DropFilesEvent class"""
5232 def __init__(self
): raise RuntimeError, "No constructor defined"
5234 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5235 def GetPosition(*args
, **kwargs
):
5236 """GetPosition(self) -> Point"""
5237 return _core_
.DropFilesEvent_GetPosition(*args
, **kwargs
)
5239 def GetNumberOfFiles(*args
, **kwargs
):
5240 """GetNumberOfFiles(self) -> int"""
5241 return _core_
.DropFilesEvent_GetNumberOfFiles(*args
, **kwargs
)
5243 def GetFiles(*args
, **kwargs
):
5244 """GetFiles(self) -> PyObject"""
5245 return _core_
.DropFilesEvent_GetFiles(*args
, **kwargs
)
5248 class DropFilesEventPtr(DropFilesEvent
):
5249 def __init__(self
, this
):
5251 if not hasattr(self
,"thisown"): self
.thisown
= 0
5252 self
.__class
__ = DropFilesEvent
5253 _core_
.DropFilesEvent_swigregister(DropFilesEventPtr
)
5255 #---------------------------------------------------------------------------
5257 UPDATE_UI_PROCESS_ALL
= _core_
.UPDATE_UI_PROCESS_ALL
5258 UPDATE_UI_PROCESS_SPECIFIED
= _core_
.UPDATE_UI_PROCESS_SPECIFIED
5259 class UpdateUIEvent(CommandEvent
):
5260 """Proxy of C++ UpdateUIEvent class"""
5262 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5263 def __init__(self
, *args
, **kwargs
):
5264 """__init__(self, int commandId=0) -> UpdateUIEvent"""
5265 newobj
= _core_
.new_UpdateUIEvent(*args
, **kwargs
)
5266 self
.this
= newobj
.this
5269 def GetChecked(*args
, **kwargs
):
5270 """GetChecked(self) -> bool"""
5271 return _core_
.UpdateUIEvent_GetChecked(*args
, **kwargs
)
5273 def GetEnabled(*args
, **kwargs
):
5274 """GetEnabled(self) -> bool"""
5275 return _core_
.UpdateUIEvent_GetEnabled(*args
, **kwargs
)
5277 def GetText(*args
, **kwargs
):
5278 """GetText(self) -> String"""
5279 return _core_
.UpdateUIEvent_GetText(*args
, **kwargs
)
5281 def GetSetText(*args
, **kwargs
):
5282 """GetSetText(self) -> bool"""
5283 return _core_
.UpdateUIEvent_GetSetText(*args
, **kwargs
)
5285 def GetSetChecked(*args
, **kwargs
):
5286 """GetSetChecked(self) -> bool"""
5287 return _core_
.UpdateUIEvent_GetSetChecked(*args
, **kwargs
)
5289 def GetSetEnabled(*args
, **kwargs
):
5290 """GetSetEnabled(self) -> bool"""
5291 return _core_
.UpdateUIEvent_GetSetEnabled(*args
, **kwargs
)
5293 def Check(*args
, **kwargs
):
5294 """Check(self, bool check)"""
5295 return _core_
.UpdateUIEvent_Check(*args
, **kwargs
)
5297 def Enable(*args
, **kwargs
):
5298 """Enable(self, bool enable)"""
5299 return _core_
.UpdateUIEvent_Enable(*args
, **kwargs
)
5301 def SetText(*args
, **kwargs
):
5302 """SetText(self, String text)"""
5303 return _core_
.UpdateUIEvent_SetText(*args
, **kwargs
)
5305 def SetUpdateInterval(*args
, **kwargs
):
5306 """SetUpdateInterval(long updateInterval)"""
5307 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5309 SetUpdateInterval
= staticmethod(SetUpdateInterval
)
5310 def GetUpdateInterval(*args
, **kwargs
):
5311 """GetUpdateInterval() -> long"""
5312 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5314 GetUpdateInterval
= staticmethod(GetUpdateInterval
)
5315 def CanUpdate(*args
, **kwargs
):
5316 """CanUpdate(Window win) -> bool"""
5317 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5319 CanUpdate
= staticmethod(CanUpdate
)
5320 def ResetUpdateTime(*args
, **kwargs
):
5321 """ResetUpdateTime()"""
5322 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5324 ResetUpdateTime
= staticmethod(ResetUpdateTime
)
5325 def SetMode(*args
, **kwargs
):
5326 """SetMode(int mode)"""
5327 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5329 SetMode
= staticmethod(SetMode
)
5330 def GetMode(*args
, **kwargs
):
5331 """GetMode() -> int"""
5332 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5334 GetMode
= staticmethod(GetMode
)
5336 class UpdateUIEventPtr(UpdateUIEvent
):
5337 def __init__(self
, this
):
5339 if not hasattr(self
,"thisown"): self
.thisown
= 0
5340 self
.__class
__ = UpdateUIEvent
5341 _core_
.UpdateUIEvent_swigregister(UpdateUIEventPtr
)
5343 def UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
):
5344 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
5345 return _core_
.UpdateUIEvent_SetUpdateInterval(*args
, **kwargs
)
5347 def UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
):
5348 """UpdateUIEvent_GetUpdateInterval() -> long"""
5349 return _core_
.UpdateUIEvent_GetUpdateInterval(*args
, **kwargs
)
5351 def UpdateUIEvent_CanUpdate(*args
, **kwargs
):
5352 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
5353 return _core_
.UpdateUIEvent_CanUpdate(*args
, **kwargs
)
5355 def UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
):
5356 """UpdateUIEvent_ResetUpdateTime()"""
5357 return _core_
.UpdateUIEvent_ResetUpdateTime(*args
, **kwargs
)
5359 def UpdateUIEvent_SetMode(*args
, **kwargs
):
5360 """UpdateUIEvent_SetMode(int mode)"""
5361 return _core_
.UpdateUIEvent_SetMode(*args
, **kwargs
)
5363 def UpdateUIEvent_GetMode(*args
, **kwargs
):
5364 """UpdateUIEvent_GetMode() -> int"""
5365 return _core_
.UpdateUIEvent_GetMode(*args
, **kwargs
)
5367 #---------------------------------------------------------------------------
5369 class SysColourChangedEvent(Event
):
5370 """Proxy of C++ SysColourChangedEvent class"""
5372 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5373 def __init__(self
, *args
, **kwargs
):
5374 """__init__(self) -> SysColourChangedEvent"""
5375 newobj
= _core_
.new_SysColourChangedEvent(*args
, **kwargs
)
5376 self
.this
= newobj
.this
5380 class SysColourChangedEventPtr(SysColourChangedEvent
):
5381 def __init__(self
, this
):
5383 if not hasattr(self
,"thisown"): self
.thisown
= 0
5384 self
.__class
__ = SysColourChangedEvent
5385 _core_
.SysColourChangedEvent_swigregister(SysColourChangedEventPtr
)
5387 #---------------------------------------------------------------------------
5389 class MouseCaptureChangedEvent(Event
):
5390 """Proxy of C++ MouseCaptureChangedEvent class"""
5392 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5393 def __init__(self
, *args
, **kwargs
):
5394 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
5395 newobj
= _core_
.new_MouseCaptureChangedEvent(*args
, **kwargs
)
5396 self
.this
= newobj
.this
5399 def GetCapturedWindow(*args
, **kwargs
):
5400 """GetCapturedWindow(self) -> Window"""
5401 return _core_
.MouseCaptureChangedEvent_GetCapturedWindow(*args
, **kwargs
)
5404 class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent
):
5405 def __init__(self
, this
):
5407 if not hasattr(self
,"thisown"): self
.thisown
= 0
5408 self
.__class
__ = MouseCaptureChangedEvent
5409 _core_
.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr
)
5411 #---------------------------------------------------------------------------
5413 class DisplayChangedEvent(Event
):
5414 """Proxy of C++ DisplayChangedEvent class"""
5416 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5417 def __init__(self
, *args
, **kwargs
):
5418 """__init__(self) -> DisplayChangedEvent"""
5419 newobj
= _core_
.new_DisplayChangedEvent(*args
, **kwargs
)
5420 self
.this
= newobj
.this
5424 class DisplayChangedEventPtr(DisplayChangedEvent
):
5425 def __init__(self
, this
):
5427 if not hasattr(self
,"thisown"): self
.thisown
= 0
5428 self
.__class
__ = DisplayChangedEvent
5429 _core_
.DisplayChangedEvent_swigregister(DisplayChangedEventPtr
)
5431 #---------------------------------------------------------------------------
5433 class PaletteChangedEvent(Event
):
5434 """Proxy of C++ PaletteChangedEvent class"""
5436 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5437 def __init__(self
, *args
, **kwargs
):
5438 """__init__(self, int id=0) -> PaletteChangedEvent"""
5439 newobj
= _core_
.new_PaletteChangedEvent(*args
, **kwargs
)
5440 self
.this
= newobj
.this
5443 def SetChangedWindow(*args
, **kwargs
):
5444 """SetChangedWindow(self, Window win)"""
5445 return _core_
.PaletteChangedEvent_SetChangedWindow(*args
, **kwargs
)
5447 def GetChangedWindow(*args
, **kwargs
):
5448 """GetChangedWindow(self) -> Window"""
5449 return _core_
.PaletteChangedEvent_GetChangedWindow(*args
, **kwargs
)
5452 class PaletteChangedEventPtr(PaletteChangedEvent
):
5453 def __init__(self
, this
):
5455 if not hasattr(self
,"thisown"): self
.thisown
= 0
5456 self
.__class
__ = PaletteChangedEvent
5457 _core_
.PaletteChangedEvent_swigregister(PaletteChangedEventPtr
)
5459 #---------------------------------------------------------------------------
5461 class QueryNewPaletteEvent(Event
):
5462 """Proxy of C++ QueryNewPaletteEvent class"""
5464 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5465 def __init__(self
, *args
, **kwargs
):
5466 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
5467 newobj
= _core_
.new_QueryNewPaletteEvent(*args
, **kwargs
)
5468 self
.this
= newobj
.this
5471 def SetPaletteRealized(*args
, **kwargs
):
5472 """SetPaletteRealized(self, bool realized)"""
5473 return _core_
.QueryNewPaletteEvent_SetPaletteRealized(*args
, **kwargs
)
5475 def GetPaletteRealized(*args
, **kwargs
):
5476 """GetPaletteRealized(self) -> bool"""
5477 return _core_
.QueryNewPaletteEvent_GetPaletteRealized(*args
, **kwargs
)
5480 class QueryNewPaletteEventPtr(QueryNewPaletteEvent
):
5481 def __init__(self
, this
):
5483 if not hasattr(self
,"thisown"): self
.thisown
= 0
5484 self
.__class
__ = QueryNewPaletteEvent
5485 _core_
.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr
)
5487 #---------------------------------------------------------------------------
5489 class NavigationKeyEvent(Event
):
5490 """Proxy of C++ NavigationKeyEvent class"""
5492 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5493 def __init__(self
, *args
, **kwargs
):
5494 """__init__(self) -> NavigationKeyEvent"""
5495 newobj
= _core_
.new_NavigationKeyEvent(*args
, **kwargs
)
5496 self
.this
= newobj
.this
5499 def GetDirection(*args
, **kwargs
):
5500 """GetDirection(self) -> bool"""
5501 return _core_
.NavigationKeyEvent_GetDirection(*args
, **kwargs
)
5503 def SetDirection(*args
, **kwargs
):
5504 """SetDirection(self, bool forward)"""
5505 return _core_
.NavigationKeyEvent_SetDirection(*args
, **kwargs
)
5507 def IsWindowChange(*args
, **kwargs
):
5508 """IsWindowChange(self) -> bool"""
5509 return _core_
.NavigationKeyEvent_IsWindowChange(*args
, **kwargs
)
5511 def SetWindowChange(*args
, **kwargs
):
5512 """SetWindowChange(self, bool ischange)"""
5513 return _core_
.NavigationKeyEvent_SetWindowChange(*args
, **kwargs
)
5515 def IsFromTab(*args
, **kwargs
):
5516 """IsFromTab(self) -> bool"""
5517 return _core_
.NavigationKeyEvent_IsFromTab(*args
, **kwargs
)
5519 def SetFromTab(*args
, **kwargs
):
5520 """SetFromTab(self, bool bIs)"""
5521 return _core_
.NavigationKeyEvent_SetFromTab(*args
, **kwargs
)
5523 def SetFlags(*args
, **kwargs
):
5524 """SetFlags(self, long flags)"""
5525 return _core_
.NavigationKeyEvent_SetFlags(*args
, **kwargs
)
5527 def GetCurrentFocus(*args
, **kwargs
):
5528 """GetCurrentFocus(self) -> Window"""
5529 return _core_
.NavigationKeyEvent_GetCurrentFocus(*args
, **kwargs
)
5531 def SetCurrentFocus(*args
, **kwargs
):
5532 """SetCurrentFocus(self, Window win)"""
5533 return _core_
.NavigationKeyEvent_SetCurrentFocus(*args
, **kwargs
)
5535 IsBackward
= _core_
.NavigationKeyEvent_IsBackward
5536 IsForward
= _core_
.NavigationKeyEvent_IsForward
5537 WinChange
= _core_
.NavigationKeyEvent_WinChange
5538 FromTab
= _core_
.NavigationKeyEvent_FromTab
5540 class NavigationKeyEventPtr(NavigationKeyEvent
):
5541 def __init__(self
, this
):
5543 if not hasattr(self
,"thisown"): self
.thisown
= 0
5544 self
.__class
__ = NavigationKeyEvent
5545 _core_
.NavigationKeyEvent_swigregister(NavigationKeyEventPtr
)
5547 #---------------------------------------------------------------------------
5549 class WindowCreateEvent(CommandEvent
):
5550 """Proxy of C++ WindowCreateEvent class"""
5552 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5553 def __init__(self
, *args
, **kwargs
):
5554 """__init__(self, Window win=None) -> WindowCreateEvent"""
5555 newobj
= _core_
.new_WindowCreateEvent(*args
, **kwargs
)
5556 self
.this
= newobj
.this
5559 def GetWindow(*args
, **kwargs
):
5560 """GetWindow(self) -> Window"""
5561 return _core_
.WindowCreateEvent_GetWindow(*args
, **kwargs
)
5564 class WindowCreateEventPtr(WindowCreateEvent
):
5565 def __init__(self
, this
):
5567 if not hasattr(self
,"thisown"): self
.thisown
= 0
5568 self
.__class
__ = WindowCreateEvent
5569 _core_
.WindowCreateEvent_swigregister(WindowCreateEventPtr
)
5571 class WindowDestroyEvent(CommandEvent
):
5572 """Proxy of C++ WindowDestroyEvent class"""
5574 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5575 def __init__(self
, *args
, **kwargs
):
5576 """__init__(self, Window win=None) -> WindowDestroyEvent"""
5577 newobj
= _core_
.new_WindowDestroyEvent(*args
, **kwargs
)
5578 self
.this
= newobj
.this
5581 def GetWindow(*args
, **kwargs
):
5582 """GetWindow(self) -> Window"""
5583 return _core_
.WindowDestroyEvent_GetWindow(*args
, **kwargs
)
5586 class WindowDestroyEventPtr(WindowDestroyEvent
):
5587 def __init__(self
, this
):
5589 if not hasattr(self
,"thisown"): self
.thisown
= 0
5590 self
.__class
__ = WindowDestroyEvent
5591 _core_
.WindowDestroyEvent_swigregister(WindowDestroyEventPtr
)
5593 #---------------------------------------------------------------------------
5595 class ContextMenuEvent(CommandEvent
):
5596 """Proxy of C++ ContextMenuEvent class"""
5598 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5599 def __init__(self
, *args
, **kwargs
):
5600 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
5601 newobj
= _core_
.new_ContextMenuEvent(*args
, **kwargs
)
5602 self
.this
= newobj
.this
5605 def GetPosition(*args
, **kwargs
):
5606 """GetPosition(self) -> Point"""
5607 return _core_
.ContextMenuEvent_GetPosition(*args
, **kwargs
)
5609 def SetPosition(*args
, **kwargs
):
5610 """SetPosition(self, Point pos)"""
5611 return _core_
.ContextMenuEvent_SetPosition(*args
, **kwargs
)
5614 class ContextMenuEventPtr(ContextMenuEvent
):
5615 def __init__(self
, this
):
5617 if not hasattr(self
,"thisown"): self
.thisown
= 0
5618 self
.__class
__ = ContextMenuEvent
5619 _core_
.ContextMenuEvent_swigregister(ContextMenuEventPtr
)
5621 #---------------------------------------------------------------------------
5623 IDLE_PROCESS_ALL
= _core_
.IDLE_PROCESS_ALL
5624 IDLE_PROCESS_SPECIFIED
= _core_
.IDLE_PROCESS_SPECIFIED
5625 class IdleEvent(Event
):
5626 """Proxy of C++ IdleEvent class"""
5628 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5629 def __init__(self
, *args
, **kwargs
):
5630 """__init__(self) -> IdleEvent"""
5631 newobj
= _core_
.new_IdleEvent(*args
, **kwargs
)
5632 self
.this
= newobj
.this
5635 def RequestMore(*args
, **kwargs
):
5636 """RequestMore(self, bool needMore=True)"""
5637 return _core_
.IdleEvent_RequestMore(*args
, **kwargs
)
5639 def MoreRequested(*args
, **kwargs
):
5640 """MoreRequested(self) -> bool"""
5641 return _core_
.IdleEvent_MoreRequested(*args
, **kwargs
)
5643 def SetMode(*args
, **kwargs
):
5644 """SetMode(int mode)"""
5645 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
5647 SetMode
= staticmethod(SetMode
)
5648 def GetMode(*args
, **kwargs
):
5649 """GetMode() -> int"""
5650 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
5652 GetMode
= staticmethod(GetMode
)
5653 def CanSend(*args
, **kwargs
):
5654 """CanSend(Window win) -> bool"""
5655 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
5657 CanSend
= staticmethod(CanSend
)
5659 class IdleEventPtr(IdleEvent
):
5660 def __init__(self
, this
):
5662 if not hasattr(self
,"thisown"): self
.thisown
= 0
5663 self
.__class
__ = IdleEvent
5664 _core_
.IdleEvent_swigregister(IdleEventPtr
)
5666 def IdleEvent_SetMode(*args
, **kwargs
):
5667 """IdleEvent_SetMode(int mode)"""
5668 return _core_
.IdleEvent_SetMode(*args
, **kwargs
)
5670 def IdleEvent_GetMode(*args
, **kwargs
):
5671 """IdleEvent_GetMode() -> int"""
5672 return _core_
.IdleEvent_GetMode(*args
, **kwargs
)
5674 def IdleEvent_CanSend(*args
, **kwargs
):
5675 """IdleEvent_CanSend(Window win) -> bool"""
5676 return _core_
.IdleEvent_CanSend(*args
, **kwargs
)
5678 #---------------------------------------------------------------------------
5680 class PyEvent(Event
):
5681 """Proxy of C++ PyEvent class"""
5683 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5684 def __init__(self
, *args
, **kwargs
):
5685 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
5686 newobj
= _core_
.new_PyEvent(*args
, **kwargs
)
5687 self
.this
= newobj
.this
5692 def __del__(self
, destroy
=_core_
.delete_PyEvent
):
5695 if self
.thisown
: destroy(self
)
5698 def SetSelf(*args
, **kwargs
):
5699 """SetSelf(self, PyObject self)"""
5700 return _core_
.PyEvent_SetSelf(*args
, **kwargs
)
5702 def GetSelf(*args
, **kwargs
):
5703 """GetSelf(self) -> PyObject"""
5704 return _core_
.PyEvent_GetSelf(*args
, **kwargs
)
5707 class PyEventPtr(PyEvent
):
5708 def __init__(self
, this
):
5710 if not hasattr(self
,"thisown"): self
.thisown
= 0
5711 self
.__class
__ = PyEvent
5712 _core_
.PyEvent_swigregister(PyEventPtr
)
5714 class PyCommandEvent(CommandEvent
):
5715 """Proxy of C++ PyCommandEvent class"""
5717 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5718 def __init__(self
, *args
, **kwargs
):
5719 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
5720 newobj
= _core_
.new_PyCommandEvent(*args
, **kwargs
)
5721 self
.this
= newobj
.this
5726 def __del__(self
, destroy
=_core_
.delete_PyCommandEvent
):
5729 if self
.thisown
: destroy(self
)
5732 def SetSelf(*args
, **kwargs
):
5733 """SetSelf(self, PyObject self)"""
5734 return _core_
.PyCommandEvent_SetSelf(*args
, **kwargs
)
5736 def GetSelf(*args
, **kwargs
):
5737 """GetSelf(self) -> PyObject"""
5738 return _core_
.PyCommandEvent_GetSelf(*args
, **kwargs
)
5741 class PyCommandEventPtr(PyCommandEvent
):
5742 def __init__(self
, this
):
5744 if not hasattr(self
,"thisown"): self
.thisown
= 0
5745 self
.__class
__ = PyCommandEvent
5746 _core_
.PyCommandEvent_swigregister(PyCommandEventPtr
)
5748 class DateEvent(CommandEvent
):
5749 """Proxy of C++ DateEvent class"""
5751 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5752 def __init__(self
, *args
, **kwargs
):
5753 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
5754 newobj
= _core_
.new_DateEvent(*args
, **kwargs
)
5755 self
.this
= newobj
.this
5758 def GetDate(*args
, **kwargs
):
5759 """GetDate(self) -> DateTime"""
5760 return _core_
.DateEvent_GetDate(*args
, **kwargs
)
5762 def SetDate(*args
, **kwargs
):
5763 """SetDate(self, DateTime date)"""
5764 return _core_
.DateEvent_SetDate(*args
, **kwargs
)
5767 class DateEventPtr(DateEvent
):
5768 def __init__(self
, this
):
5770 if not hasattr(self
,"thisown"): self
.thisown
= 0
5771 self
.__class
__ = DateEvent
5772 _core_
.DateEvent_swigregister(DateEventPtr
)
5774 wxEVT_DATE_CHANGED
= _core_
.wxEVT_DATE_CHANGED
5775 EVT_DATE_CHANGED
= wx
.PyEventBinder( wxEVT_DATE_CHANGED
, 1 )
5777 #---------------------------------------------------------------------------
5779 PYAPP_ASSERT_SUPPRESS
= _core_
.PYAPP_ASSERT_SUPPRESS
5780 PYAPP_ASSERT_EXCEPTION
= _core_
.PYAPP_ASSERT_EXCEPTION
5781 PYAPP_ASSERT_DIALOG
= _core_
.PYAPP_ASSERT_DIALOG
5782 PYAPP_ASSERT_LOG
= _core_
.PYAPP_ASSERT_LOG
5783 PRINT_WINDOWS
= _core_
.PRINT_WINDOWS
5784 PRINT_POSTSCRIPT
= _core_
.PRINT_POSTSCRIPT
5785 class PyApp(EvtHandler
):
5787 The ``wx.PyApp`` class is an *implementation detail*, please use the
5788 `wx.App` class (or some other derived class) instead.
5791 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
5792 def __init__(self
, *args
, **kwargs
):
5794 __init__(self) -> PyApp
5796 Create a new application object, starting the bootstrap process.
5798 newobj
= _core_
.new_PyApp(*args
, **kwargs
)
5799 self
.this
= newobj
.this
5802 self
._setCallbackInfo
(self
, PyApp
, False)
5803 self
._setOORInfo
(self
, False)
5805 def __del__(self
, destroy
=_core_
.delete_PyApp
):
5808 if self
.thisown
: destroy(self
)
5811 def _setCallbackInfo(*args
, **kwargs
):
5812 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5813 return _core_
.PyApp__setCallbackInfo(*args
, **kwargs
)
5815 def GetAppName(*args
, **kwargs
):
5817 GetAppName(self) -> String
5819 Get the application name.
5821 return _core_
.PyApp_GetAppName(*args
, **kwargs
)
5823 def SetAppName(*args
, **kwargs
):
5825 SetAppName(self, String name)
5827 Set the application name. This value may be used automatically by
5828 `wx.Config` and such.
5830 return _core_
.PyApp_SetAppName(*args
, **kwargs
)
5832 def GetClassName(*args
, **kwargs
):
5834 GetClassName(self) -> String
5836 Get the application's class name.
5838 return _core_
.PyApp_GetClassName(*args
, **kwargs
)
5840 def SetClassName(*args
, **kwargs
):
5842 SetClassName(self, String name)
5844 Set the application's class name. This value may be used for
5845 X-resources if applicable for the platform
5847 return _core_
.PyApp_SetClassName(*args
, **kwargs
)
5849 def GetVendorName(*args
, **kwargs
):
5851 GetVendorName(self) -> String
5853 Get the application's vendor name.
5855 return _core_
.PyApp_GetVendorName(*args
, **kwargs
)
5857 def SetVendorName(*args
, **kwargs
):
5859 SetVendorName(self, String name)
5861 Set the application's vendor name. This value may be used
5862 automatically by `wx.Config` and such.
5864 return _core_
.PyApp_SetVendorName(*args
, **kwargs
)
5866 def GetTraits(*args
, **kwargs
):
5868 GetTraits(self) -> wxAppTraits
5870 Return (and create if necessary) the app traits object to which we
5871 delegate for everything which either should be configurable by the
5872 user (then he can change the default behaviour simply by overriding
5873 CreateTraits() and returning his own traits object) or which is
5874 GUI/console dependent as then wx.AppTraits allows us to abstract the
5875 differences behind the common facade.
5877 :todo: Add support for overriding CreateAppTraits in wxPython.
5879 return _core_
.PyApp_GetTraits(*args
, **kwargs
)
5881 def ProcessPendingEvents(*args
, **kwargs
):
5883 ProcessPendingEvents(self)
5885 Process all events in the Pending Events list -- it is necessary to
5886 call this function to process posted events. This normally happens
5887 during each event loop iteration.
5889 return _core_
.PyApp_ProcessPendingEvents(*args
, **kwargs
)
5891 def Yield(*args
, **kwargs
):
5893 Yield(self, bool onlyIfNeeded=False) -> bool
5895 Process all currently pending events right now, instead of waiting
5896 until return to the event loop. It is an error to call ``Yield``
5897 recursively unless the value of ``onlyIfNeeded`` is True.
5899 :warning: This function is dangerous as it can lead to unexpected
5900 reentrancies (i.e. when called from an event handler it may
5901 result in calling the same event handler again), use with
5902 extreme care or, better, don't use at all!
5904 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
5907 return _core_
.PyApp_Yield(*args
, **kwargs
)
5909 def WakeUpIdle(*args
, **kwargs
):
5913 Make sure that idle events are sent again.
5914 :see: `wx.WakeUpIdle`
5916 return _core_
.PyApp_WakeUpIdle(*args
, **kwargs
)
5918 def IsMainLoopRunning(*args
, **kwargs
):
5920 IsMainLoopRunning() -> bool
5922 Returns True if we're running the main loop, i.e. if the events can
5923 currently be dispatched.
5925 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
5927 IsMainLoopRunning
= staticmethod(IsMainLoopRunning
)
5928 def MainLoop(*args
, **kwargs
):
5930 MainLoop(self) -> int
5932 Execute the main GUI loop, the function doesn't normally return until
5933 all top level windows have been closed and destroyed.
5935 return _core_
.PyApp_MainLoop(*args
, **kwargs
)
5937 def Exit(*args
, **kwargs
):
5941 Exit the main loop thus terminating the application.
5944 return _core_
.PyApp_Exit(*args
, **kwargs
)
5946 def ExitMainLoop(*args
, **kwargs
):
5950 Exit the main GUI loop during the next iteration of the main
5951 loop, (i.e. it does not stop the program immediately!)
5953 return _core_
.PyApp_ExitMainLoop(*args
, **kwargs
)
5955 def Pending(*args
, **kwargs
):
5957 Pending(self) -> bool
5959 Returns True if there are unprocessed events in the event queue.
5961 return _core_
.PyApp_Pending(*args
, **kwargs
)
5963 def Dispatch(*args
, **kwargs
):
5965 Dispatch(self) -> bool
5967 Process the first event in the event queue (blocks until an event
5968 appears if there are none currently)
5970 return _core_
.PyApp_Dispatch(*args
, **kwargs
)
5972 def ProcessIdle(*args
, **kwargs
):
5974 ProcessIdle(self) -> bool
5976 Called from the MainLoop when the application becomes idle (there are
5977 no pending events) and sends a `wx.IdleEvent` to all interested
5978 parties. Returns True if more idle events are needed, False if not.
5980 return _core_
.PyApp_ProcessIdle(*args
, **kwargs
)
5982 def SendIdleEvents(*args
, **kwargs
):
5984 SendIdleEvents(self, Window win, IdleEvent event) -> bool
5986 Send idle event to window and all subwindows. Returns True if more
5987 idle time is requested.
5989 return _core_
.PyApp_SendIdleEvents(*args
, **kwargs
)
5991 def IsActive(*args
, **kwargs
):
5993 IsActive(self) -> bool
5995 Return True if our app has focus.
5997 return _core_
.PyApp_IsActive(*args
, **kwargs
)
5999 def SetTopWindow(*args
, **kwargs
):
6001 SetTopWindow(self, Window win)
6003 Set the *main* top level window
6005 return _core_
.PyApp_SetTopWindow(*args
, **kwargs
)
6007 def GetTopWindow(*args
, **kwargs
):
6009 GetTopWindow(self) -> Window
6011 Return the *main* top level window (if it hadn't been set previously
6012 with SetTopWindow(), will return just some top level window and, if
6013 there not any, will return None)
6015 return _core_
.PyApp_GetTopWindow(*args
, **kwargs
)
6017 def SetExitOnFrameDelete(*args
, **kwargs
):
6019 SetExitOnFrameDelete(self, bool flag)
6021 Control the exit behaviour: by default, the program will exit the main
6022 loop (and so, usually, terminate) when the last top-level program
6023 window is deleted. Beware that if you disable this behaviour (with
6024 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6025 explicitly from somewhere.
6027 return _core_
.PyApp_SetExitOnFrameDelete(*args
, **kwargs
)
6029 def GetExitOnFrameDelete(*args
, **kwargs
):
6031 GetExitOnFrameDelete(self) -> bool
6033 Get the current exit behaviour setting.
6035 return _core_
.PyApp_GetExitOnFrameDelete(*args
, **kwargs
)
6037 def SetUseBestVisual(*args
, **kwargs
):
6039 SetUseBestVisual(self, bool flag)
6041 Set whether the app should try to use the best available visual on
6042 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
6044 return _core_
.PyApp_SetUseBestVisual(*args
, **kwargs
)
6046 def GetUseBestVisual(*args
, **kwargs
):
6048 GetUseBestVisual(self) -> bool
6050 Get current UseBestVisual setting.
6052 return _core_
.PyApp_GetUseBestVisual(*args
, **kwargs
)
6054 def SetPrintMode(*args
, **kwargs
):
6055 """SetPrintMode(self, int mode)"""
6056 return _core_
.PyApp_SetPrintMode(*args
, **kwargs
)
6058 def GetPrintMode(*args
, **kwargs
):
6059 """GetPrintMode(self) -> int"""
6060 return _core_
.PyApp_GetPrintMode(*args
, **kwargs
)
6062 def SetAssertMode(*args
, **kwargs
):
6064 SetAssertMode(self, int mode)
6066 Set the OnAssert behaviour for debug and hybrid builds.
6068 return _core_
.PyApp_SetAssertMode(*args
, **kwargs
)
6070 def GetAssertMode(*args
, **kwargs
):
6072 GetAssertMode(self) -> int
6074 Get the current OnAssert behaviour setting.
6076 return _core_
.PyApp_GetAssertMode(*args
, **kwargs
)
6078 def GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6079 """GetMacSupportPCMenuShortcuts() -> bool"""
6080 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6082 GetMacSupportPCMenuShortcuts
= staticmethod(GetMacSupportPCMenuShortcuts
)
6083 def GetMacAboutMenuItemId(*args
, **kwargs
):
6084 """GetMacAboutMenuItemId() -> long"""
6085 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
6087 GetMacAboutMenuItemId
= staticmethod(GetMacAboutMenuItemId
)
6088 def GetMacPreferencesMenuItemId(*args
, **kwargs
):
6089 """GetMacPreferencesMenuItemId() -> long"""
6090 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
6092 GetMacPreferencesMenuItemId
= staticmethod(GetMacPreferencesMenuItemId
)
6093 def GetMacExitMenuItemId(*args
, **kwargs
):
6094 """GetMacExitMenuItemId() -> long"""
6095 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
6097 GetMacExitMenuItemId
= staticmethod(GetMacExitMenuItemId
)
6098 def GetMacHelpMenuTitleName(*args
, **kwargs
):
6099 """GetMacHelpMenuTitleName() -> String"""
6100 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
6102 GetMacHelpMenuTitleName
= staticmethod(GetMacHelpMenuTitleName
)
6103 def SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6104 """SetMacSupportPCMenuShortcuts(bool val)"""
6105 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6107 SetMacSupportPCMenuShortcuts
= staticmethod(SetMacSupportPCMenuShortcuts
)
6108 def SetMacAboutMenuItemId(*args
, **kwargs
):
6109 """SetMacAboutMenuItemId(long val)"""
6110 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6112 SetMacAboutMenuItemId
= staticmethod(SetMacAboutMenuItemId
)
6113 def SetMacPreferencesMenuItemId(*args
, **kwargs
):
6114 """SetMacPreferencesMenuItemId(long val)"""
6115 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6117 SetMacPreferencesMenuItemId
= staticmethod(SetMacPreferencesMenuItemId
)
6118 def SetMacExitMenuItemId(*args
, **kwargs
):
6119 """SetMacExitMenuItemId(long val)"""
6120 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6122 SetMacExitMenuItemId
= staticmethod(SetMacExitMenuItemId
)
6123 def SetMacHelpMenuTitleName(*args
, **kwargs
):
6124 """SetMacHelpMenuTitleName(String val)"""
6125 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6127 SetMacHelpMenuTitleName
= staticmethod(SetMacHelpMenuTitleName
)
6128 def _BootstrapApp(*args
, **kwargs
):
6132 For internal use only
6134 return _core_
.PyApp__BootstrapApp(*args
, **kwargs
)
6136 def GetComCtl32Version(*args
, **kwargs
):
6138 GetComCtl32Version() -> int
6140 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6141 it wasn't found at all. Raises an exception on non-Windows platforms.
6143 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
6145 GetComCtl32Version
= staticmethod(GetComCtl32Version
)
6147 class PyAppPtr(PyApp
):
6148 def __init__(self
, this
):
6150 if not hasattr(self
,"thisown"): self
.thisown
= 0
6151 self
.__class
__ = PyApp
6152 _core_
.PyApp_swigregister(PyAppPtr
)
6154 def PyApp_IsMainLoopRunning(*args
, **kwargs
):
6156 PyApp_IsMainLoopRunning() -> bool
6158 Returns True if we're running the main loop, i.e. if the events can
6159 currently be dispatched.
6161 return _core_
.PyApp_IsMainLoopRunning(*args
, **kwargs
)
6163 def PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6164 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6165 return _core_
.PyApp_GetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6167 def PyApp_GetMacAboutMenuItemId(*args
, **kwargs
):
6168 """PyApp_GetMacAboutMenuItemId() -> long"""
6169 return _core_
.PyApp_GetMacAboutMenuItemId(*args
, **kwargs
)
6171 def PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
):
6172 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6173 return _core_
.PyApp_GetMacPreferencesMenuItemId(*args
, **kwargs
)
6175 def PyApp_GetMacExitMenuItemId(*args
, **kwargs
):
6176 """PyApp_GetMacExitMenuItemId() -> long"""
6177 return _core_
.PyApp_GetMacExitMenuItemId(*args
, **kwargs
)
6179 def PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
):
6180 """PyApp_GetMacHelpMenuTitleName() -> String"""
6181 return _core_
.PyApp_GetMacHelpMenuTitleName(*args
, **kwargs
)
6183 def PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
):
6184 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6185 return _core_
.PyApp_SetMacSupportPCMenuShortcuts(*args
, **kwargs
)
6187 def PyApp_SetMacAboutMenuItemId(*args
, **kwargs
):
6188 """PyApp_SetMacAboutMenuItemId(long val)"""
6189 return _core_
.PyApp_SetMacAboutMenuItemId(*args
, **kwargs
)
6191 def PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
):
6192 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6193 return _core_
.PyApp_SetMacPreferencesMenuItemId(*args
, **kwargs
)
6195 def PyApp_SetMacExitMenuItemId(*args
, **kwargs
):
6196 """PyApp_SetMacExitMenuItemId(long val)"""
6197 return _core_
.PyApp_SetMacExitMenuItemId(*args
, **kwargs
)
6199 def PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
):
6200 """PyApp_SetMacHelpMenuTitleName(String val)"""
6201 return _core_
.PyApp_SetMacHelpMenuTitleName(*args
, **kwargs
)
6203 def PyApp_GetComCtl32Version(*args
, **kwargs
):
6205 PyApp_GetComCtl32Version() -> int
6207 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6208 it wasn't found at all. Raises an exception on non-Windows platforms.
6210 return _core_
.PyApp_GetComCtl32Version(*args
, **kwargs
)
6212 #---------------------------------------------------------------------------
6215 def Exit(*args
, **kwargs
):
6219 Force an exit of the application. Convenience for wx.GetApp().Exit()
6221 return _core_
.Exit(*args
, **kwargs
)
6223 def Yield(*args
, **kwargs
):
6227 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6229 return _core_
.Yield(*args
, **kwargs
)
6231 def YieldIfNeeded(*args
, **kwargs
):
6233 YieldIfNeeded() -> bool
6235 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6237 return _core_
.YieldIfNeeded(*args
, **kwargs
)
6239 def SafeYield(*args
, **kwargs
):
6241 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6243 This function is similar to `wx.Yield`, except that it disables the
6244 user input to all program windows before calling `wx.Yield` and
6245 re-enables it again afterwards. If ``win`` is not None, this window
6246 will remain enabled, allowing the implementation of some limited user
6249 :Returns: the result of the call to `wx.Yield`.
6251 return _core_
.SafeYield(*args
, **kwargs
)
6253 def WakeUpIdle(*args
, **kwargs
):
6257 Cause the message queue to become empty again, so idle events will be
6260 return _core_
.WakeUpIdle(*args
, **kwargs
)
6262 def PostEvent(*args
, **kwargs
):
6264 PostEvent(EvtHandler dest, Event event)
6266 Send an event to a window or other wx.EvtHandler to be processed
6269 return _core_
.PostEvent(*args
, **kwargs
)
6271 def App_CleanUp(*args
, **kwargs
):
6275 For internal use only, it is used to cleanup after wxWidgets when
6278 return _core_
.App_CleanUp(*args
, **kwargs
)
6280 def GetApp(*args
, **kwargs
):
6284 Return a reference to the current wx.App object.
6286 return _core_
.GetApp(*args
, **kwargs
)
6288 def SetDefaultPyEncoding(*args
, **kwargs
):
6290 SetDefaultPyEncoding(string encoding)
6292 Sets the encoding that wxPython will use when it needs to convert a
6293 Python string or unicode object to or from a wxString.
6295 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6296 but please be aware that the default encoding within the same locale
6297 may be slightly different on different platforms. For example, please
6298 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6299 between the common latin/roman encodings.
6301 return _core_
.SetDefaultPyEncoding(*args
, **kwargs
)
6303 def GetDefaultPyEncoding(*args
, **kwargs
):
6305 GetDefaultPyEncoding() -> string
6307 Gets the current encoding that wxPython will use when it needs to
6308 convert a Python string or unicode object to or from a wxString.
6310 return _core_
.GetDefaultPyEncoding(*args
, **kwargs
)
6311 #----------------------------------------------------------------------
6313 class PyOnDemandOutputWindow
:
6315 A class that can be used for redirecting Python's stdout and
6316 stderr streams. It will do nothing until something is wrriten to
6317 the stream at which point it will create a Frame with a text area
6318 and write the text there.
6320 def __init__(self
, title
= "wxPython: stdout/stderr"):
6323 self
.pos
= wx
.DefaultPosition
6324 self
.size
= (450, 300)
6327 def SetParent(self
, parent
):
6328 """Set the window to be used as the popup Frame's parent."""
6329 self
.parent
= parent
6332 def CreateOutputWindow(self
, st
):
6333 self
.frame
= wx
.Frame(self
.parent
, -1, self
.title
, self
.pos
, self
.size
,
6334 style
=wx
.DEFAULT_FRAME_STYLE
)
6335 self
.text
= wx
.TextCtrl(self
.frame
, -1, "",
6336 style
=wx
.TE_MULTILINE|wx
.TE_READONLY
)
6337 self
.text
.AppendText(st
)
6338 self
.frame
.Show(True)
6339 EVT_CLOSE(self
.frame
, self
.OnCloseWindow
)
6342 def OnCloseWindow(self
, event
):
6343 if self
.frame
is not None:
6344 self
.frame
.Destroy()
6349 # These methods provide the file-like output behaviour.
6350 def write(self
, text
):
6352 Create the output window if needed and write the string to it.
6353 If not called in the context of the gui thread then uses
6354 CallAfter to do the work there.
6356 if self
.frame
is None:
6357 if not wx
.Thread_IsMain():
6358 wx
.CallAfter(self
.CreateOutputWindow
, text
)
6360 self
.CreateOutputWindow(text
)
6362 if not wx
.Thread_IsMain():
6363 wx
.CallAfter(self
.text
.AppendText
, text
)
6365 self
.text
.AppendText(text
)
6369 if self
.frame
is not None:
6370 wx
.CallAfter(self
.frame
.Close
)
6378 #----------------------------------------------------------------------
6380 _defRedirect
= (wx
.Platform
== '__WXMSW__' or wx
.Platform
== '__WXMAC__')
6382 class App(wx
.PyApp
):
6384 The ``wx.App`` class represents the application and is used to:
6386 * bootstrap the wxPython system and initialize the underlying
6388 * set and get application-wide properties
6389 * implement the windowing system main message or event loop,
6390 and to dispatch events to window instances
6393 Every application must have a ``wx.App`` instance, and all
6394 creation of UI objects should be delayed until after the
6395 ``wx.App`` object has been created in order to ensure that the gui
6396 platform and wxWidgets have been fully initialized.
6398 Normally you would derive from this class and implement an
6399 ``OnInit`` method that creates a frame and then calls
6400 ``self.SetTopWindow(frame)``.
6402 :see: `wx.PySimpleApp` for a simpler app class that can be used
6406 outputWindowClass
= PyOnDemandOutputWindow
6408 def __init__(self
, redirect
=_defRedirect
, filename
=None,
6409 useBestVisual
=False, clearSigInt
=True):
6411 Construct a ``wx.App`` object.
6413 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
6414 redirected? Defaults to True on Windows and Mac, False
6415 otherwise. If `filename` is None then output will be
6416 redirected to a window that pops up as needed. (You can
6417 control what kind of window is created for the output by
6418 resetting the class variable ``outputWindowClass`` to a
6419 class of your choosing.)
6421 :param filename: The name of a file to redirect output to, if
6424 :param useBestVisual: Should the app try to use the best
6425 available visual provided by the system (only relevant on
6426 systems that have more than one visual.) This parameter
6427 must be used instead of calling `SetUseBestVisual` later
6428 on because it must be set before the underlying GUI
6429 toolkit is initialized.
6431 :param clearSigInt: Should SIGINT be cleared? This allows the
6432 app to terminate upon a Ctrl-C in the console like other
6435 :note: You should override OnInit to do applicaition
6436 initialization to ensure that the system, toolkit and
6437 wxWidgets are fully initialized.
6439 wx
.PyApp
.__init
__(self
)
6441 if wx
.Platform
== "__WXMAC__":
6444 if not MacOS
.WMAvailable():
6446 This program needs access to the screen. Please run with 'pythonw',
6447 not 'python', and only when you are logged in on the main display of
6455 # This has to be done before OnInit
6456 self
.SetUseBestVisual(useBestVisual
)
6458 # Set the default handler for SIGINT. This fixes a problem
6459 # where if Ctrl-C is pressed in the console that started this
6460 # app then it will not appear to do anything, (not even send
6461 # KeyboardInterrupt???) but will later segfault on exit. By
6462 # setting the default handler then the app will exit, as
6463 # expected (depending on platform.)
6467 signal
.signal(signal
.SIGINT
, signal
.SIG_DFL
)
6471 # Save and redirect the stdio to a window?
6472 self
.stdioWin
= None
6473 self
.saveStdio
= (_sys
.stdout
, _sys
.stderr
)
6475 self
.RedirectStdio(filename
)
6477 # Use Python's install prefix as the default
6478 wx
.StandardPaths
.Get().SetInstallPrefix(_sys
.prefix
)
6480 # This finishes the initialization of wxWindows and then calls
6481 # the OnInit that should be present in the derived class
6482 self
._BootstrapApp
()
6485 def __del__(self
, destroy
=wx
.PyApp
.__del
__):
6486 self
.RestoreStdio() # Just in case the MainLoop was overridden
6490 wx
.PyApp
.Destroy(self
)
6493 def SetTopWindow(self
, frame
):
6494 """Set the \"main\" top level window"""
6496 self
.stdioWin
.SetParent(frame
)
6497 wx
.PyApp
.SetTopWindow(self
, frame
)
6501 """Execute the main GUI event loop"""
6502 wx
.PyApp
.MainLoop(self
)
6506 def RedirectStdio(self
, filename
=None):
6507 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
6509 _sys
.stdout
= _sys
.stderr
= open(filename
, 'a')
6511 self
.stdioWin
= self
.outputWindowClass()
6512 _sys
.stdout
= _sys
.stderr
= self
.stdioWin
6515 def RestoreStdio(self
):
6517 _sys
.stdout
, _sys
.stderr
= self
.saveStdio
6522 def SetOutputWindowAttributes(self
, title
=None, pos
=None, size
=None):
6524 Set the title, position and/or size of the output window if
6525 the stdio has been redirected. This should be called before
6526 any output would cause the output window to be created.
6529 if title
is not None:
6530 self
.stdioWin
.title
= title
6532 self
.stdioWin
.pos
= pos
6533 if size
is not None:
6534 self
.stdioWin
.size
= size
6539 # change from wx.PyApp_XX to wx.App_XX
6540 App_GetMacSupportPCMenuShortcuts
= _core_
.PyApp_GetMacSupportPCMenuShortcuts
6541 App_GetMacAboutMenuItemId
= _core_
.PyApp_GetMacAboutMenuItemId
6542 App_GetMacPreferencesMenuItemId
= _core_
.PyApp_GetMacPreferencesMenuItemId
6543 App_GetMacExitMenuItemId
= _core_
.PyApp_GetMacExitMenuItemId
6544 App_GetMacHelpMenuTitleName
= _core_
.PyApp_GetMacHelpMenuTitleName
6545 App_SetMacSupportPCMenuShortcuts
= _core_
.PyApp_SetMacSupportPCMenuShortcuts
6546 App_SetMacAboutMenuItemId
= _core_
.PyApp_SetMacAboutMenuItemId
6547 App_SetMacPreferencesMenuItemId
= _core_
.PyApp_SetMacPreferencesMenuItemId
6548 App_SetMacExitMenuItemId
= _core_
.PyApp_SetMacExitMenuItemId
6549 App_SetMacHelpMenuTitleName
= _core_
.PyApp_SetMacHelpMenuTitleName
6550 App_GetComCtl32Version
= _core_
.PyApp_GetComCtl32Version
6552 #----------------------------------------------------------------------------
6554 class PySimpleApp(wx
.App
):
6556 A simple application class. You can just create one of these and
6557 then then make your top level windows later, and not have to worry
6558 about OnInit. For example::
6560 app = wx.PySimpleApp()
6561 frame = wx.Frame(None, title='Hello World')
6568 def __init__(self
, redirect
=False, filename
=None,
6569 useBestVisual
=False, clearSigInt
=True):
6571 :see: `wx.App.__init__`
6573 wx
.App
.__init
__(self
, redirect
, filename
, useBestVisual
, clearSigInt
)
6580 # Is anybody using this one?
6581 class PyWidgetTester(wx
.App
):
6582 def __init__(self
, size
= (250, 100)):
6584 wx
.App
.__init
__(self
, 0)
6587 self
.frame
= wx
.Frame(None, -1, "Widget Tester", pos
=(0,0), size
=self
.size
)
6588 self
.SetTopWindow(self
.frame
)
6591 def SetWidget(self
, widgetClass
, *args
, **kwargs
):
6592 w
= widgetClass(self
.frame
, *args
, **kwargs
)
6593 self
.frame
.Show(True)
6595 #----------------------------------------------------------------------------
6596 # DO NOT hold any other references to this object. This is how we
6597 # know when to cleanup system resources that wxWidgets is holding. When
6598 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
6599 # goes to zero and it calls the wx.App_CleanUp function.
6601 class __wxPyCleanup
:
6603 self
.cleanup
= _core_
.App_CleanUp
6607 _sys
.__wxPythonCleanup
= __wxPyCleanup()
6609 ## # another possible solution, but it gets called too early...
6611 ## atexit.register(_core_.wxApp_CleanUp)
6614 #----------------------------------------------------------------------------
6616 #---------------------------------------------------------------------------
6618 class EventLoop(object):
6619 """Proxy of C++ EventLoop class"""
6621 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6622 def __init__(self
, *args
, **kwargs
):
6623 """__init__(self) -> EventLoop"""
6624 newobj
= _core_
.new_EventLoop(*args
, **kwargs
)
6625 self
.this
= newobj
.this
6628 def __del__(self
, destroy
=_core_
.delete_EventLoop
):
6631 if self
.thisown
: destroy(self
)
6634 def Run(*args
, **kwargs
):
6635 """Run(self) -> int"""
6636 return _core_
.EventLoop_Run(*args
, **kwargs
)
6638 def Exit(*args
, **kwargs
):
6639 """Exit(self, int rc=0)"""
6640 return _core_
.EventLoop_Exit(*args
, **kwargs
)
6642 def Pending(*args
, **kwargs
):
6643 """Pending(self) -> bool"""
6644 return _core_
.EventLoop_Pending(*args
, **kwargs
)
6646 def Dispatch(*args
, **kwargs
):
6647 """Dispatch(self) -> bool"""
6648 return _core_
.EventLoop_Dispatch(*args
, **kwargs
)
6650 def IsRunning(*args
, **kwargs
):
6651 """IsRunning(self) -> bool"""
6652 return _core_
.EventLoop_IsRunning(*args
, **kwargs
)
6654 def GetActive(*args
, **kwargs
):
6655 """GetActive() -> EventLoop"""
6656 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
6658 GetActive
= staticmethod(GetActive
)
6659 def SetActive(*args
, **kwargs
):
6660 """SetActive(EventLoop loop)"""
6661 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
6663 SetActive
= staticmethod(SetActive
)
6665 class EventLoopPtr(EventLoop
):
6666 def __init__(self
, this
):
6668 if not hasattr(self
,"thisown"): self
.thisown
= 0
6669 self
.__class
__ = EventLoop
6670 _core_
.EventLoop_swigregister(EventLoopPtr
)
6672 def EventLoop_GetActive(*args
, **kwargs
):
6673 """EventLoop_GetActive() -> EventLoop"""
6674 return _core_
.EventLoop_GetActive(*args
, **kwargs
)
6676 def EventLoop_SetActive(*args
, **kwargs
):
6677 """EventLoop_SetActive(EventLoop loop)"""
6678 return _core_
.EventLoop_SetActive(*args
, **kwargs
)
6680 #---------------------------------------------------------------------------
6682 class AcceleratorEntry(object):
6684 A class used to define items in an `wx.AcceleratorTable`. wxPython
6685 programs can choose to use wx.AcceleratorEntry objects, but using a
6686 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
6687 as well. See `__init__` for of the tuple values.
6689 :see: `wx.AcceleratorTable`
6692 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6693 def __init__(self
, *args
, **kwargs
):
6695 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
6697 Construct a wx.AcceleratorEntry.
6699 newobj
= _core_
.new_AcceleratorEntry(*args
, **kwargs
)
6700 self
.this
= newobj
.this
6703 def __del__(self
, destroy
=_core_
.delete_AcceleratorEntry
):
6706 if self
.thisown
: destroy(self
)
6709 def Set(*args
, **kwargs
):
6711 Set(self, int flags, int keyCode, int cmd)
6713 (Re)set the attributes of a wx.AcceleratorEntry.
6716 return _core_
.AcceleratorEntry_Set(*args
, **kwargs
)
6718 def GetFlags(*args
, **kwargs
):
6720 GetFlags(self) -> int
6722 Get the AcceleratorEntry's flags.
6724 return _core_
.AcceleratorEntry_GetFlags(*args
, **kwargs
)
6726 def GetKeyCode(*args
, **kwargs
):
6728 GetKeyCode(self) -> int
6730 Get the AcceleratorEntry's keycode.
6732 return _core_
.AcceleratorEntry_GetKeyCode(*args
, **kwargs
)
6734 def GetCommand(*args
, **kwargs
):
6736 GetCommand(self) -> int
6738 Get the AcceleratorEntry's command ID.
6740 return _core_
.AcceleratorEntry_GetCommand(*args
, **kwargs
)
6743 class AcceleratorEntryPtr(AcceleratorEntry
):
6744 def __init__(self
, this
):
6746 if not hasattr(self
,"thisown"): self
.thisown
= 0
6747 self
.__class
__ = AcceleratorEntry
6748 _core_
.AcceleratorEntry_swigregister(AcceleratorEntryPtr
)
6750 class AcceleratorTable(Object
):
6752 An accelerator table allows the application to specify a table of
6753 keyboard shortcuts for menus or other commands. On Windows, menu or
6754 button commands are supported; on GTK, only menu commands are
6758 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6759 def __init__(self
, *args
, **kwargs
):
6761 __init__(entries) -> AcceleratorTable
6763 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
6764 items or or of 3-tuples (flags, keyCode, cmdID)
6766 :see: `wx.AcceleratorEntry`
6768 newobj
= _core_
.new_AcceleratorTable(*args
, **kwargs
)
6769 self
.this
= newobj
.this
6772 def __del__(self
, destroy
=_core_
.delete_AcceleratorTable
):
6775 if self
.thisown
: destroy(self
)
6778 def Ok(*args
, **kwargs
):
6779 """Ok(self) -> bool"""
6780 return _core_
.AcceleratorTable_Ok(*args
, **kwargs
)
6783 class AcceleratorTablePtr(AcceleratorTable
):
6784 def __init__(self
, this
):
6786 if not hasattr(self
,"thisown"): self
.thisown
= 0
6787 self
.__class
__ = AcceleratorTable
6788 _core_
.AcceleratorTable_swigregister(AcceleratorTablePtr
)
6791 def GetAccelFromString(*args
, **kwargs
):
6792 """GetAccelFromString(String label) -> AcceleratorEntry"""
6793 return _core_
.GetAccelFromString(*args
, **kwargs
)
6794 #---------------------------------------------------------------------------
6796 class VisualAttributes(object):
6797 """struct containing all the visual attributes of a control"""
6799 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6800 def __init__(self
, *args
, **kwargs
):
6802 __init__(self) -> VisualAttributes
6804 struct containing all the visual attributes of a control
6806 newobj
= _core_
.new_VisualAttributes(*args
, **kwargs
)
6807 self
.this
= newobj
.this
6810 def __del__(self
, destroy
=_core_
.delete_VisualAttributes
):
6813 if self
.thisown
: destroy(self
)
6816 font
= property(_core_
.VisualAttributes_font_get
, _core_
.VisualAttributes_font_set
)
6817 colFg
= property(_core_
.VisualAttributes_colFg_get
, _core_
.VisualAttributes_colFg_set
)
6818 colBg
= property(_core_
.VisualAttributes_colBg_get
, _core_
.VisualAttributes_colBg_set
)
6820 class VisualAttributesPtr(VisualAttributes
):
6821 def __init__(self
, this
):
6823 if not hasattr(self
,"thisown"): self
.thisown
= 0
6824 self
.__class
__ = VisualAttributes
6825 _core_
.VisualAttributes_swigregister(VisualAttributesPtr
)
6826 NullAcceleratorTable
= cvar
.NullAcceleratorTable
6827 PanelNameStr
= cvar
.PanelNameStr
6829 WINDOW_VARIANT_NORMAL
= _core_
.WINDOW_VARIANT_NORMAL
6830 WINDOW_VARIANT_SMALL
= _core_
.WINDOW_VARIANT_SMALL
6831 WINDOW_VARIANT_MINI
= _core_
.WINDOW_VARIANT_MINI
6832 WINDOW_VARIANT_LARGE
= _core_
.WINDOW_VARIANT_LARGE
6833 WINDOW_VARIANT_MAX
= _core_
.WINDOW_VARIANT_MAX
6834 class Window(EvtHandler
):
6836 wx.Window is the base class for all windows and represents any visible
6837 object on the screen. All controls, top level windows and so on are
6838 wx.Windows. Sizers and device contexts are not however, as they don't
6839 appear on screen themselves.
6843 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
6844 def __init__(self
, *args
, **kwargs
):
6846 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
6847 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
6849 Construct and show a generic Window.
6851 newobj
= _core_
.new_Window(*args
, **kwargs
)
6852 self
.this
= newobj
.this
6855 self
._setOORInfo
(self
)
6857 def Create(*args
, **kwargs
):
6859 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
6860 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
6862 Create the GUI part of the Window for 2-phase creation mode.
6864 return _core_
.Window_Create(*args
, **kwargs
)
6866 def Close(*args
, **kwargs
):
6868 Close(self, bool force=False) -> bool
6870 This function simply generates a EVT_CLOSE event whose handler usually
6871 tries to close the window. It doesn't close the window itself,
6872 however. If force is False (the default) then the window's close
6873 handler will be allowed to veto the destruction of the window.
6875 return _core_
.Window_Close(*args
, **kwargs
)
6877 def Destroy(*args
, **kwargs
):
6879 Destroy(self) -> bool
6881 Destroys the window safely. Frames and dialogs are not destroyed
6882 immediately when this function is called -- they are added to a list
6883 of windows to be deleted on idle time, when all the window's events
6884 have been processed. This prevents problems with events being sent to
6885 non-existent windows.
6887 Returns True if the window has either been successfully deleted, or it
6888 has been added to the list of windows pending real deletion.
6890 return _core_
.Window_Destroy(*args
, **kwargs
)
6892 def DestroyChildren(*args
, **kwargs
):
6894 DestroyChildren(self) -> bool
6896 Destroys all children of a window. Called automatically by the
6899 return _core_
.Window_DestroyChildren(*args
, **kwargs
)
6901 def IsBeingDeleted(*args
, **kwargs
):
6903 IsBeingDeleted(self) -> bool
6905 Is the window in the process of being deleted?
6907 return _core_
.Window_IsBeingDeleted(*args
, **kwargs
)
6909 def SetTitle(*args
, **kwargs
):
6911 SetTitle(self, String title)
6913 Sets the window's title. Applicable only to frames and dialogs.
6915 return _core_
.Window_SetTitle(*args
, **kwargs
)
6917 def GetTitle(*args
, **kwargs
):
6919 GetTitle(self) -> String
6921 Gets the window's title. Applicable only to frames and dialogs.
6923 return _core_
.Window_GetTitle(*args
, **kwargs
)
6925 def SetLabel(*args
, **kwargs
):
6927 SetLabel(self, String label)
6929 Set the text which the window shows in its label if applicable.
6931 return _core_
.Window_SetLabel(*args
, **kwargs
)
6933 def GetLabel(*args
, **kwargs
):
6935 GetLabel(self) -> String
6937 Generic way of getting a label from any window, for identification
6938 purposes. The interpretation of this function differs from class to
6939 class. For frames and dialogs, the value returned is the title. For
6940 buttons or static text controls, it is the button text. This function
6941 can be useful for meta-programs such as testing tools or special-needs
6942 access programs)which need to identify windows by name.
6944 return _core_
.Window_GetLabel(*args
, **kwargs
)
6946 def SetName(*args
, **kwargs
):
6948 SetName(self, String name)
6950 Sets the window's name. The window name is used for ressource setting
6951 in X, it is not the same as the window title/label
6953 return _core_
.Window_SetName(*args
, **kwargs
)
6955 def GetName(*args
, **kwargs
):
6957 GetName(self) -> String
6959 Returns the windows name. This name is not guaranteed to be unique;
6960 it is up to the programmer to supply an appropriate name in the window
6961 constructor or via wx.Window.SetName.
6963 return _core_
.Window_GetName(*args
, **kwargs
)
6965 def SetWindowVariant(*args
, **kwargs
):
6967 SetWindowVariant(self, int variant)
6969 Sets the variant of the window/font size to use for this window, if
6970 the platform supports variants, for example, wxMac.
6972 return _core_
.Window_SetWindowVariant(*args
, **kwargs
)
6974 def GetWindowVariant(*args
, **kwargs
):
6975 """GetWindowVariant(self) -> int"""
6976 return _core_
.Window_GetWindowVariant(*args
, **kwargs
)
6978 def SetId(*args
, **kwargs
):
6980 SetId(self, int winid)
6982 Sets the identifier of the window. Each window has an integer
6983 identifier. If the application has not provided one, an identifier
6984 will be generated. Normally, the identifier should be provided on
6985 creation and should not be modified subsequently.
6987 return _core_
.Window_SetId(*args
, **kwargs
)
6989 def GetId(*args
, **kwargs
):
6993 Returns the identifier of the window. Each window has an integer
6994 identifier. If the application has not provided one (or the default Id
6995 -1 is used) then an unique identifier with a negative value will be
6998 return _core_
.Window_GetId(*args
, **kwargs
)
7000 def NewControlId(*args
, **kwargs
):
7002 NewControlId() -> int
7004 Generate a control id for the controls which were not given one.
7006 return _core_
.Window_NewControlId(*args
, **kwargs
)
7008 NewControlId
= staticmethod(NewControlId
)
7009 def NextControlId(*args
, **kwargs
):
7011 NextControlId(int winid) -> int
7013 Get the id of the control following the one with the given
7016 return _core_
.Window_NextControlId(*args
, **kwargs
)
7018 NextControlId
= staticmethod(NextControlId
)
7019 def PrevControlId(*args
, **kwargs
):
7021 PrevControlId(int winid) -> int
7023 Get the id of the control preceding the one with the given
7026 return _core_
.Window_PrevControlId(*args
, **kwargs
)
7028 PrevControlId
= staticmethod(PrevControlId
)
7029 def SetSize(*args
, **kwargs
):
7031 SetSize(self, Size size)
7033 Sets the size of the window in pixels.
7035 return _core_
.Window_SetSize(*args
, **kwargs
)
7037 def SetDimensions(*args
, **kwargs
):
7039 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7041 Sets the position and size of the window in pixels. The sizeFlags
7042 parameter indicates the interpretation of the other params if they are
7045 ======================== ======================================
7046 wx.SIZE_AUTO A -1 indicates that a class-specific
7047 default should be used.
7048 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7049 -1 values are supplied.
7050 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7051 interpreted as real dimensions, not
7053 ======================== ======================================
7056 return _core_
.Window_SetDimensions(*args
, **kwargs
)
7058 def SetRect(*args
, **kwargs
):
7060 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7062 Sets the position and size of the window in pixels using a wx.Rect.
7064 return _core_
.Window_SetRect(*args
, **kwargs
)
7066 def SetSizeWH(*args
, **kwargs
):
7068 SetSizeWH(self, int width, int height)
7070 Sets the size of the window in pixels.
7072 return _core_
.Window_SetSizeWH(*args
, **kwargs
)
7074 def Move(*args
, **kwargs
):
7076 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7078 Moves the window to the given position.
7080 return _core_
.Window_Move(*args
, **kwargs
)
7083 def MoveXY(*args
, **kwargs
):
7085 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7087 Moves the window to the given position.
7089 return _core_
.Window_MoveXY(*args
, **kwargs
)
7091 def SetBestFittingSize(*args
, **kwargs
):
7093 SetBestFittingSize(self, Size size=DefaultSize)
7095 A 'Smart' SetSize that will fill in default size components with the
7096 window's *best size* values. Also set's the minsize for use with sizers.
7098 return _core_
.Window_SetBestFittingSize(*args
, **kwargs
)
7100 def Raise(*args
, **kwargs
):
7104 Raises the window to the top of the window hierarchy if it is a
7105 managed window (dialog or frame).
7107 return _core_
.Window_Raise(*args
, **kwargs
)
7109 def Lower(*args
, **kwargs
):
7113 Lowers the window to the bottom of the window hierarchy if it is a
7114 managed window (dialog or frame).
7116 return _core_
.Window_Lower(*args
, **kwargs
)
7118 def SetClientSize(*args
, **kwargs
):
7120 SetClientSize(self, Size size)
7122 This sets the size of the window client area in pixels. Using this
7123 function to size a window tends to be more device-independent than
7124 wx.Window.SetSize, since the application need not worry about what
7125 dimensions the border or title bar have when trying to fit the window
7126 around panel items, for example.
7128 return _core_
.Window_SetClientSize(*args
, **kwargs
)
7130 def SetClientSizeWH(*args
, **kwargs
):
7132 SetClientSizeWH(self, int width, int height)
7134 This sets the size of the window client area in pixels. Using this
7135 function to size a window tends to be more device-independent than
7136 wx.Window.SetSize, since the application need not worry about what
7137 dimensions the border or title bar have when trying to fit the window
7138 around panel items, for example.
7140 return _core_
.Window_SetClientSizeWH(*args
, **kwargs
)
7142 def SetClientRect(*args
, **kwargs
):
7144 SetClientRect(self, Rect rect)
7146 This sets the size of the window client area in pixels. Using this
7147 function to size a window tends to be more device-independent than
7148 wx.Window.SetSize, since the application need not worry about what
7149 dimensions the border or title bar have when trying to fit the window
7150 around panel items, for example.
7152 return _core_
.Window_SetClientRect(*args
, **kwargs
)
7154 def GetPosition(*args
, **kwargs
):
7156 GetPosition(self) -> Point
7158 Get the window's position.
7160 return _core_
.Window_GetPosition(*args
, **kwargs
)
7162 def GetPositionTuple(*args
, **kwargs
):
7164 GetPositionTuple() -> (x,y)
7166 Get the window's position.
7168 return _core_
.Window_GetPositionTuple(*args
, **kwargs
)
7170 def GetSize(*args
, **kwargs
):
7172 GetSize(self) -> Size
7174 Get the window size.
7176 return _core_
.Window_GetSize(*args
, **kwargs
)
7178 def GetSizeTuple(*args
, **kwargs
):
7180 GetSizeTuple() -> (width, height)
7182 Get the window size.
7184 return _core_
.Window_GetSizeTuple(*args
, **kwargs
)
7186 def GetRect(*args
, **kwargs
):
7188 GetRect(self) -> Rect
7190 Returns the size and position of the window as a wx.Rect object.
7192 return _core_
.Window_GetRect(*args
, **kwargs
)
7194 def GetClientSize(*args
, **kwargs
):
7196 GetClientSize(self) -> Size
7198 This gets the size of the window's 'client area' in pixels. The client
7199 area is the area which may be drawn on by the programmer, excluding
7200 title bar, border, scrollbars, etc.
7202 return _core_
.Window_GetClientSize(*args
, **kwargs
)
7204 def GetClientSizeTuple(*args
, **kwargs
):
7206 GetClientSizeTuple() -> (width, height)
7208 This gets the size of the window's 'client area' in pixels. The client
7209 area is the area which may be drawn on by the programmer, excluding
7210 title bar, border, scrollbars, etc.
7212 return _core_
.Window_GetClientSizeTuple(*args
, **kwargs
)
7214 def GetClientAreaOrigin(*args
, **kwargs
):
7216 GetClientAreaOrigin(self) -> Point
7218 Get the origin of the client area of the window relative to the
7219 window's top left corner (the client area may be shifted because of
7220 the borders, scrollbars, other decorations...)
7222 return _core_
.Window_GetClientAreaOrigin(*args
, **kwargs
)
7224 def GetClientRect(*args
, **kwargs
):
7226 GetClientRect(self) -> Rect
7228 Get the client area position and size as a `wx.Rect` object.
7230 return _core_
.Window_GetClientRect(*args
, **kwargs
)
7232 def GetBestSize(*args
, **kwargs
):
7234 GetBestSize(self) -> Size
7236 This function returns the best acceptable minimal size for the
7237 window, if applicable. For example, for a static text control, it will
7238 be the minimal size such that the control label is not truncated. For
7239 windows containing subwindows (suzh aswx.Panel), the size returned by
7240 this function will be the same as the size the window would have had
7243 return _core_
.Window_GetBestSize(*args
, **kwargs
)
7245 def GetBestSizeTuple(*args
, **kwargs
):
7247 GetBestSizeTuple() -> (width, height)
7249 This function returns the best acceptable minimal size for the
7250 window, if applicable. For example, for a static text control, it will
7251 be the minimal size such that the control label is not truncated. For
7252 windows containing subwindows (suzh aswx.Panel), the size returned by
7253 this function will be the same as the size the window would have had
7256 return _core_
.Window_GetBestSizeTuple(*args
, **kwargs
)
7258 def InvalidateBestSize(*args
, **kwargs
):
7260 InvalidateBestSize(self)
7262 Reset the cached best size value so it will be recalculated the next
7265 return _core_
.Window_InvalidateBestSize(*args
, **kwargs
)
7267 def GetBestFittingSize(*args
, **kwargs
):
7269 GetBestFittingSize(self) -> Size
7271 This function will merge the window's best size into the window's
7272 minimum size, giving priority to the min size components, and returns
7276 return _core_
.Window_GetBestFittingSize(*args
, **kwargs
)
7278 def GetAdjustedBestSize(*args
, **kwargs
):
7280 GetAdjustedBestSize(self) -> Size
7282 This method is similar to GetBestSize, except in one
7283 thing. GetBestSize should return the minimum untruncated size of the
7284 window, while this method will return the largest of BestSize and any
7285 user specified minimum size. ie. it is the minimum size the window
7286 should currently be drawn at, not the minimal size it can possibly
7289 return _core_
.Window_GetAdjustedBestSize(*args
, **kwargs
)
7291 def Center(*args
, **kwargs
):
7293 Center(self, int direction=BOTH)
7295 Centers the window. The parameter specifies the direction for
7296 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7297 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7298 on the entire screen and not on its parent window. If it is a
7299 top-level window and has no parent then it will always be centered
7300 relative to the screen.
7302 return _core_
.Window_Center(*args
, **kwargs
)
7305 def CenterOnScreen(*args
, **kwargs
):
7307 CenterOnScreen(self, int dir=BOTH)
7309 Center on screen (only works for top level windows)
7311 return _core_
.Window_CenterOnScreen(*args
, **kwargs
)
7313 CentreOnScreen
= CenterOnScreen
7314 def CenterOnParent(*args
, **kwargs
):
7316 CenterOnParent(self, int dir=BOTH)
7318 Center with respect to the the parent window
7320 return _core_
.Window_CenterOnParent(*args
, **kwargs
)
7322 CentreOnParent
= CenterOnParent
7323 def Fit(*args
, **kwargs
):
7327 Sizes the window so that it fits around its subwindows. This function
7328 won't do anything if there are no subwindows and will only really work
7329 correctly if sizers are used for the subwindows layout. Also, if the
7330 window has exactly one subwindow it is better (faster and the result
7331 is more precise as Fit adds some margin to account for fuzziness of
7332 its calculations) to call window.SetClientSize(child.GetSize())
7333 instead of calling Fit.
7335 return _core_
.Window_Fit(*args
, **kwargs
)
7337 def FitInside(*args
, **kwargs
):
7341 Similar to Fit, but sizes the interior (virtual) size of a
7342 window. Mainly useful with scrolled windows to reset scrollbars after
7343 sizing changes that do not trigger a size event, and/or scrolled
7344 windows without an interior sizer. This function similarly won't do
7345 anything if there are no subwindows.
7347 return _core_
.Window_FitInside(*args
, **kwargs
)
7349 def SetSizeHints(*args
, **kwargs
):
7351 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7354 Allows specification of minimum and maximum window sizes, and window
7355 size increments. If a pair of values is not set (or set to -1), the
7356 default values will be used. If this function is called, the user
7357 will not be able to size the window outside the given bounds (if it is
7358 a top-level window.) Sizers will also inspect the minimum window size
7359 and will use that value if set when calculating layout.
7361 The resizing increments are only significant under Motif or Xt.
7363 return _core_
.Window_SetSizeHints(*args
, **kwargs
)
7365 def SetSizeHintsSz(*args
, **kwargs
):
7367 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7369 Allows specification of minimum and maximum window sizes, and window
7370 size increments. If a pair of values is not set (or set to -1), the
7371 default values will be used. If this function is called, the user
7372 will not be able to size the window outside the given bounds (if it is
7373 a top-level window.) Sizers will also inspect the minimum window size
7374 and will use that value if set when calculating layout.
7376 The resizing increments are only significant under Motif or Xt.
7378 return _core_
.Window_SetSizeHintsSz(*args
, **kwargs
)
7380 def SetVirtualSizeHints(*args
, **kwargs
):
7382 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
7384 Allows specification of minimum and maximum virtual window sizes. If a
7385 pair of values is not set (or set to -1), the default values will be
7386 used. If this function is called, the user will not be able to size
7387 the virtual area of the window outside the given bounds.
7389 return _core_
.Window_SetVirtualSizeHints(*args
, **kwargs
)
7391 def SetVirtualSizeHintsSz(*args
, **kwargs
):
7393 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7395 Allows specification of minimum and maximum virtual window sizes. If a
7396 pair of values is not set (or set to -1), the default values will be
7397 used. If this function is called, the user will not be able to size
7398 the virtual area of the window outside the given bounds.
7400 return _core_
.Window_SetVirtualSizeHintsSz(*args
, **kwargs
)
7402 def GetMaxSize(*args
, **kwargs
):
7403 """GetMaxSize(self) -> Size"""
7404 return _core_
.Window_GetMaxSize(*args
, **kwargs
)
7406 def GetMinSize(*args
, **kwargs
):
7407 """GetMinSize(self) -> Size"""
7408 return _core_
.Window_GetMinSize(*args
, **kwargs
)
7410 def SetMinSize(*args
, **kwargs
):
7412 SetMinSize(self, Size minSize)
7414 A more convenient method than `SetSizeHints` for setting just the
7417 return _core_
.Window_SetMinSize(*args
, **kwargs
)
7419 def SetMaxSize(*args
, **kwargs
):
7421 SetMaxSize(self, Size maxSize)
7423 A more convenient method than `SetSizeHints` for setting just the
7426 return _core_
.Window_SetMaxSize(*args
, **kwargs
)
7428 def GetMinWidth(*args
, **kwargs
):
7429 """GetMinWidth(self) -> int"""
7430 return _core_
.Window_GetMinWidth(*args
, **kwargs
)
7432 def GetMinHeight(*args
, **kwargs
):
7433 """GetMinHeight(self) -> int"""
7434 return _core_
.Window_GetMinHeight(*args
, **kwargs
)
7436 def GetMaxWidth(*args
, **kwargs
):
7437 """GetMaxWidth(self) -> int"""
7438 return _core_
.Window_GetMaxWidth(*args
, **kwargs
)
7440 def GetMaxHeight(*args
, **kwargs
):
7441 """GetMaxHeight(self) -> int"""
7442 return _core_
.Window_GetMaxHeight(*args
, **kwargs
)
7444 def SetVirtualSize(*args
, **kwargs
):
7446 SetVirtualSize(self, Size size)
7448 Set the the virtual size of a window in pixels. For most windows this
7449 is just the client area of the window, but for some like scrolled
7450 windows it is more or less independent of the screen window size.
7452 return _core_
.Window_SetVirtualSize(*args
, **kwargs
)
7454 def SetVirtualSizeWH(*args
, **kwargs
):
7456 SetVirtualSizeWH(self, int w, int h)
7458 Set the the virtual size of a window in pixels. For most windows this
7459 is just the client area of the window, but for some like scrolled
7460 windows it is more or less independent of the screen window size.
7462 return _core_
.Window_SetVirtualSizeWH(*args
, **kwargs
)
7464 def GetVirtualSize(*args
, **kwargs
):
7466 GetVirtualSize(self) -> Size
7468 Get the the virtual size of the window in pixels. For most windows
7469 this is just the client area of the window, but for some like scrolled
7470 windows it is more or less independent of the screen window size.
7472 return _core_
.Window_GetVirtualSize(*args
, **kwargs
)
7474 def GetVirtualSizeTuple(*args
, **kwargs
):
7476 GetVirtualSizeTuple() -> (width, height)
7478 Get the the virtual size of the window in pixels. For most windows
7479 this is just the client area of the window, but for some like scrolled
7480 windows it is more or less independent of the screen window size.
7482 return _core_
.Window_GetVirtualSizeTuple(*args
, **kwargs
)
7484 def GetBestVirtualSize(*args
, **kwargs
):
7486 GetBestVirtualSize(self) -> Size
7488 Return the largest of ClientSize and BestSize (as determined by a
7489 sizer, interior children, or other means)
7491 return _core_
.Window_GetBestVirtualSize(*args
, **kwargs
)
7493 def Show(*args
, **kwargs
):
7495 Show(self, bool show=True) -> bool
7497 Shows or hides the window. You may need to call Raise for a top level
7498 window if you want to bring it to top, although this is not needed if
7499 Show is called immediately after the frame creation. Returns True if
7500 the window has been shown or hidden or False if nothing was done
7501 because it already was in the requested state.
7503 return _core_
.Window_Show(*args
, **kwargs
)
7505 def Hide(*args
, **kwargs
):
7509 Equivalent to calling Show(False).
7511 return _core_
.Window_Hide(*args
, **kwargs
)
7513 def Enable(*args
, **kwargs
):
7515 Enable(self, bool enable=True) -> bool
7517 Enable or disable the window for user input. Note that when a parent
7518 window is disabled, all of its children are disabled as well and they
7519 are reenabled again when the parent is. Returns true if the window
7520 has been enabled or disabled, false if nothing was done, i.e. if the
7521 window had already been in the specified state.
7523 return _core_
.Window_Enable(*args
, **kwargs
)
7525 def Disable(*args
, **kwargs
):
7527 Disable(self) -> bool
7529 Disables the window, same as Enable(false).
7531 return _core_
.Window_Disable(*args
, **kwargs
)
7533 def IsShown(*args
, **kwargs
):
7535 IsShown(self) -> bool
7537 Returns true if the window is shown, false if it has been hidden.
7539 return _core_
.Window_IsShown(*args
, **kwargs
)
7541 def IsEnabled(*args
, **kwargs
):
7543 IsEnabled(self) -> bool
7545 Returns true if the window is enabled for input, false otherwise.
7547 return _core_
.Window_IsEnabled(*args
, **kwargs
)
7549 def SetWindowStyleFlag(*args
, **kwargs
):
7551 SetWindowStyleFlag(self, long style)
7553 Sets the style of the window. Please note that some styles cannot be
7554 changed after the window creation and that Refresh() might need to be
7555 called after changing the others for the change to take place
7558 return _core_
.Window_SetWindowStyleFlag(*args
, **kwargs
)
7560 def GetWindowStyleFlag(*args
, **kwargs
):
7562 GetWindowStyleFlag(self) -> long
7564 Gets the window style that was passed to the constructor or Create
7567 return _core_
.Window_GetWindowStyleFlag(*args
, **kwargs
)
7569 SetWindowStyle
= SetWindowStyleFlag
; GetWindowStyle
= GetWindowStyleFlag
7570 def HasFlag(*args
, **kwargs
):
7572 HasFlag(self, int flag) -> bool
7574 Test if the given style is set for this window.
7576 return _core_
.Window_HasFlag(*args
, **kwargs
)
7578 def IsRetained(*args
, **kwargs
):
7580 IsRetained(self) -> bool
7582 Returns true if the window is retained, false otherwise. Retained
7583 windows are only available on X platforms.
7585 return _core_
.Window_IsRetained(*args
, **kwargs
)
7587 def SetExtraStyle(*args
, **kwargs
):
7589 SetExtraStyle(self, long exStyle)
7591 Sets the extra style bits for the window. Extra styles are the less
7592 often used style bits which can't be set with the constructor or with
7593 SetWindowStyleFlag()
7595 return _core_
.Window_SetExtraStyle(*args
, **kwargs
)
7597 def GetExtraStyle(*args
, **kwargs
):
7599 GetExtraStyle(self) -> long
7601 Returns the extra style bits for the window.
7603 return _core_
.Window_GetExtraStyle(*args
, **kwargs
)
7605 def MakeModal(*args
, **kwargs
):
7607 MakeModal(self, bool modal=True)
7609 Disables all other windows in the application so that the user can
7610 only interact with this window. Passing False will reverse this
7613 return _core_
.Window_MakeModal(*args
, **kwargs
)
7615 def SetThemeEnabled(*args
, **kwargs
):
7617 SetThemeEnabled(self, bool enableTheme)
7619 This function tells a window if it should use the system's "theme"
7620 code to draw the windows' background instead if its own background
7621 drawing code. This will only have an effect on platforms that support
7622 the notion of themes in user defined windows. One such platform is
7623 GTK+ where windows can have (very colourful) backgrounds defined by a
7624 user's selected theme.
7626 Dialogs, notebook pages and the status bar have this flag set to true
7627 by default so that the default look and feel is simulated best.
7629 return _core_
.Window_SetThemeEnabled(*args
, **kwargs
)
7631 def GetThemeEnabled(*args
, **kwargs
):
7633 GetThemeEnabled(self) -> bool
7635 Return the themeEnabled flag.
7637 return _core_
.Window_GetThemeEnabled(*args
, **kwargs
)
7639 def SetFocus(*args
, **kwargs
):
7643 Set's the focus to this window, allowing it to receive keyboard input.
7645 return _core_
.Window_SetFocus(*args
, **kwargs
)
7647 def SetFocusFromKbd(*args
, **kwargs
):
7649 SetFocusFromKbd(self)
7651 Set focus to this window as the result of a keyboard action. Normally
7652 only called internally.
7654 return _core_
.Window_SetFocusFromKbd(*args
, **kwargs
)
7656 def FindFocus(*args
, **kwargs
):
7658 FindFocus() -> Window
7660 Returns the window or control that currently has the keyboard focus,
7663 return _core_
.Window_FindFocus(*args
, **kwargs
)
7665 FindFocus
= staticmethod(FindFocus
)
7666 def AcceptsFocus(*args
, **kwargs
):
7668 AcceptsFocus(self) -> bool
7670 Can this window have focus?
7672 return _core_
.Window_AcceptsFocus(*args
, **kwargs
)
7674 def AcceptsFocusFromKeyboard(*args
, **kwargs
):
7676 AcceptsFocusFromKeyboard(self) -> bool
7678 Can this window be given focus by keyboard navigation? if not, the
7679 only way to give it focus (provided it accepts it at all) is to click
7682 return _core_
.Window_AcceptsFocusFromKeyboard(*args
, **kwargs
)
7684 def GetDefaultItem(*args
, **kwargs
):
7686 GetDefaultItem(self) -> Window
7688 Get the default child of this parent, i.e. the one which is activated
7689 by pressing <Enter> such as the OK button on a wx.Dialog.
7691 return _core_
.Window_GetDefaultItem(*args
, **kwargs
)
7693 def SetDefaultItem(*args
, **kwargs
):
7695 SetDefaultItem(self, Window child) -> Window
7697 Set this child as default, return the old default.
7699 return _core_
.Window_SetDefaultItem(*args
, **kwargs
)
7701 def SetTmpDefaultItem(*args
, **kwargs
):
7703 SetTmpDefaultItem(self, Window win)
7705 Set this child as temporary default
7707 return _core_
.Window_SetTmpDefaultItem(*args
, **kwargs
)
7709 def Navigate(*args
, **kwargs
):
7711 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
7713 Does keyboard navigation from this window to another, by sending a
7714 `wx.NavigationKeyEvent`.
7716 return _core_
.Window_Navigate(*args
, **kwargs
)
7718 def MoveAfterInTabOrder(*args
, **kwargs
):
7720 MoveAfterInTabOrder(self, Window win)
7722 Moves this window in the tab navigation order after the specified
7723 sibling window. This means that when the user presses the TAB key on
7724 that other window, the focus switches to this window.
7726 The default tab order is the same as creation order. This function
7727 and `MoveBeforeInTabOrder` allow to change it after creating all the
7731 return _core_
.Window_MoveAfterInTabOrder(*args
, **kwargs
)
7733 def MoveBeforeInTabOrder(*args
, **kwargs
):
7735 MoveBeforeInTabOrder(self, Window win)
7737 Same as `MoveAfterInTabOrder` except that it inserts this window just
7738 before win instead of putting it right after it.
7740 return _core_
.Window_MoveBeforeInTabOrder(*args
, **kwargs
)
7742 def GetChildren(*args
, **kwargs
):
7744 GetChildren(self) -> PyObject
7746 Returns a list of the window's children. NOTE: Currently this is a
7747 copy of the child window list maintained by the window, so the return
7748 value of this function is only valid as long as the window's children
7751 return _core_
.Window_GetChildren(*args
, **kwargs
)
7753 def GetParent(*args
, **kwargs
):
7755 GetParent(self) -> Window
7757 Returns the parent window of this window, or None if there isn't one.
7759 return _core_
.Window_GetParent(*args
, **kwargs
)
7761 def GetGrandParent(*args
, **kwargs
):
7763 GetGrandParent(self) -> Window
7765 Returns the parent of the parent of this window, or None if there
7768 return _core_
.Window_GetGrandParent(*args
, **kwargs
)
7770 def IsTopLevel(*args
, **kwargs
):
7772 IsTopLevel(self) -> bool
7774 Returns true if the given window is a top-level one. Currently all
7775 frames and dialogs are always considered to be top-level windows (even
7776 if they have a parent window).
7778 return _core_
.Window_IsTopLevel(*args
, **kwargs
)
7780 def Reparent(*args
, **kwargs
):
7782 Reparent(self, Window newParent) -> bool
7784 Reparents the window, i.e the window will be removed from its current
7785 parent window (e.g. a non-standard toolbar in a wxFrame) and then
7786 re-inserted into another. Available on Windows and GTK. Returns True
7787 if the parent was changed, False otherwise (error or newParent ==
7790 return _core_
.Window_Reparent(*args
, **kwargs
)
7792 def AddChild(*args
, **kwargs
):
7794 AddChild(self, Window child)
7796 Adds a child window. This is called automatically by window creation
7797 functions so should not be required by the application programmer.
7799 return _core_
.Window_AddChild(*args
, **kwargs
)
7801 def RemoveChild(*args
, **kwargs
):
7803 RemoveChild(self, Window child)
7805 Removes a child window. This is called automatically by window
7806 deletion functions so should not be required by the application
7809 return _core_
.Window_RemoveChild(*args
, **kwargs
)
7811 def FindWindowById(*args
, **kwargs
):
7813 FindWindowById(self, long winid) -> Window
7815 Find a chld of this window by window ID
7817 return _core_
.Window_FindWindowById(*args
, **kwargs
)
7819 def FindWindowByName(*args
, **kwargs
):
7821 FindWindowByName(self, String name) -> Window
7823 Find a child of this window by name
7825 return _core_
.Window_FindWindowByName(*args
, **kwargs
)
7827 def GetEventHandler(*args
, **kwargs
):
7829 GetEventHandler(self) -> EvtHandler
7831 Returns the event handler for this window. By default, the window is
7832 its own event handler.
7834 return _core_
.Window_GetEventHandler(*args
, **kwargs
)
7836 def SetEventHandler(*args
, **kwargs
):
7838 SetEventHandler(self, EvtHandler handler)
7840 Sets the event handler for this window. An event handler is an object
7841 that is capable of processing the events sent to a window. By default,
7842 the window is its own event handler, but an application may wish to
7843 substitute another, for example to allow central implementation of
7844 event-handling for a variety of different window classes.
7846 It is usually better to use `wx.Window.PushEventHandler` since this sets
7847 up a chain of event handlers, where an event not handled by one event
7848 handler is handed to the next one in the chain.
7850 return _core_
.Window_SetEventHandler(*args
, **kwargs
)
7852 def PushEventHandler(*args
, **kwargs
):
7854 PushEventHandler(self, EvtHandler handler)
7856 Pushes this event handler onto the event handler stack for the window.
7857 An event handler is an object that is capable of processing the events
7858 sent to a window. By default, the window is its own event handler, but
7859 an application may wish to substitute another, for example to allow
7860 central implementation of event-handling for a variety of different
7863 wx.Window.PushEventHandler allows an application to set up a chain of
7864 event handlers, where an event not handled by one event handler is
7865 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
7866 remove the event handler.
7868 return _core_
.Window_PushEventHandler(*args
, **kwargs
)
7870 def PopEventHandler(*args
, **kwargs
):
7872 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
7874 Removes and returns the top-most event handler on the event handler
7875 stack. If deleteHandler is True then the wx.EvtHandler object will be
7876 destroyed after it is popped.
7878 return _core_
.Window_PopEventHandler(*args
, **kwargs
)
7880 def RemoveEventHandler(*args
, **kwargs
):
7882 RemoveEventHandler(self, EvtHandler handler) -> bool
7884 Find the given handler in the event handler chain and remove (but not
7885 delete) it from the event handler chain, return True if it was found
7886 and False otherwise (this also results in an assert failure so this
7887 function should only be called when the handler is supposed to be
7890 return _core_
.Window_RemoveEventHandler(*args
, **kwargs
)
7892 def SetValidator(*args
, **kwargs
):
7894 SetValidator(self, Validator validator)
7896 Deletes the current validator (if any) and sets the window validator,
7897 having called wx.Validator.Clone to create a new validator of this
7900 return _core_
.Window_SetValidator(*args
, **kwargs
)
7902 def GetValidator(*args
, **kwargs
):
7904 GetValidator(self) -> Validator
7906 Returns a pointer to the current validator for the window, or None if
7909 return _core_
.Window_GetValidator(*args
, **kwargs
)
7911 def Validate(*args
, **kwargs
):
7913 Validate(self) -> bool
7915 Validates the current values of the child controls using their
7916 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7917 style flag set, the method will also call Validate() of all child
7918 windows. Returns false if any of the validations failed.
7920 return _core_
.Window_Validate(*args
, **kwargs
)
7922 def TransferDataToWindow(*args
, **kwargs
):
7924 TransferDataToWindow(self) -> bool
7926 Transfers values to child controls from data areas specified by their
7927 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7928 style flag set, the method will also call TransferDataToWindow() of
7931 return _core_
.Window_TransferDataToWindow(*args
, **kwargs
)
7933 def TransferDataFromWindow(*args
, **kwargs
):
7935 TransferDataFromWindow(self) -> bool
7937 Transfers values from child controls to data areas specified by their
7938 validators. Returns false if a transfer failed. If the window has
7939 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
7940 also call TransferDataFromWindow() of all child windows.
7942 return _core_
.Window_TransferDataFromWindow(*args
, **kwargs
)
7944 def InitDialog(*args
, **kwargs
):
7948 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
7949 to the dialog via validators.
7951 return _core_
.Window_InitDialog(*args
, **kwargs
)
7953 def SetAcceleratorTable(*args
, **kwargs
):
7955 SetAcceleratorTable(self, AcceleratorTable accel)
7957 Sets the accelerator table for this window.
7959 return _core_
.Window_SetAcceleratorTable(*args
, **kwargs
)
7961 def GetAcceleratorTable(*args
, **kwargs
):
7963 GetAcceleratorTable(self) -> AcceleratorTable
7965 Gets the accelerator table for this window.
7967 return _core_
.Window_GetAcceleratorTable(*args
, **kwargs
)
7969 def RegisterHotKey(*args
, **kwargs
):
7971 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
7973 Registers a system wide hotkey. Every time the user presses the hotkey
7974 registered here, this window will receive a hotkey event. It will
7975 receive the event even if the application is in the background and
7976 does not have the input focus because the user is working with some
7977 other application. To bind an event handler function to this hotkey
7978 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
7979 hotkey was registered successfully.
7981 return _core_
.Window_RegisterHotKey(*args
, **kwargs
)
7983 def UnregisterHotKey(*args
, **kwargs
):
7985 UnregisterHotKey(self, int hotkeyId) -> bool
7987 Unregisters a system wide hotkey.
7989 return _core_
.Window_UnregisterHotKey(*args
, **kwargs
)
7991 def ConvertDialogPointToPixels(*args
, **kwargs
):
7993 ConvertDialogPointToPixels(self, Point pt) -> Point
7995 Converts a point or size from dialog units to pixels. Dialog units
7996 are used for maintaining a dialog's proportions even if the font
7997 changes. For the x dimension, the dialog units are multiplied by the
7998 average character width and then divided by 4. For the y dimension,
7999 the dialog units are multiplied by the average character height and
8002 return _core_
.Window_ConvertDialogPointToPixels(*args
, **kwargs
)
8004 def ConvertDialogSizeToPixels(*args
, **kwargs
):
8006 ConvertDialogSizeToPixels(self, Size sz) -> Size
8008 Converts a point or size from dialog units to pixels. Dialog units
8009 are used for maintaining a dialog's proportions even if the font
8010 changes. For the x dimension, the dialog units are multiplied by the
8011 average character width and then divided by 4. For the y dimension,
8012 the dialog units are multiplied by the average character height and
8015 return _core_
.Window_ConvertDialogSizeToPixels(*args
, **kwargs
)
8017 def DLG_PNT(*args
, **kwargs
):
8019 DLG_PNT(self, Point pt) -> Point
8021 Converts a point or size from dialog units to pixels. Dialog units
8022 are used for maintaining a dialog's proportions even if the font
8023 changes. For the x dimension, the dialog units are multiplied by the
8024 average character width and then divided by 4. For the y dimension,
8025 the dialog units are multiplied by the average character height and
8028 return _core_
.Window_DLG_PNT(*args
, **kwargs
)
8030 def DLG_SZE(*args
, **kwargs
):
8032 DLG_SZE(self, Size sz) -> Size
8034 Converts a point or size from dialog units to pixels. Dialog units
8035 are used for maintaining a dialog's proportions even if the font
8036 changes. For the x dimension, the dialog units are multiplied by the
8037 average character width and then divided by 4. For the y dimension,
8038 the dialog units are multiplied by the average character height and
8041 return _core_
.Window_DLG_SZE(*args
, **kwargs
)
8043 def ConvertPixelPointToDialog(*args
, **kwargs
):
8044 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8045 return _core_
.Window_ConvertPixelPointToDialog(*args
, **kwargs
)
8047 def ConvertPixelSizeToDialog(*args
, **kwargs
):
8048 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8049 return _core_
.Window_ConvertPixelSizeToDialog(*args
, **kwargs
)
8051 def WarpPointer(*args
, **kwargs
):
8053 WarpPointer(self, int x, int y)
8055 Moves the pointer to the given position on the window.
8057 NOTE: This function is not supported under Mac because Apple Human
8058 Interface Guidelines forbid moving the mouse cursor programmatically.
8060 return _core_
.Window_WarpPointer(*args
, **kwargs
)
8062 def CaptureMouse(*args
, **kwargs
):
8066 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8067 release the capture.
8069 Note that wxWindows maintains the stack of windows having captured the
8070 mouse and when the mouse is released the capture returns to the window
8071 which had had captured it previously and it is only really released if
8072 there were no previous window. In particular, this means that you must
8073 release the mouse as many times as you capture it.
8075 return _core_
.Window_CaptureMouse(*args
, **kwargs
)
8077 def ReleaseMouse(*args
, **kwargs
):
8081 Releases mouse input captured with wx.Window.CaptureMouse.
8083 return _core_
.Window_ReleaseMouse(*args
, **kwargs
)
8085 def GetCapture(*args
, **kwargs
):
8087 GetCapture() -> Window
8089 Returns the window which currently captures the mouse or None
8091 return _core_
.Window_GetCapture(*args
, **kwargs
)
8093 GetCapture
= staticmethod(GetCapture
)
8094 def HasCapture(*args
, **kwargs
):
8096 HasCapture(self) -> bool
8098 Returns true if this window has the current mouse capture.
8100 return _core_
.Window_HasCapture(*args
, **kwargs
)
8102 def Refresh(*args
, **kwargs
):
8104 Refresh(self, bool eraseBackground=True, Rect rect=None)
8106 Mark the specified rectangle (or the whole window) as "dirty" so it
8107 will be repainted. Causes an EVT_PAINT event to be generated and sent
8110 return _core_
.Window_Refresh(*args
, **kwargs
)
8112 def RefreshRect(*args
, **kwargs
):
8114 RefreshRect(self, Rect rect, bool eraseBackground=True)
8116 Redraws the contents of the given rectangle: the area inside it will
8117 be repainted. This is the same as Refresh but has a nicer syntax.
8119 return _core_
.Window_RefreshRect(*args
, **kwargs
)
8121 def Update(*args
, **kwargs
):
8125 Calling this method immediately repaints the invalidated area of the
8126 window instead of waiting for the EVT_PAINT event to happen, (normally
8127 this would usually only happen when the flow of control returns to the
8128 event loop.) Notice that this function doesn't refresh the window and
8129 does nothing if the window has been already repainted. Use Refresh
8130 first if you want to immediately redraw the window (or some portion of
8131 it) unconditionally.
8133 return _core_
.Window_Update(*args
, **kwargs
)
8135 def ClearBackground(*args
, **kwargs
):
8137 ClearBackground(self)
8139 Clears the window by filling it with the current background
8140 colour. Does not cause an erase background event to be generated.
8142 return _core_
.Window_ClearBackground(*args
, **kwargs
)
8144 def Freeze(*args
, **kwargs
):
8148 Freezes the window or, in other words, prevents any updates from
8149 taking place on screen, the window is not redrawn at all. Thaw must be
8150 called to reenable window redrawing. Calls to Freeze/Thaw may be
8151 nested, with the actual Thaw being delayed until all the nesting has
8154 This method is useful for visual appearance optimization (for example,
8155 it is a good idea to use it before inserting large amount of text into
8156 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8157 for all controls so it is mostly just a hint to wxWindows and not a
8158 mandatory directive.
8160 return _core_
.Window_Freeze(*args
, **kwargs
)
8162 def Thaw(*args
, **kwargs
):
8166 Reenables window updating after a previous call to Freeze. Calls to
8167 Freeze/Thaw may be nested, so Thaw must be called the same number of
8168 times that Freeze was before the window will be updated.
8170 return _core_
.Window_Thaw(*args
, **kwargs
)
8172 def PrepareDC(*args
, **kwargs
):
8174 PrepareDC(self, DC dc)
8176 Call this function to prepare the device context for drawing a
8177 scrolled image. It sets the device origin according to the current
8180 return _core_
.Window_PrepareDC(*args
, **kwargs
)
8182 def GetUpdateRegion(*args
, **kwargs
):
8184 GetUpdateRegion(self) -> Region
8186 Returns the region specifying which parts of the window have been
8187 damaged. Should only be called within an EVT_PAINT handler.
8189 return _core_
.Window_GetUpdateRegion(*args
, **kwargs
)
8191 def GetUpdateClientRect(*args
, **kwargs
):
8193 GetUpdateClientRect(self) -> Rect
8195 Get the update rectangle region bounding box in client coords.
8197 return _core_
.Window_GetUpdateClientRect(*args
, **kwargs
)
8199 def IsExposed(*args
, **kwargs
):
8201 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8203 Returns true if the given point or rectangle area has been exposed
8204 since the last repaint. Call this in an paint event handler to
8205 optimize redrawing by only redrawing those areas, which have been
8208 return _core_
.Window_IsExposed(*args
, **kwargs
)
8210 def IsExposedPoint(*args
, **kwargs
):
8212 IsExposedPoint(self, Point pt) -> bool
8214 Returns true if the given point or rectangle area has been exposed
8215 since the last repaint. Call this in an paint event handler to
8216 optimize redrawing by only redrawing those areas, which have been
8219 return _core_
.Window_IsExposedPoint(*args
, **kwargs
)
8221 def IsExposedRect(*args
, **kwargs
):
8223 IsExposedRect(self, Rect rect) -> bool
8225 Returns true if the given point or rectangle area has been exposed
8226 since the last repaint. Call this in an paint event handler to
8227 optimize redrawing by only redrawing those areas, which have been
8230 return _core_
.Window_IsExposedRect(*args
, **kwargs
)
8232 def GetDefaultAttributes(*args
, **kwargs
):
8234 GetDefaultAttributes(self) -> VisualAttributes
8236 Get the default attributes for an instance of this class. This is
8237 useful if you want to use the same font or colour in your own control
8238 as in a standard control -- which is a much better idea than hard
8239 coding specific colours or fonts which might look completely out of
8240 place on the user's system, especially if it uses themes.
8242 return _core_
.Window_GetDefaultAttributes(*args
, **kwargs
)
8244 def GetClassDefaultAttributes(*args
, **kwargs
):
8246 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8248 Get the default attributes for this class. This is useful if you want
8249 to use the same font or colour in your own control as in a standard
8250 control -- which is a much better idea than hard coding specific
8251 colours or fonts which might look completely out of place on the
8252 user's system, especially if it uses themes.
8254 The variant parameter is only relevant under Mac currently and is
8255 ignore under other platforms. Under Mac, it will change the size of
8256 the returned font. See `wx.Window.SetWindowVariant` for more about
8259 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
8261 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
8262 def SetBackgroundColour(*args
, **kwargs
):
8264 SetBackgroundColour(self, Colour colour) -> bool
8266 Sets the background colour of the window. Returns True if the colour
8267 was changed. The background colour is usually painted by the default
8268 EVT_ERASE_BACKGROUND event handler function under Windows and
8269 automatically under GTK. Using `wx.NullColour` will reset the window
8270 to the default background colour.
8272 Note that setting the background colour may not cause an immediate
8273 refresh, so you may wish to call `ClearBackground` or `Refresh` after
8274 calling this function.
8276 Using this function will disable attempts to use themes for this
8277 window, if the system supports them. Use with care since usually the
8278 themes represent the appearance chosen by the user to be used for all
8279 applications on the system.
8281 return _core_
.Window_SetBackgroundColour(*args
, **kwargs
)
8283 def SetOwnBackgroundColour(*args
, **kwargs
):
8284 """SetOwnBackgroundColour(self, Colour colour)"""
8285 return _core_
.Window_SetOwnBackgroundColour(*args
, **kwargs
)
8287 def SetForegroundColour(*args
, **kwargs
):
8289 SetForegroundColour(self, Colour colour) -> bool
8291 Sets the foreground colour of the window. Returns True is the colour
8292 was changed. The interpretation of foreground colour is dependent on
8293 the window class; it may be the text colour or other colour, or it may
8296 return _core_
.Window_SetForegroundColour(*args
, **kwargs
)
8298 def SetOwnForegroundColour(*args
, **kwargs
):
8299 """SetOwnForegroundColour(self, Colour colour)"""
8300 return _core_
.Window_SetOwnForegroundColour(*args
, **kwargs
)
8302 def GetBackgroundColour(*args
, **kwargs
):
8304 GetBackgroundColour(self) -> Colour
8306 Returns the background colour of the window.
8308 return _core_
.Window_GetBackgroundColour(*args
, **kwargs
)
8310 def GetForegroundColour(*args
, **kwargs
):
8312 GetForegroundColour(self) -> Colour
8314 Returns the foreground colour of the window. The interpretation of
8315 foreground colour is dependent on the window class; it may be the text
8316 colour or other colour, or it may not be used at all.
8318 return _core_
.Window_GetForegroundColour(*args
, **kwargs
)
8320 def InheritsBackgroundColour(*args
, **kwargs
):
8321 """InheritsBackgroundColour(self) -> bool"""
8322 return _core_
.Window_InheritsBackgroundColour(*args
, **kwargs
)
8324 def UseBgCol(*args
, **kwargs
):
8325 """UseBgCol(self) -> bool"""
8326 return _core_
.Window_UseBgCol(*args
, **kwargs
)
8328 def SetBackgroundStyle(*args
, **kwargs
):
8330 SetBackgroundStyle(self, int style) -> bool
8332 Returns the background style of the window. The background style
8333 indicates how the background of the window is drawn.
8335 ====================== ========================================
8336 wx.BG_STYLE_SYSTEM The background colour or pattern should
8337 be determined by the system
8338 wx.BG_STYLE_COLOUR The background should be a solid colour
8339 wx.BG_STYLE_CUSTOM The background will be implemented by the
8341 ====================== ========================================
8343 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8344 a custom background, such as a tiled bitmap. Currently the style has
8345 no effect on other platforms.
8347 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8349 return _core_
.Window_SetBackgroundStyle(*args
, **kwargs
)
8351 def GetBackgroundStyle(*args
, **kwargs
):
8353 GetBackgroundStyle(self) -> int
8355 Returns the background style of the window.
8357 :see: `SetBackgroundStyle`
8359 return _core_
.Window_GetBackgroundStyle(*args
, **kwargs
)
8361 def HasTransparentBackground(*args
, **kwargs
):
8363 HasTransparentBackground(self) -> bool
8365 Returns True if this window's background is transparent (as, for
8366 example, for `wx.StaticText`) and should show the parent window's
8369 This method is mostly used internally by the library itself and you
8370 normally shouldn't have to call it. You may, however, have to override
8371 it in your custom control classes to ensure that background is painted
8374 return _core_
.Window_HasTransparentBackground(*args
, **kwargs
)
8376 def SetCursor(*args
, **kwargs
):
8378 SetCursor(self, Cursor cursor) -> bool
8380 Sets the window's cursor. Notice that the window cursor also sets it
8381 for the children of the window implicitly.
8383 The cursor may be wx.NullCursor in which case the window cursor will
8384 be reset back to default.
8386 return _core_
.Window_SetCursor(*args
, **kwargs
)
8388 def GetCursor(*args
, **kwargs
):
8390 GetCursor(self) -> Cursor
8392 Return the cursor associated with this window.
8394 return _core_
.Window_GetCursor(*args
, **kwargs
)
8396 def SetFont(*args
, **kwargs
):
8398 SetFont(self, Font font) -> bool
8400 Sets the font for this window.
8402 return _core_
.Window_SetFont(*args
, **kwargs
)
8404 def SetOwnFont(*args
, **kwargs
):
8405 """SetOwnFont(self, Font font)"""
8406 return _core_
.Window_SetOwnFont(*args
, **kwargs
)
8408 def GetFont(*args
, **kwargs
):
8410 GetFont(self) -> Font
8412 Returns the default font used for this window.
8414 return _core_
.Window_GetFont(*args
, **kwargs
)
8416 def SetCaret(*args
, **kwargs
):
8418 SetCaret(self, Caret caret)
8420 Sets the caret associated with the window.
8422 return _core_
.Window_SetCaret(*args
, **kwargs
)
8424 def GetCaret(*args
, **kwargs
):
8426 GetCaret(self) -> Caret
8428 Returns the caret associated with the window.
8430 return _core_
.Window_GetCaret(*args
, **kwargs
)
8432 def GetCharHeight(*args
, **kwargs
):
8434 GetCharHeight(self) -> int
8436 Get the (average) character size for the current font.
8438 return _core_
.Window_GetCharHeight(*args
, **kwargs
)
8440 def GetCharWidth(*args
, **kwargs
):
8442 GetCharWidth(self) -> int
8444 Get the (average) character size for the current font.
8446 return _core_
.Window_GetCharWidth(*args
, **kwargs
)
8448 def GetTextExtent(*args
, **kwargs
):
8450 GetTextExtent(String string) -> (width, height)
8452 Get the width and height of the text using the current font.
8454 return _core_
.Window_GetTextExtent(*args
, **kwargs
)
8456 def GetFullTextExtent(*args
, **kwargs
):
8458 GetFullTextExtent(String string, Font font=None) ->
8459 (width, height, descent, externalLeading)
8461 Get the width, height, decent and leading of the text using the
8462 current or specified font.
8464 return _core_
.Window_GetFullTextExtent(*args
, **kwargs
)
8466 def ClientToScreenXY(*args
, **kwargs
):
8468 ClientToScreenXY(int x, int y) -> (x,y)
8470 Converts to screen coordinates from coordinates relative to this window.
8472 return _core_
.Window_ClientToScreenXY(*args
, **kwargs
)
8474 def ScreenToClientXY(*args
, **kwargs
):
8476 ScreenToClientXY(int x, int y) -> (x,y)
8478 Converts from screen to client window coordinates.
8480 return _core_
.Window_ScreenToClientXY(*args
, **kwargs
)
8482 def ClientToScreen(*args
, **kwargs
):
8484 ClientToScreen(self, Point pt) -> Point
8486 Converts to screen coordinates from coordinates relative to this window.
8488 return _core_
.Window_ClientToScreen(*args
, **kwargs
)
8490 def ScreenToClient(*args
, **kwargs
):
8492 ScreenToClient(self, Point pt) -> Point
8494 Converts from screen to client window coordinates.
8496 return _core_
.Window_ScreenToClient(*args
, **kwargs
)
8498 def HitTestXY(*args
, **kwargs
):
8500 HitTestXY(self, int x, int y) -> int
8502 Test where the given (in client coords) point lies
8504 return _core_
.Window_HitTestXY(*args
, **kwargs
)
8506 def HitTest(*args
, **kwargs
):
8508 HitTest(self, Point pt) -> int
8510 Test where the given (in client coords) point lies
8512 return _core_
.Window_HitTest(*args
, **kwargs
)
8514 def GetBorder(*args
):
8516 GetBorder(self, long flags) -> int
8517 GetBorder(self) -> int
8519 Get border for the flags of this window
8521 return _core_
.Window_GetBorder(*args
)
8523 def UpdateWindowUI(*args
, **kwargs
):
8525 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
8527 This function sends EVT_UPDATE_UI events to the window. The particular
8528 implementation depends on the window; for example a wx.ToolBar will
8529 send an update UI event for each toolbar button, and a wx.Frame will
8530 send an update UI event for each menubar menu item. You can call this
8531 function from your application to ensure that your UI is up-to-date at
8532 a particular point in time (as far as your EVT_UPDATE_UI handlers are
8533 concerned). This may be necessary if you have called
8534 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
8535 limit the overhead that wxWindows incurs by sending update UI events
8538 return _core_
.Window_UpdateWindowUI(*args
, **kwargs
)
8540 def PopupMenuXY(*args
, **kwargs
):
8542 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
8544 Pops up the given menu at the specified coordinates, relative to this window,
8545 and returns control when the user has dismissed the menu. If a menu item is
8546 selected, the corresponding menu event is generated and will be processed as
8547 usual. If the default position is given then the current position of the
8548 mouse cursor will be used.
8550 return _core_
.Window_PopupMenuXY(*args
, **kwargs
)
8552 def PopupMenu(*args
, **kwargs
):
8554 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
8556 Pops up the given menu at the specified coordinates, relative to this window,
8557 and returns control when the user has dismissed the menu. If a menu item is
8558 selected, the corresponding menu event is generated and will be processed as
8559 usual. If the default position is given then the current position of the
8560 mouse cursor will be used.
8562 return _core_
.Window_PopupMenu(*args
, **kwargs
)
8564 def GetHandle(*args
, **kwargs
):
8566 GetHandle(self) -> long
8568 Returns the platform-specific handle (as a long integer) of the
8569 physical window. Currently on wxMac it returns the handle of the
8570 toplevel parent of the window.
8572 return _core_
.Window_GetHandle(*args
, **kwargs
)
8574 def AssociateHandle(*args
, **kwargs
):
8576 AssociateHandle(self, long handle)
8578 Associate the window with a new native handle
8580 return _core_
.Window_AssociateHandle(*args
, **kwargs
)
8582 def DissociateHandle(*args
, **kwargs
):
8584 DissociateHandle(self)
8586 Dissociate the current native handle from the window
8588 return _core_
.Window_DissociateHandle(*args
, **kwargs
)
8590 def HasScrollbar(*args
, **kwargs
):
8592 HasScrollbar(self, int orient) -> bool
8594 Does the window have the scrollbar for this orientation?
8596 return _core_
.Window_HasScrollbar(*args
, **kwargs
)
8598 def SetScrollbar(*args
, **kwargs
):
8600 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
8603 Sets the scrollbar properties of a built-in scrollbar.
8605 return _core_
.Window_SetScrollbar(*args
, **kwargs
)
8607 def SetScrollPos(*args
, **kwargs
):
8609 SetScrollPos(self, int orientation, int pos, bool refresh=True)
8611 Sets the position of one of the built-in scrollbars.
8613 return _core_
.Window_SetScrollPos(*args
, **kwargs
)
8615 def GetScrollPos(*args
, **kwargs
):
8617 GetScrollPos(self, int orientation) -> int
8619 Returns the built-in scrollbar position.
8621 return _core_
.Window_GetScrollPos(*args
, **kwargs
)
8623 def GetScrollThumb(*args
, **kwargs
):
8625 GetScrollThumb(self, int orientation) -> int
8627 Returns the built-in scrollbar thumb size.
8629 return _core_
.Window_GetScrollThumb(*args
, **kwargs
)
8631 def GetScrollRange(*args
, **kwargs
):
8633 GetScrollRange(self, int orientation) -> int
8635 Returns the built-in scrollbar range.
8637 return _core_
.Window_GetScrollRange(*args
, **kwargs
)
8639 def ScrollWindow(*args
, **kwargs
):
8641 ScrollWindow(self, int dx, int dy, Rect rect=None)
8643 Physically scrolls the pixels in the window and move child windows
8644 accordingly. Use this function to optimise your scrolling
8645 implementations, to minimise the area that must be redrawn. Note that
8646 it is rarely required to call this function from a user program.
8648 return _core_
.Window_ScrollWindow(*args
, **kwargs
)
8650 def ScrollLines(*args
, **kwargs
):
8652 ScrollLines(self, int lines) -> bool
8654 If the platform and window class supports it, scrolls the window by
8655 the given number of lines down, if lines is positive, or up if lines
8656 is negative. Returns True if the window was scrolled, False if it was
8657 already on top/bottom and nothing was done.
8659 return _core_
.Window_ScrollLines(*args
, **kwargs
)
8661 def ScrollPages(*args
, **kwargs
):
8663 ScrollPages(self, int pages) -> bool
8665 If the platform and window class supports it, scrolls the window by
8666 the given number of pages down, if pages is positive, or up if pages
8667 is negative. Returns True if the window was scrolled, False if it was
8668 already on top/bottom and nothing was done.
8670 return _core_
.Window_ScrollPages(*args
, **kwargs
)
8672 def LineUp(*args
, **kwargs
):
8674 LineUp(self) -> bool
8676 This is just a wrapper for ScrollLines(-1).
8678 return _core_
.Window_LineUp(*args
, **kwargs
)
8680 def LineDown(*args
, **kwargs
):
8682 LineDown(self) -> bool
8684 This is just a wrapper for ScrollLines(1).
8686 return _core_
.Window_LineDown(*args
, **kwargs
)
8688 def PageUp(*args
, **kwargs
):
8690 PageUp(self) -> bool
8692 This is just a wrapper for ScrollPages(-1).
8694 return _core_
.Window_PageUp(*args
, **kwargs
)
8696 def PageDown(*args
, **kwargs
):
8698 PageDown(self) -> bool
8700 This is just a wrapper for ScrollPages(1).
8702 return _core_
.Window_PageDown(*args
, **kwargs
)
8704 def SetHelpText(*args
, **kwargs
):
8706 SetHelpText(self, String text)
8708 Sets the help text to be used as context-sensitive help for this
8709 window. Note that the text is actually stored by the current
8710 wxHelpProvider implementation, and not in the window object itself.
8712 return _core_
.Window_SetHelpText(*args
, **kwargs
)
8714 def SetHelpTextForId(*args
, **kwargs
):
8716 SetHelpTextForId(self, String text)
8718 Associate this help text with all windows with the same id as this
8721 return _core_
.Window_SetHelpTextForId(*args
, **kwargs
)
8723 def GetHelpText(*args
, **kwargs
):
8725 GetHelpText(self) -> String
8727 Gets the help text to be used as context-sensitive help for this
8728 window. Note that the text is actually stored by the current
8729 wxHelpProvider implementation, and not in the window object itself.
8731 return _core_
.Window_GetHelpText(*args
, **kwargs
)
8733 def SetToolTipString(*args
, **kwargs
):
8735 SetToolTipString(self, String tip)
8737 Attach a tooltip to the window.
8739 return _core_
.Window_SetToolTipString(*args
, **kwargs
)
8741 def SetToolTip(*args
, **kwargs
):
8743 SetToolTip(self, ToolTip tip)
8745 Attach a tooltip to the window.
8747 return _core_
.Window_SetToolTip(*args
, **kwargs
)
8749 def GetToolTip(*args
, **kwargs
):
8751 GetToolTip(self) -> ToolTip
8753 get the associated tooltip or None if none
8755 return _core_
.Window_GetToolTip(*args
, **kwargs
)
8757 def SetDropTarget(*args
, **kwargs
):
8759 SetDropTarget(self, DropTarget dropTarget)
8761 Associates a drop target with this window. If the window already has
8762 a drop target, it is deleted.
8764 return _core_
.Window_SetDropTarget(*args
, **kwargs
)
8766 def GetDropTarget(*args
, **kwargs
):
8768 GetDropTarget(self) -> DropTarget
8770 Returns the associated drop target, which may be None.
8772 return _core_
.Window_GetDropTarget(*args
, **kwargs
)
8774 def SetConstraints(*args
, **kwargs
):
8776 SetConstraints(self, LayoutConstraints constraints)
8778 Sets the window to have the given layout constraints. If an existing
8779 layout constraints object is already owned by the window, it will be
8780 deleted. Pass None to disassociate and delete the window's current
8783 You must call SetAutoLayout to tell a window to use the constraints
8784 automatically in its default EVT_SIZE handler; otherwise, you must
8785 handle EVT_SIZE yourself and call Layout() explicitly. When setting
8786 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
8789 return _core_
.Window_SetConstraints(*args
, **kwargs
)
8791 def GetConstraints(*args
, **kwargs
):
8793 GetConstraints(self) -> LayoutConstraints
8795 Returns a pointer to the window's layout constraints, or None if there
8798 return _core_
.Window_GetConstraints(*args
, **kwargs
)
8800 def SetAutoLayout(*args
, **kwargs
):
8802 SetAutoLayout(self, bool autoLayout)
8804 Determines whether the Layout function will be called automatically
8805 when the window is resized. It is called implicitly by SetSizer but
8806 if you use SetConstraints you should call it manually or otherwise the
8807 window layout won't be correctly updated when its size changes.
8809 return _core_
.Window_SetAutoLayout(*args
, **kwargs
)
8811 def GetAutoLayout(*args
, **kwargs
):
8813 GetAutoLayout(self) -> bool
8815 Returns the current autoLayout setting
8817 return _core_
.Window_GetAutoLayout(*args
, **kwargs
)
8819 def Layout(*args
, **kwargs
):
8821 Layout(self) -> bool
8823 Invokes the constraint-based layout algorithm or the sizer-based
8824 algorithm for this window. See SetAutoLayout: when auto layout is on,
8825 this function gets called automatically by the default EVT_SIZE
8826 handler when the window is resized.
8828 return _core_
.Window_Layout(*args
, **kwargs
)
8830 def SetSizer(*args
, **kwargs
):
8832 SetSizer(self, Sizer sizer, bool deleteOld=True)
8834 Sets the window to have the given layout sizer. The window will then
8835 own the object, and will take care of its deletion. If an existing
8836 layout sizer object is already owned by the window, it will be deleted
8837 if the deleteOld parameter is true. Note that this function will also
8838 call SetAutoLayout implicitly with a True parameter if the sizer is
8839 non-None, and False otherwise.
8841 return _core_
.Window_SetSizer(*args
, **kwargs
)
8843 def SetSizerAndFit(*args
, **kwargs
):
8845 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
8847 The same as SetSizer, except it also sets the size hints for the
8848 window based on the sizer's minimum size.
8850 return _core_
.Window_SetSizerAndFit(*args
, **kwargs
)
8852 def GetSizer(*args
, **kwargs
):
8854 GetSizer(self) -> Sizer
8856 Return the sizer associated with the window by a previous call to
8857 SetSizer or None if there isn't one.
8859 return _core_
.Window_GetSizer(*args
, **kwargs
)
8861 def SetContainingSizer(*args
, **kwargs
):
8863 SetContainingSizer(self, Sizer sizer)
8865 This normally does not need to be called by application code. It is
8866 called internally when a window is added to a sizer, and is used so
8867 the window can remove itself from the sizer when it is destroyed.
8869 return _core_
.Window_SetContainingSizer(*args
, **kwargs
)
8871 def GetContainingSizer(*args
, **kwargs
):
8873 GetContainingSizer(self) -> Sizer
8875 Return the sizer that this window is a member of, if any, otherwise None.
8877 return _core_
.Window_GetContainingSizer(*args
, **kwargs
)
8879 def InheritAttributes(*args
, **kwargs
):
8881 InheritAttributes(self)
8883 This function is (or should be, in case of custom controls) called
8884 during window creation to intelligently set up the window visual
8885 attributes, that is the font and the foreground and background
8888 By 'intelligently' the following is meant: by default, all windows use
8889 their own default attributes. However if some of the parent's
8890 attributes are explicitly changed (that is, using SetFont and not
8891 SetOwnFont) and if the corresponding attribute hadn't been
8892 explicitly set for this window itself, then this window takes the same
8893 value as used by the parent. In addition, if the window overrides
8894 ShouldInheritColours to return false, the colours will not be changed
8895 no matter what and only the font might.
8897 This rather complicated logic is necessary in order to accommodate the
8898 different usage scenarios. The most common one is when all default
8899 attributes are used and in this case, nothing should be inherited as
8900 in modern GUIs different controls use different fonts (and colours)
8901 than their siblings so they can't inherit the same value from the
8902 parent. However it was also deemed desirable to allow to simply change
8903 the attributes of all children at once by just changing the font or
8904 colour of their common parent, hence in this case we do inherit the
8908 return _core_
.Window_InheritAttributes(*args
, **kwargs
)
8910 def ShouldInheritColours(*args
, **kwargs
):
8912 ShouldInheritColours(self) -> bool
8914 Return true from here to allow the colours of this window to be
8915 changed by InheritAttributes, returning false forbids inheriting them
8916 from the parent window.
8918 The base class version returns false, but this method is overridden in
8919 wxControl where it returns true.
8921 return _core_
.Window_ShouldInheritColours(*args
, **kwargs
)
8923 def PostCreate(self
, pre
):
8925 Phase 3 of the 2-phase create <wink!>
8926 Call this method after precreating the window with the 2-phase create method.
8928 self
.this
= pre
.this
8929 self
.thisown
= pre
.thisown
8931 if hasattr(self
, '_setOORInfo'):
8932 self
._setOORInfo
(self
)
8933 if hasattr(self
, '_setCallbackInfo'):
8934 self
._setCallbackInfo
(self
, self
.__class
__)
8937 class WindowPtr(Window
):
8938 def __init__(self
, this
):
8940 if not hasattr(self
,"thisown"): self
.thisown
= 0
8941 self
.__class
__ = Window
8942 _core_
.Window_swigregister(WindowPtr
)
8944 def PreWindow(*args
, **kwargs
):
8946 PreWindow() -> Window
8948 Precreate a Window for 2-phase creation.
8950 val
= _core_
.new_PreWindow(*args
, **kwargs
)
8954 def Window_NewControlId(*args
, **kwargs
):
8956 Window_NewControlId() -> int
8958 Generate a control id for the controls which were not given one.
8960 return _core_
.Window_NewControlId(*args
, **kwargs
)
8962 def Window_NextControlId(*args
, **kwargs
):
8964 Window_NextControlId(int winid) -> int
8966 Get the id of the control following the one with the given
8969 return _core_
.Window_NextControlId(*args
, **kwargs
)
8971 def Window_PrevControlId(*args
, **kwargs
):
8973 Window_PrevControlId(int winid) -> int
8975 Get the id of the control preceding the one with the given
8978 return _core_
.Window_PrevControlId(*args
, **kwargs
)
8980 def Window_FindFocus(*args
, **kwargs
):
8982 Window_FindFocus() -> Window
8984 Returns the window or control that currently has the keyboard focus,
8987 return _core_
.Window_FindFocus(*args
, **kwargs
)
8989 def Window_GetCapture(*args
, **kwargs
):
8991 Window_GetCapture() -> Window
8993 Returns the window which currently captures the mouse or None
8995 return _core_
.Window_GetCapture(*args
, **kwargs
)
8997 def Window_GetClassDefaultAttributes(*args
, **kwargs
):
8999 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9001 Get the default attributes for this class. This is useful if you want
9002 to use the same font or colour in your own control as in a standard
9003 control -- which is a much better idea than hard coding specific
9004 colours or fonts which might look completely out of place on the
9005 user's system, especially if it uses themes.
9007 The variant parameter is only relevant under Mac currently and is
9008 ignore under other platforms. Under Mac, it will change the size of
9009 the returned font. See `wx.Window.SetWindowVariant` for more about
9012 return _core_
.Window_GetClassDefaultAttributes(*args
, **kwargs
)
9014 def DLG_PNT(win
, point_or_x
, y
=None):
9016 Convenience function for converting a Point or (x,y) in
9017 dialog units to pixel units.
9020 return win
.ConvertDialogPointToPixels(point_or_x
)
9022 return win
.ConvertDialogPointToPixels(wx
.Point(point_or_x
, y
))
9024 def DLG_SZE(win
, size_width
, height
=None):
9026 Convenience function for converting a Size or (w,h) in
9027 dialog units to pixel units.
9030 return win
.ConvertDialogSizeToPixels(size_width
)
9032 return win
.ConvertDialogSizeToPixels(wx
.Size(size_width
, height
))
9035 def FindWindowById(*args
, **kwargs
):
9037 FindWindowById(long id, Window parent=None) -> Window
9039 Find the first window in the application with the given id. If parent
9040 is None, the search will start from all top-level frames and dialog
9041 boxes; if non-None, the search will be limited to the given window
9042 hierarchy. The search is recursive in both cases.
9044 return _core_
.FindWindowById(*args
, **kwargs
)
9046 def FindWindowByName(*args
, **kwargs
):
9048 FindWindowByName(String name, Window parent=None) -> Window
9050 Find a window by its name (as given in a window constructor or Create
9051 function call). If parent is None, the search will start from all
9052 top-level frames and dialog boxes; if non-None, the search will be
9053 limited to the given window hierarchy. The search is recursive in both
9056 If no window with such name is found, wx.FindWindowByLabel is called.
9058 return _core_
.FindWindowByName(*args
, **kwargs
)
9060 def FindWindowByLabel(*args
, **kwargs
):
9062 FindWindowByLabel(String label, Window parent=None) -> Window
9064 Find a window by its label. Depending on the type of window, the label
9065 may be a window title or panel item label. If parent is None, the
9066 search will start from all top-level frames and dialog boxes; if
9067 non-None, the search will be limited to the given window
9068 hierarchy. The search is recursive in both cases.
9070 return _core_
.FindWindowByLabel(*args
, **kwargs
)
9072 def Window_FromHWND(*args
, **kwargs
):
9073 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9074 return _core_
.Window_FromHWND(*args
, **kwargs
)
9076 def GetTopLevelWindows(*args
, **kwargs
):
9078 GetTopLevelWindows() -> PyObject
9080 Returns a list of the the application's top-level windows, (frames,
9081 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9082 by wxWidgets, and so it is only valid as long as no top-level windows
9083 are closed or new top-level windows are created.
9086 return _core_
.GetTopLevelWindows(*args
, **kwargs
)
9087 #---------------------------------------------------------------------------
9089 class Validator(EvtHandler
):
9090 """Proxy of C++ Validator class"""
9092 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
9093 def __init__(self
, *args
, **kwargs
):
9094 """__init__(self) -> Validator"""
9095 newobj
= _core_
.new_Validator(*args
, **kwargs
)
9096 self
.this
= newobj
.this
9099 self
._setOORInfo
(self
)
9101 def Clone(*args
, **kwargs
):
9102 """Clone(self) -> Validator"""
9103 return _core_
.Validator_Clone(*args
, **kwargs
)
9105 def Validate(*args
, **kwargs
):
9106 """Validate(self, Window parent) -> bool"""
9107 return _core_
.Validator_Validate(*args
, **kwargs
)
9109 def TransferToWindow(*args
, **kwargs
):
9110 """TransferToWindow(self) -> bool"""
9111 return _core_
.Validator_TransferToWindow(*args
, **kwargs
)
9113 def TransferFromWindow(*args
, **kwargs
):
9114 """TransferFromWindow(self) -> bool"""
9115 return _core_
.Validator_TransferFromWindow(*args
, **kwargs
)
9117 def GetWindow(*args
, **kwargs
):
9118 """GetWindow(self) -> Window"""
9119 return _core_
.Validator_GetWindow(*args
, **kwargs
)
9121 def SetWindow(*args
, **kwargs
):
9122 """SetWindow(self, Window window)"""
9123 return _core_
.Validator_SetWindow(*args
, **kwargs
)
9125 def IsSilent(*args
, **kwargs
):
9126 """IsSilent() -> bool"""
9127 return _core_
.Validator_IsSilent(*args
, **kwargs
)
9129 IsSilent
= staticmethod(IsSilent
)
9130 def SetBellOnError(*args
, **kwargs
):
9131 """SetBellOnError(int doIt=True)"""
9132 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
9134 SetBellOnError
= staticmethod(SetBellOnError
)
9136 class ValidatorPtr(Validator
):
9137 def __init__(self
, this
):
9139 if not hasattr(self
,"thisown"): self
.thisown
= 0
9140 self
.__class
__ = Validator
9141 _core_
.Validator_swigregister(ValidatorPtr
)
9143 def Validator_IsSilent(*args
, **kwargs
):
9144 """Validator_IsSilent() -> bool"""
9145 return _core_
.Validator_IsSilent(*args
, **kwargs
)
9147 def Validator_SetBellOnError(*args
, **kwargs
):
9148 """Validator_SetBellOnError(int doIt=True)"""
9149 return _core_
.Validator_SetBellOnError(*args
, **kwargs
)
9151 class PyValidator(Validator
):
9152 """Proxy of C++ PyValidator class"""
9154 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
9155 def __init__(self
, *args
, **kwargs
):
9156 """__init__(self) -> PyValidator"""
9157 newobj
= _core_
.new_PyValidator(*args
, **kwargs
)
9158 self
.this
= newobj
.this
9162 self
._setCallbackInfo
(self
, PyValidator
, 1)
9163 self
._setOORInfo
(self
)
9165 def _setCallbackInfo(*args
, **kwargs
):
9166 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9167 return _core_
.PyValidator__setCallbackInfo(*args
, **kwargs
)
9170 class PyValidatorPtr(PyValidator
):
9171 def __init__(self
, this
):
9173 if not hasattr(self
,"thisown"): self
.thisown
= 0
9174 self
.__class
__ = PyValidator
9175 _core_
.PyValidator_swigregister(PyValidatorPtr
)
9177 #---------------------------------------------------------------------------
9179 class Menu(EvtHandler
):
9180 """Proxy of C++ Menu class"""
9182 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
9183 def __init__(self
, *args
, **kwargs
):
9184 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
9185 newobj
= _core_
.new_Menu(*args
, **kwargs
)
9186 self
.this
= newobj
.this
9189 self
._setOORInfo
(self
)
9191 def Append(*args
, **kwargs
):
9192 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9193 return _core_
.Menu_Append(*args
, **kwargs
)
9195 def AppendSeparator(*args
, **kwargs
):
9196 """AppendSeparator(self) -> MenuItem"""
9197 return _core_
.Menu_AppendSeparator(*args
, **kwargs
)
9199 def AppendCheckItem(*args
, **kwargs
):
9200 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9201 return _core_
.Menu_AppendCheckItem(*args
, **kwargs
)
9203 def AppendRadioItem(*args
, **kwargs
):
9204 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9205 return _core_
.Menu_AppendRadioItem(*args
, **kwargs
)
9207 def AppendMenu(*args
, **kwargs
):
9208 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9209 return _core_
.Menu_AppendMenu(*args
, **kwargs
)
9211 def AppendItem(*args
, **kwargs
):
9212 """AppendItem(self, MenuItem item) -> MenuItem"""
9213 return _core_
.Menu_AppendItem(*args
, **kwargs
)
9215 def Break(*args
, **kwargs
):
9217 return _core_
.Menu_Break(*args
, **kwargs
)
9219 def InsertItem(*args
, **kwargs
):
9220 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9221 return _core_
.Menu_InsertItem(*args
, **kwargs
)
9223 def Insert(*args
, **kwargs
):
9225 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9226 int kind=ITEM_NORMAL) -> MenuItem
9228 return _core_
.Menu_Insert(*args
, **kwargs
)
9230 def InsertSeparator(*args
, **kwargs
):
9231 """InsertSeparator(self, size_t pos) -> MenuItem"""
9232 return _core_
.Menu_InsertSeparator(*args
, **kwargs
)
9234 def InsertCheckItem(*args
, **kwargs
):
9235 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9236 return _core_
.Menu_InsertCheckItem(*args
, **kwargs
)
9238 def InsertRadioItem(*args
, **kwargs
):
9239 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9240 return _core_
.Menu_InsertRadioItem(*args
, **kwargs
)
9242 def InsertMenu(*args
, **kwargs
):
9243 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9244 return _core_
.Menu_InsertMenu(*args
, **kwargs
)
9246 def PrependItem(*args
, **kwargs
):
9247 """PrependItem(self, MenuItem item) -> MenuItem"""
9248 return _core_
.Menu_PrependItem(*args
, **kwargs
)
9250 def Prepend(*args
, **kwargs
):
9251 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9252 return _core_
.Menu_Prepend(*args
, **kwargs
)
9254 def PrependSeparator(*args
, **kwargs
):
9255 """PrependSeparator(self) -> MenuItem"""
9256 return _core_
.Menu_PrependSeparator(*args
, **kwargs
)
9258 def PrependCheckItem(*args
, **kwargs
):
9259 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9260 return _core_
.Menu_PrependCheckItem(*args
, **kwargs
)
9262 def PrependRadioItem(*args
, **kwargs
):
9263 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9264 return _core_
.Menu_PrependRadioItem(*args
, **kwargs
)
9266 def PrependMenu(*args
, **kwargs
):
9267 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9268 return _core_
.Menu_PrependMenu(*args
, **kwargs
)
9270 def Remove(*args
, **kwargs
):
9271 """Remove(self, int id) -> MenuItem"""
9272 return _core_
.Menu_Remove(*args
, **kwargs
)
9274 def RemoveItem(*args
, **kwargs
):
9275 """RemoveItem(self, MenuItem item) -> MenuItem"""
9276 return _core_
.Menu_RemoveItem(*args
, **kwargs
)
9278 def Delete(*args
, **kwargs
):
9279 """Delete(self, int id) -> bool"""
9280 return _core_
.Menu_Delete(*args
, **kwargs
)
9282 def DeleteItem(*args
, **kwargs
):
9283 """DeleteItem(self, MenuItem item) -> bool"""
9284 return _core_
.Menu_DeleteItem(*args
, **kwargs
)
9286 def Destroy(*args
, **kwargs
):
9290 Deletes the C++ object this Python object is a proxy for.
9292 return _core_
.Menu_Destroy(*args
, **kwargs
)
9294 def DestroyId(*args
, **kwargs
):
9296 DestroyId(self, int id) -> bool
9298 Deletes the C++ object this Python object is a proxy for.
9300 return _core_
.Menu_DestroyId(*args
, **kwargs
)
9302 def DestroyItem(*args
, **kwargs
):
9304 DestroyItem(self, MenuItem item) -> bool
9306 Deletes the C++ object this Python object is a proxy for.
9308 return _core_
.Menu_DestroyItem(*args
, **kwargs
)
9310 def GetMenuItemCount(*args
, **kwargs
):
9311 """GetMenuItemCount(self) -> size_t"""
9312 return _core_
.Menu_GetMenuItemCount(*args
, **kwargs
)
9314 def GetMenuItems(*args
, **kwargs
):
9315 """GetMenuItems(self) -> PyObject"""
9316 return _core_
.Menu_GetMenuItems(*args
, **kwargs
)
9318 def FindItem(*args
, **kwargs
):
9319 """FindItem(self, String item) -> int"""
9320 return _core_
.Menu_FindItem(*args
, **kwargs
)
9322 def FindItemById(*args
, **kwargs
):
9323 """FindItemById(self, int id) -> MenuItem"""
9324 return _core_
.Menu_FindItemById(*args
, **kwargs
)
9326 def FindItemByPosition(*args
, **kwargs
):
9327 """FindItemByPosition(self, size_t position) -> MenuItem"""
9328 return _core_
.Menu_FindItemByPosition(*args
, **kwargs
)
9330 def Enable(*args
, **kwargs
):
9331 """Enable(self, int id, bool enable)"""
9332 return _core_
.Menu_Enable(*args
, **kwargs
)
9334 def IsEnabled(*args
, **kwargs
):
9335 """IsEnabled(self, int id) -> bool"""
9336 return _core_
.Menu_IsEnabled(*args
, **kwargs
)
9338 def Check(*args
, **kwargs
):
9339 """Check(self, int id, bool check)"""
9340 return _core_
.Menu_Check(*args
, **kwargs
)
9342 def IsChecked(*args
, **kwargs
):
9343 """IsChecked(self, int id) -> bool"""
9344 return _core_
.Menu_IsChecked(*args
, **kwargs
)
9346 def SetLabel(*args
, **kwargs
):
9347 """SetLabel(self, int id, String label)"""
9348 return _core_
.Menu_SetLabel(*args
, **kwargs
)
9350 def GetLabel(*args
, **kwargs
):
9351 """GetLabel(self, int id) -> String"""
9352 return _core_
.Menu_GetLabel(*args
, **kwargs
)
9354 def SetHelpString(*args
, **kwargs
):
9355 """SetHelpString(self, int id, String helpString)"""
9356 return _core_
.Menu_SetHelpString(*args
, **kwargs
)
9358 def GetHelpString(*args
, **kwargs
):
9359 """GetHelpString(self, int id) -> String"""
9360 return _core_
.Menu_GetHelpString(*args
, **kwargs
)
9362 def SetTitle(*args
, **kwargs
):
9363 """SetTitle(self, String title)"""
9364 return _core_
.Menu_SetTitle(*args
, **kwargs
)
9366 def GetTitle(*args
, **kwargs
):
9367 """GetTitle(self) -> String"""
9368 return _core_
.Menu_GetTitle(*args
, **kwargs
)
9370 def SetEventHandler(*args
, **kwargs
):
9371 """SetEventHandler(self, EvtHandler handler)"""
9372 return _core_
.Menu_SetEventHandler(*args
, **kwargs
)
9374 def GetEventHandler(*args
, **kwargs
):
9375 """GetEventHandler(self) -> EvtHandler"""
9376 return _core_
.Menu_GetEventHandler(*args
, **kwargs
)
9378 def SetInvokingWindow(*args
, **kwargs
):
9379 """SetInvokingWindow(self, Window win)"""
9380 return _core_
.Menu_SetInvokingWindow(*args
, **kwargs
)
9382 def GetInvokingWindow(*args
, **kwargs
):
9383 """GetInvokingWindow(self) -> Window"""
9384 return _core_
.Menu_GetInvokingWindow(*args
, **kwargs
)
9386 def GetStyle(*args
, **kwargs
):
9387 """GetStyle(self) -> long"""
9388 return _core_
.Menu_GetStyle(*args
, **kwargs
)
9390 def UpdateUI(*args
, **kwargs
):
9391 """UpdateUI(self, EvtHandler source=None)"""
9392 return _core_
.Menu_UpdateUI(*args
, **kwargs
)
9394 def GetMenuBar(*args
, **kwargs
):
9395 """GetMenuBar(self) -> MenuBar"""
9396 return _core_
.Menu_GetMenuBar(*args
, **kwargs
)
9398 def Attach(*args
, **kwargs
):
9399 """Attach(self, wxMenuBarBase menubar)"""
9400 return _core_
.Menu_Attach(*args
, **kwargs
)
9402 def Detach(*args
, **kwargs
):
9404 return _core_
.Menu_Detach(*args
, **kwargs
)
9406 def IsAttached(*args
, **kwargs
):
9407 """IsAttached(self) -> bool"""
9408 return _core_
.Menu_IsAttached(*args
, **kwargs
)
9410 def SetParent(*args
, **kwargs
):
9411 """SetParent(self, Menu parent)"""
9412 return _core_
.Menu_SetParent(*args
, **kwargs
)
9414 def GetParent(*args
, **kwargs
):
9415 """GetParent(self) -> Menu"""
9416 return _core_
.Menu_GetParent(*args
, **kwargs
)
9419 class MenuPtr(Menu
):
9420 def __init__(self
, this
):
9422 if not hasattr(self
,"thisown"): self
.thisown
= 0
9423 self
.__class
__ = Menu
9424 _core_
.Menu_swigregister(MenuPtr
)
9425 DefaultValidator
= cvar
.DefaultValidator
9427 #---------------------------------------------------------------------------
9429 class MenuBar(Window
):
9430 """Proxy of C++ MenuBar class"""
9432 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
9433 def __init__(self
, *args
, **kwargs
):
9434 """__init__(self, long style=0) -> MenuBar"""
9435 newobj
= _core_
.new_MenuBar(*args
, **kwargs
)
9436 self
.this
= newobj
.this
9439 self
._setOORInfo
(self
)
9441 def Append(*args
, **kwargs
):
9442 """Append(self, Menu menu, String title) -> bool"""
9443 return _core_
.MenuBar_Append(*args
, **kwargs
)
9445 def Insert(*args
, **kwargs
):
9446 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
9447 return _core_
.MenuBar_Insert(*args
, **kwargs
)
9449 def GetMenuCount(*args
, **kwargs
):
9450 """GetMenuCount(self) -> size_t"""
9451 return _core_
.MenuBar_GetMenuCount(*args
, **kwargs
)
9453 def GetMenu(*args
, **kwargs
):
9454 """GetMenu(self, size_t pos) -> Menu"""
9455 return _core_
.MenuBar_GetMenu(*args
, **kwargs
)
9457 def Replace(*args
, **kwargs
):
9458 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
9459 return _core_
.MenuBar_Replace(*args
, **kwargs
)
9461 def Remove(*args
, **kwargs
):
9462 """Remove(self, size_t pos) -> Menu"""
9463 return _core_
.MenuBar_Remove(*args
, **kwargs
)
9465 def EnableTop(*args
, **kwargs
):
9466 """EnableTop(self, size_t pos, bool enable)"""
9467 return _core_
.MenuBar_EnableTop(*args
, **kwargs
)
9469 def IsEnabledTop(*args
, **kwargs
):
9470 """IsEnabledTop(self, size_t pos) -> bool"""
9471 return _core_
.MenuBar_IsEnabledTop(*args
, **kwargs
)
9473 def SetLabelTop(*args
, **kwargs
):
9474 """SetLabelTop(self, size_t pos, String label)"""
9475 return _core_
.MenuBar_SetLabelTop(*args
, **kwargs
)
9477 def GetLabelTop(*args
, **kwargs
):
9478 """GetLabelTop(self, size_t pos) -> String"""
9479 return _core_
.MenuBar_GetLabelTop(*args
, **kwargs
)
9481 def FindMenuItem(*args
, **kwargs
):
9482 """FindMenuItem(self, String menu, String item) -> int"""
9483 return _core_
.MenuBar_FindMenuItem(*args
, **kwargs
)
9485 def FindItemById(*args
, **kwargs
):
9486 """FindItemById(self, int id) -> MenuItem"""
9487 return _core_
.MenuBar_FindItemById(*args
, **kwargs
)
9489 def FindMenu(*args
, **kwargs
):
9490 """FindMenu(self, String title) -> int"""
9491 return _core_
.MenuBar_FindMenu(*args
, **kwargs
)
9493 def Enable(*args
, **kwargs
):
9494 """Enable(self, int id, bool enable)"""
9495 return _core_
.MenuBar_Enable(*args
, **kwargs
)
9497 def Check(*args
, **kwargs
):
9498 """Check(self, int id, bool check)"""
9499 return _core_
.MenuBar_Check(*args
, **kwargs
)
9501 def IsChecked(*args
, **kwargs
):
9502 """IsChecked(self, int id) -> bool"""
9503 return _core_
.MenuBar_IsChecked(*args
, **kwargs
)
9505 def IsEnabled(*args
, **kwargs
):
9506 """IsEnabled(self, int id) -> bool"""
9507 return _core_
.MenuBar_IsEnabled(*args
, **kwargs
)
9509 def SetLabel(*args
, **kwargs
):
9510 """SetLabel(self, int id, String label)"""
9511 return _core_
.MenuBar_SetLabel(*args
, **kwargs
)
9513 def GetLabel(*args
, **kwargs
):
9514 """GetLabel(self, int id) -> String"""
9515 return _core_
.MenuBar_GetLabel(*args
, **kwargs
)
9517 def SetHelpString(*args
, **kwargs
):
9518 """SetHelpString(self, int id, String helpString)"""
9519 return _core_
.MenuBar_SetHelpString(*args
, **kwargs
)
9521 def GetHelpString(*args
, **kwargs
):
9522 """GetHelpString(self, int id) -> String"""
9523 return _core_
.MenuBar_GetHelpString(*args
, **kwargs
)
9525 def GetFrame(*args
, **kwargs
):
9526 """GetFrame(self) -> wxFrame"""
9527 return _core_
.MenuBar_GetFrame(*args
, **kwargs
)
9529 def IsAttached(*args
, **kwargs
):
9530 """IsAttached(self) -> bool"""
9531 return _core_
.MenuBar_IsAttached(*args
, **kwargs
)
9533 def Attach(*args
, **kwargs
):
9534 """Attach(self, wxFrame frame)"""
9535 return _core_
.MenuBar_Attach(*args
, **kwargs
)
9537 def Detach(*args
, **kwargs
):
9539 return _core_
.MenuBar_Detach(*args
, **kwargs
)
9542 class MenuBarPtr(MenuBar
):
9543 def __init__(self
, this
):
9545 if not hasattr(self
,"thisown"): self
.thisown
= 0
9546 self
.__class
__ = MenuBar
9547 _core_
.MenuBar_swigregister(MenuBarPtr
)
9549 #---------------------------------------------------------------------------
9551 class MenuItem(Object
):
9552 """Proxy of C++ MenuItem class"""
9554 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
9555 def __init__(self
, *args
, **kwargs
):
9557 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
9558 String help=EmptyString, int kind=ITEM_NORMAL,
9559 Menu subMenu=None) -> MenuItem
9561 newobj
= _core_
.new_MenuItem(*args
, **kwargs
)
9562 self
.this
= newobj
.this
9565 def GetMenu(*args
, **kwargs
):
9566 """GetMenu(self) -> Menu"""
9567 return _core_
.MenuItem_GetMenu(*args
, **kwargs
)
9569 def SetMenu(*args
, **kwargs
):
9570 """SetMenu(self, Menu menu)"""
9571 return _core_
.MenuItem_SetMenu(*args
, **kwargs
)
9573 def SetId(*args
, **kwargs
):
9574 """SetId(self, int id)"""
9575 return _core_
.MenuItem_SetId(*args
, **kwargs
)
9577 def GetId(*args
, **kwargs
):
9578 """GetId(self) -> int"""
9579 return _core_
.MenuItem_GetId(*args
, **kwargs
)
9581 def IsSeparator(*args
, **kwargs
):
9582 """IsSeparator(self) -> bool"""
9583 return _core_
.MenuItem_IsSeparator(*args
, **kwargs
)
9585 def SetText(*args
, **kwargs
):
9586 """SetText(self, String str)"""
9587 return _core_
.MenuItem_SetText(*args
, **kwargs
)
9589 def GetLabel(*args
, **kwargs
):
9590 """GetLabel(self) -> String"""
9591 return _core_
.MenuItem_GetLabel(*args
, **kwargs
)
9593 def GetText(*args
, **kwargs
):
9594 """GetText(self) -> String"""
9595 return _core_
.MenuItem_GetText(*args
, **kwargs
)
9597 def GetLabelFromText(*args
, **kwargs
):
9598 """GetLabelFromText(String text) -> String"""
9599 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
9601 GetLabelFromText
= staticmethod(GetLabelFromText
)
9602 def GetKind(*args
, **kwargs
):
9603 """GetKind(self) -> int"""
9604 return _core_
.MenuItem_GetKind(*args
, **kwargs
)
9606 def SetKind(*args
, **kwargs
):
9607 """SetKind(self, int kind)"""
9608 return _core_
.MenuItem_SetKind(*args
, **kwargs
)
9610 def SetCheckable(*args
, **kwargs
):
9611 """SetCheckable(self, bool checkable)"""
9612 return _core_
.MenuItem_SetCheckable(*args
, **kwargs
)
9614 def IsCheckable(*args
, **kwargs
):
9615 """IsCheckable(self) -> bool"""
9616 return _core_
.MenuItem_IsCheckable(*args
, **kwargs
)
9618 def IsSubMenu(*args
, **kwargs
):
9619 """IsSubMenu(self) -> bool"""
9620 return _core_
.MenuItem_IsSubMenu(*args
, **kwargs
)
9622 def SetSubMenu(*args
, **kwargs
):
9623 """SetSubMenu(self, Menu menu)"""
9624 return _core_
.MenuItem_SetSubMenu(*args
, **kwargs
)
9626 def GetSubMenu(*args
, **kwargs
):
9627 """GetSubMenu(self) -> Menu"""
9628 return _core_
.MenuItem_GetSubMenu(*args
, **kwargs
)
9630 def Enable(*args
, **kwargs
):
9631 """Enable(self, bool enable=True)"""
9632 return _core_
.MenuItem_Enable(*args
, **kwargs
)
9634 def IsEnabled(*args
, **kwargs
):
9635 """IsEnabled(self) -> bool"""
9636 return _core_
.MenuItem_IsEnabled(*args
, **kwargs
)
9638 def Check(*args
, **kwargs
):
9639 """Check(self, bool check=True)"""
9640 return _core_
.MenuItem_Check(*args
, **kwargs
)
9642 def IsChecked(*args
, **kwargs
):
9643 """IsChecked(self) -> bool"""
9644 return _core_
.MenuItem_IsChecked(*args
, **kwargs
)
9646 def Toggle(*args
, **kwargs
):
9648 return _core_
.MenuItem_Toggle(*args
, **kwargs
)
9650 def SetHelp(*args
, **kwargs
):
9651 """SetHelp(self, String str)"""
9652 return _core_
.MenuItem_SetHelp(*args
, **kwargs
)
9654 def GetHelp(*args
, **kwargs
):
9655 """GetHelp(self) -> String"""
9656 return _core_
.MenuItem_GetHelp(*args
, **kwargs
)
9658 def GetAccel(*args
, **kwargs
):
9659 """GetAccel(self) -> AcceleratorEntry"""
9660 return _core_
.MenuItem_GetAccel(*args
, **kwargs
)
9662 def SetAccel(*args
, **kwargs
):
9663 """SetAccel(self, AcceleratorEntry accel)"""
9664 return _core_
.MenuItem_SetAccel(*args
, **kwargs
)
9666 def SetFont(*args
, **kwargs
):
9667 """SetFont(self, Font font)"""
9668 return _core_
.MenuItem_SetFont(*args
, **kwargs
)
9670 def GetFont(*args
, **kwargs
):
9671 """GetFont(self) -> Font"""
9672 return _core_
.MenuItem_GetFont(*args
, **kwargs
)
9674 def SetTextColour(*args
, **kwargs
):
9675 """SetTextColour(self, Colour colText)"""
9676 return _core_
.MenuItem_SetTextColour(*args
, **kwargs
)
9678 def GetTextColour(*args
, **kwargs
):
9679 """GetTextColour(self) -> Colour"""
9680 return _core_
.MenuItem_GetTextColour(*args
, **kwargs
)
9682 def SetBackgroundColour(*args
, **kwargs
):
9683 """SetBackgroundColour(self, Colour colBack)"""
9684 return _core_
.MenuItem_SetBackgroundColour(*args
, **kwargs
)
9686 def GetBackgroundColour(*args
, **kwargs
):
9687 """GetBackgroundColour(self) -> Colour"""
9688 return _core_
.MenuItem_GetBackgroundColour(*args
, **kwargs
)
9690 def SetBitmaps(*args
, **kwargs
):
9691 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
9692 return _core_
.MenuItem_SetBitmaps(*args
, **kwargs
)
9694 def SetDisabledBitmap(*args
, **kwargs
):
9695 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
9696 return _core_
.MenuItem_SetDisabledBitmap(*args
, **kwargs
)
9698 def GetDisabledBitmap(*args
, **kwargs
):
9699 """GetDisabledBitmap(self) -> Bitmap"""
9700 return _core_
.MenuItem_GetDisabledBitmap(*args
, **kwargs
)
9702 def SetMarginWidth(*args
, **kwargs
):
9703 """SetMarginWidth(self, int nWidth)"""
9704 return _core_
.MenuItem_SetMarginWidth(*args
, **kwargs
)
9706 def GetMarginWidth(*args
, **kwargs
):
9707 """GetMarginWidth(self) -> int"""
9708 return _core_
.MenuItem_GetMarginWidth(*args
, **kwargs
)
9710 def GetDefaultMarginWidth(*args
, **kwargs
):
9711 """GetDefaultMarginWidth() -> int"""
9712 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
9714 GetDefaultMarginWidth
= staticmethod(GetDefaultMarginWidth
)
9715 def IsOwnerDrawn(*args
, **kwargs
):
9716 """IsOwnerDrawn(self) -> bool"""
9717 return _core_
.MenuItem_IsOwnerDrawn(*args
, **kwargs
)
9719 def SetOwnerDrawn(*args
, **kwargs
):
9720 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
9721 return _core_
.MenuItem_SetOwnerDrawn(*args
, **kwargs
)
9723 def ResetOwnerDrawn(*args
, **kwargs
):
9724 """ResetOwnerDrawn(self)"""
9725 return _core_
.MenuItem_ResetOwnerDrawn(*args
, **kwargs
)
9727 def SetBitmap(*args
, **kwargs
):
9728 """SetBitmap(self, Bitmap bitmap)"""
9729 return _core_
.MenuItem_SetBitmap(*args
, **kwargs
)
9731 def GetBitmap(*args
, **kwargs
):
9732 """GetBitmap(self) -> Bitmap"""
9733 return _core_
.MenuItem_GetBitmap(*args
, **kwargs
)
9736 class MenuItemPtr(MenuItem
):
9737 def __init__(self
, this
):
9739 if not hasattr(self
,"thisown"): self
.thisown
= 0
9740 self
.__class
__ = MenuItem
9741 _core_
.MenuItem_swigregister(MenuItemPtr
)
9743 def MenuItem_GetLabelFromText(*args
, **kwargs
):
9744 """MenuItem_GetLabelFromText(String text) -> String"""
9745 return _core_
.MenuItem_GetLabelFromText(*args
, **kwargs
)
9747 def MenuItem_GetDefaultMarginWidth(*args
, **kwargs
):
9748 """MenuItem_GetDefaultMarginWidth() -> int"""
9749 return _core_
.MenuItem_GetDefaultMarginWidth(*args
, **kwargs
)
9751 #---------------------------------------------------------------------------
9753 class Control(Window
):
9755 This is the base class for a control or 'widget'.
9757 A control is generally a small window which processes user input
9758 and/or displays one or more item of data.
9761 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
9762 def __init__(self
, *args
, **kwargs
):
9764 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
9765 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
9766 String name=ControlNameStr) -> Control
9768 Create a Control. Normally you should only call this from a subclass'
9769 __init__ as a plain old wx.Control is not very useful.
9771 newobj
= _core_
.new_Control(*args
, **kwargs
)
9772 self
.this
= newobj
.this
9775 self
._setOORInfo
(self
)
9777 def Create(*args
, **kwargs
):
9779 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
9780 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
9781 String name=ControlNameStr) -> bool
9783 Do the 2nd phase and create the GUI control.
9785 return _core_
.Control_Create(*args
, **kwargs
)
9787 def Command(*args
, **kwargs
):
9789 Command(self, CommandEvent event)
9791 Simulates the effect of the user issuing a command to the item.
9793 :see: `wx.CommandEvent`
9796 return _core_
.Control_Command(*args
, **kwargs
)
9798 def GetLabel(*args
, **kwargs
):
9800 GetLabel(self) -> String
9802 Return a control's text.
9804 return _core_
.Control_GetLabel(*args
, **kwargs
)
9806 def SetLabel(*args
, **kwargs
):
9808 SetLabel(self, String label)
9810 Sets the item's text.
9812 return _core_
.Control_SetLabel(*args
, **kwargs
)
9814 def GetClassDefaultAttributes(*args
, **kwargs
):
9816 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9818 Get the default attributes for this class. This is useful if you want
9819 to use the same font or colour in your own control as in a standard
9820 control -- which is a much better idea than hard coding specific
9821 colours or fonts which might look completely out of place on the
9822 user's system, especially if it uses themes.
9824 The variant parameter is only relevant under Mac currently and is
9825 ignore under other platforms. Under Mac, it will change the size of
9826 the returned font. See `wx.Window.SetWindowVariant` for more about
9829 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
9831 GetClassDefaultAttributes
= staticmethod(GetClassDefaultAttributes
)
9833 class ControlPtr(Control
):
9834 def __init__(self
, this
):
9836 if not hasattr(self
,"thisown"): self
.thisown
= 0
9837 self
.__class
__ = Control
9838 _core_
.Control_swigregister(ControlPtr
)
9839 ControlNameStr
= cvar
.ControlNameStr
9841 def PreControl(*args
, **kwargs
):
9843 PreControl() -> Control
9845 Precreate a Control control for 2-phase creation
9847 val
= _core_
.new_PreControl(*args
, **kwargs
)
9851 def Control_GetClassDefaultAttributes(*args
, **kwargs
):
9853 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9855 Get the default attributes for this class. This is useful if you want
9856 to use the same font or colour in your own control as in a standard
9857 control -- which is a much better idea than hard coding specific
9858 colours or fonts which might look completely out of place on the
9859 user's system, especially if it uses themes.
9861 The variant parameter is only relevant under Mac currently and is
9862 ignore under other platforms. Under Mac, it will change the size of
9863 the returned font. See `wx.Window.SetWindowVariant` for more about
9866 return _core_
.Control_GetClassDefaultAttributes(*args
, **kwargs
)
9868 #---------------------------------------------------------------------------
9870 class ItemContainer(object):
9872 The wx.ItemContainer class defines an interface which is implemented
9873 by all controls which have string subitems, each of which may be
9874 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
9875 as `wx.ComboBox` which implements an extended interface deriving from
9878 It defines the methods for accessing the control's items and although
9879 each of the derived classes implements them differently, they still
9880 all conform to the same interface.
9882 The items in a wx.ItemContainer have (non empty) string labels and,
9883 optionally, client data associated with them.
9886 def __init__(self
): raise RuntimeError, "No constructor defined"
9888 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
9889 def Append(*args
, **kwargs
):
9891 Append(self, String item, PyObject clientData=None) -> int
9893 Adds the item to the control, associating the given data with the item
9894 if not None. The return value is the index of the newly added item
9895 which may be different from the last one if the control is sorted (e.g.
9896 has wx.LB_SORT or wx.CB_SORT style).
9898 return _core_
.ItemContainer_Append(*args
, **kwargs
)
9900 def AppendItems(*args
, **kwargs
):
9902 AppendItems(self, List strings)
9904 Apend several items at once to the control. Notice that calling this
9905 method may be much faster than appending the items one by one if you
9906 need to add a lot of items.
9908 return _core_
.ItemContainer_AppendItems(*args
, **kwargs
)
9910 def Insert(*args
, **kwargs
):
9912 Insert(self, String item, int pos, PyObject clientData=None) -> int
9914 Insert an item into the control before the item at the ``pos`` index,
9915 optionally associating some data object with the item.
9917 return _core_
.ItemContainer_Insert(*args
, **kwargs
)
9919 def Clear(*args
, **kwargs
):
9923 Removes all items from the control.
9925 return _core_
.ItemContainer_Clear(*args
, **kwargs
)
9927 def Delete(*args
, **kwargs
):
9931 Deletes the item at the zero-based index 'n' from the control. Note
9932 that it is an error (signalled by a `wx.PyAssertionError` exception if
9933 enabled) to remove an item with the index negative or greater or equal
9934 than the number of items in the control.
9936 return _core_
.ItemContainer_Delete(*args
, **kwargs
)
9938 def GetClientData(*args
, **kwargs
):
9940 GetClientData(self, int n) -> PyObject
9942 Returns the client data associated with the given item, (if any.)
9944 return _core_
.ItemContainer_GetClientData(*args
, **kwargs
)
9946 def SetClientData(*args
, **kwargs
):
9948 SetClientData(self, int n, PyObject clientData)
9950 Associate the given client data with the item at position n.
9952 return _core_
.ItemContainer_SetClientData(*args
, **kwargs
)
9954 def GetCount(*args
, **kwargs
):
9956 GetCount(self) -> int
9958 Returns the number of items in the control.
9960 return _core_
.ItemContainer_GetCount(*args
, **kwargs
)
9962 def IsEmpty(*args
, **kwargs
):
9964 IsEmpty(self) -> bool
9966 Returns True if the control is empty or False if it has some items.
9968 return _core_
.ItemContainer_IsEmpty(*args
, **kwargs
)
9970 def GetString(*args
, **kwargs
):
9972 GetString(self, int n) -> String
9974 Returns the label of the item with the given index.
9976 return _core_
.ItemContainer_GetString(*args
, **kwargs
)
9978 def GetStrings(*args
, **kwargs
):
9979 """GetStrings(self) -> wxArrayString"""
9980 return _core_
.ItemContainer_GetStrings(*args
, **kwargs
)
9982 def SetString(*args
, **kwargs
):
9984 SetString(self, int n, String s)
9986 Sets the label for the given item.
9988 return _core_
.ItemContainer_SetString(*args
, **kwargs
)
9990 def FindString(*args
, **kwargs
):
9992 FindString(self, String s) -> int
9994 Finds an item whose label matches the given string. Returns the
9995 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
9998 return _core_
.ItemContainer_FindString(*args
, **kwargs
)
10000 def SetSelection(*args
, **kwargs
):
10002 SetSelection(self, int n)
10004 Sets the item at index 'n' to be the selected item.
10006 return _core_
.ItemContainer_SetSelection(*args
, **kwargs
)
10008 def GetSelection(*args
, **kwargs
):
10010 GetSelection(self) -> int
10012 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10015 return _core_
.ItemContainer_GetSelection(*args
, **kwargs
)
10017 def SetStringSelection(*args
, **kwargs
):
10018 """SetStringSelection(self, String s) -> bool"""
10019 return _core_
.ItemContainer_SetStringSelection(*args
, **kwargs
)
10021 def GetStringSelection(*args
, **kwargs
):
10023 GetStringSelection(self) -> String
10025 Returns the label of the selected item or an empty string if no item
10028 return _core_
.ItemContainer_GetStringSelection(*args
, **kwargs
)
10030 def Select(*args
, **kwargs
):
10032 Select(self, int n)
10034 This is the same as `SetSelection` and exists only because it is
10035 slightly more natural for controls which support multiple selection.
10037 return _core_
.ItemContainer_Select(*args
, **kwargs
)
10040 class ItemContainerPtr(ItemContainer
):
10041 def __init__(self
, this
):
10043 if not hasattr(self
,"thisown"): self
.thisown
= 0
10044 self
.__class
__ = ItemContainer
10045 _core_
.ItemContainer_swigregister(ItemContainerPtr
)
10047 #---------------------------------------------------------------------------
10049 class ControlWithItems(Control
,ItemContainer
):
10051 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10052 wx.Control class, and is used for the base class of various controls
10055 def __init__(self
): raise RuntimeError, "No constructor defined"
10056 def __repr__(self
):
10057 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10059 class ControlWithItemsPtr(ControlWithItems
):
10060 def __init__(self
, this
):
10062 if not hasattr(self
,"thisown"): self
.thisown
= 0
10063 self
.__class
__ = ControlWithItems
10064 _core_
.ControlWithItems_swigregister(ControlWithItemsPtr
)
10066 #---------------------------------------------------------------------------
10068 class SizerItem(Object
):
10070 The wx.SizerItem class is used to track the position, size and other
10071 attributes of each item managed by a `wx.Sizer`. In normal usage user
10072 code should never need to deal directly with a wx.SizerItem, but
10073 custom classes derived from `wx.PySizer` will probably need to use the
10074 collection of wx.SizerItems held by wx.Sizer when calculating layout.
10076 :see: `wx.Sizer`, `wx.GBSizerItem`
10078 def __repr__(self
):
10079 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10080 def __init__(self
, *args
, **kwargs
):
10082 __init__(self) -> SizerItem
10084 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10085 size will need to be set before this item can be used in a Sizer.
10087 You will probably never need to create a wx.SizerItem directly as they
10088 are created automatically when the sizer's Add, Insert or Prepend
10089 methods are called.
10091 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10093 newobj
= _core_
.new_SizerItem(*args
, **kwargs
)
10094 self
.this
= newobj
.this
10097 def DeleteWindows(*args
, **kwargs
):
10099 DeleteWindows(self)
10101 Destroy the window or the windows in a subsizer, depending on the type
10104 return _core_
.SizerItem_DeleteWindows(*args
, **kwargs
)
10106 def DetachSizer(*args
, **kwargs
):
10110 Enable deleting the SizerItem without destroying the contained sizer.
10112 return _core_
.SizerItem_DetachSizer(*args
, **kwargs
)
10114 def GetSize(*args
, **kwargs
):
10116 GetSize(self) -> Size
10118 Get the current size of the item, as set in the last Layout.
10120 return _core_
.SizerItem_GetSize(*args
, **kwargs
)
10122 def CalcMin(*args
, **kwargs
):
10124 CalcMin(self) -> Size
10126 Calculates the minimum desired size for the item, including any space
10129 return _core_
.SizerItem_CalcMin(*args
, **kwargs
)
10131 def SetDimension(*args
, **kwargs
):
10133 SetDimension(self, Point pos, Size size)
10135 Set the position and size of the space allocated for this item by the
10136 sizer, and adjust the position and size of the item (window or
10137 subsizer) to be within that space taking alignment and borders into
10140 return _core_
.SizerItem_SetDimension(*args
, **kwargs
)
10142 def GetMinSize(*args
, **kwargs
):
10144 GetMinSize(self) -> Size
10146 Get the minimum size needed for the item.
10148 return _core_
.SizerItem_GetMinSize(*args
, **kwargs
)
10150 def GetMinSizeWithBorder(*args
, **kwargs
):
10152 GetMinSizeWithBorder(self) -> Size
10154 Get the minimum size needed for the item with space for the borders
10157 return _core_
.SizerItem_GetMinSizeWithBorder(*args
, **kwargs
)
10159 def SetInitSize(*args
, **kwargs
):
10160 """SetInitSize(self, int x, int y)"""
10161 return _core_
.SizerItem_SetInitSize(*args
, **kwargs
)
10163 def SetRatioWH(*args
, **kwargs
):
10165 SetRatioWH(self, int width, int height)
10167 Set the ratio item attribute.
10169 return _core_
.SizerItem_SetRatioWH(*args
, **kwargs
)
10171 def SetRatioSize(*args
, **kwargs
):
10173 SetRatioSize(self, Size size)
10175 Set the ratio item attribute.
10177 return _core_
.SizerItem_SetRatioSize(*args
, **kwargs
)
10179 def SetRatio(*args
, **kwargs
):
10181 SetRatio(self, float ratio)
10183 Set the ratio item attribute.
10185 return _core_
.SizerItem_SetRatio(*args
, **kwargs
)
10187 def GetRatio(*args
, **kwargs
):
10189 GetRatio(self) -> float
10191 Set the ratio item attribute.
10193 return _core_
.SizerItem_GetRatio(*args
, **kwargs
)
10195 def GetRect(*args
, **kwargs
):
10197 GetRect(self) -> Rect
10199 Returns the rectangle that the sizer item should occupy
10201 return _core_
.SizerItem_GetRect(*args
, **kwargs
)
10203 def IsWindow(*args
, **kwargs
):
10205 IsWindow(self) -> bool
10207 Is this sizer item a window?
10209 return _core_
.SizerItem_IsWindow(*args
, **kwargs
)
10211 def IsSizer(*args
, **kwargs
):
10213 IsSizer(self) -> bool
10215 Is this sizer item a subsizer?
10217 return _core_
.SizerItem_IsSizer(*args
, **kwargs
)
10219 def IsSpacer(*args
, **kwargs
):
10221 IsSpacer(self) -> bool
10223 Is this sizer item a spacer?
10225 return _core_
.SizerItem_IsSpacer(*args
, **kwargs
)
10227 def SetProportion(*args
, **kwargs
):
10229 SetProportion(self, int proportion)
10231 Set the proportion value for this item.
10233 return _core_
.SizerItem_SetProportion(*args
, **kwargs
)
10235 def GetProportion(*args
, **kwargs
):
10237 GetProportion(self) -> int
10239 Get the proportion value for this item.
10241 return _core_
.SizerItem_GetProportion(*args
, **kwargs
)
10243 SetOption
= wx
._deprecated
(SetProportion
, "Please use `SetProportion` instead.")
10244 GetOption
= wx
._deprecated
(GetProportion
, "Please use `GetProportion` instead.")
10245 def SetFlag(*args
, **kwargs
):
10247 SetFlag(self, int flag)
10249 Set the flag value for this item.
10251 return _core_
.SizerItem_SetFlag(*args
, **kwargs
)
10253 def GetFlag(*args
, **kwargs
):
10255 GetFlag(self) -> int
10257 Get the flag value for this item.
10259 return _core_
.SizerItem_GetFlag(*args
, **kwargs
)
10261 def SetBorder(*args
, **kwargs
):
10263 SetBorder(self, int border)
10265 Set the border value for this item.
10267 return _core_
.SizerItem_SetBorder(*args
, **kwargs
)
10269 def GetBorder(*args
, **kwargs
):
10271 GetBorder(self) -> int
10273 Get the border value for this item.
10275 return _core_
.SizerItem_GetBorder(*args
, **kwargs
)
10277 def GetWindow(*args
, **kwargs
):
10279 GetWindow(self) -> Window
10281 Get the window (if any) that is managed by this sizer item.
10283 return _core_
.SizerItem_GetWindow(*args
, **kwargs
)
10285 def SetWindow(*args
, **kwargs
):
10287 SetWindow(self, Window window)
10289 Set the window to be managed by this sizer item.
10291 return _core_
.SizerItem_SetWindow(*args
, **kwargs
)
10293 def GetSizer(*args
, **kwargs
):
10295 GetSizer(self) -> Sizer
10297 Get the subsizer (if any) that is managed by this sizer item.
10299 return _core_
.SizerItem_GetSizer(*args
, **kwargs
)
10301 def SetSizer(*args
, **kwargs
):
10303 SetSizer(self, Sizer sizer)
10305 Set the subsizer to be managed by this sizer item.
10307 return _core_
.SizerItem_SetSizer(*args
, **kwargs
)
10309 def GetSpacer(*args
, **kwargs
):
10311 GetSpacer(self) -> Size
10313 Get the size of the spacer managed by this sizer item.
10315 return _core_
.SizerItem_GetSpacer(*args
, **kwargs
)
10317 def SetSpacer(*args
, **kwargs
):
10319 SetSpacer(self, Size size)
10321 Set the size of the spacer to be managed by this sizer item.
10323 return _core_
.SizerItem_SetSpacer(*args
, **kwargs
)
10325 def Show(*args
, **kwargs
):
10327 Show(self, bool show)
10329 Set the show item attribute, which sizers use to determine if the item
10330 is to be made part of the layout or not. If the item is tracking a
10331 window then it is shown or hidden as needed.
10333 return _core_
.SizerItem_Show(*args
, **kwargs
)
10335 def IsShown(*args
, **kwargs
):
10337 IsShown(self) -> bool
10339 Is the item to be shown in the layout?
10341 return _core_
.SizerItem_IsShown(*args
, **kwargs
)
10343 def GetPosition(*args
, **kwargs
):
10345 GetPosition(self) -> Point
10347 Returns the current position of the item, as set in the last Layout.
10349 return _core_
.SizerItem_GetPosition(*args
, **kwargs
)
10351 def GetUserData(*args
, **kwargs
):
10353 GetUserData(self) -> PyObject
10355 Returns the userData associated with this sizer item, or None if there
10358 return _core_
.SizerItem_GetUserData(*args
, **kwargs
)
10361 class SizerItemPtr(SizerItem
):
10362 def __init__(self
, this
):
10364 if not hasattr(self
,"thisown"): self
.thisown
= 0
10365 self
.__class
__ = SizerItem
10366 _core_
.SizerItem_swigregister(SizerItemPtr
)
10368 def SizerItemWindow(*args
, **kwargs
):
10370 SizerItemWindow(Window window, int proportion, int flag, int border,
10371 PyObject userData=None) -> SizerItem
10373 Constructs a `wx.SizerItem` for tracking a window.
10375 val
= _core_
.new_SizerItemWindow(*args
, **kwargs
)
10379 def SizerItemSpacer(*args
, **kwargs
):
10381 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10382 PyObject userData=None) -> SizerItem
10384 Constructs a `wx.SizerItem` for tracking a spacer.
10386 val
= _core_
.new_SizerItemSpacer(*args
, **kwargs
)
10390 def SizerItemSizer(*args
, **kwargs
):
10392 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10393 PyObject userData=None) -> SizerItem
10395 Constructs a `wx.SizerItem` for tracking a subsizer
10397 val
= _core_
.new_SizerItemSizer(*args
, **kwargs
)
10401 class Sizer(Object
):
10403 wx.Sizer is the abstract base class used for laying out subwindows in
10404 a window. You cannot use wx.Sizer directly; instead, you will have to
10405 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10406 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10407 and `wx.GridBagSizer`.
10409 The concept implemented by sizers in wxWidgets is closely related to
10410 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10411 toolkit or the Qt toolkit. It is based upon the idea of the individual
10412 subwindows reporting their minimal required size and their ability to
10413 get stretched if the size of the parent window has changed. This will
10414 most often mean that the programmer does not set the original size of
10415 a dialog in the beginning, rather the dialog will assigned a sizer and
10416 this sizer will be queried about the recommended size. The sizer in
10417 turn will query its children, which can be normal windows or contorls,
10418 empty space or other sizers, so that a hierarchy of sizers can be
10419 constructed. Note that wxSizer does not derive from wxWindow and thus
10420 do not interfere with tab ordering and requires very little resources
10421 compared to a real window on screen.
10423 What makes sizers so well fitted for use in wxWidgets is the fact that
10424 every control reports its own minimal size and the algorithm can
10425 handle differences in font sizes or different window (dialog item)
10426 sizes on different platforms without problems. If for example the
10427 standard font as well as the overall design of Mac widgets requires
10428 more space than on Windows, then the initial size of a dialog using a
10429 sizer will automatically be bigger on Mac than on Windows.
10431 def __init__(self
): raise RuntimeError, "No constructor defined"
10432 def __repr__(self
):
10433 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10434 def _setOORInfo(*args
, **kwargs
):
10435 """_setOORInfo(self, PyObject _self)"""
10436 return _core_
.Sizer__setOORInfo(*args
, **kwargs
)
10438 def Add(*args
, **kwargs
):
10440 Add(self, item, int proportion=0, int flag=0, int border=0,
10441 PyObject userData=None) -> wx.SizerItem
10443 Appends a child item to the sizer.
10445 return _core_
.Sizer_Add(*args
, **kwargs
)
10447 def Insert(*args
, **kwargs
):
10449 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
10450 PyObject userData=None) -> wx.SizerItem
10452 Inserts a new item into the list of items managed by this sizer before
10453 the item at index *before*. See `Add` for a description of the parameters.
10455 return _core_
.Sizer_Insert(*args
, **kwargs
)
10457 def Prepend(*args
, **kwargs
):
10459 Prepend(self, item, int proportion=0, int flag=0, int border=0,
10460 PyObject userData=None) -> wx.SizerItem
10462 Adds a new item to the begining of the list of sizer items managed by
10463 this sizer. See `Add` for a description of the parameters.
10465 return _core_
.Sizer_Prepend(*args
, **kwargs
)
10467 def Remove(*args
, **kwargs
):
10469 Remove(self, item) -> bool
10471 Removes an item from the sizer and destroys it. This method does not
10472 cause any layout or resizing to take place, call `Layout` to update
10473 the layout on screen after removing a child from the sizer. The
10474 *item* parameter can be either a window, a sizer, or the zero-based
10475 index of an item to remove. Returns True if the child item was found
10478 return _core_
.Sizer_Remove(*args
, **kwargs
)
10480 def Detach(*args
, **kwargs
):
10482 Detach(self, item) -> bool
10484 Detaches an item from the sizer without destroying it. This method
10485 does not cause any layout or resizing to take place, call `Layout` to
10486 do so. The *item* parameter can be either a window, a sizer, or the
10487 zero-based index of the item to be detached. Returns True if the child item
10488 was found and detached.
10490 return _core_
.Sizer_Detach(*args
, **kwargs
)
10492 def GetItem(*args
, **kwargs
):
10494 GetItem(self, item) -> wx.SizerItem
10496 Returns the `wx.SizerItem` which holds the *item* given. The *item*
10497 parameter can be either a window, a sizer, or the zero-based index of
10498 the item to be detached.
10500 return _core_
.Sizer_GetItem(*args
, **kwargs
)
10502 def _SetItemMinSize(*args
, **kwargs
):
10503 """_SetItemMinSize(self, PyObject item, Size size)"""
10504 return _core_
.Sizer__SetItemMinSize(*args
, **kwargs
)
10506 def SetItemMinSize(self
, item
, *args
):
10508 SetItemMinSize(self, item, Size size)
10510 Sets the minimum size that will be allocated for an item in the sizer.
10511 The *item* parameter can be either a window, a sizer, or the
10512 zero-based index of the item. If a window or sizer is given then it
10513 will be searched for recursivly in subsizers if neccessary.
10516 # for backward compatibility accept separate width,height args too
10517 return self
._SetItemMinSize
(item
, args
)
10519 return self
._SetItemMinSize
(item
, args
[0])
10521 def AddItem(*args
, **kwargs
):
10523 AddItem(self, SizerItem item)
10525 Adds a `wx.SizerItem` to the sizer.
10527 return _core_
.Sizer_AddItem(*args
, **kwargs
)
10529 def InsertItem(*args
, **kwargs
):
10531 InsertItem(self, int index, SizerItem item)
10533 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
10535 return _core_
.Sizer_InsertItem(*args
, **kwargs
)
10537 def PrependItem(*args
, **kwargs
):
10539 PrependItem(self, SizerItem item)
10541 Prepends a `wx.SizerItem` to the sizer.
10543 return _core_
.Sizer_PrependItem(*args
, **kwargs
)
10545 def AddMany(self
, items
):
10547 AddMany is a convenience method for adding several items
10548 to a sizer at one time. Simply pass it a list of tuples,
10549 where each tuple consists of the parameters that you
10550 would normally pass to the `Add` method.
10553 if type(item
) != type(()) or (len(item
) == 2 and type(item
[0]) == type(1)):
10557 # for backwards compatibility only, please do not use in new code
10558 def AddWindow(self
, *args
, **kw
):
10559 """Compatibility alias for `Add`."""
10560 return self
.Add(*args
, **kw
)
10561 def AddSizer(self
, *args
, **kw
):
10562 """Compatibility alias for `Add`."""
10563 return self
.Add(*args
, **kw
)
10564 def AddSpacer(self
, *args
, **kw
):
10565 """Compatibility alias for `Add`."""
10566 return self
.Add(*args
, **kw
)
10568 def PrependWindow(self
, *args
, **kw
):
10569 """Compatibility alias for `Prepend`."""
10570 return self
.Prepend(*args
, **kw
)
10571 def PrependSizer(self
, *args
, **kw
):
10572 """Compatibility alias for `Prepend`."""
10573 return self
.Prepend(*args
, **kw
)
10574 def PrependSpacer(self
, *args
, **kw
):
10575 """Compatibility alias for `Prepend`."""
10576 return self
.Prepend(*args
, **kw
)
10578 def InsertWindow(self
, *args
, **kw
):
10579 """Compatibility alias for `Insert`."""
10580 return self
.Insert(*args
, **kw
)
10581 def InsertSizer(self
, *args
, **kw
):
10582 """Compatibility alias for `Insert`."""
10583 return self
.Insert(*args
, **kw
)
10584 def InsertSpacer(self
, *args
, **kw
):
10585 """Compatibility alias for `Insert`."""
10586 return self
.Insert(*args
, **kw
)
10588 def RemoveWindow(self
, *args
, **kw
):
10589 """Compatibility alias for `Remove`."""
10590 return self
.Remove(*args
, **kw
)
10591 def RemoveSizer(self
, *args
, **kw
):
10592 """Compatibility alias for `Remove`."""
10593 return self
.Remove(*args
, **kw
)
10594 def RemovePos(self
, *args
, **kw
):
10595 """Compatibility alias for `Remove`."""
10596 return self
.Remove(*args
, **kw
)
10599 def SetDimension(*args
, **kwargs
):
10601 SetDimension(self, int x, int y, int width, int height)
10603 Call this to force the sizer to take the given dimension and thus
10604 force the items owned by the sizer to resize themselves according to
10605 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
10608 return _core_
.Sizer_SetDimension(*args
, **kwargs
)
10610 def SetMinSize(*args
, **kwargs
):
10612 SetMinSize(self, Size size)
10614 Call this to give the sizer a minimal size. Normally, the sizer will
10615 calculate its minimal size based purely on how much space its children
10616 need. After calling this method `GetMinSize` will return either the
10617 minimal size as requested by its children or the minimal size set
10618 here, depending on which is bigger.
10620 return _core_
.Sizer_SetMinSize(*args
, **kwargs
)
10622 def GetSize(*args
, **kwargs
):
10624 GetSize(self) -> Size
10626 Returns the current size of the space managed by the sizer.
10628 return _core_
.Sizer_GetSize(*args
, **kwargs
)
10630 def GetPosition(*args
, **kwargs
):
10632 GetPosition(self) -> Point
10634 Returns the current position of the sizer's managed space.
10636 return _core_
.Sizer_GetPosition(*args
, **kwargs
)
10638 def GetMinSize(*args
, **kwargs
):
10640 GetMinSize(self) -> Size
10642 Returns the minimal size of the sizer. This is either the combined
10643 minimal size of all the children and their borders or the minimal size
10644 set by SetMinSize, depending on which is bigger.
10646 return _core_
.Sizer_GetMinSize(*args
, **kwargs
)
10648 def GetSizeTuple(self
):
10649 return self
.GetSize().Get()
10650 def GetPositionTuple(self
):
10651 return self
.GetPosition().Get()
10652 def GetMinSizeTuple(self
):
10653 return self
.GetMinSize().Get()
10655 def RecalcSizes(*args
, **kwargs
):
10659 Using the sizes calculated by `CalcMin` reposition and resize all the
10660 items managed by this sizer. You should not need to call this directly as
10661 it is called by `Layout`.
10663 return _core_
.Sizer_RecalcSizes(*args
, **kwargs
)
10665 def CalcMin(*args
, **kwargs
):
10667 CalcMin(self) -> Size
10669 This method is where the sizer will do the actual calculation of its
10670 children's minimal sizes. You should not need to call this directly as
10671 it is called by `Layout`.
10673 return _core_
.Sizer_CalcMin(*args
, **kwargs
)
10675 def Layout(*args
, **kwargs
):
10679 This method will force the recalculation and layout of the items
10680 controlled by the sizer using the current space allocated to the
10681 sizer. Normally this is called automatically from the owning window's
10682 EVT_SIZE handler, but it is also useful to call it from user code when
10683 one of the items in a sizer change size, or items are added or
10686 return _core_
.Sizer_Layout(*args
, **kwargs
)
10688 def Fit(*args
, **kwargs
):
10690 Fit(self, Window window) -> Size
10692 Tell the sizer to resize the *window* to match the sizer's minimal
10693 size. This is commonly done in the constructor of the window itself in
10694 order to set its initial size to match the needs of the children as
10695 determined by the sizer. Returns the new size.
10697 For a top level window this is the total window size, not the client size.
10699 return _core_
.Sizer_Fit(*args
, **kwargs
)
10701 def FitInside(*args
, **kwargs
):
10703 FitInside(self, Window window)
10705 Tell the sizer to resize the *virtual size* of the *window* to match the
10706 sizer's minimal size. This will not alter the on screen size of the
10707 window, but may cause the addition/removal/alteration of scrollbars
10708 required to view the virtual area in windows which manage it.
10710 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
10713 return _core_
.Sizer_FitInside(*args
, **kwargs
)
10715 def SetSizeHints(*args
, **kwargs
):
10717 SetSizeHints(self, Window window)
10719 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
10720 match the sizer's minimal size. This is commonly done in the
10721 constructor of the window itself if the window is resizable (as are
10722 many dialogs under Unix and frames on probably all platforms) in order
10723 to prevent the window from being sized smaller than the minimal size
10724 required by the sizer.
10726 return _core_
.Sizer_SetSizeHints(*args
, **kwargs
)
10728 def SetVirtualSizeHints(*args
, **kwargs
):
10730 SetVirtualSizeHints(self, Window window)
10732 Tell the sizer to set the minimal size of the window virtual area to
10733 match the sizer's minimal size. For windows with managed scrollbars
10734 this will set them appropriately.
10736 :see: `wx.ScrolledWindow.SetScrollbars`
10739 return _core_
.Sizer_SetVirtualSizeHints(*args
, **kwargs
)
10741 def Clear(*args
, **kwargs
):
10743 Clear(self, bool deleteWindows=False)
10745 Clear all items from the sizer, optionally destroying the window items
10748 return _core_
.Sizer_Clear(*args
, **kwargs
)
10750 def DeleteWindows(*args
, **kwargs
):
10752 DeleteWindows(self)
10754 Destroy all windows managed by the sizer.
10756 return _core_
.Sizer_DeleteWindows(*args
, **kwargs
)
10758 def GetChildren(*args
, **kwargs
):
10760 GetChildren(self) -> list
10762 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
10764 return _core_
.Sizer_GetChildren(*args
, **kwargs
)
10766 def Show(*args
, **kwargs
):
10768 Show(self, item, bool show=True, bool recursive=false) -> bool
10770 Shows or hides an item managed by the sizer. To make a sizer item
10771 disappear or reappear, use Show followed by `Layout`. The *item*
10772 parameter can be either a window, a sizer, or the zero-based index of
10773 the item. Use the recursive parameter to show or hide an item in a
10774 subsizer. Returns True if the item was found.
10776 return _core_
.Sizer_Show(*args
, **kwargs
)
10778 def IsShown(*args
, **kwargs
):
10780 IsShown(self, item)
10782 Determines if the item is currently shown. sizer. To make a sizer
10783 item disappear or reappear, use Show followed by `Layout`. The *item*
10784 parameter can be either a window, a sizer, or the zero-based index of
10787 return _core_
.Sizer_IsShown(*args
, **kwargs
)
10789 def Hide(self
, item
, recursive
=False):
10791 A convenience method for `Show` (item, False, recursive).
10793 return self
.Show(item
, False, recursive
)
10795 def ShowItems(*args
, **kwargs
):
10797 ShowItems(self, bool show)
10799 Recursively call `wx.SizerItem.Show` on all sizer items.
10801 return _core_
.Sizer_ShowItems(*args
, **kwargs
)
10804 class SizerPtr(Sizer
):
10805 def __init__(self
, this
):
10807 if not hasattr(self
,"thisown"): self
.thisown
= 0
10808 self
.__class
__ = Sizer
10809 _core_
.Sizer_swigregister(SizerPtr
)
10811 class PySizer(Sizer
):
10813 wx.PySizer is a special version of `wx.Sizer` that has been
10814 instrumented to allow the C++ virtual methods to be overloaded in
10815 Python derived classes. You would derive from this class if you are
10816 wanting to implement a custom sizer in Python code. Simply implement
10817 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
10820 class MySizer(wx.PySizer):
10821 def __init__(self):
10822 wx.PySizer.__init__(self)
10825 for item in self.GetChildren():
10826 # calculate the total minimum width and height needed
10827 # by all items in the sizer according to this sizer's
10828 # layout algorithm.
10830 return wx.Size(width, height)
10832 def RecalcSizes(self):
10833 # find the space allotted to this sizer
10834 pos = self.GetPosition()
10835 size = self.GetSize()
10836 for item in self.GetChildren():
10837 # Recalculate (if necessary) the position and size of
10838 # each item and then call item.SetDimension to do the
10839 # actual positioning and sizing of the items within the
10840 # space alloted to this sizer.
10842 item.SetDimension(itemPos, itemSize)
10845 When `Layout` is called it first calls `CalcMin` followed by
10846 `RecalcSizes` so you can optimize a bit by saving the results of
10847 `CalcMin` and reusing them in `RecalcSizes`.
10849 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
10853 def __repr__(self
):
10854 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10855 def __init__(self
, *args
, **kwargs
):
10857 __init__(self) -> PySizer
10859 Creates a wx.PySizer. Must be called from the __init__ in the derived
10862 newobj
= _core_
.new_PySizer(*args
, **kwargs
)
10863 self
.this
= newobj
.this
10866 self
._setCallbackInfo
(self
, PySizer
);self
._setOORInfo
(self
)
10868 def _setCallbackInfo(*args
, **kwargs
):
10869 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
10870 return _core_
.PySizer__setCallbackInfo(*args
, **kwargs
)
10873 class PySizerPtr(PySizer
):
10874 def __init__(self
, this
):
10876 if not hasattr(self
,"thisown"): self
.thisown
= 0
10877 self
.__class
__ = PySizer
10878 _core_
.PySizer_swigregister(PySizerPtr
)
10880 #---------------------------------------------------------------------------
10882 class BoxSizer(Sizer
):
10884 The basic idea behind a box sizer is that windows will most often be
10885 laid out in rather simple basic geometry, typically in a row or a
10886 column or nested hierarchies of either. A wx.BoxSizer will lay out
10887 its items in a simple row or column, depending on the orientation
10888 parameter passed to the constructor.
10890 def __repr__(self
):
10891 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10892 def __init__(self
, *args
, **kwargs
):
10894 __init__(self, int orient=HORIZONTAL) -> BoxSizer
10896 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
10897 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
10900 newobj
= _core_
.new_BoxSizer(*args
, **kwargs
)
10901 self
.this
= newobj
.this
10904 self
._setOORInfo
(self
)
10906 def GetOrientation(*args
, **kwargs
):
10908 GetOrientation(self) -> int
10910 Returns the current orientation of the sizer.
10912 return _core_
.BoxSizer_GetOrientation(*args
, **kwargs
)
10914 def SetOrientation(*args
, **kwargs
):
10916 SetOrientation(self, int orient)
10918 Resets the orientation of the sizer.
10920 return _core_
.BoxSizer_SetOrientation(*args
, **kwargs
)
10923 class BoxSizerPtr(BoxSizer
):
10924 def __init__(self
, this
):
10926 if not hasattr(self
,"thisown"): self
.thisown
= 0
10927 self
.__class
__ = BoxSizer
10928 _core_
.BoxSizer_swigregister(BoxSizerPtr
)
10930 #---------------------------------------------------------------------------
10932 class StaticBoxSizer(BoxSizer
):
10934 wx.StaticBoxSizer derives from and functions identically to the
10935 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
10936 manages. Note that this static box must be created separately and
10937 passed to the sizer constructor.
10939 def __repr__(self
):
10940 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10941 def __init__(self
, *args
, **kwargs
):
10943 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
10945 Constructor. It takes an associated static box and the orientation
10946 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
10949 newobj
= _core_
.new_StaticBoxSizer(*args
, **kwargs
)
10950 self
.this
= newobj
.this
10953 self
._setOORInfo
(self
)
10955 def GetStaticBox(*args
, **kwargs
):
10957 GetStaticBox(self) -> StaticBox
10959 Returns the static box associated with this sizer.
10961 return _core_
.StaticBoxSizer_GetStaticBox(*args
, **kwargs
)
10964 class StaticBoxSizerPtr(StaticBoxSizer
):
10965 def __init__(self
, this
):
10967 if not hasattr(self
,"thisown"): self
.thisown
= 0
10968 self
.__class
__ = StaticBoxSizer
10969 _core_
.StaticBoxSizer_swigregister(StaticBoxSizerPtr
)
10971 #---------------------------------------------------------------------------
10973 class GridSizer(Sizer
):
10975 A grid sizer is a sizer which lays out its children in a
10976 two-dimensional table with all cells having the same size. In other
10977 words, the width of each cell within the grid is the width of the
10978 widest item added to the sizer and the height of each grid cell is the
10979 height of the tallest item. An optional vertical and/or horizontal
10980 gap between items can also be specified (in pixels.)
10982 Items are placed in the cells of the grid in the order they are added,
10983 in row-major order. In other words, the first row is filled first,
10984 then the second, and so on until all items have been added. (If
10985 neccessary, additional rows will be added as items are added.) If you
10986 need to have greater control over the cells that items are placed in
10987 then use the `wx.GridBagSizer`.
10990 def __repr__(self
):
10991 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
10992 def __init__(self
, *args
, **kwargs
):
10994 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
10996 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
10997 of columns and rows in the sizer - if either of the parameters is
10998 zero, it will be calculated to from the total number of children in
10999 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11000 define extra space between all children.
11002 newobj
= _core_
.new_GridSizer(*args
, **kwargs
)
11003 self
.this
= newobj
.this
11006 self
._setOORInfo
(self
)
11008 def SetCols(*args
, **kwargs
):
11010 SetCols(self, int cols)
11012 Sets the number of columns in the sizer.
11014 return _core_
.GridSizer_SetCols(*args
, **kwargs
)
11016 def SetRows(*args
, **kwargs
):
11018 SetRows(self, int rows)
11020 Sets the number of rows in the sizer.
11022 return _core_
.GridSizer_SetRows(*args
, **kwargs
)
11024 def SetVGap(*args
, **kwargs
):
11026 SetVGap(self, int gap)
11028 Sets the vertical gap (in pixels) between the cells in the sizer.
11030 return _core_
.GridSizer_SetVGap(*args
, **kwargs
)
11032 def SetHGap(*args
, **kwargs
):
11034 SetHGap(self, int gap)
11036 Sets the horizontal gap (in pixels) between cells in the sizer
11038 return _core_
.GridSizer_SetHGap(*args
, **kwargs
)
11040 def GetCols(*args
, **kwargs
):
11042 GetCols(self) -> int
11044 Returns the number of columns in the sizer.
11046 return _core_
.GridSizer_GetCols(*args
, **kwargs
)
11048 def GetRows(*args
, **kwargs
):
11050 GetRows(self) -> int
11052 Returns the number of rows in the sizer.
11054 return _core_
.GridSizer_GetRows(*args
, **kwargs
)
11056 def GetVGap(*args
, **kwargs
):
11058 GetVGap(self) -> int
11060 Returns the vertical gap (in pixels) between the cells in the sizer.
11062 return _core_
.GridSizer_GetVGap(*args
, **kwargs
)
11064 def GetHGap(*args
, **kwargs
):
11066 GetHGap(self) -> int
11068 Returns the horizontal gap (in pixels) between cells in the sizer.
11070 return _core_
.GridSizer_GetHGap(*args
, **kwargs
)
11073 class GridSizerPtr(GridSizer
):
11074 def __init__(self
, this
):
11076 if not hasattr(self
,"thisown"): self
.thisown
= 0
11077 self
.__class
__ = GridSizer
11078 _core_
.GridSizer_swigregister(GridSizerPtr
)
11080 #---------------------------------------------------------------------------
11082 FLEX_GROWMODE_NONE
= _core_
.FLEX_GROWMODE_NONE
11083 FLEX_GROWMODE_SPECIFIED
= _core_
.FLEX_GROWMODE_SPECIFIED
11084 FLEX_GROWMODE_ALL
= _core_
.FLEX_GROWMODE_ALL
11085 class FlexGridSizer(GridSizer
):
11087 A flex grid sizer is a sizer which lays out its children in a
11088 two-dimensional table with all table cells in one row having the same
11089 height and all cells in one column having the same width, but all
11090 rows or all columns are not necessarily the same height or width as in
11091 the `wx.GridSizer`.
11093 wx.FlexGridSizer can also size items equally in one direction but
11094 unequally ("flexibly") in the other. If the sizer is only flexible
11095 in one direction (this can be changed using `SetFlexibleDirection`), it
11096 needs to be decided how the sizer should grow in the other ("non
11097 flexible") direction in order to fill the available space. The
11098 `SetNonFlexibleGrowMode` method serves this purpose.
11102 def __repr__(self
):
11103 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11104 def __init__(self
, *args
, **kwargs
):
11106 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11108 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11109 number of columns and rows in the sizer - if either of the parameters
11110 is zero, it will be calculated to from the total number of children in
11111 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11112 define extra space between all children.
11114 newobj
= _core_
.new_FlexGridSizer(*args
, **kwargs
)
11115 self
.this
= newobj
.this
11118 self
._setOORInfo
(self
)
11120 def AddGrowableRow(*args
, **kwargs
):
11122 AddGrowableRow(self, size_t idx, int proportion=0)
11124 Specifies that row *idx* (starting from zero) should be grown if there
11125 is extra space available to the sizer.
11127 The *proportion* parameter has the same meaning as the stretch factor
11128 for the box sizers except that if all proportions are 0, then all
11129 columns are resized equally (instead of not being resized at all).
11131 return _core_
.FlexGridSizer_AddGrowableRow(*args
, **kwargs
)
11133 def RemoveGrowableRow(*args
, **kwargs
):
11135 RemoveGrowableRow(self, size_t idx)
11137 Specifies that row *idx* is no longer growable.
11139 return _core_
.FlexGridSizer_RemoveGrowableRow(*args
, **kwargs
)
11141 def AddGrowableCol(*args
, **kwargs
):
11143 AddGrowableCol(self, size_t idx, int proportion=0)
11145 Specifies that column *idx* (starting from zero) should be grown if
11146 there is extra space available to the sizer.
11148 The *proportion* parameter has the same meaning as the stretch factor
11149 for the box sizers except that if all proportions are 0, then all
11150 columns are resized equally (instead of not being resized at all).
11152 return _core_
.FlexGridSizer_AddGrowableCol(*args
, **kwargs
)
11154 def RemoveGrowableCol(*args
, **kwargs
):
11156 RemoveGrowableCol(self, size_t idx)
11158 Specifies that column *idx* is no longer growable.
11160 return _core_
.FlexGridSizer_RemoveGrowableCol(*args
, **kwargs
)
11162 def SetFlexibleDirection(*args
, **kwargs
):
11164 SetFlexibleDirection(self, int direction)
11166 Specifies whether the sizer should flexibly resize its columns, rows,
11167 or both. Argument *direction* can be one of the following values. Any
11168 other value is ignored.
11170 ============== =======================================
11171 wx.VERTICAL Rows are flexibly sized.
11172 wx.HORIZONTAL Columns are flexibly sized.
11173 wx.BOTH Both rows and columns are flexibly sized
11174 (this is the default value).
11175 ============== =======================================
11177 Note that this method does not trigger relayout.
11180 return _core_
.FlexGridSizer_SetFlexibleDirection(*args
, **kwargs
)
11182 def GetFlexibleDirection(*args
, **kwargs
):
11184 GetFlexibleDirection(self) -> int
11186 Returns a value that specifies whether the sizer
11187 flexibly resizes its columns, rows, or both (default).
11189 :see: `SetFlexibleDirection`
11191 return _core_
.FlexGridSizer_GetFlexibleDirection(*args
, **kwargs
)
11193 def SetNonFlexibleGrowMode(*args
, **kwargs
):
11195 SetNonFlexibleGrowMode(self, int mode)
11197 Specifies how the sizer should grow in the non-flexible direction if
11198 there is one (so `SetFlexibleDirection` must have been called
11199 previously). Argument *mode* can be one of the following values:
11201 ========================== =================================================
11202 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11203 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11204 `AddGrowableCol` and `AddGrowableRow`. In this
11205 case equal sizing applies to minimum sizes of
11206 columns or rows (this is the default value).
11207 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11208 the non flexible direction, whether they are
11209 growable or not in the flexbile direction.
11210 ========================== =================================================
11212 Note that this method does not trigger relayout.
11216 return _core_
.FlexGridSizer_SetNonFlexibleGrowMode(*args
, **kwargs
)
11218 def GetNonFlexibleGrowMode(*args
, **kwargs
):
11220 GetNonFlexibleGrowMode(self) -> int
11222 Returns the value that specifies how the sizer grows in the
11223 non-flexible direction if there is one.
11225 :see: `SetNonFlexibleGrowMode`
11227 return _core_
.FlexGridSizer_GetNonFlexibleGrowMode(*args
, **kwargs
)
11229 def GetRowHeights(*args
, **kwargs
):
11231 GetRowHeights(self) -> list
11233 Returns a list of integers representing the heights of each of the
11236 return _core_
.FlexGridSizer_GetRowHeights(*args
, **kwargs
)
11238 def GetColWidths(*args
, **kwargs
):
11240 GetColWidths(self) -> list
11242 Returns a list of integers representing the widths of each of the
11243 columns in the sizer.
11245 return _core_
.FlexGridSizer_GetColWidths(*args
, **kwargs
)
11248 class FlexGridSizerPtr(FlexGridSizer
):
11249 def __init__(self
, this
):
11251 if not hasattr(self
,"thisown"): self
.thisown
= 0
11252 self
.__class
__ = FlexGridSizer
11253 _core_
.FlexGridSizer_swigregister(FlexGridSizerPtr
)
11255 class StdDialogButtonSizer(BoxSizer
):
11257 A special sizer that knows how to order and position standard buttons
11258 in order to conform to the current platform's standards. You simply
11259 need to add each `wx.Button` to the sizer, and be sure to create the
11260 buttons using the standard ID's. Then call `Realize` and the sizer
11261 will take care of the rest.
11264 def __repr__(self
):
11265 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11266 def __init__(self
, *args
, **kwargs
):
11267 """__init__(self) -> StdDialogButtonSizer"""
11268 newobj
= _core_
.new_StdDialogButtonSizer(*args
, **kwargs
)
11269 self
.this
= newobj
.this
11272 def AddButton(*args
, **kwargs
):
11274 AddButton(self, wxButton button)
11276 Use this to add the buttons to this sizer. Do not use the `Add`
11277 method in the base class.
11279 return _core_
.StdDialogButtonSizer_AddButton(*args
, **kwargs
)
11281 def Realize(*args
, **kwargs
):
11285 This funciton needs to be called after all the buttons have been added
11286 to the sizer. It will reorder them and position them in a platform
11289 return _core_
.StdDialogButtonSizer_Realize(*args
, **kwargs
)
11291 def SetAffirmativeButton(*args
, **kwargs
):
11292 """SetAffirmativeButton(self, wxButton button)"""
11293 return _core_
.StdDialogButtonSizer_SetAffirmativeButton(*args
, **kwargs
)
11295 def SetNegativeButton(*args
, **kwargs
):
11296 """SetNegativeButton(self, wxButton button)"""
11297 return _core_
.StdDialogButtonSizer_SetNegativeButton(*args
, **kwargs
)
11299 def SetCancelButton(*args
, **kwargs
):
11300 """SetCancelButton(self, wxButton button)"""
11301 return _core_
.StdDialogButtonSizer_SetCancelButton(*args
, **kwargs
)
11303 def GetAffirmativeButton(*args
, **kwargs
):
11304 """GetAffirmativeButton(self) -> wxButton"""
11305 return _core_
.StdDialogButtonSizer_GetAffirmativeButton(*args
, **kwargs
)
11307 def GetApplyButton(*args
, **kwargs
):
11308 """GetApplyButton(self) -> wxButton"""
11309 return _core_
.StdDialogButtonSizer_GetApplyButton(*args
, **kwargs
)
11311 def GetNegativeButton(*args
, **kwargs
):
11312 """GetNegativeButton(self) -> wxButton"""
11313 return _core_
.StdDialogButtonSizer_GetNegativeButton(*args
, **kwargs
)
11315 def GetCancelButton(*args
, **kwargs
):
11316 """GetCancelButton(self) -> wxButton"""
11317 return _core_
.StdDialogButtonSizer_GetCancelButton(*args
, **kwargs
)
11319 def GetHelpButton(*args
, **kwargs
):
11320 """GetHelpButton(self) -> wxButton"""
11321 return _core_
.StdDialogButtonSizer_GetHelpButton(*args
, **kwargs
)
11324 class StdDialogButtonSizerPtr(StdDialogButtonSizer
):
11325 def __init__(self
, this
):
11327 if not hasattr(self
,"thisown"): self
.thisown
= 0
11328 self
.__class
__ = StdDialogButtonSizer
11329 _core_
.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr
)
11331 #---------------------------------------------------------------------------
11333 class GBPosition(object):
11335 This class represents the position of an item in a virtual grid of
11336 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11337 typemaps that will automatically convert from a 2-element sequence of
11338 integers to a wx.GBPosition, so you can use the more pythonic
11339 representation of the position nearly transparently in Python code.
11341 def __repr__(self
):
11342 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11343 def __init__(self
, *args
, **kwargs
):
11345 __init__(self, int row=0, int col=0) -> GBPosition
11347 This class represents the position of an item in a virtual grid of
11348 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11349 typemaps that will automatically convert from a 2-element sequence of
11350 integers to a wx.GBPosition, so you can use the more pythonic
11351 representation of the position nearly transparently in Python code.
11353 newobj
= _core_
.new_GBPosition(*args
, **kwargs
)
11354 self
.this
= newobj
.this
11357 def GetRow(*args
, **kwargs
):
11358 """GetRow(self) -> int"""
11359 return _core_
.GBPosition_GetRow(*args
, **kwargs
)
11361 def GetCol(*args
, **kwargs
):
11362 """GetCol(self) -> int"""
11363 return _core_
.GBPosition_GetCol(*args
, **kwargs
)
11365 def SetRow(*args
, **kwargs
):
11366 """SetRow(self, int row)"""
11367 return _core_
.GBPosition_SetRow(*args
, **kwargs
)
11369 def SetCol(*args
, **kwargs
):
11370 """SetCol(self, int col)"""
11371 return _core_
.GBPosition_SetCol(*args
, **kwargs
)
11373 def __eq__(*args
, **kwargs
):
11374 """__eq__(self, GBPosition other) -> bool"""
11375 return _core_
.GBPosition___eq__(*args
, **kwargs
)
11377 def __ne__(*args
, **kwargs
):
11378 """__ne__(self, GBPosition other) -> bool"""
11379 return _core_
.GBPosition___ne__(*args
, **kwargs
)
11381 def Set(*args
, **kwargs
):
11382 """Set(self, int row=0, int col=0)"""
11383 return _core_
.GBPosition_Set(*args
, **kwargs
)
11385 def Get(*args
, **kwargs
):
11386 """Get(self) -> PyObject"""
11387 return _core_
.GBPosition_Get(*args
, **kwargs
)
11389 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
11390 def __str__(self
): return str(self
.Get())
11391 def __repr__(self
): return 'wx.GBPosition'+str(self
.Get())
11392 def __len__(self
): return len(self
.Get())
11393 def __getitem__(self
, index
): return self
.Get()[index
]
11394 def __setitem__(self
, index
, val
):
11395 if index
== 0: self
.SetRow(val
)
11396 elif index
== 1: self
.SetCol(val
)
11397 else: raise IndexError
11398 def __nonzero__(self
): return self
.Get() != (0,0)
11399 __safe_for_unpickling__
= True
11400 def __reduce__(self
): return (wx
.GBPosition
, self
.Get())
11402 row
= property(GetRow
, SetRow
)
11403 col
= property(GetCol
, SetCol
)
11406 class GBPositionPtr(GBPosition
):
11407 def __init__(self
, this
):
11409 if not hasattr(self
,"thisown"): self
.thisown
= 0
11410 self
.__class
__ = GBPosition
11411 _core_
.GBPosition_swigregister(GBPositionPtr
)
11413 class GBSpan(object):
11415 This class is used to hold the row and column spanning attributes of
11416 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11417 automatically convert from a 2-element sequence of integers to a
11418 wx.GBSpan, so you can use the more pythonic representation of the span
11419 nearly transparently in Python code.
11422 def __repr__(self
):
11423 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11424 def __init__(self
, *args
, **kwargs
):
11426 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11428 Construct a new wxGBSpan, optionally setting the rowspan and
11429 colspan. The default is (1,1). (Meaning that the item occupies one
11430 cell in each direction.
11432 newobj
= _core_
.new_GBSpan(*args
, **kwargs
)
11433 self
.this
= newobj
.this
11436 def GetRowspan(*args
, **kwargs
):
11437 """GetRowspan(self) -> int"""
11438 return _core_
.GBSpan_GetRowspan(*args
, **kwargs
)
11440 def GetColspan(*args
, **kwargs
):
11441 """GetColspan(self) -> int"""
11442 return _core_
.GBSpan_GetColspan(*args
, **kwargs
)
11444 def SetRowspan(*args
, **kwargs
):
11445 """SetRowspan(self, int rowspan)"""
11446 return _core_
.GBSpan_SetRowspan(*args
, **kwargs
)
11448 def SetColspan(*args
, **kwargs
):
11449 """SetColspan(self, int colspan)"""
11450 return _core_
.GBSpan_SetColspan(*args
, **kwargs
)
11452 def __eq__(*args
, **kwargs
):
11453 """__eq__(self, GBSpan other) -> bool"""
11454 return _core_
.GBSpan___eq__(*args
, **kwargs
)
11456 def __ne__(*args
, **kwargs
):
11457 """__ne__(self, GBSpan other) -> bool"""
11458 return _core_
.GBSpan___ne__(*args
, **kwargs
)
11460 def Set(*args
, **kwargs
):
11461 """Set(self, int rowspan=1, int colspan=1)"""
11462 return _core_
.GBSpan_Set(*args
, **kwargs
)
11464 def Get(*args
, **kwargs
):
11465 """Get(self) -> PyObject"""
11466 return _core_
.GBSpan_Get(*args
, **kwargs
)
11468 asTuple
= wx
._deprecated
(Get
, "asTuple is deprecated, use `Get` instead")
11469 def __str__(self
): return str(self
.Get())
11470 def __repr__(self
): return 'wx.GBSpan'+str(self
.Get())
11471 def __len__(self
): return len(self
.Get())
11472 def __getitem__(self
, index
): return self
.Get()[index
]
11473 def __setitem__(self
, index
, val
):
11474 if index
== 0: self
.SetRowspan(val
)
11475 elif index
== 1: self
.SetColspan(val
)
11476 else: raise IndexError
11477 def __nonzero__(self
): return self
.Get() != (0,0)
11478 __safe_for_unpickling__
= True
11479 def __reduce__(self
): return (wx
.GBSpan
, self
.Get())
11481 rowspan
= property(GetRowspan
, SetRowspan
)
11482 colspan
= property(GetColspan
, SetColspan
)
11485 class GBSpanPtr(GBSpan
):
11486 def __init__(self
, this
):
11488 if not hasattr(self
,"thisown"): self
.thisown
= 0
11489 self
.__class
__ = GBSpan
11490 _core_
.GBSpan_swigregister(GBSpanPtr
)
11492 class GBSizerItem(SizerItem
):
11494 The wx.GBSizerItem class is used to track the additional data about
11495 items in a `wx.GridBagSizer` such as the item's position in the grid
11496 and how many rows or columns it spans.
11499 def __repr__(self
):
11500 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11501 def __init__(self
, *args
, **kwargs
):
11503 __init__(self) -> GBSizerItem
11505 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
11506 size will need to be set, as well as a position and span before this
11507 item can be used in a Sizer.
11509 You will probably never need to create a wx.GBSizerItem directly as they
11510 are created automatically when the sizer's Add method is called.
11512 newobj
= _core_
.new_GBSizerItem(*args
, **kwargs
)
11513 self
.this
= newobj
.this
11516 def GetPos(*args
, **kwargs
):
11518 GetPos(self) -> GBPosition
11520 Get the grid position of the item
11522 return _core_
.GBSizerItem_GetPos(*args
, **kwargs
)
11524 def GetPosTuple(self
): return self
.GetPos().Get()
11525 def GetSpan(*args
, **kwargs
):
11527 GetSpan(self) -> GBSpan
11529 Get the row and column spanning of the item
11531 return _core_
.GBSizerItem_GetSpan(*args
, **kwargs
)
11533 def GetSpanTuple(self
): return self
.GetSpan().Get()
11534 def SetPos(*args
, **kwargs
):
11536 SetPos(self, GBPosition pos) -> bool
11538 If the item is already a member of a sizer then first ensure that
11539 there is no other item that would intersect with this one at the new
11540 position, then set the new position. Returns True if the change is
11541 successful and after the next Layout() the item will be moved.
11543 return _core_
.GBSizerItem_SetPos(*args
, **kwargs
)
11545 def SetSpan(*args
, **kwargs
):
11547 SetSpan(self, GBSpan span) -> bool
11549 If the item is already a member of a sizer then first ensure that
11550 there is no other item that would intersect with this one with its new
11551 spanning size, then set the new spanning. Returns True if the change
11552 is successful and after the next Layout() the item will be resized.
11555 return _core_
.GBSizerItem_SetSpan(*args
, **kwargs
)
11557 def Intersects(*args
, **kwargs
):
11559 Intersects(self, GBSizerItem other) -> bool
11561 Returns True if this item and the other item instersect.
11563 return _core_
.GBSizerItem_Intersects(*args
, **kwargs
)
11565 def IntersectsPos(*args
, **kwargs
):
11567 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
11569 Returns True if the given pos/span would intersect with this item.
11571 return _core_
.GBSizerItem_IntersectsPos(*args
, **kwargs
)
11573 def GetEndPos(*args
, **kwargs
):
11575 GetEndPos(self) -> GBPosition
11577 Get the row and column of the endpoint of this item.
11579 return _core_
.GBSizerItem_GetEndPos(*args
, **kwargs
)
11581 def GetGBSizer(*args
, **kwargs
):
11583 GetGBSizer(self) -> GridBagSizer
11585 Get the sizer this item is a member of.
11587 return _core_
.GBSizerItem_GetGBSizer(*args
, **kwargs
)
11589 def SetGBSizer(*args
, **kwargs
):
11591 SetGBSizer(self, GridBagSizer sizer)
11593 Set the sizer this item is a member of.
11595 return _core_
.GBSizerItem_SetGBSizer(*args
, **kwargs
)
11598 class GBSizerItemPtr(GBSizerItem
):
11599 def __init__(self
, this
):
11601 if not hasattr(self
,"thisown"): self
.thisown
= 0
11602 self
.__class
__ = GBSizerItem
11603 _core_
.GBSizerItem_swigregister(GBSizerItemPtr
)
11604 DefaultSpan
= cvar
.DefaultSpan
11606 def GBSizerItemWindow(*args
, **kwargs
):
11608 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
11609 int border, PyObject userData=None) -> GBSizerItem
11611 Construct a `wx.GBSizerItem` for a window.
11613 val
= _core_
.new_GBSizerItemWindow(*args
, **kwargs
)
11617 def GBSizerItemSizer(*args
, **kwargs
):
11619 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
11620 int border, PyObject userData=None) -> GBSizerItem
11622 Construct a `wx.GBSizerItem` for a sizer
11624 val
= _core_
.new_GBSizerItemSizer(*args
, **kwargs
)
11628 def GBSizerItemSpacer(*args
, **kwargs
):
11630 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
11631 int flag, int border, PyObject userData=None) -> GBSizerItem
11633 Construct a `wx.GBSizerItem` for a spacer.
11635 val
= _core_
.new_GBSizerItemSpacer(*args
, **kwargs
)
11639 class GridBagSizer(FlexGridSizer
):
11641 A `wx.Sizer` that can lay out items in a virtual grid like a
11642 `wx.FlexGridSizer` but in this case explicit positioning of the items
11643 is allowed using `wx.GBPosition`, and items can optionally span more
11644 than one row and/or column using `wx.GBSpan`. The total size of the
11645 virtual grid is determined by the largest row and column that items are
11646 positioned at, adjusted for spanning.
11649 def __repr__(self
):
11650 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11651 def __init__(self
, *args
, **kwargs
):
11653 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
11655 Constructor, with optional parameters to specify the gap between the
11658 newobj
= _core_
.new_GridBagSizer(*args
, **kwargs
)
11659 self
.this
= newobj
.this
11662 self
._setOORInfo
(self
)
11664 def Add(*args
, **kwargs
):
11666 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
11667 int border=0, userData=None) -> wx.GBSizerItem
11669 Adds an item to the sizer at the grid cell *pos*, optionally spanning
11670 more than one row or column as specified with *span*. The remaining
11671 args behave similarly to `wx.Sizer.Add`.
11673 Returns True if the item was successfully placed at the given cell
11674 position, False if something was already there.
11677 return _core_
.GridBagSizer_Add(*args
, **kwargs
)
11679 def AddItem(*args
, **kwargs
):
11681 Add(self, GBSizerItem item) -> wx.GBSizerItem
11683 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
11684 the item was successfully placed at its given cell position, False if
11685 something was already there.
11687 return _core_
.GridBagSizer_AddItem(*args
, **kwargs
)
11689 def GetCellSize(*args
, **kwargs
):
11691 GetCellSize(self, int row, int col) -> Size
11693 Get the size of the specified cell, including hgap and
11694 vgap. Only valid after a Layout.
11696 return _core_
.GridBagSizer_GetCellSize(*args
, **kwargs
)
11698 def GetEmptyCellSize(*args
, **kwargs
):
11700 GetEmptyCellSize(self) -> Size
11702 Get the size used for cells in the grid with no item.
11704 return _core_
.GridBagSizer_GetEmptyCellSize(*args
, **kwargs
)
11706 def SetEmptyCellSize(*args
, **kwargs
):
11708 SetEmptyCellSize(self, Size sz)
11710 Set the size used for cells in the grid with no item.
11712 return _core_
.GridBagSizer_SetEmptyCellSize(*args
, **kwargs
)
11714 def GetItemPosition(*args
):
11716 GetItemPosition(self, item) -> GBPosition
11718 Get the grid position of the specified *item* where *item* is either a
11719 window or subsizer that is a member of this sizer, or a zero-based
11722 return _core_
.GridBagSizer_GetItemPosition(*args
)
11724 def SetItemPosition(*args
):
11726 SetItemPosition(self, item, GBPosition pos) -> bool
11728 Set the grid position of the specified *item* where *item* is either a
11729 window or subsizer that is a member of this sizer, or a zero-based
11730 index of an item. Returns True on success. If the move is not
11731 allowed (because an item is already there) then False is returned.
11734 return _core_
.GridBagSizer_SetItemPosition(*args
)
11736 def GetItemSpan(*args
):
11738 GetItemSpan(self, item) -> GBSpan
11740 Get the row/col spanning of the specified *item* where *item* is
11741 either a window or subsizer that is a member of this sizer, or a
11742 zero-based index of an item.
11744 return _core_
.GridBagSizer_GetItemSpan(*args
)
11746 def SetItemSpan(*args
):
11748 SetItemSpan(self, item, GBSpan span) -> bool
11750 Set the row/col spanning of the specified *item* where *item* is
11751 either a window or subsizer that is a member of this sizer, or a
11752 zero-based index of an item. Returns True on success. If the move is
11753 not allowed (because an item is already there) then False is returned.
11755 return _core_
.GridBagSizer_SetItemSpan(*args
)
11757 def FindItem(*args
):
11759 FindItem(self, item) -> GBSizerItem
11761 Find the sizer item for the given window or subsizer, returns None if
11762 not found. (non-recursive)
11764 return _core_
.GridBagSizer_FindItem(*args
)
11766 def FindItemAtPosition(*args
, **kwargs
):
11768 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
11770 Return the sizer item for the given grid cell, or None if there is no
11771 item at that position. (non-recursive)
11773 return _core_
.GridBagSizer_FindItemAtPosition(*args
, **kwargs
)
11775 def FindItemAtPoint(*args
, **kwargs
):
11777 FindItemAtPoint(self, Point pt) -> GBSizerItem
11779 Return the sizer item located at the point given in *pt*, or None if
11780 there is no item at that point. The (x,y) coordinates in pt correspond
11781 to the client coordinates of the window using the sizer for
11782 layout. (non-recursive)
11784 return _core_
.GridBagSizer_FindItemAtPoint(*args
, **kwargs
)
11786 def CheckForIntersection(*args
, **kwargs
):
11788 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
11790 Look at all items and see if any intersect (or would overlap) the
11791 given *item*. Returns True if so, False if there would be no overlap.
11792 If an *excludeItem* is given then it will not be checked for
11793 intersection, for example it may be the item we are checking the
11797 return _core_
.GridBagSizer_CheckForIntersection(*args
, **kwargs
)
11799 def CheckForIntersectionPos(*args
, **kwargs
):
11801 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
11803 Look at all items and see if any intersect (or would overlap) the
11804 given position and span. Returns True if so, False if there would be
11805 no overlap. If an *excludeItem* is given then it will not be checked
11806 for intersection, for example it may be the item we are checking the
11809 return _core_
.GridBagSizer_CheckForIntersectionPos(*args
, **kwargs
)
11812 class GridBagSizerPtr(GridBagSizer
):
11813 def __init__(self
, this
):
11815 if not hasattr(self
,"thisown"): self
.thisown
= 0
11816 self
.__class
__ = GridBagSizer
11817 _core_
.GridBagSizer_swigregister(GridBagSizerPtr
)
11819 #---------------------------------------------------------------------------
11823 Right
= _core_
.Right
11824 Bottom
= _core_
.Bottom
11825 Width
= _core_
.Width
11826 Height
= _core_
.Height
11827 Centre
= _core_
.Centre
11828 Center
= _core_
.Center
11829 CentreX
= _core_
.CentreX
11830 CentreY
= _core_
.CentreY
11831 Unconstrained
= _core_
.Unconstrained
11833 PercentOf
= _core_
.PercentOf
11834 Above
= _core_
.Above
11835 Below
= _core_
.Below
11836 LeftOf
= _core_
.LeftOf
11837 RightOf
= _core_
.RightOf
11838 SameAs
= _core_
.SameAs
11839 Absolute
= _core_
.Absolute
11840 class IndividualLayoutConstraint(Object
):
11842 Objects of this class are stored in the `wx.LayoutConstraints` class as
11843 one of eight possible constraints that a window can be involved in.
11844 You will never need to create an instance of
11845 wx.IndividualLayoutConstraint, rather you should create a
11846 `wx.LayoutConstraints` instance and use the individual contstraints
11849 def __init__(self
): raise RuntimeError, "No constructor defined"
11850 def __repr__(self
):
11851 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
11852 def Set(*args
, **kwargs
):
11854 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
11856 Sets the properties of the constraint. Normally called by one of the
11857 convenience functions such as Above, RightOf, SameAs.
11859 return _core_
.IndividualLayoutConstraint_Set(*args
, **kwargs
)
11861 def LeftOf(*args
, **kwargs
):
11863 LeftOf(self, Window sibling, int marg=0)
11865 Constrains this edge to be to the left of the given window, with an
11866 optional margin. Implicitly, this is relative to the left edge of the
11869 return _core_
.IndividualLayoutConstraint_LeftOf(*args
, **kwargs
)
11871 def RightOf(*args
, **kwargs
):
11873 RightOf(self, Window sibling, int marg=0)
11875 Constrains this edge to be to the right of the given window, with an
11876 optional margin. Implicitly, this is relative to the right edge of the
11879 return _core_
.IndividualLayoutConstraint_RightOf(*args
, **kwargs
)
11881 def Above(*args
, **kwargs
):
11883 Above(self, Window sibling, int marg=0)
11885 Constrains this edge to be above the given window, with an optional
11886 margin. Implicitly, this is relative to the top edge of the other
11889 return _core_
.IndividualLayoutConstraint_Above(*args
, **kwargs
)
11891 def Below(*args
, **kwargs
):
11893 Below(self, Window sibling, int marg=0)
11895 Constrains this edge to be below the given window, with an optional
11896 margin. Implicitly, this is relative to the bottom edge of the other
11899 return _core_
.IndividualLayoutConstraint_Below(*args
, **kwargs
)
11901 def SameAs(*args
, **kwargs
):
11903 SameAs(self, Window otherW, int edge, int marg=0)
11905 Constrains this edge or dimension to be to the same as the edge of the
11906 given window, with an optional margin.
11908 return _core_
.IndividualLayoutConstraint_SameAs(*args
, **kwargs
)
11910 def PercentOf(*args
, **kwargs
):
11912 PercentOf(self, Window otherW, int wh, int per)
11914 Constrains this edge or dimension to be to a percentage of the given
11915 window, with an optional margin.
11917 return _core_
.IndividualLayoutConstraint_PercentOf(*args
, **kwargs
)
11919 def Absolute(*args
, **kwargs
):
11921 Absolute(self, int val)
11923 Constrains this edge or dimension to be the given absolute value.
11925 return _core_
.IndividualLayoutConstraint_Absolute(*args
, **kwargs
)
11927 def Unconstrained(*args
, **kwargs
):
11929 Unconstrained(self)
11931 Sets this edge or dimension to be unconstrained, that is, dependent on
11932 other edges and dimensions from which this value can be deduced.
11934 return _core_
.IndividualLayoutConstraint_Unconstrained(*args
, **kwargs
)
11936 def AsIs(*args
, **kwargs
):
11940 Sets this edge or constraint to be whatever the window's value is at
11941 the moment. If either of the width and height constraints are *as is*,
11942 the window will not be resized, but moved instead. This is important
11943 when considering panel items which are intended to have a default
11944 size, such as a button, which may take its size from the size of the
11947 return _core_
.IndividualLayoutConstraint_AsIs(*args
, **kwargs
)
11949 def GetOtherWindow(*args
, **kwargs
):
11950 """GetOtherWindow(self) -> Window"""
11951 return _core_
.IndividualLayoutConstraint_GetOtherWindow(*args
, **kwargs
)
11953 def GetMyEdge(*args
, **kwargs
):
11954 """GetMyEdge(self) -> int"""
11955 return _core_
.IndividualLayoutConstraint_GetMyEdge(*args
, **kwargs
)
11957 def SetEdge(*args
, **kwargs
):
11958 """SetEdge(self, int which)"""
11959 return _core_
.IndividualLayoutConstraint_SetEdge(*args
, **kwargs
)
11961 def SetValue(*args
, **kwargs
):
11962 """SetValue(self, int v)"""
11963 return _core_
.IndividualLayoutConstraint_SetValue(*args
, **kwargs
)
11965 def GetMargin(*args
, **kwargs
):
11966 """GetMargin(self) -> int"""
11967 return _core_
.IndividualLayoutConstraint_GetMargin(*args
, **kwargs
)
11969 def SetMargin(*args
, **kwargs
):
11970 """SetMargin(self, int m)"""
11971 return _core_
.IndividualLayoutConstraint_SetMargin(*args
, **kwargs
)
11973 def GetValue(*args
, **kwargs
):
11974 """GetValue(self) -> int"""
11975 return _core_
.IndividualLayoutConstraint_GetValue(*args
, **kwargs
)
11977 def GetPercent(*args
, **kwargs
):
11978 """GetPercent(self) -> int"""
11979 return _core_
.IndividualLayoutConstraint_GetPercent(*args
, **kwargs
)
11981 def GetOtherEdge(*args
, **kwargs
):
11982 """GetOtherEdge(self) -> int"""
11983 return _core_
.IndividualLayoutConstraint_GetOtherEdge(*args
, **kwargs
)
11985 def GetDone(*args
, **kwargs
):
11986 """GetDone(self) -> bool"""
11987 return _core_
.IndividualLayoutConstraint_GetDone(*args
, **kwargs
)
11989 def SetDone(*args
, **kwargs
):
11990 """SetDone(self, bool d)"""
11991 return _core_
.IndividualLayoutConstraint_SetDone(*args
, **kwargs
)
11993 def GetRelationship(*args
, **kwargs
):
11994 """GetRelationship(self) -> int"""
11995 return _core_
.IndividualLayoutConstraint_GetRelationship(*args
, **kwargs
)
11997 def SetRelationship(*args
, **kwargs
):
11998 """SetRelationship(self, int r)"""
11999 return _core_
.IndividualLayoutConstraint_SetRelationship(*args
, **kwargs
)
12001 def ResetIfWin(*args
, **kwargs
):
12003 ResetIfWin(self, Window otherW) -> bool
12005 Reset constraint if it mentions otherWin
12007 return _core_
.IndividualLayoutConstraint_ResetIfWin(*args
, **kwargs
)
12009 def SatisfyConstraint(*args
, **kwargs
):
12011 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12013 Try to satisfy constraint
12015 return _core_
.IndividualLayoutConstraint_SatisfyConstraint(*args
, **kwargs
)
12017 def GetEdge(*args
, **kwargs
):
12019 GetEdge(self, int which, Window thisWin, Window other) -> int
12021 Get the value of this edge or dimension, or if this
12022 is not determinable, -1.
12024 return _core_
.IndividualLayoutConstraint_GetEdge(*args
, **kwargs
)
12027 class IndividualLayoutConstraintPtr(IndividualLayoutConstraint
):
12028 def __init__(self
, this
):
12030 if not hasattr(self
,"thisown"): self
.thisown
= 0
12031 self
.__class
__ = IndividualLayoutConstraint
12032 _core_
.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr
)
12034 class LayoutConstraints(Object
):
12036 **Note:** constraints are now deprecated and you should use sizers
12039 Objects of this class can be associated with a window to define its
12040 layout constraints, with respect to siblings or its parent.
12042 The class consists of the following eight constraints of class
12043 wx.IndividualLayoutConstraint, some or all of which should be accessed
12044 directly to set the appropriate constraints.
12046 * left: represents the left hand edge of the window
12047 * right: represents the right hand edge of the window
12048 * top: represents the top edge of the window
12049 * bottom: represents the bottom edge of the window
12050 * width: represents the width of the window
12051 * height: represents the height of the window
12052 * centreX: represents the horizontal centre point of the window
12053 * centreY: represents the vertical centre point of the window
12055 Most constraints are initially set to have the relationship
12056 wxUnconstrained, which means that their values should be calculated by
12057 looking at known constraints. The exceptions are width and height,
12058 which are set to wxAsIs to ensure that if the user does not specify a
12059 constraint, the existing width and height will be used, to be
12060 compatible with panel items which often have take a default size. If
12061 the constraint is ``wx.AsIs``, the dimension will not be changed.
12063 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
12066 def __repr__(self
):
12067 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self
.__class
__.__module
__, self
.__class
__.__name
__, self
.this
,)
12068 left
= property(_core_
.LayoutConstraints_left_get
)
12069 top
= property(_core_
.LayoutConstraints_top_get
)
12070 right
= property(_core_
.LayoutConstraints_right_get
)
12071 bottom
= property(_core_
.LayoutConstraints_bottom_get
)
12072 width
= property(_core_
.LayoutConstraints_width_get
)
12073 height
= property(_core_
.LayoutConstraints_height_get
)
12074 centreX
= property(_core_
.LayoutConstraints_centreX_get
)
12075 centreY
= property(_core_
.LayoutConstraints_centreY_get
)
12076 def __init__(self
, *args
, **kwargs
):
12077 """__init__(self) -> LayoutConstraints"""
12078 newobj
= _core_
.new_LayoutConstraints(*args
, **kwargs
)
12079 self
.this
= newobj
.this
12082 def SatisfyConstraints(*args
, **kwargs
):
12083 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12084 return _core_
.LayoutConstraints_SatisfyConstraints(*args
, **kwargs
)
12086 def AreSatisfied(*args
, **kwargs
):
12087 """AreSatisfied(self) -> bool"""
12088 return _core_
.LayoutConstraints_AreSatisfied(*args
, **kwargs
)
12091 class LayoutConstraintsPtr(LayoutConstraints
):
12092 def __init__(self
, this
):
12094 if not hasattr(self
,"thisown"): self
.thisown
= 0
12095 self
.__class
__ = LayoutConstraints
12096 _core_
.LayoutConstraints_swigregister(LayoutConstraintsPtr
)
12098 #----------------------------------------------------------------------------
12100 # Use Python's bool constants if available, make some if not
12104 __builtins__
.True = 1==1
12105 __builtins__
.False = 1==0
12106 def bool(value
): return not not value
12107 __builtins__
.bool = bool
12111 # workarounds for bad wxRTTI names
12112 __wxPyPtrTypeMap
['wxGauge95'] = 'wxGauge'
12113 __wxPyPtrTypeMap
['wxSlider95'] = 'wxSlider'
12114 __wxPyPtrTypeMap
['wxStatusBar95'] = 'wxStatusBar'
12117 #----------------------------------------------------------------------------
12118 # Load version numbers from __version__... Ensure that major and minor
12119 # versions are the same for both wxPython and wxWidgets.
12121 from __version__
import *
12122 __version__
= VERSION_STRING
12124 assert MAJOR_VERSION
== _core_
.MAJOR_VERSION
, "wxPython/wxWidgets version mismatch"
12125 assert MINOR_VERSION
== _core_
.MINOR_VERSION
, "wxPython/wxWidgets version mismatch"
12126 if RELEASE_VERSION
!= _core_
.RELEASE_VERSION
:
12128 warnings
.warn("wxPython/wxWidgets release number mismatch")
12130 #----------------------------------------------------------------------------
12132 # Set wxPython's default string<-->unicode conversion encoding from
12133 # the locale, but only if Python's default hasn't been changed. (We
12134 # assume that if the user has customized it already then that is the
12135 # encoding we need to use as well.)
12137 # The encoding selected here is used when string or unicode objects
12138 # need to be converted in order to pass them to wxWidgets. Please be
12139 # aware that the default encoding within the same locale may be
12140 # slightly different on different platforms. For example, please see
12141 # http://www.alanwood.net/demos/charsetdiffs.html for differences
12142 # between the common latin/roman encodings.
12144 default
= _sys
.getdefaultencoding()
12145 if default
== 'ascii':
12149 default
= locale
.getdefaultlocale()[1]
12150 codecs
.lookup(default
)
12151 except (ValueError, LookupError, TypeError):
12152 default
= _sys
.getdefaultencoding()
12156 wx
.SetDefaultPyEncoding(default
)
12159 #----------------------------------------------------------------------------
12161 class PyDeadObjectError(AttributeError):
12164 class _wxPyDeadObject(object):
12166 Instances of wx objects that are OOR capable will have their __class__
12167 changed to this class when the C++ object is deleted. This should help
12168 prevent crashes due to referencing a bogus C++ pointer.
12170 reprStr
= "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12171 attrStr
= "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12173 def __repr__(self
):
12174 if not hasattr(self
, "_name"):
12175 self
._name
= "[unknown]"
12176 return self
.reprStr
% self
._name
12178 def __getattr__(self
, *args
):
12179 if not hasattr(self
, "_name"):
12180 self
._name
= "[unknown]"
12181 raise PyDeadObjectError(self
.attrStr
% self
._name
)
12183 def __nonzero__(self
):
12188 class PyUnbornObjectError(AttributeError):
12191 class _wxPyUnbornObject(object):
12193 Some stock objects are created when the wx._core module is
12194 imported, but their C++ instance is not created until the wx.App
12195 object is created and initialized. These object instances will
12196 temporarily have their __class__ changed to this class so an
12197 exception will be raised if they are used before the C++ instance
12201 reprStr
= "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12202 attrStr
= "The C++ part of this object has not been initialized, attribute access not allowed."
12204 def __repr__(self
):
12205 #if not hasattr(self, "_name"):
12206 # self._name = "[unknown]"
12207 return self
.reprStr
#% self._name
12209 def __getattr__(self
, *args
):
12210 #if not hasattr(self, "_name"):
12211 # self._name = "[unknown]"
12212 raise PyUnbornObjectError(self
.attrStr
) # % self._name )
12214 def __nonzero__(self
):
12218 #----------------------------------------------------------------------------
12220 def CallAfter(callable, *args
, **kw
):
12222 Call the specified function after the current and pending event
12223 handlers have been completed. This is also good for making GUI
12224 method calls from non-GUI threads. Any extra positional or
12225 keyword args are passed on to the callable when it is called.
12227 :see: `wx.FutureCall`
12230 assert app
is not None, 'No wx.App created yet'
12232 if not hasattr(app
, "_CallAfterId"):
12233 app
._CallAfterId
= wx
.NewEventType()
12234 app
.Connect(-1, -1, app
._CallAfterId
,
12235 lambda event
: event
.callable(*event
.args
, **event
.kw
) )
12237 evt
.SetEventType(app
._CallAfterId
)
12238 evt
.callable = callable
12241 wx
.PostEvent(app
, evt
)
12243 #----------------------------------------------------------------------------
12248 A convenience class for `wx.Timer`, that calls the given callable
12249 object once after the given amount of milliseconds, passing any
12250 positional or keyword args. The return value of the callable is
12251 availbale after it has been run with the `GetResult` method.
12253 If you don't need to get the return value or restart the timer
12254 then there is no need to hold a reference to this object. It will
12255 hold a reference to itself while the timer is running (the timer
12256 has a reference to self.Notify) but the cycle will be broken when
12257 the timer completes, automatically cleaning up the wx.FutureCall
12260 :see: `wx.CallAfter`
12262 def __init__(self
, millis
, callable, *args
, **kwargs
):
12263 self
.millis
= millis
12264 self
.callable = callable
12265 self
.SetArgs(*args
, **kwargs
)
12267 self
.running
= False
12268 self
.hasRun
= False
12277 def Start(self
, millis
=None, *args
, **kwargs
):
12279 (Re)start the timer
12281 self
.hasRun
= False
12282 if millis
is not None:
12283 self
.millis
= millis
12285 self
.SetArgs(*args
, **kwargs
)
12287 self
.timer
= wx
.PyTimer(self
.Notify
)
12288 self
.timer
.Start(self
.millis
, wx
.TIMER_ONE_SHOT
)
12289 self
.running
= True
12295 Stop and destroy the timer.
12297 if self
.timer
is not None:
12302 def GetInterval(self
):
12303 if self
.timer
is not None:
12304 return self
.timer
.GetInterval()
12309 def IsRunning(self
):
12310 return self
.timer
is not None and self
.timer
.IsRunning()
12313 def SetArgs(self
, *args
, **kwargs
):
12315 (Re)set the args passed to the callable object. This is
12316 useful in conjunction with Restart if you want to schedule a
12317 new call to the same callable object but with different
12321 self
.kwargs
= kwargs
12327 def GetResult(self
):
12332 The timer has expired so call the callable.
12334 if self
.callable and getattr(self
.callable, 'im_self', True):
12336 self
.running
= False
12337 self
.result
= self
.callable(*self
.args
, **self
.kwargs
)
12339 if not self
.running
:
12340 # if it wasn't restarted, then cleanup
12341 wx
.CallAfter(self
.Stop
)
12345 #----------------------------------------------------------------------------
12346 # Control which items in this module should be documented by epydoc.
12347 # We allow only classes and functions, which will help reduce the size
12348 # of the docs by filtering out the zillions of constants, EVT objects,
12349 # and etc that don't make much sense by themselves, but are instead
12350 # documented (or will be) as part of the classes/functions/methods
12351 # where they should be used.
12355 A filter for epydoc that only allows non-Ptr classes and
12356 fucntions, in order to reduce the clutter in the API docs.
12358 def __init__(self
, globals):
12359 self
._globals
= globals
12361 def __call__(self
, name
):
12363 obj
= self
._globals
.get(name
, None)
12364 if type(obj
) not in [type, types
.ClassType
, types
.FunctionType
, types
.BuiltinFunctionType
]:
12366 if name
.startswith('_') or name
.endswith('Ptr') or name
.startswith('EVT'):
12370 #----------------------------------------------------------------------------
12371 #----------------------------------------------------------------------------
12373 # Import other modules in this package that should show up in the
12374 # "core" wx namespace
12376 from _windows
import *
12377 from _controls
import *
12378 from _misc
import *
12381 # Fixup the stock objects since they can't be used yet. (They will be
12382 # restored in wx.PyApp.OnInit.)
12383 _core_
._wxPyFixStockObjects
()
12385 #----------------------------------------------------------------------------
12386 #----------------------------------------------------------------------------