]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/msw/_core.py
log wxChoice events in the same format as wxComboBox ones to make it simpler to compa...
[wxWidgets.git] / wxPython / src / msw / _core.py
CommitLineData
7449af73 1# This file was created automatically by SWIG 1.3.27.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
4import _core_
5
093d3ff1
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
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
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _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
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
d55e5bfc
RD
47#// Give a reference to the dictionary of this module to the C++ extension
48#// code.
49_core_._wxPySetDictionary(vars())
50
51#// A little trick to make 'wx' be a reference to this module so wx.Names can
52#// be used here.
53import sys as _sys
54wx = _sys.modules[__name__]
55
c24da6d6
RD
56
57#----------------------------------------------------------------------------
58
59def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74#----------------------------------------------------------------------------
75
d55e5bfc
RD
76NOT_FOUND = _core_.NOT_FOUND
77VSCROLL = _core_.VSCROLL
78HSCROLL = _core_.HSCROLL
79CAPTION = _core_.CAPTION
80DOUBLE_BORDER = _core_.DOUBLE_BORDER
81SUNKEN_BORDER = _core_.SUNKEN_BORDER
82RAISED_BORDER = _core_.RAISED_BORDER
83BORDER = _core_.BORDER
84SIMPLE_BORDER = _core_.SIMPLE_BORDER
85STATIC_BORDER = _core_.STATIC_BORDER
86TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87NO_BORDER = _core_.NO_BORDER
57133d5c 88DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 89DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
d55e5bfc
RD
90TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
91WANTS_CHARS = _core_.WANTS_CHARS
92POPUP_WINDOW = _core_.POPUP_WINDOW
93CENTER_FRAME = _core_.CENTER_FRAME
94CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
95CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
d55e5bfc
RD
96CLIP_CHILDREN = _core_.CLIP_CHILDREN
97CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
98ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
99RETAINED = _core_.RETAINED
100BACKINGSTORE = _core_.BACKINGSTORE
101COLOURED = _core_.COLOURED
102FIXED_LENGTH = _core_.FIXED_LENGTH
103LB_NEEDED_SB = _core_.LB_NEEDED_SB
104LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
105LB_SORT = _core_.LB_SORT
106LB_SINGLE = _core_.LB_SINGLE
107LB_MULTIPLE = _core_.LB_MULTIPLE
108LB_EXTENDED = _core_.LB_EXTENDED
109LB_OWNERDRAW = _core_.LB_OWNERDRAW
110LB_HSCROLL = _core_.LB_HSCROLL
111PROCESS_ENTER = _core_.PROCESS_ENTER
112PASSWORD = _core_.PASSWORD
113CB_SIMPLE = _core_.CB_SIMPLE
114CB_DROPDOWN = _core_.CB_DROPDOWN
115CB_SORT = _core_.CB_SORT
116CB_READONLY = _core_.CB_READONLY
117RA_HORIZONTAL = _core_.RA_HORIZONTAL
118RA_VERTICAL = _core_.RA_VERTICAL
119RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
120RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 121RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
d55e5bfc
RD
122RB_GROUP = _core_.RB_GROUP
123RB_SINGLE = _core_.RB_SINGLE
d55e5bfc
RD
124SB_HORIZONTAL = _core_.SB_HORIZONTAL
125SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 126RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
d55e5bfc
RD
127ST_SIZEGRIP = _core_.ST_SIZEGRIP
128ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
129FLOOD_SURFACE = _core_.FLOOD_SURFACE
130FLOOD_BORDER = _core_.FLOOD_BORDER
131ODDEVEN_RULE = _core_.ODDEVEN_RULE
132WINDING_RULE = _core_.WINDING_RULE
133TOOL_TOP = _core_.TOOL_TOP
134TOOL_BOTTOM = _core_.TOOL_BOTTOM
135TOOL_LEFT = _core_.TOOL_LEFT
136TOOL_RIGHT = _core_.TOOL_RIGHT
137OK = _core_.OK
138YES_NO = _core_.YES_NO
139CANCEL = _core_.CANCEL
140YES = _core_.YES
141NO = _core_.NO
142NO_DEFAULT = _core_.NO_DEFAULT
143YES_DEFAULT = _core_.YES_DEFAULT
144ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
145ICON_HAND = _core_.ICON_HAND
146ICON_QUESTION = _core_.ICON_QUESTION
147ICON_INFORMATION = _core_.ICON_INFORMATION
148ICON_STOP = _core_.ICON_STOP
149ICON_ASTERISK = _core_.ICON_ASTERISK
150ICON_MASK = _core_.ICON_MASK
151ICON_WARNING = _core_.ICON_WARNING
152ICON_ERROR = _core_.ICON_ERROR
153FORWARD = _core_.FORWARD
154BACKWARD = _core_.BACKWARD
155RESET = _core_.RESET
156HELP = _core_.HELP
157MORE = _core_.MORE
158SETUP = _core_.SETUP
159SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
160SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
161SIZE_AUTO = _core_.SIZE_AUTO
162SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
163SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
9d7dfdff 164SIZE_FORCE = _core_.SIZE_FORCE
d55e5bfc
RD
165PORTRAIT = _core_.PORTRAIT
166LANDSCAPE = _core_.LANDSCAPE
167PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
168PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
169PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
170PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
171ID_ANY = _core_.ID_ANY
172ID_SEPARATOR = _core_.ID_SEPARATOR
9d7dfdff 173ID_NONE = _core_.ID_NONE
d55e5bfc
RD
174ID_LOWEST = _core_.ID_LOWEST
175ID_OPEN = _core_.ID_OPEN
176ID_CLOSE = _core_.ID_CLOSE
177ID_NEW = _core_.ID_NEW
178ID_SAVE = _core_.ID_SAVE
179ID_SAVEAS = _core_.ID_SAVEAS
180ID_REVERT = _core_.ID_REVERT
181ID_EXIT = _core_.ID_EXIT
182ID_UNDO = _core_.ID_UNDO
183ID_REDO = _core_.ID_REDO
184ID_HELP = _core_.ID_HELP
185ID_PRINT = _core_.ID_PRINT
186ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
187ID_PREVIEW = _core_.ID_PREVIEW
188ID_ABOUT = _core_.ID_ABOUT
189ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
190ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
191ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
192ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
193ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
194ID_PREFERENCES = _core_.ID_PREFERENCES
195ID_CUT = _core_.ID_CUT
196ID_COPY = _core_.ID_COPY
197ID_PASTE = _core_.ID_PASTE
198ID_CLEAR = _core_.ID_CLEAR
199ID_FIND = _core_.ID_FIND
200ID_DUPLICATE = _core_.ID_DUPLICATE
201ID_SELECTALL = _core_.ID_SELECTALL
202ID_DELETE = _core_.ID_DELETE
203ID_REPLACE = _core_.ID_REPLACE
204ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
205ID_PROPERTIES = _core_.ID_PROPERTIES
206ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
207ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
208ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
209ID_VIEW_LIST = _core_.ID_VIEW_LIST
210ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
211ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
212ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
213ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
214ID_FILE1 = _core_.ID_FILE1
215ID_FILE2 = _core_.ID_FILE2
216ID_FILE3 = _core_.ID_FILE3
217ID_FILE4 = _core_.ID_FILE4
218ID_FILE5 = _core_.ID_FILE5
219ID_FILE6 = _core_.ID_FILE6
220ID_FILE7 = _core_.ID_FILE7
221ID_FILE8 = _core_.ID_FILE8
222ID_FILE9 = _core_.ID_FILE9
223ID_OK = _core_.ID_OK
224ID_CANCEL = _core_.ID_CANCEL
225ID_APPLY = _core_.ID_APPLY
226ID_YES = _core_.ID_YES
227ID_NO = _core_.ID_NO
228ID_STATIC = _core_.ID_STATIC
229ID_FORWARD = _core_.ID_FORWARD
230ID_BACKWARD = _core_.ID_BACKWARD
231ID_DEFAULT = _core_.ID_DEFAULT
232ID_MORE = _core_.ID_MORE
233ID_SETUP = _core_.ID_SETUP
234ID_RESET = _core_.ID_RESET
235ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
236ID_YESTOALL = _core_.ID_YESTOALL
237ID_NOTOALL = _core_.ID_NOTOALL
238ID_ABORT = _core_.ID_ABORT
239ID_RETRY = _core_.ID_RETRY
240ID_IGNORE = _core_.ID_IGNORE
0f63ec68
RD
241ID_ADD = _core_.ID_ADD
242ID_REMOVE = _core_.ID_REMOVE
243ID_UP = _core_.ID_UP
244ID_DOWN = _core_.ID_DOWN
245ID_HOME = _core_.ID_HOME
246ID_REFRESH = _core_.ID_REFRESH
247ID_STOP = _core_.ID_STOP
248ID_INDEX = _core_.ID_INDEX
249ID_BOLD = _core_.ID_BOLD
250ID_ITALIC = _core_.ID_ITALIC
251ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
252ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
253ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
254ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
255ID_UNDERLINE = _core_.ID_UNDERLINE
256ID_INDENT = _core_.ID_INDENT
257ID_UNINDENT = _core_.ID_UNINDENT
258ID_ZOOM_100 = _core_.ID_ZOOM_100
259ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
260ID_ZOOM_IN = _core_.ID_ZOOM_IN
261ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
262ID_UNDELETE = _core_.ID_UNDELETE
263ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
d55e5bfc
RD
264ID_HIGHEST = _core_.ID_HIGHEST
265OPEN = _core_.OPEN
266SAVE = _core_.SAVE
267HIDE_READONLY = _core_.HIDE_READONLY
268OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
269FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
270MULTIPLE = _core_.MULTIPLE
271CHANGE_DIR = _core_.CHANGE_DIR
272ACCEL_ALT = _core_.ACCEL_ALT
273ACCEL_CTRL = _core_.ACCEL_CTRL
274ACCEL_SHIFT = _core_.ACCEL_SHIFT
275ACCEL_NORMAL = _core_.ACCEL_NORMAL
276PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
277PD_APP_MODAL = _core_.PD_APP_MODAL
278PD_CAN_ABORT = _core_.PD_CAN_ABORT
279PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
280PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
281PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
62d32a5f
RD
282PD_SMOOTH = _core_.PD_SMOOTH
283PD_CAN_SKIP = _core_.PD_CAN_SKIP
d55e5bfc
RD
284DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
285DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
286MENU_TEAROFF = _core_.MENU_TEAROFF
287MB_DOCKABLE = _core_.MB_DOCKABLE
288NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
289FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
290LI_HORIZONTAL = _core_.LI_HORIZONTAL
291LI_VERTICAL = _core_.LI_VERTICAL
292WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
293WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
294WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
295WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
296WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
297WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
298MM_TEXT = _core_.MM_TEXT
299MM_LOMETRIC = _core_.MM_LOMETRIC
300MM_HIMETRIC = _core_.MM_HIMETRIC
301MM_LOENGLISH = _core_.MM_LOENGLISH
302MM_HIENGLISH = _core_.MM_HIENGLISH
303MM_TWIPS = _core_.MM_TWIPS
304MM_ISOTROPIC = _core_.MM_ISOTROPIC
305MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
306MM_POINTS = _core_.MM_POINTS
307MM_METRIC = _core_.MM_METRIC
308CENTRE = _core_.CENTRE
309CENTER = _core_.CENTER
310HORIZONTAL = _core_.HORIZONTAL
311VERTICAL = _core_.VERTICAL
312BOTH = _core_.BOTH
313LEFT = _core_.LEFT
314RIGHT = _core_.RIGHT
315UP = _core_.UP
316DOWN = _core_.DOWN
317TOP = _core_.TOP
318BOTTOM = _core_.BOTTOM
319NORTH = _core_.NORTH
320SOUTH = _core_.SOUTH
321WEST = _core_.WEST
322EAST = _core_.EAST
323ALL = _core_.ALL
324ALIGN_NOT = _core_.ALIGN_NOT
325ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
326ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
327ALIGN_LEFT = _core_.ALIGN_LEFT
328ALIGN_TOP = _core_.ALIGN_TOP
329ALIGN_RIGHT = _core_.ALIGN_RIGHT
330ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
331ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
332ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
333ALIGN_CENTER = _core_.ALIGN_CENTER
334ALIGN_CENTRE = _core_.ALIGN_CENTRE
335ALIGN_MASK = _core_.ALIGN_MASK
336STRETCH_NOT = _core_.STRETCH_NOT
337SHRINK = _core_.SHRINK
338GROW = _core_.GROW
339EXPAND = _core_.EXPAND
340SHAPED = _core_.SHAPED
341FIXED_MINSIZE = _core_.FIXED_MINSIZE
342TILE = _core_.TILE
343ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
344BORDER_DEFAULT = _core_.BORDER_DEFAULT
345BORDER_NONE = _core_.BORDER_NONE
346BORDER_STATIC = _core_.BORDER_STATIC
347BORDER_SIMPLE = _core_.BORDER_SIMPLE
348BORDER_RAISED = _core_.BORDER_RAISED
349BORDER_SUNKEN = _core_.BORDER_SUNKEN
350BORDER_DOUBLE = _core_.BORDER_DOUBLE
351BORDER_MASK = _core_.BORDER_MASK
0f63ec68
RD
352BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
353BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
354BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
d55e5bfc
RD
355DEFAULT = _core_.DEFAULT
356DECORATIVE = _core_.DECORATIVE
357ROMAN = _core_.ROMAN
358SCRIPT = _core_.SCRIPT
359SWISS = _core_.SWISS
360MODERN = _core_.MODERN
361TELETYPE = _core_.TELETYPE
362VARIABLE = _core_.VARIABLE
363FIXED = _core_.FIXED
364NORMAL = _core_.NORMAL
365LIGHT = _core_.LIGHT
366BOLD = _core_.BOLD
367ITALIC = _core_.ITALIC
368SLANT = _core_.SLANT
369SOLID = _core_.SOLID
370DOT = _core_.DOT
371LONG_DASH = _core_.LONG_DASH
372SHORT_DASH = _core_.SHORT_DASH
373DOT_DASH = _core_.DOT_DASH
374USER_DASH = _core_.USER_DASH
375TRANSPARENT = _core_.TRANSPARENT
376STIPPLE = _core_.STIPPLE
d04418a7
RD
377STIPPLE_MASK = _core_.STIPPLE_MASK
378STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
d55e5bfc
RD
379BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
380CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
381FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
382CROSS_HATCH = _core_.CROSS_HATCH
383HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
384VERTICAL_HATCH = _core_.VERTICAL_HATCH
385JOIN_BEVEL = _core_.JOIN_BEVEL
386JOIN_MITER = _core_.JOIN_MITER
387JOIN_ROUND = _core_.JOIN_ROUND
388CAP_ROUND = _core_.CAP_ROUND
389CAP_PROJECTING = _core_.CAP_PROJECTING
390CAP_BUTT = _core_.CAP_BUTT
391CLEAR = _core_.CLEAR
392XOR = _core_.XOR
393INVERT = _core_.INVERT
394OR_REVERSE = _core_.OR_REVERSE
395AND_REVERSE = _core_.AND_REVERSE
396COPY = _core_.COPY
397AND = _core_.AND
398AND_INVERT = _core_.AND_INVERT
399NO_OP = _core_.NO_OP
400NOR = _core_.NOR
401EQUIV = _core_.EQUIV
402SRC_INVERT = _core_.SRC_INVERT
403OR_INVERT = _core_.OR_INVERT
404NAND = _core_.NAND
405OR = _core_.OR
406SET = _core_.SET
407WXK_BACK = _core_.WXK_BACK
408WXK_TAB = _core_.WXK_TAB
409WXK_RETURN = _core_.WXK_RETURN
410WXK_ESCAPE = _core_.WXK_ESCAPE
411WXK_SPACE = _core_.WXK_SPACE
412WXK_DELETE = _core_.WXK_DELETE
413WXK_START = _core_.WXK_START
414WXK_LBUTTON = _core_.WXK_LBUTTON
415WXK_RBUTTON = _core_.WXK_RBUTTON
416WXK_CANCEL = _core_.WXK_CANCEL
417WXK_MBUTTON = _core_.WXK_MBUTTON
418WXK_CLEAR = _core_.WXK_CLEAR
419WXK_SHIFT = _core_.WXK_SHIFT
420WXK_ALT = _core_.WXK_ALT
421WXK_CONTROL = _core_.WXK_CONTROL
422WXK_MENU = _core_.WXK_MENU
423WXK_PAUSE = _core_.WXK_PAUSE
424WXK_CAPITAL = _core_.WXK_CAPITAL
425WXK_PRIOR = _core_.WXK_PRIOR
426WXK_NEXT = _core_.WXK_NEXT
427WXK_END = _core_.WXK_END
428WXK_HOME = _core_.WXK_HOME
429WXK_LEFT = _core_.WXK_LEFT
430WXK_UP = _core_.WXK_UP
431WXK_RIGHT = _core_.WXK_RIGHT
432WXK_DOWN = _core_.WXK_DOWN
433WXK_SELECT = _core_.WXK_SELECT
434WXK_PRINT = _core_.WXK_PRINT
435WXK_EXECUTE = _core_.WXK_EXECUTE
436WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
437WXK_INSERT = _core_.WXK_INSERT
438WXK_HELP = _core_.WXK_HELP
439WXK_NUMPAD0 = _core_.WXK_NUMPAD0
440WXK_NUMPAD1 = _core_.WXK_NUMPAD1
441WXK_NUMPAD2 = _core_.WXK_NUMPAD2
442WXK_NUMPAD3 = _core_.WXK_NUMPAD3
443WXK_NUMPAD4 = _core_.WXK_NUMPAD4
444WXK_NUMPAD5 = _core_.WXK_NUMPAD5
445WXK_NUMPAD6 = _core_.WXK_NUMPAD6
446WXK_NUMPAD7 = _core_.WXK_NUMPAD7
447WXK_NUMPAD8 = _core_.WXK_NUMPAD8
448WXK_NUMPAD9 = _core_.WXK_NUMPAD9
449WXK_MULTIPLY = _core_.WXK_MULTIPLY
450WXK_ADD = _core_.WXK_ADD
451WXK_SEPARATOR = _core_.WXK_SEPARATOR
452WXK_SUBTRACT = _core_.WXK_SUBTRACT
453WXK_DECIMAL = _core_.WXK_DECIMAL
454WXK_DIVIDE = _core_.WXK_DIVIDE
455WXK_F1 = _core_.WXK_F1
456WXK_F2 = _core_.WXK_F2
457WXK_F3 = _core_.WXK_F3
458WXK_F4 = _core_.WXK_F4
459WXK_F5 = _core_.WXK_F5
460WXK_F6 = _core_.WXK_F6
461WXK_F7 = _core_.WXK_F7
462WXK_F8 = _core_.WXK_F8
463WXK_F9 = _core_.WXK_F9
464WXK_F10 = _core_.WXK_F10
465WXK_F11 = _core_.WXK_F11
466WXK_F12 = _core_.WXK_F12
467WXK_F13 = _core_.WXK_F13
468WXK_F14 = _core_.WXK_F14
469WXK_F15 = _core_.WXK_F15
470WXK_F16 = _core_.WXK_F16
471WXK_F17 = _core_.WXK_F17
472WXK_F18 = _core_.WXK_F18
473WXK_F19 = _core_.WXK_F19
474WXK_F20 = _core_.WXK_F20
475WXK_F21 = _core_.WXK_F21
476WXK_F22 = _core_.WXK_F22
477WXK_F23 = _core_.WXK_F23
478WXK_F24 = _core_.WXK_F24
479WXK_NUMLOCK = _core_.WXK_NUMLOCK
480WXK_SCROLL = _core_.WXK_SCROLL
481WXK_PAGEUP = _core_.WXK_PAGEUP
482WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
483WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
484WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
485WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
486WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
487WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
488WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
489WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
490WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
491WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
492WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
493WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
494WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
495WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
496WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
497WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
498WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
499WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
500WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
501WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
502WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
503WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
504WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
505WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
506WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
507WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
508WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
509WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
510WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
511WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
512WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
513WXK_COMMAND = _core_.WXK_COMMAND
514WXK_SPECIAL1 = _core_.WXK_SPECIAL1
515WXK_SPECIAL2 = _core_.WXK_SPECIAL2
516WXK_SPECIAL3 = _core_.WXK_SPECIAL3
517WXK_SPECIAL4 = _core_.WXK_SPECIAL4
518WXK_SPECIAL5 = _core_.WXK_SPECIAL5
519WXK_SPECIAL6 = _core_.WXK_SPECIAL6
520WXK_SPECIAL7 = _core_.WXK_SPECIAL7
521WXK_SPECIAL8 = _core_.WXK_SPECIAL8
522WXK_SPECIAL9 = _core_.WXK_SPECIAL9
523WXK_SPECIAL10 = _core_.WXK_SPECIAL10
524WXK_SPECIAL11 = _core_.WXK_SPECIAL11
525WXK_SPECIAL12 = _core_.WXK_SPECIAL12
526WXK_SPECIAL13 = _core_.WXK_SPECIAL13
527WXK_SPECIAL14 = _core_.WXK_SPECIAL14
528WXK_SPECIAL15 = _core_.WXK_SPECIAL15
529WXK_SPECIAL16 = _core_.WXK_SPECIAL16
530WXK_SPECIAL17 = _core_.WXK_SPECIAL17
531WXK_SPECIAL18 = _core_.WXK_SPECIAL18
532WXK_SPECIAL19 = _core_.WXK_SPECIAL19
533WXK_SPECIAL20 = _core_.WXK_SPECIAL20
d55e5bfc
RD
534PAPER_NONE = _core_.PAPER_NONE
535PAPER_LETTER = _core_.PAPER_LETTER
536PAPER_LEGAL = _core_.PAPER_LEGAL
537PAPER_A4 = _core_.PAPER_A4
538PAPER_CSHEET = _core_.PAPER_CSHEET
539PAPER_DSHEET = _core_.PAPER_DSHEET
540PAPER_ESHEET = _core_.PAPER_ESHEET
541PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
542PAPER_TABLOID = _core_.PAPER_TABLOID
543PAPER_LEDGER = _core_.PAPER_LEDGER
544PAPER_STATEMENT = _core_.PAPER_STATEMENT
545PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
546PAPER_A3 = _core_.PAPER_A3
547PAPER_A4SMALL = _core_.PAPER_A4SMALL
548PAPER_A5 = _core_.PAPER_A5
549PAPER_B4 = _core_.PAPER_B4
550PAPER_B5 = _core_.PAPER_B5
551PAPER_FOLIO = _core_.PAPER_FOLIO
552PAPER_QUARTO = _core_.PAPER_QUARTO
553PAPER_10X14 = _core_.PAPER_10X14
554PAPER_11X17 = _core_.PAPER_11X17
555PAPER_NOTE = _core_.PAPER_NOTE
556PAPER_ENV_9 = _core_.PAPER_ENV_9
557PAPER_ENV_10 = _core_.PAPER_ENV_10
558PAPER_ENV_11 = _core_.PAPER_ENV_11
559PAPER_ENV_12 = _core_.PAPER_ENV_12
560PAPER_ENV_14 = _core_.PAPER_ENV_14
561PAPER_ENV_DL = _core_.PAPER_ENV_DL
562PAPER_ENV_C5 = _core_.PAPER_ENV_C5
563PAPER_ENV_C3 = _core_.PAPER_ENV_C3
564PAPER_ENV_C4 = _core_.PAPER_ENV_C4
565PAPER_ENV_C6 = _core_.PAPER_ENV_C6
566PAPER_ENV_C65 = _core_.PAPER_ENV_C65
567PAPER_ENV_B4 = _core_.PAPER_ENV_B4
568PAPER_ENV_B5 = _core_.PAPER_ENV_B5
569PAPER_ENV_B6 = _core_.PAPER_ENV_B6
570PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
571PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
572PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
573PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
574PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
575PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
576PAPER_ISO_B4 = _core_.PAPER_ISO_B4
577PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
578PAPER_9X11 = _core_.PAPER_9X11
579PAPER_10X11 = _core_.PAPER_10X11
580PAPER_15X11 = _core_.PAPER_15X11
581PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
582PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
583PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
584PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
585PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
586PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
587PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
588PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
589PAPER_A_PLUS = _core_.PAPER_A_PLUS
590PAPER_B_PLUS = _core_.PAPER_B_PLUS
591PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
592PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
593PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
594PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
595PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
596PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
597PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
598PAPER_A2 = _core_.PAPER_A2
599PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
600PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
601PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
602PAPER_A6 = _core_.PAPER_A6
603PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
604PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
605PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
606PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
607PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
608PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
609PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
610PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
611PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
612PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
613PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
614PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
615PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
616PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
617PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
618PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
619PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
620PAPER_B6_JIS = _core_.PAPER_B6_JIS
621PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
622PAPER_12X11 = _core_.PAPER_12X11
623PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
624PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
625PAPER_P16K = _core_.PAPER_P16K
626PAPER_P32K = _core_.PAPER_P32K
627PAPER_P32KBIG = _core_.PAPER_P32KBIG
628PAPER_PENV_1 = _core_.PAPER_PENV_1
629PAPER_PENV_2 = _core_.PAPER_PENV_2
630PAPER_PENV_3 = _core_.PAPER_PENV_3
631PAPER_PENV_4 = _core_.PAPER_PENV_4
632PAPER_PENV_5 = _core_.PAPER_PENV_5
633PAPER_PENV_6 = _core_.PAPER_PENV_6
634PAPER_PENV_7 = _core_.PAPER_PENV_7
635PAPER_PENV_8 = _core_.PAPER_PENV_8
636PAPER_PENV_9 = _core_.PAPER_PENV_9
637PAPER_PENV_10 = _core_.PAPER_PENV_10
638PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
639PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
640PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
641PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
642PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
643PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
644PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
645PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
646PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
647PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
648PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
649PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
650PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
d55e5bfc
RD
651DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
652DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
653DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
654ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
655ITEM_NORMAL = _core_.ITEM_NORMAL
656ITEM_CHECK = _core_.ITEM_CHECK
657ITEM_RADIO = _core_.ITEM_RADIO
658ITEM_MAX = _core_.ITEM_MAX
659HT_NOWHERE = _core_.HT_NOWHERE
660HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
661HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
662HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
663HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
664HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
665HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
666HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
667HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
668HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
669HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
670HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
671HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
672HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
673HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
674HT_MAX = _core_.HT_MAX
675MOD_NONE = _core_.MOD_NONE
676MOD_ALT = _core_.MOD_ALT
677MOD_CONTROL = _core_.MOD_CONTROL
9d7dfdff 678MOD_ALTGR = _core_.MOD_ALTGR
d55e5bfc 679MOD_SHIFT = _core_.MOD_SHIFT
9d7dfdff 680MOD_META = _core_.MOD_META
d55e5bfc 681MOD_WIN = _core_.MOD_WIN
9d7dfdff
RD
682MOD_CMD = _core_.MOD_CMD
683MOD_ALL = _core_.MOD_ALL
d55e5bfc
RD
684UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
685UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
686UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
687#---------------------------------------------------------------------------
688
689class Object(object):
690 """
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
693 """
694 def __init__(self): raise RuntimeError, "No constructor defined"
695 def __repr__(self):
696 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
697 def GetClassName(*args, **kwargs):
698 """
699 GetClassName(self) -> String
700
701 Returns the class name of the C++ class using wxRTTI.
702 """
703 return _core_.Object_GetClassName(*args, **kwargs)
704
705 def Destroy(*args, **kwargs):
706 """
707 Destroy(self)
708
709 Deletes the C++ object this Python object is a proxy for.
710 """
7e08d4ef
RD
711 val = _core_.Object_Destroy(*args, **kwargs)
712 args[0].thisown = 0
713 return val
d55e5bfc
RD
714
715
716class ObjectPtr(Object):
717 def __init__(self, this):
718 self.this = this
719 if not hasattr(self,"thisown"): self.thisown = 0
720 self.__class__ = Object
721_core_.Object_swigregister(ObjectPtr)
722_wxPySetDictionary = _core_._wxPySetDictionary
723
724_wxPyFixStockObjects = _core_._wxPyFixStockObjects
725
726cvar = _core_.cvar
727EmptyString = cvar.EmptyString
728
729#---------------------------------------------------------------------------
730
731BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
732BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
733BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
734BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
735BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
736BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
737BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
738BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
739BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
740BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
741BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
742BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
743BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
744BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
745BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
746BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
747BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
748BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
749BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
750BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
751CURSOR_NONE = _core_.CURSOR_NONE
752CURSOR_ARROW = _core_.CURSOR_ARROW
753CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
754CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
755CURSOR_CHAR = _core_.CURSOR_CHAR
756CURSOR_CROSS = _core_.CURSOR_CROSS
757CURSOR_HAND = _core_.CURSOR_HAND
758CURSOR_IBEAM = _core_.CURSOR_IBEAM
759CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
760CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
761CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
762CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
763CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
764CURSOR_PENCIL = _core_.CURSOR_PENCIL
765CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
766CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
767CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
768CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
769CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
770CURSOR_SIZENS = _core_.CURSOR_SIZENS
771CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
772CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
773CURSOR_SIZING = _core_.CURSOR_SIZING
774CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
775CURSOR_WAIT = _core_.CURSOR_WAIT
776CURSOR_WATCH = _core_.CURSOR_WATCH
777CURSOR_BLANK = _core_.CURSOR_BLANK
778CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
779CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
780CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
781CURSOR_MAX = _core_.CURSOR_MAX
782#---------------------------------------------------------------------------
783
784class Size(object):
785 """
79fccf9d 786 wx.Size is a useful data structure used to represent the size of
093d3ff1
RD
787 something. It simply contians integer width and height
788 proprtites. In most places in wxPython where a wx.Size is
789 expected a (width, height) tuple can be used instead.
d55e5bfc
RD
790 """
791 def __repr__(self):
792 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
793 width = property(_core_.Size_width_get, _core_.Size_width_set)
794 height = property(_core_.Size_height_get, _core_.Size_height_set)
795 x = width; y = height
796 def __init__(self, *args, **kwargs):
797 """
798 __init__(self, int w=0, int h=0) -> Size
799
800 Creates a size object.
801 """
802 newobj = _core_.new_Size(*args, **kwargs)
803 self.this = newobj.this
804 self.thisown = 1
805 del newobj.thisown
806 def __del__(self, destroy=_core_.delete_Size):
807 """__del__(self)"""
808 try:
809 if self.thisown: destroy(self)
810 except: pass
811
812 def __eq__(*args, **kwargs):
813 """
814 __eq__(self, Size sz) -> bool
815
816 Test for equality of wx.Size objects.
817 """
818 return _core_.Size___eq__(*args, **kwargs)
819
820 def __ne__(*args, **kwargs):
821 """
822 __ne__(self, Size sz) -> bool
823
824 Test for inequality.
825 """
826 return _core_.Size___ne__(*args, **kwargs)
827
828 def __add__(*args, **kwargs):
829 """
830 __add__(self, Size sz) -> Size
831
832 Add sz's proprties to this and return the result.
833 """
834 return _core_.Size___add__(*args, **kwargs)
835
836 def __sub__(*args, **kwargs):
837 """
838 __sub__(self, Size sz) -> Size
839
840 Subtract sz's properties from this and return the result.
841 """
842 return _core_.Size___sub__(*args, **kwargs)
843
844 def IncTo(*args, **kwargs):
845 """
846 IncTo(self, Size sz)
847
848 Increments this object so that both of its dimensions are not less
849 than the corresponding dimensions of the size.
850 """
851 return _core_.Size_IncTo(*args, **kwargs)
852
853 def DecTo(*args, **kwargs):
854 """
855 DecTo(self, Size sz)
856
857 Decrements this object so that both of its dimensions are not greater
858 than the corresponding dimensions of the size.
859 """
860 return _core_.Size_DecTo(*args, **kwargs)
861
862 def Set(*args, **kwargs):
863 """
864 Set(self, int w, int h)
865
866 Set both width and height.
867 """
868 return _core_.Size_Set(*args, **kwargs)
869
870 def SetWidth(*args, **kwargs):
871 """SetWidth(self, int w)"""
872 return _core_.Size_SetWidth(*args, **kwargs)
873
874 def SetHeight(*args, **kwargs):
875 """SetHeight(self, int h)"""
876 return _core_.Size_SetHeight(*args, **kwargs)
877
878 def GetWidth(*args, **kwargs):
879 """GetWidth(self) -> int"""
880 return _core_.Size_GetWidth(*args, **kwargs)
881
882 def GetHeight(*args, **kwargs):
883 """GetHeight(self) -> int"""
884 return _core_.Size_GetHeight(*args, **kwargs)
885
886 def IsFullySpecified(*args, **kwargs):
887 """
888 IsFullySpecified(self) -> bool
889
890 Returns True if both components of the size are non-default values.
891 """
892 return _core_.Size_IsFullySpecified(*args, **kwargs)
893
894 def SetDefaults(*args, **kwargs):
895 """
896 SetDefaults(self, Size size)
897
79fccf9d
RD
898 Combine this size with the other one replacing the default components
899 of this object (i.e. equal to -1) with those of the other.
d55e5bfc
RD
900 """
901 return _core_.Size_SetDefaults(*args, **kwargs)
902
903 def Get(*args, **kwargs):
904 """
905 Get() -> (width,height)
906
907 Returns the width and height properties as a tuple.
908 """
909 return _core_.Size_Get(*args, **kwargs)
910
79fccf9d 911 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
912 def __str__(self): return str(self.Get())
913 def __repr__(self): return 'wx.Size'+str(self.Get())
914 def __len__(self): return len(self.Get())
915 def __getitem__(self, index): return self.Get()[index]
916 def __setitem__(self, index, val):
917 if index == 0: self.width = val
918 elif index == 1: self.height = val
919 else: raise IndexError
920 def __nonzero__(self): return self.Get() != (0,0)
921 __safe_for_unpickling__ = True
922 def __reduce__(self): return (wx.Size, self.Get())
923
924
925class SizePtr(Size):
926 def __init__(self, this):
927 self.this = this
928 if not hasattr(self,"thisown"): self.thisown = 0
929 self.__class__ = Size
930_core_.Size_swigregister(SizePtr)
931
932#---------------------------------------------------------------------------
933
934class RealPoint(object):
935 """
79fccf9d
RD
936 A data structure for representing a point or position with floating
937 point x and y properties. In wxPython most places that expect a
938 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc
RD
939 """
940 def __repr__(self):
941 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
942 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
943 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
944 def __init__(self, *args, **kwargs):
945 """
946 __init__(self, double x=0.0, double y=0.0) -> RealPoint
947
948 Create a wx.RealPoint object
949 """
950 newobj = _core_.new_RealPoint(*args, **kwargs)
951 self.this = newobj.this
952 self.thisown = 1
953 del newobj.thisown
954 def __del__(self, destroy=_core_.delete_RealPoint):
955 """__del__(self)"""
956 try:
957 if self.thisown: destroy(self)
958 except: pass
959
960 def __eq__(*args, **kwargs):
961 """
962 __eq__(self, RealPoint pt) -> bool
963
964 Test for equality of wx.RealPoint objects.
965 """
966 return _core_.RealPoint___eq__(*args, **kwargs)
967
968 def __ne__(*args, **kwargs):
969 """
970 __ne__(self, RealPoint pt) -> bool
971
972 Test for inequality of wx.RealPoint objects.
973 """
974 return _core_.RealPoint___ne__(*args, **kwargs)
975
976 def __add__(*args, **kwargs):
977 """
978 __add__(self, RealPoint pt) -> RealPoint
979
980 Add pt's proprties to this and return the result.
981 """
982 return _core_.RealPoint___add__(*args, **kwargs)
983
984 def __sub__(*args, **kwargs):
985 """
986 __sub__(self, RealPoint pt) -> RealPoint
987
988 Subtract pt's proprties from this and return the result
989 """
990 return _core_.RealPoint___sub__(*args, **kwargs)
991
992 def Set(*args, **kwargs):
993 """
994 Set(self, double x, double y)
995
996 Set both the x and y properties
997 """
998 return _core_.RealPoint_Set(*args, **kwargs)
999
1000 def Get(*args, **kwargs):
1001 """
1002 Get() -> (x,y)
1003
1004 Return the x and y properties as a tuple.
1005 """
1006 return _core_.RealPoint_Get(*args, **kwargs)
1007
79fccf9d 1008 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1009 def __str__(self): return str(self.Get())
1010 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1011 def __len__(self): return len(self.Get())
1012 def __getitem__(self, index): return self.Get()[index]
1013 def __setitem__(self, index, val):
1014 if index == 0: self.x = val
1015 elif index == 1: self.y = val
1016 else: raise IndexError
1017 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1018 __safe_for_unpickling__ = True
1019 def __reduce__(self): return (wx.RealPoint, self.Get())
1020
1021
1022class RealPointPtr(RealPoint):
1023 def __init__(self, this):
1024 self.this = this
1025 if not hasattr(self,"thisown"): self.thisown = 0
1026 self.__class__ = RealPoint
1027_core_.RealPoint_swigregister(RealPointPtr)
1028
1029#---------------------------------------------------------------------------
1030
1031class Point(object):
1032 """
79fccf9d
RD
1033 A data structure for representing a point or position with integer x
1034 and y properties. Most places in wxPython that expect a wx.Point can
1035 also accept a (x,y) tuple.
d55e5bfc
RD
1036 """
1037 def __repr__(self):
1038 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1039 x = property(_core_.Point_x_get, _core_.Point_x_set)
1040 y = property(_core_.Point_y_get, _core_.Point_y_set)
1041 def __init__(self, *args, **kwargs):
1042 """
1043 __init__(self, int x=0, int y=0) -> Point
1044
1045 Create a wx.Point object
1046 """
1047 newobj = _core_.new_Point(*args, **kwargs)
1048 self.this = newobj.this
1049 self.thisown = 1
1050 del newobj.thisown
1051 def __del__(self, destroy=_core_.delete_Point):
1052 """__del__(self)"""
1053 try:
1054 if self.thisown: destroy(self)
1055 except: pass
1056
1057 def __eq__(*args, **kwargs):
1058 """
1059 __eq__(self, Point pt) -> bool
1060
1061 Test for equality of wx.Point objects.
1062 """
1063 return _core_.Point___eq__(*args, **kwargs)
1064
1065 def __ne__(*args, **kwargs):
1066 """
1067 __ne__(self, Point pt) -> bool
1068
1069 Test for inequality of wx.Point objects.
1070 """
1071 return _core_.Point___ne__(*args, **kwargs)
1072
1073 def __add__(*args, **kwargs):
1074 """
1075 __add__(self, Point pt) -> Point
1076
1077 Add pt's proprties to this and return the result.
1078 """
1079 return _core_.Point___add__(*args, **kwargs)
1080
1081 def __sub__(*args, **kwargs):
1082 """
1083 __sub__(self, Point pt) -> Point
1084
1085 Subtract pt's proprties from this and return the result
1086 """
1087 return _core_.Point___sub__(*args, **kwargs)
1088
1089 def __iadd__(*args, **kwargs):
1090 """
1091 __iadd__(self, Point pt) -> Point
1092
1093 Add pt to this object.
1094 """
1095 return _core_.Point___iadd__(*args, **kwargs)
1096
1097 def __isub__(*args, **kwargs):
1098 """
1099 __isub__(self, Point pt) -> Point
1100
1101 Subtract pt from this object.
1102 """
1103 return _core_.Point___isub__(*args, **kwargs)
1104
1105 def Set(*args, **kwargs):
1106 """
1107 Set(self, long x, long y)
1108
1109 Set both the x and y properties
1110 """
1111 return _core_.Point_Set(*args, **kwargs)
1112
1113 def Get(*args, **kwargs):
1114 """
1115 Get() -> (x,y)
1116
1117 Return the x and y properties as a tuple.
1118 """
1119 return _core_.Point_Get(*args, **kwargs)
1120
79fccf9d 1121 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1122 def __str__(self): return str(self.Get())
1123 def __repr__(self): return 'wx.Point'+str(self.Get())
1124 def __len__(self): return len(self.Get())
1125 def __getitem__(self, index): return self.Get()[index]
1126 def __setitem__(self, index, val):
1127 if index == 0: self.x = val
1128 elif index == 1: self.y = val
1129 else: raise IndexError
1130 def __nonzero__(self): return self.Get() != (0,0)
1131 __safe_for_unpickling__ = True
1132 def __reduce__(self): return (wx.Point, self.Get())
1133
1134
1135class PointPtr(Point):
1136 def __init__(self, this):
1137 self.this = this
1138 if not hasattr(self,"thisown"): self.thisown = 0
1139 self.__class__ = Point
1140_core_.Point_swigregister(PointPtr)
1141
1142#---------------------------------------------------------------------------
1143
1144class Rect(object):
1145 """
79fccf9d
RD
1146 A class for representing and manipulating rectangles. It has x, y,
1147 width and height properties. In wxPython most palces that expect a
1148 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc
RD
1149 """
1150 def __repr__(self):
1151 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1152 def __init__(self, *args, **kwargs):
1153 """
1154 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1155
1156 Create a new Rect object.
1157 """
1158 newobj = _core_.new_Rect(*args, **kwargs)
1159 self.this = newobj.this
1160 self.thisown = 1
1161 del newobj.thisown
1162 def __del__(self, destroy=_core_.delete_Rect):
1163 """__del__(self)"""
1164 try:
1165 if self.thisown: destroy(self)
1166 except: pass
1167
1168 def GetX(*args, **kwargs):
1169 """GetX(self) -> int"""
1170 return _core_.Rect_GetX(*args, **kwargs)
1171
1172 def SetX(*args, **kwargs):
1173 """SetX(self, int x)"""
1174 return _core_.Rect_SetX(*args, **kwargs)
1175
1176 def GetY(*args, **kwargs):
1177 """GetY(self) -> int"""
1178 return _core_.Rect_GetY(*args, **kwargs)
1179
1180 def SetY(*args, **kwargs):
1181 """SetY(self, int y)"""
1182 return _core_.Rect_SetY(*args, **kwargs)
1183
1184 def GetWidth(*args, **kwargs):
1185 """GetWidth(self) -> int"""
1186 return _core_.Rect_GetWidth(*args, **kwargs)
1187
1188 def SetWidth(*args, **kwargs):
1189 """SetWidth(self, int w)"""
1190 return _core_.Rect_SetWidth(*args, **kwargs)
1191
1192 def GetHeight(*args, **kwargs):
1193 """GetHeight(self) -> int"""
1194 return _core_.Rect_GetHeight(*args, **kwargs)
1195
1196 def SetHeight(*args, **kwargs):
1197 """SetHeight(self, int h)"""
1198 return _core_.Rect_SetHeight(*args, **kwargs)
1199
1200 def GetPosition(*args, **kwargs):
1201 """GetPosition(self) -> Point"""
1202 return _core_.Rect_GetPosition(*args, **kwargs)
1203
1204 def SetPosition(*args, **kwargs):
1205 """SetPosition(self, Point p)"""
1206 return _core_.Rect_SetPosition(*args, **kwargs)
1207
1208 def GetSize(*args, **kwargs):
1209 """GetSize(self) -> Size"""
1210 return _core_.Rect_GetSize(*args, **kwargs)
1211
1212 def SetSize(*args, **kwargs):
1213 """SetSize(self, Size s)"""
1214 return _core_.Rect_SetSize(*args, **kwargs)
1215
aff4cc5c
RD
1216 def IsEmpty(*args, **kwargs):
1217 """IsEmpty(self) -> bool"""
1218 return _core_.Rect_IsEmpty(*args, **kwargs)
1219
d55e5bfc
RD
1220 def GetTopLeft(*args, **kwargs):
1221 """GetTopLeft(self) -> Point"""
1222 return _core_.Rect_GetTopLeft(*args, **kwargs)
1223
1224 def SetTopLeft(*args, **kwargs):
1225 """SetTopLeft(self, Point p)"""
1226 return _core_.Rect_SetTopLeft(*args, **kwargs)
1227
1228 def GetBottomRight(*args, **kwargs):
1229 """GetBottomRight(self) -> Point"""
1230 return _core_.Rect_GetBottomRight(*args, **kwargs)
1231
1232 def SetBottomRight(*args, **kwargs):
1233 """SetBottomRight(self, Point p)"""
1234 return _core_.Rect_SetBottomRight(*args, **kwargs)
1235
1236 def GetLeft(*args, **kwargs):
1237 """GetLeft(self) -> int"""
1238 return _core_.Rect_GetLeft(*args, **kwargs)
1239
1240 def GetTop(*args, **kwargs):
1241 """GetTop(self) -> int"""
1242 return _core_.Rect_GetTop(*args, **kwargs)
1243
1244 def GetBottom(*args, **kwargs):
1245 """GetBottom(self) -> int"""
1246 return _core_.Rect_GetBottom(*args, **kwargs)
1247
1248 def GetRight(*args, **kwargs):
1249 """GetRight(self) -> int"""
1250 return _core_.Rect_GetRight(*args, **kwargs)
1251
1252 def SetLeft(*args, **kwargs):
1253 """SetLeft(self, int left)"""
1254 return _core_.Rect_SetLeft(*args, **kwargs)
1255
1256 def SetRight(*args, **kwargs):
1257 """SetRight(self, int right)"""
1258 return _core_.Rect_SetRight(*args, **kwargs)
1259
1260 def SetTop(*args, **kwargs):
1261 """SetTop(self, int top)"""
1262 return _core_.Rect_SetTop(*args, **kwargs)
1263
1264 def SetBottom(*args, **kwargs):
1265 """SetBottom(self, int bottom)"""
1266 return _core_.Rect_SetBottom(*args, **kwargs)
1267
1268 position = property(GetPosition, SetPosition)
1269 size = property(GetSize, SetSize)
1270 left = property(GetLeft, SetLeft)
1271 right = property(GetRight, SetRight)
1272 top = property(GetTop, SetTop)
1273 bottom = property(GetBottom, SetBottom)
1274
1275 def Inflate(*args, **kwargs):
1276 """
1277 Inflate(self, int dx, int dy) -> Rect
1278
091fdbfa
RD
1279 Increases the size of the rectangle.
1280
1281 The left border is moved farther left and the right border is moved
1282 farther right by ``dx``. The upper border is moved farther up and the
1283 bottom border is moved farther down by ``dy``. (Note the the width and
1284 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1285 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1286 opposite happens: the rectangle size decreases in the respective
1287 direction.
1288
1289 The change is made to the rectangle inplace, if instead you need a
1290 copy that is inflated, preserving the original then make the copy
1291 first::
1292
1293 copy = wx.Rect(*original)
1294 copy.Inflate(10,15)
1295
1296
d55e5bfc
RD
1297 """
1298 return _core_.Rect_Inflate(*args, **kwargs)
1299
1300 def Deflate(*args, **kwargs):
1301 """
1302 Deflate(self, int dx, int dy) -> Rect
1303
091fdbfa
RD
1304 Decrease the rectangle size. This method is the opposite of `Inflate`
1305 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1306 `Inflate` for a full description.
d55e5bfc
RD
1307 """
1308 return _core_.Rect_Deflate(*args, **kwargs)
1309
1310 def OffsetXY(*args, **kwargs):
1311 """
1312 OffsetXY(self, int dx, int dy)
1313
79fccf9d
RD
1314 Moves the rectangle by the specified offset. If dx is positive, the
1315 rectangle is moved to the right, if dy is positive, it is moved to the
1316 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc
RD
1317 """
1318 return _core_.Rect_OffsetXY(*args, **kwargs)
1319
1320 def Offset(*args, **kwargs):
1321 """
1322 Offset(self, Point pt)
1323
b1fcee84 1324 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc
RD
1325 """
1326 return _core_.Rect_Offset(*args, **kwargs)
1327
1328 def Intersect(*args, **kwargs):
1329 """
1330 Intersect(self, Rect rect) -> Rect
1331
b519803b 1332 Returns the intersectsion of this rectangle and rect.
d55e5bfc
RD
1333 """
1334 return _core_.Rect_Intersect(*args, **kwargs)
1335
b519803b
RD
1336 def Union(*args, **kwargs):
1337 """
1338 Union(self, Rect rect) -> Rect
1339
1340 Returns the union of this rectangle and rect.
1341 """
1342 return _core_.Rect_Union(*args, **kwargs)
1343
d55e5bfc
RD
1344 def __add__(*args, **kwargs):
1345 """
1346 __add__(self, Rect rect) -> Rect
1347
1348 Add the properties of rect to this rectangle and return the result.
1349 """
1350 return _core_.Rect___add__(*args, **kwargs)
1351
1352 def __iadd__(*args, **kwargs):
1353 """
1354 __iadd__(self, Rect rect) -> Rect
1355
1356 Add the properties of rect to this rectangle, updating this rectangle.
1357 """
1358 return _core_.Rect___iadd__(*args, **kwargs)
1359
1360 def __eq__(*args, **kwargs):
1361 """
1362 __eq__(self, Rect rect) -> bool
1363
1364 Test for equality.
1365 """
1366 return _core_.Rect___eq__(*args, **kwargs)
1367
1368 def __ne__(*args, **kwargs):
1369 """
1370 __ne__(self, Rect rect) -> bool
1371
1372 Test for inequality.
1373 """
1374 return _core_.Rect___ne__(*args, **kwargs)
1375
1376 def InsideXY(*args, **kwargs):
1377 """
1378 InsideXY(self, int x, int y) -> bool
1379
1380 Return True if the point is (not strcitly) inside the rect.
1381 """
1382 return _core_.Rect_InsideXY(*args, **kwargs)
1383
1384 def Inside(*args, **kwargs):
1385 """
1386 Inside(self, Point pt) -> bool
1387
1388 Return True if the point is (not strcitly) inside the rect.
1389 """
1390 return _core_.Rect_Inside(*args, **kwargs)
1391
1392 def Intersects(*args, **kwargs):
1393 """
1394 Intersects(self, Rect rect) -> bool
1395
1396 Returns True if the rectangles have a non empty intersection.
1397 """
1398 return _core_.Rect_Intersects(*args, **kwargs)
1399
b1fcee84
RD
1400 def CenterIn(*args, **kwargs):
1401 """
1402 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1403
1404 Center this rectangle within the one passed to the method, which is
1405 usually, but not necessarily, the larger one.
1406 """
1407 return _core_.Rect_CenterIn(*args, **kwargs)
1408
1409 CentreIn = CenterIn
d55e5bfc
RD
1410 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1411 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1412 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1413 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1414 def Set(*args, **kwargs):
1415 """
1416 Set(self, int x=0, int y=0, int width=0, int height=0)
1417
1418 Set all rectangle properties.
1419 """
1420 return _core_.Rect_Set(*args, **kwargs)
1421
1422 def Get(*args, **kwargs):
1423 """
1424 Get() -> (x,y,width,height)
1425
1426 Return the rectangle properties as a tuple.
1427 """
1428 return _core_.Rect_Get(*args, **kwargs)
1429
79fccf9d 1430 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1431 def __str__(self): return str(self.Get())
1432 def __repr__(self): return 'wx.Rect'+str(self.Get())
1433 def __len__(self): return len(self.Get())
1434 def __getitem__(self, index): return self.Get()[index]
1435 def __setitem__(self, index, val):
1436 if index == 0: self.x = val
1437 elif index == 1: self.y = val
1438 elif index == 2: self.width = val
1439 elif index == 3: self.height = val
1440 else: raise IndexError
1441 def __nonzero__(self): return self.Get() != (0,0,0,0)
1442 __safe_for_unpickling__ = True
1443 def __reduce__(self): return (wx.Rect, self.Get())
1444
1445
1446class RectPtr(Rect):
1447 def __init__(self, this):
1448 self.this = this
1449 if not hasattr(self,"thisown"): self.thisown = 0
1450 self.__class__ = Rect
1451_core_.Rect_swigregister(RectPtr)
1452
1453def RectPP(*args, **kwargs):
1454 """
1455 RectPP(Point topLeft, Point bottomRight) -> Rect
1456
1457 Create a new Rect object from Points representing two corners.
1458 """
1459 val = _core_.new_RectPP(*args, **kwargs)
1460 val.thisown = 1
1461 return val
1462
1463def RectPS(*args, **kwargs):
1464 """
1465 RectPS(Point pos, Size size) -> Rect
1466
1467 Create a new Rect from a position and size.
1468 """
1469 val = _core_.new_RectPS(*args, **kwargs)
1470 val.thisown = 1
1471 return val
1472
c1cb24a4
RD
1473def RectS(*args, **kwargs):
1474 """
1475 RectS(Size size) -> Rect
1476
1477 Create a new Rect from a size only.
1478 """
1479 val = _core_.new_RectS(*args, **kwargs)
1480 val.thisown = 1
1481 return val
1482
d55e5bfc
RD
1483
1484def IntersectRect(*args, **kwargs):
1485 """
1486 IntersectRect(Rect r1, Rect r2) -> Rect
1487
1488 Calculate and return the intersection of r1 and r2.
1489 """
1490 return _core_.IntersectRect(*args, **kwargs)
1491#---------------------------------------------------------------------------
1492
1493class Point2D(object):
79fccf9d
RD
1494 """
1495 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1496 with floating point values.
1497 """
d55e5bfc
RD
1498 def __repr__(self):
1499 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1500 def __init__(self, *args, **kwargs):
1501 """
1502 __init__(self, double x=0.0, double y=0.0) -> Point2D
1503
1504 Create a w.Point2D object.
1505 """
1506 newobj = _core_.new_Point2D(*args, **kwargs)
1507 self.this = newobj.this
1508 self.thisown = 1
1509 del newobj.thisown
1510 def GetFloor(*args, **kwargs):
a8eff060
RD
1511 """
1512 GetFloor() -> (x,y)
1513
1514 Convert to integer
1515 """
d55e5bfc
RD
1516 return _core_.Point2D_GetFloor(*args, **kwargs)
1517
1518 def GetRounded(*args, **kwargs):
a8eff060
RD
1519 """
1520 GetRounded() -> (x,y)
1521
1522 Convert to integer
1523 """
d55e5bfc
RD
1524 return _core_.Point2D_GetRounded(*args, **kwargs)
1525
1526 def GetVectorLength(*args, **kwargs):
1527 """GetVectorLength(self) -> double"""
1528 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1529
1530 def GetVectorAngle(*args, **kwargs):
1531 """GetVectorAngle(self) -> double"""
1532 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1533
1534 def SetVectorLength(*args, **kwargs):
1535 """SetVectorLength(self, double length)"""
1536 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1537
1538 def SetVectorAngle(*args, **kwargs):
1539 """SetVectorAngle(self, double degrees)"""
1540 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1541
1542 def SetPolarCoordinates(self, angle, length):
1543 self.SetVectorLength(length)
1544 self.SetVectorAngle(angle)
1545 def Normalize(self):
1546 self.SetVectorLength(1.0)
1547
1548 def GetDistance(*args, **kwargs):
1549 """GetDistance(self, Point2D pt) -> double"""
1550 return _core_.Point2D_GetDistance(*args, **kwargs)
1551
1552 def GetDistanceSquare(*args, **kwargs):
1553 """GetDistanceSquare(self, Point2D pt) -> double"""
1554 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1555
1556 def GetDotProduct(*args, **kwargs):
1557 """GetDotProduct(self, Point2D vec) -> double"""
1558 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1559
1560 def GetCrossProduct(*args, **kwargs):
1561 """GetCrossProduct(self, Point2D vec) -> double"""
1562 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1563
1564 def __neg__(*args, **kwargs):
1565 """
1566 __neg__(self) -> Point2D
1567
1568 the reflection of this point
1569 """
1570 return _core_.Point2D___neg__(*args, **kwargs)
1571
1572 def __iadd__(*args, **kwargs):
1573 """__iadd__(self, Point2D pt) -> Point2D"""
1574 return _core_.Point2D___iadd__(*args, **kwargs)
1575
1576 def __isub__(*args, **kwargs):
1577 """__isub__(self, Point2D pt) -> Point2D"""
1578 return _core_.Point2D___isub__(*args, **kwargs)
1579
1580 def __imul__(*args, **kwargs):
1581 """__imul__(self, Point2D pt) -> Point2D"""
1582 return _core_.Point2D___imul__(*args, **kwargs)
1583
1584 def __idiv__(*args, **kwargs):
1585 """__idiv__(self, Point2D pt) -> Point2D"""
1586 return _core_.Point2D___idiv__(*args, **kwargs)
1587
1588 def __eq__(*args, **kwargs):
1589 """
1590 __eq__(self, Point2D pt) -> bool
1591
1592 Test for equality
1593 """
1594 return _core_.Point2D___eq__(*args, **kwargs)
1595
1596 def __ne__(*args, **kwargs):
1597 """
1598 __ne__(self, Point2D pt) -> bool
1599
1600 Test for inequality
1601 """
1602 return _core_.Point2D___ne__(*args, **kwargs)
1603
1604 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1605 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1606 def Set(*args, **kwargs):
1607 """Set(self, double x=0, double y=0)"""
1608 return _core_.Point2D_Set(*args, **kwargs)
1609
1610 def Get(*args, **kwargs):
1611 """
1612 Get() -> (x,y)
1613
1614 Return x and y properties as a tuple.
1615 """
1616 return _core_.Point2D_Get(*args, **kwargs)
1617
79fccf9d 1618 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1619 def __str__(self): return str(self.Get())
1620 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1621 def __len__(self): return len(self.Get())
1622 def __getitem__(self, index): return self.Get()[index]
1623 def __setitem__(self, index, val):
1624 if index == 0: self.x = val
1625 elif index == 1: self.y = val
1626 else: raise IndexError
1627 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1628 __safe_for_unpickling__ = True
1629 def __reduce__(self): return (wx.Point2D, self.Get())
1630
1631
1632class Point2DPtr(Point2D):
1633 def __init__(self, this):
1634 self.this = this
1635 if not hasattr(self,"thisown"): self.thisown = 0
1636 self.__class__ = Point2D
1637_core_.Point2D_swigregister(Point2DPtr)
1638
1639def Point2DCopy(*args, **kwargs):
1640 """
1641 Point2DCopy(Point2D pt) -> Point2D
1642
1643 Create a w.Point2D object.
1644 """
1645 val = _core_.new_Point2DCopy(*args, **kwargs)
1646 val.thisown = 1
1647 return val
1648
1649def Point2DFromPoint(*args, **kwargs):
1650 """
1651 Point2DFromPoint(Point pt) -> Point2D
1652
1653 Create a w.Point2D object.
1654 """
1655 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1656 val.thisown = 1
1657 return val
1658
1659#---------------------------------------------------------------------------
1660
1661FromStart = _core_.FromStart
1662FromCurrent = _core_.FromCurrent
1663FromEnd = _core_.FromEnd
1664class InputStream(object):
093d3ff1 1665 """Proxy of C++ InputStream class"""
d55e5bfc
RD
1666 def __repr__(self):
1667 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1668 def __init__(self, *args, **kwargs):
1669 """__init__(self, PyObject p) -> InputStream"""
1670 newobj = _core_.new_InputStream(*args, **kwargs)
1671 self.this = newobj.this
1672 self.thisown = 1
1673 del newobj.thisown
8fb0e70a
RD
1674 def __del__(self, destroy=_core_.delete_InputStream):
1675 """__del__(self)"""
1676 try:
1677 if self.thisown: destroy(self)
1678 except: pass
1679
d55e5bfc
RD
1680 def close(*args, **kwargs):
1681 """close(self)"""
1682 return _core_.InputStream_close(*args, **kwargs)
1683
1684 def flush(*args, **kwargs):
1685 """flush(self)"""
1686 return _core_.InputStream_flush(*args, **kwargs)
1687
1688 def eof(*args, **kwargs):
1689 """eof(self) -> bool"""
1690 return _core_.InputStream_eof(*args, **kwargs)
1691
1692 def read(*args, **kwargs):
1693 """read(self, int size=-1) -> PyObject"""
1694 return _core_.InputStream_read(*args, **kwargs)
1695
1696 def readline(*args, **kwargs):
1697 """readline(self, int size=-1) -> PyObject"""
1698 return _core_.InputStream_readline(*args, **kwargs)
1699
1700 def readlines(*args, **kwargs):
1701 """readlines(self, int sizehint=-1) -> PyObject"""
1702 return _core_.InputStream_readlines(*args, **kwargs)
1703
1704 def seek(*args, **kwargs):
1705 """seek(self, int offset, int whence=0)"""
1706 return _core_.InputStream_seek(*args, **kwargs)
1707
1708 def tell(*args, **kwargs):
1709 """tell(self) -> int"""
1710 return _core_.InputStream_tell(*args, **kwargs)
1711
1712 def Peek(*args, **kwargs):
1713 """Peek(self) -> char"""
1714 return _core_.InputStream_Peek(*args, **kwargs)
1715
1716 def GetC(*args, **kwargs):
1717 """GetC(self) -> char"""
1718 return _core_.InputStream_GetC(*args, **kwargs)
1719
1720 def LastRead(*args, **kwargs):
1721 """LastRead(self) -> size_t"""
1722 return _core_.InputStream_LastRead(*args, **kwargs)
1723
1724 def CanRead(*args, **kwargs):
1725 """CanRead(self) -> bool"""
1726 return _core_.InputStream_CanRead(*args, **kwargs)
1727
1728 def Eof(*args, **kwargs):
1729 """Eof(self) -> bool"""
1730 return _core_.InputStream_Eof(*args, **kwargs)
1731
1732 def Ungetch(*args, **kwargs):
1733 """Ungetch(self, char c) -> bool"""
1734 return _core_.InputStream_Ungetch(*args, **kwargs)
1735
1736 def SeekI(*args, **kwargs):
1737 """SeekI(self, long pos, int mode=FromStart) -> long"""
1738 return _core_.InputStream_SeekI(*args, **kwargs)
1739
1740 def TellI(*args, **kwargs):
1741 """TellI(self) -> long"""
1742 return _core_.InputStream_TellI(*args, **kwargs)
1743
1744
1745class InputStreamPtr(InputStream):
1746 def __init__(self, this):
1747 self.this = this
1748 if not hasattr(self,"thisown"): self.thisown = 0
1749 self.__class__ = InputStream
1750_core_.InputStream_swigregister(InputStreamPtr)
1751DefaultPosition = cvar.DefaultPosition
1752DefaultSize = cvar.DefaultSize
1753
1754class OutputStream(object):
093d3ff1 1755 """Proxy of C++ OutputStream class"""
d55e5bfc
RD
1756 def __init__(self): raise RuntimeError, "No constructor defined"
1757 def __repr__(self):
1758 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1759 def write(*args, **kwargs):
1760 """write(self, PyObject obj)"""
1761 return _core_.OutputStream_write(*args, **kwargs)
1762
1763
1764class OutputStreamPtr(OutputStream):
1765 def __init__(self, this):
1766 self.this = this
1767 if not hasattr(self,"thisown"): self.thisown = 0
1768 self.__class__ = OutputStream
1769_core_.OutputStream_swigregister(OutputStreamPtr)
1770
1771#---------------------------------------------------------------------------
1772
1773class FSFile(Object):
093d3ff1 1774 """Proxy of C++ FSFile class"""
d55e5bfc
RD
1775 def __repr__(self):
1776 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1777 def __init__(self, *args, **kwargs):
1778 """
1779 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1780 DateTime modif) -> FSFile
1781 """
1782 newobj = _core_.new_FSFile(*args, **kwargs)
1783 self.this = newobj.this
1784 self.thisown = 1
1785 del newobj.thisown
e2950dbb 1786 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1787
d55e5bfc
RD
1788 def __del__(self, destroy=_core_.delete_FSFile):
1789 """__del__(self)"""
1790 try:
1791 if self.thisown: destroy(self)
1792 except: pass
1793
1794 def GetStream(*args, **kwargs):
1795 """GetStream(self) -> InputStream"""
1796 return _core_.FSFile_GetStream(*args, **kwargs)
1797
1798 def GetMimeType(*args, **kwargs):
1799 """GetMimeType(self) -> String"""
1800 return _core_.FSFile_GetMimeType(*args, **kwargs)
1801
1802 def GetLocation(*args, **kwargs):
1803 """GetLocation(self) -> String"""
1804 return _core_.FSFile_GetLocation(*args, **kwargs)
1805
1806 def GetAnchor(*args, **kwargs):
1807 """GetAnchor(self) -> String"""
1808 return _core_.FSFile_GetAnchor(*args, **kwargs)
1809
1810 def GetModificationTime(*args, **kwargs):
1811 """GetModificationTime(self) -> DateTime"""
1812 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1813
1814
1815class FSFilePtr(FSFile):
1816 def __init__(self, this):
1817 self.this = this
1818 if not hasattr(self,"thisown"): self.thisown = 0
1819 self.__class__ = FSFile
1820_core_.FSFile_swigregister(FSFilePtr)
1821
1822class CPPFileSystemHandler(object):
093d3ff1 1823 """Proxy of C++ CPPFileSystemHandler class"""
d55e5bfc
RD
1824 def __init__(self): raise RuntimeError, "No constructor defined"
1825 def __repr__(self):
1826 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1827
1828class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1829 def __init__(self, this):
1830 self.this = this
1831 if not hasattr(self,"thisown"): self.thisown = 0
1832 self.__class__ = CPPFileSystemHandler
1833_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1834
1835class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1836 """Proxy of C++ FileSystemHandler class"""
d55e5bfc
RD
1837 def __repr__(self):
1838 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1839 def __init__(self, *args, **kwargs):
1840 """__init__(self) -> FileSystemHandler"""
1841 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1842 self.this = newobj.this
1843 self.thisown = 1
1844 del newobj.thisown
1845 self._setCallbackInfo(self, FileSystemHandler)
1846
1847 def _setCallbackInfo(*args, **kwargs):
1848 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1849 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1850
1851 def CanOpen(*args, **kwargs):
1852 """CanOpen(self, String location) -> bool"""
1853 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1854
1855 def OpenFile(*args, **kwargs):
1856 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1857 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1858
1859 def FindFirst(*args, **kwargs):
1860 """FindFirst(self, String spec, int flags=0) -> String"""
1861 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1862
1863 def FindNext(*args, **kwargs):
1864 """FindNext(self) -> String"""
1865 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1866
1867 def GetProtocol(*args, **kwargs):
1868 """GetProtocol(self, String location) -> String"""
1869 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1870
1871 def GetLeftLocation(*args, **kwargs):
1872 """GetLeftLocation(self, String location) -> String"""
1873 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1874
1875 def GetAnchor(*args, **kwargs):
1876 """GetAnchor(self, String location) -> String"""
1877 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1878
1879 def GetRightLocation(*args, **kwargs):
1880 """GetRightLocation(self, String location) -> String"""
1881 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1882
1883 def GetMimeTypeFromExt(*args, **kwargs):
1884 """GetMimeTypeFromExt(self, String location) -> String"""
1885 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1886
1887
1888class FileSystemHandlerPtr(FileSystemHandler):
1889 def __init__(self, this):
1890 self.this = this
1891 if not hasattr(self,"thisown"): self.thisown = 0
1892 self.__class__ = FileSystemHandler
1893_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1894
1895class FileSystem(Object):
093d3ff1 1896 """Proxy of C++ FileSystem class"""
d55e5bfc
RD
1897 def __repr__(self):
1898 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1899 def __init__(self, *args, **kwargs):
1900 """__init__(self) -> FileSystem"""
1901 newobj = _core_.new_FileSystem(*args, **kwargs)
1902 self.this = newobj.this
1903 self.thisown = 1
1904 del newobj.thisown
1905 def __del__(self, destroy=_core_.delete_FileSystem):
1906 """__del__(self)"""
1907 try:
1908 if self.thisown: destroy(self)
1909 except: pass
1910
1911 def ChangePathTo(*args, **kwargs):
1912 """ChangePathTo(self, String location, bool is_dir=False)"""
1913 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1914
1915 def GetPath(*args, **kwargs):
1916 """GetPath(self) -> String"""
1917 return _core_.FileSystem_GetPath(*args, **kwargs)
1918
1919 def OpenFile(*args, **kwargs):
1920 """OpenFile(self, String location) -> FSFile"""
1921 return _core_.FileSystem_OpenFile(*args, **kwargs)
1922
1923 def FindFirst(*args, **kwargs):
1924 """FindFirst(self, String spec, int flags=0) -> String"""
1925 return _core_.FileSystem_FindFirst(*args, **kwargs)
1926
1927 def FindNext(*args, **kwargs):
1928 """FindNext(self) -> String"""
1929 return _core_.FileSystem_FindNext(*args, **kwargs)
1930
1931 def AddHandler(*args, **kwargs):
c24da6d6 1932 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
1933 return _core_.FileSystem_AddHandler(*args, **kwargs)
1934
1935 AddHandler = staticmethod(AddHandler)
1936 def CleanUpHandlers(*args, **kwargs):
c24da6d6 1937 """CleanUpHandlers()"""
d55e5bfc
RD
1938 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1939
1940 CleanUpHandlers = staticmethod(CleanUpHandlers)
1941 def FileNameToURL(*args, **kwargs):
c24da6d6 1942 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
1943 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1944
1945 FileNameToURL = staticmethod(FileNameToURL)
ae8162c8
RD
1946 def URLToFileName(*args, **kwargs):
1947 """URLToFileName(String url) -> String"""
1948 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1949
1950 URLToFileName = staticmethod(URLToFileName)
d55e5bfc
RD
1951
1952class FileSystemPtr(FileSystem):
1953 def __init__(self, this):
1954 self.this = this
1955 if not hasattr(self,"thisown"): self.thisown = 0
1956 self.__class__ = FileSystem
1957_core_.FileSystem_swigregister(FileSystemPtr)
1958
1959def FileSystem_AddHandler(*args, **kwargs):
1960 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1961 return _core_.FileSystem_AddHandler(*args, **kwargs)
1962
1963def FileSystem_CleanUpHandlers(*args, **kwargs):
1964 """FileSystem_CleanUpHandlers()"""
1965 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1966
1967def FileSystem_FileNameToURL(*args, **kwargs):
1968 """FileSystem_FileNameToURL(String filename) -> String"""
1969 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1970
d55e5bfc
RD
1971def FileSystem_URLToFileName(*args, **kwargs):
1972 """FileSystem_URLToFileName(String url) -> String"""
1973 return _core_.FileSystem_URLToFileName(*args, **kwargs)
ae8162c8 1974
d55e5bfc 1975class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1976 """Proxy of C++ InternetFSHandler class"""
d55e5bfc
RD
1977 def __repr__(self):
1978 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1979 def __init__(self, *args, **kwargs):
1980 """__init__(self) -> InternetFSHandler"""
1981 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1982 self.this = newobj.this
1983 self.thisown = 1
1984 del newobj.thisown
1985 def CanOpen(*args, **kwargs):
1986 """CanOpen(self, String location) -> bool"""
1987 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1988
1989 def OpenFile(*args, **kwargs):
1990 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1991 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1992
1993
1994class InternetFSHandlerPtr(InternetFSHandler):
1995 def __init__(self, this):
1996 self.this = this
1997 if not hasattr(self,"thisown"): self.thisown = 0
1998 self.__class__ = InternetFSHandler
1999_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
2000
2001class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 2002 """Proxy of C++ ZipFSHandler class"""
d55e5bfc
RD
2003 def __repr__(self):
2004 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2005 def __init__(self, *args, **kwargs):
2006 """__init__(self) -> ZipFSHandler"""
2007 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
2008 self.this = newobj.this
2009 self.thisown = 1
2010 del newobj.thisown
2011 def CanOpen(*args, **kwargs):
2012 """CanOpen(self, String location) -> bool"""
2013 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
2014
2015 def OpenFile(*args, **kwargs):
2016 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2017 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
2018
2019 def FindFirst(*args, **kwargs):
2020 """FindFirst(self, String spec, int flags=0) -> String"""
2021 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
2022
2023 def FindNext(*args, **kwargs):
2024 """FindNext(self) -> String"""
2025 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
2026
2027
2028class ZipFSHandlerPtr(ZipFSHandler):
2029 def __init__(self, this):
2030 self.this = this
2031 if not hasattr(self,"thisown"): self.thisown = 0
2032 self.__class__ = ZipFSHandler
2033_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
2034
2035
2036def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
2037 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2038 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
2039
2040def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
2041 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2042 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
2043
2044def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
2045 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2046 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
ae8162c8
RD
2047def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2048 """
2049 Add 'file' to the memory filesystem. The dataItem parameter can
2050 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2051 arbitrary data. If a bitmap or image is used then the imgType
2052 parameter should specify what kind of image file it should be
2053 written as, wx.BITMAP_TYPE_PNG, etc.
2054 """
2055 if isinstance(dataItem, wx.Image):
2056 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2057 elif isinstance(dataItem, wx.Bitmap):
2058 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2059 elif type(dataItem) == str:
2060 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2061 else:
2062 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc
RD
2063
2064class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2065 """Proxy of C++ MemoryFSHandler class"""
d55e5bfc
RD
2066 def __repr__(self):
2067 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2068 def __init__(self, *args, **kwargs):
2069 """__init__(self) -> MemoryFSHandler"""
2070 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
2071 self.this = newobj.this
2072 self.thisown = 1
2073 del newobj.thisown
2074 def RemoveFile(*args, **kwargs):
c24da6d6 2075 """RemoveFile(String filename)"""
d55e5bfc
RD
2076 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2077
2078 RemoveFile = staticmethod(RemoveFile)
2079 AddFile = staticmethod(MemoryFSHandler_AddFile)
2080 def CanOpen(*args, **kwargs):
2081 """CanOpen(self, String location) -> bool"""
2082 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2083
2084 def OpenFile(*args, **kwargs):
2085 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2086 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2087
2088 def FindFirst(*args, **kwargs):
2089 """FindFirst(self, String spec, int flags=0) -> String"""
2090 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2091
2092 def FindNext(*args, **kwargs):
2093 """FindNext(self) -> String"""
2094 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2095
2096
2097class MemoryFSHandlerPtr(MemoryFSHandler):
2098 def __init__(self, this):
2099 self.this = this
2100 if not hasattr(self,"thisown"): self.thisown = 0
2101 self.__class__ = MemoryFSHandler
2102_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
2103
2104def MemoryFSHandler_RemoveFile(*args, **kwargs):
2105 """MemoryFSHandler_RemoveFile(String filename)"""
2106 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2107
57133d5c
RD
2108IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2109IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2110IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
2111#---------------------------------------------------------------------------
2112
2113class ImageHandler(Object):
27fb7603
RD
2114 """
2115 This is the base class for implementing image file loading/saving, and
2116 image creation from data. It is used within `wx.Image` and is not
2117 normally seen by the application.
2118 """
d55e5bfc
RD
2119 def __init__(self): raise RuntimeError, "No constructor defined"
2120 def __repr__(self):
2121 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2122 def GetName(*args, **kwargs):
2123 """GetName(self) -> String"""
2124 return _core_.ImageHandler_GetName(*args, **kwargs)
2125
2126 def GetExtension(*args, **kwargs):
2127 """GetExtension(self) -> String"""
2128 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2129
2130 def GetType(*args, **kwargs):
2131 """GetType(self) -> long"""
2132 return _core_.ImageHandler_GetType(*args, **kwargs)
2133
2134 def GetMimeType(*args, **kwargs):
2135 """GetMimeType(self) -> String"""
2136 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2137
2138 def CanRead(*args, **kwargs):
2139 """CanRead(self, String name) -> bool"""
2140 return _core_.ImageHandler_CanRead(*args, **kwargs)
2141
2142 def SetName(*args, **kwargs):
2143 """SetName(self, String name)"""
2144 return _core_.ImageHandler_SetName(*args, **kwargs)
2145
2146 def SetExtension(*args, **kwargs):
2147 """SetExtension(self, String extension)"""
2148 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2149
2150 def SetType(*args, **kwargs):
2151 """SetType(self, long type)"""
2152 return _core_.ImageHandler_SetType(*args, **kwargs)
2153
2154 def SetMimeType(*args, **kwargs):
2155 """SetMimeType(self, String mimetype)"""
2156 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2157
2158
2159class ImageHandlerPtr(ImageHandler):
2160 def __init__(self, this):
2161 self.this = this
2162 if not hasattr(self,"thisown"): self.thisown = 0
2163 self.__class__ = ImageHandler
2164_core_.ImageHandler_swigregister(ImageHandlerPtr)
2165
9d7dfdff
RD
2166class PyImageHandler(ImageHandler):
2167 """
2168 This is the base class for implementing image file loading/saving, and
2169 image creation from data, all written in Python. To create a custom
2170 image handler derive a new class from wx.PyImageHandler and provide
2171 the following methods::
2172
2173 def DoCanRead(self, stream) --> bool
2174 '''Check if this handler can read the image on the stream'''
2175
2176 def LoadFile(self, image, stream, verbose, index) --> bool
2177 '''Load image data from the stream and load it into image.'''
2178
2179 def SaveFile(self, image, stream, verbose) --> bool
2180 '''Save the iamge data in image to the stream using
2181 this handler's image file format.'''
2182
2183 def GetImageCount(self, stream) --> int
2184 '''If this image format can hold more than one image,
2185 how many does the image on the stream have?'''
2186
2187 To activate your handler create an instance of it and pass it to
2188 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2189 `SetExtension` from your constructor.
2190
2191 """
2192 def __repr__(self):
2193 return "<%s.%s; proxy of C++ wxPyImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2194 def __init__(self, *args, **kwargs):
2195 """
2196 __init__(self) -> PyImageHandler
2197
2198 This is the base class for implementing image file loading/saving, and
2199 image creation from data, all written in Python. To create a custom
2200 image handler derive a new class from wx.PyImageHandler and provide
2201 the following methods::
2202
2203 def DoCanRead(self, stream) --> bool
2204 '''Check if this handler can read the image on the stream'''
2205
2206 def LoadFile(self, image, stream, verbose, index) --> bool
2207 '''Load image data from the stream and load it into image.'''
2208
2209 def SaveFile(self, image, stream, verbose) --> bool
2210 '''Save the iamge data in image to the stream using
2211 this handler's image file format.'''
2212
2213 def GetImageCount(self, stream) --> int
2214 '''If this image format can hold more than one image,
2215 how many does the image on the stream have?'''
2216
2217 To activate your handler create an instance of it and pass it to
2218 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2219 `SetExtension` from your constructor.
2220
2221 """
2222 newobj = _core_.new_PyImageHandler(*args, **kwargs)
2223 self.this = newobj.this
2224 self.thisown = 1
2225 del newobj.thisown
2226 self._SetSelf(self)
2227
2228 def _SetSelf(*args, **kwargs):
2229 """_SetSelf(self, PyObject self)"""
2230 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2231
2232
2233class PyImageHandlerPtr(PyImageHandler):
2234 def __init__(self, this):
2235 self.this = this
2236 if not hasattr(self,"thisown"): self.thisown = 0
2237 self.__class__ = PyImageHandler
2238_core_.PyImageHandler_swigregister(PyImageHandlerPtr)
2239
d55e5bfc 2240class ImageHistogram(object):
093d3ff1 2241 """Proxy of C++ ImageHistogram class"""
d55e5bfc
RD
2242 def __repr__(self):
2243 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2244 def __init__(self, *args, **kwargs):
2245 """__init__(self) -> ImageHistogram"""
2246 newobj = _core_.new_ImageHistogram(*args, **kwargs)
2247 self.this = newobj.this
2248 self.thisown = 1
2249 del newobj.thisown
2250 def MakeKey(*args, **kwargs):
2251 """
7a27cf7c 2252 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2253
2254 Get the key in the histogram for the given RGB values
2255 """
2256 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2257
2258 MakeKey = staticmethod(MakeKey)
2259 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2260 """
2261 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2262
2263 Find first colour that is not used in the image and has higher RGB
2264 values than startR, startG, startB. Returns a tuple consisting of a
2265 success flag and rgb values.
2266 """
d55e5bfc
RD
2267 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2268
f1cbd8fa
RD
2269 def GetCount(*args, **kwargs):
2270 """
2271 GetCount(self, unsigned long key) -> unsigned long
2272
2273 Returns the pixel count for the given key. Use `MakeKey` to create a
2274 key value from a RGB tripple.
2275 """
2276 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2277
2278 def GetCountRGB(*args, **kwargs):
2279 """
7a27cf7c 2280 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2281
2282 Returns the pixel count for the given RGB values.
2283 """
2284 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2285
2286 def GetCountColour(*args, **kwargs):
2287 """
2288 GetCountColour(self, Colour colour) -> unsigned long
2289
2290 Returns the pixel count for the given `wx.Colour` value.
2291 """
2292 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2293
d55e5bfc
RD
2294
2295class ImageHistogramPtr(ImageHistogram):
2296 def __init__(self, this):
2297 self.this = this
2298 if not hasattr(self,"thisown"): self.thisown = 0
2299 self.__class__ = ImageHistogram
2300_core_.ImageHistogram_swigregister(ImageHistogramPtr)
2301
2302def ImageHistogram_MakeKey(*args, **kwargs):
2303 """
7a27cf7c 2304 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2305
2306 Get the key in the histogram for the given RGB values
2307 """
2308 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2309
2f91e3df 2310class Image_RGBValue(object):
9d7dfdff
RD
2311 """
2312 An object that contains values for red, green and blue which represent
2313 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2314 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2315 color space.
2316 """
2f91e3df
KO
2317 def __repr__(self):
2318 return "<%s.%s; proxy of C++ wxImage_RGBValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2319 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2320 """
2321 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2322
2323 Constructor.
2324 """
2f91e3df
KO
2325 newobj = _core_.new_Image_RGBValue(*args, **kwargs)
2326 self.this = newobj.this
2327 self.thisown = 1
2328 del newobj.thisown
2329 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2330 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2331 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2332
2333class Image_RGBValuePtr(Image_RGBValue):
2334 def __init__(self, this):
2335 self.this = this
2336 if not hasattr(self,"thisown"): self.thisown = 0
2337 self.__class__ = Image_RGBValue
2338_core_.Image_RGBValue_swigregister(Image_RGBValuePtr)
2339
2340class Image_HSVValue(object):
9d7dfdff
RD
2341 """
2342 An object that contains values for hue, saturation and value which
2343 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2344 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2345 color space.
2346 """
2f91e3df
KO
2347 def __repr__(self):
2348 return "<%s.%s; proxy of C++ wxImage_HSVValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2349 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2350 """
2351 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2352
2353 Constructor.
2354 """
2f91e3df
KO
2355 newobj = _core_.new_Image_HSVValue(*args, **kwargs)
2356 self.this = newobj.this
2357 self.thisown = 1
2358 del newobj.thisown
2359 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2360 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2361 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2362
2363class Image_HSVValuePtr(Image_HSVValue):
2364 def __init__(self, this):
2365 self.this = this
2366 if not hasattr(self,"thisown"): self.thisown = 0
2367 self.__class__ = Image_HSVValue
2368_core_.Image_HSVValue_swigregister(Image_HSVValuePtr)
2369
d55e5bfc 2370class Image(Object):
7a27cf7c
RD
2371 """
2372 A platform-independent image class. An image can be created from
2373 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2374 variety of formats. Functions are available to set and get image
2375 bits, so it can be used for basic image manipulation.
2376
2377 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2378 platform-specific `wx.Bitmap` object must be created from it using the
2379 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2380 device context, using `wx.DC.DrawBitmap`.
2381
2382 One colour value of the image may be used as a mask colour which will
2383 lead to the automatic creation of a `wx.Mask` object associated to the
2384 bitmap object.
2385
2386 wx.Image supports alpha channel data, that is in addition to a byte
2387 for the red, green and blue colour components for each pixel it also
2388 stores a byte representing the pixel opacity. An alpha value of 0
2389 corresponds to a transparent pixel (null opacity) while a value of 255
2390 means that the pixel is 100% opaque.
2391
2392 Unlike RGB data, not all images have an alpha channel and before using
2393 `GetAlpha` you should check if this image contains an alpha channel
2394 with `HasAlpha`. Note that currently only images loaded from PNG files
2395 with transparency information will have an alpha channel.
2396 """
d55e5bfc
RD
2397 def __repr__(self):
2398 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2399 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2400 """
2401 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2402
2403 Loads an image from a file.
2404 """
d55e5bfc
RD
2405 newobj = _core_.new_Image(*args, **kwargs)
2406 self.this = newobj.this
2407 self.thisown = 1
2408 del newobj.thisown
2409 def __del__(self, destroy=_core_.delete_Image):
2410 """__del__(self)"""
2411 try:
2412 if self.thisown: destroy(self)
2413 except: pass
2414
2415 def Create(*args, **kwargs):
7a27cf7c
RD
2416 """
2417 Create(self, int width, int height, bool clear=True)
2418
2419 Creates a fresh image. If clear is ``True``, the new image will be
2420 initialized to black. Otherwise, the image data will be uninitialized.
2421 """
d55e5bfc
RD
2422 return _core_.Image_Create(*args, **kwargs)
2423
2424 def Destroy(*args, **kwargs):
2425 """
2426 Destroy(self)
2427
7a27cf7c 2428 Destroys the image data.
d55e5bfc 2429 """
7e08d4ef
RD
2430 val = _core_.Image_Destroy(*args, **kwargs)
2431 args[0].thisown = 0
2432 return val
d55e5bfc
RD
2433
2434 def Scale(*args, **kwargs):
7a27cf7c
RD
2435 """
2436 Scale(self, int width, int height) -> Image
2437
2438 Returns a scaled version of the image. This is also useful for scaling
2439 bitmaps in general as the only other way to scale bitmaps is to blit a
2440 `wx.MemoryDC` into another `wx.MemoryDC`.
2441 """
d55e5bfc
RD
2442 return _core_.Image_Scale(*args, **kwargs)
2443
2444 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2445 """
2446 ShrinkBy(self, int xFactor, int yFactor) -> Image
2447
2448 Return a version of the image scaled smaller by the given factors.
2449 """
d55e5bfc
RD
2450 return _core_.Image_ShrinkBy(*args, **kwargs)
2451
2452 def Rescale(*args, **kwargs):
7a27cf7c
RD
2453 """
2454 Rescale(self, int width, int height) -> Image
2455
2456 Changes the size of the image in-place by scaling it: after a call to
2457 this function, the image will have the given width and height.
2458
2459 Returns the (modified) image itself.
2460 """
d55e5bfc
RD
2461 return _core_.Image_Rescale(*args, **kwargs)
2462
aff4cc5c 2463 def Resize(*args, **kwargs):
7a27cf7c
RD
2464 """
2465 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2466
2467 Changes the size of the image in-place without scaling it, by adding
2468 either a border with the given colour or cropping as necessary. The
2469 image is pasted into a new image with the given size and background
2470 colour at the position pos relative to the upper left of the new
2471 image. If red = green = blue = -1 then use either the current mask
2472 colour if set or find, use, and set a suitable mask colour for any
2473 newly exposed areas.
2474
2475 Returns the (modified) image itself.
2476 """
aff4cc5c
RD
2477 return _core_.Image_Resize(*args, **kwargs)
2478
d55e5bfc 2479 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2480 """
2481 SetRGB(self, int x, int y, byte r, byte g, byte b)
2482
2483 Sets the pixel at the given coordinate. This routine performs
2484 bounds-checks for the coordinate so it can be considered a safe way to
2485 manipulate the data, but in some cases this might be too slow so that
2486 the data will have to be set directly. In that case you will have to
2487 get access to the image data using the `GetData` method.
2488 """
d55e5bfc
RD
2489 return _core_.Image_SetRGB(*args, **kwargs)
2490
aff4cc5c 2491 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2492 """
2493 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2494
2495 Sets the colour of the pixels within the given rectangle. This routine
2496 performs bounds-checks for the rectangle so it can be considered a
2497 safe way to manipulate the data.
2498 """
aff4cc5c
RD
2499 return _core_.Image_SetRGBRect(*args, **kwargs)
2500
d55e5bfc 2501 def GetRed(*args, **kwargs):
7a27cf7c
RD
2502 """
2503 GetRed(self, int x, int y) -> byte
2504
2505 Returns the red intensity at the given coordinate.
2506 """
d55e5bfc
RD
2507 return _core_.Image_GetRed(*args, **kwargs)
2508
2509 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2510 """
2511 GetGreen(self, int x, int y) -> byte
2512
2513 Returns the green intensity at the given coordinate.
2514 """
d55e5bfc
RD
2515 return _core_.Image_GetGreen(*args, **kwargs)
2516
2517 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2518 """
2519 GetBlue(self, int x, int y) -> byte
2520
2521 Returns the blue intensity at the given coordinate.
2522 """
d55e5bfc
RD
2523 return _core_.Image_GetBlue(*args, **kwargs)
2524
2525 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2526 """
2527 SetAlpha(self, int x, int y, byte alpha)
2528
2529 Sets the alpha value for the given pixel. This function should only be
2530 called if the image has alpha channel data, use `HasAlpha` to check
2531 for this.
2532 """
d55e5bfc
RD
2533 return _core_.Image_SetAlpha(*args, **kwargs)
2534
2535 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2536 """
2537 GetAlpha(self, int x, int y) -> byte
2538
2539 Returns the alpha value for the given pixel. This function may only be
2540 called for the images with alpha channel, use `HasAlpha` to check for
2541 this.
2542
2543 The returned value is the *opacity* of the image, i.e. the value of 0
2544 corresponds to the fully transparent pixels while the value of 255 to
2545 the fully opaque pixels.
2546 """
d55e5bfc
RD
2547 return _core_.Image_GetAlpha(*args, **kwargs)
2548
2549 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2550 """
2551 HasAlpha(self) -> bool
2552
2553 Returns true if this image has alpha channel, false otherwise.
2554 """
d55e5bfc
RD
2555 return _core_.Image_HasAlpha(*args, **kwargs)
2556
68350608
RD
2557 def InitAlpha(*args, **kwargs):
2558 """
2559 InitAlpha(self)
2560
2561 Initializes the image alpha channel data. It is an error to call it if
2562 the image already has alpha data. If it doesn't, alpha data will be by
2563 default initialized to all pixels being fully opaque. But if the image
2564 has a a mask colour, all mask pixels will be completely transparent.
2565 """
2566 return _core_.Image_InitAlpha(*args, **kwargs)
2567
57133d5c
RD
2568 def IsTransparent(*args, **kwargs):
2569 """
7a27cf7c 2570 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
57133d5c 2571
7a27cf7c
RD
2572 Returns ``True`` if this pixel is masked or has an alpha value less
2573 than the spcified threshold.
57133d5c
RD
2574 """
2575 return _core_.Image_IsTransparent(*args, **kwargs)
2576
d55e5bfc 2577 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2578 """
2579 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2580
2581 Find first colour that is not used in the image and has higher RGB
2582 values than startR, startG, startB. Returns a tuple consisting of a
2583 success flag and rgb values.
2584 """
d55e5bfc
RD
2585 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2586
4cf4100f
RD
2587 def ConvertAlphaToMask(*args, **kwargs):
2588 """
57133d5c 2589 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2590
7a27cf7c
RD
2591 If the image has alpha channel, this method converts it to mask. All
2592 pixels with alpha value less than ``threshold`` are replaced with the
2593 mask colour and the alpha channel is removed. The mask colour is
2594 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2595
2596 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2597 nothing.
2598 """
2599 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2600
8fb0e70a
RD
2601 def ConvertColourToAlpha(*args, **kwargs):
2602 """
7a27cf7c 2603 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2604
2605 This method converts an image where the original alpha information is
2606 only available as a shades of a colour (actually shades of grey)
2607 typically when you draw anti-aliased text into a bitmap. The DC
2608 drawing routines draw grey values on the black background although
2609 they actually mean to draw white with differnt alpha values. This
2610 method reverses it, assuming a black (!) background and white text.
2611 The method will then fill up the whole image with the colour given.
2612 """
2613 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2614
d55e5bfc 2615 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2616 """
2617 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2618
2619 Sets the image's mask so that the pixels that have RGB value of
2620 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2621 by first finding an unused colour in the image, setting this colour as
2622 the mask colour and then using this colour to draw all pixels in the
2623 image who corresponding pixel in mask has given RGB value.
2624
2625 Returns ``False`` if ``mask`` does not have same dimensions as the
2626 image or if there is no unused colour left. Returns ``True`` if the
2627 mask was successfully applied.
2628
2629 Note that this method involves computing the histogram, which is
2630 computationally intensive operation.
2631 """
d55e5bfc
RD
2632 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2633
2634 def CanRead(*args, **kwargs):
7a27cf7c
RD
2635 """
2636 CanRead(String filename) -> bool
2637
2638 Returns True if the image handlers can read this file.
2639 """
d55e5bfc
RD
2640 return _core_.Image_CanRead(*args, **kwargs)
2641
2642 CanRead = staticmethod(CanRead)
2643 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2644 """
2645 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2646
2647 If the image file contains more than one image and the image handler
2648 is capable of retrieving these individually, this function will return
2649 the number of available images.
2650 """
d55e5bfc
RD
2651 return _core_.Image_GetImageCount(*args, **kwargs)
2652
2653 GetImageCount = staticmethod(GetImageCount)
2654 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2655 """
2656 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2657
2658 Loads an image from a file. If no handler type is provided, the
2659 library will try to autodetect the format.
2660 """
d55e5bfc
RD
2661 return _core_.Image_LoadFile(*args, **kwargs)
2662
2663 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2664 """
2665 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2666
2667 Loads an image from a file, specifying the image type with a MIME type
2668 string.
2669 """
d55e5bfc
RD
2670 return _core_.Image_LoadMimeFile(*args, **kwargs)
2671
2672 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2673 """
2674 SaveFile(self, String name, int type) -> bool
2675
2676 Saves an image in the named file.
2677 """
d55e5bfc
RD
2678 return _core_.Image_SaveFile(*args, **kwargs)
2679
2680 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2681 """
2682 SaveMimeFile(self, String name, String mimetype) -> bool
2683
2684 Saves an image in the named file.
2685 """
d55e5bfc
RD
2686 return _core_.Image_SaveMimeFile(*args, **kwargs)
2687
2688 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2689 """
2690 CanReadStream(InputStream stream) -> bool
2691
2692 Returns True if the image handlers can read an image file from the
2693 data currently on the input stream, or a readable Python file-like
2694 object.
2695 """
d55e5bfc
RD
2696 return _core_.Image_CanReadStream(*args, **kwargs)
2697
2698 CanReadStream = staticmethod(CanReadStream)
2699 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2700 """
2701 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2702
2703 Loads an image from an input stream or a readable Python file-like
2704 object. If no handler type is provided, the library will try to
2705 autodetect the format.
2706 """
d55e5bfc
RD
2707 return _core_.Image_LoadStream(*args, **kwargs)
2708
2709 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2710 """
2711 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2712
2713 Loads an image from an input stream or a readable Python file-like
2714 object, using a MIME type string to specify the image file format.
2715 """
d55e5bfc
RD
2716 return _core_.Image_LoadMimeStream(*args, **kwargs)
2717
2718 def Ok(*args, **kwargs):
7a27cf7c
RD
2719 """
2720 Ok(self) -> bool
2721
2722 Returns true if image data is present.
2723 """
d55e5bfc
RD
2724 return _core_.Image_Ok(*args, **kwargs)
2725
2726 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2727 """
2728 GetWidth(self) -> int
2729
2730 Gets the width of the image in pixels.
2731 """
d55e5bfc
RD
2732 return _core_.Image_GetWidth(*args, **kwargs)
2733
2734 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2735 """
2736 GetHeight(self) -> int
2737
2738 Gets the height of the image in pixels.
2739 """
d55e5bfc
RD
2740 return _core_.Image_GetHeight(*args, **kwargs)
2741
2742 def GetSize(*args, **kwargs):
7a27cf7c
RD
2743 """
2744 GetSize(self) -> Size
2745
2746 Returns the size of the image in pixels.
2747 """
d55e5bfc
RD
2748 return _core_.Image_GetSize(*args, **kwargs)
2749
2750 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2751 """
2752 GetSubImage(self, Rect rect) -> Image
2753
2754 Returns a sub image of the current one as long as the rect belongs
2755 entirely to the image.
2756 """
d55e5bfc
RD
2757 return _core_.Image_GetSubImage(*args, **kwargs)
2758
aff4cc5c 2759 def Size(*args, **kwargs):
7a27cf7c
RD
2760 """
2761 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2762
2763 Returns a resized version of this image without scaling it by adding
2764 either a border with the given colour or cropping as necessary. The
2765 image is pasted into a new image with the given size and background
2766 colour at the position ``pos`` relative to the upper left of the new
2767 image. If red = green = blue = -1 then use either the current mask
2768 colour if set or find, use, and set a suitable mask colour for any
2769 newly exposed areas.
2770 """
aff4cc5c
RD
2771 return _core_.Image_Size(*args, **kwargs)
2772
d55e5bfc 2773 def Copy(*args, **kwargs):
7a27cf7c
RD
2774 """
2775 Copy(self) -> Image
2776
2777 Returns an identical copy of the image.
2778 """
d55e5bfc
RD
2779 return _core_.Image_Copy(*args, **kwargs)
2780
2781 def Paste(*args, **kwargs):
7a27cf7c
RD
2782 """
2783 Paste(self, Image image, int x, int y)
2784
2785 Pastes ``image`` into this instance and takes care of the mask colour
2786 and any out of bounds problems.
2787 """
d55e5bfc
RD
2788 return _core_.Image_Paste(*args, **kwargs)
2789
2790 def GetData(*args, **kwargs):
ea939623
RD
2791 """
2792 GetData(self) -> PyObject
2793
2794 Returns a string containing a copy of the RGB bytes of the image.
2795 """
d55e5bfc
RD
2796 return _core_.Image_GetData(*args, **kwargs)
2797
2798 def SetData(*args, **kwargs):
ea939623
RD
2799 """
2800 SetData(self, buffer data)
2801
2802 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2803 either a string or a buffer object holding the data and the length of
2804 the data must be width*height*3.
2805 """
d55e5bfc
RD
2806 return _core_.Image_SetData(*args, **kwargs)
2807
2808 def GetDataBuffer(*args, **kwargs):
ea939623
RD
2809 """
2810 GetDataBuffer(self) -> PyObject
2811
2812 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2813 image data buffer inside the wx.Image. You need to ensure that you do
2814 not use this buffer object after the image has been destroyed.
ea939623 2815 """
d55e5bfc
RD
2816 return _core_.Image_GetDataBuffer(*args, **kwargs)
2817
2818 def SetDataBuffer(*args, **kwargs):
ea939623
RD
2819 """
2820 SetDataBuffer(self, buffer data)
2821
2822 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2823 object. This can save making an extra copy of the data but you must
2824 ensure that the buffer object lives longer than the wx.Image does.
ea939623 2825 """
d55e5bfc
RD
2826 return _core_.Image_SetDataBuffer(*args, **kwargs)
2827
2828 def GetAlphaData(*args, **kwargs):
ea939623
RD
2829 """
2830 GetAlphaData(self) -> PyObject
2831
2832 Returns a string containing a copy of the alpha bytes of the image.
2833 """
d55e5bfc
RD
2834 return _core_.Image_GetAlphaData(*args, **kwargs)
2835
2836 def SetAlphaData(*args, **kwargs):
ea939623
RD
2837 """
2838 SetAlphaData(self, buffer alpha)
2839
2840 Resets the Image's alpha data from a buffer of bytes. Accepts either
2841 a string or a buffer object holding the data and the length of the
2842 data must be width*height.
2843 """
d55e5bfc
RD
2844 return _core_.Image_SetAlphaData(*args, **kwargs)
2845
2846 def GetAlphaBuffer(*args, **kwargs):
2847 """GetAlphaBuffer(self) -> PyObject"""
2848 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2849
2850 def SetAlphaBuffer(*args, **kwargs):
ea939623 2851 """SetAlphaBuffer(self, buffer alpha)"""
d55e5bfc
RD
2852 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2853
2854 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2855 """
2856 SetMaskColour(self, byte r, byte g, byte b)
2857
2858 Sets the mask colour for this image (and tells the image to use the
2859 mask).
2860 """
d55e5bfc
RD
2861 return _core_.Image_SetMaskColour(*args, **kwargs)
2862
aff4cc5c
RD
2863 def GetOrFindMaskColour(*args, **kwargs):
2864 """
2865 GetOrFindMaskColour() -> (r,g,b)
2866
2867 Get the current mask colour or find a suitable colour.
2868 """
2869 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2870
d55e5bfc 2871 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2872 """
2873 GetMaskRed(self) -> byte
2874
2875 Gets the red component of the mask colour.
2876 """
d55e5bfc
RD
2877 return _core_.Image_GetMaskRed(*args, **kwargs)
2878
2879 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2880 """
2881 GetMaskGreen(self) -> byte
2882
2883 Gets the green component of the mask colour.
2884 """
d55e5bfc
RD
2885 return _core_.Image_GetMaskGreen(*args, **kwargs)
2886
2887 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2888 """
2889 GetMaskBlue(self) -> byte
2890
2891 Gets the blue component of the mask colour.
2892 """
d55e5bfc
RD
2893 return _core_.Image_GetMaskBlue(*args, **kwargs)
2894
2895 def SetMask(*args, **kwargs):
7a27cf7c
RD
2896 """
2897 SetMask(self, bool mask=True)
2898
2899 Specifies whether there is a mask or not. The area of the mask is
2900 determined by the current mask colour.
2901 """
d55e5bfc
RD
2902 return _core_.Image_SetMask(*args, **kwargs)
2903
2904 def HasMask(*args, **kwargs):
7a27cf7c
RD
2905 """
2906 HasMask(self) -> bool
2907
2908 Returns ``True`` if there is a mask active, ``False`` otherwise.
2909 """
d55e5bfc
RD
2910 return _core_.Image_HasMask(*args, **kwargs)
2911
2912 def Rotate(*args, **kwargs):
2913 """
2914 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2915 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2916
2917 Rotates the image about the given point, by ``angle`` radians. Passing
2918 ``True`` to ``interpolating`` results in better image quality, but is
2919 slower. If the image has a mask, then the mask colour is used for the
2920 uncovered pixels in the rotated image background. Otherwise, black
2921 will be used as the fill colour.
2922
2923 Returns the rotated image, leaving this image intact.
d55e5bfc
RD
2924 """
2925 return _core_.Image_Rotate(*args, **kwargs)
2926
2927 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2928 """
2929 Rotate90(self, bool clockwise=True) -> Image
2930
2931 Returns a copy of the image rotated 90 degrees in the direction
2932 indicated by ``clockwise``.
2933 """
d55e5bfc
RD
2934 return _core_.Image_Rotate90(*args, **kwargs)
2935
2936 def Mirror(*args, **kwargs):
7a27cf7c
RD
2937 """
2938 Mirror(self, bool horizontally=True) -> Image
2939
2940 Returns a mirrored copy of the image. The parameter ``horizontally``
2941 indicates the orientation.
2942 """
d55e5bfc
RD
2943 return _core_.Image_Mirror(*args, **kwargs)
2944
2945 def Replace(*args, **kwargs):
2946 """
7a27cf7c
RD
2947 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2948
2949 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2950 ``(r2,g2,b2)``.
d55e5bfc
RD
2951 """
2952 return _core_.Image_Replace(*args, **kwargs)
2953
7449af73
RD
2954 def ConvertToGreyscale(*args, **kwargs):
2955 """
2956 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2957
2958 Convert to greyscale image. Uses the luminance component (Y) of the
2959 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2960 defaults to ITU-T BT.601
2961 """
2962 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2963
d55e5bfc 2964 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2965 """
2966 ConvertToMono(self, byte r, byte g, byte b) -> Image
2967
2968 Returns monochromatic version of the image. The returned image has
2969 white colour where the original has ``(r,g,b)`` colour and black
2970 colour everywhere else.
2971 """
d55e5bfc
RD
2972 return _core_.Image_ConvertToMono(*args, **kwargs)
2973
2974 def SetOption(*args, **kwargs):
7a27cf7c
RD
2975 """
2976 SetOption(self, String name, String value)
2977
2978 Sets an image handler defined option. For example, when saving as a
2979 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2980 number between 0 and 100 (0 is terrible, 100 is very good).
2981 """
d55e5bfc
RD
2982 return _core_.Image_SetOption(*args, **kwargs)
2983
2984 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2985 """
2986 SetOptionInt(self, String name, int value)
2987
2988 Sets an image option as an integer.
2989 """
d55e5bfc
RD
2990 return _core_.Image_SetOptionInt(*args, **kwargs)
2991
2992 def GetOption(*args, **kwargs):
7a27cf7c
RD
2993 """
2994 GetOption(self, String name) -> String
2995
2996 Gets the value of an image handler option.
2997 """
d55e5bfc
RD
2998 return _core_.Image_GetOption(*args, **kwargs)
2999
3000 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
3001 """
3002 GetOptionInt(self, String name) -> int
3003
3004 Gets the value of an image handler option as an integer. If the given
3005 option is not present, the function returns 0.
3006 """
d55e5bfc
RD
3007 return _core_.Image_GetOptionInt(*args, **kwargs)
3008
3009 def HasOption(*args, **kwargs):
7a27cf7c
RD
3010 """
3011 HasOption(self, String name) -> bool
3012
3013 Returns true if the given option is present.
3014 """
d55e5bfc
RD
3015 return _core_.Image_HasOption(*args, **kwargs)
3016
3017 def CountColours(*args, **kwargs):
3018 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
3019 return _core_.Image_CountColours(*args, **kwargs)
3020
3021 def ComputeHistogram(*args, **kwargs):
3022 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3023 return _core_.Image_ComputeHistogram(*args, **kwargs)
3024
3025 def AddHandler(*args, **kwargs):
c24da6d6 3026 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
3027 return _core_.Image_AddHandler(*args, **kwargs)
3028
3029 AddHandler = staticmethod(AddHandler)
3030 def InsertHandler(*args, **kwargs):
c24da6d6 3031 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
3032 return _core_.Image_InsertHandler(*args, **kwargs)
3033
3034 InsertHandler = staticmethod(InsertHandler)
3035 def RemoveHandler(*args, **kwargs):
c24da6d6 3036 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
3037 return _core_.Image_RemoveHandler(*args, **kwargs)
3038
3039 RemoveHandler = staticmethod(RemoveHandler)
3040 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3041 """
3042 GetImageExtWildcard() -> String
3043
3044 Iterates all registered wxImageHandler objects, and returns a string
3045 containing file extension masks suitable for passing to file open/save
3046 dialog boxes.
3047 """
d55e5bfc
RD
3048 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
3049
3050 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3051 def ConvertToBitmap(*args, **kwargs):
1fbf26be 3052 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
d55e5bfc
RD
3053 return _core_.Image_ConvertToBitmap(*args, **kwargs)
3054
3055 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3056 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
d55e5bfc
RD
3057 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
3058
2f91e3df
KO
3059 def RotateHue(*args, **kwargs):
3060 """
3061 RotateHue(self, double angle)
3062
3063 Rotates the hue of each pixel of the image. Hue is a double in the
3064 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3065 """
3066 return _core_.Image_RotateHue(*args, **kwargs)
3067
3068 def RGBtoHSV(*args, **kwargs):
9d7dfdff
RD
3069 """
3070 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3071
3072 Converts a color in RGB color space to HSV color space.
3073 """
2f91e3df
KO
3074 return _core_.Image_RGBtoHSV(*args, **kwargs)
3075
3076 RGBtoHSV = staticmethod(RGBtoHSV)
3077 def HSVtoRGB(*args, **kwargs):
9d7dfdff
RD
3078 """
3079 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3080
3081 Converts a color in HSV color space to RGB color space.
3082 """
2f91e3df
KO
3083 return _core_.Image_HSVtoRGB(*args, **kwargs)
3084
3085 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc
RD
3086 def __nonzero__(self): return self.Ok()
3087
3088class ImagePtr(Image):
3089 def __init__(self, this):
3090 self.this = this
3091 if not hasattr(self,"thisown"): self.thisown = 0
3092 self.__class__ = Image
3093_core_.Image_swigregister(ImagePtr)
3094
3095def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3096 """
3097 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3098
3099 Loads an image from a file, using a MIME type string (such as
3100 'image/jpeg') to specify image type.
3101 """
d55e5bfc
RD
3102 val = _core_.new_ImageFromMime(*args, **kwargs)
3103 val.thisown = 1
3104 return val
3105
3106def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3107 """
3108 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3109
3110 Loads an image from an input stream, or any readable Python file-like
3111 object.
3112 """
d55e5bfc
RD
3113 val = _core_.new_ImageFromStream(*args, **kwargs)
3114 val.thisown = 1
3115 return val
3116
3117def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3118 """
3119 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3120
3121 Loads an image from an input stream, or any readable Python file-like
3122 object, specifying the image format with a MIME type string.
3123 """
d55e5bfc
RD
3124 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
3125 val.thisown = 1
3126 return val
3127
c24da6d6 3128def EmptyImage(*args, **kwargs):
ea939623
RD
3129 """
3130 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3131
3132 Construct an empty image of a given size, optionally setting all
3133 pixels to black.
3134 """
c24da6d6 3135 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3136 val.thisown = 1
3137 return val
3138
3139def ImageFromBitmap(*args, **kwargs):
ea939623
RD
3140 """
3141 ImageFromBitmap(Bitmap bitmap) -> Image
3142
3143 Construct an Image from a `wx.Bitmap`.
3144 """
d55e5bfc
RD
3145 val = _core_.new_ImageFromBitmap(*args, **kwargs)
3146 val.thisown = 1
3147 return val
3148
3149def ImageFromData(*args, **kwargs):
ea939623
RD
3150 """
3151 ImageFromData(int width, int height, buffer data) -> Image
3152
3153 Construct an Image from a buffer of RGB bytes. Accepts either a
3154 string or a buffer object holding the data and the length of the data
3155 must be width*height*3.
3156 """
d55e5bfc
RD
3157 val = _core_.new_ImageFromData(*args, **kwargs)
3158 val.thisown = 1
3159 return val
3160
c9c2cf70 3161def ImageFromDataWithAlpha(*args, **kwargs):
ea939623
RD
3162 """
3163 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3164
3165 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3166 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3167 length of the data must be width*height*3 bytes, and the length of the
3168 alpha data must be width*height bytes.
ea939623 3169 """
c9c2cf70
RD
3170 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3171 val.thisown = 1
3172 return val
3173
d55e5bfc 3174def Image_CanRead(*args, **kwargs):
7a27cf7c
RD
3175 """
3176 Image_CanRead(String filename) -> bool
3177
3178 Returns True if the image handlers can read this file.
3179 """
d55e5bfc
RD
3180 return _core_.Image_CanRead(*args, **kwargs)
3181
3182def Image_GetImageCount(*args, **kwargs):
7a27cf7c
RD
3183 """
3184 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3185
3186 If the image file contains more than one image and the image handler
3187 is capable of retrieving these individually, this function will return
3188 the number of available images.
3189 """
d55e5bfc
RD
3190 return _core_.Image_GetImageCount(*args, **kwargs)
3191
3192def Image_CanReadStream(*args, **kwargs):
7a27cf7c
RD
3193 """
3194 Image_CanReadStream(InputStream stream) -> bool
3195
3196 Returns True if the image handlers can read an image file from the
3197 data currently on the input stream, or a readable Python file-like
3198 object.
3199 """
d55e5bfc
RD
3200 return _core_.Image_CanReadStream(*args, **kwargs)
3201
3202def Image_AddHandler(*args, **kwargs):
3203 """Image_AddHandler(ImageHandler handler)"""
3204 return _core_.Image_AddHandler(*args, **kwargs)
3205
3206def Image_InsertHandler(*args, **kwargs):
3207 """Image_InsertHandler(ImageHandler handler)"""
3208 return _core_.Image_InsertHandler(*args, **kwargs)
3209
3210def Image_RemoveHandler(*args, **kwargs):
3211 """Image_RemoveHandler(String name) -> bool"""
3212 return _core_.Image_RemoveHandler(*args, **kwargs)
3213
3214def Image_GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3215 """
3216 Image_GetImageExtWildcard() -> String
3217
3218 Iterates all registered wxImageHandler objects, and returns a string
3219 containing file extension masks suitable for passing to file open/save
3220 dialog boxes.
3221 """
d55e5bfc
RD
3222 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
3223
2f91e3df 3224def Image_RGBtoHSV(*args, **kwargs):
9d7dfdff
RD
3225 """
3226 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3227
3228 Converts a color in RGB color space to HSV color space.
3229 """
2f91e3df
KO
3230 return _core_.Image_RGBtoHSV(*args, **kwargs)
3231
3232def Image_HSVtoRGB(*args, **kwargs):
9d7dfdff
RD
3233 """
3234 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3235
3236 Converts a color in HSV color space to RGB color space.
3237 """
2f91e3df
KO
3238 return _core_.Image_HSVtoRGB(*args, **kwargs)
3239
a07a67e6
RD
3240def InitAllImageHandlers():
3241 """
3242 The former functionality of InitAllImageHanders is now done internal to
3243 the _core_ extension module and so this function has become a simple NOP.
3244 """
3245 pass
d55e5bfc 3246
d55e5bfc
RD
3247IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3248IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3249PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3250PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3251PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
d55e5bfc
RD
3252BMP_24BPP = _core_.BMP_24BPP
3253BMP_8BPP = _core_.BMP_8BPP
3254BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3255BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3256BMP_8BPP_RED = _core_.BMP_8BPP_RED
3257BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3258BMP_4BPP = _core_.BMP_4BPP
3259BMP_1BPP = _core_.BMP_1BPP
3260BMP_1BPP_BW = _core_.BMP_1BPP_BW
3261class BMPHandler(ImageHandler):
27fb7603 3262 """A `wx.ImageHandler` for \*.bmp bitmap files."""
d55e5bfc
RD
3263 def __repr__(self):
3264 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3265 def __init__(self, *args, **kwargs):
27fb7603
RD
3266 """
3267 __init__(self) -> BMPHandler
3268
3269 A `wx.ImageHandler` for \*.bmp bitmap files.
3270 """
d55e5bfc
RD
3271 newobj = _core_.new_BMPHandler(*args, **kwargs)
3272 self.this = newobj.this
3273 self.thisown = 1
3274 del newobj.thisown
3275
3276class BMPHandlerPtr(BMPHandler):
3277 def __init__(self, this):
3278 self.this = this
3279 if not hasattr(self,"thisown"): self.thisown = 0
3280 self.__class__ = BMPHandler
3281_core_.BMPHandler_swigregister(BMPHandlerPtr)
3282NullImage = cvar.NullImage
68350608 3283IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3284IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3285IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3286IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3287IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3288IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3289IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3290IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3291IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3292IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3293IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3294IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3295IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3296IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3297IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc
RD
3298
3299class ICOHandler(BMPHandler):
27fb7603 3300 """A `wx.ImageHandler` for \*.ico icon files."""
d55e5bfc
RD
3301 def __repr__(self):
3302 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3303 def __init__(self, *args, **kwargs):
27fb7603
RD
3304 """
3305 __init__(self) -> ICOHandler
3306
3307 A `wx.ImageHandler` for \*.ico icon files.
3308 """
d55e5bfc
RD
3309 newobj = _core_.new_ICOHandler(*args, **kwargs)
3310 self.this = newobj.this
3311 self.thisown = 1
3312 del newobj.thisown
3313
3314class ICOHandlerPtr(ICOHandler):
3315 def __init__(self, this):
3316 self.this = this
3317 if not hasattr(self,"thisown"): self.thisown = 0
3318 self.__class__ = ICOHandler
3319_core_.ICOHandler_swigregister(ICOHandlerPtr)
3320
3321class CURHandler(ICOHandler):
27fb7603 3322 """A `wx.ImageHandler` for \*.cur cursor files."""
d55e5bfc
RD
3323 def __repr__(self):
3324 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3325 def __init__(self, *args, **kwargs):
27fb7603
RD
3326 """
3327 __init__(self) -> CURHandler
3328
3329 A `wx.ImageHandler` for \*.cur cursor files.
3330 """
d55e5bfc
RD
3331 newobj = _core_.new_CURHandler(*args, **kwargs)
3332 self.this = newobj.this
3333 self.thisown = 1
3334 del newobj.thisown
3335
3336class CURHandlerPtr(CURHandler):
3337 def __init__(self, this):
3338 self.this = this
3339 if not hasattr(self,"thisown"): self.thisown = 0
3340 self.__class__ = CURHandler
3341_core_.CURHandler_swigregister(CURHandlerPtr)
3342
3343class ANIHandler(CURHandler):
27fb7603 3344 """A `wx.ImageHandler` for \*.ani animated cursor files."""
d55e5bfc
RD
3345 def __repr__(self):
3346 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3347 def __init__(self, *args, **kwargs):
27fb7603
RD
3348 """
3349 __init__(self) -> ANIHandler
3350
3351 A `wx.ImageHandler` for \*.ani animated cursor files.
3352 """
d55e5bfc
RD
3353 newobj = _core_.new_ANIHandler(*args, **kwargs)
3354 self.this = newobj.this
3355 self.thisown = 1
3356 del newobj.thisown
3357
3358class ANIHandlerPtr(ANIHandler):
3359 def __init__(self, this):
3360 self.this = this
3361 if not hasattr(self,"thisown"): self.thisown = 0
3362 self.__class__ = ANIHandler
3363_core_.ANIHandler_swigregister(ANIHandlerPtr)
3364
3365class PNGHandler(ImageHandler):
27fb7603 3366 """A `wx.ImageHandler` for PNG image files."""
d55e5bfc
RD
3367 def __repr__(self):
3368 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3369 def __init__(self, *args, **kwargs):
27fb7603
RD
3370 """
3371 __init__(self) -> PNGHandler
3372
3373 A `wx.ImageHandler` for PNG image files.
3374 """
d55e5bfc
RD
3375 newobj = _core_.new_PNGHandler(*args, **kwargs)
3376 self.this = newobj.this
3377 self.thisown = 1
3378 del newobj.thisown
3379
3380class PNGHandlerPtr(PNGHandler):
3381 def __init__(self, this):
3382 self.this = this
3383 if not hasattr(self,"thisown"): self.thisown = 0
3384 self.__class__ = PNGHandler
3385_core_.PNGHandler_swigregister(PNGHandlerPtr)
3386
3387class GIFHandler(ImageHandler):
27fb7603 3388 """A `wx.ImageHandler` for GIF image files."""
d55e5bfc
RD
3389 def __repr__(self):
3390 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3391 def __init__(self, *args, **kwargs):
27fb7603
RD
3392 """
3393 __init__(self) -> GIFHandler
3394
3395 A `wx.ImageHandler` for GIF image files.
3396 """
d55e5bfc
RD
3397 newobj = _core_.new_GIFHandler(*args, **kwargs)
3398 self.this = newobj.this
3399 self.thisown = 1
3400 del newobj.thisown
3401
3402class GIFHandlerPtr(GIFHandler):
3403 def __init__(self, this):
3404 self.this = this
3405 if not hasattr(self,"thisown"): self.thisown = 0
3406 self.__class__ = GIFHandler
3407_core_.GIFHandler_swigregister(GIFHandlerPtr)
3408
3409class PCXHandler(ImageHandler):
27fb7603 3410 """A `wx.ImageHandler` for PCX imager files."""
d55e5bfc
RD
3411 def __repr__(self):
3412 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3413 def __init__(self, *args, **kwargs):
27fb7603
RD
3414 """
3415 __init__(self) -> PCXHandler
3416
3417 A `wx.ImageHandler` for PCX imager files.
3418 """
d55e5bfc
RD
3419 newobj = _core_.new_PCXHandler(*args, **kwargs)
3420 self.this = newobj.this
3421 self.thisown = 1
3422 del newobj.thisown
3423
3424class PCXHandlerPtr(PCXHandler):
3425 def __init__(self, this):
3426 self.this = this
3427 if not hasattr(self,"thisown"): self.thisown = 0
3428 self.__class__ = PCXHandler
3429_core_.PCXHandler_swigregister(PCXHandlerPtr)
3430
3431class JPEGHandler(ImageHandler):
27fb7603 3432 """A `wx.ImageHandler` for JPEG/JPG image files."""
d55e5bfc
RD
3433 def __repr__(self):
3434 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3435 def __init__(self, *args, **kwargs):
27fb7603
RD
3436 """
3437 __init__(self) -> JPEGHandler
3438
3439 A `wx.ImageHandler` for JPEG/JPG image files.
3440 """
d55e5bfc
RD
3441 newobj = _core_.new_JPEGHandler(*args, **kwargs)
3442 self.this = newobj.this
3443 self.thisown = 1
3444 del newobj.thisown
3445
3446class JPEGHandlerPtr(JPEGHandler):
3447 def __init__(self, this):
3448 self.this = this
3449 if not hasattr(self,"thisown"): self.thisown = 0
3450 self.__class__ = JPEGHandler
3451_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
3452
3453class PNMHandler(ImageHandler):
27fb7603 3454 """A `wx.ImageHandler` for PNM image files."""
d55e5bfc
RD
3455 def __repr__(self):
3456 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3457 def __init__(self, *args, **kwargs):
27fb7603
RD
3458 """
3459 __init__(self) -> PNMHandler
3460
3461 A `wx.ImageHandler` for PNM image files.
3462 """
d55e5bfc
RD
3463 newobj = _core_.new_PNMHandler(*args, **kwargs)
3464 self.this = newobj.this
3465 self.thisown = 1
3466 del newobj.thisown
3467
3468class PNMHandlerPtr(PNMHandler):
3469 def __init__(self, this):
3470 self.this = this
3471 if not hasattr(self,"thisown"): self.thisown = 0
3472 self.__class__ = PNMHandler
3473_core_.PNMHandler_swigregister(PNMHandlerPtr)
3474
3475class XPMHandler(ImageHandler):
27fb7603 3476 """A `wx.ImageHandler` for XPM image."""
d55e5bfc
RD
3477 def __repr__(self):
3478 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3479 def __init__(self, *args, **kwargs):
27fb7603
RD
3480 """
3481 __init__(self) -> XPMHandler
3482
3483 A `wx.ImageHandler` for XPM image.
3484 """
d55e5bfc
RD
3485 newobj = _core_.new_XPMHandler(*args, **kwargs)
3486 self.this = newobj.this
3487 self.thisown = 1
3488 del newobj.thisown
3489
3490class XPMHandlerPtr(XPMHandler):
3491 def __init__(self, this):
3492 self.this = this
3493 if not hasattr(self,"thisown"): self.thisown = 0
3494 self.__class__ = XPMHandler
3495_core_.XPMHandler_swigregister(XPMHandlerPtr)
3496
3497class TIFFHandler(ImageHandler):
27fb7603 3498 """A `wx.ImageHandler` for TIFF image files."""
d55e5bfc
RD
3499 def __repr__(self):
3500 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3501 def __init__(self, *args, **kwargs):
27fb7603
RD
3502 """
3503 __init__(self) -> TIFFHandler
3504
3505 A `wx.ImageHandler` for TIFF image files.
3506 """
d55e5bfc
RD
3507 newobj = _core_.new_TIFFHandler(*args, **kwargs)
3508 self.this = newobj.this
3509 self.thisown = 1
3510 del newobj.thisown
3511
3512class TIFFHandlerPtr(TIFFHandler):
3513 def __init__(self, this):
3514 self.this = this
3515 if not hasattr(self,"thisown"): self.thisown = 0
3516 self.__class__ = TIFFHandler
3517_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
3518
c0de73ae
RD
3519QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3520QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3521class Quantize(object):
3522 """Performs quantization, or colour reduction, on a wxImage."""
3523 def __init__(self): raise RuntimeError, "No constructor defined"
3524 def __repr__(self):
3525 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3526 def Quantize(*args, **kwargs):
3527 """
3528 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3529
3530 Reduce the colours in the source image and put the result into the
3531 destination image, setting the palette in the destination if
3532 needed. Both images may be the same, to overwrite the source image.
3533 """
3534 return _core_.Quantize_Quantize(*args, **kwargs)
3535
3536 Quantize = staticmethod(Quantize)
3537
3538class QuantizePtr(Quantize):
3539 def __init__(self, this):
3540 self.this = this
3541 if not hasattr(self,"thisown"): self.thisown = 0
3542 self.__class__ = Quantize
3543_core_.Quantize_swigregister(QuantizePtr)
3544
3545def Quantize_Quantize(*args, **kwargs):
3546 """
3547 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3548
3549 Reduce the colours in the source image and put the result into the
3550 destination image, setting the palette in the destination if
3551 needed. Both images may be the same, to overwrite the source image.
3552 """
3553 return _core_.Quantize_Quantize(*args, **kwargs)
3554
d55e5bfc
RD
3555#---------------------------------------------------------------------------
3556
3557class EvtHandler(Object):
093d3ff1 3558 """Proxy of C++ EvtHandler class"""
d55e5bfc
RD
3559 def __repr__(self):
3560 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3561 def __init__(self, *args, **kwargs):
3562 """__init__(self) -> EvtHandler"""
3563 newobj = _core_.new_EvtHandler(*args, **kwargs)
3564 self.this = newobj.this
3565 self.thisown = 1
3566 del newobj.thisown
3567 def GetNextHandler(*args, **kwargs):
3568 """GetNextHandler(self) -> EvtHandler"""
3569 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3570
3571 def GetPreviousHandler(*args, **kwargs):
3572 """GetPreviousHandler(self) -> EvtHandler"""
3573 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3574
3575 def SetNextHandler(*args, **kwargs):
3576 """SetNextHandler(self, EvtHandler handler)"""
3577 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3578
3579 def SetPreviousHandler(*args, **kwargs):
3580 """SetPreviousHandler(self, EvtHandler handler)"""
3581 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3582
3583 def GetEvtHandlerEnabled(*args, **kwargs):
3584 """GetEvtHandlerEnabled(self) -> bool"""
3585 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3586
3587 def SetEvtHandlerEnabled(*args, **kwargs):
3588 """SetEvtHandlerEnabled(self, bool enabled)"""
3589 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3590
3591 def ProcessEvent(*args, **kwargs):
3592 """ProcessEvent(self, Event event) -> bool"""
3593 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3594
3595 def AddPendingEvent(*args, **kwargs):
3596 """AddPendingEvent(self, Event event)"""
3597 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3598
3599 def ProcessPendingEvents(*args, **kwargs):
3600 """ProcessPendingEvents(self)"""
3601 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3602
3603 def Connect(*args, **kwargs):
3604 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3605 return _core_.EvtHandler_Connect(*args, **kwargs)
3606
3607 def Disconnect(*args, **kwargs):
3608 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
3609 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3610
3611 def _setOORInfo(*args, **kwargs):
093d3ff1 3612 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3613 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3614 args[0].thisown = 0
3615 return val
d55e5bfc
RD
3616
3617 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3618 """
3619 Bind an event to an event handler.
3620
caef1a4d
RD
3621 :param event: One of the EVT_* objects that specifies the
3622 type of event to bind,
d55e5bfc 3623
caef1a4d
RD
3624 :param handler: A callable object to be invoked when the
3625 event is delivered to self. Pass None to
3626 disconnect an event handler.
d55e5bfc 3627
caef1a4d
RD
3628 :param source: Sometimes the event originates from a
3629 different window than self, but you still
3630 want to catch it in self. (For example, a
3631 button event delivered to a frame.) By
3632 passing the source of the event, the event
3633 handling system is able to differentiate
3634 between the same event type from different
3635 controls.
d55e5bfc 3636
caef1a4d
RD
3637 :param id: Used to spcify the event source by ID instead
3638 of instance.
3639
3640 :param id2: Used when it is desirable to bind a handler
3641 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3642 """
3643 if source is not None:
3644 id = source.GetId()
3645 event.Bind(self, id, id2, handler)
3646
c24da6d6
RD
3647 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3648 """
3649 Disconencts the event handler binding for event from self.
3650 Returns True if successful.
3651 """
3652 if source is not None:
3653 id = source.GetId()
3654 return event.Unbind(self, id, id2)
d55e5bfc
RD
3655
3656
3657class EvtHandlerPtr(EvtHandler):
3658 def __init__(self, this):
3659 self.this = this
3660 if not hasattr(self,"thisown"): self.thisown = 0
3661 self.__class__ = EvtHandler
3662_core_.EvtHandler_swigregister(EvtHandlerPtr)
3663
3664#---------------------------------------------------------------------------
3665
3666class PyEventBinder(object):
3667 """
3668 Instances of this class are used to bind specific events to event
3669 handlers.
3670 """
3671 def __init__(self, evtType, expectedIDs=0):
3672 if expectedIDs not in [0, 1, 2]:
3673 raise ValueError, "Invalid number of expectedIDs"
3674 self.expectedIDs = expectedIDs
3675
3676 if type(evtType) == list or type(evtType) == tuple:
3677 self.evtType = evtType
3678 else:
3679 self.evtType = [evtType]
3680
3681
3682 def Bind(self, target, id1, id2, function):
3683 """Bind this set of event types to target."""
3684 for et in self.evtType:
3685 target.Connect(id1, id2, et, function)
3686
c24da6d6
RD
3687
3688 def Unbind(self, target, id1, id2):
3689 """Remove an event binding."""
3690 success = 0
3691 for et in self.evtType:
3692 success += target.Disconnect(id1, id2, et)
3693 return success != 0
3694
d55e5bfc
RD
3695
3696 def __call__(self, *args):
3697 """
3698 For backwards compatibility with the old EVT_* functions.
3699 Should be called with either (window, func), (window, ID,
3700 func) or (window, ID1, ID2, func) parameters depending on the
3701 type of the event.
3702 """
3703 assert len(args) == 2 + self.expectedIDs
3704 id1 = wx.ID_ANY
3705 id2 = wx.ID_ANY
3706 target = args[0]
3707 if self.expectedIDs == 0:
3708 func = args[1]
3709 elif self.expectedIDs == 1:
3710 id1 = args[1]
3711 func = args[2]
3712 elif self.expectedIDs == 2:
3713 id1 = args[1]
3714 id2 = args[2]
3715 func = args[3]
3716 else:
3717 raise ValueError, "Unexpected number of IDs"
3718
3719 self.Bind(target, id1, id2, func)
3720
3721
3722# These two are square pegs that don't fit the PyEventBinder hole...
3723def EVT_COMMAND(win, id, cmd, func):
3724 win.Connect(id, -1, cmd, func)
3725def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3726 win.Connect(id1, id2, cmd, func)
3727
3728
3729#---------------------------------------------------------------------------
3730
3731#---------------------------------------------------------------------------
3732
3733EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3734EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3735
3736def NewEventType(*args, **kwargs):
3737 """NewEventType() -> wxEventType"""
3738 return _core_.NewEventType(*args, **kwargs)
3739wxEVT_NULL = _core_.wxEVT_NULL
3740wxEVT_FIRST = _core_.wxEVT_FIRST
3741wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3742wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3743wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3744wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3745wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3746wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3747wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3748wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3749wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3750wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3751wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3752wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3753wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3754wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3755wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3756wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3757wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3758wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3759wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3760wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3761wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3762wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3763wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3764wxEVT_MOTION = _core_.wxEVT_MOTION
3765wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3766wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3767wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3768wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3769wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3770wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3771wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3772wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3773wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3774wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3775wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3776wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3777wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3778wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3779wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3780wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3781wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3782wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3783wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3784wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3785wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3786wxEVT_CHAR = _core_.wxEVT_CHAR
3787wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3788wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3789wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3790wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3791wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3792wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3793wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3794wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3795wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3796wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3797wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3798wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3799wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3800wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
db67f999
RD
3801wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3802wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
d55e5bfc
RD
3803wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3804wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3805wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3806wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3807wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3808wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3809wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3810wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3811wxEVT_SIZE = _core_.wxEVT_SIZE
3812wxEVT_MOVE = _core_.wxEVT_MOVE
3813wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3814wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3815wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3816wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3817wxEVT_POWER = _core_.wxEVT_POWER
3818wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3819wxEVT_CREATE = _core_.wxEVT_CREATE
3820wxEVT_DESTROY = _core_.wxEVT_DESTROY
3821wxEVT_SHOW = _core_.wxEVT_SHOW
3822wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3823wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3824wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3825wxEVT_PAINT = _core_.wxEVT_PAINT
3826wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3827wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3828wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3829wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3830wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3831wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3832wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3833wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3834wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3835wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3836wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3837wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3838wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3839wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3840wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3841wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3842wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3843wxEVT_IDLE = _core_.wxEVT_IDLE
3844wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3845wxEVT_SIZING = _core_.wxEVT_SIZING
3846wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3847wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
d55e5bfc
RD
3848wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3849wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3850wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3851wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3852wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3853wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3854wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3855#
3856# Create some event binders
3857EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3858EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3859EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3860EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3861EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3862EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3863EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3864EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3865EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3866EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3867EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3868EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3869EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3870EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3871EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3872EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3873EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3874EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3875EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3876EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3877EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3878EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3879EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3880EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3881EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3882EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3883EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3884EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3885EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3886EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3887EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3888EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3889EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3890EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3891EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3892EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3893EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3894EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3895EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3896EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3897EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3898
3899EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3900EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3901EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3902EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3903EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3904EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3905EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3906EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3907EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3908EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3909EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3910EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3911EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3912
3913EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3914 wxEVT_LEFT_UP,
3915 wxEVT_MIDDLE_DOWN,
3916 wxEVT_MIDDLE_UP,
3917 wxEVT_RIGHT_DOWN,
3918 wxEVT_RIGHT_UP,
3919 wxEVT_MOTION,
3920 wxEVT_LEFT_DCLICK,
3921 wxEVT_MIDDLE_DCLICK,
3922 wxEVT_RIGHT_DCLICK,
3923 wxEVT_ENTER_WINDOW,
3924 wxEVT_LEAVE_WINDOW,
3925 wxEVT_MOUSEWHEEL
3926 ])
3927
3928
3929# Scrolling from wxWindow (sent to wxScrolledWindow)
3930EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3931 wxEVT_SCROLLWIN_BOTTOM,
3932 wxEVT_SCROLLWIN_LINEUP,
3933 wxEVT_SCROLLWIN_LINEDOWN,
3934 wxEVT_SCROLLWIN_PAGEUP,
3935 wxEVT_SCROLLWIN_PAGEDOWN,
3936 wxEVT_SCROLLWIN_THUMBTRACK,
3937 wxEVT_SCROLLWIN_THUMBRELEASE,
3938 ])
3939
3940EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3941EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3942EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3943EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3944EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3945EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3946EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3947EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3948
27fb7603 3949# Scrolling from wx.Slider and wx.ScrollBar
d55e5bfc
RD
3950EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3951 wxEVT_SCROLL_BOTTOM,
3952 wxEVT_SCROLL_LINEUP,
3953 wxEVT_SCROLL_LINEDOWN,
3954 wxEVT_SCROLL_PAGEUP,
3955 wxEVT_SCROLL_PAGEDOWN,
3956 wxEVT_SCROLL_THUMBTRACK,
3957 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3958 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3959 ])
3960
3961EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3962EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3963EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3964EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3965EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3966EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3967EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3968EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
db67f999
RD
3969EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3970EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3971
27fb7603 3972# Scrolling from wx.Slider and wx.ScrollBar, with an id
d55e5bfc
RD
3973EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3974 wxEVT_SCROLL_BOTTOM,
3975 wxEVT_SCROLL_LINEUP,
3976 wxEVT_SCROLL_LINEDOWN,
3977 wxEVT_SCROLL_PAGEUP,
3978 wxEVT_SCROLL_PAGEDOWN,
3979 wxEVT_SCROLL_THUMBTRACK,
3980 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3981 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3982 ], 1)
3983
3984EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3985EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3986EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3987EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3988EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3989EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3990EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3991EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
db67f999
RD
3992EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3993EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3994
3995EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3996EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3997EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3998EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3999EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
4000EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
4001EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
4002EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
4003EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
4004EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
4005
4006EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
4007EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
4008EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
4009EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4010EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4011EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4012EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4013EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4014EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4015
4016
4017EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4018EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4019EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4020EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4021EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4022EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4023EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4024
4025EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4026
4027EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4028EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4029
4030EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4031
4032
4033
4034#---------------------------------------------------------------------------
4035
4036class Event(Object):
27fb7603
RD
4037 """
4038 An event is a structure holding information about an event passed to a
4039 callback or member function. wx.Event is an abstract base class for
4040 other event classes
4041 """
d55e5bfc
RD
4042 def __init__(self): raise RuntimeError, "No constructor defined"
4043 def __repr__(self):
4044 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4045 def __del__(self, destroy=_core_.delete_Event):
4046 """__del__(self)"""
4047 try:
4048 if self.thisown: destroy(self)
4049 except: pass
4050
4051 def SetEventType(*args, **kwargs):
27fb7603
RD
4052 """
4053 SetEventType(self, wxEventType typ)
4054
4055 Sets the specific type of the event.
4056 """
d55e5bfc
RD
4057 return _core_.Event_SetEventType(*args, **kwargs)
4058
4059 def GetEventType(*args, **kwargs):
27fb7603
RD
4060 """
4061 GetEventType(self) -> wxEventType
4062
4063 Returns the identifier of the given event type, such as
4064 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4065 """
d55e5bfc
RD
4066 return _core_.Event_GetEventType(*args, **kwargs)
4067
4068 def GetEventObject(*args, **kwargs):
27fb7603
RD
4069 """
4070 GetEventObject(self) -> Object
4071
4072 Returns the object (usually a window) associated with the event, if
4073 any.
4074 """
d55e5bfc
RD
4075 return _core_.Event_GetEventObject(*args, **kwargs)
4076
4077 def SetEventObject(*args, **kwargs):
27fb7603
RD
4078 """
4079 SetEventObject(self, Object obj)
4080
4081 Sets the originating object, or in other words, obj is normally the
4082 object that is sending the event.
4083 """
d55e5bfc
RD
4084 return _core_.Event_SetEventObject(*args, **kwargs)
4085
4086 def GetTimestamp(*args, **kwargs):
4087 """GetTimestamp(self) -> long"""
4088 return _core_.Event_GetTimestamp(*args, **kwargs)
4089
4090 def SetTimestamp(*args, **kwargs):
4091 """SetTimestamp(self, long ts=0)"""
4092 return _core_.Event_SetTimestamp(*args, **kwargs)
4093
4094 def GetId(*args, **kwargs):
27fb7603
RD
4095 """
4096 GetId(self) -> int
4097
4098 Returns the identifier associated with this event, such as a button
4099 command id.
4100 """
d55e5bfc
RD
4101 return _core_.Event_GetId(*args, **kwargs)
4102
4103 def SetId(*args, **kwargs):
27fb7603
RD
4104 """
4105 SetId(self, int Id)
4106
4107 Set's the ID for the event. This is usually the ID of the window that
4108 is sending the event, but it can also be a command id from a menu
4109 item, etc.
4110 """
d55e5bfc
RD
4111 return _core_.Event_SetId(*args, **kwargs)
4112
4113 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4114 """
4115 IsCommandEvent(self) -> bool
4116
4117 Returns true if the event is or is derived from `wx.CommandEvent` else
4118 it returns false. Note: Exists only for optimization purposes.
4119 """
d55e5bfc
RD
4120 return _core_.Event_IsCommandEvent(*args, **kwargs)
4121
4122 def Skip(*args, **kwargs):
51b83b37
RD
4123 """
4124 Skip(self, bool skip=True)
4125
4126 Called by an event handler, it controls whether additional event
4127 handlers bound to this event will be called after the current event
4128 handler returns. Skip(false) (the default setting) will prevent
4129 additional event handlers from being called and control will be
4130 returned to the sender of the event immediately after the current
4131 handler has finished. Skip(True) will cause the event processing
4132 system to continue searching for a handler function for this event.
4133
4134 """
d55e5bfc
RD
4135 return _core_.Event_Skip(*args, **kwargs)
4136
4137 def GetSkipped(*args, **kwargs):
27fb7603
RD
4138 """
4139 GetSkipped(self) -> bool
4140
4141 Returns true if the event handler should be skipped, false otherwise.
4142 :see: `Skip`
4143 """
d55e5bfc
RD
4144 return _core_.Event_GetSkipped(*args, **kwargs)
4145
4146 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4147 """
4148 ShouldPropagate(self) -> bool
4149
4150 Test if this event should be propagated to the parent window or not,
4151 i.e. if the propagation level is currently greater than 0.
4152 """
d55e5bfc
RD
4153 return _core_.Event_ShouldPropagate(*args, **kwargs)
4154
4155 def StopPropagation(*args, **kwargs):
27fb7603
RD
4156 """
4157 StopPropagation(self) -> int
4158
4159 Stop the event from propagating to its parent window. Returns the old
4160 propagation level value which may be later passed to
4161 `ResumePropagation` to allow propagating the event again.
4162 """
d55e5bfc
RD
4163 return _core_.Event_StopPropagation(*args, **kwargs)
4164
4165 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4166 """
4167 ResumePropagation(self, int propagationLevel)
4168
4169 Resume the event propagation by restoring the propagation level. (For
4170 example, you can use the value returned by an earlier call to
4171 `StopPropagation`.)
4172
4173 """
d55e5bfc
RD
4174 return _core_.Event_ResumePropagation(*args, **kwargs)
4175
4176 def Clone(*args, **kwargs):
4177 """Clone(self) -> Event"""
4178 return _core_.Event_Clone(*args, **kwargs)
4179
4180
4181class EventPtr(Event):
4182 def __init__(self, this):
4183 self.this = this
4184 if not hasattr(self,"thisown"): self.thisown = 0
4185 self.__class__ = Event
4186_core_.Event_swigregister(EventPtr)
4187
4188#---------------------------------------------------------------------------
4189
4190class PropagationDisabler(object):
27fb7603
RD
4191 """
4192 Helper class to temporarily change an event not to propagate. Simply
4193 create an instance of this class and then whe it is destroyed the
4194 propogation of the event will be restored.
4195 """
d55e5bfc
RD
4196 def __repr__(self):
4197 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4198 def __init__(self, *args, **kwargs):
27fb7603
RD
4199 """
4200 __init__(self, Event event) -> PropagationDisabler
4201
4202 Helper class to temporarily change an event not to propagate. Simply
4203 create an instance of this class and then whe it is destroyed the
4204 propogation of the event will be restored.
4205 """
d55e5bfc
RD
4206 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
4207 self.this = newobj.this
4208 self.thisown = 1
4209 del newobj.thisown
4210 def __del__(self, destroy=_core_.delete_PropagationDisabler):
4211 """__del__(self)"""
4212 try:
4213 if self.thisown: destroy(self)
4214 except: pass
4215
4216
4217class PropagationDisablerPtr(PropagationDisabler):
4218 def __init__(self, this):
4219 self.this = this
4220 if not hasattr(self,"thisown"): self.thisown = 0
4221 self.__class__ = PropagationDisabler
4222_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
4223
4224class PropagateOnce(object):
27fb7603
RD
4225 """
4226 A helper class that will temporarily lower propagation level of an
4227 event. Simply create an instance of this class and then whe it is
4228 destroyed the propogation of the event will be restored.
4229 """
d55e5bfc
RD
4230 def __repr__(self):
4231 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4232 def __init__(self, *args, **kwargs):
27fb7603
RD
4233 """
4234 __init__(self, Event event) -> PropagateOnce
4235
4236 A helper class that will temporarily lower propagation level of an
4237 event. Simply create an instance of this class and then whe it is
4238 destroyed the propogation of the event will be restored.
4239 """
d55e5bfc
RD
4240 newobj = _core_.new_PropagateOnce(*args, **kwargs)
4241 self.this = newobj.this
4242 self.thisown = 1
4243 del newobj.thisown
4244 def __del__(self, destroy=_core_.delete_PropagateOnce):
4245 """__del__(self)"""
4246 try:
4247 if self.thisown: destroy(self)
4248 except: pass
4249
4250
4251class PropagateOncePtr(PropagateOnce):
4252 def __init__(self, this):
4253 self.this = this
4254 if not hasattr(self,"thisown"): self.thisown = 0
4255 self.__class__ = PropagateOnce
4256_core_.PropagateOnce_swigregister(PropagateOncePtr)
4257
4258#---------------------------------------------------------------------------
4259
4260class CommandEvent(Event):
27fb7603
RD
4261 """
4262 This event class contains information about command events, which
4263 originate from a variety of simple controls, as well as menus and
4264 toolbars.
4265 """
d55e5bfc
RD
4266 def __repr__(self):
4267 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4268 def __init__(self, *args, **kwargs):
27fb7603
RD
4269 """
4270 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4271
4272 This event class contains information about command events, which
4273 originate from a variety of simple controls, as well as menus and
4274 toolbars.
4275 """
d55e5bfc
RD
4276 newobj = _core_.new_CommandEvent(*args, **kwargs)
4277 self.this = newobj.this
4278 self.thisown = 1
4279 del newobj.thisown
4280 def GetSelection(*args, **kwargs):
27fb7603
RD
4281 """
4282 GetSelection(self) -> int
4283
4284 Returns item index for a listbox or choice selection event (not valid
4285 for a deselection).
4286 """
d55e5bfc
RD
4287 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4288
4289 def SetString(*args, **kwargs):
4290 """SetString(self, String s)"""
4291 return _core_.CommandEvent_SetString(*args, **kwargs)
4292
4293 def GetString(*args, **kwargs):
27fb7603
RD
4294 """
4295 GetString(self) -> String
4296
4297 Returns item string for a listbox or choice selection event (not valid
4298 for a deselection).
4299 """
d55e5bfc
RD
4300 return _core_.CommandEvent_GetString(*args, **kwargs)
4301
4302 def IsChecked(*args, **kwargs):
27fb7603
RD
4303 """
4304 IsChecked(self) -> bool
4305
4306 This method can be used with checkbox and menu events: for the
4307 checkboxes, the method returns true for a selection event and false
4308 for a deselection one. For the menu events, this method indicates if
4309 the menu item just has become checked or unchecked (and thus only
4310 makes sense for checkable menu items).
4311 """
d55e5bfc
RD
4312 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4313
4314 Checked = IsChecked
4315 def IsSelection(*args, **kwargs):
27fb7603
RD
4316 """
4317 IsSelection(self) -> bool
4318
4319 For a listbox or similar event, returns true if it is a selection,
4320 false if it is a deselection.
4321 """
d55e5bfc
RD
4322 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4323
4324 def SetExtraLong(*args, **kwargs):
4325 """SetExtraLong(self, long extraLong)"""
4326 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4327
4328 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4329 """
4330 GetExtraLong(self) -> long
4331
5ba5649b
RD
4332 Returns extra information dependant on the event objects type. If the
4333 event comes from a listbox selection, it is a boolean determining
4334 whether the event was a selection (true) or a deselection (false). A
4335 listbox deselection only occurs for multiple-selection boxes, and in
4336 this case the index and string values are indeterminate and the
4337 listbox must be examined by the application.
27fb7603 4338 """
d55e5bfc
RD
4339 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4340
4341 def SetInt(*args, **kwargs):
4342 """SetInt(self, int i)"""
4343 return _core_.CommandEvent_SetInt(*args, **kwargs)
4344
4345 def GetInt(*args, **kwargs):
27fb7603
RD
4346 """
4347 GetInt(self) -> long
4348
5ba5649b
RD
4349 Returns the integer identifier corresponding to a listbox, choice or
4350 radiobox selection (only if the event was a selection, not a
4351 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4352 """
d55e5bfc
RD
4353 return _core_.CommandEvent_GetInt(*args, **kwargs)
4354
4355 def Clone(*args, **kwargs):
4356 """Clone(self) -> Event"""
4357 return _core_.CommandEvent_Clone(*args, **kwargs)
4358
4359
4360class CommandEventPtr(CommandEvent):
4361 def __init__(self, this):
4362 self.this = this
4363 if not hasattr(self,"thisown"): self.thisown = 0
4364 self.__class__ = CommandEvent
4365_core_.CommandEvent_swigregister(CommandEventPtr)
4366
4367#---------------------------------------------------------------------------
4368
4369class NotifyEvent(CommandEvent):
27fb7603
RD
4370 """
4371 An instance of this class (or one of its derived classes) is sent from
4372 a control when the control's state is being changed and the control
4373 allows that change to be prevented from happening. The event handler
4374 can call `Veto` or `Allow` to tell the control what to do.
4375 """
d55e5bfc
RD
4376 def __repr__(self):
4377 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4378 def __init__(self, *args, **kwargs):
27fb7603
RD
4379 """
4380 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4381
4382 An instance of this class (or one of its derived classes) is sent from
4383 a control when the control's state is being changed and the control
4384 allows that change to be prevented from happening. The event handler
4385 can call `Veto` or `Allow` to tell the control what to do.
4386 """
d55e5bfc
RD
4387 newobj = _core_.new_NotifyEvent(*args, **kwargs)
4388 self.this = newobj.this
4389 self.thisown = 1
4390 del newobj.thisown
4391 def Veto(*args, **kwargs):
27fb7603
RD
4392 """
4393 Veto(self)
4394
4395 Prevents the change announced by this event from happening.
4396
4397 It is in general a good idea to notify the user about the reasons for
4398 vetoing the change because otherwise the applications behaviour (which
4399 just refuses to do what the user wants) might be quite surprising.
4400 """
d55e5bfc
RD
4401 return _core_.NotifyEvent_Veto(*args, **kwargs)
4402
4403 def Allow(*args, **kwargs):
27fb7603
RD
4404 """
4405 Allow(self)
4406
4407 This is the opposite of `Veto`: it explicitly allows the event to be
4408 processed. For most events it is not necessary to call this method as
4409 the events are allowed anyhow but some are forbidden by default (this
4410 will be mentioned in the corresponding event description).
4411 """
d55e5bfc
RD
4412 return _core_.NotifyEvent_Allow(*args, **kwargs)
4413
4414 def IsAllowed(*args, **kwargs):
27fb7603
RD
4415 """
4416 IsAllowed(self) -> bool
4417
4418 Returns true if the change is allowed (`Veto` hasn't been called) or
4419 false otherwise (if it was).
4420 """
d55e5bfc
RD
4421 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4422
4423
4424class NotifyEventPtr(NotifyEvent):
4425 def __init__(self, this):
4426 self.this = this
4427 if not hasattr(self,"thisown"): self.thisown = 0
4428 self.__class__ = NotifyEvent
4429_core_.NotifyEvent_swigregister(NotifyEventPtr)
4430
4431#---------------------------------------------------------------------------
4432
4433class ScrollEvent(CommandEvent):
27fb7603
RD
4434 """
4435 A scroll event holds information about events sent from stand-alone
4436 scrollbars and sliders. Note that scrolled windows do not send
4437 instnaces of this event class, but send the `wx.ScrollWinEvent`
4438 instead.
4439 """
d55e5bfc
RD
4440 def __repr__(self):
4441 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4442 def __init__(self, *args, **kwargs):
4443 """
4444 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4445 int orient=0) -> ScrollEvent
4446 """
4447 newobj = _core_.new_ScrollEvent(*args, **kwargs)
4448 self.this = newobj.this
4449 self.thisown = 1
4450 del newobj.thisown
4451 def GetOrientation(*args, **kwargs):
27fb7603
RD
4452 """
4453 GetOrientation(self) -> int
4454
4455 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4456 the scrollbar.
4457 """
d55e5bfc
RD
4458 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4459
4460 def GetPosition(*args, **kwargs):
27fb7603
RD
4461 """
4462 GetPosition(self) -> int
4463
4464 Returns the position of the scrollbar.
4465 """
d55e5bfc
RD
4466 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4467
4468 def SetOrientation(*args, **kwargs):
4469 """SetOrientation(self, int orient)"""
4470 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4471
4472 def SetPosition(*args, **kwargs):
4473 """SetPosition(self, int pos)"""
4474 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4475
4476
4477class ScrollEventPtr(ScrollEvent):
4478 def __init__(self, this):
4479 self.this = this
4480 if not hasattr(self,"thisown"): self.thisown = 0
4481 self.__class__ = ScrollEvent
4482_core_.ScrollEvent_swigregister(ScrollEventPtr)
4483
4484#---------------------------------------------------------------------------
4485
4486class ScrollWinEvent(Event):
27fb7603
RD
4487 """
4488 A wx.ScrollWinEvent holds information about scrolling and is sent from
4489 scrolling windows.
4490 """
d55e5bfc
RD
4491 def __repr__(self):
4492 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4493 def __init__(self, *args, **kwargs):
27fb7603
RD
4494 """
4495 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4496
4497 A wx.ScrollWinEvent holds information about scrolling and is sent from
4498 scrolling windows.
4499 """
d55e5bfc
RD
4500 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
4501 self.this = newobj.this
4502 self.thisown = 1
4503 del newobj.thisown
4504 def GetOrientation(*args, **kwargs):
27fb7603
RD
4505 """
4506 GetOrientation(self) -> int
4507
4508 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4509 the scrollbar.
4510 """
d55e5bfc
RD
4511 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4512
4513 def GetPosition(*args, **kwargs):
27fb7603
RD
4514 """
4515 GetPosition(self) -> int
4516
4517 Returns the position of the scrollbar for the thumb track and release
4518 events. Note that this field can't be used for the other events, you
4519 need to query the window itself for the current position in that case.
4520 """
d55e5bfc
RD
4521 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4522
4523 def SetOrientation(*args, **kwargs):
4524 """SetOrientation(self, int orient)"""
4525 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4526
4527 def SetPosition(*args, **kwargs):
4528 """SetPosition(self, int pos)"""
4529 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4530
4531
4532class ScrollWinEventPtr(ScrollWinEvent):
4533 def __init__(self, this):
4534 self.this = this
4535 if not hasattr(self,"thisown"): self.thisown = 0
4536 self.__class__ = ScrollWinEvent
4537_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
4538
4539#---------------------------------------------------------------------------
4540
4541MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4542MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4543MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4544MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4545MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4546class MouseEvent(Event):
27fb7603
RD
4547 """
4548 This event class contains information about the events generated by
4549 the mouse: they include mouse buttons press and release events and
4550 mouse move events.
4551
4552 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4553 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4554 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4555 a middle button so a portable application should avoid relying on the
4556 events from it.
4557
4558 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4559 the former returns true when the event corresponds to the left mouse
4560 button click while the latter returns true if the left mouse button is
4561 currently being pressed. For example, when the user is dragging the
4562 mouse you can use `LeftIsDown` to test whether the left mouse button
4563 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4564 `LeftIsDown` will also return true in wxWidgets whatever the
4565 underlying GUI behaviour is (which is platform-dependent). The same
4566 applies, of course, to other mouse buttons as well.
4567 """
d55e5bfc
RD
4568 def __repr__(self):
4569 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4570 def __init__(self, *args, **kwargs):
27fb7603
RD
4571 """
4572 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4573
4574 Constructs a wx.MouseEvent. Valid event types are:
4575
4576 * wxEVT_ENTER_WINDOW
4577 * wxEVT_LEAVE_WINDOW
4578 * wxEVT_LEFT_DOWN
4579 * wxEVT_LEFT_UP
4580 * wxEVT_LEFT_DCLICK
4581 * wxEVT_MIDDLE_DOWN
4582 * wxEVT_MIDDLE_UP
4583 * wxEVT_MIDDLE_DCLICK
4584 * wxEVT_RIGHT_DOWN
4585 * wxEVT_RIGHT_UP
4586 * wxEVT_RIGHT_DCLICK
4587 * wxEVT_MOTION
4588 * wxEVT_MOUSEWHEEL
4589 """
d55e5bfc
RD
4590 newobj = _core_.new_MouseEvent(*args, **kwargs)
4591 self.this = newobj.this
4592 self.thisown = 1
4593 del newobj.thisown
4594 def IsButton(*args, **kwargs):
27fb7603
RD
4595 """
4596 IsButton(self) -> bool
4597
4598 Returns true if the event was a mouse button event (not necessarily a
4599 button down event - that may be tested using `ButtonDown`).
4600 """
d55e5bfc
RD
4601 return _core_.MouseEvent_IsButton(*args, **kwargs)
4602
4603 def ButtonDown(*args, **kwargs):
27fb7603
RD
4604 """
4605 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4606
5ba5649b
RD
4607 If the argument is omitted, this returns true if the event was any
4608 mouse button down event. Otherwise the argument specifies which
4609 button-down event shold be checked for (see `Button` for the possible
4610 values).
27fb7603 4611 """
d55e5bfc
RD
4612 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4613
4614 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4615 """
4616 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4617
4618 If the argument is omitted, this returns true if the event was any
4619 mouse double click event. Otherwise the argument specifies which
4620 double click event to check for (see `Button` for the possible
4621 values).
4622 """
d55e5bfc
RD
4623 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4624
4625 def ButtonUp(*args, **kwargs):
27fb7603
RD
4626 """
4627 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4628
4629 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4630 mouse button up event. Otherwise the argument specifies which button
4631 up event to check for (see `Button` for the possible values).
27fb7603 4632 """
d55e5bfc
RD
4633 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4634
4635 def Button(*args, **kwargs):
27fb7603
RD
4636 """
4637 Button(self, int button) -> bool
4638
4639 Returns true if the identified mouse button is changing state. Valid
4640 values of button are:
4641
4642 ==================== =====================================
4643 wx.MOUSE_BTN_LEFT check if left button was pressed
4644 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4645 wx.MOUSE_BTN_RIGHT check if right button was pressed
4646 wx.MOUSE_BTN_ANY check if any button was pressed
4647 ==================== =====================================
4648
4649 """
d55e5bfc
RD
4650 return _core_.MouseEvent_Button(*args, **kwargs)
4651
4652 def ButtonIsDown(*args, **kwargs):
4653 """ButtonIsDown(self, int but) -> bool"""
4654 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4655
4656 def GetButton(*args, **kwargs):
27fb7603
RD
4657 """
4658 GetButton(self) -> int
4659
4660 Returns the mouse button which generated this event or
4661 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4662 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4663 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4664 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4665 right buttons respectively.
4666 """
d55e5bfc
RD
4667 return _core_.MouseEvent_GetButton(*args, **kwargs)
4668
4669 def ControlDown(*args, **kwargs):
27fb7603
RD
4670 """
4671 ControlDown(self) -> bool
4672
4673 Returns true if the control key was down at the time of the event.
4674 """
d55e5bfc
RD
4675 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4676
4677 def MetaDown(*args, **kwargs):
27fb7603
RD
4678 """
4679 MetaDown(self) -> bool
4680
4681 Returns true if the Meta key was down at the time of the event.
4682 """
d55e5bfc
RD
4683 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4684
4685 def AltDown(*args, **kwargs):
27fb7603
RD
4686 """
4687 AltDown(self) -> bool
4688
4689 Returns true if the Alt key was down at the time of the event.
4690 """
d55e5bfc
RD
4691 return _core_.MouseEvent_AltDown(*args, **kwargs)
4692
4693 def ShiftDown(*args, **kwargs):
27fb7603
RD
4694 """
4695 ShiftDown(self) -> bool
4696
4697 Returns true if the Shift key was down at the time of the event.
4698 """
d55e5bfc
RD
4699 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4700
412d302d
RD
4701 def CmdDown(*args, **kwargs):
4702 """
4703 CmdDown(self) -> bool
4704
4705 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4706 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4707 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4708 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4709 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4710 purpose. So for non-Mac platforms this is the same as `ControlDown`
4711 and Macs this is the same as `MetaDown`.
4712 """
4713 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4714
d55e5bfc 4715 def LeftDown(*args, **kwargs):
27fb7603
RD
4716 """
4717 LeftDown(self) -> bool
4718
4719 Returns true if the left mouse button state changed to down.
4720 """
d55e5bfc
RD
4721 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4722
4723 def MiddleDown(*args, **kwargs):
27fb7603
RD
4724 """
4725 MiddleDown(self) -> bool
4726
4727 Returns true if the middle mouse button state changed to down.
4728 """
d55e5bfc
RD
4729 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4730
4731 def RightDown(*args, **kwargs):
27fb7603
RD
4732 """
4733 RightDown(self) -> bool
4734
4735 Returns true if the right mouse button state changed to down.
4736 """
d55e5bfc
RD
4737 return _core_.MouseEvent_RightDown(*args, **kwargs)
4738
4739 def LeftUp(*args, **kwargs):
27fb7603
RD
4740 """
4741 LeftUp(self) -> bool
4742
4743 Returns true if the left mouse button state changed to up.
4744 """
d55e5bfc
RD
4745 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4746
4747 def MiddleUp(*args, **kwargs):
27fb7603
RD
4748 """
4749 MiddleUp(self) -> bool
4750
4751 Returns true if the middle mouse button state changed to up.
4752 """
d55e5bfc
RD
4753 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4754
4755 def RightUp(*args, **kwargs):
27fb7603
RD
4756 """
4757 RightUp(self) -> bool
4758
4759 Returns true if the right mouse button state changed to up.
4760 """
d55e5bfc
RD
4761 return _core_.MouseEvent_RightUp(*args, **kwargs)
4762
4763 def LeftDClick(*args, **kwargs):
27fb7603
RD
4764 """
4765 LeftDClick(self) -> bool
4766
4767 Returns true if the event was a left button double click.
4768 """
d55e5bfc
RD
4769 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4770
4771 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4772 """
4773 MiddleDClick(self) -> bool
4774
4775 Returns true if the event was a middle button double click.
4776 """
d55e5bfc
RD
4777 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4778
4779 def RightDClick(*args, **kwargs):
27fb7603
RD
4780 """
4781 RightDClick(self) -> bool
4782
4783 Returns true if the event was a right button double click.
4784 """
d55e5bfc
RD
4785 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4786
4787 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4788 """
4789 LeftIsDown(self) -> bool
4790
4791 Returns true if the left mouse button is currently down, independent
4792 of the current event type.
4793
4794 Please notice that it is not the same as LeftDown which returns true
4795 if the left mouse button was just pressed. Rather, it describes the
4796 state of the mouse button before the event happened.
4797
4798 This event is usually used in the mouse event handlers which process
4799 "move mouse" messages to determine whether the user is (still)
4800 dragging the mouse.
4801 """
d55e5bfc
RD
4802 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4803
4804 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4805 """
4806 MiddleIsDown(self) -> bool
4807
4808 Returns true if the middle mouse button is currently down, independent
4809 of the current event type.
4810 """
d55e5bfc
RD
4811 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4812
4813 def RightIsDown(*args, **kwargs):
27fb7603
RD
4814 """
4815 RightIsDown(self) -> bool
4816
4817 Returns true if the right mouse button is currently down, independent
4818 of the current event type.
4819 """
d55e5bfc
RD
4820 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4821
4822 def Dragging(*args, **kwargs):
27fb7603
RD
4823 """
4824 Dragging(self) -> bool
4825
4826 Returns true if this was a dragging event (motion while a button is
4827 depressed).
4828 """
d55e5bfc
RD
4829 return _core_.MouseEvent_Dragging(*args, **kwargs)
4830
4831 def Moving(*args, **kwargs):
27fb7603
RD
4832 """
4833 Moving(self) -> bool
4834
4835 Returns true if this was a motion event and no mouse buttons were
4836 pressed. If any mouse button is held pressed, then this method returns
4837 false and Dragging returns true.
4838 """
d55e5bfc
RD
4839 return _core_.MouseEvent_Moving(*args, **kwargs)
4840
4841 def Entering(*args, **kwargs):
27fb7603
RD
4842 """
4843 Entering(self) -> bool
4844
4845 Returns true if the mouse was entering the window.
4846 """
d55e5bfc
RD
4847 return _core_.MouseEvent_Entering(*args, **kwargs)
4848
4849 def Leaving(*args, **kwargs):
27fb7603
RD
4850 """
4851 Leaving(self) -> bool
4852
4853 Returns true if the mouse was leaving the window.
4854 """
d55e5bfc
RD
4855 return _core_.MouseEvent_Leaving(*args, **kwargs)
4856
4857 def GetPosition(*args, **kwargs):
4858 """
4859 GetPosition(self) -> Point
4860
27fb7603
RD
4861 Returns the pixel position of the mouse in window coordinates when the
4862 event happened.
d55e5bfc
RD
4863 """
4864 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4865
4866 def GetPositionTuple(*args, **kwargs):
4867 """
4868 GetPositionTuple() -> (x,y)
4869
27fb7603
RD
4870 Returns the pixel position of the mouse in window coordinates when the
4871 event happened.
d55e5bfc
RD
4872 """
4873 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4874
4875 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4876 """
4877 GetLogicalPosition(self, DC dc) -> Point
4878
4879 Returns the logical mouse position in pixels (i.e. translated
4880 according to the translation set for the DC, which usually indicates
4881 that the window has been scrolled).
4882 """
d55e5bfc
RD
4883 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4884
4885 def GetX(*args, **kwargs):
27fb7603
RD
4886 """
4887 GetX(self) -> int
4888
4889 Returns X coordinate of the physical mouse event position.
4890 """
d55e5bfc
RD
4891 return _core_.MouseEvent_GetX(*args, **kwargs)
4892
4893 def GetY(*args, **kwargs):
27fb7603
RD
4894 """
4895 GetY(self) -> int
4896
4897 Returns Y coordinate of the physical mouse event position.
4898 """
d55e5bfc
RD
4899 return _core_.MouseEvent_GetY(*args, **kwargs)
4900
4901 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4902 """
4903 GetWheelRotation(self) -> int
4904
4905 Get wheel rotation, positive or negative indicates direction of
4906 rotation. Current devices all send an event when rotation is equal to
4907 +/-WheelDelta, but this allows for finer resolution devices to be
4908 created in the future. Because of this you shouldn't assume that one
4909 event is equal to 1 line or whatever, but you should be able to either
4910 do partial line scrolling or wait until +/-WheelDelta rotation values
4911 have been accumulated before scrolling.
4912 """
d55e5bfc
RD
4913 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4914
4915 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4916 """
4917 GetWheelDelta(self) -> int
4918
4919 Get wheel delta, normally 120. This is the threshold for action to be
4920 taken, and one such action (for example, scrolling one increment)
4921 should occur for each delta.
4922 """
d55e5bfc
RD
4923 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4924
4925 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4926 """
4927 GetLinesPerAction(self) -> int
4928
4929 Returns the configured number of lines (or whatever) to be scrolled
4930 per wheel action. Defaults to three.
4931 """
d55e5bfc
RD
4932 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4933
4934 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4935 """
4936 IsPageScroll(self) -> bool
4937
4938 Returns true if the system has been setup to do page scrolling with
4939 the mouse wheel instead of line scrolling.
4940 """
d55e5bfc
RD
4941 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4942
4943 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4944 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4945 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4946 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4947 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4948 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4949 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4950 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4951 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4952 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4953 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4954 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4955
4956class MouseEventPtr(MouseEvent):
4957 def __init__(self, this):
4958 self.this = this
4959 if not hasattr(self,"thisown"): self.thisown = 0
4960 self.__class__ = MouseEvent
4961_core_.MouseEvent_swigregister(MouseEventPtr)
4962
4963#---------------------------------------------------------------------------
4964
4965class SetCursorEvent(Event):
5ba5649b
RD
4966 """
4967 A SetCursorEvent is generated when the mouse cursor is about to be set
4968 as a result of mouse motion. This event gives the application the
4969 chance to perform specific mouse cursor processing based on the
4970 current position of the mouse within the window. Use the `SetCursor`
4971 method to specify the cursor you want to be displayed.
4972 """
d55e5bfc
RD
4973 def __repr__(self):
4974 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4975 def __init__(self, *args, **kwargs):
5ba5649b
RD
4976 """
4977 __init__(self, int x=0, int y=0) -> SetCursorEvent
4978
4979 Construct a new `wx.SetCursorEvent`.
4980 """
d55e5bfc
RD
4981 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
4982 self.this = newobj.this
4983 self.thisown = 1
4984 del newobj.thisown
4985 def GetX(*args, **kwargs):
5ba5649b
RD
4986 """
4987 GetX(self) -> int
4988
4989 Returns the X coordinate of the mouse in client coordinates.
4990 """
d55e5bfc
RD
4991 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4992
4993 def GetY(*args, **kwargs):
5ba5649b
RD
4994 """
4995 GetY(self) -> int
4996
4997 Returns the Y coordinate of the mouse in client coordinates.
4998 """
d55e5bfc
RD
4999 return _core_.SetCursorEvent_GetY(*args, **kwargs)
5000
5001 def SetCursor(*args, **kwargs):
5ba5649b
RD
5002 """
5003 SetCursor(self, Cursor cursor)
5004
5005 Sets the cursor associated with this event.
5006 """
d55e5bfc
RD
5007 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
5008
5009 def GetCursor(*args, **kwargs):
5ba5649b
RD
5010 """
5011 GetCursor(self) -> Cursor
5012
5013 Returns a reference to the cursor specified by this event.
5014 """
d55e5bfc
RD
5015 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
5016
5017 def HasCursor(*args, **kwargs):
5ba5649b
RD
5018 """
5019 HasCursor(self) -> bool
5020
5021 Returns true if the cursor specified by this event is a valid cursor.
5022 """
d55e5bfc
RD
5023 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
5024
5025
5026class SetCursorEventPtr(SetCursorEvent):
5027 def __init__(self, this):
5028 self.this = this
5029 if not hasattr(self,"thisown"): self.thisown = 0
5030 self.__class__ = SetCursorEvent
5031_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
5032
5033#---------------------------------------------------------------------------
5034
5035class KeyEvent(Event):
5ba5649b
RD
5036 """
5037 This event class contains information about keypress and character
5038 events. These events are only sent to the widget that currently has
5039 the keyboard focus.
5040
5041 Notice that there are three different kinds of keyboard events in
5042 wxWidgets: key down and up events and char events. The difference
5043 between the first two is clear - the first corresponds to a key press
5044 and the second to a key release - otherwise they are identical. Just
5045 note that if the key is maintained in a pressed state you will
5046 typically get a lot of (automatically generated) down events but only
5047 one up so it is wrong to assume that there is one up event
5048 corresponding to each down one.
5049
5050 Both key events provide untranslated key codes while the char event
5051 carries the translated one. The untranslated code for alphanumeric
5052 keys is always an upper case value. For the other keys it is one of
5053 WXK_XXX values from the keycodes table. The translated key is, in
5054 general, the character the user expects to appear as the result of the
5055 key combination when typing the text into a text entry zone, for
5056 example.
5057
5058 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5059 and the standard US keyboard): when the 'A' key is pressed, the key
5060 down event key code is equal to ASCII A == 65. But the char event key
5061 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5062 'A' keys simultaneously , the key code in key down event will still be
5063 just 'A' while the char event key code parameter will now be 'A' as
5064 well.
5065
5066 Although in this simple case it is clear that the correct key code
5067 could be found in the key down event handler by checking the value
5068 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5069 as for non alphanumeric keys or non-US keyboard layouts the
5070 translation is keyboard-layout dependent and can only be done properly
5071 by the system itself.
5072
5073 Another kind of translation is done when the control key is pressed:
5074 for example, for CTRL-A key press the key down event still carries the
5075 same key code 'A' as usual but the char event will have key code of 1,
5076 the ASCII value of this key combination.
5077
5078 You may discover how the other keys on your system behave
5079 interactively by running the KeyEvents sample in the wxPython demo and
5080 pressing some keys while the blue box at the top has the keyboard
5081 focus.
5082
5083 **Note**: If a key down event is caught and the event handler does not
5084 call event.Skip() then the coresponding char event will not
5085 happen. This is by design and enables the programs that handle both
5086 types of events to be a bit simpler.
5087
5088 **Note for Windows programmers**: The key and char events in wxWidgets
5089 are similar to but slightly different from Windows WM_KEYDOWN and
5090 WM_CHAR events. In particular, Alt-x combination will generate a char
5091 event in wxWidgets (unless it is used as an accelerator).
5092
5093 **Tip**: be sure to call event.Skip() for events that you don't
5094 process in key event function, otherwise menu shortcuts may cease to
5095 work under Windows.
5096
5097 """
d55e5bfc
RD
5098 def __repr__(self):
5099 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5100 def __init__(self, *args, **kwargs):
5ba5649b
RD
5101 """
5102 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
5103
5104 Construct a new `wx.KeyEvent`. Valid event types are:
5105 *
5106 """
d55e5bfc
RD
5107 newobj = _core_.new_KeyEvent(*args, **kwargs)
5108 self.this = newobj.this
5109 self.thisown = 1
5110 del newobj.thisown
b1fcee84
RD
5111 def GetModifiers(*args, **kwargs):
5112 """
5113 GetModifiers(self) -> int
5114
5115 Returns a bitmask of the current modifier settings. Can be used to
5116 check if the key event has exactly the given modifiers without having
5117 to explicitly check that the other modifiers are not down. For
5118 example::
5119
5120 if event.GetModifers() == wx.MOD_CONTROL:
5121 DoSomething()
5122
5123 """
5124 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
5125
d55e5bfc 5126 def ControlDown(*args, **kwargs):
5ba5649b
RD
5127 """
5128 ControlDown(self) -> bool
5129
5130 Returns ``True`` if the Control key was down at the time of the event.
5131 """
d55e5bfc
RD
5132 return _core_.KeyEvent_ControlDown(*args, **kwargs)
5133
5134 def MetaDown(*args, **kwargs):
5ba5649b
RD
5135 """
5136 MetaDown(self) -> bool
5137
5138 Returns ``True`` if the Meta key was down at the time of the event.
5139 """
d55e5bfc
RD
5140 return _core_.KeyEvent_MetaDown(*args, **kwargs)
5141
5142 def AltDown(*args, **kwargs):
5ba5649b
RD
5143 """
5144 AltDown(self) -> bool
5145
5146 Returns ``True`` if the Alt key was down at the time of the event.
5147 """
d55e5bfc
RD
5148 return _core_.KeyEvent_AltDown(*args, **kwargs)
5149
5150 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5151 """
5152 ShiftDown(self) -> bool
5153
5154 Returns ``True`` if the Shift key was down at the time of the event.
5155 """
d55e5bfc
RD
5156 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
5157
412d302d
RD
5158 def CmdDown(*args, **kwargs):
5159 """
5160 CmdDown(self) -> bool
5161
5162 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5163 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5164 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5165 because Cmd key is used for the same thing under Mac as Ctrl
5166 elsewhere. The Ctrl still exists, it's just not used for this
5167 purpose. So for non-Mac platforms this is the same as `ControlDown`
5168 and Macs this is the same as `MetaDown`.
5169 """
5170 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5171
d55e5bfc 5172 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5173 """
5174 HasModifiers(self) -> bool
5175
5176 Returns true if either CTRL or ALT keys was down at the time of the
5177 key event. Note that this function does not take into account neither
5178 SHIFT nor META key states (the reason for ignoring the latter is that
5179 it is common for NUMLOCK key to be configured as META under X but the
5180 key presses even while NUMLOCK is on should be still processed
5181 normally).
5182 """
d55e5bfc
RD
5183 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
5184
5185 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5186 """
5187 GetKeyCode(self) -> int
5188
5189 Returns the virtual key code. ASCII events return normal ASCII values,
5190 while non-ASCII events return values such as WXK_LEFT for the left
5191 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5192 codes.
5193
5194 Note that in Unicode build, the returned value is meaningful only if
5195 the user entered a character that can be represented in current
5196 locale's default charset. You can obtain the corresponding Unicode
5197 character using `GetUnicodeKey`.
5198 """
d55e5bfc
RD
5199 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
5200
5201 KeyCode = GetKeyCode
19272049 5202 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5203 """
5204 GetUnicodeKey(self) -> int
5205
5206 Returns the Unicode character corresponding to this key event. This
5207 function is only meaningfule in a Unicode build of wxPython.
5208 """
19272049 5209 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5210
19272049 5211 GetUniChar = GetUnicodeKey
d55e5bfc 5212 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5213 """
5214 GetRawKeyCode(self) -> unsigned int
5215
5216 Returns the raw key code for this event. This is a platform-dependent
5217 scan code which should only be used in advanced
5218 applications. Currently the raw key codes are not supported by all
5219 ports.
5220 """
d55e5bfc
RD
5221 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
5222
5223 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5224 """
5225 GetRawKeyFlags(self) -> unsigned int
5226
5227 Returns the low level key flags for this event. The flags are
5228 platform-dependent and should only be used in advanced applications.
5229 Currently the raw key flags are not supported by all ports.
5230 """
d55e5bfc
RD
5231 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
5232
5233 def GetPosition(*args, **kwargs):
5234 """
5235 GetPosition(self) -> Point
5236
5ba5649b 5237 Find the position of the event, if applicable.
d55e5bfc
RD
5238 """
5239 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5240
5241 def GetPositionTuple(*args, **kwargs):
5242 """
5243 GetPositionTuple() -> (x,y)
5244
5ba5649b 5245 Find the position of the event, if applicable.
d55e5bfc
RD
5246 """
5247 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5248
5249 def GetX(*args, **kwargs):
5ba5649b
RD
5250 """
5251 GetX(self) -> int
5252
5253 Returns the X position (in client coordinates) of the event, if
5254 applicable.
5255 """
d55e5bfc
RD
5256 return _core_.KeyEvent_GetX(*args, **kwargs)
5257
5258 def GetY(*args, **kwargs):
5ba5649b
RD
5259 """
5260 GetY(self) -> int
5261
5262 Returns the Y position (in client coordinates) of the event, if
5263 applicable.
5264 """
d55e5bfc
RD
5265 return _core_.KeyEvent_GetY(*args, **kwargs)
5266
5267 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5268 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5269 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5270 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5271 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5272 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5273 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5274 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5275 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5276 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5277
5278class KeyEventPtr(KeyEvent):
5279 def __init__(self, this):
5280 self.this = this
5281 if not hasattr(self,"thisown"): self.thisown = 0
5282 self.__class__ = KeyEvent
5283_core_.KeyEvent_swigregister(KeyEventPtr)
5284
5285#---------------------------------------------------------------------------
5286
5287class SizeEvent(Event):
5ba5649b
RD
5288 """
5289 A size event holds information about size change events. The EVT_SIZE
5290 handler function will be called when the window it is bound to has
5291 been resized.
5292
5293 Note that the size passed is of the whole window: call
5294 `wx.Window.GetClientSize` for the area which may be used by the
5295 application.
5296
5297 When a window is resized, usually only a small part of the window is
5298 damaged and and that area is all that is in the update region for the
5299 next paint event. However, if your drawing depends on the size of the
5300 window, you may need to clear the DC explicitly and repaint the whole
5301 window. In which case, you may need to call `wx.Window.Refresh` to
5302 invalidate the entire window.
5303
5304 """
d55e5bfc
RD
5305 def __repr__(self):
5306 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5307 def __init__(self, *args, **kwargs):
5ba5649b
RD
5308 """
5309 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5310
5311 Construct a new ``wx.SizeEvent``.
5312 """
d55e5bfc
RD
5313 newobj = _core_.new_SizeEvent(*args, **kwargs)
5314 self.this = newobj.this
5315 self.thisown = 1
5316 del newobj.thisown
5317 def GetSize(*args, **kwargs):
5ba5649b
RD
5318 """
5319 GetSize(self) -> Size
5320
5321 Returns the entire size of the window generating the size change
5322 event.
5323 """
d55e5bfc
RD
5324 return _core_.SizeEvent_GetSize(*args, **kwargs)
5325
5326 def GetRect(*args, **kwargs):
5327 """GetRect(self) -> Rect"""
5328 return _core_.SizeEvent_GetRect(*args, **kwargs)
5329
5330 def SetRect(*args, **kwargs):
5331 """SetRect(self, Rect rect)"""
5332 return _core_.SizeEvent_SetRect(*args, **kwargs)
5333
5334 def SetSize(*args, **kwargs):
5335 """SetSize(self, Size size)"""
5336 return _core_.SizeEvent_SetSize(*args, **kwargs)
5337
5338 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5339 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5340
5341class SizeEventPtr(SizeEvent):
5342 def __init__(self, this):
5343 self.this = this
5344 if not hasattr(self,"thisown"): self.thisown = 0
5345 self.__class__ = SizeEvent
5346_core_.SizeEvent_swigregister(SizeEventPtr)
5347
5348#---------------------------------------------------------------------------
5349
5350class MoveEvent(Event):
5ba5649b
RD
5351 """
5352 This event object is sent for EVT_MOVE event bindings when a window is
5353 moved to a new position.
5354 """
d55e5bfc
RD
5355 def __repr__(self):
5356 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5357 def __init__(self, *args, **kwargs):
5ba5649b
RD
5358 """
5359 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5360
5361 Constructor.
5362 """
d55e5bfc
RD
5363 newobj = _core_.new_MoveEvent(*args, **kwargs)
5364 self.this = newobj.this
5365 self.thisown = 1
5366 del newobj.thisown
5367 def GetPosition(*args, **kwargs):
5ba5649b
RD
5368 """
5369 GetPosition(self) -> Point
5370
5371 Returns the position of the window generating the move change event.
5372 """
d55e5bfc
RD
5373 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5374
5375 def GetRect(*args, **kwargs):
5376 """GetRect(self) -> Rect"""
5377 return _core_.MoveEvent_GetRect(*args, **kwargs)
5378
5379 def SetRect(*args, **kwargs):
5380 """SetRect(self, Rect rect)"""
5381 return _core_.MoveEvent_SetRect(*args, **kwargs)
5382
5383 def SetPosition(*args, **kwargs):
5384 """SetPosition(self, Point pos)"""
5385 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5386
fef4c27a
RD
5387 m_pos = property(GetPosition, SetPosition)
5388 m_rect = property(GetRect, SetRect)
5389
d55e5bfc
RD
5390
5391class MoveEventPtr(MoveEvent):
5392 def __init__(self, this):
5393 self.this = this
5394 if not hasattr(self,"thisown"): self.thisown = 0
5395 self.__class__ = MoveEvent
5396_core_.MoveEvent_swigregister(MoveEventPtr)
5397
5398#---------------------------------------------------------------------------
5399
5400class PaintEvent(Event):
5ba5649b
RD
5401 """
5402 A paint event is sent when a window's contents needs to be repainted.
5403 Note that in an EVT_PAINT handler the application must *always* create
5404 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5405 Windows assumes that the window has not been painted yet and will send
5406 the event again, causing endless refreshes.
5407
5408 You can optimize painting by retrieving the rectangles that have been
5409 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5410 and only repainting these rectangles. The rectangles are in terms of
5411 the client area, and are unscrolled, so you will need to do some
5412 calculations using the current view position to obtain logical,
5413 scrolled units.
5414
5415 """
d55e5bfc
RD
5416 def __repr__(self):
5417 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5418 def __init__(self, *args, **kwargs):
5419 """__init__(self, int Id=0) -> PaintEvent"""
5420 newobj = _core_.new_PaintEvent(*args, **kwargs)
5421 self.this = newobj.this
5422 self.thisown = 1
5423 del newobj.thisown
5424
5425class PaintEventPtr(PaintEvent):
5426 def __init__(self, this):
5427 self.this = this
5428 if not hasattr(self,"thisown"): self.thisown = 0
5429 self.__class__ = PaintEvent
5430_core_.PaintEvent_swigregister(PaintEventPtr)
5431
5432class NcPaintEvent(Event):
093d3ff1 5433 """Proxy of C++ NcPaintEvent class"""
d55e5bfc
RD
5434 def __repr__(self):
5435 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5436 def __init__(self, *args, **kwargs):
5437 """__init__(self, int winid=0) -> NcPaintEvent"""
5438 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
5439 self.this = newobj.this
5440 self.thisown = 1
5441 del newobj.thisown
5442
5443class NcPaintEventPtr(NcPaintEvent):
5444 def __init__(self, this):
5445 self.this = this
5446 if not hasattr(self,"thisown"): self.thisown = 0
5447 self.__class__ = NcPaintEvent
5448_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
5449
5450#---------------------------------------------------------------------------
5451
5452class EraseEvent(Event):
5ba5649b
RD
5453 """
5454 An erase event is sent whenever the background of a window needs to be
5455 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5456 binder. On some platforms, such as GTK+, this event is simulated
5457 (simply generated just before the paint event) and may cause flicker.
5458
5459 To paint a custom background use the `GetDC` method and use the returned
5460 device context if it is not ``None``, otherwise create a temporary
5461 `wx.ClientDC` and draw on that.
5462
5463 """
d55e5bfc
RD
5464 def __repr__(self):
5465 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5466 def __init__(self, *args, **kwargs):
5ba5649b
RD
5467 """
5468 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5469
5470 Constructor
5471 """
d55e5bfc
RD
5472 newobj = _core_.new_EraseEvent(*args, **kwargs)
5473 self.this = newobj.this
5474 self.thisown = 1
5475 del newobj.thisown
5476 def GetDC(*args, **kwargs):
5ba5649b
RD
5477 """
5478 GetDC(self) -> DC
5479
5480 Returns the device context the event handler should draw upon. If
5481 ``None`` is returned then create a temporary `wx.ClientDC` and use
5482 that instead.
5483 """
d55e5bfc
RD
5484 return _core_.EraseEvent_GetDC(*args, **kwargs)
5485
5486
5487class EraseEventPtr(EraseEvent):
5488 def __init__(self, this):
5489 self.this = this
5490 if not hasattr(self,"thisown"): self.thisown = 0
5491 self.__class__ = EraseEvent
5492_core_.EraseEvent_swigregister(EraseEventPtr)
5493
5494#---------------------------------------------------------------------------
5495
5496class FocusEvent(Event):
5ba5649b
RD
5497 """
5498 A focus event is sent when a window's focus changes. The window losing
5499 focus receives an EVT_KILL_FOCUS event while the window gaining it
5500 gets an EVT_SET_FOCUS event.
5501
5502 Notice that the set focus event happens both when the user gives focus
5503 to the window (whether using the mouse or keyboard) and when it is
5504 done from the program itself using `wx.Window.SetFocus`.
5505
5506 """
d55e5bfc
RD
5507 def __repr__(self):
5508 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5509 def __init__(self, *args, **kwargs):
5ba5649b
RD
5510 """
5511 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5512
5513 Constructor
5514 """
d55e5bfc
RD
5515 newobj = _core_.new_FocusEvent(*args, **kwargs)
5516 self.this = newobj.this
5517 self.thisown = 1
5518 del newobj.thisown
5519 def GetWindow(*args, **kwargs):
5ba5649b
RD
5520 """
5521 GetWindow(self) -> Window
5522
5523 Returns the other window associated with this event, that is the
5524 window which had the focus before for the EVT_SET_FOCUS event and the
5525 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5526
5527 Warning: the window returned may be None!
5528 """
d55e5bfc
RD
5529 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5530
5531 def SetWindow(*args, **kwargs):
5532 """SetWindow(self, Window win)"""
5533 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5534
5535
5536class FocusEventPtr(FocusEvent):
5537 def __init__(self, this):
5538 self.this = this
5539 if not hasattr(self,"thisown"): self.thisown = 0
5540 self.__class__ = FocusEvent
5541_core_.FocusEvent_swigregister(FocusEventPtr)
5542
5543#---------------------------------------------------------------------------
5544
5545class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5546 """
5547 wx.ChildFocusEvent notifies the parent that a child has received the
5548 focus. Unlike `wx.FocusEvent` it is propagated up the window
5549 heirarchy.
5550 """
d55e5bfc
RD
5551 def __repr__(self):
5552 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5553 def __init__(self, *args, **kwargs):
5ba5649b
RD
5554 """
5555 __init__(self, Window win=None) -> ChildFocusEvent
5556
5557 Constructor
5558 """
d55e5bfc
RD
5559 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
5560 self.this = newobj.this
5561 self.thisown = 1
5562 del newobj.thisown
5563 def GetWindow(*args, **kwargs):
5ba5649b
RD
5564 """
5565 GetWindow(self) -> Window
5566
5567 The window which has just received the focus.
5568 """
d55e5bfc
RD
5569 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5570
5571
5572class ChildFocusEventPtr(ChildFocusEvent):
5573 def __init__(self, this):
5574 self.this = this
5575 if not hasattr(self,"thisown"): self.thisown = 0
5576 self.__class__ = ChildFocusEvent
5577_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
5578
5579#---------------------------------------------------------------------------
5580
5581class ActivateEvent(Event):
5ba5649b
RD
5582 """
5583 An activate event is sent when a top-level window or the entire
5584 application is being activated or deactivated.
5585
5586 A top-level window (a dialog or frame) receives an activate event when
5587 is being activated or deactivated. This is indicated visually by the
5588 title bar changing colour, and a subwindow gaining the keyboard focus.
5589 An application is activated or deactivated when one of its frames
5590 becomes activated, or a frame becomes inactivate resulting in all
5591 application frames being inactive.
5592
5593 Please note that usually you should call event.Skip() in your handlers
5594 for these events so the default handlers will still be called, as not
5595 doing so can result in strange effects.
5596
5597 """
d55e5bfc
RD
5598 def __repr__(self):
5599 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5600 def __init__(self, *args, **kwargs):
5ba5649b
RD
5601 """
5602 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5603
5604 Constructor
5605 """
d55e5bfc
RD
5606 newobj = _core_.new_ActivateEvent(*args, **kwargs)
5607 self.this = newobj.this
5608 self.thisown = 1
5609 del newobj.thisown
5610 def GetActive(*args, **kwargs):
5ba5649b
RD
5611 """
5612 GetActive(self) -> bool
5613
5614 Returns true if the application or window is being activated, false
5615 otherwise.
5616 """
d55e5bfc
RD
5617 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5618
5619
5620class ActivateEventPtr(ActivateEvent):
5621 def __init__(self, this):
5622 self.this = this
5623 if not hasattr(self,"thisown"): self.thisown = 0
5624 self.__class__ = ActivateEvent
5625_core_.ActivateEvent_swigregister(ActivateEventPtr)
5626
5627#---------------------------------------------------------------------------
5628
5629class InitDialogEvent(Event):
5ba5649b
RD
5630 """
5631 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5632 any window when `wx.Window.InitDialog` is called. Handlers for this
5633 event can transfer data to the window, or anything else that should be
5634 done before the user begins editing the form. The default handler
5635 calls `wx.Window.TransferDataToWindow`.
5636 """
d55e5bfc
RD
5637 def __repr__(self):
5638 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5639 def __init__(self, *args, **kwargs):
5ba5649b
RD
5640 """
5641 __init__(self, int Id=0) -> InitDialogEvent
5642
5643 Constructor
5644 """
d55e5bfc
RD
5645 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
5646 self.this = newobj.this
5647 self.thisown = 1
5648 del newobj.thisown
5649
5650class InitDialogEventPtr(InitDialogEvent):
5651 def __init__(self, this):
5652 self.this = this
5653 if not hasattr(self,"thisown"): self.thisown = 0
5654 self.__class__ = InitDialogEvent
5655_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
5656
5657#---------------------------------------------------------------------------
5658
5659class MenuEvent(Event):
5ba5649b
RD
5660 """
5661 This class is used for a variety of menu-related events. Note that
5662 these do not include menu command events, which are handled by sending
5663 `wx.CommandEvent` objects.
5664
5665 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5666 text in the first field of the status bar.
5667 """
d55e5bfc
RD
5668 def __repr__(self):
5669 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5670 def __init__(self, *args, **kwargs):
5ba5649b
RD
5671 """
5672 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5673
5674 Constructor
5675 """
d55e5bfc
RD
5676 newobj = _core_.new_MenuEvent(*args, **kwargs)
5677 self.this = newobj.this
5678 self.thisown = 1
5679 del newobj.thisown
5680 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5681 """
5682 GetMenuId(self) -> int
5683
5684 Returns the menu identifier associated with the event. This method
5685 should be only used with the HIGHLIGHT events.
5686 """
d55e5bfc
RD
5687 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5688
5689 def IsPopup(*args, **kwargs):
5ba5649b
RD
5690 """
5691 IsPopup(self) -> bool
5692
5693 Returns ``True`` if the menu which is being opened or closed is a
5694 popup menu, ``False`` if it is a normal one. This method should only
5695 be used with the OPEN and CLOSE events.
5696 """
d55e5bfc
RD
5697 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5698
5699 def GetMenu(*args, **kwargs):
5ba5649b
RD
5700 """
5701 GetMenu(self) -> Menu
5702
5703 Returns the menu which is being opened or closed. This method should
5704 only be used with the OPEN and CLOSE events.
5705 """
d55e5bfc
RD
5706 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5707
5708
5709class MenuEventPtr(MenuEvent):
5710 def __init__(self, this):
5711 self.this = this
5712 if not hasattr(self,"thisown"): self.thisown = 0
5713 self.__class__ = MenuEvent
5714_core_.MenuEvent_swigregister(MenuEventPtr)
5715
5716#---------------------------------------------------------------------------
5717
5718class CloseEvent(Event):
5ba5649b
RD
5719 """
5720 This event class contains information about window and session close
5721 events.
5722
5723 The handler function for EVT_CLOSE is called when the user has tried
5724 to close a a frame or dialog box using the window manager controls or
5725 the system menu. It can also be invoked by the application itself
5726 programmatically, for example by calling the `wx.Window.Close`
5727 function.
5728
5729 You should check whether the application is forcing the deletion of
5730 the window using `CanVeto`. If it returns ``False``, you must destroy
5731 the window using `wx.Window.Destroy`. If the return value is ``True``,
5732 it is up to you whether you respond by destroying the window or not.
5733 For example you may wish to display a message dialog prompting to save
5734 files or to cancel the close.
5735
5736 If you don't destroy the window, you should call `Veto` to let the
5737 calling code know that you did not destroy the window. This allows the
5738 `wx.Window.Close` function to return ``True`` or ``False`` depending
5739 on whether the close instruction was honored or not.
5740 """
d55e5bfc
RD
5741 def __repr__(self):
5742 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5743 def __init__(self, *args, **kwargs):
5ba5649b
RD
5744 """
5745 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5746
5747 Constructor.
5748 """
d55e5bfc
RD
5749 newobj = _core_.new_CloseEvent(*args, **kwargs)
5750 self.this = newobj.this
5751 self.thisown = 1
5752 del newobj.thisown
5753 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5754 """
5755 SetLoggingOff(self, bool logOff)
5756
5757 Sets the 'logging off' flag.
5758 """
d55e5bfc
RD
5759 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5760
5761 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5762 """
5763 GetLoggingOff(self) -> bool
5764
034e3677
RD
5765 Returns ``True`` if the user is logging off or ``False`` if the
5766 system is shutting down. This method can only be called for end
5767 session and query end session events, it doesn't make sense for close
5768 window event.
5ba5649b 5769 """
d55e5bfc
RD
5770 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5771
5772 def Veto(*args, **kwargs):
5ba5649b
RD
5773 """
5774 Veto(self, bool veto=True)
5775
5776 Call this from your event handler to veto a system shutdown or to
5777 signal to the calling application that a window close did not happen.
5778
5779 You can only veto a shutdown or close if `CanVeto` returns true.
5780 """
d55e5bfc
RD
5781 return _core_.CloseEvent_Veto(*args, **kwargs)
5782
5ba5649b
RD
5783 def GetVeto(*args, **kwargs):
5784 """GetVeto(self) -> bool"""
5785 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5786
d55e5bfc 5787 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5788 """
5789 SetCanVeto(self, bool canVeto)
5790
5791 Sets the 'can veto' flag.
5792 """
d55e5bfc
RD
5793 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5794
5795 def CanVeto(*args, **kwargs):
5ba5649b
RD
5796 """
5797 CanVeto(self) -> bool
d55e5bfc 5798
5ba5649b
RD
5799 Returns true if you can veto a system shutdown or a window close
5800 event. Vetoing a window close event is not possible if the calling
5801 code wishes to force the application to exit, and so this function
5802 must be called to check this.
5803 """
5804 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc
RD
5805
5806
5807class CloseEventPtr(CloseEvent):
5808 def __init__(self, this):
5809 self.this = this
5810 if not hasattr(self,"thisown"): self.thisown = 0
5811 self.__class__ = CloseEvent
5812_core_.CloseEvent_swigregister(CloseEventPtr)
5813
5814#---------------------------------------------------------------------------
5815
5816class ShowEvent(Event):
5ba5649b 5817 """An EVT_SHOW event is sent when a window is shown or hidden."""
d55e5bfc
RD
5818 def __repr__(self):
5819 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5820 def __init__(self, *args, **kwargs):
5ba5649b
RD
5821 """
5822 __init__(self, int winid=0, bool show=False) -> ShowEvent
5823
5824 An EVT_SHOW event is sent when a window is shown or hidden.
5825 """
d55e5bfc
RD
5826 newobj = _core_.new_ShowEvent(*args, **kwargs)
5827 self.this = newobj.this
5828 self.thisown = 1
5829 del newobj.thisown
5830 def SetShow(*args, **kwargs):
5831 """SetShow(self, bool show)"""
5832 return _core_.ShowEvent_SetShow(*args, **kwargs)
5833
5834 def GetShow(*args, **kwargs):
5835 """GetShow(self) -> bool"""
5836 return _core_.ShowEvent_GetShow(*args, **kwargs)
5837
5838
5839class ShowEventPtr(ShowEvent):
5840 def __init__(self, this):
5841 self.this = this
5842 if not hasattr(self,"thisown"): self.thisown = 0
5843 self.__class__ = ShowEvent
5844_core_.ShowEvent_swigregister(ShowEventPtr)
5845
5846#---------------------------------------------------------------------------
5847
5848class IconizeEvent(Event):
5ba5649b
RD
5849 """
5850 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5851 restored.
5852 """
d55e5bfc
RD
5853 def __repr__(self):
5854 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5855 def __init__(self, *args, **kwargs):
5ba5649b
RD
5856 """
5857 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5858
5859 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5860 restored.
5861 """
d55e5bfc
RD
5862 newobj = _core_.new_IconizeEvent(*args, **kwargs)
5863 self.this = newobj.this
5864 self.thisown = 1
5865 del newobj.thisown
5866 def Iconized(*args, **kwargs):
5ba5649b
RD
5867 """
5868 Iconized(self) -> bool
5869
5870 Returns ``True`` if the frame has been iconized, ``False`` if it has
5871 been restored.
5872 """
d55e5bfc
RD
5873 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5874
5875
5876class IconizeEventPtr(IconizeEvent):
5877 def __init__(self, this):
5878 self.this = this
5879 if not hasattr(self,"thisown"): self.thisown = 0
5880 self.__class__ = IconizeEvent
5881_core_.IconizeEvent_swigregister(IconizeEventPtr)
5882
5883#---------------------------------------------------------------------------
5884
5885class MaximizeEvent(Event):
5ba5649b 5886 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
d55e5bfc
RD
5887 def __repr__(self):
5888 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5889 def __init__(self, *args, **kwargs):
5ba5649b
RD
5890 """
5891 __init__(self, int id=0) -> MaximizeEvent
5892
5893 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5894 """
d55e5bfc
RD
5895 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
5896 self.this = newobj.this
5897 self.thisown = 1
5898 del newobj.thisown
5899
5900class MaximizeEventPtr(MaximizeEvent):
5901 def __init__(self, this):
5902 self.this = this
5903 if not hasattr(self,"thisown"): self.thisown = 0
5904 self.__class__ = MaximizeEvent
5905_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
5906
5907#---------------------------------------------------------------------------
5908
5909class DropFilesEvent(Event):
5ba5649b
RD
5910 """
5911 This class is used for drop files events, that is, when files have
5912 been dropped onto the window. This functionality is only available
5913 under Windows. The window must have previously been enabled for
5914 dropping by calling `wx.Window.DragAcceptFiles`.
5915
5916 Important note: this is a separate implementation to the more general
5917 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5918 implementation uses the older, Windows message-based approach of
5919 dropping files.
5920
5921 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5922 events.
5923
5924 """
d55e5bfc
RD
5925 def __init__(self): raise RuntimeError, "No constructor defined"
5926 def __repr__(self):
5927 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5928 def GetPosition(*args, **kwargs):
5ba5649b
RD
5929 """
5930 GetPosition(self) -> Point
5931
5932 Returns the position at which the files were dropped.
5933 """
d55e5bfc
RD
5934 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5935
5936 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5937 """
5938 GetNumberOfFiles(self) -> int
5939
5940 Returns the number of files dropped.
5941 """
d55e5bfc
RD
5942 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5943
5944 def GetFiles(*args, **kwargs):
5ba5649b
RD
5945 """
5946 GetFiles(self) -> PyObject
5947
5948 Returns a list of the filenames that were dropped.
5949 """
d55e5bfc
RD
5950 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5951
5952
5953class DropFilesEventPtr(DropFilesEvent):
5954 def __init__(self, this):
5955 self.this = this
5956 if not hasattr(self,"thisown"): self.thisown = 0
5957 self.__class__ = DropFilesEvent
5958_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
5959
5960#---------------------------------------------------------------------------
5961
5962UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5963UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5964class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5965 """
5966 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5967 wxWidgets to give an application the chance to update various user
5968 interface elements.
5969
5970 Without update UI events, an application has to work hard to
5971 check/uncheck, enable/disable, and set the text for elements such as
5972 menu items and toolbar buttons. The code for doing this has to be
5973 mixed up with the code that is invoked when an action is invoked for a
5974 menu item or button.
5975
5976 With update UI events, you define an event handler to look at the
5977 state of the application and change UI elements accordingly. wxWidgets
5978 will call your handler functions in idle time, so you don't have to
5979 worry where to call this code. In addition to being a clearer and more
5980 declarative method, it also means you don't have to worry whether
5981 you're updating a toolbar or menubar identifier. The same handler can
5982 update a menu item and toolbar button, if the ID values are the same.
5983
5984 Instead of directly manipulating the menu or button, you call
5985 functions in the event object, such as `Check`. wxWidgets will
5986 determine whether such a call has been made, and which UI element to
5987 update.
5988
5989 These events will work for popup menus as well as menubars. Just
5990 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5991 any UI events for the window that owns the menu.
5992
5993 If you find that the overhead of UI update processing is affecting
5994 your application, you can do one or both of the following:
5995
5996 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5997 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5998 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5999 receive update events. No other windows will receive update
6000 events.
6001
6002 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6003 value to set the delay between updates. You may need to call
6004 `wx.Window.UpdateWindowUI` at critical points, for example when
6005 a dialog is about to be shown, in case the user sees a slight
6006 delay before windows are updated.
6007
6008 Note that although events are sent in idle time, defining a EVT_IDLE
6009 handler for a window does not affect this because the events are sent
6010 from an internal idle handler.
6011
6012 wxWidgets tries to optimize update events on some platforms. On
6013 Windows and GTK+, events for menubar items are only sent when the menu
6014 is about to be shown, and not in idle time.
6015
6016 """
d55e5bfc
RD
6017 def __repr__(self):
6018 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6019 def __init__(self, *args, **kwargs):
5ba5649b
RD
6020 """
6021 __init__(self, int commandId=0) -> UpdateUIEvent
6022
6023 Constructor
6024 """
d55e5bfc
RD
6025 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
6026 self.this = newobj.this
6027 self.thisown = 1
6028 del newobj.thisown
6029 def GetChecked(*args, **kwargs):
5ba5649b
RD
6030 """
6031 GetChecked(self) -> bool
6032
6033 Returns ``True`` if the UI element should be checked.
6034 """
d55e5bfc
RD
6035 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
6036
6037 def GetEnabled(*args, **kwargs):
5ba5649b
RD
6038 """
6039 GetEnabled(self) -> bool
6040
6041 Returns ``True`` if the UI element should be enabled.
6042 """
d55e5bfc
RD
6043 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
6044
6045 def GetText(*args, **kwargs):
5ba5649b
RD
6046 """
6047 GetText(self) -> String
6048
6049 Returns the text that should be set for the UI element.
6050 """
d55e5bfc
RD
6051 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
6052
6053 def GetSetText(*args, **kwargs):
5ba5649b
RD
6054 """
6055 GetSetText(self) -> bool
6056
6057 Returns ``True`` if the application has called `SetText`. For
6058 wxWidgets internal use only.
6059 """
d55e5bfc
RD
6060 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
6061
6062 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6063 """
6064 GetSetChecked(self) -> bool
6065
6066 Returns ``True`` if the application has called `Check`. For wxWidgets
6067 internal use only.
6068 """
d55e5bfc
RD
6069 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
6070
6071 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6072 """
6073 GetSetEnabled(self) -> bool
6074
6075 Returns ``True`` if the application has called `Enable`. For wxWidgets
6076 internal use only.
6077 """
d55e5bfc
RD
6078 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
6079
6080 def Check(*args, **kwargs):
5ba5649b
RD
6081 """
6082 Check(self, bool check)
6083
6084 Check or uncheck the UI element.
6085 """
d55e5bfc
RD
6086 return _core_.UpdateUIEvent_Check(*args, **kwargs)
6087
6088 def Enable(*args, **kwargs):
5ba5649b
RD
6089 """
6090 Enable(self, bool enable)
6091
6092 Enable or disable the UI element.
6093 """
d55e5bfc
RD
6094 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
6095
6096 def SetText(*args, **kwargs):
5ba5649b
RD
6097 """
6098 SetText(self, String text)
6099
6100 Sets the text for this UI element.
6101 """
d55e5bfc
RD
6102 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
6103
6104 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6105 """
6106 SetUpdateInterval(long updateInterval)
6107
6108 Sets the interval between updates in milliseconds. Set to -1 to
6109 disable updates, or to 0 to update as frequently as possible. The
6110 default is 0.
6111
6112 Use this to reduce the overhead of UI update events if your
6113 application has a lot of windows. If you set the value to -1 or
6114 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6115 at appropriate points in your application, such as when a dialog is
6116 about to be shown.
6117 """
d55e5bfc
RD
6118 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
6119
6120 SetUpdateInterval = staticmethod(SetUpdateInterval)
6121 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6122 """
6123 GetUpdateInterval() -> long
6124
6125 Returns the current interval between updates in milliseconds. -1
6126 disables updates, 0 updates as frequently as possible.
6127 """
d55e5bfc
RD
6128 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
6129
6130 GetUpdateInterval = staticmethod(GetUpdateInterval)
6131 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6132 """
6133 CanUpdate(Window win) -> bool
6134
6135 Returns ``True`` if it is appropriate to update (send UI update events
6136 to) this window.
6137
6138 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6139 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6140 events were last sent in idle time, and the update interval, to
6141 determine whether events should be sent to this window now. By default
6142 this will always return true because the update mode is initially
6143 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6144 events will be sent as often as possible. You can reduce the frequency
6145 that events are sent by changing the mode and/or setting an update
6146 interval.
6147
6148 """
d55e5bfc
RD
6149 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6150
6151 CanUpdate = staticmethod(CanUpdate)
6152 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6153 """
6154 ResetUpdateTime()
6155
6156 Used internally to reset the last-updated time to the current time. It
6157 is assumed that update events are normally sent in idle time, so this
6158 is called at the end of idle processing.
6159 """
d55e5bfc
RD
6160 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
6161
6162 ResetUpdateTime = staticmethod(ResetUpdateTime)
6163 def SetMode(*args, **kwargs):
5ba5649b
RD
6164 """
6165 SetMode(int mode)
6166
6167 Specify how wxWidgets will send update events: to all windows, or only
6168 to those which specify that they will process the events.
6169
6170 The mode may be one of the following values:
6171
6172 ============================= ==========================================
6173 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6174 is the default setting.
6175 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6176 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6177 style set.
6178 ============================= ==========================================
6179
6180 """
d55e5bfc
RD
6181 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6182
6183 SetMode = staticmethod(SetMode)
6184 def GetMode(*args, **kwargs):
5ba5649b
RD
6185 """
6186 GetMode() -> int
6187
6188 Returns a value specifying how wxWidgets will send update events: to
6189 all windows, or only to those which specify that they will process the
6190 events.
6191 """
d55e5bfc
RD
6192 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
6193
6194 GetMode = staticmethod(GetMode)
6195
6196class UpdateUIEventPtr(UpdateUIEvent):
6197 def __init__(self, this):
6198 self.this = this
6199 if not hasattr(self,"thisown"): self.thisown = 0
6200 self.__class__ = UpdateUIEvent
6201_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
6202
6203def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6204 """
6205 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6206
6207 Sets the interval between updates in milliseconds. Set to -1 to
6208 disable updates, or to 0 to update as frequently as possible. The
6209 default is 0.
6210
6211 Use this to reduce the overhead of UI update events if your
6212 application has a lot of windows. If you set the value to -1 or
6213 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6214 at appropriate points in your application, such as when a dialog is
6215 about to be shown.
6216 """
d55e5bfc
RD
6217 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
6218
6219def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6220 """
6221 UpdateUIEvent_GetUpdateInterval() -> long
6222
6223 Returns the current interval between updates in milliseconds. -1
6224 disables updates, 0 updates as frequently as possible.
6225 """
d55e5bfc
RD
6226 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
6227
6228def UpdateUIEvent_CanUpdate(*args, **kwargs):
5ba5649b
RD
6229 """
6230 UpdateUIEvent_CanUpdate(Window win) -> bool
6231
6232 Returns ``True`` if it is appropriate to update (send UI update events
6233 to) this window.
6234
6235 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6236 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6237 events were last sent in idle time, and the update interval, to
6238 determine whether events should be sent to this window now. By default
6239 this will always return true because the update mode is initially
6240 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6241 events will be sent as often as possible. You can reduce the frequency
6242 that events are sent by changing the mode and/or setting an update
6243 interval.
6244
6245 """
d55e5bfc
RD
6246 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6247
6248def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6249 """
6250 UpdateUIEvent_ResetUpdateTime()
6251
6252 Used internally to reset the last-updated time to the current time. It
6253 is assumed that update events are normally sent in idle time, so this
6254 is called at the end of idle processing.
6255 """
d55e5bfc
RD
6256 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
6257
6258def UpdateUIEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6259 """
6260 UpdateUIEvent_SetMode(int mode)
6261
6262 Specify how wxWidgets will send update events: to all windows, or only
6263 to those which specify that they will process the events.
6264
6265 The mode may be one of the following values:
6266
6267 ============================= ==========================================
6268 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6269 is the default setting.
6270 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6271 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6272 style set.
6273 ============================= ==========================================
6274
6275 """
d55e5bfc
RD
6276 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6277
6278def UpdateUIEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6279 """
6280 UpdateUIEvent_GetMode() -> int
6281
6282 Returns a value specifying how wxWidgets will send update events: to
6283 all windows, or only to those which specify that they will process the
6284 events.
6285 """
d55e5bfc
RD
6286 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
6287
6288#---------------------------------------------------------------------------
6289
6290class SysColourChangedEvent(Event):
5ba5649b
RD
6291 """
6292 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6293 when the user changes the colour settings using the control
6294 panel. This is only applicable under Windows.
6295
6296 The default event handler for this event propagates the event to child
6297 windows, since Windows only sends the events to top-level windows. If
6298 intercepting this event for a top-level window, remember to call
6299 `Skip` so the the base class handler will still be executed, or to
6300 pass the event on to the window's children explicitly.
6301
6302 """
d55e5bfc
RD
6303 def __repr__(self):
6304 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6305 def __init__(self, *args, **kwargs):
5ba5649b
RD
6306 """
6307 __init__(self) -> SysColourChangedEvent
6308
6309 Constructor
6310 """
d55e5bfc
RD
6311 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
6312 self.this = newobj.this
6313 self.thisown = 1
6314 del newobj.thisown
6315
6316class SysColourChangedEventPtr(SysColourChangedEvent):
6317 def __init__(self, this):
6318 self.this = this
6319 if not hasattr(self,"thisown"): self.thisown = 0
6320 self.__class__ = SysColourChangedEvent
6321_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
6322
6323#---------------------------------------------------------------------------
6324
6325class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6326 """
6327 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6328 a window that loses its mouse capture. This is called even if
6329 `wx.Window.ReleaseMouse` was called by the application code. Handling
6330 this event allows an application to cater for unexpected capture
6331 releases which might otherwise confuse mouse handling code.
6332
6333 This event is implemented under Windows only.
6334 """
d55e5bfc
RD
6335 def __repr__(self):
6336 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6337 def __init__(self, *args, **kwargs):
5ba5649b
RD
6338 """
6339 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6340
6341 Constructor
6342 """
d55e5bfc
RD
6343 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
6344 self.this = newobj.this
6345 self.thisown = 1
6346 del newobj.thisown
6347 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6348 """
6349 GetCapturedWindow(self) -> Window
6350
6351 Returns the window that gained the capture, or ``None`` if it was a
6352 non-wxWidgets window.
6353 """
d55e5bfc
RD
6354 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6355
6356
6357class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
6358 def __init__(self, this):
6359 self.this = this
6360 if not hasattr(self,"thisown"): self.thisown = 0
6361 self.__class__ = MouseCaptureChangedEvent
6362_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
6363
6364#---------------------------------------------------------------------------
6365
6366class DisplayChangedEvent(Event):
5ba5649b
RD
6367 """
6368 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6369 resolution has changed.
6370
6371 This event is implemented under Windows only.
6372 """
d55e5bfc
RD
6373 def __repr__(self):
6374 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6375 def __init__(self, *args, **kwargs):
6376 """__init__(self) -> DisplayChangedEvent"""
6377 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
6378 self.this = newobj.this
6379 self.thisown = 1
6380 del newobj.thisown
6381
6382class DisplayChangedEventPtr(DisplayChangedEvent):
6383 def __init__(self, this):
6384 self.this = this
6385 if not hasattr(self,"thisown"): self.thisown = 0
6386 self.__class__ = DisplayChangedEvent
6387_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
6388
6389#---------------------------------------------------------------------------
6390
6391class PaletteChangedEvent(Event):
5ba5649b
RD
6392 """
6393 An EVT_PALETTE_CHANGED event is sent when the system palette has
6394 changed, thereby giving each window a chance to redo their own to
6395 match.
6396
6397 This event is implemented under Windows only.
6398 """
d55e5bfc
RD
6399 def __repr__(self):
6400 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6401 def __init__(self, *args, **kwargs):
5ba5649b
RD
6402 """
6403 __init__(self, int id=0) -> PaletteChangedEvent
6404
6405 An EVT_PALETTE_CHANGED event is sent when the system palette has
6406 changed, thereby giving each window a chance to redo their own to
6407 match.
6408
6409 This event is implemented under Windows only.
6410 """
d55e5bfc
RD
6411 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
6412 self.this = newobj.this
6413 self.thisown = 1
6414 del newobj.thisown
6415 def SetChangedWindow(*args, **kwargs):
6416 """SetChangedWindow(self, Window win)"""
6417 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6418
6419 def GetChangedWindow(*args, **kwargs):
6420 """GetChangedWindow(self) -> Window"""
6421 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6422
6423
6424class PaletteChangedEventPtr(PaletteChangedEvent):
6425 def __init__(self, this):
6426 self.this = this
6427 if not hasattr(self,"thisown"): self.thisown = 0
6428 self.__class__ = PaletteChangedEvent
6429_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
6430
6431#---------------------------------------------------------------------------
6432
6433class QueryNewPaletteEvent(Event):
5ba5649b
RD
6434 """
6435 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6436 focus and should re-do its palette.
6437
6438 This event is implemented under Windows only.
6439 """
d55e5bfc
RD
6440 def __repr__(self):
6441 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6442 def __init__(self, *args, **kwargs):
5ba5649b
RD
6443 """
6444 __init__(self, int winid=0) -> QueryNewPaletteEvent
6445
6446 Constructor.
6447 """
d55e5bfc
RD
6448 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
6449 self.this = newobj.this
6450 self.thisown = 1
6451 del newobj.thisown
6452 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6453 """
6454 SetPaletteRealized(self, bool realized)
6455
6456 App should set this if it changes the palette.
6457 """
d55e5bfc
RD
6458 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6459
6460 def GetPaletteRealized(*args, **kwargs):
6461 """GetPaletteRealized(self) -> bool"""
6462 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6463
6464
6465class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
6466 def __init__(self, this):
6467 self.this = this
6468 if not hasattr(self,"thisown"): self.thisown = 0
6469 self.__class__ = QueryNewPaletteEvent
6470_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
6471
6472#---------------------------------------------------------------------------
6473
6474class NavigationKeyEvent(Event):
5ba5649b
RD
6475 """
6476 EVT_NAVIGATION_KEY events are used to control moving the focus between
6477 widgets, otherwise known as tab-traversal. You woudl normally not
6478 catch navigation events in applications as there are already
6479 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6480 it useful to send navigation events in certain situations to change
6481 the focus in certain ways, although it's probably easier to just call
6482 `wx.Window.Navigate`.
6483 """
d55e5bfc
RD
6484 def __repr__(self):
6485 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6486 def __init__(self, *args, **kwargs):
6487 """__init__(self) -> NavigationKeyEvent"""
6488 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
6489 self.this = newobj.this
6490 self.thisown = 1
6491 del newobj.thisown
6492 def GetDirection(*args, **kwargs):
5ba5649b
RD
6493 """
6494 GetDirection(self) -> bool
6495
6496 Returns ``True`` if the direction is forward, ``False`` otherwise.
6497 """
d55e5bfc
RD
6498 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6499
6500 def SetDirection(*args, **kwargs):
5ba5649b
RD
6501 """
6502 SetDirection(self, bool forward)
6503
6504 Specify the direction that the navigation should take. Usually the
6505 difference between using Tab and Shift-Tab.
6506 """
d55e5bfc
RD
6507 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6508
6509 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6510 """
6511 IsWindowChange(self) -> bool
6512
6513 Returns ``True`` if window change is allowed.
6514 """
d55e5bfc
RD
6515 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6516
6517 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6518 """
6519 SetWindowChange(self, bool ischange)
6520
6521 Specify if the navigation should be able to change parent windows.
6522 For example, changing notebook pages, etc. This is usually implemented
6523 by using Control-Tab.
6524 """
d55e5bfc
RD
6525 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6526
68350608 6527 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6528 """
6529 IsFromTab(self) -> bool
6530
6531 Returns ``True`` if the navigation event is originated from the Tab
6532 key.
6533 """
68350608
RD
6534 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6535
6536 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6537 """
6538 SetFromTab(self, bool bIs)
6539
6540 Set to true under MSW if the event was generated using the tab key.
6541 This is required for proper navogation over radio buttons.
6542 """
68350608
RD
6543 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6544
908b74cd 6545 def SetFlags(*args, **kwargs):
5ba5649b
RD
6546 """
6547 SetFlags(self, long flags)
6548
6549 Set the navigation flags to a combination of the following:
6550
6551 * wx.NavigationKeyEvent.IsBackward
6552 * wx.NavigationKeyEvent.IsForward
6553 * wx.NavigationKeyEvent.WinChange
6554 * wx.NavigationKeyEvent.FromTab
6555
6556 """
908b74cd
RD
6557 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6558
d55e5bfc 6559 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6560 """
6561 GetCurrentFocus(self) -> Window
6562
6563 Returns the child window which currenty has the focus. May be
6564 ``None``.
6565 """
d55e5bfc
RD
6566 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6567
6568 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6569 """
6570 SetCurrentFocus(self, Window win)
6571
6572 Set the window that has the focus.
6573 """
d55e5bfc
RD
6574 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6575
b0f7404b 6576 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6577 IsForward = _core_.NavigationKeyEvent_IsForward
6578 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6579 FromTab = _core_.NavigationKeyEvent_FromTab
d55e5bfc
RD
6580
6581class NavigationKeyEventPtr(NavigationKeyEvent):
6582 def __init__(self, this):
6583 self.this = this
6584 if not hasattr(self,"thisown"): self.thisown = 0
6585 self.__class__ = NavigationKeyEvent
6586_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
6587
6588#---------------------------------------------------------------------------
6589
6590class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6591 """
6592 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6593 underlying GUI object) exists.
6594 """
d55e5bfc
RD
6595 def __repr__(self):
6596 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6597 def __init__(self, *args, **kwargs):
5ba5649b
RD
6598 """
6599 __init__(self, Window win=None) -> WindowCreateEvent
6600
6601 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6602 underlying GUI object) exists.
6603 """
d55e5bfc
RD
6604 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
6605 self.this = newobj.this
6606 self.thisown = 1
6607 del newobj.thisown
6608 def GetWindow(*args, **kwargs):
5ba5649b
RD
6609 """
6610 GetWindow(self) -> Window
6611
6612 Returns the window that this event refers to.
6613 """
d55e5bfc
RD
6614 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6615
6616
6617class WindowCreateEventPtr(WindowCreateEvent):
6618 def __init__(self, this):
6619 self.this = this
6620 if not hasattr(self,"thisown"): self.thisown = 0
6621 self.__class__ = WindowCreateEvent
6622_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
6623
6624class WindowDestroyEvent(CommandEvent):
5ba5649b 6625 """
9d7dfdff
RD
6626 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6627 when the GUI window is destroyed.
6628
6629 When a class derived from `wx.Window` is destroyed its destructor will
6630 have already run by the time this event is sent. Therefore this event
6631 will not usually be received at all by the window itself. Since it is
6632 received after the destructor has run, an object should not try to
6633 handle its own wx.WindowDestroyEvent, but it can be used to get
6634 notification of the destruction of another window.
5ba5649b 6635 """
d55e5bfc
RD
6636 def __repr__(self):
6637 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6638 def __init__(self, *args, **kwargs):
5ba5649b
RD
6639 """
6640 __init__(self, Window win=None) -> WindowDestroyEvent
6641
9d7dfdff
RD
6642 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6643 when the GUI window is destroyed.
6644
6645 When a class derived from `wx.Window` is destroyed its destructor will
6646 have already run by the time this event is sent. Therefore this event
6647 will not usually be received at all by the window itself. Since it is
6648 received after the destructor has run, an object should not try to
6649 handle its own wx.WindowDestroyEvent, but it can be used to get
6650 notification of the destruction of another window.
5ba5649b 6651 """
d55e5bfc
RD
6652 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
6653 self.this = newobj.this
6654 self.thisown = 1
6655 del newobj.thisown
6656 def GetWindow(*args, **kwargs):
5ba5649b
RD
6657 """
6658 GetWindow(self) -> Window
6659
6660 Returns the window that this event refers to.
6661 """
d55e5bfc
RD
6662 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6663
6664
6665class WindowDestroyEventPtr(WindowDestroyEvent):
6666 def __init__(self, this):
6667 self.this = this
6668 if not hasattr(self,"thisown"): self.thisown = 0
6669 self.__class__ = WindowDestroyEvent
6670_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
6671
6672#---------------------------------------------------------------------------
6673
6674class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6675 """
6676 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6677 give the application a chance to show a context (popup) menu.
6678 """
d55e5bfc
RD
6679 def __repr__(self):
6680 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6681 def __init__(self, *args, **kwargs):
5ba5649b
RD
6682 """
6683 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6684
6685 Constructor.
6686 """
d55e5bfc
RD
6687 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
6688 self.this = newobj.this
6689 self.thisown = 1
6690 del newobj.thisown
6691 def GetPosition(*args, **kwargs):
5ba5649b
RD
6692 """
6693 GetPosition(self) -> Point
6694
6695 Returns the position (in screen coordinants) at which the menu should
6696 be shown.
6697 """
d55e5bfc
RD
6698 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6699
6700 def SetPosition(*args, **kwargs):
5ba5649b
RD
6701 """
6702 SetPosition(self, Point pos)
6703
6704 Sets the position at which the menu should be shown.
6705 """
d55e5bfc
RD
6706 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6707
6708
6709class ContextMenuEventPtr(ContextMenuEvent):
6710 def __init__(self, this):
6711 self.this = this
6712 if not hasattr(self,"thisown"): self.thisown = 0
6713 self.__class__ = ContextMenuEvent
6714_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
6715
6716#---------------------------------------------------------------------------
6717
6718IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6719IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6720class IdleEvent(Event):
5ba5649b
RD
6721 """
6722 This class is used for EVT_IDLE events, which are generated and sent
6723 when the application *becomes* idle. In other words, the when the
6724 event queue becomes empty then idle events are sent to all windows (by
6725 default) and as long as none of them call `RequestMore` then there are
6726 no more idle events until after the system event queue has some normal
6727 events and then becomes empty again.
6728
6729 By default, idle events are sent to all windows. If this is causing a
6730 significant overhead in your application, you can call
6731 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6732 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6733 which should receive idle events. Then idle events will only be sent
6734 to those windows and not to any others.
6735 """
d55e5bfc
RD
6736 def __repr__(self):
6737 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6738 def __init__(self, *args, **kwargs):
5ba5649b
RD
6739 """
6740 __init__(self) -> IdleEvent
6741
6742 Constructor
6743 """
d55e5bfc
RD
6744 newobj = _core_.new_IdleEvent(*args, **kwargs)
6745 self.this = newobj.this
6746 self.thisown = 1
6747 del newobj.thisown
6748 def RequestMore(*args, **kwargs):
5ba5649b
RD
6749 """
6750 RequestMore(self, bool needMore=True)
6751
6752 Tells wxWidgets that more processing is required. This function can be
6753 called by an EVT_IDLE handler for a window to indicate that the
6754 application should forward the EVT_IDLE event once more to the
6755 application windows. If no window calls this function during its
6756 EVT_IDLE handler, then the application will remain in a passive event
6757 loop until a new event is posted to the application by the windowing
6758 system.
6759 """
d55e5bfc
RD
6760 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6761
6762 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6763 """
6764 MoreRequested(self) -> bool
6765
6766 Returns ``True`` if the OnIdle function processing this event
6767 requested more processing time.
6768 """
d55e5bfc
RD
6769 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6770
6771 def SetMode(*args, **kwargs):
5ba5649b
RD
6772 """
6773 SetMode(int mode)
6774
6775 Static method for specifying how wxWidgets will send idle events: to
6776 all windows, or only to those which specify that they will process the
6777 events.
6778
6779 The mode can be one of the following values:
6780
6781 ========================= ========================================
6782 wx.IDLE_PROCESS_ALL Send idle events to all windows
6783 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6784 the wx.WS_EX_PROCESS_IDLE extra style
6785 flag set.
6786 ========================= ========================================
6787
6788 """
d55e5bfc
RD
6789 return _core_.IdleEvent_SetMode(*args, **kwargs)
6790
6791 SetMode = staticmethod(SetMode)
6792 def GetMode(*args, **kwargs):
5ba5649b
RD
6793 """
6794 GetMode() -> int
6795
6796 Static method returning a value specifying how wxWidgets will send
6797 idle events: to all windows, or only to those which specify that they
6798 will process the events.
6799 """
d55e5bfc
RD
6800 return _core_.IdleEvent_GetMode(*args, **kwargs)
6801
6802 GetMode = staticmethod(GetMode)
6803 def CanSend(*args, **kwargs):
5ba5649b
RD
6804 """
6805 CanSend(Window win) -> bool
6806
6807 Returns ``True`` if it is appropriate to send idle events to this
6808 window.
6809
6810 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6811 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6812 events should be sent to this window now. By default this will always
6813 return ``True`` because the update mode is initially
6814 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6815 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6816 """
d55e5bfc
RD
6817 return _core_.IdleEvent_CanSend(*args, **kwargs)
6818
6819 CanSend = staticmethod(CanSend)
6820
6821class IdleEventPtr(IdleEvent):
6822 def __init__(self, this):
6823 self.this = this
6824 if not hasattr(self,"thisown"): self.thisown = 0
6825 self.__class__ = IdleEvent
6826_core_.IdleEvent_swigregister(IdleEventPtr)
6827
6828def IdleEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6829 """
6830 IdleEvent_SetMode(int mode)
6831
6832 Static method for specifying how wxWidgets will send idle events: to
6833 all windows, or only to those which specify that they will process the
6834 events.
6835
6836 The mode can be one of the following values:
6837
6838 ========================= ========================================
6839 wx.IDLE_PROCESS_ALL Send idle events to all windows
6840 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6841 the wx.WS_EX_PROCESS_IDLE extra style
6842 flag set.
6843 ========================= ========================================
6844
6845 """
d55e5bfc
RD
6846 return _core_.IdleEvent_SetMode(*args, **kwargs)
6847
6848def IdleEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6849 """
6850 IdleEvent_GetMode() -> int
6851
6852 Static method returning a value specifying how wxWidgets will send
6853 idle events: to all windows, or only to those which specify that they
6854 will process the events.
6855 """
d55e5bfc
RD
6856 return _core_.IdleEvent_GetMode(*args, **kwargs)
6857
6858def IdleEvent_CanSend(*args, **kwargs):
5ba5649b
RD
6859 """
6860 IdleEvent_CanSend(Window win) -> bool
6861
6862 Returns ``True`` if it is appropriate to send idle events to this
6863 window.
6864
6865 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6866 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6867 events should be sent to this window now. By default this will always
6868 return ``True`` because the update mode is initially
6869 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6870 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6871 """
d55e5bfc
RD
6872 return _core_.IdleEvent_CanSend(*args, **kwargs)
6873
6874#---------------------------------------------------------------------------
6875
6876class PyEvent(Event):
5ba5649b
RD
6877 """
6878 wx.PyEvent can be used as a base class for implementing custom event
6879 types in Python. You should derived from this class instead of
6880 `wx.Event` because this class is Python-aware and is able to transport
6881 its Python bits safely through the wxWidgets event system and have
6882 them still be there when the event handler is invoked.
6883
6884 :see: `wx.PyCommandEvent`
6885
6886 """
d55e5bfc
RD
6887 def __repr__(self):
6888 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6889 def __init__(self, *args, **kwargs):
5ba5649b 6890 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
d55e5bfc
RD
6891 newobj = _core_.new_PyEvent(*args, **kwargs)
6892 self.this = newobj.this
6893 self.thisown = 1
6894 del newobj.thisown
5ba5649b 6895 self._SetSelf(self)
d55e5bfc
RD
6896
6897 def __del__(self, destroy=_core_.delete_PyEvent):
6898 """__del__(self)"""
6899 try:
6900 if self.thisown: destroy(self)
6901 except: pass
6902
5ba5649b
RD
6903 def _SetSelf(*args, **kwargs):
6904 """_SetSelf(self, PyObject self)"""
6905 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6906
5ba5649b
RD
6907 def _GetSelf(*args, **kwargs):
6908 """_GetSelf(self) -> PyObject"""
6909 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6910
6911
6912class PyEventPtr(PyEvent):
6913 def __init__(self, this):
6914 self.this = this
6915 if not hasattr(self,"thisown"): self.thisown = 0
6916 self.__class__ = PyEvent
6917_core_.PyEvent_swigregister(PyEventPtr)
6918
6919class PyCommandEvent(CommandEvent):
5ba5649b
RD
6920 """
6921 wx.PyCommandEvent can be used as a base class for implementing custom
6922 event types in Python, where the event shoudl travel up to parent
6923 windows looking for a handler. You should derived from this class
6924 instead of `wx.CommandEvent` because this class is Python-aware and is
6925 able to transport its Python bits safely through the wxWidgets event
6926 system and have them still be there when the event handler is invoked.
6927
6928 :see: `wx.PyEvent`
6929
6930 """
d55e5bfc
RD
6931 def __repr__(self):
6932 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6933 def __init__(self, *args, **kwargs):
5ba5649b 6934 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
d55e5bfc
RD
6935 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
6936 self.this = newobj.this
6937 self.thisown = 1
6938 del newobj.thisown
5ba5649b 6939 self._SetSelf(self)
d55e5bfc
RD
6940
6941 def __del__(self, destroy=_core_.delete_PyCommandEvent):
6942 """__del__(self)"""
6943 try:
6944 if self.thisown: destroy(self)
6945 except: pass
6946
5ba5649b
RD
6947 def _SetSelf(*args, **kwargs):
6948 """_SetSelf(self, PyObject self)"""
6949 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6950
5ba5649b
RD
6951 def _GetSelf(*args, **kwargs):
6952 """_GetSelf(self) -> PyObject"""
6953 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6954
6955
6956class PyCommandEventPtr(PyCommandEvent):
6957 def __init__(self, this):
6958 self.this = this
6959 if not hasattr(self,"thisown"): self.thisown = 0
6960 self.__class__ = PyCommandEvent
6961_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
6962
53aa7709 6963class DateEvent(CommandEvent):
5ba5649b
RD
6964 """
6965 This event class holds information about a date change event and is
6966 used together with `wx.DatePickerCtrl`. It also serves as a base class
6967 for `wx.calendar.CalendarEvent`. Bind these event types with
6968 EVT_DATE_CHANGED.
6969 """
53aa7709
RD
6970 def __repr__(self):
6971 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6972 def __init__(self, *args, **kwargs):
6973 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6974 newobj = _core_.new_DateEvent(*args, **kwargs)
6975 self.this = newobj.this
6976 self.thisown = 1
6977 del newobj.thisown
6978 def GetDate(*args, **kwargs):
5ba5649b
RD
6979 """
6980 GetDate(self) -> DateTime
6981
6982 Returns the date.
6983 """
53aa7709
RD
6984 return _core_.DateEvent_GetDate(*args, **kwargs)
6985
6986 def SetDate(*args, **kwargs):
5ba5649b
RD
6987 """
6988 SetDate(self, DateTime date)
6989
6990 Sets the date carried by the event, normally only used by the library
6991 internally.
6992 """
53aa7709
RD
6993 return _core_.DateEvent_SetDate(*args, **kwargs)
6994
6995
6996class DateEventPtr(DateEvent):
6997 def __init__(self, this):
6998 self.this = this
6999 if not hasattr(self,"thisown"): self.thisown = 0
7000 self.__class__ = DateEvent
7001_core_.DateEvent_swigregister(DateEventPtr)
7002
7003wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
7004EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
7005
d55e5bfc
RD
7006#---------------------------------------------------------------------------
7007
7008PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
7009PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
7010PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
7011PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
7012PRINT_WINDOWS = _core_.PRINT_WINDOWS
7013PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
7014class PyApp(EvtHandler):
c24da6d6
RD
7015 """
7016 The ``wx.PyApp`` class is an *implementation detail*, please use the
7017 `wx.App` class (or some other derived class) instead.
7018 """
d55e5bfc
RD
7019 def __repr__(self):
7020 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7021 def __init__(self, *args, **kwargs):
7022 """
7023 __init__(self) -> PyApp
7024
7025 Create a new application object, starting the bootstrap process.
7026 """
7027 newobj = _core_.new_PyApp(*args, **kwargs)
7028 self.this = newobj.this
7029 self.thisown = 1
7030 del newobj.thisown
70b7a5fe
RD
7031 self._setCallbackInfo(self, PyApp, False)
7032 self._setOORInfo(self, False)
d55e5bfc
RD
7033
7034 def __del__(self, destroy=_core_.delete_PyApp):
7035 """__del__(self)"""
7036 try:
7037 if self.thisown: destroy(self)
7038 except: pass
7039
7040 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 7041 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
d55e5bfc
RD
7042 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
7043
7044 def GetAppName(*args, **kwargs):
7045 """
7046 GetAppName(self) -> String
7047
7048 Get the application name.
7049 """
7050 return _core_.PyApp_GetAppName(*args, **kwargs)
7051
7052 def SetAppName(*args, **kwargs):
7053 """
7054 SetAppName(self, String name)
7055
c24da6d6
RD
7056 Set the application name. This value may be used automatically by
7057 `wx.Config` and such.
d55e5bfc
RD
7058 """
7059 return _core_.PyApp_SetAppName(*args, **kwargs)
7060
7061 def GetClassName(*args, **kwargs):
7062 """
7063 GetClassName(self) -> String
7064
7065 Get the application's class name.
7066 """
7067 return _core_.PyApp_GetClassName(*args, **kwargs)
7068
7069 def SetClassName(*args, **kwargs):
7070 """
7071 SetClassName(self, String name)
7072
c24da6d6
RD
7073 Set the application's class name. This value may be used for
7074 X-resources if applicable for the platform
d55e5bfc
RD
7075 """
7076 return _core_.PyApp_SetClassName(*args, **kwargs)
7077
7078 def GetVendorName(*args, **kwargs):
7079 """
7080 GetVendorName(self) -> String
7081
7082 Get the application's vendor name.
7083 """
7084 return _core_.PyApp_GetVendorName(*args, **kwargs)
7085
7086 def SetVendorName(*args, **kwargs):
7087 """
7088 SetVendorName(self, String name)
7089
c24da6d6
RD
7090 Set the application's vendor name. This value may be used
7091 automatically by `wx.Config` and such.
d55e5bfc
RD
7092 """
7093 return _core_.PyApp_SetVendorName(*args, **kwargs)
7094
7095 def GetTraits(*args, **kwargs):
7096 """
7097 GetTraits(self) -> wxAppTraits
7098
c24da6d6
RD
7099 Return (and create if necessary) the app traits object to which we
7100 delegate for everything which either should be configurable by the
7101 user (then he can change the default behaviour simply by overriding
7102 CreateTraits() and returning his own traits object) or which is
7103 GUI/console dependent as then wx.AppTraits allows us to abstract the
7104 differences behind the common facade.
7105
7106 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
7107 """
7108 return _core_.PyApp_GetTraits(*args, **kwargs)
7109
7110 def ProcessPendingEvents(*args, **kwargs):
7111 """
7112 ProcessPendingEvents(self)
7113
c24da6d6
RD
7114 Process all events in the Pending Events list -- it is necessary to
7115 call this function to process posted events. This normally happens
7116 during each event loop iteration.
d55e5bfc
RD
7117 """
7118 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
7119
7120 def Yield(*args, **kwargs):
7121 """
7122 Yield(self, bool onlyIfNeeded=False) -> bool
7123
c24da6d6
RD
7124 Process all currently pending events right now, instead of waiting
7125 until return to the event loop. It is an error to call ``Yield``
7126 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 7127
c24da6d6 7128 :warning: This function is dangerous as it can lead to unexpected
79fccf9d
RD
7129 reentrancies (i.e. when called from an event handler it may
7130 result in calling the same event handler again), use with
7131 extreme care or, better, don't use at all!
d55e5bfc 7132
c24da6d6 7133 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
79fccf9d 7134
d55e5bfc
RD
7135 """
7136 return _core_.PyApp_Yield(*args, **kwargs)
7137
7138 def WakeUpIdle(*args, **kwargs):
7139 """
7140 WakeUpIdle(self)
7141
c24da6d6
RD
7142 Make sure that idle events are sent again.
7143 :see: `wx.WakeUpIdle`
d55e5bfc
RD
7144 """
7145 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
7146
84f85550
RD
7147 def IsMainLoopRunning(*args, **kwargs):
7148 """
7149 IsMainLoopRunning() -> bool
7150
7151 Returns True if we're running the main loop, i.e. if the events can
7152 currently be dispatched.
7153 """
7154 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7155
7156 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
7157 def MainLoop(*args, **kwargs):
7158 """
7159 MainLoop(self) -> int
7160
c24da6d6
RD
7161 Execute the main GUI loop, the function doesn't normally return until
7162 all top level windows have been closed and destroyed.
d55e5bfc
RD
7163 """
7164 return _core_.PyApp_MainLoop(*args, **kwargs)
7165
7166 def Exit(*args, **kwargs):
7167 """
7168 Exit(self)
7169
7170 Exit the main loop thus terminating the application.
c24da6d6 7171 :see: `wx.Exit`
d55e5bfc
RD
7172 """
7173 return _core_.PyApp_Exit(*args, **kwargs)
7174
7175 def ExitMainLoop(*args, **kwargs):
7176 """
7177 ExitMainLoop(self)
7178
c24da6d6
RD
7179 Exit the main GUI loop during the next iteration of the main
7180 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
7181 """
7182 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
7183
7184 def Pending(*args, **kwargs):
7185 """
7186 Pending(self) -> bool
7187
7188 Returns True if there are unprocessed events in the event queue.
7189 """
7190 return _core_.PyApp_Pending(*args, **kwargs)
7191
7192 def Dispatch(*args, **kwargs):
7193 """
7194 Dispatch(self) -> bool
7195
7196 Process the first event in the event queue (blocks until an event
7197 appears if there are none currently)
7198 """
7199 return _core_.PyApp_Dispatch(*args, **kwargs)
7200
7201 def ProcessIdle(*args, **kwargs):
7202 """
7203 ProcessIdle(self) -> bool
7204
c24da6d6
RD
7205 Called from the MainLoop when the application becomes idle (there are
7206 no pending events) and sends a `wx.IdleEvent` to all interested
7207 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
7208 """
7209 return _core_.PyApp_ProcessIdle(*args, **kwargs)
7210
7211 def SendIdleEvents(*args, **kwargs):
7212 """
7213 SendIdleEvents(self, Window win, IdleEvent event) -> bool
7214
c24da6d6
RD
7215 Send idle event to window and all subwindows. Returns True if more
7216 idle time is requested.
d55e5bfc
RD
7217 """
7218 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
7219
7220 def IsActive(*args, **kwargs):
7221 """
7222 IsActive(self) -> bool
7223
7224 Return True if our app has focus.
7225 """
7226 return _core_.PyApp_IsActive(*args, **kwargs)
7227
7228 def SetTopWindow(*args, **kwargs):
7229 """
7230 SetTopWindow(self, Window win)
7231
c24da6d6 7232 Set the *main* top level window
d55e5bfc
RD
7233 """
7234 return _core_.PyApp_SetTopWindow(*args, **kwargs)
7235
7236 def GetTopWindow(*args, **kwargs):
7237 """
7238 GetTopWindow(self) -> Window
7239
c24da6d6
RD
7240 Return the *main* top level window (if it hadn't been set previously
7241 with SetTopWindow(), will return just some top level window and, if
7242 there not any, will return None)
d55e5bfc
RD
7243 """
7244 return _core_.PyApp_GetTopWindow(*args, **kwargs)
7245
7246 def SetExitOnFrameDelete(*args, **kwargs):
7247 """
7248 SetExitOnFrameDelete(self, bool flag)
7249
c24da6d6
RD
7250 Control the exit behaviour: by default, the program will exit the main
7251 loop (and so, usually, terminate) when the last top-level program
7252 window is deleted. Beware that if you disable this behaviour (with
7253 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7254 explicitly from somewhere.
d55e5bfc
RD
7255 """
7256 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
7257
7258 def GetExitOnFrameDelete(*args, **kwargs):
7259 """
7260 GetExitOnFrameDelete(self) -> bool
7261
7262 Get the current exit behaviour setting.
7263 """
7264 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
7265
7266 def SetUseBestVisual(*args, **kwargs):
7267 """
7268 SetUseBestVisual(self, bool flag)
7269
c24da6d6
RD
7270 Set whether the app should try to use the best available visual on
7271 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
7272 """
7273 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
7274
7275 def GetUseBestVisual(*args, **kwargs):
7276 """
7277 GetUseBestVisual(self) -> bool
7278
7279 Get current UseBestVisual setting.
7280 """
7281 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
7282
7283 def SetPrintMode(*args, **kwargs):
7284 """SetPrintMode(self, int mode)"""
7285 return _core_.PyApp_SetPrintMode(*args, **kwargs)
7286
7287 def GetPrintMode(*args, **kwargs):
7288 """GetPrintMode(self) -> int"""
7289 return _core_.PyApp_GetPrintMode(*args, **kwargs)
7290
7291 def SetAssertMode(*args, **kwargs):
7292 """
7293 SetAssertMode(self, int mode)
7294
79fccf9d 7295 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
7296 """
7297 return _core_.PyApp_SetAssertMode(*args, **kwargs)
7298
7299 def GetAssertMode(*args, **kwargs):
7300 """
7301 GetAssertMode(self) -> int
7302
7303 Get the current OnAssert behaviour setting.
7304 """
7305 return _core_.PyApp_GetAssertMode(*args, **kwargs)
7306
7307 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 7308 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
7309 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7310
7311 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7312 def GetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 7313 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
7314 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7315
7316 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7317 def GetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 7318 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
7319 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7320
7321 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7322 def GetMacExitMenuItemId(*args, **kwargs):
c24da6d6 7323 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
7324 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7325
7326 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7327 def GetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 7328 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
7329 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7330
7331 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7332 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 7333 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
7334 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7335
7336 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7337 def SetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 7338 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
7339 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7340
7341 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7342 def SetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 7343 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
7344 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7345
7346 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7347 def SetMacExitMenuItemId(*args, **kwargs):
c24da6d6 7348 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
7349 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7350
7351 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7352 def SetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 7353 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
7354 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7355
7356 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7357 def _BootstrapApp(*args, **kwargs):
7358 """
7359 _BootstrapApp(self)
7360
7361 For internal use only
7362 """
7363 return _core_.PyApp__BootstrapApp(*args, **kwargs)
7364
7365 def GetComCtl32Version(*args, **kwargs):
7366 """
c24da6d6 7367 GetComCtl32Version() -> int
d55e5bfc 7368
c24da6d6
RD
7369 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7370 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
7371 """
7372 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7373
7374 GetComCtl32Version = staticmethod(GetComCtl32Version)
7375
7376class PyAppPtr(PyApp):
7377 def __init__(self, this):
7378 self.this = this
7379 if not hasattr(self,"thisown"): self.thisown = 0
7380 self.__class__ = PyApp
7381_core_.PyApp_swigregister(PyAppPtr)
7382
84f85550
RD
7383def PyApp_IsMainLoopRunning(*args, **kwargs):
7384 """
7385 PyApp_IsMainLoopRunning() -> bool
7386
7387 Returns True if we're running the main loop, i.e. if the events can
7388 currently be dispatched.
7389 """
7390 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7391
d55e5bfc
RD
7392def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
7393 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7394 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7395
7396def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
7397 """PyApp_GetMacAboutMenuItemId() -> long"""
7398 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7399
7400def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
7401 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7402 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7403
7404def PyApp_GetMacExitMenuItemId(*args, **kwargs):
7405 """PyApp_GetMacExitMenuItemId() -> long"""
7406 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7407
7408def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
7409 """PyApp_GetMacHelpMenuTitleName() -> String"""
7410 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7411
7412def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7413 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7414 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7415
7416def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7417 """PyApp_SetMacAboutMenuItemId(long val)"""
7418 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7419
7420def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7421 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7422 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7423
7424def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7425 """PyApp_SetMacExitMenuItemId(long val)"""
7426 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7427
7428def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7429 """PyApp_SetMacHelpMenuTitleName(String val)"""
7430 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7431
7432def PyApp_GetComCtl32Version(*args, **kwargs):
7433 """
7434 PyApp_GetComCtl32Version() -> int
7435
c24da6d6
RD
7436 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7437 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
7438 """
7439 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7440
7441#---------------------------------------------------------------------------
7442
7443
7444def Exit(*args, **kwargs):
7445 """
7446 Exit()
7447
7448 Force an exit of the application. Convenience for wx.GetApp().Exit()
7449 """
7450 return _core_.Exit(*args, **kwargs)
7451
7452def Yield(*args, **kwargs):
7453 """
7454 Yield() -> bool
7455
7456 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7457 """
7458 return _core_.Yield(*args, **kwargs)
7459
7460def YieldIfNeeded(*args, **kwargs):
7461 """
7462 YieldIfNeeded() -> bool
7463
7464 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7465 """
7466 return _core_.YieldIfNeeded(*args, **kwargs)
7467
7468def SafeYield(*args, **kwargs):
7469 """
7470 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7471
c24da6d6
RD
7472 This function is similar to `wx.Yield`, except that it disables the
7473 user input to all program windows before calling `wx.Yield` and
7474 re-enables it again afterwards. If ``win`` is not None, this window
7475 will remain enabled, allowing the implementation of some limited user
7476 interaction.
d55e5bfc 7477
c24da6d6 7478 :Returns: the result of the call to `wx.Yield`.
d55e5bfc
RD
7479 """
7480 return _core_.SafeYield(*args, **kwargs)
7481
7482def WakeUpIdle(*args, **kwargs):
7483 """
7484 WakeUpIdle()
7485
c24da6d6
RD
7486 Cause the message queue to become empty again, so idle events will be
7487 sent.
d55e5bfc
RD
7488 """
7489 return _core_.WakeUpIdle(*args, **kwargs)
7490
7491def PostEvent(*args, **kwargs):
7492 """
7493 PostEvent(EvtHandler dest, Event event)
7494
c24da6d6
RD
7495 Send an event to a window or other wx.EvtHandler to be processed
7496 later.
d55e5bfc
RD
7497 """
7498 return _core_.PostEvent(*args, **kwargs)
7499
7500def App_CleanUp(*args, **kwargs):
7501 """
7502 App_CleanUp()
7503
79fccf9d 7504 For internal use only, it is used to cleanup after wxWidgets when
c24da6d6 7505 Python shuts down.
d55e5bfc
RD
7506 """
7507 return _core_.App_CleanUp(*args, **kwargs)
7508
7509def GetApp(*args, **kwargs):
7510 """
7511 GetApp() -> PyApp
7512
7513 Return a reference to the current wx.App object.
7514 """
7515 return _core_.GetApp(*args, **kwargs)
5cbf236d
RD
7516
7517def SetDefaultPyEncoding(*args, **kwargs):
7518 """
7519 SetDefaultPyEncoding(string encoding)
7520
7521 Sets the encoding that wxPython will use when it needs to convert a
7522 Python string or unicode object to or from a wxString.
62d32a5f
RD
7523
7524 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7525 but please be aware that the default encoding within the same locale
7526 may be slightly different on different platforms. For example, please
7527 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7528 between the common latin/roman encodings.
5cbf236d
RD
7529 """
7530 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7531
7532def GetDefaultPyEncoding(*args, **kwargs):
7533 """
7534 GetDefaultPyEncoding() -> string
7535
7536 Gets the current encoding that wxPython will use when it needs to
7537 convert a Python string or unicode object to or from a wxString.
7538 """
7539 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d55e5bfc
RD
7540#----------------------------------------------------------------------
7541
7542class PyOnDemandOutputWindow:
7543 """
7544 A class that can be used for redirecting Python's stdout and
7545 stderr streams. It will do nothing until something is wrriten to
7546 the stream at which point it will create a Frame with a text area
7547 and write the text there.
7548 """
7549 def __init__(self, title = "wxPython: stdout/stderr"):
7550 self.frame = None
7551 self.title = title
412d302d
RD
7552 self.pos = wx.DefaultPosition
7553 self.size = (450, 300)
d55e5bfc
RD
7554 self.parent = None
7555
7556 def SetParent(self, parent):
7557 """Set the window to be used as the popup Frame's parent."""
7558 self.parent = parent
7559
7560
7561 def CreateOutputWindow(self, st):
412d302d
RD
7562 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7563 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7564 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7565 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7566 self.text.AppendText(st)
d55e5bfc
RD
7567 self.frame.Show(True)
7568 EVT_CLOSE(self.frame, self.OnCloseWindow)
7569
7570
7571 def OnCloseWindow(self, event):
7572 if self.frame is not None:
7573 self.frame.Destroy()
7574 self.frame = None
7575 self.text = None
7576
7577
7578 # These methods provide the file-like output behaviour.
7579 def write(self, text):
7580 """
7581 Create the output window if needed and write the string to it.
7582 If not called in the context of the gui thread then uses
7583 CallAfter to do the work there.
7584 """
7585 if self.frame is None:
7586 if not wx.Thread_IsMain():
7587 wx.CallAfter(self.CreateOutputWindow, text)
7588 else:
7589 self.CreateOutputWindow(text)
7590 else:
7591 if not wx.Thread_IsMain():
7592 wx.CallAfter(self.text.AppendText, text)
7593 else:
7594 self.text.AppendText(text)
7595
7596
7597 def close(self):
7598 if self.frame is not None:
7599 wx.CallAfter(self.frame.Close)
7600
7601
19272049
RD
7602 def flush(self):
7603 pass
7604
7605
d55e5bfc
RD
7606
7607#----------------------------------------------------------------------
7608
7609_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7610
7611class App(wx.PyApp):
7612 """
c24da6d6
RD
7613 The ``wx.App`` class represents the application and is used to:
7614
7615 * bootstrap the wxPython system and initialize the underlying
7616 gui toolkit
7617 * set and get application-wide properties
7618 * implement the windowing system main message or event loop,
7619 and to dispatch events to window instances
7620 * etc.
7621
7622 Every application must have a ``wx.App`` instance, and all
7623 creation of UI objects should be delayed until after the
7624 ``wx.App`` object has been created in order to ensure that the gui
7625 platform and wxWidgets have been fully initialized.
7626
7627 Normally you would derive from this class and implement an
7628 ``OnInit`` method that creates a frame and then calls
7629 ``self.SetTopWindow(frame)``.
7630
7631 :see: `wx.PySimpleApp` for a simpler app class that can be used
79fccf9d 7632 directly.
d55e5bfc 7633 """
c24da6d6 7634
d55e5bfc
RD
7635 outputWindowClass = PyOnDemandOutputWindow
7636
c24da6d6
RD
7637 def __init__(self, redirect=_defRedirect, filename=None,
7638 useBestVisual=False, clearSigInt=True):
7639 """
7640 Construct a ``wx.App`` object.
7641
7642 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7643 redirected? Defaults to True on Windows and Mac, False
7644 otherwise. If `filename` is None then output will be
7645 redirected to a window that pops up as needed. (You can
7646 control what kind of window is created for the output by
7647 resetting the class variable ``outputWindowClass`` to a
7648 class of your choosing.)
7649
7650 :param filename: The name of a file to redirect output to, if
7651 redirect is True.
7652
7653 :param useBestVisual: Should the app try to use the best
7654 available visual provided by the system (only relevant on
7655 systems that have more than one visual.) This parameter
7656 must be used instead of calling `SetUseBestVisual` later
7657 on because it must be set before the underlying GUI
7658 toolkit is initialized.
7659
7660 :param clearSigInt: Should SIGINT be cleared? This allows the
7661 app to terminate upon a Ctrl-C in the console like other
7662 GUI apps will.
7663
7664 :note: You should override OnInit to do applicaition
7665 initialization to ensure that the system, toolkit and
7666 wxWidgets are fully initialized.
7667 """
d55e5bfc
RD
7668 wx.PyApp.__init__(self)
7669
7670 if wx.Platform == "__WXMAC__":
7671 try:
7672 import MacOS
7673 if not MacOS.WMAvailable():
7674 print """\
7675This program needs access to the screen. Please run with 'pythonw',
7676not 'python', and only when you are logged in on the main display of
7677your Mac."""
7678 _sys.exit(1)
b1f29bf7
RD
7679 except SystemExit:
7680 raise
d55e5bfc
RD
7681 except:
7682 pass
7683
7684 # This has to be done before OnInit
7685 self.SetUseBestVisual(useBestVisual)
7686
7687 # Set the default handler for SIGINT. This fixes a problem
7688 # where if Ctrl-C is pressed in the console that started this
7689 # app then it will not appear to do anything, (not even send
7690 # KeyboardInterrupt???) but will later segfault on exit. By
7691 # setting the default handler then the app will exit, as
7692 # expected (depending on platform.)
c24da6d6
RD
7693 if clearSigInt:
7694 try:
7695 import signal
7696 signal.signal(signal.SIGINT, signal.SIG_DFL)
7697 except:
7698 pass
d55e5bfc
RD
7699
7700 # Save and redirect the stdio to a window?
7701 self.stdioWin = None
7702 self.saveStdio = (_sys.stdout, _sys.stderr)
7703 if redirect:
7704 self.RedirectStdio(filename)
7705
8fb0e70a
RD
7706 # Use Python's install prefix as the default
7707 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7708
d55e5bfc
RD
7709 # This finishes the initialization of wxWindows and then calls
7710 # the OnInit that should be present in the derived class
7711 self._BootstrapApp()
7712
7713
66af7a75
RD
7714 def __del__(self, destroy=wx.PyApp.__del__):
7715 self.RestoreStdio() # Just in case the MainLoop was overridden
7716 destroy(self)
d55e5bfc 7717
70b7a5fe
RD
7718 def Destroy(self):
7719 wx.PyApp.Destroy(self)
7720 self.thisown = 0
d55e5bfc
RD
7721
7722 def SetTopWindow(self, frame):
7723 """Set the \"main\" top level window"""
7724 if self.stdioWin:
7725 self.stdioWin.SetParent(frame)
7726 wx.PyApp.SetTopWindow(self, frame)
7727
7728
7729 def MainLoop(self):
7730 """Execute the main GUI event loop"""
7731 wx.PyApp.MainLoop(self)
7732 self.RestoreStdio()
7733
7734
7735 def RedirectStdio(self, filename=None):
7736 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7737 if filename:
7738 _sys.stdout = _sys.stderr = open(filename, 'a')
7739 else:
7740 self.stdioWin = self.outputWindowClass()
7741 _sys.stdout = _sys.stderr = self.stdioWin
7742
7743
7744 def RestoreStdio(self):
66af7a75
RD
7745 try:
7746 _sys.stdout, _sys.stderr = self.saveStdio
7747 except:
7748 pass
d55e5bfc
RD
7749
7750
412d302d
RD
7751 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7752 """
7753 Set the title, position and/or size of the output window if
f5b96ee1
RD
7754 the stdio has been redirected. This should be called before
7755 any output would cause the output window to be created.
412d302d
RD
7756 """
7757 if self.stdioWin:
7758 if title is not None:
7759 self.stdioWin.title = title
7760 if pos is not None:
7761 self.stdioWin.pos = pos
7762 if size is not None:
7763 self.stdioWin.size = size
7764
7765
7766
d55e5bfc 7767
c24da6d6 7768# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7769App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7770App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7771App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7772App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7773App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7774App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7775App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7776App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7777App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7778App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7779App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7780
7781#----------------------------------------------------------------------------
7782
7783class PySimpleApp(wx.App):
7784 """
7785 A simple application class. You can just create one of these and
7786 then then make your top level windows later, and not have to worry
c24da6d6 7787 about OnInit. For example::
d55e5bfc 7788
c24da6d6
RD
7789 app = wx.PySimpleApp()
7790 frame = wx.Frame(None, title='Hello World')
7791 frame.Show()
7792 app.MainLoop()
7793
7794 :see: `wx.App`
7795 """
7796
7797 def __init__(self, redirect=False, filename=None,
7798 useBestVisual=False, clearSigInt=True):
7799 """
7800 :see: `wx.App.__init__`
7801 """
7802 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7803
7804 def OnInit(self):
d55e5bfc
RD
7805 return True
7806
7807
c24da6d6 7808
d55e5bfc
RD
7809# Is anybody using this one?
7810class PyWidgetTester(wx.App):
7811 def __init__(self, size = (250, 100)):
7812 self.size = size
7813 wx.App.__init__(self, 0)
7814
7815 def OnInit(self):
7816 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7817 self.SetTopWindow(self.frame)
7818 return True
7819
c24da6d6
RD
7820 def SetWidget(self, widgetClass, *args, **kwargs):
7821 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7822 self.frame.Show(True)
7823
7824#----------------------------------------------------------------------------
7825# DO NOT hold any other references to this object. This is how we
c24da6d6 7826# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7827# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
c24da6d6 7828# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7829
7830class __wxPyCleanup:
7831 def __init__(self):
7832 self.cleanup = _core_.App_CleanUp
7833 def __del__(self):
7834 self.cleanup()
7835
7836_sys.__wxPythonCleanup = __wxPyCleanup()
7837
7838## # another possible solution, but it gets called too early...
c24da6d6
RD
7839## import atexit
7840## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7841
7842
7843#----------------------------------------------------------------------------
7844
7845#---------------------------------------------------------------------------
7846
ae8162c8 7847class EventLoop(object):
093d3ff1 7848 """Proxy of C++ EventLoop class"""
ae8162c8
RD
7849 def __repr__(self):
7850 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7851 def __init__(self, *args, **kwargs):
7852 """__init__(self) -> EventLoop"""
7853 newobj = _core_.new_EventLoop(*args, **kwargs)
7854 self.this = newobj.this
7855 self.thisown = 1
7856 del newobj.thisown
7857 def __del__(self, destroy=_core_.delete_EventLoop):
7858 """__del__(self)"""
7859 try:
7860 if self.thisown: destroy(self)
7861 except: pass
7862
7863 def Run(*args, **kwargs):
7864 """Run(self) -> int"""
7865 return _core_.EventLoop_Run(*args, **kwargs)
7866
7867 def Exit(*args, **kwargs):
7868 """Exit(self, int rc=0)"""
7869 return _core_.EventLoop_Exit(*args, **kwargs)
7870
7871 def Pending(*args, **kwargs):
7872 """Pending(self) -> bool"""
7873 return _core_.EventLoop_Pending(*args, **kwargs)
7874
7875 def Dispatch(*args, **kwargs):
7876 """Dispatch(self) -> bool"""
7877 return _core_.EventLoop_Dispatch(*args, **kwargs)
7878
7879 def IsRunning(*args, **kwargs):
7880 """IsRunning(self) -> bool"""
7881 return _core_.EventLoop_IsRunning(*args, **kwargs)
7882
7883 def GetActive(*args, **kwargs):
7884 """GetActive() -> EventLoop"""
7885 return _core_.EventLoop_GetActive(*args, **kwargs)
7886
7887 GetActive = staticmethod(GetActive)
7888 def SetActive(*args, **kwargs):
7889 """SetActive(EventLoop loop)"""
7890 return _core_.EventLoop_SetActive(*args, **kwargs)
7891
7892 SetActive = staticmethod(SetActive)
7893
7894class EventLoopPtr(EventLoop):
7895 def __init__(self, this):
7896 self.this = this
7897 if not hasattr(self,"thisown"): self.thisown = 0
7898 self.__class__ = EventLoop
7899_core_.EventLoop_swigregister(EventLoopPtr)
7900
7901def EventLoop_GetActive(*args, **kwargs):
7902 """EventLoop_GetActive() -> EventLoop"""
7903 return _core_.EventLoop_GetActive(*args, **kwargs)
7904
7905def EventLoop_SetActive(*args, **kwargs):
7906 """EventLoop_SetActive(EventLoop loop)"""
7907 return _core_.EventLoop_SetActive(*args, **kwargs)
7908
7449af73
RD
7909class EventLoopActivator(object):
7910 """Proxy of C++ EventLoopActivator class"""
7911 def __repr__(self):
7912 return "<%s.%s; proxy of C++ wxEventLoopActivator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7913 def __init__(self, *args, **kwargs):
7914 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7915 newobj = _core_.new_EventLoopActivator(*args, **kwargs)
7916 self.this = newobj.this
7917 self.thisown = 1
7918 del newobj.thisown
7919 def __del__(self, destroy=_core_.delete_EventLoopActivator):
7920 """__del__(self)"""
7921 try:
7922 if self.thisown: destroy(self)
7923 except: pass
7924
7925
7926class EventLoopActivatorPtr(EventLoopActivator):
7927 def __init__(self, this):
7928 self.this = this
7929 if not hasattr(self,"thisown"): self.thisown = 0
7930 self.__class__ = EventLoopActivator
7931_core_.EventLoopActivator_swigregister(EventLoopActivatorPtr)
7932
ae8162c8
RD
7933#---------------------------------------------------------------------------
7934
d55e5bfc 7935class AcceleratorEntry(object):
c24da6d6
RD
7936 """
7937 A class used to define items in an `wx.AcceleratorTable`. wxPython
7938 programs can choose to use wx.AcceleratorEntry objects, but using a
7939 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
79fccf9d 7940 as well. See `__init__` for of the tuple values.
c24da6d6
RD
7941
7942 :see: `wx.AcceleratorTable`
7943 """
d55e5bfc
RD
7944 def __repr__(self):
7945 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7946 def __init__(self, *args, **kwargs):
c24da6d6
RD
7947 """
7948 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7949
7950 Construct a wx.AcceleratorEntry.
c24da6d6 7951 """
d55e5bfc
RD
7952 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
7953 self.this = newobj.this
7954 self.thisown = 1
7955 del newobj.thisown
7956 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
7957 """__del__(self)"""
7958 try:
7959 if self.thisown: destroy(self)
7960 except: pass
7961
7962 def Set(*args, **kwargs):
c24da6d6
RD
7963 """
7964 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7965
c24da6d6
RD
7966 (Re)set the attributes of a wx.AcceleratorEntry.
7967 :see `__init__`
7968 """
7969 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7970
7971 def GetFlags(*args, **kwargs):
c24da6d6
RD
7972 """
7973 GetFlags(self) -> int
7974
7975 Get the AcceleratorEntry's flags.
7976 """
d55e5bfc
RD
7977 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7978
7979 def GetKeyCode(*args, **kwargs):
c24da6d6
RD
7980 """
7981 GetKeyCode(self) -> int
7982
7983 Get the AcceleratorEntry's keycode.
7984 """
d55e5bfc
RD
7985 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7986
7987 def GetCommand(*args, **kwargs):
c24da6d6
RD
7988 """
7989 GetCommand(self) -> int
7990
7991 Get the AcceleratorEntry's command ID.
7992 """
d55e5bfc
RD
7993 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7994
7995
7996class AcceleratorEntryPtr(AcceleratorEntry):
7997 def __init__(self, this):
7998 self.this = this
7999 if not hasattr(self,"thisown"): self.thisown = 0
8000 self.__class__ = AcceleratorEntry
8001_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
8002
8003class AcceleratorTable(Object):
c24da6d6
RD
8004 """
8005 An accelerator table allows the application to specify a table of
8006 keyboard shortcuts for menus or other commands. On Windows, menu or
8007 button commands are supported; on GTK, only menu commands are
8008 supported.
c24da6d6 8009 """
d55e5bfc
RD
8010 def __repr__(self):
8011 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8012 def __init__(self, *args, **kwargs):
8013 """
8014 __init__(entries) -> AcceleratorTable
8015
c24da6d6
RD
8016 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8017 items or or of 3-tuples (flags, keyCode, cmdID)
8018
8019 :see: `wx.AcceleratorEntry`
d55e5bfc
RD
8020 """
8021 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
8022 self.this = newobj.this
8023 self.thisown = 1
8024 del newobj.thisown
8025 def __del__(self, destroy=_core_.delete_AcceleratorTable):
8026 """__del__(self)"""
8027 try:
8028 if self.thisown: destroy(self)
8029 except: pass
8030
8031 def Ok(*args, **kwargs):
8032 """Ok(self) -> bool"""
8033 return _core_.AcceleratorTable_Ok(*args, **kwargs)
8034
8035
8036class AcceleratorTablePtr(AcceleratorTable):
8037 def __init__(self, this):
8038 self.this = this
8039 if not hasattr(self,"thisown"): self.thisown = 0
8040 self.__class__ = AcceleratorTable
8041_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
8042
8043
8044def GetAccelFromString(*args, **kwargs):
8045 """GetAccelFromString(String label) -> AcceleratorEntry"""
8046 return _core_.GetAccelFromString(*args, **kwargs)
8047#---------------------------------------------------------------------------
8048
8049class VisualAttributes(object):
8050 """struct containing all the visual attributes of a control"""
8051 def __repr__(self):
8052 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8053 def __init__(self, *args, **kwargs):
8054 """
8055 __init__(self) -> VisualAttributes
8056
8057 struct containing all the visual attributes of a control
8058 """
8059 newobj = _core_.new_VisualAttributes(*args, **kwargs)
8060 self.this = newobj.this
8061 self.thisown = 1
8062 del newobj.thisown
8063 def __del__(self, destroy=_core_.delete_VisualAttributes):
8064 """__del__(self)"""
8065 try:
8066 if self.thisown: destroy(self)
8067 except: pass
8068
8069 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
8070 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
8071 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
8072
8073class VisualAttributesPtr(VisualAttributes):
8074 def __init__(self, this):
8075 self.this = this
8076 if not hasattr(self,"thisown"): self.thisown = 0
8077 self.__class__ = VisualAttributes
8078_core_.VisualAttributes_swigregister(VisualAttributesPtr)
8079NullAcceleratorTable = cvar.NullAcceleratorTable
8080PanelNameStr = cvar.PanelNameStr
8081
8082WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8083WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8084WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8085WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8086WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
8087class Window(EvtHandler):
8088 """
8089 wx.Window is the base class for all windows and represents any visible
8090 object on the screen. All controls, top level windows and so on are
8091 wx.Windows. Sizers and device contexts are not however, as they don't
8092 appear on screen themselves.
8093
8094 """
8095 def __repr__(self):
8096 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8097 def __init__(self, *args, **kwargs):
8098 """
8099 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8100 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
8101
8102 Construct and show a generic Window.
8103 """
8104 newobj = _core_.new_Window(*args, **kwargs)
8105 self.this = newobj.this
8106 self.thisown = 1
8107 del newobj.thisown
8108 self._setOORInfo(self)
8109
8110 def Create(*args, **kwargs):
8111 """
8112 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8113 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
8114
8115 Create the GUI part of the Window for 2-phase creation mode.
8116 """
8117 return _core_.Window_Create(*args, **kwargs)
8118
8119 def Close(*args, **kwargs):
8120 """
8121 Close(self, bool force=False) -> bool
8122
8123 This function simply generates a EVT_CLOSE event whose handler usually
8124 tries to close the window. It doesn't close the window itself,
8125 however. If force is False (the default) then the window's close
8126 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
8127 """
8128 return _core_.Window_Close(*args, **kwargs)
8129
8130 def Destroy(*args, **kwargs):
8131 """
8132 Destroy(self) -> bool
8133
8134 Destroys the window safely. Frames and dialogs are not destroyed
8135 immediately when this function is called -- they are added to a list
8136 of windows to be deleted on idle time, when all the window's events
8137 have been processed. This prevents problems with events being sent to
8138 non-existent windows.
8139
8140 Returns True if the window has either been successfully deleted, or it
8141 has been added to the list of windows pending real deletion.
8142 """
7e08d4ef
RD
8143 val = _core_.Window_Destroy(*args, **kwargs)
8144 args[0].thisown = 0
8145 return val
d55e5bfc
RD
8146
8147 def DestroyChildren(*args, **kwargs):
8148 """
8149 DestroyChildren(self) -> bool
8150
79fccf9d
RD
8151 Destroys all children of a window. Called automatically by the
8152 destructor.
d55e5bfc
RD
8153 """
8154 return _core_.Window_DestroyChildren(*args, **kwargs)
8155
8156 def IsBeingDeleted(*args, **kwargs):
8157 """
8158 IsBeingDeleted(self) -> bool
8159
8160 Is the window in the process of being deleted?
8161 """
8162 return _core_.Window_IsBeingDeleted(*args, **kwargs)
8163
d55e5bfc
RD
8164 def SetLabel(*args, **kwargs):
8165 """
8166 SetLabel(self, String label)
8167
8168 Set the text which the window shows in its label if applicable.
8169 """
8170 return _core_.Window_SetLabel(*args, **kwargs)
8171
8172 def GetLabel(*args, **kwargs):
8173 """
8174 GetLabel(self) -> String
8175
79fccf9d
RD
8176 Generic way of getting a label from any window, for identification
8177 purposes. The interpretation of this function differs from class to
8178 class. For frames and dialogs, the value returned is the title. For
8179 buttons or static text controls, it is the button text. This function
8180 can be useful for meta-programs such as testing tools or special-needs
8181 access programs)which need to identify windows by name.
d55e5bfc
RD
8182 """
8183 return _core_.Window_GetLabel(*args, **kwargs)
8184
8185 def SetName(*args, **kwargs):
8186 """
8187 SetName(self, String name)
8188
79fccf9d
RD
8189 Sets the window's name. The window name is used for ressource setting
8190 in X, it is not the same as the window title/label
d55e5bfc
RD
8191 """
8192 return _core_.Window_SetName(*args, **kwargs)
8193
8194 def GetName(*args, **kwargs):
8195 """
8196 GetName(self) -> String
8197
79fccf9d
RD
8198 Returns the windows name. This name is not guaranteed to be unique;
8199 it is up to the programmer to supply an appropriate name in the window
8200 constructor or via wx.Window.SetName.
d55e5bfc
RD
8201 """
8202 return _core_.Window_GetName(*args, **kwargs)
8203
8204 def SetWindowVariant(*args, **kwargs):
8205 """
8206 SetWindowVariant(self, int variant)
8207
79fccf9d
RD
8208 Sets the variant of the window/font size to use for this window, if
8209 the platform supports variants, for example, wxMac.
d55e5bfc
RD
8210 """
8211 return _core_.Window_SetWindowVariant(*args, **kwargs)
8212
8213 def GetWindowVariant(*args, **kwargs):
8214 """GetWindowVariant(self) -> int"""
8215 return _core_.Window_GetWindowVariant(*args, **kwargs)
8216
8217 def SetId(*args, **kwargs):
8218 """
8219 SetId(self, int winid)
8220
8221 Sets the identifier of the window. Each window has an integer
8222 identifier. If the application has not provided one, an identifier
8223 will be generated. Normally, the identifier should be provided on
8224 creation and should not be modified subsequently.
8225 """
8226 return _core_.Window_SetId(*args, **kwargs)
8227
8228 def GetId(*args, **kwargs):
8229 """
8230 GetId(self) -> int
8231
8232 Returns the identifier of the window. Each window has an integer
8233 identifier. If the application has not provided one (or the default Id
8234 -1 is used) then an unique identifier with a negative value will be
8235 generated.
8236 """
8237 return _core_.Window_GetId(*args, **kwargs)
8238
8239 def NewControlId(*args, **kwargs):
8240 """
c24da6d6 8241 NewControlId() -> int
d55e5bfc
RD
8242
8243 Generate a control id for the controls which were not given one.
8244 """
8245 return _core_.Window_NewControlId(*args, **kwargs)
8246
8247 NewControlId = staticmethod(NewControlId)
8248 def NextControlId(*args, **kwargs):
8249 """
c24da6d6 8250 NextControlId(int winid) -> int
d55e5bfc
RD
8251
8252 Get the id of the control following the one with the given
79fccf9d 8253 autogenerated) id
d55e5bfc
RD
8254 """
8255 return _core_.Window_NextControlId(*args, **kwargs)
8256
8257 NextControlId = staticmethod(NextControlId)
8258 def PrevControlId(*args, **kwargs):
8259 """
c24da6d6 8260 PrevControlId(int winid) -> int
d55e5bfc
RD
8261
8262 Get the id of the control preceding the one with the given
79fccf9d 8263 autogenerated) id
d55e5bfc
RD
8264 """
8265 return _core_.Window_PrevControlId(*args, **kwargs)
8266
8267 PrevControlId = staticmethod(PrevControlId)
8268 def SetSize(*args, **kwargs):
8269 """
8270 SetSize(self, Size size)
8271
8272 Sets the size of the window in pixels.
8273 """
8274 return _core_.Window_SetSize(*args, **kwargs)
8275
8276 def SetDimensions(*args, **kwargs):
8277 """
8278 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8279
8280 Sets the position and size of the window in pixels. The sizeFlags
8281 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8282 equal to -1.
8283
8284 ======================== ======================================
8285 wx.SIZE_AUTO A -1 indicates that a class-specific
8286 default should be used.
8287 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8288 -1 values are supplied.
8289 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8290 interpreted as real dimensions, not
8291 default values.
8292 ======================== ======================================
8293
d55e5bfc
RD
8294 """
8295 return _core_.Window_SetDimensions(*args, **kwargs)
8296
8297 def SetRect(*args, **kwargs):
8298 """
8299 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8300
8301 Sets the position and size of the window in pixels using a wx.Rect.
8302 """
8303 return _core_.Window_SetRect(*args, **kwargs)
8304
8305 def SetSizeWH(*args, **kwargs):
8306 """
8307 SetSizeWH(self, int width, int height)
8308
8309 Sets the size of the window in pixels.
8310 """
8311 return _core_.Window_SetSizeWH(*args, **kwargs)
8312
8313 def Move(*args, **kwargs):
8314 """
8315 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8316
8317 Moves the window to the given position.
8318 """
8319 return _core_.Window_Move(*args, **kwargs)
8320
8321 SetPosition = Move
8322 def MoveXY(*args, **kwargs):
8323 """
8324 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8325
8326 Moves the window to the given position.
8327 """
8328 return _core_.Window_MoveXY(*args, **kwargs)
8329
f8167d6e
RD
8330 def SetBestFittingSize(*args, **kwargs):
8331 """
8332 SetBestFittingSize(self, Size size=DefaultSize)
8333
8334 A 'Smart' SetSize that will fill in default size components with the
8335 window's *best size* values. Also set's the minsize for use with sizers.
8336 """
8337 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8338
d55e5bfc
RD
8339 def Raise(*args, **kwargs):
8340 """
8341 Raise(self)
8342
9d7dfdff
RD
8343 Raises the window to the top of the window hierarchy. In current
8344 version of wxWidgets this works both for manage and child windows.
d55e5bfc
RD
8345 """
8346 return _core_.Window_Raise(*args, **kwargs)
8347
8348 def Lower(*args, **kwargs):
8349 """
8350 Lower(self)
8351
9d7dfdff
RD
8352 Lowers the window to the bottom of the window hierarchy. In current
8353 version of wxWidgets this works both for manage and child windows.
d55e5bfc
RD
8354 """
8355 return _core_.Window_Lower(*args, **kwargs)
8356
8357 def SetClientSize(*args, **kwargs):
8358 """
8359 SetClientSize(self, Size size)
8360
8361 This sets the size of the window client area in pixels. Using this
8362 function to size a window tends to be more device-independent than
8363 wx.Window.SetSize, since the application need not worry about what
8364 dimensions the border or title bar have when trying to fit the window
8365 around panel items, for example.
8366 """
8367 return _core_.Window_SetClientSize(*args, **kwargs)
8368
8369 def SetClientSizeWH(*args, **kwargs):
8370 """
8371 SetClientSizeWH(self, int width, int height)
8372
8373 This sets the size of the window client area in pixels. Using this
8374 function to size a window tends to be more device-independent than
8375 wx.Window.SetSize, since the application need not worry about what
8376 dimensions the border or title bar have when trying to fit the window
8377 around panel items, for example.
8378 """
8379 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8380
8381 def SetClientRect(*args, **kwargs):
8382 """
8383 SetClientRect(self, Rect rect)
8384
8385 This sets the size of the window client area in pixels. Using this
8386 function to size a window tends to be more device-independent than
8387 wx.Window.SetSize, since the application need not worry about what
8388 dimensions the border or title bar have when trying to fit the window
8389 around panel items, for example.
8390 """
8391 return _core_.Window_SetClientRect(*args, **kwargs)
8392
8393 def GetPosition(*args, **kwargs):
8394 """
8395 GetPosition(self) -> Point
8396
8397 Get the window's position.
8398 """
8399 return _core_.Window_GetPosition(*args, **kwargs)
8400
8401 def GetPositionTuple(*args, **kwargs):
8402 """
8403 GetPositionTuple() -> (x,y)
8404
8405 Get the window's position.
8406 """
8407 return _core_.Window_GetPositionTuple(*args, **kwargs)
8408
8409 def GetSize(*args, **kwargs):
8410 """
8411 GetSize(self) -> Size
8412
8413 Get the window size.
8414 """
8415 return _core_.Window_GetSize(*args, **kwargs)
8416
8417 def GetSizeTuple(*args, **kwargs):
8418 """
8419 GetSizeTuple() -> (width, height)
8420
8421 Get the window size.
8422 """
8423 return _core_.Window_GetSizeTuple(*args, **kwargs)
8424
8425 def GetRect(*args, **kwargs):
8426 """
8427 GetRect(self) -> Rect
8428
8429 Returns the size and position of the window as a wx.Rect object.
8430 """
8431 return _core_.Window_GetRect(*args, **kwargs)
8432
8433 def GetClientSize(*args, **kwargs):
8434 """
8435 GetClientSize(self) -> Size
8436
8437 This gets the size of the window's 'client area' in pixels. The client
8438 area is the area which may be drawn on by the programmer, excluding
8439 title bar, border, scrollbars, etc.
8440 """
8441 return _core_.Window_GetClientSize(*args, **kwargs)
8442
8443 def GetClientSizeTuple(*args, **kwargs):
8444 """
8445 GetClientSizeTuple() -> (width, height)
8446
8447 This gets the size of the window's 'client area' in pixels. The client
8448 area is the area which may be drawn on by the programmer, excluding
8449 title bar, border, scrollbars, etc.
8450 """
8451 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8452
8453 def GetClientAreaOrigin(*args, **kwargs):
8454 """
8455 GetClientAreaOrigin(self) -> Point
8456
8457 Get the origin of the client area of the window relative to the
8458 window's top left corner (the client area may be shifted because of
8459 the borders, scrollbars, other decorations...)
8460 """
8461 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8462
8463 def GetClientRect(*args, **kwargs):
8464 """
8465 GetClientRect(self) -> Rect
8466
629f3c1b 8467 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
8468 """
8469 return _core_.Window_GetClientRect(*args, **kwargs)
8470
8471 def GetBestSize(*args, **kwargs):
8472 """
8473 GetBestSize(self) -> Size
8474
248ed943 8475 This function returns the best acceptable minimal size for the
79fccf9d
RD
8476 window, if applicable. For example, for a static text control, it will
8477 be the minimal size such that the control label is not truncated. For
8478 windows containing subwindows (suzh aswx.Panel), the size returned by
8479 this function will be the same as the size the window would have had
8480 after calling Fit.
d55e5bfc
RD
8481 """
8482 return _core_.Window_GetBestSize(*args, **kwargs)
8483
8484 def GetBestSizeTuple(*args, **kwargs):
8485 """
8486 GetBestSizeTuple() -> (width, height)
8487
248ed943 8488 This function returns the best acceptable minimal size for the
79fccf9d
RD
8489 window, if applicable. For example, for a static text control, it will
8490 be the minimal size such that the control label is not truncated. For
8491 windows containing subwindows (suzh aswx.Panel), the size returned by
8492 this function will be the same as the size the window would have had
8493 after calling Fit.
d55e5bfc
RD
8494 """
8495 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8496
a001823c
RD
8497 def InvalidateBestSize(*args, **kwargs):
8498 """
8499 InvalidateBestSize(self)
8500
8501 Reset the cached best size value so it will be recalculated the next
8502 time it is needed.
8503 """
8504 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8505
e2813725
RD
8506 def CacheBestSize(*args, **kwargs):
8507 """
8508 CacheBestSize(self, Size size)
8509
8510 Cache the best size so it doesn't need to be calculated again, (at least until
8511 some properties of the window change.)
8512 """
8513 return _core_.Window_CacheBestSize(*args, **kwargs)
8514
a001823c
RD
8515 def GetBestFittingSize(*args, **kwargs):
8516 """
8517 GetBestFittingSize(self) -> Size
8518
8519 This function will merge the window's best size into the window's
8520 minimum size, giving priority to the min size components, and returns
8521 the results.
8522
8523 """
8524 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8525
d55e5bfc
RD
8526 def GetAdjustedBestSize(*args, **kwargs):
8527 """
8528 GetAdjustedBestSize(self) -> Size
8529
8530 This method is similar to GetBestSize, except in one
8531 thing. GetBestSize should return the minimum untruncated size of the
8532 window, while this method will return the largest of BestSize and any
8533 user specified minimum size. ie. it is the minimum size the window
8534 should currently be drawn at, not the minimal size it can possibly
8535 tolerate.
8536 """
8537 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8538
8539 def Center(*args, **kwargs):
8540 """
8541 Center(self, int direction=BOTH)
8542
8543 Centers the window. The parameter specifies the direction for
8544 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8545 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8546 on the entire screen and not on its parent window. If it is a
8547 top-level window and has no parent then it will always be centered
8548 relative to the screen.
8549 """
8550 return _core_.Window_Center(*args, **kwargs)
8551
8552 Centre = Center
d55e5bfc
RD
8553 def CenterOnParent(*args, **kwargs):
8554 """
8555 CenterOnParent(self, int dir=BOTH)
8556
8557 Center with respect to the the parent window
8558 """
8559 return _core_.Window_CenterOnParent(*args, **kwargs)
8560
8561 CentreOnParent = CenterOnParent
8562 def Fit(*args, **kwargs):
8563 """
8564 Fit(self)
8565
8566 Sizes the window so that it fits around its subwindows. This function
8567 won't do anything if there are no subwindows and will only really work
8568 correctly if sizers are used for the subwindows layout. Also, if the
8569 window has exactly one subwindow it is better (faster and the result
8570 is more precise as Fit adds some margin to account for fuzziness of
8571 its calculations) to call window.SetClientSize(child.GetSize())
8572 instead of calling Fit.
8573 """
8574 return _core_.Window_Fit(*args, **kwargs)
8575
8576 def FitInside(*args, **kwargs):
8577 """
8578 FitInside(self)
8579
8580 Similar to Fit, but sizes the interior (virtual) size of a
8581 window. Mainly useful with scrolled windows to reset scrollbars after
8582 sizing changes that do not trigger a size event, and/or scrolled
8583 windows without an interior sizer. This function similarly won't do
8584 anything if there are no subwindows.
8585 """
8586 return _core_.Window_FitInside(*args, **kwargs)
8587
03837c5c 8588 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8589 """
8590 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8591 int incH=-1)
d55e5bfc
RD
8592
8593 Allows specification of minimum and maximum window sizes, and window
8594 size increments. If a pair of values is not set (or set to -1), the
8595 default values will be used. If this function is called, the user
908b74cd
RD
8596 will not be able to size the window outside the given bounds (if it is
8597 a top-level window.) Sizers will also inspect the minimum window size
8598 and will use that value if set when calculating layout.
8599
8600 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8601 """
03837c5c 8602 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8603
03837c5c
RD
8604 def SetSizeHintsSz(*args, **kwargs):
8605 """
8606 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8607
8608 Allows specification of minimum and maximum window sizes, and window
8609 size increments. If a pair of values is not set (or set to -1), the
8610 default values will be used. If this function is called, the user
8611 will not be able to size the window outside the given bounds (if it is
8612 a top-level window.) Sizers will also inspect the minimum window size
8613 and will use that value if set when calculating layout.
8614
8615 The resizing increments are only significant under Motif or Xt.
8616 """
8617 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8618
8619 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8620 """
908b74cd 8621 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8622
8623 Allows specification of minimum and maximum virtual window sizes. If a
8624 pair of values is not set (or set to -1), the default values will be
8625 used. If this function is called, the user will not be able to size
8626 the virtual area of the window outside the given bounds.
8627 """
03837c5c
RD
8628 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8629
8630 def SetVirtualSizeHintsSz(*args, **kwargs):
8631 """
8632 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8633
8634 Allows specification of minimum and maximum virtual window sizes. If a
8635 pair of values is not set (or set to -1), the default values will be
8636 used. If this function is called, the user will not be able to size
8637 the virtual area of the window outside the given bounds.
8638 """
8639 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8640
908b74cd
RD
8641 def GetMaxSize(*args, **kwargs):
8642 """GetMaxSize(self) -> Size"""
8643 return _core_.Window_GetMaxSize(*args, **kwargs)
8644
8645 def GetMinSize(*args, **kwargs):
8646 """GetMinSize(self) -> Size"""
8647 return _core_.Window_GetMinSize(*args, **kwargs)
8648
8649 def SetMinSize(*args, **kwargs):
8650 """
8651 SetMinSize(self, Size minSize)
8652
8653 A more convenient method than `SetSizeHints` for setting just the
8654 min size.
8655 """
8656 return _core_.Window_SetMinSize(*args, **kwargs)
8657
8658 def SetMaxSize(*args, **kwargs):
8659 """
8660 SetMaxSize(self, Size maxSize)
8661
8662 A more convenient method than `SetSizeHints` for setting just the
8663 max size.
8664 """
8665 return _core_.Window_SetMaxSize(*args, **kwargs)
8666
d55e5bfc
RD
8667 def GetMinWidth(*args, **kwargs):
8668 """GetMinWidth(self) -> int"""
8669 return _core_.Window_GetMinWidth(*args, **kwargs)
8670
8671 def GetMinHeight(*args, **kwargs):
8672 """GetMinHeight(self) -> int"""
8673 return _core_.Window_GetMinHeight(*args, **kwargs)
8674
8675 def GetMaxWidth(*args, **kwargs):
8676 """GetMaxWidth(self) -> int"""
8677 return _core_.Window_GetMaxWidth(*args, **kwargs)
8678
8679 def GetMaxHeight(*args, **kwargs):
8680 """GetMaxHeight(self) -> int"""
8681 return _core_.Window_GetMaxHeight(*args, **kwargs)
8682
d55e5bfc
RD
8683 def SetVirtualSize(*args, **kwargs):
8684 """
8685 SetVirtualSize(self, Size size)
8686
8687 Set the the virtual size of a window in pixels. For most windows this
8688 is just the client area of the window, but for some like scrolled
8689 windows it is more or less independent of the screen window size.
8690 """
8691 return _core_.Window_SetVirtualSize(*args, **kwargs)
8692
8693 def SetVirtualSizeWH(*args, **kwargs):
8694 """
8695 SetVirtualSizeWH(self, int w, int h)
8696
8697 Set the the virtual size of a window in pixels. For most windows this
8698 is just the client area of the window, but for some like scrolled
8699 windows it is more or less independent of the screen window size.
8700 """
8701 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8702
8703 def GetVirtualSize(*args, **kwargs):
8704 """
8705 GetVirtualSize(self) -> Size
8706
8707 Get the the virtual size of the window in pixels. For most windows
8708 this is just the client area of the window, but for some like scrolled
8709 windows it is more or less independent of the screen window size.
8710 """
8711 return _core_.Window_GetVirtualSize(*args, **kwargs)
8712
8713 def GetVirtualSizeTuple(*args, **kwargs):
8714 """
8715 GetVirtualSizeTuple() -> (width, height)
8716
8717 Get the the virtual size of the window in pixels. For most windows
8718 this is just the client area of the window, but for some like scrolled
8719 windows it is more or less independent of the screen window size.
8720 """
8721 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8722
8723 def GetBestVirtualSize(*args, **kwargs):
8724 """
8725 GetBestVirtualSize(self) -> Size
8726
8727 Return the largest of ClientSize and BestSize (as determined by a
8728 sizer, interior children, or other means)
8729 """
8730 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8731
8732 def Show(*args, **kwargs):
8733 """
8734 Show(self, bool show=True) -> bool
8735
8736 Shows or hides the window. You may need to call Raise for a top level
8737 window if you want to bring it to top, although this is not needed if
8738 Show is called immediately after the frame creation. Returns True if
8739 the window has been shown or hidden or False if nothing was done
8740 because it already was in the requested state.
8741 """
8742 return _core_.Window_Show(*args, **kwargs)
8743
8744 def Hide(*args, **kwargs):
8745 """
8746 Hide(self) -> bool
8747
8748 Equivalent to calling Show(False).
8749 """
8750 return _core_.Window_Hide(*args, **kwargs)
8751
8752 def Enable(*args, **kwargs):
8753 """
8754 Enable(self, bool enable=True) -> bool
8755
8756 Enable or disable the window for user input. Note that when a parent
8757 window is disabled, all of its children are disabled as well and they
8758 are reenabled again when the parent is. Returns true if the window
8759 has been enabled or disabled, false if nothing was done, i.e. if the
8760 window had already been in the specified state.
8761 """
8762 return _core_.Window_Enable(*args, **kwargs)
8763
8764 def Disable(*args, **kwargs):
8765 """
8766 Disable(self) -> bool
8767
8768 Disables the window, same as Enable(false).
8769 """
8770 return _core_.Window_Disable(*args, **kwargs)
8771
8772 def IsShown(*args, **kwargs):
8773 """
8774 IsShown(self) -> bool
8775
8776 Returns true if the window is shown, false if it has been hidden.
8777 """
8778 return _core_.Window_IsShown(*args, **kwargs)
8779
8780 def IsEnabled(*args, **kwargs):
8781 """
8782 IsEnabled(self) -> bool
8783
8784 Returns true if the window is enabled for input, false otherwise.
8785 """
8786 return _core_.Window_IsEnabled(*args, **kwargs)
8787
8788 def SetWindowStyleFlag(*args, **kwargs):
8789 """
8790 SetWindowStyleFlag(self, long style)
8791
79fccf9d
RD
8792 Sets the style of the window. Please note that some styles cannot be
8793 changed after the window creation and that Refresh() might need to be
8794 called after changing the others for the change to take place
8795 immediately.
d55e5bfc
RD
8796 """
8797 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8798
8799 def GetWindowStyleFlag(*args, **kwargs):
8800 """
8801 GetWindowStyleFlag(self) -> long
8802
8803 Gets the window style that was passed to the constructor or Create
8804 method.
8805 """
8806 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8807
8808 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8809 def HasFlag(*args, **kwargs):
8810 """
8811 HasFlag(self, int flag) -> bool
8812
8813 Test if the given style is set for this window.
8814 """
8815 return _core_.Window_HasFlag(*args, **kwargs)
8816
8817 def IsRetained(*args, **kwargs):
8818 """
8819 IsRetained(self) -> bool
8820
8821 Returns true if the window is retained, false otherwise. Retained
8822 windows are only available on X platforms.
8823 """
8824 return _core_.Window_IsRetained(*args, **kwargs)
8825
8826 def SetExtraStyle(*args, **kwargs):
8827 """
8828 SetExtraStyle(self, long exStyle)
8829
8830 Sets the extra style bits for the window. Extra styles are the less
8831 often used style bits which can't be set with the constructor or with
8832 SetWindowStyleFlag()
8833 """
8834 return _core_.Window_SetExtraStyle(*args, **kwargs)
8835
8836 def GetExtraStyle(*args, **kwargs):
8837 """
8838 GetExtraStyle(self) -> long
8839
8840 Returns the extra style bits for the window.
8841 """
8842 return _core_.Window_GetExtraStyle(*args, **kwargs)
8843
8844 def MakeModal(*args, **kwargs):
8845 """
8846 MakeModal(self, bool modal=True)
8847
8848 Disables all other windows in the application so that the user can
8849 only interact with this window. Passing False will reverse this
8850 effect.
8851 """
8852 return _core_.Window_MakeModal(*args, **kwargs)
8853
8854 def SetThemeEnabled(*args, **kwargs):
8855 """
8856 SetThemeEnabled(self, bool enableTheme)
8857
8858 This function tells a window if it should use the system's "theme"
8859 code to draw the windows' background instead if its own background
8860 drawing code. This will only have an effect on platforms that support
8861 the notion of themes in user defined windows. One such platform is
8862 GTK+ where windows can have (very colourful) backgrounds defined by a
8863 user's selected theme.
8864
8865 Dialogs, notebook pages and the status bar have this flag set to true
8866 by default so that the default look and feel is simulated best.
8867 """
8868 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8869
8870 def GetThemeEnabled(*args, **kwargs):
8871 """
8872 GetThemeEnabled(self) -> bool
8873
8874 Return the themeEnabled flag.
8875 """
8876 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8877
8878 def SetFocus(*args, **kwargs):
8879 """
8880 SetFocus(self)
8881
8882 Set's the focus to this window, allowing it to receive keyboard input.
8883 """
8884 return _core_.Window_SetFocus(*args, **kwargs)
8885
8886 def SetFocusFromKbd(*args, **kwargs):
8887 """
8888 SetFocusFromKbd(self)
8889
8890 Set focus to this window as the result of a keyboard action. Normally
8891 only called internally.
8892 """
8893 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8894
8895 def FindFocus(*args, **kwargs):
8896 """
c24da6d6 8897 FindFocus() -> Window
d55e5bfc
RD
8898
8899 Returns the window or control that currently has the keyboard focus,
8900 or None.
8901 """
8902 return _core_.Window_FindFocus(*args, **kwargs)
8903
8904 FindFocus = staticmethod(FindFocus)
8905 def AcceptsFocus(*args, **kwargs):
8906 """
8907 AcceptsFocus(self) -> bool
8908
8909 Can this window have focus?
8910 """
8911 return _core_.Window_AcceptsFocus(*args, **kwargs)
8912
8913 def AcceptsFocusFromKeyboard(*args, **kwargs):
8914 """
8915 AcceptsFocusFromKeyboard(self) -> bool
8916
8917 Can this window be given focus by keyboard navigation? if not, the
8918 only way to give it focus (provided it accepts it at all) is to click
8919 it.
8920 """
8921 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8922
8923 def GetDefaultItem(*args, **kwargs):
8924 """
8925 GetDefaultItem(self) -> Window
8926
8927 Get the default child of this parent, i.e. the one which is activated
8928 by pressing <Enter> such as the OK button on a wx.Dialog.
8929 """
8930 return _core_.Window_GetDefaultItem(*args, **kwargs)
8931
8932 def SetDefaultItem(*args, **kwargs):
8933 """
8934 SetDefaultItem(self, Window child) -> Window
8935
8936 Set this child as default, return the old default.
8937 """
8938 return _core_.Window_SetDefaultItem(*args, **kwargs)
8939
8940 def SetTmpDefaultItem(*args, **kwargs):
8941 """
8942 SetTmpDefaultItem(self, Window win)
8943
8944 Set this child as temporary default
8945 """
8946 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
8947
908b74cd
RD
8948 def Navigate(*args, **kwargs):
8949 """
8950 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8951
a8eff060
RD
8952 Does keyboard navigation from this window to another, by sending a
8953 `wx.NavigationKeyEvent`.
908b74cd
RD
8954 """
8955 return _core_.Window_Navigate(*args, **kwargs)
8956
bf26d883
RD
8957 def MoveAfterInTabOrder(*args, **kwargs):
8958 """
8959 MoveAfterInTabOrder(self, Window win)
8960
8961 Moves this window in the tab navigation order after the specified
8962 sibling window. This means that when the user presses the TAB key on
8963 that other window, the focus switches to this window.
8964
8965 The default tab order is the same as creation order. This function
8966 and `MoveBeforeInTabOrder` allow to change it after creating all the
8967 windows.
8968
8969 """
8970 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8971
8972 def MoveBeforeInTabOrder(*args, **kwargs):
8973 """
8974 MoveBeforeInTabOrder(self, Window win)
8975
8976 Same as `MoveAfterInTabOrder` except that it inserts this window just
8977 before win instead of putting it right after it.
8978 """
8979 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8980
d55e5bfc
RD
8981 def GetChildren(*args, **kwargs):
8982 """
8983 GetChildren(self) -> PyObject
8984
8985 Returns a list of the window's children. NOTE: Currently this is a
8986 copy of the child window list maintained by the window, so the return
8987 value of this function is only valid as long as the window's children
8988 do not change.
8989 """
8990 return _core_.Window_GetChildren(*args, **kwargs)
8991
8992 def GetParent(*args, **kwargs):
8993 """
8994 GetParent(self) -> Window
8995
8996 Returns the parent window of this window, or None if there isn't one.
8997 """
8998 return _core_.Window_GetParent(*args, **kwargs)
8999
9000 def GetGrandParent(*args, **kwargs):
9001 """
9002 GetGrandParent(self) -> Window
9003
79fccf9d
RD
9004 Returns the parent of the parent of this window, or None if there
9005 isn't one.
d55e5bfc
RD
9006 """
9007 return _core_.Window_GetGrandParent(*args, **kwargs)
9008
9009 def IsTopLevel(*args, **kwargs):
9010 """
9011 IsTopLevel(self) -> bool
9012
9013 Returns true if the given window is a top-level one. Currently all
9014 frames and dialogs are always considered to be top-level windows (even
9015 if they have a parent window).
9016 """
9017 return _core_.Window_IsTopLevel(*args, **kwargs)
9018
9019 def Reparent(*args, **kwargs):
9020 """
9021 Reparent(self, Window newParent) -> bool
9022
9023 Reparents the window, i.e the window will be removed from its current
9024 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9025 re-inserted into another. Available on Windows and GTK. Returns True
9026 if the parent was changed, False otherwise (error or newParent ==
9027 oldParent)
9028 """
9029 return _core_.Window_Reparent(*args, **kwargs)
9030
9031 def AddChild(*args, **kwargs):
9032 """
9033 AddChild(self, Window child)
9034
9035 Adds a child window. This is called automatically by window creation
9036 functions so should not be required by the application programmer.
9037 """
9038 return _core_.Window_AddChild(*args, **kwargs)
9039
9040 def RemoveChild(*args, **kwargs):
9041 """
9042 RemoveChild(self, Window child)
9043
9044 Removes a child window. This is called automatically by window
9045 deletion functions so should not be required by the application
9046 programmer.
9047 """
9048 return _core_.Window_RemoveChild(*args, **kwargs)
9049
9050 def FindWindowById(*args, **kwargs):
9051 """
9052 FindWindowById(self, long winid) -> Window
9053
9054 Find a chld of this window by window ID
9055 """
9056 return _core_.Window_FindWindowById(*args, **kwargs)
9057
9058 def FindWindowByName(*args, **kwargs):
9059 """
9060 FindWindowByName(self, String name) -> Window
9061
9062 Find a child of this window by name
9063 """
9064 return _core_.Window_FindWindowByName(*args, **kwargs)
9065
9066 def GetEventHandler(*args, **kwargs):
9067 """
9068 GetEventHandler(self) -> EvtHandler
9069
9070 Returns the event handler for this window. By default, the window is
9071 its own event handler.
9072 """
9073 return _core_.Window_GetEventHandler(*args, **kwargs)
9074
9075 def SetEventHandler(*args, **kwargs):
9076 """
9077 SetEventHandler(self, EvtHandler handler)
9078
9079 Sets the event handler for this window. An event handler is an object
9080 that is capable of processing the events sent to a window. By default,
9081 the window is its own event handler, but an application may wish to
9082 substitute another, for example to allow central implementation of
9083 event-handling for a variety of different window classes.
9084
79fccf9d 9085 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
9086 up a chain of event handlers, where an event not handled by one event
9087 handler is handed to the next one in the chain.
9088 """
9089 return _core_.Window_SetEventHandler(*args, **kwargs)
9090
9091 def PushEventHandler(*args, **kwargs):
9092 """
9093 PushEventHandler(self, EvtHandler handler)
9094
9095 Pushes this event handler onto the event handler stack for the window.
9096 An event handler is an object that is capable of processing the events
9097 sent to a window. By default, the window is its own event handler, but
9098 an application may wish to substitute another, for example to allow
9099 central implementation of event-handling for a variety of different
9100 window classes.
9101
9102 wx.Window.PushEventHandler allows an application to set up a chain of
9103 event handlers, where an event not handled by one event handler is
79fccf9d 9104 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
9105 remove the event handler.
9106 """
9107 return _core_.Window_PushEventHandler(*args, **kwargs)
9108
9109 def PopEventHandler(*args, **kwargs):
9110 """
9111 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
9112
9113 Removes and returns the top-most event handler on the event handler
9114 stack. If deleteHandler is True then the wx.EvtHandler object will be
9115 destroyed after it is popped.
9116 """
9117 return _core_.Window_PopEventHandler(*args, **kwargs)
9118
9119 def RemoveEventHandler(*args, **kwargs):
9120 """
9121 RemoveEventHandler(self, EvtHandler handler) -> bool
9122
79fccf9d
RD
9123 Find the given handler in the event handler chain and remove (but not
9124 delete) it from the event handler chain, return True if it was found
9125 and False otherwise (this also results in an assert failure so this
9126 function should only be called when the handler is supposed to be
9127 there.)
d55e5bfc
RD
9128 """
9129 return _core_.Window_RemoveEventHandler(*args, **kwargs)
9130
9131 def SetValidator(*args, **kwargs):
9132 """
9133 SetValidator(self, Validator validator)
9134
9135 Deletes the current validator (if any) and sets the window validator,
9136 having called wx.Validator.Clone to create a new validator of this
9137 type.
9138 """
9139 return _core_.Window_SetValidator(*args, **kwargs)
9140
9141 def GetValidator(*args, **kwargs):
9142 """
9143 GetValidator(self) -> Validator
9144
9145 Returns a pointer to the current validator for the window, or None if
9146 there is none.
9147 """
9148 return _core_.Window_GetValidator(*args, **kwargs)
9149
9150 def Validate(*args, **kwargs):
9151 """
9152 Validate(self) -> bool
9153
9154 Validates the current values of the child controls using their
79fccf9d
RD
9155 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9156 style flag set, the method will also call Validate() of all child
9157 windows. Returns false if any of the validations failed.
d55e5bfc
RD
9158 """
9159 return _core_.Window_Validate(*args, **kwargs)
9160
9161 def TransferDataToWindow(*args, **kwargs):
9162 """
9163 TransferDataToWindow(self) -> bool
9164
79fccf9d
RD
9165 Transfers values to child controls from data areas specified by their
9166 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9167 style flag set, the method will also call TransferDataToWindow() of
9168 all child windows.
d55e5bfc
RD
9169 """
9170 return _core_.Window_TransferDataToWindow(*args, **kwargs)
9171
9172 def TransferDataFromWindow(*args, **kwargs):
9173 """
9174 TransferDataFromWindow(self) -> bool
9175
79fccf9d
RD
9176 Transfers values from child controls to data areas specified by their
9177 validators. Returns false if a transfer failed. If the window has
9178 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9179 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
9180 """
9181 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
9182
9183 def InitDialog(*args, **kwargs):
9184 """
9185 InitDialog(self)
9186
79fccf9d
RD
9187 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9188 to the dialog via validators.
d55e5bfc
RD
9189 """
9190 return _core_.Window_InitDialog(*args, **kwargs)
9191
9192 def SetAcceleratorTable(*args, **kwargs):
9193 """
9194 SetAcceleratorTable(self, AcceleratorTable accel)
9195
9196 Sets the accelerator table for this window.
9197 """
9198 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
9199
9200 def GetAcceleratorTable(*args, **kwargs):
9201 """
9202 GetAcceleratorTable(self) -> AcceleratorTable
9203
9204 Gets the accelerator table for this window.
9205 """
9206 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
9207
9208 def RegisterHotKey(*args, **kwargs):
9209 """
9210 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9211
9212 Registers a system wide hotkey. Every time the user presses the hotkey
9213 registered here, this window will receive a hotkey event. It will
9214 receive the event even if the application is in the background and
9215 does not have the input focus because the user is working with some
9216 other application. To bind an event handler function to this hotkey
9217 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9218 hotkey was registered successfully.
9219 """
9220 return _core_.Window_RegisterHotKey(*args, **kwargs)
9221
9222 def UnregisterHotKey(*args, **kwargs):
9223 """
9224 UnregisterHotKey(self, int hotkeyId) -> bool
9225
9226 Unregisters a system wide hotkey.
9227 """
9228 return _core_.Window_UnregisterHotKey(*args, **kwargs)
9229
9230 def ConvertDialogPointToPixels(*args, **kwargs):
9231 """
9232 ConvertDialogPointToPixels(self, Point pt) -> Point
9233
9234 Converts a point or size from dialog units to pixels. Dialog units
9235 are used for maintaining a dialog's proportions even if the font
9236 changes. For the x dimension, the dialog units are multiplied by the
9237 average character width and then divided by 4. For the y dimension,
9238 the dialog units are multiplied by the average character height and
9239 then divided by 8.
9240 """
9241 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
9242
9243 def ConvertDialogSizeToPixels(*args, **kwargs):
9244 """
9245 ConvertDialogSizeToPixels(self, Size sz) -> Size
9246
9247 Converts a point or size from dialog units to pixels. Dialog units
9248 are used for maintaining a dialog's proportions even if the font
9249 changes. For the x dimension, the dialog units are multiplied by the
9250 average character width and then divided by 4. For the y dimension,
9251 the dialog units are multiplied by the average character height and
9252 then divided by 8.
9253 """
9254 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
9255
9256 def DLG_PNT(*args, **kwargs):
9257 """
9258 DLG_PNT(self, Point pt) -> Point
9259
9260 Converts a point or size from dialog units to pixels. Dialog units
9261 are used for maintaining a dialog's proportions even if the font
9262 changes. For the x dimension, the dialog units are multiplied by the
9263 average character width and then divided by 4. For the y dimension,
9264 the dialog units are multiplied by the average character height and
9265 then divided by 8.
9266 """
9267 return _core_.Window_DLG_PNT(*args, **kwargs)
9268
9269 def DLG_SZE(*args, **kwargs):
9270 """
9271 DLG_SZE(self, Size sz) -> Size
9272
9273 Converts a point or size from dialog units to pixels. Dialog units
9274 are used for maintaining a dialog's proportions even if the font
9275 changes. For the x dimension, the dialog units are multiplied by the
9276 average character width and then divided by 4. For the y dimension,
9277 the dialog units are multiplied by the average character height and
9278 then divided by 8.
9279 """
9280 return _core_.Window_DLG_SZE(*args, **kwargs)
9281
9282 def ConvertPixelPointToDialog(*args, **kwargs):
9283 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9284 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9285
9286 def ConvertPixelSizeToDialog(*args, **kwargs):
9287 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9288 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9289
9290 def WarpPointer(*args, **kwargs):
9291 """
9292 WarpPointer(self, int x, int y)
9293
9294 Moves the pointer to the given position on the window.
9295
9296 NOTE: This function is not supported under Mac because Apple Human
9297 Interface Guidelines forbid moving the mouse cursor programmatically.
9298 """
9299 return _core_.Window_WarpPointer(*args, **kwargs)
9300
9301 def CaptureMouse(*args, **kwargs):
9302 """
9303 CaptureMouse(self)
9304
9305 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9306 release the capture.
9307
9308 Note that wxWindows maintains the stack of windows having captured the
9309 mouse and when the mouse is released the capture returns to the window
9310 which had had captured it previously and it is only really released if
9311 there were no previous window. In particular, this means that you must
9312 release the mouse as many times as you capture it.
9313 """
9314 return _core_.Window_CaptureMouse(*args, **kwargs)
9315
9316 def ReleaseMouse(*args, **kwargs):
9317 """
9318 ReleaseMouse(self)
9319
9320 Releases mouse input captured with wx.Window.CaptureMouse.
9321 """
9322 return _core_.Window_ReleaseMouse(*args, **kwargs)
9323
9324 def GetCapture(*args, **kwargs):
9325 """
c24da6d6 9326 GetCapture() -> Window
d55e5bfc
RD
9327
9328 Returns the window which currently captures the mouse or None
9329 """
9330 return _core_.Window_GetCapture(*args, **kwargs)
9331
9332 GetCapture = staticmethod(GetCapture)
9333 def HasCapture(*args, **kwargs):
9334 """
9335 HasCapture(self) -> bool
9336
9337 Returns true if this window has the current mouse capture.
9338 """
9339 return _core_.Window_HasCapture(*args, **kwargs)
9340
9341 def Refresh(*args, **kwargs):
9342 """
9343 Refresh(self, bool eraseBackground=True, Rect rect=None)
9344
9345 Mark the specified rectangle (or the whole window) as "dirty" so it
9346 will be repainted. Causes an EVT_PAINT event to be generated and sent
9347 to the window.
9348 """
9349 return _core_.Window_Refresh(*args, **kwargs)
9350
9351 def RefreshRect(*args, **kwargs):
9352 """
fef4c27a 9353 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9354
9355 Redraws the contents of the given rectangle: the area inside it will
9356 be repainted. This is the same as Refresh but has a nicer syntax.
9357 """
9358 return _core_.Window_RefreshRect(*args, **kwargs)
9359
9360 def Update(*args, **kwargs):
9361 """
9362 Update(self)
9363
9364 Calling this method immediately repaints the invalidated area of the
9365 window instead of waiting for the EVT_PAINT event to happen, (normally
9366 this would usually only happen when the flow of control returns to the
9367 event loop.) Notice that this function doesn't refresh the window and
9368 does nothing if the window has been already repainted. Use Refresh
9369 first if you want to immediately redraw the window (or some portion of
9370 it) unconditionally.
9371 """
9372 return _core_.Window_Update(*args, **kwargs)
9373
9374 def ClearBackground(*args, **kwargs):
9375 """
9376 ClearBackground(self)
9377
9378 Clears the window by filling it with the current background
9379 colour. Does not cause an erase background event to be generated.
9380 """
9381 return _core_.Window_ClearBackground(*args, **kwargs)
9382
9383 def Freeze(*args, **kwargs):
9384 """
9385 Freeze(self)
9386
79fccf9d
RD
9387 Freezes the window or, in other words, prevents any updates from
9388 taking place on screen, the window is not redrawn at all. Thaw must be
9389 called to reenable window redrawing. Calls to Freeze/Thaw may be
9390 nested, with the actual Thaw being delayed until all the nesting has
9391 been undone.
d55e5bfc
RD
9392
9393 This method is useful for visual appearance optimization (for example,
9394 it is a good idea to use it before inserting large amount of text into
9395 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9396 for all controls so it is mostly just a hint to wxWindows and not a
9397 mandatory directive.
9398 """
9399 return _core_.Window_Freeze(*args, **kwargs)
9400
9401 def Thaw(*args, **kwargs):
9402 """
9403 Thaw(self)
9404
9405 Reenables window updating after a previous call to Freeze. Calls to
79fccf9d
RD
9406 Freeze/Thaw may be nested, so Thaw must be called the same number of
9407 times that Freeze was before the window will be updated.
d55e5bfc
RD
9408 """
9409 return _core_.Window_Thaw(*args, **kwargs)
9410
9411 def PrepareDC(*args, **kwargs):
9412 """
9413 PrepareDC(self, DC dc)
9414
9415 Call this function to prepare the device context for drawing a
9416 scrolled image. It sets the device origin according to the current
9417 scroll position.
9418 """
9419 return _core_.Window_PrepareDC(*args, **kwargs)
9420
9421 def GetUpdateRegion(*args, **kwargs):
9422 """
9423 GetUpdateRegion(self) -> Region
9424
9425 Returns the region specifying which parts of the window have been
9426 damaged. Should only be called within an EVT_PAINT handler.
9427 """
9428 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9429
9430 def GetUpdateClientRect(*args, **kwargs):
9431 """
9432 GetUpdateClientRect(self) -> Rect
9433
9434 Get the update rectangle region bounding box in client coords.
9435 """
9436 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9437
9438 def IsExposed(*args, **kwargs):
9439 """
9440 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9441
9442 Returns true if the given point or rectangle area has been exposed
9443 since the last repaint. Call this in an paint event handler to
9444 optimize redrawing by only redrawing those areas, which have been
9445 exposed.
9446 """
9447 return _core_.Window_IsExposed(*args, **kwargs)
9448
9449 def IsExposedPoint(*args, **kwargs):
9450 """
9451 IsExposedPoint(self, Point pt) -> bool
9452
9453 Returns true if the given point or rectangle area has been exposed
9454 since the last repaint. Call this in an paint event handler to
9455 optimize redrawing by only redrawing those areas, which have been
9456 exposed.
9457 """
9458 return _core_.Window_IsExposedPoint(*args, **kwargs)
9459
9460 def IsExposedRect(*args, **kwargs):
9461 """
9462 IsExposedRect(self, Rect rect) -> bool
9463
9464 Returns true if the given point or rectangle area has been exposed
9465 since the last repaint. Call this in an paint event handler to
9466 optimize redrawing by only redrawing those areas, which have been
9467 exposed.
9468 """
9469 return _core_.Window_IsExposedRect(*args, **kwargs)
9470
9471 def GetDefaultAttributes(*args, **kwargs):
9472 """
9473 GetDefaultAttributes(self) -> VisualAttributes
9474
79fccf9d
RD
9475 Get the default attributes for an instance of this class. This is
9476 useful if you want to use the same font or colour in your own control
9477 as in a standard control -- which is a much better idea than hard
9478 coding specific colours or fonts which might look completely out of
caef1a4d 9479 place on the user's system, especially if it uses themes.
d55e5bfc
RD
9480 """
9481 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9482
9483 def GetClassDefaultAttributes(*args, **kwargs):
9484 """
c24da6d6 9485 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9486
79fccf9d
RD
9487 Get the default attributes for this class. This is useful if you want
9488 to use the same font or colour in your own control as in a standard
9489 control -- which is a much better idea than hard coding specific
caef1a4d
RD
9490 colours or fonts which might look completely out of place on the
9491 user's system, especially if it uses themes.
d55e5bfc
RD
9492
9493 The variant parameter is only relevant under Mac currently and is
79fccf9d 9494 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
9495 the returned font. See `wx.Window.SetWindowVariant` for more about
9496 this.
d55e5bfc
RD
9497 """
9498 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9499
9500 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9501 def SetBackgroundColour(*args, **kwargs):
9502 """
9503 SetBackgroundColour(self, Colour colour) -> bool
9504
9505 Sets the background colour of the window. Returns True if the colour
9506 was changed. The background colour is usually painted by the default
9507 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9508 automatically under GTK. Using `wx.NullColour` will reset the window
9509 to the default background colour.
d55e5bfc 9510
caef1a4d 9511 Note that setting the background colour may not cause an immediate
f8167d6e 9512 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9513 calling this function.
9514
f8167d6e
RD
9515 Using this function will disable attempts to use themes for this
9516 window, if the system supports them. Use with care since usually the
9517 themes represent the appearance chosen by the user to be used for all
9518 applications on the system.
d55e5bfc
RD
9519 """
9520 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9521
412d302d
RD
9522 def SetOwnBackgroundColour(*args, **kwargs):
9523 """SetOwnBackgroundColour(self, Colour colour)"""
9524 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9525
9526 def SetForegroundColour(*args, **kwargs):
9527 """
9528 SetForegroundColour(self, Colour colour) -> bool
9529
9530 Sets the foreground colour of the window. Returns True is the colour
9531 was changed. The interpretation of foreground colour is dependent on
9532 the window class; it may be the text colour or other colour, or it may
9533 not be used at all.
9534 """
9535 return _core_.Window_SetForegroundColour(*args, **kwargs)
9536
fa47d7a7
VS
9537 def SetOwnForegroundColour(*args, **kwargs):
9538 """SetOwnForegroundColour(self, Colour colour)"""
9539 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9540
9541 def GetBackgroundColour(*args, **kwargs):
9542 """
9543 GetBackgroundColour(self) -> Colour
9544
9545 Returns the background colour of the window.
9546 """
9547 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9548
9549 def GetForegroundColour(*args, **kwargs):
9550 """
9551 GetForegroundColour(self) -> Colour
9552
9553 Returns the foreground colour of the window. The interpretation of
9554 foreground colour is dependent on the window class; it may be the text
9555 colour or other colour, or it may not be used at all.
9556 """
9557 return _core_.Window_GetForegroundColour(*args, **kwargs)
9558
dcb8fc74
RD
9559 def InheritsBackgroundColour(*args, **kwargs):
9560 """InheritsBackgroundColour(self) -> bool"""
9561 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9562
9563 def UseBgCol(*args, **kwargs):
9564 """UseBgCol(self) -> bool"""
9565 return _core_.Window_UseBgCol(*args, **kwargs)
9566
0f63ec68
RD
9567 def SetBackgroundStyle(*args, **kwargs):
9568 """
9569 SetBackgroundStyle(self, int style) -> bool
9570
9571 Returns the background style of the window. The background style
9572 indicates how the background of the window is drawn.
9573
9574 ====================== ========================================
9575 wx.BG_STYLE_SYSTEM The background colour or pattern should
9576 be determined by the system
9577 wx.BG_STYLE_COLOUR The background should be a solid colour
9578 wx.BG_STYLE_CUSTOM The background will be implemented by the
9579 application.
9580 ====================== ========================================
9581
9582 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9583 a custom background, such as a tiled bitmap. Currently the style has
9584 no effect on other platforms.
9585
9586 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9587 """
9588 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9589
9590 def GetBackgroundStyle(*args, **kwargs):
9591 """
9592 GetBackgroundStyle(self) -> int
9593
9594 Returns the background style of the window.
9595
9596 :see: `SetBackgroundStyle`
9597 """
9598 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9599
51b83b37
RD
9600 def HasTransparentBackground(*args, **kwargs):
9601 """
9602 HasTransparentBackground(self) -> bool
9603
9604 Returns True if this window's background is transparent (as, for
9605 example, for `wx.StaticText`) and should show the parent window's
9606 background.
9607
9608 This method is mostly used internally by the library itself and you
9609 normally shouldn't have to call it. You may, however, have to override
9610 it in your custom control classes to ensure that background is painted
9611 correctly.
9612 """
9613 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9614
d55e5bfc
RD
9615 def SetCursor(*args, **kwargs):
9616 """
9617 SetCursor(self, Cursor cursor) -> bool
9618
9619 Sets the window's cursor. Notice that the window cursor also sets it
9620 for the children of the window implicitly.
9621
9622 The cursor may be wx.NullCursor in which case the window cursor will
9623 be reset back to default.
9624 """
9625 return _core_.Window_SetCursor(*args, **kwargs)
9626
9627 def GetCursor(*args, **kwargs):
9628 """
9629 GetCursor(self) -> Cursor
9630
9631 Return the cursor associated with this window.
9632 """
9633 return _core_.Window_GetCursor(*args, **kwargs)
9634
9635 def SetFont(*args, **kwargs):
9636 """
9637 SetFont(self, Font font) -> bool
9638
9639 Sets the font for this window.
9640 """
9641 return _core_.Window_SetFont(*args, **kwargs)
9642
fa47d7a7
VS
9643 def SetOwnFont(*args, **kwargs):
9644 """SetOwnFont(self, Font font)"""
9645 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9646
9647 def GetFont(*args, **kwargs):
9648 """
9649 GetFont(self) -> Font
9650
9651 Returns the default font used for this window.
9652 """
9653 return _core_.Window_GetFont(*args, **kwargs)
9654
9655 def SetCaret(*args, **kwargs):
9656 """
9657 SetCaret(self, Caret caret)
9658
9659 Sets the caret associated with the window.
9660 """
9661 return _core_.Window_SetCaret(*args, **kwargs)
9662
9663 def GetCaret(*args, **kwargs):
9664 """
9665 GetCaret(self) -> Caret
9666
9667 Returns the caret associated with the window.
9668 """
9669 return _core_.Window_GetCaret(*args, **kwargs)
9670
9671 def GetCharHeight(*args, **kwargs):
9672 """
9673 GetCharHeight(self) -> int
9674
9675 Get the (average) character size for the current font.
9676 """
9677 return _core_.Window_GetCharHeight(*args, **kwargs)
9678
9679 def GetCharWidth(*args, **kwargs):
9680 """
9681 GetCharWidth(self) -> int
9682
9683 Get the (average) character size for the current font.
9684 """
9685 return _core_.Window_GetCharWidth(*args, **kwargs)
9686
9687 def GetTextExtent(*args, **kwargs):
a8eff060
RD
9688 """
9689 GetTextExtent(String string) -> (width, height)
9690
9691 Get the width and height of the text using the current font.
9692 """
d55e5bfc
RD
9693 return _core_.Window_GetTextExtent(*args, **kwargs)
9694
9695 def GetFullTextExtent(*args, **kwargs):
9696 """
9697 GetFullTextExtent(String string, Font font=None) ->
9698 (width, height, descent, externalLeading)
9699
9700 Get the width, height, decent and leading of the text using the
9701 current or specified font.
9702 """
9703 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9704
9705 def ClientToScreenXY(*args, **kwargs):
9706 """
9707 ClientToScreenXY(int x, int y) -> (x,y)
9708
9709 Converts to screen coordinates from coordinates relative to this window.
9710 """
9711 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9712
9713 def ScreenToClientXY(*args, **kwargs):
9714 """
9715 ScreenToClientXY(int x, int y) -> (x,y)
9716
9717 Converts from screen to client window coordinates.
9718 """
9719 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9720
9721 def ClientToScreen(*args, **kwargs):
9722 """
9723 ClientToScreen(self, Point pt) -> Point
9724
9725 Converts to screen coordinates from coordinates relative to this window.
9726 """
9727 return _core_.Window_ClientToScreen(*args, **kwargs)
9728
9729 def ScreenToClient(*args, **kwargs):
9730 """
9731 ScreenToClient(self, Point pt) -> Point
9732
9733 Converts from screen to client window coordinates.
9734 """
9735 return _core_.Window_ScreenToClient(*args, **kwargs)
9736
9737 def HitTestXY(*args, **kwargs):
9738 """
9739 HitTestXY(self, int x, int y) -> int
9740
9741 Test where the given (in client coords) point lies
9742 """
9743 return _core_.Window_HitTestXY(*args, **kwargs)
9744
9745 def HitTest(*args, **kwargs):
9746 """
9747 HitTest(self, Point pt) -> int
9748
9749 Test where the given (in client coords) point lies
9750 """
9751 return _core_.Window_HitTest(*args, **kwargs)
9752
9753 def GetBorder(*args):
9754 """
9755 GetBorder(self, long flags) -> int
9756 GetBorder(self) -> int
9757
9758 Get border for the flags of this window
9759 """
9760 return _core_.Window_GetBorder(*args)
9761
9762 def UpdateWindowUI(*args, **kwargs):
9763 """
9764 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9765
9766 This function sends EVT_UPDATE_UI events to the window. The particular
9767 implementation depends on the window; for example a wx.ToolBar will
9768 send an update UI event for each toolbar button, and a wx.Frame will
9769 send an update UI event for each menubar menu item. You can call this
9770 function from your application to ensure that your UI is up-to-date at
9771 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9772 concerned). This may be necessary if you have called
5ba5649b 9773 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9774 limit the overhead that wxWindows incurs by sending update UI events
9775 in idle time.
d55e5bfc
RD
9776 """
9777 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9778
9779 def PopupMenuXY(*args, **kwargs):
9780 """
7a0b95b0 9781 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9782
7a0b95b0
RD
9783 Pops up the given menu at the specified coordinates, relative to this window,
9784 and returns control when the user has dismissed the menu. If a menu item is
9785 selected, the corresponding menu event is generated and will be processed as
9786 usual. If the default position is given then the current position of the
9787 mouse cursor will be used.
d55e5bfc
RD
9788 """
9789 return _core_.Window_PopupMenuXY(*args, **kwargs)
9790
9791 def PopupMenu(*args, **kwargs):
9792 """
7a0b95b0 9793 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9794
7a0b95b0
RD
9795 Pops up the given menu at the specified coordinates, relative to this window,
9796 and returns control when the user has dismissed the menu. If a menu item is
9797 selected, the corresponding menu event is generated and will be processed as
9798 usual. If the default position is given then the current position of the
9799 mouse cursor will be used.
d55e5bfc
RD
9800 """
9801 return _core_.Window_PopupMenu(*args, **kwargs)
9802
9803 def GetHandle(*args, **kwargs):
9804 """
9805 GetHandle(self) -> long
9806
9807 Returns the platform-specific handle (as a long integer) of the
9808 physical window. Currently on wxMac it returns the handle of the
9809 toplevel parent of the window.
9810 """
9811 return _core_.Window_GetHandle(*args, **kwargs)
9812
629e65c2
RD
9813 def AssociateHandle(*args, **kwargs):
9814 """
9815 AssociateHandle(self, long handle)
9816
9817 Associate the window with a new native handle
9818 """
9819 return _core_.Window_AssociateHandle(*args, **kwargs)
9820
9821 def DissociateHandle(*args, **kwargs):
9822 """
9823 DissociateHandle(self)
9824
9825 Dissociate the current native handle from the window
9826 """
9827 return _core_.Window_DissociateHandle(*args, **kwargs)
9828
d55e5bfc
RD
9829 def OnPaint(*args, **kwargs):
9830 """OnPaint(self, PaintEvent event)"""
9831 return _core_.Window_OnPaint(*args, **kwargs)
9832
9833 def HasScrollbar(*args, **kwargs):
9834 """
9835 HasScrollbar(self, int orient) -> bool
9836
9837 Does the window have the scrollbar for this orientation?
9838 """
9839 return _core_.Window_HasScrollbar(*args, **kwargs)
9840
9841 def SetScrollbar(*args, **kwargs):
9842 """
79fccf9d 9843 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9844 bool refresh=True)
9845
9846 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
9847 """
9848 return _core_.Window_SetScrollbar(*args, **kwargs)
9849
9850 def SetScrollPos(*args, **kwargs):
9851 """
9852 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9853
9854 Sets the position of one of the built-in scrollbars.
9855 """
9856 return _core_.Window_SetScrollPos(*args, **kwargs)
9857
9858 def GetScrollPos(*args, **kwargs):
9859 """
9860 GetScrollPos(self, int orientation) -> int
9861
9862 Returns the built-in scrollbar position.
9863 """
9864 return _core_.Window_GetScrollPos(*args, **kwargs)
9865
9866 def GetScrollThumb(*args, **kwargs):
9867 """
9868 GetScrollThumb(self, int orientation) -> int
9869
9870 Returns the built-in scrollbar thumb size.
9871 """
9872 return _core_.Window_GetScrollThumb(*args, **kwargs)
9873
9874 def GetScrollRange(*args, **kwargs):
9875 """
9876 GetScrollRange(self, int orientation) -> int
9877
9878 Returns the built-in scrollbar range.
9879 """
9880 return _core_.Window_GetScrollRange(*args, **kwargs)
9881
9882 def ScrollWindow(*args, **kwargs):
9883 """
9884 ScrollWindow(self, int dx, int dy, Rect rect=None)
9885
9886 Physically scrolls the pixels in the window and move child windows
9887 accordingly. Use this function to optimise your scrolling
9888 implementations, to minimise the area that must be redrawn. Note that
9889 it is rarely required to call this function from a user program.
d55e5bfc
RD
9890 """
9891 return _core_.Window_ScrollWindow(*args, **kwargs)
9892
9893 def ScrollLines(*args, **kwargs):
9894 """
9895 ScrollLines(self, int lines) -> bool
9896
9897 If the platform and window class supports it, scrolls the window by
9898 the given number of lines down, if lines is positive, or up if lines
9899 is negative. Returns True if the window was scrolled, False if it was
9900 already on top/bottom and nothing was done.
9901 """
9902 return _core_.Window_ScrollLines(*args, **kwargs)
9903
9904 def ScrollPages(*args, **kwargs):
9905 """
9906 ScrollPages(self, int pages) -> bool
9907
79fccf9d 9908 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9909 the given number of pages down, if pages is positive, or up if pages
9910 is negative. Returns True if the window was scrolled, False if it was
9911 already on top/bottom and nothing was done.
9912 """
9913 return _core_.Window_ScrollPages(*args, **kwargs)
9914
9915 def LineUp(*args, **kwargs):
9916 """
9917 LineUp(self) -> bool
9918
9919 This is just a wrapper for ScrollLines(-1).
9920 """
9921 return _core_.Window_LineUp(*args, **kwargs)
9922
9923 def LineDown(*args, **kwargs):
9924 """
9925 LineDown(self) -> bool
9926
9927 This is just a wrapper for ScrollLines(1).
9928 """
9929 return _core_.Window_LineDown(*args, **kwargs)
9930
9931 def PageUp(*args, **kwargs):
9932 """
9933 PageUp(self) -> bool
9934
9935 This is just a wrapper for ScrollPages(-1).
9936 """
9937 return _core_.Window_PageUp(*args, **kwargs)
9938
9939 def PageDown(*args, **kwargs):
9940 """
9941 PageDown(self) -> bool
9942
9943 This is just a wrapper for ScrollPages(1).
9944 """
9945 return _core_.Window_PageDown(*args, **kwargs)
9946
9947 def SetHelpText(*args, **kwargs):
9948 """
9949 SetHelpText(self, String text)
9950
9951 Sets the help text to be used as context-sensitive help for this
9952 window. Note that the text is actually stored by the current
9953 wxHelpProvider implementation, and not in the window object itself.
9954 """
9955 return _core_.Window_SetHelpText(*args, **kwargs)
9956
9957 def SetHelpTextForId(*args, **kwargs):
9958 """
9959 SetHelpTextForId(self, String text)
9960
9961 Associate this help text with all windows with the same id as this
9962 one.
9963 """
9964 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9965
9966 def GetHelpText(*args, **kwargs):
9967 """
9968 GetHelpText(self) -> String
9969
9970 Gets the help text to be used as context-sensitive help for this
9971 window. Note that the text is actually stored by the current
9972 wxHelpProvider implementation, and not in the window object itself.
9973 """
9974 return _core_.Window_GetHelpText(*args, **kwargs)
9975
9976 def SetToolTipString(*args, **kwargs):
9977 """
9978 SetToolTipString(self, String tip)
9979
9980 Attach a tooltip to the window.
9981 """
9982 return _core_.Window_SetToolTipString(*args, **kwargs)
9983
9984 def SetToolTip(*args, **kwargs):
9985 """
9986 SetToolTip(self, ToolTip tip)
9987
9988 Attach a tooltip to the window.
9989 """
9990 return _core_.Window_SetToolTip(*args, **kwargs)
9991
9992 def GetToolTip(*args, **kwargs):
9993 """
9994 GetToolTip(self) -> ToolTip
9995
9996 get the associated tooltip or None if none
9997 """
9998 return _core_.Window_GetToolTip(*args, **kwargs)
9999
10000 def SetDropTarget(*args, **kwargs):
10001 """
10002 SetDropTarget(self, DropTarget dropTarget)
10003
10004 Associates a drop target with this window. If the window already has
10005 a drop target, it is deleted.
10006 """
10007 return _core_.Window_SetDropTarget(*args, **kwargs)
10008
10009 def GetDropTarget(*args, **kwargs):
10010 """
10011 GetDropTarget(self) -> DropTarget
10012
10013 Returns the associated drop target, which may be None.
10014 """
10015 return _core_.Window_GetDropTarget(*args, **kwargs)
10016
10017 def DragAcceptFiles(*args, **kwargs):
10018 """
10019 DragAcceptFiles(self, bool accept)
10020
10021 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
5ba5649b 10022 Only functional on Windows.
d55e5bfc
RD
10023 """
10024 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10025
10026 def SetConstraints(*args, **kwargs):
10027 """
10028 SetConstraints(self, LayoutConstraints constraints)
10029
10030 Sets the window to have the given layout constraints. If an existing
10031 layout constraints object is already owned by the window, it will be
10032 deleted. Pass None to disassociate and delete the window's current
10033 constraints.
10034
10035 You must call SetAutoLayout to tell a window to use the constraints
10036 automatically in its default EVT_SIZE handler; otherwise, you must
10037 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10038 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10039 effect.
10040 """
10041 return _core_.Window_SetConstraints(*args, **kwargs)
10042
10043 def GetConstraints(*args, **kwargs):
10044 """
10045 GetConstraints(self) -> LayoutConstraints
10046
10047 Returns a pointer to the window's layout constraints, or None if there
10048 are none.
10049 """
10050 return _core_.Window_GetConstraints(*args, **kwargs)
10051
10052 def SetAutoLayout(*args, **kwargs):
10053 """
10054 SetAutoLayout(self, bool autoLayout)
10055
10056 Determines whether the Layout function will be called automatically
b1fcee84
RD
10057 when the window is resized. lease note that this only happens for the
10058 windows usually used to contain children, namely `wx.Panel` and
10059 `wx.TopLevelWindow` (and the classes deriving from them).
10060
10061 This method is called implicitly by `SetSizer` but if you use
10062 `SetConstraints` you should call it manually or otherwise the window
10063 layout won't be correctly updated when its size changes.
d55e5bfc
RD
10064 """
10065 return _core_.Window_SetAutoLayout(*args, **kwargs)
10066
10067 def GetAutoLayout(*args, **kwargs):
10068 """
10069 GetAutoLayout(self) -> bool
10070
10071 Returns the current autoLayout setting
10072 """
10073 return _core_.Window_GetAutoLayout(*args, **kwargs)
10074
10075 def Layout(*args, **kwargs):
10076 """
10077 Layout(self) -> bool
10078
10079 Invokes the constraint-based layout algorithm or the sizer-based
10080 algorithm for this window. See SetAutoLayout: when auto layout is on,
10081 this function gets called automatically by the default EVT_SIZE
10082 handler when the window is resized.
10083 """
10084 return _core_.Window_Layout(*args, **kwargs)
10085
10086 def SetSizer(*args, **kwargs):
10087 """
10088 SetSizer(self, Sizer sizer, bool deleteOld=True)
10089
10090 Sets the window to have the given layout sizer. The window will then
10091 own the object, and will take care of its deletion. If an existing
10092 layout sizer object is already owned by the window, it will be deleted
10093 if the deleteOld parameter is true. Note that this function will also
10094 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 10095 non-None, and False otherwise.
d55e5bfc
RD
10096 """
10097 return _core_.Window_SetSizer(*args, **kwargs)
10098
10099 def SetSizerAndFit(*args, **kwargs):
10100 """
10101 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
10102
10103 The same as SetSizer, except it also sets the size hints for the
10104 window based on the sizer's minimum size.
10105 """
10106 return _core_.Window_SetSizerAndFit(*args, **kwargs)
10107
10108 def GetSizer(*args, **kwargs):
10109 """
10110 GetSizer(self) -> Sizer
10111
10112 Return the sizer associated with the window by a previous call to
10113 SetSizer or None if there isn't one.
10114 """
10115 return _core_.Window_GetSizer(*args, **kwargs)
10116
10117 def SetContainingSizer(*args, **kwargs):
10118 """
10119 SetContainingSizer(self, Sizer sizer)
10120
10121 This normally does not need to be called by application code. It is
10122 called internally when a window is added to a sizer, and is used so
10123 the window can remove itself from the sizer when it is destroyed.
10124 """
10125 return _core_.Window_SetContainingSizer(*args, **kwargs)
10126
10127 def GetContainingSizer(*args, **kwargs):
10128 """
10129 GetContainingSizer(self) -> Sizer
10130
10131 Return the sizer that this window is a member of, if any, otherwise None.
10132 """
10133 return _core_.Window_GetContainingSizer(*args, **kwargs)
10134
10135 def InheritAttributes(*args, **kwargs):
10136 """
10137 InheritAttributes(self)
10138
79fccf9d
RD
10139 This function is (or should be, in case of custom controls) called
10140 during window creation to intelligently set up the window visual
10141 attributes, that is the font and the foreground and background
10142 colours.
10143
10144 By 'intelligently' the following is meant: by default, all windows use
10145 their own default attributes. However if some of the parent's
10146 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10147 SetOwnFont) and if the corresponding attribute hadn't been
79fccf9d
RD
10148 explicitly set for this window itself, then this window takes the same
10149 value as used by the parent. In addition, if the window overrides
10150 ShouldInheritColours to return false, the colours will not be changed
10151 no matter what and only the font might.
10152
ec9b55ca
RD
10153 This rather complicated logic is necessary in order to accommodate the
10154 different usage scenarios. The most common one is when all default
79fccf9d
RD
10155 attributes are used and in this case, nothing should be inherited as
10156 in modern GUIs different controls use different fonts (and colours)
10157 than their siblings so they can't inherit the same value from the
10158 parent. However it was also deemed desirable to allow to simply change
10159 the attributes of all children at once by just changing the font or
10160 colour of their common parent, hence in this case we do inherit the
10161 parents attributes.
10162
d55e5bfc
RD
10163 """
10164 return _core_.Window_InheritAttributes(*args, **kwargs)
10165
10166 def ShouldInheritColours(*args, **kwargs):
10167 """
10168 ShouldInheritColours(self) -> bool
10169
10170 Return true from here to allow the colours of this window to be
79fccf9d
RD
10171 changed by InheritAttributes, returning false forbids inheriting them
10172 from the parent window.
d55e5bfc 10173
79fccf9d
RD
10174 The base class version returns false, but this method is overridden in
10175 wxControl where it returns true.
d55e5bfc
RD
10176 """
10177 return _core_.Window_ShouldInheritColours(*args, **kwargs)
10178
10179 def PostCreate(self, pre):
10180 """
10181 Phase 3 of the 2-phase create <wink!>
10182 Call this method after precreating the window with the 2-phase create method.
10183 """
10184 self.this = pre.this
10185 self.thisown = pre.thisown
10186 pre.thisown = 0
10187 if hasattr(self, '_setOORInfo'):
10188 self._setOORInfo(self)
10189 if hasattr(self, '_setCallbackInfo'):
10190 self._setCallbackInfo(self, self.__class__)
10191
7e08d4ef
RD
10192 def SendSizeEvent(self):
10193 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
10194
d55e5bfc
RD
10195
10196class WindowPtr(Window):
10197 def __init__(self, this):
10198 self.this = this
10199 if not hasattr(self,"thisown"): self.thisown = 0
10200 self.__class__ = Window
10201_core_.Window_swigregister(WindowPtr)
10202
10203def PreWindow(*args, **kwargs):
10204 """
10205 PreWindow() -> Window
10206
10207 Precreate a Window for 2-phase creation.
10208 """
10209 val = _core_.new_PreWindow(*args, **kwargs)
10210 val.thisown = 1
10211 return val
10212
10213def Window_NewControlId(*args, **kwargs):
10214 """
10215 Window_NewControlId() -> int
10216
10217 Generate a control id for the controls which were not given one.
10218 """
10219 return _core_.Window_NewControlId(*args, **kwargs)
10220
10221def Window_NextControlId(*args, **kwargs):
10222 """
10223 Window_NextControlId(int winid) -> int
10224
10225 Get the id of the control following the one with the given
79fccf9d 10226 autogenerated) id
d55e5bfc
RD
10227 """
10228 return _core_.Window_NextControlId(*args, **kwargs)
10229
10230def Window_PrevControlId(*args, **kwargs):
10231 """
10232 Window_PrevControlId(int winid) -> int
10233
10234 Get the id of the control preceding the one with the given
79fccf9d 10235 autogenerated) id
d55e5bfc
RD
10236 """
10237 return _core_.Window_PrevControlId(*args, **kwargs)
10238
10239def Window_FindFocus(*args, **kwargs):
10240 """
10241 Window_FindFocus() -> Window
10242
10243 Returns the window or control that currently has the keyboard focus,
10244 or None.
10245 """
10246 return _core_.Window_FindFocus(*args, **kwargs)
10247
10248def Window_GetCapture(*args, **kwargs):
10249 """
10250 Window_GetCapture() -> Window
10251
10252 Returns the window which currently captures the mouse or None
10253 """
10254 return _core_.Window_GetCapture(*args, **kwargs)
10255
10256def Window_GetClassDefaultAttributes(*args, **kwargs):
10257 """
10258 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10259
79fccf9d
RD
10260 Get the default attributes for this class. This is useful if you want
10261 to use the same font or colour in your own control as in a standard
10262 control -- which is a much better idea than hard coding specific
caef1a4d
RD
10263 colours or fonts which might look completely out of place on the
10264 user's system, especially if it uses themes.
d55e5bfc
RD
10265
10266 The variant parameter is only relevant under Mac currently and is
79fccf9d 10267 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
10268 the returned font. See `wx.Window.SetWindowVariant` for more about
10269 this.
d55e5bfc
RD
10270 """
10271 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10272
10273def DLG_PNT(win, point_or_x, y=None):
10274 """
10275 Convenience function for converting a Point or (x,y) in
10276 dialog units to pixel units.
10277 """
10278 if y is None:
10279 return win.ConvertDialogPointToPixels(point_or_x)
10280 else:
10281 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10282
10283def DLG_SZE(win, size_width, height=None):
10284 """
10285 Convenience function for converting a Size or (w,h) in
10286 dialog units to pixel units.
10287 """
10288 if height is None:
10289 return win.ConvertDialogSizeToPixels(size_width)
10290 else:
10291 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10292
10293
10294def FindWindowById(*args, **kwargs):
10295 """
10296 FindWindowById(long id, Window parent=None) -> Window
10297
10298 Find the first window in the application with the given id. If parent
10299 is None, the search will start from all top-level frames and dialog
10300 boxes; if non-None, the search will be limited to the given window
10301 hierarchy. The search is recursive in both cases.
10302 """
10303 return _core_.FindWindowById(*args, **kwargs)
10304
10305def FindWindowByName(*args, **kwargs):
10306 """
10307 FindWindowByName(String name, Window parent=None) -> Window
10308
10309 Find a window by its name (as given in a window constructor or Create
10310 function call). If parent is None, the search will start from all
10311 top-level frames and dialog boxes; if non-None, the search will be
10312 limited to the given window hierarchy. The search is recursive in both
10313 cases.
10314
10315 If no window with such name is found, wx.FindWindowByLabel is called.
10316 """
10317 return _core_.FindWindowByName(*args, **kwargs)
10318
10319def FindWindowByLabel(*args, **kwargs):
10320 """
10321 FindWindowByLabel(String label, Window parent=None) -> Window
10322
10323 Find a window by its label. Depending on the type of window, the label
10324 may be a window title or panel item label. If parent is None, the
10325 search will start from all top-level frames and dialog boxes; if
10326 non-None, the search will be limited to the given window
10327 hierarchy. The search is recursive in both cases.
10328 """
10329 return _core_.FindWindowByLabel(*args, **kwargs)
10330
10331def Window_FromHWND(*args, **kwargs):
10332 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10333 return _core_.Window_FromHWND(*args, **kwargs)
3215336e
RD
10334
10335def GetTopLevelWindows(*args, **kwargs):
10336 """
10337 GetTopLevelWindows() -> PyObject
10338
10339 Returns a list of the the application's top-level windows, (frames,
10340 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10341 by wxWidgets, and so it is only valid as long as no top-level windows
10342 are closed or new top-level windows are created.
10343
10344 """
10345 return _core_.GetTopLevelWindows(*args, **kwargs)
d55e5bfc
RD
10346#---------------------------------------------------------------------------
10347
10348class Validator(EvtHandler):
093d3ff1 10349 """Proxy of C++ Validator class"""
d55e5bfc
RD
10350 def __repr__(self):
10351 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10352 def __init__(self, *args, **kwargs):
10353 """__init__(self) -> Validator"""
10354 newobj = _core_.new_Validator(*args, **kwargs)
10355 self.this = newobj.this
10356 self.thisown = 1
10357 del newobj.thisown
10358 self._setOORInfo(self)
10359
10360 def Clone(*args, **kwargs):
10361 """Clone(self) -> Validator"""
10362 return _core_.Validator_Clone(*args, **kwargs)
10363
10364 def Validate(*args, **kwargs):
10365 """Validate(self, Window parent) -> bool"""
10366 return _core_.Validator_Validate(*args, **kwargs)
10367
10368 def TransferToWindow(*args, **kwargs):
10369 """TransferToWindow(self) -> bool"""
10370 return _core_.Validator_TransferToWindow(*args, **kwargs)
10371
10372 def TransferFromWindow(*args, **kwargs):
10373 """TransferFromWindow(self) -> bool"""
10374 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10375
10376 def GetWindow(*args, **kwargs):
10377 """GetWindow(self) -> Window"""
10378 return _core_.Validator_GetWindow(*args, **kwargs)
10379
10380 def SetWindow(*args, **kwargs):
10381 """SetWindow(self, Window window)"""
10382 return _core_.Validator_SetWindow(*args, **kwargs)
10383
10384 def IsSilent(*args, **kwargs):
c24da6d6 10385 """IsSilent() -> bool"""
d55e5bfc
RD
10386 return _core_.Validator_IsSilent(*args, **kwargs)
10387
10388 IsSilent = staticmethod(IsSilent)
10389 def SetBellOnError(*args, **kwargs):
c24da6d6 10390 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
10391 return _core_.Validator_SetBellOnError(*args, **kwargs)
10392
10393 SetBellOnError = staticmethod(SetBellOnError)
10394
10395class ValidatorPtr(Validator):
10396 def __init__(self, this):
10397 self.this = this
10398 if not hasattr(self,"thisown"): self.thisown = 0
10399 self.__class__ = Validator
10400_core_.Validator_swigregister(ValidatorPtr)
10401
10402def Validator_IsSilent(*args, **kwargs):
10403 """Validator_IsSilent() -> bool"""
10404 return _core_.Validator_IsSilent(*args, **kwargs)
10405
10406def Validator_SetBellOnError(*args, **kwargs):
10407 """Validator_SetBellOnError(int doIt=True)"""
10408 return _core_.Validator_SetBellOnError(*args, **kwargs)
10409
10410class PyValidator(Validator):
093d3ff1 10411 """Proxy of C++ PyValidator class"""
d55e5bfc
RD
10412 def __repr__(self):
10413 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10414 def __init__(self, *args, **kwargs):
10415 """__init__(self) -> PyValidator"""
10416 newobj = _core_.new_PyValidator(*args, **kwargs)
10417 self.this = newobj.this
10418 self.thisown = 1
10419 del newobj.thisown
10420
10421 self._setCallbackInfo(self, PyValidator, 1)
10422 self._setOORInfo(self)
10423
10424 def _setCallbackInfo(*args, **kwargs):
10425 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10426 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10427
10428
10429class PyValidatorPtr(PyValidator):
10430 def __init__(self, this):
10431 self.this = this
10432 if not hasattr(self,"thisown"): self.thisown = 0
10433 self.__class__ = PyValidator
10434_core_.PyValidator_swigregister(PyValidatorPtr)
10435
10436#---------------------------------------------------------------------------
10437
10438class Menu(EvtHandler):
093d3ff1 10439 """Proxy of C++ Menu class"""
d55e5bfc
RD
10440 def __repr__(self):
10441 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10442 def __init__(self, *args, **kwargs):
10443 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10444 newobj = _core_.new_Menu(*args, **kwargs)
10445 self.this = newobj.this
10446 self.thisown = 1
10447 del newobj.thisown
10448 self._setOORInfo(self)
10449
10450 def Append(*args, **kwargs):
10451 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10452 return _core_.Menu_Append(*args, **kwargs)
10453
10454 def AppendSeparator(*args, **kwargs):
10455 """AppendSeparator(self) -> MenuItem"""
10456 return _core_.Menu_AppendSeparator(*args, **kwargs)
10457
10458 def AppendCheckItem(*args, **kwargs):
10459 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10460 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10461
10462 def AppendRadioItem(*args, **kwargs):
10463 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10464 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10465
10466 def AppendMenu(*args, **kwargs):
10467 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10468 return _core_.Menu_AppendMenu(*args, **kwargs)
10469
10470 def AppendItem(*args, **kwargs):
10471 """AppendItem(self, MenuItem item) -> MenuItem"""
10472 return _core_.Menu_AppendItem(*args, **kwargs)
10473
10474 def Break(*args, **kwargs):
10475 """Break(self)"""
10476 return _core_.Menu_Break(*args, **kwargs)
10477
10478 def InsertItem(*args, **kwargs):
10479 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10480 return _core_.Menu_InsertItem(*args, **kwargs)
10481
10482 def Insert(*args, **kwargs):
10483 """
10484 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10485 int kind=ITEM_NORMAL) -> MenuItem
10486 """
10487 return _core_.Menu_Insert(*args, **kwargs)
10488
10489 def InsertSeparator(*args, **kwargs):
10490 """InsertSeparator(self, size_t pos) -> MenuItem"""
10491 return _core_.Menu_InsertSeparator(*args, **kwargs)
10492
10493 def InsertCheckItem(*args, **kwargs):
10494 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10495 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10496
10497 def InsertRadioItem(*args, **kwargs):
10498 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10499 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10500
10501 def InsertMenu(*args, **kwargs):
10502 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10503 return _core_.Menu_InsertMenu(*args, **kwargs)
10504
10505 def PrependItem(*args, **kwargs):
10506 """PrependItem(self, MenuItem item) -> MenuItem"""
10507 return _core_.Menu_PrependItem(*args, **kwargs)
10508
10509 def Prepend(*args, **kwargs):
10510 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10511 return _core_.Menu_Prepend(*args, **kwargs)
10512
10513 def PrependSeparator(*args, **kwargs):
10514 """PrependSeparator(self) -> MenuItem"""
10515 return _core_.Menu_PrependSeparator(*args, **kwargs)
10516
10517 def PrependCheckItem(*args, **kwargs):
10518 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10519 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10520
10521 def PrependRadioItem(*args, **kwargs):
10522 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10523 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10524
10525 def PrependMenu(*args, **kwargs):
10526 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10527 return _core_.Menu_PrependMenu(*args, **kwargs)
10528
10529 def Remove(*args, **kwargs):
10530 """Remove(self, int id) -> MenuItem"""
10531 return _core_.Menu_Remove(*args, **kwargs)
10532
10533 def RemoveItem(*args, **kwargs):
10534 """RemoveItem(self, MenuItem item) -> MenuItem"""
10535 return _core_.Menu_RemoveItem(*args, **kwargs)
10536
10537 def Delete(*args, **kwargs):
10538 """Delete(self, int id) -> bool"""
10539 return _core_.Menu_Delete(*args, **kwargs)
10540
10541 def DeleteItem(*args, **kwargs):
10542 """DeleteItem(self, MenuItem item) -> bool"""
10543 return _core_.Menu_DeleteItem(*args, **kwargs)
10544
10545 def Destroy(*args, **kwargs):
10546 """
10547 Destroy(self)
10548
10549 Deletes the C++ object this Python object is a proxy for.
10550 """
7e08d4ef
RD
10551 val = _core_.Menu_Destroy(*args, **kwargs)
10552 args[0].thisown = 0
10553 return val
d55e5bfc
RD
10554
10555 def DestroyId(*args, **kwargs):
10556 """
10557 DestroyId(self, int id) -> bool
10558
10559 Deletes the C++ object this Python object is a proxy for.
10560 """
7e08d4ef
RD
10561 val = _core_.Menu_DestroyId(*args, **kwargs)
10562 args[0].thisown = 0
10563 return val
d55e5bfc
RD
10564
10565 def DestroyItem(*args, **kwargs):
10566 """
10567 DestroyItem(self, MenuItem item) -> bool
10568
10569 Deletes the C++ object this Python object is a proxy for.
10570 """
7e08d4ef
RD
10571 val = _core_.Menu_DestroyItem(*args, **kwargs)
10572 args[0].thisown = 0
10573 return val
d55e5bfc
RD
10574
10575 def GetMenuItemCount(*args, **kwargs):
10576 """GetMenuItemCount(self) -> size_t"""
10577 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10578
10579 def GetMenuItems(*args, **kwargs):
10580 """GetMenuItems(self) -> PyObject"""
10581 return _core_.Menu_GetMenuItems(*args, **kwargs)
10582
10583 def FindItem(*args, **kwargs):
10584 """FindItem(self, String item) -> int"""
10585 return _core_.Menu_FindItem(*args, **kwargs)
10586
10587 def FindItemById(*args, **kwargs):
10588 """FindItemById(self, int id) -> MenuItem"""
10589 return _core_.Menu_FindItemById(*args, **kwargs)
10590
10591 def FindItemByPosition(*args, **kwargs):
10592 """FindItemByPosition(self, size_t position) -> MenuItem"""
10593 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10594
10595 def Enable(*args, **kwargs):
10596 """Enable(self, int id, bool enable)"""
10597 return _core_.Menu_Enable(*args, **kwargs)
10598
10599 def IsEnabled(*args, **kwargs):
10600 """IsEnabled(self, int id) -> bool"""
10601 return _core_.Menu_IsEnabled(*args, **kwargs)
10602
10603 def Check(*args, **kwargs):
10604 """Check(self, int id, bool check)"""
10605 return _core_.Menu_Check(*args, **kwargs)
10606
10607 def IsChecked(*args, **kwargs):
10608 """IsChecked(self, int id) -> bool"""
10609 return _core_.Menu_IsChecked(*args, **kwargs)
10610
10611 def SetLabel(*args, **kwargs):
10612 """SetLabel(self, int id, String label)"""
10613 return _core_.Menu_SetLabel(*args, **kwargs)
10614
10615 def GetLabel(*args, **kwargs):
10616 """GetLabel(self, int id) -> String"""
10617 return _core_.Menu_GetLabel(*args, **kwargs)
10618
10619 def SetHelpString(*args, **kwargs):
10620 """SetHelpString(self, int id, String helpString)"""
10621 return _core_.Menu_SetHelpString(*args, **kwargs)
10622
10623 def GetHelpString(*args, **kwargs):
10624 """GetHelpString(self, int id) -> String"""
10625 return _core_.Menu_GetHelpString(*args, **kwargs)
10626
10627 def SetTitle(*args, **kwargs):
10628 """SetTitle(self, String title)"""
10629 return _core_.Menu_SetTitle(*args, **kwargs)
10630
10631 def GetTitle(*args, **kwargs):
10632 """GetTitle(self) -> String"""
10633 return _core_.Menu_GetTitle(*args, **kwargs)
10634
10635 def SetEventHandler(*args, **kwargs):
10636 """SetEventHandler(self, EvtHandler handler)"""
10637 return _core_.Menu_SetEventHandler(*args, **kwargs)
10638
10639 def GetEventHandler(*args, **kwargs):
10640 """GetEventHandler(self) -> EvtHandler"""
10641 return _core_.Menu_GetEventHandler(*args, **kwargs)
10642
10643 def SetInvokingWindow(*args, **kwargs):
10644 """SetInvokingWindow(self, Window win)"""
10645 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10646
10647 def GetInvokingWindow(*args, **kwargs):
10648 """GetInvokingWindow(self) -> Window"""
10649 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10650
10651 def GetStyle(*args, **kwargs):
10652 """GetStyle(self) -> long"""
10653 return _core_.Menu_GetStyle(*args, **kwargs)
10654
10655 def UpdateUI(*args, **kwargs):
10656 """UpdateUI(self, EvtHandler source=None)"""
10657 return _core_.Menu_UpdateUI(*args, **kwargs)
10658
10659 def GetMenuBar(*args, **kwargs):
10660 """GetMenuBar(self) -> MenuBar"""
10661 return _core_.Menu_GetMenuBar(*args, **kwargs)
10662
10663 def Attach(*args, **kwargs):
10664 """Attach(self, wxMenuBarBase menubar)"""
10665 return _core_.Menu_Attach(*args, **kwargs)
10666
10667 def Detach(*args, **kwargs):
10668 """Detach(self)"""
10669 return _core_.Menu_Detach(*args, **kwargs)
10670
10671 def IsAttached(*args, **kwargs):
10672 """IsAttached(self) -> bool"""
10673 return _core_.Menu_IsAttached(*args, **kwargs)
10674
10675 def SetParent(*args, **kwargs):
10676 """SetParent(self, Menu parent)"""
10677 return _core_.Menu_SetParent(*args, **kwargs)
10678
10679 def GetParent(*args, **kwargs):
10680 """GetParent(self) -> Menu"""
10681 return _core_.Menu_GetParent(*args, **kwargs)
10682
10683
10684class MenuPtr(Menu):
10685 def __init__(self, this):
10686 self.this = this
10687 if not hasattr(self,"thisown"): self.thisown = 0
10688 self.__class__ = Menu
10689_core_.Menu_swigregister(MenuPtr)
10690DefaultValidator = cvar.DefaultValidator
10691
10692#---------------------------------------------------------------------------
10693
10694class MenuBar(Window):
093d3ff1 10695 """Proxy of C++ MenuBar class"""
d55e5bfc
RD
10696 def __repr__(self):
10697 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10698 def __init__(self, *args, **kwargs):
10699 """__init__(self, long style=0) -> MenuBar"""
10700 newobj = _core_.new_MenuBar(*args, **kwargs)
10701 self.this = newobj.this
10702 self.thisown = 1
10703 del newobj.thisown
10704 self._setOORInfo(self)
10705
10706 def Append(*args, **kwargs):
10707 """Append(self, Menu menu, String title) -> bool"""
10708 return _core_.MenuBar_Append(*args, **kwargs)
10709
10710 def Insert(*args, **kwargs):
10711 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10712 return _core_.MenuBar_Insert(*args, **kwargs)
10713
10714 def GetMenuCount(*args, **kwargs):
10715 """GetMenuCount(self) -> size_t"""
10716 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10717
10718 def GetMenu(*args, **kwargs):
10719 """GetMenu(self, size_t pos) -> Menu"""
10720 return _core_.MenuBar_GetMenu(*args, **kwargs)
10721
10722 def Replace(*args, **kwargs):
10723 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10724 return _core_.MenuBar_Replace(*args, **kwargs)
10725
10726 def Remove(*args, **kwargs):
10727 """Remove(self, size_t pos) -> Menu"""
10728 return _core_.MenuBar_Remove(*args, **kwargs)
10729
10730 def EnableTop(*args, **kwargs):
10731 """EnableTop(self, size_t pos, bool enable)"""
10732 return _core_.MenuBar_EnableTop(*args, **kwargs)
10733
10734 def IsEnabledTop(*args, **kwargs):
10735 """IsEnabledTop(self, size_t pos) -> bool"""
10736 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10737
10738 def SetLabelTop(*args, **kwargs):
10739 """SetLabelTop(self, size_t pos, String label)"""
10740 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10741
10742 def GetLabelTop(*args, **kwargs):
10743 """GetLabelTop(self, size_t pos) -> String"""
10744 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10745
10746 def FindMenuItem(*args, **kwargs):
10747 """FindMenuItem(self, String menu, String item) -> int"""
10748 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10749
10750 def FindItemById(*args, **kwargs):
10751 """FindItemById(self, int id) -> MenuItem"""
10752 return _core_.MenuBar_FindItemById(*args, **kwargs)
10753
10754 def FindMenu(*args, **kwargs):
10755 """FindMenu(self, String title) -> int"""
10756 return _core_.MenuBar_FindMenu(*args, **kwargs)
10757
10758 def Enable(*args, **kwargs):
10759 """Enable(self, int id, bool enable)"""
10760 return _core_.MenuBar_Enable(*args, **kwargs)
10761
10762 def Check(*args, **kwargs):
10763 """Check(self, int id, bool check)"""
10764 return _core_.MenuBar_Check(*args, **kwargs)
10765
10766 def IsChecked(*args, **kwargs):
10767 """IsChecked(self, int id) -> bool"""
10768 return _core_.MenuBar_IsChecked(*args, **kwargs)
10769
10770 def IsEnabled(*args, **kwargs):
10771 """IsEnabled(self, int id) -> bool"""
10772 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10773
10774 def SetLabel(*args, **kwargs):
10775 """SetLabel(self, int id, String label)"""
10776 return _core_.MenuBar_SetLabel(*args, **kwargs)
10777
10778 def GetLabel(*args, **kwargs):
10779 """GetLabel(self, int id) -> String"""
10780 return _core_.MenuBar_GetLabel(*args, **kwargs)
10781
10782 def SetHelpString(*args, **kwargs):
10783 """SetHelpString(self, int id, String helpString)"""
10784 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10785
10786 def GetHelpString(*args, **kwargs):
10787 """GetHelpString(self, int id) -> String"""
10788 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10789
10790 def GetFrame(*args, **kwargs):
10791 """GetFrame(self) -> wxFrame"""
10792 return _core_.MenuBar_GetFrame(*args, **kwargs)
10793
10794 def IsAttached(*args, **kwargs):
10795 """IsAttached(self) -> bool"""
10796 return _core_.MenuBar_IsAttached(*args, **kwargs)
10797
10798 def Attach(*args, **kwargs):
10799 """Attach(self, wxFrame frame)"""
10800 return _core_.MenuBar_Attach(*args, **kwargs)
10801
10802 def Detach(*args, **kwargs):
10803 """Detach(self)"""
10804 return _core_.MenuBar_Detach(*args, **kwargs)
10805
db67f999
RD
10806 def SetAutoWindowMenu(*args, **kwargs):
10807 """SetAutoWindowMenu(bool enable)"""
10808 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10809
10810 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10811 def GetAutoWindowMenu(*args, **kwargs):
10812 """GetAutoWindowMenu() -> bool"""
10813 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10814
10815 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
d55e5bfc
RD
10816
10817class MenuBarPtr(MenuBar):
10818 def __init__(self, this):
10819 self.this = this
10820 if not hasattr(self,"thisown"): self.thisown = 0
10821 self.__class__ = MenuBar
10822_core_.MenuBar_swigregister(MenuBarPtr)
10823
db67f999
RD
10824def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10825 """MenuBar_SetAutoWindowMenu(bool enable)"""
10826 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10827
10828def MenuBar_GetAutoWindowMenu(*args, **kwargs):
10829 """MenuBar_GetAutoWindowMenu() -> bool"""
10830 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10831
d55e5bfc
RD
10832#---------------------------------------------------------------------------
10833
10834class MenuItem(Object):
093d3ff1 10835 """Proxy of C++ MenuItem class"""
d55e5bfc
RD
10836 def __repr__(self):
10837 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10838 def __init__(self, *args, **kwargs):
10839 """
10840 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10841 String help=EmptyString, int kind=ITEM_NORMAL,
10842 Menu subMenu=None) -> MenuItem
10843 """
10844 newobj = _core_.new_MenuItem(*args, **kwargs)
10845 self.this = newobj.this
10846 self.thisown = 1
10847 del newobj.thisown
10848 def GetMenu(*args, **kwargs):
10849 """GetMenu(self) -> Menu"""
10850 return _core_.MenuItem_GetMenu(*args, **kwargs)
10851
10852 def SetMenu(*args, **kwargs):
10853 """SetMenu(self, Menu menu)"""
10854 return _core_.MenuItem_SetMenu(*args, **kwargs)
10855
10856 def SetId(*args, **kwargs):
10857 """SetId(self, int id)"""
10858 return _core_.MenuItem_SetId(*args, **kwargs)
10859
10860 def GetId(*args, **kwargs):
10861 """GetId(self) -> int"""
10862 return _core_.MenuItem_GetId(*args, **kwargs)
10863
10864 def IsSeparator(*args, **kwargs):
10865 """IsSeparator(self) -> bool"""
10866 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10867
10868 def SetText(*args, **kwargs):
10869 """SetText(self, String str)"""
10870 return _core_.MenuItem_SetText(*args, **kwargs)
10871
10872 def GetLabel(*args, **kwargs):
10873 """GetLabel(self) -> String"""
10874 return _core_.MenuItem_GetLabel(*args, **kwargs)
10875
10876 def GetText(*args, **kwargs):
10877 """GetText(self) -> String"""
10878 return _core_.MenuItem_GetText(*args, **kwargs)
10879
10880 def GetLabelFromText(*args, **kwargs):
c24da6d6 10881 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
10882 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10883
10884 GetLabelFromText = staticmethod(GetLabelFromText)
10885 def GetKind(*args, **kwargs):
10886 """GetKind(self) -> int"""
10887 return _core_.MenuItem_GetKind(*args, **kwargs)
10888
10889 def SetKind(*args, **kwargs):
10890 """SetKind(self, int kind)"""
10891 return _core_.MenuItem_SetKind(*args, **kwargs)
10892
10893 def SetCheckable(*args, **kwargs):
10894 """SetCheckable(self, bool checkable)"""
10895 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10896
10897 def IsCheckable(*args, **kwargs):
10898 """IsCheckable(self) -> bool"""
10899 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10900
10901 def IsSubMenu(*args, **kwargs):
10902 """IsSubMenu(self) -> bool"""
10903 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10904
10905 def SetSubMenu(*args, **kwargs):
10906 """SetSubMenu(self, Menu menu)"""
10907 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10908
10909 def GetSubMenu(*args, **kwargs):
10910 """GetSubMenu(self) -> Menu"""
10911 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10912
10913 def Enable(*args, **kwargs):
10914 """Enable(self, bool enable=True)"""
10915 return _core_.MenuItem_Enable(*args, **kwargs)
10916
10917 def IsEnabled(*args, **kwargs):
10918 """IsEnabled(self) -> bool"""
10919 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10920
10921 def Check(*args, **kwargs):
10922 """Check(self, bool check=True)"""
10923 return _core_.MenuItem_Check(*args, **kwargs)
10924
10925 def IsChecked(*args, **kwargs):
10926 """IsChecked(self) -> bool"""
10927 return _core_.MenuItem_IsChecked(*args, **kwargs)
10928
10929 def Toggle(*args, **kwargs):
10930 """Toggle(self)"""
10931 return _core_.MenuItem_Toggle(*args, **kwargs)
10932
10933 def SetHelp(*args, **kwargs):
10934 """SetHelp(self, String str)"""
10935 return _core_.MenuItem_SetHelp(*args, **kwargs)
10936
10937 def GetHelp(*args, **kwargs):
10938 """GetHelp(self) -> String"""
10939 return _core_.MenuItem_GetHelp(*args, **kwargs)
10940
10941 def GetAccel(*args, **kwargs):
10942 """GetAccel(self) -> AcceleratorEntry"""
10943 return _core_.MenuItem_GetAccel(*args, **kwargs)
10944
10945 def SetAccel(*args, **kwargs):
10946 """SetAccel(self, AcceleratorEntry accel)"""
10947 return _core_.MenuItem_SetAccel(*args, **kwargs)
10948
7449af73
RD
10949 def SetBitmap(*args, **kwargs):
10950 """SetBitmap(self, Bitmap bitmap)"""
10951 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10952
10953 def GetBitmap(*args, **kwargs):
10954 """GetBitmap(self) -> Bitmap"""
10955 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10956
d55e5bfc
RD
10957 def SetFont(*args, **kwargs):
10958 """SetFont(self, Font font)"""
10959 return _core_.MenuItem_SetFont(*args, **kwargs)
10960
10961 def GetFont(*args, **kwargs):
10962 """GetFont(self) -> Font"""
10963 return _core_.MenuItem_GetFont(*args, **kwargs)
10964
10965 def SetTextColour(*args, **kwargs):
10966 """SetTextColour(self, Colour colText)"""
10967 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10968
10969 def GetTextColour(*args, **kwargs):
10970 """GetTextColour(self) -> Colour"""
10971 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10972
10973 def SetBackgroundColour(*args, **kwargs):
10974 """SetBackgroundColour(self, Colour colBack)"""
10975 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10976
10977 def GetBackgroundColour(*args, **kwargs):
10978 """GetBackgroundColour(self) -> Colour"""
10979 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10980
10981 def SetBitmaps(*args, **kwargs):
10982 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10983 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10984
10985 def SetDisabledBitmap(*args, **kwargs):
10986 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10987 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10988
10989 def GetDisabledBitmap(*args, **kwargs):
10990 """GetDisabledBitmap(self) -> Bitmap"""
10991 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10992
10993 def SetMarginWidth(*args, **kwargs):
10994 """SetMarginWidth(self, int nWidth)"""
10995 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10996
10997 def GetMarginWidth(*args, **kwargs):
10998 """GetMarginWidth(self) -> int"""
10999 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
11000
11001 def GetDefaultMarginWidth(*args, **kwargs):
c24da6d6 11002 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
11003 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
11004
11005 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
11006 def IsOwnerDrawn(*args, **kwargs):
11007 """IsOwnerDrawn(self) -> bool"""
11008 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
11009
11010 def SetOwnerDrawn(*args, **kwargs):
11011 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11012 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
11013
11014 def ResetOwnerDrawn(*args, **kwargs):
11015 """ResetOwnerDrawn(self)"""
11016 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
11017
d55e5bfc
RD
11018
11019class MenuItemPtr(MenuItem):
11020 def __init__(self, this):
11021 self.this = this
11022 if not hasattr(self,"thisown"): self.thisown = 0
11023 self.__class__ = MenuItem
11024_core_.MenuItem_swigregister(MenuItemPtr)
11025
11026def MenuItem_GetLabelFromText(*args, **kwargs):
11027 """MenuItem_GetLabelFromText(String text) -> String"""
11028 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
11029
11030def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
11031 """MenuItem_GetDefaultMarginWidth() -> int"""
11032 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
11033
11034#---------------------------------------------------------------------------
11035
11036class Control(Window):
11037 """
11038 This is the base class for a control or 'widget'.
11039
79fccf9d
RD
11040 A control is generally a small window which processes user input
11041 and/or displays one or more item of data.
d55e5bfc
RD
11042 """
11043 def __repr__(self):
11044 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11045 def __init__(self, *args, **kwargs):
11046 """
248ed943
RD
11047 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11048 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
11049 String name=ControlNameStr) -> Control
11050
79fccf9d
RD
11051 Create a Control. Normally you should only call this from a subclass'
11052 __init__ as a plain old wx.Control is not very useful.
d55e5bfc
RD
11053 """
11054 newobj = _core_.new_Control(*args, **kwargs)
11055 self.this = newobj.this
11056 self.thisown = 1
11057 del newobj.thisown
11058 self._setOORInfo(self)
11059
11060 def Create(*args, **kwargs):
11061 """
248ed943
RD
11062 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11063 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
11064 String name=ControlNameStr) -> bool
11065
11066 Do the 2nd phase and create the GUI control.
11067 """
11068 return _core_.Control_Create(*args, **kwargs)
11069
11070 def Command(*args, **kwargs):
11071 """
11072 Command(self, CommandEvent event)
11073
79fccf9d
RD
11074 Simulates the effect of the user issuing a command to the item.
11075
11076 :see: `wx.CommandEvent`
11077
d55e5bfc
RD
11078 """
11079 return _core_.Control_Command(*args, **kwargs)
11080
11081 def GetLabel(*args, **kwargs):
11082 """
11083 GetLabel(self) -> String
11084
11085 Return a control's text.
11086 """
11087 return _core_.Control_GetLabel(*args, **kwargs)
11088
11089 def SetLabel(*args, **kwargs):
11090 """
11091 SetLabel(self, String label)
11092
11093 Sets the item's text.
11094 """
11095 return _core_.Control_SetLabel(*args, **kwargs)
11096
a001823c 11097 def GetClassDefaultAttributes(*args, **kwargs):
f8167d6e 11098 """
a001823c 11099 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
f8167d6e 11100
a001823c
RD
11101 Get the default attributes for this class. This is useful if you want
11102 to use the same font or colour in your own control as in a standard
11103 control -- which is a much better idea than hard coding specific
11104 colours or fonts which might look completely out of place on the
11105 user's system, especially if it uses themes.
f8167d6e 11106
a001823c
RD
11107 The variant parameter is only relevant under Mac currently and is
11108 ignore under other platforms. Under Mac, it will change the size of
11109 the returned font. See `wx.Window.SetWindowVariant` for more about
11110 this.
f8167d6e 11111 """
d55e5bfc
RD
11112 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11113
11114 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
11115
11116class ControlPtr(Control):
11117 def __init__(self, this):
11118 self.this = this
11119 if not hasattr(self,"thisown"): self.thisown = 0
11120 self.__class__ = Control
11121_core_.Control_swigregister(ControlPtr)
11122ControlNameStr = cvar.ControlNameStr
11123
11124def PreControl(*args, **kwargs):
11125 """
11126 PreControl() -> Control
11127
11128 Precreate a Control control for 2-phase creation
11129 """
11130 val = _core_.new_PreControl(*args, **kwargs)
11131 val.thisown = 1
11132 return val
11133
11134def Control_GetClassDefaultAttributes(*args, **kwargs):
a001823c
RD
11135 """
11136 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11137
11138 Get the default attributes for this class. This is useful if you want
11139 to use the same font or colour in your own control as in a standard
11140 control -- which is a much better idea than hard coding specific
11141 colours or fonts which might look completely out of place on the
11142 user's system, especially if it uses themes.
11143
11144 The variant parameter is only relevant under Mac currently and is
11145 ignore under other platforms. Under Mac, it will change the size of
11146 the returned font. See `wx.Window.SetWindowVariant` for more about
11147 this.
11148 """
d55e5bfc
RD
11149 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11150
11151#---------------------------------------------------------------------------
11152
11153class ItemContainer(object):
11154 """
53aa7709
RD
11155 The wx.ItemContainer class defines an interface which is implemented
11156 by all controls which have string subitems, each of which may be
11157 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11158 as `wx.ComboBox` which implements an extended interface deriving from
79fccf9d 11159 this one.
d55e5bfc 11160
79fccf9d
RD
11161 It defines the methods for accessing the control's items and although
11162 each of the derived classes implements them differently, they still
11163 all conform to the same interface.
d55e5bfc 11164
79fccf9d
RD
11165 The items in a wx.ItemContainer have (non empty) string labels and,
11166 optionally, client data associated with them.
d55e5bfc
RD
11167
11168 """
11169 def __init__(self): raise RuntimeError, "No constructor defined"
11170 def __repr__(self):
11171 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11172 def Append(*args, **kwargs):
11173 """
11174 Append(self, String item, PyObject clientData=None) -> int
11175
79fccf9d
RD
11176 Adds the item to the control, associating the given data with the item
11177 if not None. The return value is the index of the newly added item
11178 which may be different from the last one if the control is sorted (e.g.
11179 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
11180 """
11181 return _core_.ItemContainer_Append(*args, **kwargs)
11182
11183 def AppendItems(*args, **kwargs):
11184 """
f5b96ee1 11185 AppendItems(self, List strings)
d55e5bfc 11186
79fccf9d
RD
11187 Apend several items at once to the control. Notice that calling this
11188 method may be much faster than appending the items one by one if you
11189 need to add a lot of items.
d55e5bfc
RD
11190 """
11191 return _core_.ItemContainer_AppendItems(*args, **kwargs)
11192
11193 def Insert(*args, **kwargs):
11194 """
11195 Insert(self, String item, int pos, PyObject clientData=None) -> int
11196
79fccf9d 11197 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11198 optionally associating some data object with the item.
11199 """
11200 return _core_.ItemContainer_Insert(*args, **kwargs)
11201
11202 def Clear(*args, **kwargs):
11203 """
11204 Clear(self)
11205
11206 Removes all items from the control.
11207 """
11208 return _core_.ItemContainer_Clear(*args, **kwargs)
11209
11210 def Delete(*args, **kwargs):
11211 """
11212 Delete(self, int n)
11213
79fccf9d
RD
11214 Deletes the item at the zero-based index 'n' from the control. Note
11215 that it is an error (signalled by a `wx.PyAssertionError` exception if
11216 enabled) to remove an item with the index negative or greater or equal
11217 than the number of items in the control.
d55e5bfc
RD
11218 """
11219 return _core_.ItemContainer_Delete(*args, **kwargs)
11220
53aa7709
RD
11221 def GetClientData(*args, **kwargs):
11222 """
11223 GetClientData(self, int n) -> PyObject
11224
11225 Returns the client data associated with the given item, (if any.)
11226 """
11227 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11228
11229 def SetClientData(*args, **kwargs):
11230 """
11231 SetClientData(self, int n, PyObject clientData)
11232
11233 Associate the given client data with the item at position n.
11234 """
11235 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11236
d55e5bfc
RD
11237 def GetCount(*args, **kwargs):
11238 """
11239 GetCount(self) -> int
11240
11241 Returns the number of items in the control.
11242 """
11243 return _core_.ItemContainer_GetCount(*args, **kwargs)
11244
11245 def IsEmpty(*args, **kwargs):
11246 """
11247 IsEmpty(self) -> bool
11248
11249 Returns True if the control is empty or False if it has some items.
11250 """
11251 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11252
11253 def GetString(*args, **kwargs):
11254 """
11255 GetString(self, int n) -> String
11256
11257 Returns the label of the item with the given index.
11258 """
11259 return _core_.ItemContainer_GetString(*args, **kwargs)
11260
11261 def GetStrings(*args, **kwargs):
11262 """GetStrings(self) -> wxArrayString"""
11263 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11264
11265 def SetString(*args, **kwargs):
11266 """
11267 SetString(self, int n, String s)
11268
11269 Sets the label for the given item.
11270 """
11271 return _core_.ItemContainer_SetString(*args, **kwargs)
11272
11273 def FindString(*args, **kwargs):
11274 """
11275 FindString(self, String s) -> int
11276
11277 Finds an item whose label matches the given string. Returns the
79fccf9d
RD
11278 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11279 found.
d55e5bfc
RD
11280 """
11281 return _core_.ItemContainer_FindString(*args, **kwargs)
11282
53aa7709 11283 def SetSelection(*args, **kwargs):
d55e5bfc 11284 """
53aa7709 11285 SetSelection(self, int n)
d55e5bfc
RD
11286
11287 Sets the item at index 'n' to be the selected item.
11288 """
53aa7709 11289 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11290
d55e5bfc
RD
11291 def GetSelection(*args, **kwargs):
11292 """
11293 GetSelection(self) -> int
11294
79fccf9d
RD
11295 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11296 is selected.
d55e5bfc
RD
11297 """
11298 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11299
53aa7709
RD
11300 def SetStringSelection(*args, **kwargs):
11301 """SetStringSelection(self, String s) -> bool"""
11302 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11303
d55e5bfc
RD
11304 def GetStringSelection(*args, **kwargs):
11305 """
11306 GetStringSelection(self) -> String
11307
79fccf9d
RD
11308 Returns the label of the selected item or an empty string if no item
11309 is selected.
d55e5bfc
RD
11310 """
11311 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11312
53aa7709 11313 def Select(*args, **kwargs):
d55e5bfc 11314 """
53aa7709 11315 Select(self, int n)
d55e5bfc 11316
53aa7709
RD
11317 This is the same as `SetSelection` and exists only because it is
11318 slightly more natural for controls which support multiple selection.
d55e5bfc 11319 """
53aa7709 11320 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc
RD
11321
11322
11323class ItemContainerPtr(ItemContainer):
11324 def __init__(self, this):
11325 self.this = this
11326 if not hasattr(self,"thisown"): self.thisown = 0
11327 self.__class__ = ItemContainer
11328_core_.ItemContainer_swigregister(ItemContainerPtr)
11329
11330#---------------------------------------------------------------------------
11331
11332class ControlWithItems(Control,ItemContainer):
11333 """
79fccf9d
RD
11334 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11335 wx.Control class, and is used for the base class of various controls
11336 that have items.
d55e5bfc
RD
11337 """
11338 def __init__(self): raise RuntimeError, "No constructor defined"
11339 def __repr__(self):
11340 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11341
11342class ControlWithItemsPtr(ControlWithItems):
11343 def __init__(self, this):
11344 self.this = this
11345 if not hasattr(self,"thisown"): self.thisown = 0
11346 self.__class__ = ControlWithItems
11347_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
11348
11349#---------------------------------------------------------------------------
11350
11351class SizerItem(Object):
248ed943
RD
11352 """
11353 The wx.SizerItem class is used to track the position, size and other
11354 attributes of each item managed by a `wx.Sizer`. In normal usage user
11355 code should never need to deal directly with a wx.SizerItem, but
11356 custom classes derived from `wx.PySizer` will probably need to use the
11357 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11358
11359 :see: `wx.Sizer`, `wx.GBSizerItem`
11360 """
d55e5bfc
RD
11361 def __repr__(self):
11362 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11363 def __init__(self, *args, **kwargs):
248ed943
RD
11364 """
11365 __init__(self) -> SizerItem
11366
11367 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11368 size will need to be set before this item can be used in a Sizer.
11369
11370 You will probably never need to create a wx.SizerItem directly as they
11371 are created automatically when the sizer's Add, Insert or Prepend
11372 methods are called.
11373
11374 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11375 """
d55e5bfc
RD
11376 newobj = _core_.new_SizerItem(*args, **kwargs)
11377 self.this = newobj.this
11378 self.thisown = 1
11379 del newobj.thisown
7e08d4ef
RD
11380 def __del__(self, destroy=_core_.delete_SizerItem):
11381 """__del__(self)"""
11382 try:
11383 if self.thisown: destroy(self)
11384 except: pass
11385
d55e5bfc 11386 def DeleteWindows(*args, **kwargs):
248ed943
RD
11387 """
11388 DeleteWindows(self)
11389
11390 Destroy the window or the windows in a subsizer, depending on the type
11391 of item.
11392 """
d55e5bfc
RD
11393 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11394
11395 def DetachSizer(*args, **kwargs):
248ed943
RD
11396 """
11397 DetachSizer(self)
11398
11399 Enable deleting the SizerItem without destroying the contained sizer.
11400 """
d55e5bfc
RD
11401 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11402
11403 def GetSize(*args, **kwargs):
248ed943
RD
11404 """
11405 GetSize(self) -> Size
11406
11407 Get the current size of the item, as set in the last Layout.
11408 """
d55e5bfc
RD
11409 return _core_.SizerItem_GetSize(*args, **kwargs)
11410
11411 def CalcMin(*args, **kwargs):
248ed943
RD
11412 """
11413 CalcMin(self) -> Size
11414
11415 Calculates the minimum desired size for the item, including any space
11416 needed by borders.
11417 """
d55e5bfc
RD
11418 return _core_.SizerItem_CalcMin(*args, **kwargs)
11419
11420 def SetDimension(*args, **kwargs):
248ed943
RD
11421 """
11422 SetDimension(self, Point pos, Size size)
11423
11424 Set the position and size of the space allocated for this item by the
11425 sizer, and adjust the position and size of the item (window or
11426 subsizer) to be within that space taking alignment and borders into
11427 account.
11428 """
d55e5bfc
RD
11429 return _core_.SizerItem_SetDimension(*args, **kwargs)
11430
11431 def GetMinSize(*args, **kwargs):
248ed943
RD
11432 """
11433 GetMinSize(self) -> Size
11434
11435 Get the minimum size needed for the item.
11436 """
d55e5bfc
RD
11437 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11438
a001823c
RD
11439 def GetMinSizeWithBorder(*args, **kwargs):
11440 """
11441 GetMinSizeWithBorder(self) -> Size
11442
11443 Get the minimum size needed for the item with space for the borders
11444 added, if needed.
11445 """
11446 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11447
d55e5bfc
RD
11448 def SetInitSize(*args, **kwargs):
11449 """SetInitSize(self, int x, int y)"""
11450 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11451
11452 def SetRatioWH(*args, **kwargs):
248ed943
RD
11453 """
11454 SetRatioWH(self, int width, int height)
11455
11456 Set the ratio item attribute.
11457 """
d55e5bfc
RD
11458 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11459
11460 def SetRatioSize(*args, **kwargs):
248ed943
RD
11461 """
11462 SetRatioSize(self, Size size)
11463
11464 Set the ratio item attribute.
11465 """
d55e5bfc
RD
11466 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11467
11468 def SetRatio(*args, **kwargs):
248ed943
RD
11469 """
11470 SetRatio(self, float ratio)
11471
11472 Set the ratio item attribute.
11473 """
d55e5bfc
RD
11474 return _core_.SizerItem_SetRatio(*args, **kwargs)
11475
11476 def GetRatio(*args, **kwargs):
248ed943
RD
11477 """
11478 GetRatio(self) -> float
11479
11480 Set the ratio item attribute.
11481 """
d55e5bfc
RD
11482 return _core_.SizerItem_GetRatio(*args, **kwargs)
11483
c1cb24a4
RD
11484 def GetRect(*args, **kwargs):
11485 """
11486 GetRect(self) -> Rect
11487
11488 Returns the rectangle that the sizer item should occupy
11489 """
11490 return _core_.SizerItem_GetRect(*args, **kwargs)
11491
d55e5bfc 11492 def IsWindow(*args, **kwargs):
248ed943
RD
11493 """
11494 IsWindow(self) -> bool
11495
11496 Is this sizer item a window?
11497 """
d55e5bfc
RD
11498 return _core_.SizerItem_IsWindow(*args, **kwargs)
11499
11500 def IsSizer(*args, **kwargs):
248ed943
RD
11501 """
11502 IsSizer(self) -> bool
11503
11504 Is this sizer item a subsizer?
11505 """
d55e5bfc
RD
11506 return _core_.SizerItem_IsSizer(*args, **kwargs)
11507
11508 def IsSpacer(*args, **kwargs):
248ed943
RD
11509 """
11510 IsSpacer(self) -> bool
11511
11512 Is this sizer item a spacer?
11513 """
d55e5bfc
RD
11514 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11515
11516 def SetProportion(*args, **kwargs):
248ed943
RD
11517 """
11518 SetProportion(self, int proportion)
11519
11520 Set the proportion value for this item.
11521 """
d55e5bfc
RD
11522 return _core_.SizerItem_SetProportion(*args, **kwargs)
11523
11524 def GetProportion(*args, **kwargs):
248ed943
RD
11525 """
11526 GetProportion(self) -> int
11527
11528 Get the proportion value for this item.
11529 """
d55e5bfc
RD
11530 return _core_.SizerItem_GetProportion(*args, **kwargs)
11531
248ed943
RD
11532 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11533 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 11534 def SetFlag(*args, **kwargs):
248ed943
RD
11535 """
11536 SetFlag(self, int flag)
11537
11538 Set the flag value for this item.
11539 """
d55e5bfc
RD
11540 return _core_.SizerItem_SetFlag(*args, **kwargs)
11541
11542 def GetFlag(*args, **kwargs):
248ed943
RD
11543 """
11544 GetFlag(self) -> int
11545
11546 Get the flag value for this item.
11547 """
d55e5bfc
RD
11548 return _core_.SizerItem_GetFlag(*args, **kwargs)
11549
11550 def SetBorder(*args, **kwargs):
248ed943
RD
11551 """
11552 SetBorder(self, int border)
11553
11554 Set the border value for this item.
11555 """
d55e5bfc
RD
11556 return _core_.SizerItem_SetBorder(*args, **kwargs)
11557
11558 def GetBorder(*args, **kwargs):
248ed943
RD
11559 """
11560 GetBorder(self) -> int
11561
11562 Get the border value for this item.
11563 """
d55e5bfc
RD
11564 return _core_.SizerItem_GetBorder(*args, **kwargs)
11565
11566 def GetWindow(*args, **kwargs):
248ed943
RD
11567 """
11568 GetWindow(self) -> Window
11569
11570 Get the window (if any) that is managed by this sizer item.
11571 """
d55e5bfc
RD
11572 return _core_.SizerItem_GetWindow(*args, **kwargs)
11573
11574 def SetWindow(*args, **kwargs):
248ed943
RD
11575 """
11576 SetWindow(self, Window window)
11577
11578 Set the window to be managed by this sizer item.
11579 """
d55e5bfc
RD
11580 return _core_.SizerItem_SetWindow(*args, **kwargs)
11581
11582 def GetSizer(*args, **kwargs):
248ed943
RD
11583 """
11584 GetSizer(self) -> Sizer
11585
11586 Get the subsizer (if any) that is managed by this sizer item.
11587 """
d55e5bfc
RD
11588 return _core_.SizerItem_GetSizer(*args, **kwargs)
11589
11590 def SetSizer(*args, **kwargs):
248ed943
RD
11591 """
11592 SetSizer(self, Sizer sizer)
11593
11594 Set the subsizer to be managed by this sizer item.
11595 """
d55e5bfc
RD
11596 return _core_.SizerItem_SetSizer(*args, **kwargs)
11597
11598 def GetSpacer(*args, **kwargs):
248ed943
RD
11599 """
11600 GetSpacer(self) -> Size
11601
11602 Get the size of the spacer managed by this sizer item.
11603 """
d55e5bfc
RD
11604 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11605
11606 def SetSpacer(*args, **kwargs):
248ed943
RD
11607 """
11608 SetSpacer(self, Size size)
11609
11610 Set the size of the spacer to be managed by this sizer item.
11611 """
d55e5bfc
RD
11612 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11613
11614 def Show(*args, **kwargs):
248ed943
RD
11615 """
11616 Show(self, bool show)
11617
11618 Set the show item attribute, which sizers use to determine if the item
11619 is to be made part of the layout or not. If the item is tracking a
11620 window then it is shown or hidden as needed.
11621 """
d55e5bfc
RD
11622 return _core_.SizerItem_Show(*args, **kwargs)
11623
11624 def IsShown(*args, **kwargs):
248ed943
RD
11625 """
11626 IsShown(self) -> bool
11627
11628 Is the item to be shown in the layout?
11629 """
d55e5bfc
RD
11630 return _core_.SizerItem_IsShown(*args, **kwargs)
11631
11632 def GetPosition(*args, **kwargs):
248ed943
RD
11633 """
11634 GetPosition(self) -> Point
11635
11636 Returns the current position of the item, as set in the last Layout.
11637 """
d55e5bfc
RD
11638 return _core_.SizerItem_GetPosition(*args, **kwargs)
11639
11640 def GetUserData(*args, **kwargs):
248ed943
RD
11641 """
11642 GetUserData(self) -> PyObject
11643
11644 Returns the userData associated with this sizer item, or None if there
11645 isn't any.
11646 """
d55e5bfc
RD
11647 return _core_.SizerItem_GetUserData(*args, **kwargs)
11648
7449af73
RD
11649 def SetUserData(*args, **kwargs):
11650 """
11651 SetUserData(self, PyObject userData)
11652
11653 Associate a Python object with this sizer item.
11654 """
11655 return _core_.SizerItem_SetUserData(*args, **kwargs)
11656
d55e5bfc
RD
11657
11658class SizerItemPtr(SizerItem):
11659 def __init__(self, this):
11660 self.this = this
11661 if not hasattr(self,"thisown"): self.thisown = 0
11662 self.__class__ = SizerItem
11663_core_.SizerItem_swigregister(SizerItemPtr)
11664
248ed943 11665def SizerItemWindow(*args, **kwargs):
d55e5bfc 11666 """
248ed943
RD
11667 SizerItemWindow(Window window, int proportion, int flag, int border,
11668 PyObject userData=None) -> SizerItem
11669
11670 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11671 """
248ed943 11672 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11673 val.thisown = 1
11674 return val
11675
248ed943 11676def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11677 """
248ed943
RD
11678 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11679 PyObject userData=None) -> SizerItem
11680
11681 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11682 """
248ed943 11683 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11684 val.thisown = 1
11685 return val
11686
11687def SizerItemSizer(*args, **kwargs):
11688 """
11689 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
11690 PyObject userData=None) -> SizerItem
11691
11692 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
11693 """
11694 val = _core_.new_SizerItemSizer(*args, **kwargs)
11695 val.thisown = 1
11696 return val
11697
11698class Sizer(Object):
248ed943
RD
11699 """
11700 wx.Sizer is the abstract base class used for laying out subwindows in
11701 a window. You cannot use wx.Sizer directly; instead, you will have to
11702 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11703 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11704 and `wx.GridBagSizer`.
11705
11706 The concept implemented by sizers in wxWidgets is closely related to
11707 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11708 toolkit or the Qt toolkit. It is based upon the idea of the individual
11709 subwindows reporting their minimal required size and their ability to
11710 get stretched if the size of the parent window has changed. This will
11711 most often mean that the programmer does not set the original size of
11712 a dialog in the beginning, rather the dialog will assigned a sizer and
11713 this sizer will be queried about the recommended size. The sizer in
11714 turn will query its children, which can be normal windows or contorls,
11715 empty space or other sizers, so that a hierarchy of sizers can be
11716 constructed. Note that wxSizer does not derive from wxWindow and thus
11717 do not interfere with tab ordering and requires very little resources
11718 compared to a real window on screen.
11719
11720 What makes sizers so well fitted for use in wxWidgets is the fact that
11721 every control reports its own minimal size and the algorithm can
11722 handle differences in font sizes or different window (dialog item)
11723 sizes on different platforms without problems. If for example the
11724 standard font as well as the overall design of Mac widgets requires
11725 more space than on Windows, then the initial size of a dialog using a
11726 sizer will automatically be bigger on Mac than on Windows.
11727 """
d55e5bfc
RD
11728 def __init__(self): raise RuntimeError, "No constructor defined"
11729 def __repr__(self):
11730 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7e08d4ef
RD
11731 def __del__(self, destroy=_core_.delete_Sizer):
11732 """__del__(self)"""
11733 try:
11734 if self.thisown: destroy(self)
11735 except: pass
11736
d55e5bfc
RD
11737 def _setOORInfo(*args, **kwargs):
11738 """_setOORInfo(self, PyObject _self)"""
11739 return _core_.Sizer__setOORInfo(*args, **kwargs)
11740
11741 def Add(*args, **kwargs):
11742 """
248ed943 11743 Add(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11744 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11745
11746 Appends a child item to the sizer.
d55e5bfc
RD
11747 """
11748 return _core_.Sizer_Add(*args, **kwargs)
11749
11750 def Insert(*args, **kwargs):
11751 """
248ed943 11752 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11753 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11754
11755 Inserts a new item into the list of items managed by this sizer before
11756 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
11757 """
11758 return _core_.Sizer_Insert(*args, **kwargs)
11759
11760 def Prepend(*args, **kwargs):
11761 """
248ed943 11762 Prepend(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11763 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11764
11765 Adds a new item to the begining of the list of sizer items managed by
11766 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
11767 """
11768 return _core_.Sizer_Prepend(*args, **kwargs)
11769
11770 def Remove(*args, **kwargs):
248ed943
RD
11771 """
11772 Remove(self, item) -> bool
11773
11774 Removes an item from the sizer and destroys it. This method does not
11775 cause any layout or resizing to take place, call `Layout` to update
11776 the layout on screen after removing a child from the sizer. The
11777 *item* parameter can be either a window, a sizer, or the zero-based
11778 index of an item to remove. Returns True if the child item was found
11779 and removed.
11780 """
d55e5bfc
RD
11781 return _core_.Sizer_Remove(*args, **kwargs)
11782
1a6bba1e 11783 def Detach(*args, **kwargs):
248ed943
RD
11784 """
11785 Detach(self, item) -> bool
11786
11787 Detaches an item from the sizer without destroying it. This method
11788 does not cause any layout or resizing to take place, call `Layout` to
11789 do so. The *item* parameter can be either a window, a sizer, or the
11790 zero-based index of the item to be detached. Returns True if the child item
11791 was found and detached.
11792 """
1a6bba1e
RD
11793 return _core_.Sizer_Detach(*args, **kwargs)
11794
c1cb24a4
RD
11795 def GetItem(*args, **kwargs):
11796 """
11797 GetItem(self, item) -> wx.SizerItem
11798
11799 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11800 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11801 the item to be found.
c1cb24a4
RD
11802 """
11803 return _core_.Sizer_GetItem(*args, **kwargs)
11804
d55e5bfc
RD
11805 def _SetItemMinSize(*args, **kwargs):
11806 """_SetItemMinSize(self, PyObject item, Size size)"""
11807 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11808
248ed943
RD
11809 def SetItemMinSize(self, item, *args):
11810 """
11811 SetItemMinSize(self, item, Size size)
11812
11813 Sets the minimum size that will be allocated for an item in the sizer.
11814 The *item* parameter can be either a window, a sizer, or the
11815 zero-based index of the item. If a window or sizer is given then it
11816 will be searched for recursivly in subsizers if neccessary.
11817 """
11818 if len(args) == 2:
11819 # for backward compatibility accept separate width,height args too
11820 return self._SetItemMinSize(item, args)
11821 else:
11822 return self._SetItemMinSize(item, args[0])
11823
d55e5bfc 11824 def AddItem(*args, **kwargs):
248ed943
RD
11825 """
11826 AddItem(self, SizerItem item)
11827
11828 Adds a `wx.SizerItem` to the sizer.
11829 """
d55e5bfc
RD
11830 return _core_.Sizer_AddItem(*args, **kwargs)
11831
11832 def InsertItem(*args, **kwargs):
248ed943
RD
11833 """
11834 InsertItem(self, int index, SizerItem item)
11835
11836 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11837 """
d55e5bfc
RD
11838 return _core_.Sizer_InsertItem(*args, **kwargs)
11839
11840 def PrependItem(*args, **kwargs):
248ed943
RD
11841 """
11842 PrependItem(self, SizerItem item)
11843
11844 Prepends a `wx.SizerItem` to the sizer.
11845 """
d55e5bfc
RD
11846 return _core_.Sizer_PrependItem(*args, **kwargs)
11847
248ed943 11848 def AddMany(self, items):
c24da6d6
RD
11849 """
11850 AddMany is a convenience method for adding several items
11851 to a sizer at one time. Simply pass it a list of tuples,
11852 where each tuple consists of the parameters that you
11853 would normally pass to the `Add` method.
11854 """
248ed943
RD
11855 for item in items:
11856 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11857 item = (item, )
11858 self.Add(*item)
d55e5bfc
RD
11859
11860 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11861 def AddWindow(self, *args, **kw):
11862 """Compatibility alias for `Add`."""
11863 return self.Add(*args, **kw)
11864 def AddSizer(self, *args, **kw):
11865 """Compatibility alias for `Add`."""
11866 return self.Add(*args, **kw)
11867 def AddSpacer(self, *args, **kw):
11868 """Compatibility alias for `Add`."""
11869 return self.Add(*args, **kw)
11870
11871 def PrependWindow(self, *args, **kw):
11872 """Compatibility alias for `Prepend`."""
11873 return self.Prepend(*args, **kw)
11874 def PrependSizer(self, *args, **kw):
11875 """Compatibility alias for `Prepend`."""
11876 return self.Prepend(*args, **kw)
11877 def PrependSpacer(self, *args, **kw):
11878 """Compatibility alias for `Prepend`."""
11879 return self.Prepend(*args, **kw)
11880
11881 def InsertWindow(self, *args, **kw):
11882 """Compatibility alias for `Insert`."""
11883 return self.Insert(*args, **kw)
11884 def InsertSizer(self, *args, **kw):
11885 """Compatibility alias for `Insert`."""
11886 return self.Insert(*args, **kw)
11887 def InsertSpacer(self, *args, **kw):
11888 """Compatibility alias for `Insert`."""
11889 return self.Insert(*args, **kw)
11890
11891 def RemoveWindow(self, *args, **kw):
11892 """Compatibility alias for `Remove`."""
11893 return self.Remove(*args, **kw)
11894 def RemoveSizer(self, *args, **kw):
11895 """Compatibility alias for `Remove`."""
11896 return self.Remove(*args, **kw)
11897 def RemovePos(self, *args, **kw):
11898 """Compatibility alias for `Remove`."""
11899 return self.Remove(*args, **kw)
d55e5bfc
RD
11900
11901
d55e5bfc 11902 def SetDimension(*args, **kwargs):
248ed943
RD
11903 """
11904 SetDimension(self, int x, int y, int width, int height)
11905
11906 Call this to force the sizer to take the given dimension and thus
11907 force the items owned by the sizer to resize themselves according to
11908 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11909 methods.
11910 """
d55e5bfc
RD
11911 return _core_.Sizer_SetDimension(*args, **kwargs)
11912
11913 def SetMinSize(*args, **kwargs):
248ed943
RD
11914 """
11915 SetMinSize(self, Size size)
11916
11917 Call this to give the sizer a minimal size. Normally, the sizer will
11918 calculate its minimal size based purely on how much space its children
11919 need. After calling this method `GetMinSize` will return either the
11920 minimal size as requested by its children or the minimal size set
11921 here, depending on which is bigger.
11922 """
d55e5bfc
RD
11923 return _core_.Sizer_SetMinSize(*args, **kwargs)
11924
11925 def GetSize(*args, **kwargs):
248ed943
RD
11926 """
11927 GetSize(self) -> Size
11928
11929 Returns the current size of the space managed by the sizer.
11930 """
d55e5bfc
RD
11931 return _core_.Sizer_GetSize(*args, **kwargs)
11932
11933 def GetPosition(*args, **kwargs):
248ed943
RD
11934 """
11935 GetPosition(self) -> Point
11936
11937 Returns the current position of the sizer's managed space.
11938 """
d55e5bfc
RD
11939 return _core_.Sizer_GetPosition(*args, **kwargs)
11940
11941 def GetMinSize(*args, **kwargs):
248ed943
RD
11942 """
11943 GetMinSize(self) -> Size
11944
11945 Returns the minimal size of the sizer. This is either the combined
11946 minimal size of all the children and their borders or the minimal size
11947 set by SetMinSize, depending on which is bigger.
11948 """
d55e5bfc
RD
11949 return _core_.Sizer_GetMinSize(*args, **kwargs)
11950
11951 def GetSizeTuple(self):
1a6bba1e 11952 return self.GetSize().Get()
d55e5bfc 11953 def GetPositionTuple(self):
1a6bba1e 11954 return self.GetPosition().Get()
d55e5bfc 11955 def GetMinSizeTuple(self):
1a6bba1e 11956 return self.GetMinSize().Get()
d55e5bfc
RD
11957
11958 def RecalcSizes(*args, **kwargs):
248ed943
RD
11959 """
11960 RecalcSizes(self)
11961
11962 Using the sizes calculated by `CalcMin` reposition and resize all the
11963 items managed by this sizer. You should not need to call this directly as
11964 it is called by `Layout`.
11965 """
d55e5bfc
RD
11966 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11967
11968 def CalcMin(*args, **kwargs):
248ed943
RD
11969 """
11970 CalcMin(self) -> Size
11971
11972 This method is where the sizer will do the actual calculation of its
11973 children's minimal sizes. You should not need to call this directly as
11974 it is called by `Layout`.
11975 """
d55e5bfc
RD
11976 return _core_.Sizer_CalcMin(*args, **kwargs)
11977
11978 def Layout(*args, **kwargs):
248ed943
RD
11979 """
11980 Layout(self)
11981
11982 This method will force the recalculation and layout of the items
11983 controlled by the sizer using the current space allocated to the
11984 sizer. Normally this is called automatically from the owning window's
11985 EVT_SIZE handler, but it is also useful to call it from user code when
11986 one of the items in a sizer change size, or items are added or
11987 removed.
11988 """
d55e5bfc
RD
11989 return _core_.Sizer_Layout(*args, **kwargs)
11990
11991 def Fit(*args, **kwargs):
248ed943
RD
11992 """
11993 Fit(self, Window window) -> Size
11994
11995 Tell the sizer to resize the *window* to match the sizer's minimal
11996 size. This is commonly done in the constructor of the window itself in
11997 order to set its initial size to match the needs of the children as
11998 determined by the sizer. Returns the new size.
11999
12000 For a top level window this is the total window size, not the client size.
12001 """
d55e5bfc
RD
12002 return _core_.Sizer_Fit(*args, **kwargs)
12003
12004 def FitInside(*args, **kwargs):
248ed943
RD
12005 """
12006 FitInside(self, Window window)
12007
12008 Tell the sizer to resize the *virtual size* of the *window* to match the
12009 sizer's minimal size. This will not alter the on screen size of the
12010 window, but may cause the addition/removal/alteration of scrollbars
12011 required to view the virtual area in windows which manage it.
12012
12013 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12014
12015 """
d55e5bfc
RD
12016 return _core_.Sizer_FitInside(*args, **kwargs)
12017
12018 def SetSizeHints(*args, **kwargs):
248ed943
RD
12019 """
12020 SetSizeHints(self, Window window)
12021
12022 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12023 match the sizer's minimal size. This is commonly done in the
12024 constructor of the window itself if the window is resizable (as are
12025 many dialogs under Unix and frames on probably all platforms) in order
12026 to prevent the window from being sized smaller than the minimal size
12027 required by the sizer.
12028 """
d55e5bfc
RD
12029 return _core_.Sizer_SetSizeHints(*args, **kwargs)
12030
12031 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
12032 """
12033 SetVirtualSizeHints(self, Window window)
12034
12035 Tell the sizer to set the minimal size of the window virtual area to
12036 match the sizer's minimal size. For windows with managed scrollbars
12037 this will set them appropriately.
12038
12039 :see: `wx.ScrolledWindow.SetScrollbars`
12040
12041 """
d55e5bfc
RD
12042 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
12043
12044 def Clear(*args, **kwargs):
248ed943
RD
12045 """
12046 Clear(self, bool deleteWindows=False)
12047
12048 Clear all items from the sizer, optionally destroying the window items
12049 as well.
12050 """
d55e5bfc
RD
12051 return _core_.Sizer_Clear(*args, **kwargs)
12052
12053 def DeleteWindows(*args, **kwargs):
248ed943
RD
12054 """
12055 DeleteWindows(self)
12056
12057 Destroy all windows managed by the sizer.
12058 """
d55e5bfc
RD
12059 return _core_.Sizer_DeleteWindows(*args, **kwargs)
12060
12061 def GetChildren(*args, **kwargs):
248ed943 12062 """
51b83b37 12063 GetChildren(self) -> list
248ed943
RD
12064
12065 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12066 """
d55e5bfc
RD
12067 return _core_.Sizer_GetChildren(*args, **kwargs)
12068
12069 def Show(*args, **kwargs):
248ed943 12070 """
ae8162c8 12071 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12072
248ed943
RD
12073 Shows or hides an item managed by the sizer. To make a sizer item
12074 disappear or reappear, use Show followed by `Layout`. The *item*
12075 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12076 the item. Use the recursive parameter to show or hide an item in a
12077 subsizer. Returns True if the item was found.
248ed943
RD
12078 """
12079 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12080
12081 def IsShown(*args, **kwargs):
248ed943
RD
12082 """
12083 IsShown(self, item)
12084
b1fcee84 12085 Determines if the item is currently shown. To make a sizer
248ed943
RD
12086 item disappear or reappear, use Show followed by `Layout`. The *item*
12087 parameter can be either a window, a sizer, or the zero-based index of
12088 the item.
12089 """
d55e5bfc
RD
12090 return _core_.Sizer_IsShown(*args, **kwargs)
12091
629e65c2 12092 def Hide(self, item, recursive=False):
248ed943 12093 """
27fb7603 12094 A convenience method for `Show` (item, False, recursive).
248ed943 12095 """
06759a38 12096 return self.Show(item, False, recursive)
248ed943 12097
d55e5bfc 12098 def ShowItems(*args, **kwargs):
248ed943
RD
12099 """
12100 ShowItems(self, bool show)
12101
84f85550 12102 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 12103 """
d55e5bfc
RD
12104 return _core_.Sizer_ShowItems(*args, **kwargs)
12105
12106
12107class SizerPtr(Sizer):
12108 def __init__(self, this):
12109 self.this = this
12110 if not hasattr(self,"thisown"): self.thisown = 0
12111 self.__class__ = Sizer
12112_core_.Sizer_swigregister(SizerPtr)
12113
12114class PySizer(Sizer):
248ed943
RD
12115 """
12116 wx.PySizer is a special version of `wx.Sizer` that has been
12117 instrumented to allow the C++ virtual methods to be overloaded in
12118 Python derived classes. You would derive from this class if you are
12119 wanting to implement a custom sizer in Python code. Simply implement
12120 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12121 For example::
12122
12123 class MySizer(wx.PySizer):
12124 def __init__(self):
12125 wx.PySizer.__init__(self)
12126
12127 def CalcMin(self):
12128 for item in self.GetChildren():
12129 # calculate the total minimum width and height needed
12130 # by all items in the sizer according to this sizer's
12131 # layout algorithm.
12132 ...
12133 return wx.Size(width, height)
12134
12135 def RecalcSizes(self):
12136 # find the space allotted to this sizer
12137 pos = self.GetPosition()
12138 size = self.GetSize()
12139 for item in self.GetChildren():
12140 # Recalculate (if necessary) the position and size of
12141 # each item and then call item.SetDimension to do the
12142 # actual positioning and sizing of the items within the
12143 # space alloted to this sizer.
12144 ...
12145 item.SetDimension(itemPos, itemSize)
12146
12147
12148 When `Layout` is called it first calls `CalcMin` followed by
12149 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12150 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
12151
12152 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12153
12154
12155 """
d55e5bfc
RD
12156 def __repr__(self):
12157 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12158 def __init__(self, *args, **kwargs):
248ed943
RD
12159 """
12160 __init__(self) -> PySizer
12161
12162 Creates a wx.PySizer. Must be called from the __init__ in the derived
12163 class.
12164 """
d55e5bfc
RD
12165 newobj = _core_.new_PySizer(*args, **kwargs)
12166 self.this = newobj.this
12167 self.thisown = 1
12168 del newobj.thisown
12169 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12170
12171 def _setCallbackInfo(*args, **kwargs):
12172 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12173 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
12174
12175
12176class PySizerPtr(PySizer):
12177 def __init__(self, this):
12178 self.this = this
12179 if not hasattr(self,"thisown"): self.thisown = 0
12180 self.__class__ = PySizer
12181_core_.PySizer_swigregister(PySizerPtr)
12182
12183#---------------------------------------------------------------------------
12184
12185class BoxSizer(Sizer):
248ed943
RD
12186 """
12187 The basic idea behind a box sizer is that windows will most often be
12188 laid out in rather simple basic geometry, typically in a row or a
12189 column or nested hierarchies of either. A wx.BoxSizer will lay out
12190 its items in a simple row or column, depending on the orientation
12191 parameter passed to the constructor.
12192 """
d55e5bfc
RD
12193 def __repr__(self):
12194 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12195 def __init__(self, *args, **kwargs):
248ed943
RD
12196 """
12197 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12198
12199 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12200 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12201 sizer.
12202 """
d55e5bfc
RD
12203 newobj = _core_.new_BoxSizer(*args, **kwargs)
12204 self.this = newobj.this
12205 self.thisown = 1
12206 del newobj.thisown
12207 self._setOORInfo(self)
12208
12209 def GetOrientation(*args, **kwargs):
248ed943
RD
12210 """
12211 GetOrientation(self) -> int
12212
12213 Returns the current orientation of the sizer.
12214 """
d55e5bfc
RD
12215 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12216
12217 def SetOrientation(*args, **kwargs):
248ed943
RD
12218 """
12219 SetOrientation(self, int orient)
d55e5bfc 12220
248ed943
RD
12221 Resets the orientation of the sizer.
12222 """
12223 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
12224
12225
12226class BoxSizerPtr(BoxSizer):
12227 def __init__(self, this):
12228 self.this = this
12229 if not hasattr(self,"thisown"): self.thisown = 0
12230 self.__class__ = BoxSizer
12231_core_.BoxSizer_swigregister(BoxSizerPtr)
12232
12233#---------------------------------------------------------------------------
12234
12235class StaticBoxSizer(BoxSizer):
248ed943
RD
12236 """
12237 wx.StaticBoxSizer derives from and functions identically to the
12238 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12239 manages. Note that this static box must be created separately and
12240 passed to the sizer constructor.
12241 """
d55e5bfc
RD
12242 def __repr__(self):
12243 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12244 def __init__(self, *args, **kwargs):
248ed943
RD
12245 """
12246 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12247
12248 Constructor. It takes an associated static box and the orientation
12249 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12250 ``wx.HORIZONTAL``.
12251 """
d55e5bfc
RD
12252 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
12253 self.this = newobj.this
12254 self.thisown = 1
12255 del newobj.thisown
12256 self._setOORInfo(self)
12257
12258 def GetStaticBox(*args, **kwargs):
248ed943
RD
12259 """
12260 GetStaticBox(self) -> StaticBox
d55e5bfc 12261
248ed943
RD
12262 Returns the static box associated with this sizer.
12263 """
12264 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
12265
12266
12267class StaticBoxSizerPtr(StaticBoxSizer):
12268 def __init__(self, this):
12269 self.this = this
12270 if not hasattr(self,"thisown"): self.thisown = 0
12271 self.__class__ = StaticBoxSizer
12272_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
12273
12274#---------------------------------------------------------------------------
12275
12276class GridSizer(Sizer):
248ed943
RD
12277 """
12278 A grid sizer is a sizer which lays out its children in a
12279 two-dimensional table with all cells having the same size. In other
12280 words, the width of each cell within the grid is the width of the
12281 widest item added to the sizer and the height of each grid cell is the
12282 height of the tallest item. An optional vertical and/or horizontal
12283 gap between items can also be specified (in pixels.)
12284
12285 Items are placed in the cells of the grid in the order they are added,
12286 in row-major order. In other words, the first row is filled first,
12287 then the second, and so on until all items have been added. (If
12288 neccessary, additional rows will be added as items are added.) If you
12289 need to have greater control over the cells that items are placed in
12290 then use the `wx.GridBagSizer`.
12291
12292 """
d55e5bfc
RD
12293 def __repr__(self):
12294 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12295 def __init__(self, *args, **kwargs):
248ed943
RD
12296 """
12297 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12298
12299 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12300 of columns and rows in the sizer - if either of the parameters is
12301 zero, it will be calculated to from the total number of children in
12302 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12303 define extra space between all children.
12304 """
d55e5bfc
RD
12305 newobj = _core_.new_GridSizer(*args, **kwargs)
12306 self.this = newobj.this
12307 self.thisown = 1
12308 del newobj.thisown
12309 self._setOORInfo(self)
12310
d55e5bfc 12311 def SetCols(*args, **kwargs):
248ed943
RD
12312 """
12313 SetCols(self, int cols)
12314
12315 Sets the number of columns in the sizer.
12316 """
d55e5bfc
RD
12317 return _core_.GridSizer_SetCols(*args, **kwargs)
12318
12319 def SetRows(*args, **kwargs):
248ed943
RD
12320 """
12321 SetRows(self, int rows)
12322
12323 Sets the number of rows in the sizer.
12324 """
d55e5bfc
RD
12325 return _core_.GridSizer_SetRows(*args, **kwargs)
12326
12327 def SetVGap(*args, **kwargs):
248ed943
RD
12328 """
12329 SetVGap(self, int gap)
12330
12331 Sets the vertical gap (in pixels) between the cells in the sizer.
12332 """
d55e5bfc
RD
12333 return _core_.GridSizer_SetVGap(*args, **kwargs)
12334
12335 def SetHGap(*args, **kwargs):
248ed943
RD
12336 """
12337 SetHGap(self, int gap)
12338
12339 Sets the horizontal gap (in pixels) between cells in the sizer
12340 """
d55e5bfc
RD
12341 return _core_.GridSizer_SetHGap(*args, **kwargs)
12342
12343 def GetCols(*args, **kwargs):
248ed943
RD
12344 """
12345 GetCols(self) -> int
12346
12347 Returns the number of columns in the sizer.
12348 """
d55e5bfc
RD
12349 return _core_.GridSizer_GetCols(*args, **kwargs)
12350
12351 def GetRows(*args, **kwargs):
248ed943
RD
12352 """
12353 GetRows(self) -> int
12354
12355 Returns the number of rows in the sizer.
12356 """
d55e5bfc
RD
12357 return _core_.GridSizer_GetRows(*args, **kwargs)
12358
12359 def GetVGap(*args, **kwargs):
248ed943
RD
12360 """
12361 GetVGap(self) -> int
12362
12363 Returns the vertical gap (in pixels) between the cells in the sizer.
12364 """
d55e5bfc
RD
12365 return _core_.GridSizer_GetVGap(*args, **kwargs)
12366
12367 def GetHGap(*args, **kwargs):
248ed943
RD
12368 """
12369 GetHGap(self) -> int
12370
12371 Returns the horizontal gap (in pixels) between cells in the sizer.
12372 """
d55e5bfc
RD
12373 return _core_.GridSizer_GetHGap(*args, **kwargs)
12374
12375
12376class GridSizerPtr(GridSizer):
12377 def __init__(self, this):
12378 self.this = this
12379 if not hasattr(self,"thisown"): self.thisown = 0
12380 self.__class__ = GridSizer
12381_core_.GridSizer_swigregister(GridSizerPtr)
12382
12383#---------------------------------------------------------------------------
12384
12385FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12386FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12387FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12388class FlexGridSizer(GridSizer):
248ed943
RD
12389 """
12390 A flex grid sizer is a sizer which lays out its children in a
12391 two-dimensional table with all table cells in one row having the same
12392 height and all cells in one column having the same width, but all
12393 rows or all columns are not necessarily the same height or width as in
12394 the `wx.GridSizer`.
12395
12396 wx.FlexGridSizer can also size items equally in one direction but
12397 unequally ("flexibly") in the other. If the sizer is only flexible
12398 in one direction (this can be changed using `SetFlexibleDirection`), it
12399 needs to be decided how the sizer should grow in the other ("non
12400 flexible") direction in order to fill the available space. The
12401 `SetNonFlexibleGrowMode` method serves this purpose.
12402
12403
12404 """
d55e5bfc
RD
12405 def __repr__(self):
12406 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12407 def __init__(self, *args, **kwargs):
248ed943
RD
12408 """
12409 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12410
12411 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12412 number of columns and rows in the sizer - if either of the parameters
12413 is zero, it will be calculated to from the total number of children in
12414 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12415 define extra space between all children.
12416 """
d55e5bfc
RD
12417 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
12418 self.this = newobj.this
12419 self.thisown = 1
12420 del newobj.thisown
12421 self._setOORInfo(self)
12422
248ed943
RD
12423 def AddGrowableRow(*args, **kwargs):
12424 """
12425 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 12426
248ed943
RD
12427 Specifies that row *idx* (starting from zero) should be grown if there
12428 is extra space available to the sizer.
d55e5bfc 12429
248ed943
RD
12430 The *proportion* parameter has the same meaning as the stretch factor
12431 for the box sizers except that if all proportions are 0, then all
12432 columns are resized equally (instead of not being resized at all).
12433 """
d55e5bfc
RD
12434 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
12435
12436 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
12437 """
12438 RemoveGrowableRow(self, size_t idx)
12439
12440 Specifies that row *idx* is no longer growable.
12441 """
d55e5bfc
RD
12442 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
12443
12444 def AddGrowableCol(*args, **kwargs):
248ed943
RD
12445 """
12446 AddGrowableCol(self, size_t idx, int proportion=0)
12447
12448 Specifies that column *idx* (starting from zero) should be grown if
12449 there is extra space available to the sizer.
12450
12451 The *proportion* parameter has the same meaning as the stretch factor
12452 for the box sizers except that if all proportions are 0, then all
12453 columns are resized equally (instead of not being resized at all).
12454 """
d55e5bfc
RD
12455 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
12456
12457 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
12458 """
12459 RemoveGrowableCol(self, size_t idx)
12460
12461 Specifies that column *idx* is no longer growable.
12462 """
d55e5bfc
RD
12463 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
12464
12465 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
12466 """
12467 SetFlexibleDirection(self, int direction)
12468
12469 Specifies whether the sizer should flexibly resize its columns, rows,
12470 or both. Argument *direction* can be one of the following values. Any
12471 other value is ignored.
12472
12473 ============== =======================================
12474 wx.VERTICAL Rows are flexibly sized.
12475 wx.HORIZONTAL Columns are flexibly sized.
12476 wx.BOTH Both rows and columns are flexibly sized
12477 (this is the default value).
12478 ============== =======================================
12479
12480 Note that this method does not trigger relayout.
12481
12482 """
d55e5bfc
RD
12483 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12484
12485 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
12486 """
12487 GetFlexibleDirection(self) -> int
12488
12489 Returns a value that specifies whether the sizer
12490 flexibly resizes its columns, rows, or both (default).
12491
12492 :see: `SetFlexibleDirection`
12493 """
d55e5bfc
RD
12494 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12495
12496 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12497 """
12498 SetNonFlexibleGrowMode(self, int mode)
12499
12500 Specifies how the sizer should grow in the non-flexible direction if
12501 there is one (so `SetFlexibleDirection` must have been called
12502 previously). Argument *mode* can be one of the following values:
12503
12504 ========================== =================================================
12505 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12506 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12507 `AddGrowableCol` and `AddGrowableRow`. In this
12508 case equal sizing applies to minimum sizes of
12509 columns or rows (this is the default value).
12510 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12511 the non flexible direction, whether they are
12512 growable or not in the flexbile direction.
12513 ========================== =================================================
12514
12515 Note that this method does not trigger relayout.
12516
12517
12518 """
d55e5bfc
RD
12519 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12520
12521 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12522 """
12523 GetNonFlexibleGrowMode(self) -> int
12524
12525 Returns the value that specifies how the sizer grows in the
12526 non-flexible direction if there is one.
12527
12528 :see: `SetNonFlexibleGrowMode`
12529 """
d55e5bfc
RD
12530 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12531
12532 def GetRowHeights(*args, **kwargs):
a8eff060
RD
12533 """
12534 GetRowHeights(self) -> list
12535
12536 Returns a list of integers representing the heights of each of the
12537 rows in the sizer.
12538 """
d55e5bfc
RD
12539 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12540
12541 def GetColWidths(*args, **kwargs):
a8eff060
RD
12542 """
12543 GetColWidths(self) -> list
12544
12545 Returns a list of integers representing the widths of each of the
12546 columns in the sizer.
12547 """
d55e5bfc
RD
12548 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12549
12550
12551class FlexGridSizerPtr(FlexGridSizer):
12552 def __init__(self, this):
12553 self.this = this
12554 if not hasattr(self,"thisown"): self.thisown = 0
12555 self.__class__ = FlexGridSizer
12556_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
12557
62d32a5f
RD
12558class StdDialogButtonSizer(BoxSizer):
12559 """
12560 A special sizer that knows how to order and position standard buttons
12561 in order to conform to the current platform's standards. You simply
12562 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12563 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
12564 will take care of the rest.
12565
12566 """
12567 def __repr__(self):
12568 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12569 def __init__(self, *args, **kwargs):
12570 """__init__(self) -> StdDialogButtonSizer"""
12571 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
12572 self.this = newobj.this
12573 self.thisown = 1
12574 del newobj.thisown
12575 def AddButton(*args, **kwargs):
12576 """
12577 AddButton(self, wxButton button)
12578
12579 Use this to add the buttons to this sizer. Do not use the `Add`
12580 method in the base class.
12581 """
12582 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12583
53aa7709 12584 def Realize(*args, **kwargs):
62d32a5f 12585 """
53aa7709 12586 Realize(self)
62d32a5f
RD
12587
12588 This funciton needs to be called after all the buttons have been added
12589 to the sizer. It will reorder them and position them in a platform
12590 specifc manner.
12591 """
53aa7709 12592 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12593
12594 def SetAffirmativeButton(*args, **kwargs):
12595 """SetAffirmativeButton(self, wxButton button)"""
12596 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12597
12598 def SetNegativeButton(*args, **kwargs):
12599 """SetNegativeButton(self, wxButton button)"""
12600 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12601
12602 def SetCancelButton(*args, **kwargs):
12603 """SetCancelButton(self, wxButton button)"""
12604 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
12605
12606 def GetAffirmativeButton(*args, **kwargs):
12607 """GetAffirmativeButton(self) -> wxButton"""
12608 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12609
12610 def GetApplyButton(*args, **kwargs):
12611 """GetApplyButton(self) -> wxButton"""
12612 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12613
12614 def GetNegativeButton(*args, **kwargs):
12615 """GetNegativeButton(self) -> wxButton"""
12616 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12617
12618 def GetCancelButton(*args, **kwargs):
12619 """GetCancelButton(self) -> wxButton"""
12620 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12621
12622 def GetHelpButton(*args, **kwargs):
12623 """GetHelpButton(self) -> wxButton"""
12624 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12625
12626
12627class StdDialogButtonSizerPtr(StdDialogButtonSizer):
12628 def __init__(self, this):
12629 self.this = this
12630 if not hasattr(self,"thisown"): self.thisown = 0
12631 self.__class__ = StdDialogButtonSizer
12632_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
12633
d55e5bfc
RD
12634#---------------------------------------------------------------------------
12635
12636class GBPosition(object):
248ed943
RD
12637 """
12638 This class represents the position of an item in a virtual grid of
12639 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12640 typemaps that will automatically convert from a 2-element sequence of
12641 integers to a wx.GBPosition, so you can use the more pythonic
12642 representation of the position nearly transparently in Python code.
12643 """
d55e5bfc
RD
12644 def __repr__(self):
12645 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12646 def __init__(self, *args, **kwargs):
248ed943
RD
12647 """
12648 __init__(self, int row=0, int col=0) -> GBPosition
12649
12650 This class represents the position of an item in a virtual grid of
12651 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12652 typemaps that will automatically convert from a 2-element sequence of
12653 integers to a wx.GBPosition, so you can use the more pythonic
12654 representation of the position nearly transparently in Python code.
12655 """
d55e5bfc
RD
12656 newobj = _core_.new_GBPosition(*args, **kwargs)
12657 self.this = newobj.this
12658 self.thisown = 1
12659 del newobj.thisown
7e08d4ef
RD
12660 def __del__(self, destroy=_core_.delete_GBPosition):
12661 """__del__(self)"""
12662 try:
12663 if self.thisown: destroy(self)
12664 except: pass
12665
d55e5bfc
RD
12666 def GetRow(*args, **kwargs):
12667 """GetRow(self) -> int"""
12668 return _core_.GBPosition_GetRow(*args, **kwargs)
12669
12670 def GetCol(*args, **kwargs):
12671 """GetCol(self) -> int"""
12672 return _core_.GBPosition_GetCol(*args, **kwargs)
12673
12674 def SetRow(*args, **kwargs):
12675 """SetRow(self, int row)"""
12676 return _core_.GBPosition_SetRow(*args, **kwargs)
12677
12678 def SetCol(*args, **kwargs):
12679 """SetCol(self, int col)"""
12680 return _core_.GBPosition_SetCol(*args, **kwargs)
12681
12682 def __eq__(*args, **kwargs):
12683 """__eq__(self, GBPosition other) -> bool"""
12684 return _core_.GBPosition___eq__(*args, **kwargs)
12685
12686 def __ne__(*args, **kwargs):
12687 """__ne__(self, GBPosition other) -> bool"""
12688 return _core_.GBPosition___ne__(*args, **kwargs)
12689
12690 def Set(*args, **kwargs):
12691 """Set(self, int row=0, int col=0)"""
12692 return _core_.GBPosition_Set(*args, **kwargs)
12693
12694 def Get(*args, **kwargs):
12695 """Get(self) -> PyObject"""
12696 return _core_.GBPosition_Get(*args, **kwargs)
12697
79fccf9d 12698 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12699 def __str__(self): return str(self.Get())
12700 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12701 def __len__(self): return len(self.Get())
12702 def __getitem__(self, index): return self.Get()[index]
12703 def __setitem__(self, index, val):
12704 if index == 0: self.SetRow(val)
12705 elif index == 1: self.SetCol(val)
12706 else: raise IndexError
12707 def __nonzero__(self): return self.Get() != (0,0)
12708 __safe_for_unpickling__ = True
12709 def __reduce__(self): return (wx.GBPosition, self.Get())
12710
12711 row = property(GetRow, SetRow)
12712 col = property(GetCol, SetCol)
12713
12714
12715class GBPositionPtr(GBPosition):
12716 def __init__(self, this):
12717 self.this = this
12718 if not hasattr(self,"thisown"): self.thisown = 0
12719 self.__class__ = GBPosition
12720_core_.GBPosition_swigregister(GBPositionPtr)
12721
12722class GBSpan(object):
248ed943
RD
12723 """
12724 This class is used to hold the row and column spanning attributes of
12725 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12726 automatically convert from a 2-element sequence of integers to a
12727 wx.GBSpan, so you can use the more pythonic representation of the span
12728 nearly transparently in Python code.
12729
12730 """
d55e5bfc
RD
12731 def __repr__(self):
12732 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12733 def __init__(self, *args, **kwargs):
248ed943
RD
12734 """
12735 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12736
12737 Construct a new wxGBSpan, optionally setting the rowspan and
12738 colspan. The default is (1,1). (Meaning that the item occupies one
12739 cell in each direction.
12740 """
d55e5bfc
RD
12741 newobj = _core_.new_GBSpan(*args, **kwargs)
12742 self.this = newobj.this
12743 self.thisown = 1
12744 del newobj.thisown
7e08d4ef
RD
12745 def __del__(self, destroy=_core_.delete_GBSpan):
12746 """__del__(self)"""
12747 try:
12748 if self.thisown: destroy(self)
12749 except: pass
12750
d55e5bfc
RD
12751 def GetRowspan(*args, **kwargs):
12752 """GetRowspan(self) -> int"""
12753 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12754
12755 def GetColspan(*args, **kwargs):
12756 """GetColspan(self) -> int"""
12757 return _core_.GBSpan_GetColspan(*args, **kwargs)
12758
12759 def SetRowspan(*args, **kwargs):
12760 """SetRowspan(self, int rowspan)"""
12761 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12762
12763 def SetColspan(*args, **kwargs):
12764 """SetColspan(self, int colspan)"""
12765 return _core_.GBSpan_SetColspan(*args, **kwargs)
12766
12767 def __eq__(*args, **kwargs):
12768 """__eq__(self, GBSpan other) -> bool"""
12769 return _core_.GBSpan___eq__(*args, **kwargs)
12770
12771 def __ne__(*args, **kwargs):
12772 """__ne__(self, GBSpan other) -> bool"""
12773 return _core_.GBSpan___ne__(*args, **kwargs)
12774
12775 def Set(*args, **kwargs):
12776 """Set(self, int rowspan=1, int colspan=1)"""
12777 return _core_.GBSpan_Set(*args, **kwargs)
12778
12779 def Get(*args, **kwargs):
12780 """Get(self) -> PyObject"""
12781 return _core_.GBSpan_Get(*args, **kwargs)
12782
79fccf9d 12783 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12784 def __str__(self): return str(self.Get())
12785 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12786 def __len__(self): return len(self.Get())
12787 def __getitem__(self, index): return self.Get()[index]
12788 def __setitem__(self, index, val):
12789 if index == 0: self.SetRowspan(val)
12790 elif index == 1: self.SetColspan(val)
12791 else: raise IndexError
12792 def __nonzero__(self): return self.Get() != (0,0)
12793 __safe_for_unpickling__ = True
12794 def __reduce__(self): return (wx.GBSpan, self.Get())
12795
12796 rowspan = property(GetRowspan, SetRowspan)
12797 colspan = property(GetColspan, SetColspan)
12798
12799
12800class GBSpanPtr(GBSpan):
12801 def __init__(self, this):
12802 self.this = this
12803 if not hasattr(self,"thisown"): self.thisown = 0
12804 self.__class__ = GBSpan
12805_core_.GBSpan_swigregister(GBSpanPtr)
12806
12807class GBSizerItem(SizerItem):
248ed943
RD
12808 """
12809 The wx.GBSizerItem class is used to track the additional data about
12810 items in a `wx.GridBagSizer` such as the item's position in the grid
12811 and how many rows or columns it spans.
12812
12813 """
d55e5bfc
RD
12814 def __repr__(self):
12815 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12816 def __init__(self, *args, **kwargs):
248ed943
RD
12817 """
12818 __init__(self) -> GBSizerItem
12819
12820 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12821 size will need to be set, as well as a position and span before this
12822 item can be used in a Sizer.
12823
12824 You will probably never need to create a wx.GBSizerItem directly as they
12825 are created automatically when the sizer's Add method is called.
12826 """
d55e5bfc
RD
12827 newobj = _core_.new_GBSizerItem(*args, **kwargs)
12828 self.this = newobj.this
12829 self.thisown = 1
12830 del newobj.thisown
7e08d4ef
RD
12831 def __del__(self, destroy=_core_.delete_GBSizerItem):
12832 """__del__(self)"""
12833 try:
12834 if self.thisown: destroy(self)
12835 except: pass
12836
d55e5bfc 12837 def GetPos(*args, **kwargs):
248ed943
RD
12838 """
12839 GetPos(self) -> GBPosition
12840
12841 Get the grid position of the item
12842 """
d55e5bfc
RD
12843 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12844
12845 def GetPosTuple(self): return self.GetPos().Get()
12846 def GetSpan(*args, **kwargs):
248ed943
RD
12847 """
12848 GetSpan(self) -> GBSpan
12849
12850 Get the row and column spanning of the item
12851 """
d55e5bfc
RD
12852 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12853
12854 def GetSpanTuple(self): return self.GetSpan().Get()
12855 def SetPos(*args, **kwargs):
248ed943
RD
12856 """
12857 SetPos(self, GBPosition pos) -> bool
12858
12859 If the item is already a member of a sizer then first ensure that
12860 there is no other item that would intersect with this one at the new
12861 position, then set the new position. Returns True if the change is
12862 successful and after the next Layout() the item will be moved.
12863 """
d55e5bfc
RD
12864 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12865
12866 def SetSpan(*args, **kwargs):
248ed943
RD
12867 """
12868 SetSpan(self, GBSpan span) -> bool
12869
12870 If the item is already a member of a sizer then first ensure that
12871 there is no other item that would intersect with this one with its new
12872 spanning size, then set the new spanning. Returns True if the change
12873 is successful and after the next Layout() the item will be resized.
12874
12875 """
d55e5bfc
RD
12876 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12877
248ed943 12878 def Intersects(*args, **kwargs):
d55e5bfc
RD
12879 """
12880 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12881
12882 Returns True if this item and the other item instersect.
d55e5bfc 12883 """
248ed943
RD
12884 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12885
12886 def IntersectsPos(*args, **kwargs):
12887 """
12888 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12889
12890 Returns True if the given pos/span would intersect with this item.
12891 """
12892 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12893
12894 def GetEndPos(*args, **kwargs):
248ed943
RD
12895 """
12896 GetEndPos(self) -> GBPosition
12897
12898 Get the row and column of the endpoint of this item.
12899 """
d55e5bfc
RD
12900 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12901
12902 def GetGBSizer(*args, **kwargs):
248ed943
RD
12903 """
12904 GetGBSizer(self) -> GridBagSizer
12905
12906 Get the sizer this item is a member of.
12907 """
d55e5bfc
RD
12908 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12909
12910 def SetGBSizer(*args, **kwargs):
248ed943
RD
12911 """
12912 SetGBSizer(self, GridBagSizer sizer)
12913
12914 Set the sizer this item is a member of.
12915 """
d55e5bfc
RD
12916 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12917
12918
12919class GBSizerItemPtr(GBSizerItem):
12920 def __init__(self, this):
12921 self.this = this
12922 if not hasattr(self,"thisown"): self.thisown = 0
12923 self.__class__ = GBSizerItem
12924_core_.GBSizerItem_swigregister(GBSizerItemPtr)
12925DefaultSpan = cvar.DefaultSpan
12926
12927def GBSizerItemWindow(*args, **kwargs):
12928 """
12929 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12930 int border, PyObject userData=None) -> GBSizerItem
12931
12932 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
12933 """
12934 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12935 val.thisown = 1
12936 return val
12937
12938def GBSizerItemSizer(*args, **kwargs):
12939 """
12940 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12941 int border, PyObject userData=None) -> GBSizerItem
12942
12943 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
12944 """
12945 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12946 val.thisown = 1
12947 return val
12948
12949def GBSizerItemSpacer(*args, **kwargs):
12950 """
12951 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12952 int flag, int border, PyObject userData=None) -> GBSizerItem
12953
12954 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
12955 """
12956 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12957 val.thisown = 1
12958 return val
12959
12960class GridBagSizer(FlexGridSizer):
248ed943
RD
12961 """
12962 A `wx.Sizer` that can lay out items in a virtual grid like a
12963 `wx.FlexGridSizer` but in this case explicit positioning of the items
12964 is allowed using `wx.GBPosition`, and items can optionally span more
12965 than one row and/or column using `wx.GBSpan`. The total size of the
12966 virtual grid is determined by the largest row and column that items are
12967 positioned at, adjusted for spanning.
12968
12969 """
d55e5bfc
RD
12970 def __repr__(self):
12971 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12972 def __init__(self, *args, **kwargs):
248ed943
RD
12973 """
12974 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12975
12976 Constructor, with optional parameters to specify the gap between the
12977 rows and columns.
12978 """
d55e5bfc
RD
12979 newobj = _core_.new_GridBagSizer(*args, **kwargs)
12980 self.this = newobj.this
12981 self.thisown = 1
12982 del newobj.thisown
c9c2cf70
RD
12983 self._setOORInfo(self)
12984
d55e5bfc
RD
12985 def Add(*args, **kwargs):
12986 """
248ed943 12987 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
c1cb24a4 12988 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12989
12990 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12991 more than one row or column as specified with *span*. The remaining
12992 args behave similarly to `wx.Sizer.Add`.
12993
12994 Returns True if the item was successfully placed at the given cell
12995 position, False if something was already there.
12996
d55e5bfc
RD
12997 """
12998 return _core_.GridBagSizer_Add(*args, **kwargs)
12999
13000 def AddItem(*args, **kwargs):
248ed943 13001 """
c1cb24a4 13002 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
13003
13004 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13005 the item was successfully placed at its given cell position, False if
13006 something was already there.
13007 """
d55e5bfc
RD
13008 return _core_.GridBagSizer_AddItem(*args, **kwargs)
13009
84f85550
RD
13010 def GetCellSize(*args, **kwargs):
13011 """
13012 GetCellSize(self, int row, int col) -> Size
13013
13014 Get the size of the specified cell, including hgap and
13015 vgap. Only valid after a Layout.
13016 """
13017 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
13018
d55e5bfc 13019 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
13020 """
13021 GetEmptyCellSize(self) -> Size
13022
13023 Get the size used for cells in the grid with no item.
13024 """
d55e5bfc
RD
13025 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
13026
13027 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
13028 """
13029 SetEmptyCellSize(self, Size sz)
13030
13031 Set the size used for cells in the grid with no item.
13032 """
d55e5bfc
RD
13033 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
13034
13035 def GetItemPosition(*args):
13036 """
248ed943
RD
13037 GetItemPosition(self, item) -> GBPosition
13038
13039 Get the grid position of the specified *item* where *item* is either a
13040 window or subsizer that is a member of this sizer, or a zero-based
13041 index of an item.
d55e5bfc
RD
13042 """
13043 return _core_.GridBagSizer_GetItemPosition(*args)
13044
13045 def SetItemPosition(*args):
13046 """
248ed943
RD
13047 SetItemPosition(self, item, GBPosition pos) -> bool
13048
13049 Set the grid position of the specified *item* where *item* is either a
13050 window or subsizer that is a member of this sizer, or a zero-based
13051 index of an item. Returns True on success. If the move is not
13052 allowed (because an item is already there) then False is returned.
13053
d55e5bfc
RD
13054 """
13055 return _core_.GridBagSizer_SetItemPosition(*args)
13056
13057 def GetItemSpan(*args):
13058 """
248ed943
RD
13059 GetItemSpan(self, item) -> GBSpan
13060
13061 Get the row/col spanning of the specified *item* where *item* is
13062 either a window or subsizer that is a member of this sizer, or a
13063 zero-based index of an item.
d55e5bfc
RD
13064 """
13065 return _core_.GridBagSizer_GetItemSpan(*args)
13066
13067 def SetItemSpan(*args):
13068 """
248ed943
RD
13069 SetItemSpan(self, item, GBSpan span) -> bool
13070
13071 Set the row/col spanning of the specified *item* where *item* is
13072 either a window or subsizer that is a member of this sizer, or a
13073 zero-based index of an item. Returns True on success. If the move is
13074 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
13075 """
13076 return _core_.GridBagSizer_SetItemSpan(*args)
13077
13078 def FindItem(*args):
13079 """
248ed943
RD
13080 FindItem(self, item) -> GBSizerItem
13081
13082 Find the sizer item for the given window or subsizer, returns None if
13083 not found. (non-recursive)
d55e5bfc
RD
13084 """
13085 return _core_.GridBagSizer_FindItem(*args)
13086
13087 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
13088 """
13089 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13090
13091 Return the sizer item for the given grid cell, or None if there is no
13092 item at that position. (non-recursive)
13093 """
d55e5bfc
RD
13094 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
13095
13096 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
13097 """
13098 FindItemAtPoint(self, Point pt) -> GBSizerItem
13099
13100 Return the sizer item located at the point given in *pt*, or None if
13101 there is no item at that point. The (x,y) coordinates in pt correspond
13102 to the client coordinates of the window using the sizer for
13103 layout. (non-recursive)
13104 """
d55e5bfc
RD
13105 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
13106
248ed943
RD
13107 def CheckForIntersection(*args, **kwargs):
13108 """
13109 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13110
248ed943
RD
13111 Look at all items and see if any intersect (or would overlap) the
13112 given *item*. Returns True if so, False if there would be no overlap.
13113 If an *excludeItem* is given then it will not be checked for
13114 intersection, for example it may be the item we are checking the
13115 position of.
d55e5bfc 13116
248ed943
RD
13117 """
13118 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13119
248ed943 13120 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13121 """
248ed943
RD
13122 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13123
13124 Look at all items and see if any intersect (or would overlap) the
13125 given position and span. Returns True if so, False if there would be
13126 no overlap. If an *excludeItem* is given then it will not be checked
13127 for intersection, for example it may be the item we are checking the
13128 position of.
d55e5bfc 13129 """
248ed943 13130 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
13131
13132
13133class GridBagSizerPtr(GridBagSizer):
13134 def __init__(self, this):
13135 self.this = this
13136 if not hasattr(self,"thisown"): self.thisown = 0
13137 self.__class__ = GridBagSizer
13138_core_.GridBagSizer_swigregister(GridBagSizerPtr)
13139
13140#---------------------------------------------------------------------------
13141
13142Left = _core_.Left
13143Top = _core_.Top
13144Right = _core_.Right
13145Bottom = _core_.Bottom
13146Width = _core_.Width
13147Height = _core_.Height
13148Centre = _core_.Centre
13149Center = _core_.Center
13150CentreX = _core_.CentreX
13151CentreY = _core_.CentreY
13152Unconstrained = _core_.Unconstrained
13153AsIs = _core_.AsIs
13154PercentOf = _core_.PercentOf
13155Above = _core_.Above
13156Below = _core_.Below
13157LeftOf = _core_.LeftOf
13158RightOf = _core_.RightOf
13159SameAs = _core_.SameAs
13160Absolute = _core_.Absolute
13161class IndividualLayoutConstraint(Object):
13162 """
79fccf9d
RD
13163 Objects of this class are stored in the `wx.LayoutConstraints` class as
13164 one of eight possible constraints that a window can be involved in.
13165 You will never need to create an instance of
13166 wx.IndividualLayoutConstraint, rather you should create a
13167 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13168 that it contains.
d55e5bfc
RD
13169 """
13170 def __init__(self): raise RuntimeError, "No constructor defined"
13171 def __repr__(self):
13172 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
13173 def Set(*args, **kwargs):
79fccf9d
RD
13174 """
13175 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13176
13177 Sets the properties of the constraint. Normally called by one of the
13178 convenience functions such as Above, RightOf, SameAs.
13179 """
d55e5bfc
RD
13180 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
13181
13182 def LeftOf(*args, **kwargs):
13183 """
13184 LeftOf(self, Window sibling, int marg=0)
13185
79fccf9d
RD
13186 Constrains this edge to be to the left of the given window, with an
13187 optional margin. Implicitly, this is relative to the left edge of the
13188 other window.
d55e5bfc
RD
13189 """
13190 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
13191
13192 def RightOf(*args, **kwargs):
13193 """
13194 RightOf(self, Window sibling, int marg=0)
13195
79fccf9d
RD
13196 Constrains this edge to be to the right of the given window, with an
13197 optional margin. Implicitly, this is relative to the right edge of the
13198 other window.
d55e5bfc
RD
13199 """
13200 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
13201
13202 def Above(*args, **kwargs):
13203 """
13204 Above(self, Window sibling, int marg=0)
13205
79fccf9d
RD
13206 Constrains this edge to be above the given window, with an optional
13207 margin. Implicitly, this is relative to the top edge of the other
13208 window.
d55e5bfc
RD
13209 """
13210 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
13211
13212 def Below(*args, **kwargs):
13213 """
13214 Below(self, Window sibling, int marg=0)
13215
79fccf9d
RD
13216 Constrains this edge to be below the given window, with an optional
13217 margin. Implicitly, this is relative to the bottom edge of the other
13218 window.
d55e5bfc
RD
13219 """
13220 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
13221
13222 def SameAs(*args, **kwargs):
13223 """
13224 SameAs(self, Window otherW, int edge, int marg=0)
13225
79fccf9d
RD
13226 Constrains this edge or dimension to be to the same as the edge of the
13227 given window, with an optional margin.
d55e5bfc
RD
13228 """
13229 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
13230
13231 def PercentOf(*args, **kwargs):
13232 """
13233 PercentOf(self, Window otherW, int wh, int per)
13234
79fccf9d
RD
13235 Constrains this edge or dimension to be to a percentage of the given
13236 window, with an optional margin.
d55e5bfc
RD
13237 """
13238 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13239
13240 def Absolute(*args, **kwargs):
13241 """
13242 Absolute(self, int val)
13243
79fccf9d 13244 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
13245 """
13246 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13247
13248 def Unconstrained(*args, **kwargs):
13249 """
13250 Unconstrained(self)
13251
79fccf9d
RD
13252 Sets this edge or dimension to be unconstrained, that is, dependent on
13253 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
13254 """
13255 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13256
13257 def AsIs(*args, **kwargs):
13258 """
13259 AsIs(self)
13260
79fccf9d
RD
13261 Sets this edge or constraint to be whatever the window's value is at
13262 the moment. If either of the width and height constraints are *as is*,
13263 the window will not be resized, but moved instead. This is important
13264 when considering panel items which are intended to have a default
13265 size, such as a button, which may take its size from the size of the
13266 button label.
d55e5bfc
RD
13267 """
13268 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13269
13270 def GetOtherWindow(*args, **kwargs):
13271 """GetOtherWindow(self) -> Window"""
13272 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13273
13274 def GetMyEdge(*args, **kwargs):
13275 """GetMyEdge(self) -> int"""
13276 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13277
13278 def SetEdge(*args, **kwargs):
13279 """SetEdge(self, int which)"""
13280 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13281
13282 def SetValue(*args, **kwargs):
13283 """SetValue(self, int v)"""
13284 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13285
13286 def GetMargin(*args, **kwargs):
13287 """GetMargin(self) -> int"""
13288 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13289
13290 def SetMargin(*args, **kwargs):
13291 """SetMargin(self, int m)"""
13292 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13293
13294 def GetValue(*args, **kwargs):
13295 """GetValue(self) -> int"""
13296 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13297
13298 def GetPercent(*args, **kwargs):
13299 """GetPercent(self) -> int"""
13300 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
13301
13302 def GetOtherEdge(*args, **kwargs):
13303 """GetOtherEdge(self) -> int"""
13304 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13305
13306 def GetDone(*args, **kwargs):
13307 """GetDone(self) -> bool"""
13308 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13309
13310 def SetDone(*args, **kwargs):
13311 """SetDone(self, bool d)"""
13312 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13313
13314 def GetRelationship(*args, **kwargs):
13315 """GetRelationship(self) -> int"""
13316 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13317
13318 def SetRelationship(*args, **kwargs):
13319 """SetRelationship(self, int r)"""
13320 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13321
13322 def ResetIfWin(*args, **kwargs):
13323 """
13324 ResetIfWin(self, Window otherW) -> bool
13325
13326 Reset constraint if it mentions otherWin
13327 """
13328 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13329
13330 def SatisfyConstraint(*args, **kwargs):
13331 """
13332 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13333
13334 Try to satisfy constraint
13335 """
13336 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13337
13338 def GetEdge(*args, **kwargs):
13339 """
13340 GetEdge(self, int which, Window thisWin, Window other) -> int
13341
13342 Get the value of this edge or dimension, or if this
13343 is not determinable, -1.
13344 """
13345 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13346
13347
13348class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
13349 def __init__(self, this):
13350 self.this = this
13351 if not hasattr(self,"thisown"): self.thisown = 0
13352 self.__class__ = IndividualLayoutConstraint
13353_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
13354
13355class LayoutConstraints(Object):
13356 """
79fccf9d
RD
13357 **Note:** constraints are now deprecated and you should use sizers
13358 instead.
d55e5bfc 13359
79fccf9d
RD
13360 Objects of this class can be associated with a window to define its
13361 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13362
13363 The class consists of the following eight constraints of class
13364 wx.IndividualLayoutConstraint, some or all of which should be accessed
13365 directly to set the appropriate constraints.
13366
13367 * left: represents the left hand edge of the window
13368 * right: represents the right hand edge of the window
13369 * top: represents the top edge of the window
13370 * bottom: represents the bottom edge of the window
13371 * width: represents the width of the window
13372 * height: represents the height of the window
13373 * centreX: represents the horizontal centre point of the window
13374 * centreY: represents the vertical centre point of the window
13375
79fccf9d
RD
13376 Most constraints are initially set to have the relationship
13377 wxUnconstrained, which means that their values should be calculated by
13378 looking at known constraints. The exceptions are width and height,
13379 which are set to wxAsIs to ensure that if the user does not specify a
13380 constraint, the existing width and height will be used, to be
13381 compatible with panel items which often have take a default size. If
13382 the constraint is ``wx.AsIs``, the dimension will not be changed.
13383
13384 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13385
13386 """
13387 def __repr__(self):
13388 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
13389 left = property(_core_.LayoutConstraints_left_get)
13390 top = property(_core_.LayoutConstraints_top_get)
13391 right = property(_core_.LayoutConstraints_right_get)
13392 bottom = property(_core_.LayoutConstraints_bottom_get)
13393 width = property(_core_.LayoutConstraints_width_get)
13394 height = property(_core_.LayoutConstraints_height_get)
13395 centreX = property(_core_.LayoutConstraints_centreX_get)
13396 centreY = property(_core_.LayoutConstraints_centreY_get)
13397 def __init__(self, *args, **kwargs):
13398 """__init__(self) -> LayoutConstraints"""
13399 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
13400 self.this = newobj.this
13401 self.thisown = 1
13402 del newobj.thisown
13403 def SatisfyConstraints(*args, **kwargs):
13404 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13405 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
13406
13407 def AreSatisfied(*args, **kwargs):
13408 """AreSatisfied(self) -> bool"""
13409 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
13410
13411
13412class LayoutConstraintsPtr(LayoutConstraints):
13413 def __init__(self, this):
13414 self.this = this
13415 if not hasattr(self,"thisown"): self.thisown = 0
13416 self.__class__ = LayoutConstraints
13417_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
13418
13419#----------------------------------------------------------------------------
13420
13421# Use Python's bool constants if available, make some if not
13422try:
13423 True
13424except NameError:
13425 __builtins__.True = 1==1
13426 __builtins__.False = 1==0
13427 def bool(value): return not not value
13428 __builtins__.bool = bool
13429
13430
13431
13432# workarounds for bad wxRTTI names
13433__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13434__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13435__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13436
13437
13438#----------------------------------------------------------------------------
13439# Load version numbers from __version__... Ensure that major and minor
0f63ec68 13440# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
13441
13442from __version__ import *
13443__version__ = VERSION_STRING
13444
0f63ec68
RD
13445assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13446assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
13447if RELEASE_VERSION != _core_.RELEASE_VERSION:
13448 import warnings
0f63ec68 13449 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
13450
13451#----------------------------------------------------------------------------
13452
70b7a5fe
RD
13453# Set wxPython's default string<-->unicode conversion encoding from
13454# the locale, but only if Python's default hasn't been changed. (We
13455# assume that if the user has customized it already then that is the
13456# encoding we need to use as well.)
13457#
13458# The encoding selected here is used when string or unicode objects
13459# need to be converted in order to pass them to wxWidgets. Please be
13460# aware that the default encoding within the same locale may be
13461# slightly different on different platforms. For example, please see
62d32a5f
RD
13462# http://www.alanwood.net/demos/charsetdiffs.html for differences
13463# between the common latin/roman encodings.
396fb509
RD
13464
13465default = _sys.getdefaultencoding()
13466if default == 'ascii':
13467 import locale
13468 import codecs
13469 try:
13470 default = locale.getdefaultlocale()[1]
13471 codecs.lookup(default)
70b7a5fe 13472 except (ValueError, LookupError, TypeError):
396fb509
RD
13473 default = _sys.getdefaultencoding()
13474 del locale
13475 del codecs
5cbf236d
RD
13476if default:
13477 wx.SetDefaultPyEncoding(default)
13478del default
5cbf236d
RD
13479
13480#----------------------------------------------------------------------------
13481
d55e5bfc
RD
13482class PyDeadObjectError(AttributeError):
13483 pass
13484
13485class _wxPyDeadObject(object):
13486 """
13487 Instances of wx objects that are OOR capable will have their __class__
13488 changed to this class when the C++ object is deleted. This should help
13489 prevent crashes due to referencing a bogus C++ pointer.
13490 """
13491 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13492 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13493
13494 def __repr__(self):
13495 if not hasattr(self, "_name"):
13496 self._name = "[unknown]"
13497 return self.reprStr % self._name
13498
13499 def __getattr__(self, *args):
13500 if not hasattr(self, "_name"):
13501 self._name = "[unknown]"
13502 raise PyDeadObjectError(self.attrStr % self._name)
13503
13504 def __nonzero__(self):
13505 return 0
13506
13507
13508
13509class PyUnbornObjectError(AttributeError):
13510 pass
13511
13512class _wxPyUnbornObject(object):
13513 """
13514 Some stock objects are created when the wx._core module is
13515 imported, but their C++ instance is not created until the wx.App
13516 object is created and initialized. These object instances will
13517 temporarily have their __class__ changed to this class so an
13518 exception will be raised if they are used before the C++ instance
13519 is ready.
13520 """
13521
13522 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13523 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13524
13525 def __repr__(self):
13526 #if not hasattr(self, "_name"):
13527 # self._name = "[unknown]"
13528 return self.reprStr #% self._name
13529
13530 def __getattr__(self, *args):
13531 #if not hasattr(self, "_name"):
13532 # self._name = "[unknown]"
13533 raise PyUnbornObjectError(self.attrStr) # % self._name )
13534
13535 def __nonzero__(self):
13536 return 0
13537
13538
13539#----------------------------------------------------------------------------
d55e5bfc
RD
13540
13541def CallAfter(callable, *args, **kw):
13542 """
13543 Call the specified function after the current and pending event
13544 handlers have been completed. This is also good for making GUI
0439c23b
RD
13545 method calls from non-GUI threads. Any extra positional or
13546 keyword args are passed on to the callable when it is called.
13547
13548 :see: `wx.FutureCall`
d55e5bfc
RD
13549 """
13550 app = wx.GetApp()
a001823c 13551 assert app is not None, 'No wx.App created yet'
d55e5bfc 13552
891bb194
RD
13553 if not hasattr(app, "_CallAfterId"):
13554 app._CallAfterId = wx.NewEventType()
13555 app.Connect(-1, -1, app._CallAfterId,
13556 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 13557 evt = wx.PyEvent()
891bb194 13558 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
13559 evt.callable = callable
13560 evt.args = args
13561 evt.kw = kw
13562 wx.PostEvent(app, evt)
13563
d55e5bfc
RD
13564#----------------------------------------------------------------------------
13565
13566
13567class FutureCall:
13568 """
8ac8dba0 13569 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
13570 object once after the given amount of milliseconds, passing any
13571 positional or keyword args. The return value of the callable is
0439c23b 13572 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
13573
13574 If you don't need to get the return value or restart the timer
13575 then there is no need to hold a reference to this object. It will
13576 hold a reference to itself while the timer is running (the timer
13577 has a reference to self.Notify) but the cycle will be broken when
13578 the timer completes, automatically cleaning up the wx.FutureCall
13579 object.
0439c23b
RD
13580
13581 :see: `wx.CallAfter`
d55e5bfc
RD
13582 """
13583 def __init__(self, millis, callable, *args, **kwargs):
13584 self.millis = millis
13585 self.callable = callable
13586 self.SetArgs(*args, **kwargs)
13587 self.runCount = 0
13588 self.running = False
13589 self.hasRun = False
13590 self.result = None
13591 self.timer = None
13592 self.Start()
13593
13594 def __del__(self):
13595 self.Stop()
13596
13597
13598 def Start(self, millis=None, *args, **kwargs):
13599 """
13600 (Re)start the timer
13601 """
13602 self.hasRun = False
13603 if millis is not None:
13604 self.millis = millis
13605 if args or kwargs:
13606 self.SetArgs(*args, **kwargs)
13607 self.Stop()
13608 self.timer = wx.PyTimer(self.Notify)
13609 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13610 self.running = True
13611 Restart = Start
13612
13613
13614 def Stop(self):
13615 """
13616 Stop and destroy the timer.
13617 """
13618 if self.timer is not None:
13619 self.timer.Stop()
13620 self.timer = None
13621
13622
13623 def GetInterval(self):
13624 if self.timer is not None:
13625 return self.timer.GetInterval()
13626 else:
13627 return 0
13628
13629
13630 def IsRunning(self):
13631 return self.timer is not None and self.timer.IsRunning()
13632
13633
13634 def SetArgs(self, *args, **kwargs):
13635 """
13636 (Re)set the args passed to the callable object. This is
13637 useful in conjunction with Restart if you want to schedule a
13638 new call to the same callable object but with different
13639 parameters.
13640 """
13641 self.args = args
13642 self.kwargs = kwargs
13643
13644
13645 def HasRun(self):
13646 return self.hasRun
13647
13648 def GetResult(self):
13649 return self.result
13650
13651 def Notify(self):
13652 """
13653 The timer has expired so call the callable.
13654 """
13655 if self.callable and getattr(self.callable, 'im_self', True):
13656 self.runCount += 1
13657 self.running = False
13658 self.result = self.callable(*self.args, **self.kwargs)
13659 self.hasRun = True
13660 if not self.running:
13661 # if it wasn't restarted, then cleanup
13662 wx.CallAfter(self.Stop)
13663
13664
13665
13666#----------------------------------------------------------------------------
13667# Control which items in this module should be documented by epydoc.
13668# We allow only classes and functions, which will help reduce the size
13669# of the docs by filtering out the zillions of constants, EVT objects,
13670# and etc that don't make much sense by themselves, but are instead
13671# documented (or will be) as part of the classes/functions/methods
13672# where they should be used.
13673
c24da6d6
RD
13674class __DocFilter:
13675 """
13676 A filter for epydoc that only allows non-Ptr classes and
13677 fucntions, in order to reduce the clutter in the API docs.
13678 """
13679 def __init__(self, globals):
13680 self._globals = globals
13681
13682 def __call__(self, name):
13683 import types
13684 obj = self._globals.get(name, None)
13685 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13686 return False
13687 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
13688 return False
13689 return True
d55e5bfc
RD
13690
13691#----------------------------------------------------------------------------
13692#----------------------------------------------------------------------------
13693
13694# Import other modules in this package that should show up in the
13695# "core" wx namespace
13696from _gdi import *
13697from _windows import *
13698from _controls import *
13699from _misc import *
13700
13701
13702# Fixup the stock objects since they can't be used yet. (They will be
13703# restored in wx.PyApp.OnInit.)
13704_core_._wxPyFixStockObjects()
13705
13706#----------------------------------------------------------------------------
13707#----------------------------------------------------------------------------
13708
13709
7449af73 13710