]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/msw/_core.py
Compilation fix for Mac
[wxWidgets.git] / wxPython / src / msw / _core.py
CommitLineData
554f62e9 1# This file was created automatically by SWIG 1.3.29.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
4import _core_
554f62e9
RD
5import new
6new_instancemethod = new.instancemethod
093d3ff1 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
554f62e9 8 if (name == "thisown"): return self.this.own(value)
093d3ff1 9 if (name == "this"):
554f62e9
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
093d3ff1
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
554f62e9 15 if (not static) or hasattr(self,name):
093d3ff1
RD
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):
554f62e9 24 if (name == "thisown"): return self.this.own()
093d3ff1
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
554f62e9
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
093d3ff1
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
554f62e9
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
093d3ff1
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d55e5bfc
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
56_core_._wxPySetDictionary(vars())
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
c24da6d6
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
d55e5bfc
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
57133d5c 95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
d55e5bfc
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
d55e5bfc
RD
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
106RETAINED = _core_.RETAINED
107BACKINGSTORE = _core_.BACKINGSTORE
108COLOURED = _core_.COLOURED
109FIXED_LENGTH = _core_.FIXED_LENGTH
110LB_NEEDED_SB = _core_.LB_NEEDED_SB
111LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
112LB_SORT = _core_.LB_SORT
113LB_SINGLE = _core_.LB_SINGLE
114LB_MULTIPLE = _core_.LB_MULTIPLE
115LB_EXTENDED = _core_.LB_EXTENDED
116LB_OWNERDRAW = _core_.LB_OWNERDRAW
117LB_HSCROLL = _core_.LB_HSCROLL
118PROCESS_ENTER = _core_.PROCESS_ENTER
119PASSWORD = _core_.PASSWORD
120CB_SIMPLE = _core_.CB_SIMPLE
121CB_DROPDOWN = _core_.CB_DROPDOWN
122CB_SORT = _core_.CB_SORT
123CB_READONLY = _core_.CB_READONLY
124RA_HORIZONTAL = _core_.RA_HORIZONTAL
125RA_VERTICAL = _core_.RA_VERTICAL
126RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
127RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 128RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
d55e5bfc
RD
129RB_GROUP = _core_.RB_GROUP
130RB_SINGLE = _core_.RB_SINGLE
d55e5bfc
RD
131SB_HORIZONTAL = _core_.SB_HORIZONTAL
132SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 133RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
d55e5bfc
RD
134ST_SIZEGRIP = _core_.ST_SIZEGRIP
135ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
136ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
137ST_DOTS_END = _core_.ST_DOTS_END
d55e5bfc
RD
138FLOOD_SURFACE = _core_.FLOOD_SURFACE
139FLOOD_BORDER = _core_.FLOOD_BORDER
140ODDEVEN_RULE = _core_.ODDEVEN_RULE
141WINDING_RULE = _core_.WINDING_RULE
142TOOL_TOP = _core_.TOOL_TOP
143TOOL_BOTTOM = _core_.TOOL_BOTTOM
144TOOL_LEFT = _core_.TOOL_LEFT
145TOOL_RIGHT = _core_.TOOL_RIGHT
146OK = _core_.OK
147YES_NO = _core_.YES_NO
148CANCEL = _core_.CANCEL
149YES = _core_.YES
150NO = _core_.NO
151NO_DEFAULT = _core_.NO_DEFAULT
152YES_DEFAULT = _core_.YES_DEFAULT
153ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
154ICON_HAND = _core_.ICON_HAND
155ICON_QUESTION = _core_.ICON_QUESTION
156ICON_INFORMATION = _core_.ICON_INFORMATION
157ICON_STOP = _core_.ICON_STOP
158ICON_ASTERISK = _core_.ICON_ASTERISK
159ICON_MASK = _core_.ICON_MASK
160ICON_WARNING = _core_.ICON_WARNING
161ICON_ERROR = _core_.ICON_ERROR
162FORWARD = _core_.FORWARD
163BACKWARD = _core_.BACKWARD
164RESET = _core_.RESET
165HELP = _core_.HELP
166MORE = _core_.MORE
167SETUP = _core_.SETUP
168SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
169SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
170SIZE_AUTO = _core_.SIZE_AUTO
171SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
172SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
9d7dfdff 173SIZE_FORCE = _core_.SIZE_FORCE
d55e5bfc
RD
174PORTRAIT = _core_.PORTRAIT
175LANDSCAPE = _core_.LANDSCAPE
176PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
177PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
178PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
179PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
180ID_ANY = _core_.ID_ANY
181ID_SEPARATOR = _core_.ID_SEPARATOR
9d7dfdff 182ID_NONE = _core_.ID_NONE
d55e5bfc
RD
183ID_LOWEST = _core_.ID_LOWEST
184ID_OPEN = _core_.ID_OPEN
185ID_CLOSE = _core_.ID_CLOSE
186ID_NEW = _core_.ID_NEW
187ID_SAVE = _core_.ID_SAVE
188ID_SAVEAS = _core_.ID_SAVEAS
189ID_REVERT = _core_.ID_REVERT
190ID_EXIT = _core_.ID_EXIT
191ID_UNDO = _core_.ID_UNDO
192ID_REDO = _core_.ID_REDO
193ID_HELP = _core_.ID_HELP
194ID_PRINT = _core_.ID_PRINT
195ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
196ID_PREVIEW = _core_.ID_PREVIEW
197ID_ABOUT = _core_.ID_ABOUT
198ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
202ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
203ID_PREFERENCES = _core_.ID_PREFERENCES
204ID_CUT = _core_.ID_CUT
205ID_COPY = _core_.ID_COPY
206ID_PASTE = _core_.ID_PASTE
207ID_CLEAR = _core_.ID_CLEAR
208ID_FIND = _core_.ID_FIND
209ID_DUPLICATE = _core_.ID_DUPLICATE
210ID_SELECTALL = _core_.ID_SELECTALL
211ID_DELETE = _core_.ID_DELETE
212ID_REPLACE = _core_.ID_REPLACE
213ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214ID_PROPERTIES = _core_.ID_PROPERTIES
215ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218ID_VIEW_LIST = _core_.ID_VIEW_LIST
219ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
223ID_FILE1 = _core_.ID_FILE1
224ID_FILE2 = _core_.ID_FILE2
225ID_FILE3 = _core_.ID_FILE3
226ID_FILE4 = _core_.ID_FILE4
227ID_FILE5 = _core_.ID_FILE5
228ID_FILE6 = _core_.ID_FILE6
229ID_FILE7 = _core_.ID_FILE7
230ID_FILE8 = _core_.ID_FILE8
231ID_FILE9 = _core_.ID_FILE9
232ID_OK = _core_.ID_OK
233ID_CANCEL = _core_.ID_CANCEL
234ID_APPLY = _core_.ID_APPLY
235ID_YES = _core_.ID_YES
236ID_NO = _core_.ID_NO
237ID_STATIC = _core_.ID_STATIC
238ID_FORWARD = _core_.ID_FORWARD
239ID_BACKWARD = _core_.ID_BACKWARD
240ID_DEFAULT = _core_.ID_DEFAULT
241ID_MORE = _core_.ID_MORE
242ID_SETUP = _core_.ID_SETUP
243ID_RESET = _core_.ID_RESET
244ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
245ID_YESTOALL = _core_.ID_YESTOALL
246ID_NOTOALL = _core_.ID_NOTOALL
247ID_ABORT = _core_.ID_ABORT
248ID_RETRY = _core_.ID_RETRY
249ID_IGNORE = _core_.ID_IGNORE
0f63ec68
RD
250ID_ADD = _core_.ID_ADD
251ID_REMOVE = _core_.ID_REMOVE
252ID_UP = _core_.ID_UP
253ID_DOWN = _core_.ID_DOWN
254ID_HOME = _core_.ID_HOME
255ID_REFRESH = _core_.ID_REFRESH
256ID_STOP = _core_.ID_STOP
257ID_INDEX = _core_.ID_INDEX
258ID_BOLD = _core_.ID_BOLD
259ID_ITALIC = _core_.ID_ITALIC
260ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
261ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
262ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
263ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
264ID_UNDERLINE = _core_.ID_UNDERLINE
265ID_INDENT = _core_.ID_INDENT
266ID_UNINDENT = _core_.ID_UNINDENT
267ID_ZOOM_100 = _core_.ID_ZOOM_100
268ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
269ID_ZOOM_IN = _core_.ID_ZOOM_IN
270ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
271ID_UNDELETE = _core_.ID_UNDELETE
272ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
d55e5bfc 273ID_HIGHEST = _core_.ID_HIGHEST
d55e5bfc
RD
274ACCEL_ALT = _core_.ACCEL_ALT
275ACCEL_CTRL = _core_.ACCEL_CTRL
276ACCEL_SHIFT = _core_.ACCEL_SHIFT
277ACCEL_NORMAL = _core_.ACCEL_NORMAL
278PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
279PD_APP_MODAL = _core_.PD_APP_MODAL
280PD_CAN_ABORT = _core_.PD_CAN_ABORT
281PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
282PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
283PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
62d32a5f
RD
284PD_SMOOTH = _core_.PD_SMOOTH
285PD_CAN_SKIP = _core_.PD_CAN_SKIP
d55e5bfc
RD
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 """
554f62e9
RD
694 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
695 def __init__(self): raise AttributeError, "No constructor defined"
696 __repr__ = _swig_repr
d55e5bfc
RD
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 714
2131d850 715_core_.Object_swigregister(Object)
d55e5bfc 716_wxPySetDictionary = _core_._wxPySetDictionary
d55e5bfc
RD
717cvar = _core_.cvar
718EmptyString = cvar.EmptyString
719
720#---------------------------------------------------------------------------
721
722BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
723BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
724BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
725BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
726BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
727BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
728BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
729BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
730BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
731BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
732BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
733BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
734BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
735BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
736BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
737BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
738BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
739BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
740BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
741BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
742CURSOR_NONE = _core_.CURSOR_NONE
743CURSOR_ARROW = _core_.CURSOR_ARROW
744CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
745CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
746CURSOR_CHAR = _core_.CURSOR_CHAR
747CURSOR_CROSS = _core_.CURSOR_CROSS
748CURSOR_HAND = _core_.CURSOR_HAND
749CURSOR_IBEAM = _core_.CURSOR_IBEAM
750CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
751CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
752CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
753CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
754CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
755CURSOR_PENCIL = _core_.CURSOR_PENCIL
756CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
757CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
758CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
759CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
760CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
761CURSOR_SIZENS = _core_.CURSOR_SIZENS
762CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
763CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
764CURSOR_SIZING = _core_.CURSOR_SIZING
765CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
766CURSOR_WAIT = _core_.CURSOR_WAIT
767CURSOR_WATCH = _core_.CURSOR_WATCH
768CURSOR_BLANK = _core_.CURSOR_BLANK
769CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
770CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
771CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
772CURSOR_MAX = _core_.CURSOR_MAX
773#---------------------------------------------------------------------------
774
775class Size(object):
776 """
79fccf9d 777 wx.Size is a useful data structure used to represent the size of
554f62e9
RD
778 something. It simply contains integer width and height
779 properties. In most places in wxPython where a wx.Size is
093d3ff1 780 expected a (width, height) tuple can be used instead.
d55e5bfc 781 """
554f62e9
RD
782 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
783 __repr__ = _swig_repr
d55e5bfc
RD
784 width = property(_core_.Size_width_get, _core_.Size_width_set)
785 height = property(_core_.Size_height_get, _core_.Size_height_set)
786 x = width; y = height
554f62e9 787 def __init__(self, *args, **kwargs):
d55e5bfc
RD
788 """
789 __init__(self, int w=0, int h=0) -> Size
790
791 Creates a size object.
792 """
554f62e9
RD
793 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
794 __swig_destroy__ = _core_.delete_Size
795 __del__ = lambda self : None;
d55e5bfc
RD
796 def __eq__(*args, **kwargs):
797 """
e9d6f3a4 798 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
799
800 Test for equality of wx.Size objects.
801 """
802 return _core_.Size___eq__(*args, **kwargs)
803
804 def __ne__(*args, **kwargs):
805 """
e9d6f3a4 806 __ne__(self, PyObject other) -> bool
d55e5bfc 807
e9d6f3a4 808 Test for inequality of wx.Size objects.
d55e5bfc
RD
809 """
810 return _core_.Size___ne__(*args, **kwargs)
811
812 def __add__(*args, **kwargs):
813 """
814 __add__(self, Size sz) -> Size
815
816 Add sz's proprties to this and return the result.
817 """
818 return _core_.Size___add__(*args, **kwargs)
819
820 def __sub__(*args, **kwargs):
821 """
822 __sub__(self, Size sz) -> Size
823
824 Subtract sz's properties from this and return the result.
825 """
826 return _core_.Size___sub__(*args, **kwargs)
827
828 def IncTo(*args, **kwargs):
829 """
830 IncTo(self, Size sz)
831
832 Increments this object so that both of its dimensions are not less
833 than the corresponding dimensions of the size.
834 """
835 return _core_.Size_IncTo(*args, **kwargs)
836
837 def DecTo(*args, **kwargs):
838 """
839 DecTo(self, Size sz)
840
841 Decrements this object so that both of its dimensions are not greater
842 than the corresponding dimensions of the size.
843 """
844 return _core_.Size_DecTo(*args, **kwargs)
845
846 def Set(*args, **kwargs):
847 """
848 Set(self, int w, int h)
849
850 Set both width and height.
851 """
852 return _core_.Size_Set(*args, **kwargs)
853
854 def SetWidth(*args, **kwargs):
855 """SetWidth(self, int w)"""
856 return _core_.Size_SetWidth(*args, **kwargs)
857
858 def SetHeight(*args, **kwargs):
859 """SetHeight(self, int h)"""
860 return _core_.Size_SetHeight(*args, **kwargs)
861
862 def GetWidth(*args, **kwargs):
863 """GetWidth(self) -> int"""
864 return _core_.Size_GetWidth(*args, **kwargs)
865
866 def GetHeight(*args, **kwargs):
867 """GetHeight(self) -> int"""
868 return _core_.Size_GetHeight(*args, **kwargs)
869
870 def IsFullySpecified(*args, **kwargs):
871 """
872 IsFullySpecified(self) -> bool
873
874 Returns True if both components of the size are non-default values.
875 """
876 return _core_.Size_IsFullySpecified(*args, **kwargs)
877
878 def SetDefaults(*args, **kwargs):
879 """
880 SetDefaults(self, Size size)
881
79fccf9d
RD
882 Combine this size with the other one replacing the default components
883 of this object (i.e. equal to -1) with those of the other.
d55e5bfc
RD
884 """
885 return _core_.Size_SetDefaults(*args, **kwargs)
886
887 def Get(*args, **kwargs):
888 """
889 Get() -> (width,height)
890
891 Returns the width and height properties as a tuple.
892 """
893 return _core_.Size_Get(*args, **kwargs)
894
79fccf9d 895 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
896 def __str__(self): return str(self.Get())
897 def __repr__(self): return 'wx.Size'+str(self.Get())
898 def __len__(self): return len(self.Get())
899 def __getitem__(self, index): return self.Get()[index]
900 def __setitem__(self, index, val):
901 if index == 0: self.width = val
902 elif index == 1: self.height = val
903 else: raise IndexError
904 def __nonzero__(self): return self.Get() != (0,0)
905 __safe_for_unpickling__ = True
906 def __reduce__(self): return (wx.Size, self.Get())
907
2131d850 908_core_.Size_swigregister(Size)
d55e5bfc
RD
909
910#---------------------------------------------------------------------------
911
912class RealPoint(object):
913 """
79fccf9d
RD
914 A data structure for representing a point or position with floating
915 point x and y properties. In wxPython most places that expect a
916 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 917 """
554f62e9
RD
918 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
919 __repr__ = _swig_repr
d55e5bfc
RD
920 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
921 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
554f62e9 922 def __init__(self, *args, **kwargs):
d55e5bfc
RD
923 """
924 __init__(self, double x=0.0, double y=0.0) -> RealPoint
925
926 Create a wx.RealPoint object
927 """
554f62e9
RD
928 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
929 __swig_destroy__ = _core_.delete_RealPoint
930 __del__ = lambda self : None;
d55e5bfc
RD
931 def __eq__(*args, **kwargs):
932 """
e9d6f3a4 933 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
934
935 Test for equality of wx.RealPoint objects.
936 """
937 return _core_.RealPoint___eq__(*args, **kwargs)
938
939 def __ne__(*args, **kwargs):
940 """
e9d6f3a4 941 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
942
943 Test for inequality of wx.RealPoint objects.
944 """
945 return _core_.RealPoint___ne__(*args, **kwargs)
946
947 def __add__(*args, **kwargs):
948 """
949 __add__(self, RealPoint pt) -> RealPoint
950
951 Add pt's proprties to this and return the result.
952 """
953 return _core_.RealPoint___add__(*args, **kwargs)
954
955 def __sub__(*args, **kwargs):
956 """
957 __sub__(self, RealPoint pt) -> RealPoint
958
959 Subtract pt's proprties from this and return the result
960 """
961 return _core_.RealPoint___sub__(*args, **kwargs)
962
963 def Set(*args, **kwargs):
964 """
965 Set(self, double x, double y)
966
967 Set both the x and y properties
968 """
969 return _core_.RealPoint_Set(*args, **kwargs)
970
971 def Get(*args, **kwargs):
972 """
973 Get() -> (x,y)
974
975 Return the x and y properties as a tuple.
976 """
977 return _core_.RealPoint_Get(*args, **kwargs)
978
79fccf9d 979 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
980 def __str__(self): return str(self.Get())
981 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
982 def __len__(self): return len(self.Get())
983 def __getitem__(self, index): return self.Get()[index]
984 def __setitem__(self, index, val):
985 if index == 0: self.x = val
986 elif index == 1: self.y = val
987 else: raise IndexError
988 def __nonzero__(self): return self.Get() != (0.0, 0.0)
989 __safe_for_unpickling__ = True
990 def __reduce__(self): return (wx.RealPoint, self.Get())
991
2131d850 992_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
993
994#---------------------------------------------------------------------------
995
996class Point(object):
997 """
79fccf9d
RD
998 A data structure for representing a point or position with integer x
999 and y properties. Most places in wxPython that expect a wx.Point can
1000 also accept a (x,y) tuple.
d55e5bfc 1001 """
554f62e9
RD
1002 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1003 __repr__ = _swig_repr
d55e5bfc
RD
1004 x = property(_core_.Point_x_get, _core_.Point_x_set)
1005 y = property(_core_.Point_y_get, _core_.Point_y_set)
554f62e9 1006 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1007 """
1008 __init__(self, int x=0, int y=0) -> Point
1009
1010 Create a wx.Point object
1011 """
554f62e9
RD
1012 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1013 __swig_destroy__ = _core_.delete_Point
1014 __del__ = lambda self : None;
d55e5bfc
RD
1015 def __eq__(*args, **kwargs):
1016 """
e9d6f3a4 1017 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1018
1019 Test for equality of wx.Point objects.
1020 """
1021 return _core_.Point___eq__(*args, **kwargs)
1022
1023 def __ne__(*args, **kwargs):
1024 """
e9d6f3a4 1025 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1026
1027 Test for inequality of wx.Point objects.
1028 """
1029 return _core_.Point___ne__(*args, **kwargs)
1030
1031 def __add__(*args, **kwargs):
1032 """
1033 __add__(self, Point pt) -> Point
1034
1035 Add pt's proprties to this and return the result.
1036 """
1037 return _core_.Point___add__(*args, **kwargs)
1038
1039 def __sub__(*args, **kwargs):
1040 """
1041 __sub__(self, Point pt) -> Point
1042
1043 Subtract pt's proprties from this and return the result
1044 """
1045 return _core_.Point___sub__(*args, **kwargs)
1046
1047 def __iadd__(*args, **kwargs):
1048 """
1049 __iadd__(self, Point pt) -> Point
1050
1051 Add pt to this object.
1052 """
1053 return _core_.Point___iadd__(*args, **kwargs)
1054
1055 def __isub__(*args, **kwargs):
1056 """
1057 __isub__(self, Point pt) -> Point
1058
1059 Subtract pt from this object.
1060 """
1061 return _core_.Point___isub__(*args, **kwargs)
1062
1063 def Set(*args, **kwargs):
1064 """
1065 Set(self, long x, long y)
1066
1067 Set both the x and y properties
1068 """
1069 return _core_.Point_Set(*args, **kwargs)
1070
1071 def Get(*args, **kwargs):
1072 """
1073 Get() -> (x,y)
1074
1075 Return the x and y properties as a tuple.
1076 """
1077 return _core_.Point_Get(*args, **kwargs)
1078
79fccf9d 1079 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1080 def __str__(self): return str(self.Get())
1081 def __repr__(self): return 'wx.Point'+str(self.Get())
1082 def __len__(self): return len(self.Get())
1083 def __getitem__(self, index): return self.Get()[index]
1084 def __setitem__(self, index, val):
1085 if index == 0: self.x = val
1086 elif index == 1: self.y = val
1087 else: raise IndexError
1088 def __nonzero__(self): return self.Get() != (0,0)
1089 __safe_for_unpickling__ = True
1090 def __reduce__(self): return (wx.Point, self.Get())
1091
2131d850 1092_core_.Point_swigregister(Point)
d55e5bfc
RD
1093
1094#---------------------------------------------------------------------------
1095
1096class Rect(object):
1097 """
79fccf9d
RD
1098 A class for representing and manipulating rectangles. It has x, y,
1099 width and height properties. In wxPython most palces that expect a
1100 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1101 """
554f62e9
RD
1102 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1103 __repr__ = _swig_repr
1104 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1105 """
1106 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1107
1108 Create a new Rect object.
1109 """
554f62e9
RD
1110 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1111 __swig_destroy__ = _core_.delete_Rect
1112 __del__ = lambda self : None;
d55e5bfc
RD
1113 def GetX(*args, **kwargs):
1114 """GetX(self) -> int"""
1115 return _core_.Rect_GetX(*args, **kwargs)
1116
1117 def SetX(*args, **kwargs):
1118 """SetX(self, int x)"""
1119 return _core_.Rect_SetX(*args, **kwargs)
1120
1121 def GetY(*args, **kwargs):
1122 """GetY(self) -> int"""
1123 return _core_.Rect_GetY(*args, **kwargs)
1124
1125 def SetY(*args, **kwargs):
1126 """SetY(self, int y)"""
1127 return _core_.Rect_SetY(*args, **kwargs)
1128
1129 def GetWidth(*args, **kwargs):
1130 """GetWidth(self) -> int"""
1131 return _core_.Rect_GetWidth(*args, **kwargs)
1132
1133 def SetWidth(*args, **kwargs):
1134 """SetWidth(self, int w)"""
1135 return _core_.Rect_SetWidth(*args, **kwargs)
1136
1137 def GetHeight(*args, **kwargs):
1138 """GetHeight(self) -> int"""
1139 return _core_.Rect_GetHeight(*args, **kwargs)
1140
1141 def SetHeight(*args, **kwargs):
1142 """SetHeight(self, int h)"""
1143 return _core_.Rect_SetHeight(*args, **kwargs)
1144
1145 def GetPosition(*args, **kwargs):
1146 """GetPosition(self) -> Point"""
1147 return _core_.Rect_GetPosition(*args, **kwargs)
1148
1149 def SetPosition(*args, **kwargs):
1150 """SetPosition(self, Point p)"""
1151 return _core_.Rect_SetPosition(*args, **kwargs)
1152
1153 def GetSize(*args, **kwargs):
1154 """GetSize(self) -> Size"""
1155 return _core_.Rect_GetSize(*args, **kwargs)
1156
1157 def SetSize(*args, **kwargs):
1158 """SetSize(self, Size s)"""
1159 return _core_.Rect_SetSize(*args, **kwargs)
1160
aff4cc5c
RD
1161 def IsEmpty(*args, **kwargs):
1162 """IsEmpty(self) -> bool"""
1163 return _core_.Rect_IsEmpty(*args, **kwargs)
1164
d55e5bfc
RD
1165 def GetTopLeft(*args, **kwargs):
1166 """GetTopLeft(self) -> Point"""
1167 return _core_.Rect_GetTopLeft(*args, **kwargs)
1168
1169 def SetTopLeft(*args, **kwargs):
1170 """SetTopLeft(self, Point p)"""
1171 return _core_.Rect_SetTopLeft(*args, **kwargs)
1172
1173 def GetBottomRight(*args, **kwargs):
1174 """GetBottomRight(self) -> Point"""
1175 return _core_.Rect_GetBottomRight(*args, **kwargs)
1176
1177 def SetBottomRight(*args, **kwargs):
1178 """SetBottomRight(self, Point p)"""
1179 return _core_.Rect_SetBottomRight(*args, **kwargs)
1180
1181 def GetLeft(*args, **kwargs):
1182 """GetLeft(self) -> int"""
1183 return _core_.Rect_GetLeft(*args, **kwargs)
1184
1185 def GetTop(*args, **kwargs):
1186 """GetTop(self) -> int"""
1187 return _core_.Rect_GetTop(*args, **kwargs)
1188
1189 def GetBottom(*args, **kwargs):
1190 """GetBottom(self) -> int"""
1191 return _core_.Rect_GetBottom(*args, **kwargs)
1192
1193 def GetRight(*args, **kwargs):
1194 """GetRight(self) -> int"""
1195 return _core_.Rect_GetRight(*args, **kwargs)
1196
1197 def SetLeft(*args, **kwargs):
1198 """SetLeft(self, int left)"""
1199 return _core_.Rect_SetLeft(*args, **kwargs)
1200
1201 def SetRight(*args, **kwargs):
1202 """SetRight(self, int right)"""
1203 return _core_.Rect_SetRight(*args, **kwargs)
1204
1205 def SetTop(*args, **kwargs):
1206 """SetTop(self, int top)"""
1207 return _core_.Rect_SetTop(*args, **kwargs)
1208
1209 def SetBottom(*args, **kwargs):
1210 """SetBottom(self, int bottom)"""
1211 return _core_.Rect_SetBottom(*args, **kwargs)
1212
1213 position = property(GetPosition, SetPosition)
1214 size = property(GetSize, SetSize)
1215 left = property(GetLeft, SetLeft)
1216 right = property(GetRight, SetRight)
1217 top = property(GetTop, SetTop)
1218 bottom = property(GetBottom, SetBottom)
1219
1220 def Inflate(*args, **kwargs):
1221 """
1222 Inflate(self, int dx, int dy) -> Rect
1223
091fdbfa
RD
1224 Increases the size of the rectangle.
1225
1226 The left border is moved farther left and the right border is moved
1227 farther right by ``dx``. The upper border is moved farther up and the
1228 bottom border is moved farther down by ``dy``. (Note the the width and
1229 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1230 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1231 opposite happens: the rectangle size decreases in the respective
1232 direction.
1233
1234 The change is made to the rectangle inplace, if instead you need a
1235 copy that is inflated, preserving the original then make the copy
1236 first::
1237
1238 copy = wx.Rect(*original)
1239 copy.Inflate(10,15)
1240
1241
d55e5bfc
RD
1242 """
1243 return _core_.Rect_Inflate(*args, **kwargs)
1244
1245 def Deflate(*args, **kwargs):
1246 """
1247 Deflate(self, int dx, int dy) -> Rect
1248
091fdbfa
RD
1249 Decrease the rectangle size. This method is the opposite of `Inflate`
1250 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1251 `Inflate` for a full description.
d55e5bfc
RD
1252 """
1253 return _core_.Rect_Deflate(*args, **kwargs)
1254
1255 def OffsetXY(*args, **kwargs):
1256 """
1257 OffsetXY(self, int dx, int dy)
1258
79fccf9d
RD
1259 Moves the rectangle by the specified offset. If dx is positive, the
1260 rectangle is moved to the right, if dy is positive, it is moved to the
1261 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc
RD
1262 """
1263 return _core_.Rect_OffsetXY(*args, **kwargs)
1264
1265 def Offset(*args, **kwargs):
1266 """
1267 Offset(self, Point pt)
1268
b1fcee84 1269 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc
RD
1270 """
1271 return _core_.Rect_Offset(*args, **kwargs)
1272
1273 def Intersect(*args, **kwargs):
1274 """
1275 Intersect(self, Rect rect) -> Rect
1276
b519803b 1277 Returns the intersectsion of this rectangle and rect.
d55e5bfc
RD
1278 """
1279 return _core_.Rect_Intersect(*args, **kwargs)
1280
b519803b
RD
1281 def Union(*args, **kwargs):
1282 """
1283 Union(self, Rect rect) -> Rect
1284
1285 Returns the union of this rectangle and rect.
1286 """
1287 return _core_.Rect_Union(*args, **kwargs)
1288
d55e5bfc
RD
1289 def __add__(*args, **kwargs):
1290 """
1291 __add__(self, Rect rect) -> Rect
1292
1293 Add the properties of rect to this rectangle and return the result.
1294 """
1295 return _core_.Rect___add__(*args, **kwargs)
1296
1297 def __iadd__(*args, **kwargs):
1298 """
1299 __iadd__(self, Rect rect) -> Rect
1300
1301 Add the properties of rect to this rectangle, updating this rectangle.
1302 """
1303 return _core_.Rect___iadd__(*args, **kwargs)
1304
1305 def __eq__(*args, **kwargs):
1306 """
e9d6f3a4 1307 __eq__(self, PyObject other) -> bool
d55e5bfc 1308
e9d6f3a4 1309 Test for equality of wx.Rect objects.
d55e5bfc
RD
1310 """
1311 return _core_.Rect___eq__(*args, **kwargs)
1312
1313 def __ne__(*args, **kwargs):
1314 """
e9d6f3a4 1315 __ne__(self, PyObject other) -> bool
d55e5bfc 1316
e9d6f3a4 1317 Test for inequality of wx.Rect objects.
d55e5bfc
RD
1318 """
1319 return _core_.Rect___ne__(*args, **kwargs)
1320
1321 def InsideXY(*args, **kwargs):
1322 """
1323 InsideXY(self, int x, int y) -> bool
1324
1325 Return True if the point is (not strcitly) inside the rect.
1326 """
1327 return _core_.Rect_InsideXY(*args, **kwargs)
1328
1329 def Inside(*args, **kwargs):
1330 """
1331 Inside(self, Point pt) -> bool
1332
1333 Return True if the point is (not strcitly) inside the rect.
1334 """
1335 return _core_.Rect_Inside(*args, **kwargs)
1336
1337 def Intersects(*args, **kwargs):
1338 """
1339 Intersects(self, Rect rect) -> bool
1340
1341 Returns True if the rectangles have a non empty intersection.
1342 """
1343 return _core_.Rect_Intersects(*args, **kwargs)
1344
b1fcee84
RD
1345 def CenterIn(*args, **kwargs):
1346 """
1347 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1348
1349 Center this rectangle within the one passed to the method, which is
1350 usually, but not necessarily, the larger one.
1351 """
1352 return _core_.Rect_CenterIn(*args, **kwargs)
1353
1354 CentreIn = CenterIn
d55e5bfc
RD
1355 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1356 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1357 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1358 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1359 def Set(*args, **kwargs):
1360 """
1361 Set(self, int x=0, int y=0, int width=0, int height=0)
1362
1363 Set all rectangle properties.
1364 """
1365 return _core_.Rect_Set(*args, **kwargs)
1366
1367 def Get(*args, **kwargs):
1368 """
1369 Get() -> (x,y,width,height)
1370
1371 Return the rectangle properties as a tuple.
1372 """
1373 return _core_.Rect_Get(*args, **kwargs)
1374
79fccf9d 1375 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1376 def __str__(self): return str(self.Get())
1377 def __repr__(self): return 'wx.Rect'+str(self.Get())
1378 def __len__(self): return len(self.Get())
1379 def __getitem__(self, index): return self.Get()[index]
1380 def __setitem__(self, index, val):
1381 if index == 0: self.x = val
1382 elif index == 1: self.y = val
1383 elif index == 2: self.width = val
1384 elif index == 3: self.height = val
1385 else: raise IndexError
1386 def __nonzero__(self): return self.Get() != (0,0,0,0)
1387 __safe_for_unpickling__ = True
1388 def __reduce__(self): return (wx.Rect, self.Get())
1389
2131d850 1390_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1391
1392def RectPP(*args, **kwargs):
1393 """
1394 RectPP(Point topLeft, Point bottomRight) -> Rect
1395
1396 Create a new Rect object from Points representing two corners.
1397 """
1398 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1399 return val
1400
1401def RectPS(*args, **kwargs):
1402 """
1403 RectPS(Point pos, Size size) -> Rect
1404
1405 Create a new Rect from a position and size.
1406 """
1407 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1408 return val
1409
c1cb24a4
RD
1410def RectS(*args, **kwargs):
1411 """
1412 RectS(Size size) -> Rect
1413
1414 Create a new Rect from a size only.
1415 """
1416 val = _core_.new_RectS(*args, **kwargs)
c1cb24a4
RD
1417 return val
1418
d55e5bfc
RD
1419
1420def IntersectRect(*args, **kwargs):
554f62e9 1421 """
d55e5bfc
RD
1422 IntersectRect(Rect r1, Rect r2) -> Rect
1423
1424 Calculate and return the intersection of r1 and r2.
1425 """
554f62e9 1426 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1427#---------------------------------------------------------------------------
1428
1429class Point2D(object):
79fccf9d
RD
1430 """
1431 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1432 with floating point values.
1433 """
554f62e9
RD
1434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1435 __repr__ = _swig_repr
1436 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1437 """
1438 __init__(self, double x=0.0, double y=0.0) -> Point2D
1439
1440 Create a w.Point2D object.
1441 """
554f62e9 1442 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
d55e5bfc 1443 def GetFloor(*args, **kwargs):
a8eff060
RD
1444 """
1445 GetFloor() -> (x,y)
1446
1447 Convert to integer
1448 """
d55e5bfc
RD
1449 return _core_.Point2D_GetFloor(*args, **kwargs)
1450
1451 def GetRounded(*args, **kwargs):
a8eff060
RD
1452 """
1453 GetRounded() -> (x,y)
1454
1455 Convert to integer
1456 """
d55e5bfc
RD
1457 return _core_.Point2D_GetRounded(*args, **kwargs)
1458
1459 def GetVectorLength(*args, **kwargs):
1460 """GetVectorLength(self) -> double"""
1461 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1462
1463 def GetVectorAngle(*args, **kwargs):
1464 """GetVectorAngle(self) -> double"""
1465 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1466
1467 def SetVectorLength(*args, **kwargs):
1468 """SetVectorLength(self, double length)"""
1469 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1470
1471 def SetVectorAngle(*args, **kwargs):
1472 """SetVectorAngle(self, double degrees)"""
1473 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1474
1475 def SetPolarCoordinates(self, angle, length):
1476 self.SetVectorLength(length)
1477 self.SetVectorAngle(angle)
1478 def Normalize(self):
1479 self.SetVectorLength(1.0)
1480
1481 def GetDistance(*args, **kwargs):
1482 """GetDistance(self, Point2D pt) -> double"""
1483 return _core_.Point2D_GetDistance(*args, **kwargs)
1484
1485 def GetDistanceSquare(*args, **kwargs):
1486 """GetDistanceSquare(self, Point2D pt) -> double"""
1487 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1488
1489 def GetDotProduct(*args, **kwargs):
1490 """GetDotProduct(self, Point2D vec) -> double"""
1491 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1492
1493 def GetCrossProduct(*args, **kwargs):
1494 """GetCrossProduct(self, Point2D vec) -> double"""
1495 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1496
1497 def __neg__(*args, **kwargs):
1498 """
1499 __neg__(self) -> Point2D
1500
1501 the reflection of this point
1502 """
1503 return _core_.Point2D___neg__(*args, **kwargs)
1504
1505 def __iadd__(*args, **kwargs):
1506 """__iadd__(self, Point2D pt) -> Point2D"""
1507 return _core_.Point2D___iadd__(*args, **kwargs)
1508
1509 def __isub__(*args, **kwargs):
1510 """__isub__(self, Point2D pt) -> Point2D"""
1511 return _core_.Point2D___isub__(*args, **kwargs)
1512
1513 def __imul__(*args, **kwargs):
1514 """__imul__(self, Point2D pt) -> Point2D"""
1515 return _core_.Point2D___imul__(*args, **kwargs)
1516
1517 def __idiv__(*args, **kwargs):
1518 """__idiv__(self, Point2D pt) -> Point2D"""
1519 return _core_.Point2D___idiv__(*args, **kwargs)
1520
1521 def __eq__(*args, **kwargs):
1522 """
e9d6f3a4 1523 __eq__(self, PyObject other) -> bool
d55e5bfc 1524
e9d6f3a4 1525 Test for equality of wx.Point2D objects.
d55e5bfc
RD
1526 """
1527 return _core_.Point2D___eq__(*args, **kwargs)
1528
1529 def __ne__(*args, **kwargs):
1530 """
e9d6f3a4 1531 __ne__(self, PyObject other) -> bool
d55e5bfc 1532
e9d6f3a4 1533 Test for inequality of wx.Point2D objects.
d55e5bfc
RD
1534 """
1535 return _core_.Point2D___ne__(*args, **kwargs)
1536
1537 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1538 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1539 def Set(*args, **kwargs):
1540 """Set(self, double x=0, double y=0)"""
1541 return _core_.Point2D_Set(*args, **kwargs)
1542
1543 def Get(*args, **kwargs):
1544 """
1545 Get() -> (x,y)
1546
1547 Return x and y properties as a tuple.
1548 """
1549 return _core_.Point2D_Get(*args, **kwargs)
1550
79fccf9d 1551 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1552 def __str__(self): return str(self.Get())
1553 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1554 def __len__(self): return len(self.Get())
1555 def __getitem__(self, index): return self.Get()[index]
1556 def __setitem__(self, index, val):
1557 if index == 0: self.x = val
1558 elif index == 1: self.y = val
1559 else: raise IndexError
1560 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1561 __safe_for_unpickling__ = True
1562 def __reduce__(self): return (wx.Point2D, self.Get())
1563
2131d850 1564_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1565
1566def Point2DCopy(*args, **kwargs):
1567 """
1568 Point2DCopy(Point2D pt) -> Point2D
1569
1570 Create a w.Point2D object.
1571 """
1572 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1573 return val
1574
1575def Point2DFromPoint(*args, **kwargs):
1576 """
1577 Point2DFromPoint(Point pt) -> Point2D
1578
1579 Create a w.Point2D object.
1580 """
1581 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1582 return val
1583
1584#---------------------------------------------------------------------------
1585
1586FromStart = _core_.FromStart
1587FromCurrent = _core_.FromCurrent
1588FromEnd = _core_.FromEnd
1589class InputStream(object):
093d3ff1 1590 """Proxy of C++ InputStream class"""
554f62e9
RD
1591 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1592 __repr__ = _swig_repr
1593 def __init__(self, *args, **kwargs):
d55e5bfc 1594 """__init__(self, PyObject p) -> InputStream"""
554f62e9
RD
1595 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1596 __swig_destroy__ = _core_.delete_InputStream
1597 __del__ = lambda self : None;
d55e5bfc
RD
1598 def close(*args, **kwargs):
1599 """close(self)"""
1600 return _core_.InputStream_close(*args, **kwargs)
1601
1602 def flush(*args, **kwargs):
1603 """flush(self)"""
1604 return _core_.InputStream_flush(*args, **kwargs)
1605
1606 def eof(*args, **kwargs):
1607 """eof(self) -> bool"""
1608 return _core_.InputStream_eof(*args, **kwargs)
1609
1610 def read(*args, **kwargs):
1611 """read(self, int size=-1) -> PyObject"""
1612 return _core_.InputStream_read(*args, **kwargs)
1613
1614 def readline(*args, **kwargs):
1615 """readline(self, int size=-1) -> PyObject"""
1616 return _core_.InputStream_readline(*args, **kwargs)
1617
1618 def readlines(*args, **kwargs):
1619 """readlines(self, int sizehint=-1) -> PyObject"""
1620 return _core_.InputStream_readlines(*args, **kwargs)
1621
1622 def seek(*args, **kwargs):
1623 """seek(self, int offset, int whence=0)"""
1624 return _core_.InputStream_seek(*args, **kwargs)
1625
1626 def tell(*args, **kwargs):
1627 """tell(self) -> int"""
1628 return _core_.InputStream_tell(*args, **kwargs)
1629
1630 def Peek(*args, **kwargs):
1631 """Peek(self) -> char"""
1632 return _core_.InputStream_Peek(*args, **kwargs)
1633
1634 def GetC(*args, **kwargs):
1635 """GetC(self) -> char"""
1636 return _core_.InputStream_GetC(*args, **kwargs)
1637
1638 def LastRead(*args, **kwargs):
1639 """LastRead(self) -> size_t"""
1640 return _core_.InputStream_LastRead(*args, **kwargs)
1641
1642 def CanRead(*args, **kwargs):
1643 """CanRead(self) -> bool"""
1644 return _core_.InputStream_CanRead(*args, **kwargs)
1645
1646 def Eof(*args, **kwargs):
1647 """Eof(self) -> bool"""
1648 return _core_.InputStream_Eof(*args, **kwargs)
1649
1650 def Ungetch(*args, **kwargs):
1651 """Ungetch(self, char c) -> bool"""
1652 return _core_.InputStream_Ungetch(*args, **kwargs)
1653
1654 def SeekI(*args, **kwargs):
1655 """SeekI(self, long pos, int mode=FromStart) -> long"""
1656 return _core_.InputStream_SeekI(*args, **kwargs)
1657
1658 def TellI(*args, **kwargs):
1659 """TellI(self) -> long"""
1660 return _core_.InputStream_TellI(*args, **kwargs)
1661
2131d850 1662_core_.InputStream_swigregister(InputStream)
d55e5bfc
RD
1663DefaultPosition = cvar.DefaultPosition
1664DefaultSize = cvar.DefaultSize
1665
1666class OutputStream(object):
093d3ff1 1667 """Proxy of C++ OutputStream class"""
554f62e9
RD
1668 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1669 def __init__(self): raise AttributeError, "No constructor defined"
1670 __repr__ = _swig_repr
d55e5bfc
RD
1671 def write(*args, **kwargs):
1672 """write(self, PyObject obj)"""
1673 return _core_.OutputStream_write(*args, **kwargs)
1674
554f62e9
RD
1675 def LastWrite(*args, **kwargs):
1676 """LastWrite(self) -> size_t"""
1677 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1678
2131d850 1679_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1680
1681#---------------------------------------------------------------------------
1682
1683class FSFile(Object):
093d3ff1 1684 """Proxy of C++ FSFile class"""
554f62e9
RD
1685 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1686 __repr__ = _swig_repr
1687 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1688 """
1689 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1690 DateTime modif) -> FSFile
1691 """
554f62e9 1692 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
e2950dbb 1693 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1694
554f62e9
RD
1695 __swig_destroy__ = _core_.delete_FSFile
1696 __del__ = lambda self : None;
d55e5bfc
RD
1697 def GetStream(*args, **kwargs):
1698 """GetStream(self) -> InputStream"""
1699 return _core_.FSFile_GetStream(*args, **kwargs)
1700
1701 def GetMimeType(*args, **kwargs):
1702 """GetMimeType(self) -> String"""
1703 return _core_.FSFile_GetMimeType(*args, **kwargs)
1704
1705 def GetLocation(*args, **kwargs):
1706 """GetLocation(self) -> String"""
1707 return _core_.FSFile_GetLocation(*args, **kwargs)
1708
1709 def GetAnchor(*args, **kwargs):
1710 """GetAnchor(self) -> String"""
1711 return _core_.FSFile_GetAnchor(*args, **kwargs)
1712
1713 def GetModificationTime(*args, **kwargs):
1714 """GetModificationTime(self) -> DateTime"""
1715 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1716
2131d850 1717_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1718
1719class CPPFileSystemHandler(object):
093d3ff1 1720 """Proxy of C++ CPPFileSystemHandler class"""
554f62e9
RD
1721 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1722 def __init__(self): raise AttributeError, "No constructor defined"
1723 __repr__ = _swig_repr
50f151d7
RD
1724 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1725 __del__ = lambda self : None;
2131d850 1726_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1727
1728class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1729 """Proxy of C++ FileSystemHandler class"""
554f62e9
RD
1730 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1731 __repr__ = _swig_repr
1732 def __init__(self, *args, **kwargs):
d55e5bfc 1733 """__init__(self) -> FileSystemHandler"""
554f62e9 1734 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1735 self._setCallbackInfo(self, FileSystemHandler)
1736
1737 def _setCallbackInfo(*args, **kwargs):
1738 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1739 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1740
1741 def CanOpen(*args, **kwargs):
1742 """CanOpen(self, String location) -> bool"""
1743 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1744
1745 def OpenFile(*args, **kwargs):
1746 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1747 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1748
1749 def FindFirst(*args, **kwargs):
1750 """FindFirst(self, String spec, int flags=0) -> String"""
1751 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1752
1753 def FindNext(*args, **kwargs):
1754 """FindNext(self) -> String"""
1755 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1756
1757 def GetProtocol(*args, **kwargs):
1758 """GetProtocol(self, String location) -> String"""
1759 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1760
1761 def GetLeftLocation(*args, **kwargs):
1762 """GetLeftLocation(self, String location) -> String"""
1763 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1764
1765 def GetAnchor(*args, **kwargs):
1766 """GetAnchor(self, String location) -> String"""
1767 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1768
1769 def GetRightLocation(*args, **kwargs):
1770 """GetRightLocation(self, String location) -> String"""
1771 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1772
1773 def GetMimeTypeFromExt(*args, **kwargs):
1774 """GetMimeTypeFromExt(self, String location) -> String"""
1775 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1776
2131d850 1777_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc
RD
1778
1779class FileSystem(Object):
093d3ff1 1780 """Proxy of C++ FileSystem class"""
554f62e9
RD
1781 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1782 __repr__ = _swig_repr
1783 def __init__(self, *args, **kwargs):
d55e5bfc 1784 """__init__(self) -> FileSystem"""
554f62e9
RD
1785 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1786 __swig_destroy__ = _core_.delete_FileSystem
1787 __del__ = lambda self : None;
d55e5bfc
RD
1788 def ChangePathTo(*args, **kwargs):
1789 """ChangePathTo(self, String location, bool is_dir=False)"""
1790 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1791
1792 def GetPath(*args, **kwargs):
1793 """GetPath(self) -> String"""
1794 return _core_.FileSystem_GetPath(*args, **kwargs)
1795
1796 def OpenFile(*args, **kwargs):
1797 """OpenFile(self, String location) -> FSFile"""
1798 return _core_.FileSystem_OpenFile(*args, **kwargs)
1799
1800 def FindFirst(*args, **kwargs):
1801 """FindFirst(self, String spec, int flags=0) -> String"""
1802 return _core_.FileSystem_FindFirst(*args, **kwargs)
1803
1804 def FindNext(*args, **kwargs):
1805 """FindNext(self) -> String"""
1806 return _core_.FileSystem_FindNext(*args, **kwargs)
1807
1808 def AddHandler(*args, **kwargs):
c24da6d6 1809 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
1810 return _core_.FileSystem_AddHandler(*args, **kwargs)
1811
1812 AddHandler = staticmethod(AddHandler)
1813 def CleanUpHandlers(*args, **kwargs):
c24da6d6 1814 """CleanUpHandlers()"""
d55e5bfc
RD
1815 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1816
1817 CleanUpHandlers = staticmethod(CleanUpHandlers)
1818 def FileNameToURL(*args, **kwargs):
c24da6d6 1819 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
1820 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1821
1822 FileNameToURL = staticmethod(FileNameToURL)
ae8162c8
RD
1823 def URLToFileName(*args, **kwargs):
1824 """URLToFileName(String url) -> String"""
1825 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1826
1827 URLToFileName = staticmethod(URLToFileName)
2131d850 1828_core_.FileSystem_swigregister(FileSystem)
d55e5bfc
RD
1829
1830def FileSystem_AddHandler(*args, **kwargs):
554f62e9
RD
1831 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1832 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1833
554f62e9
RD
1834def FileSystem_CleanUpHandlers(*args):
1835 """FileSystem_CleanUpHandlers()"""
1836 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc
RD
1837
1838def FileSystem_FileNameToURL(*args, **kwargs):
554f62e9
RD
1839 """FileSystem_FileNameToURL(String filename) -> String"""
1840 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1841
d55e5bfc 1842def FileSystem_URLToFileName(*args, **kwargs):
554f62e9
RD
1843 """FileSystem_URLToFileName(String url) -> String"""
1844 return _core_.FileSystem_URLToFileName(*args, **kwargs)
ae8162c8 1845
d55e5bfc 1846class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1847 """Proxy of C++ InternetFSHandler class"""
554f62e9
RD
1848 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1849 __repr__ = _swig_repr
1850 def __init__(self, *args, **kwargs):
d55e5bfc 1851 """__init__(self) -> InternetFSHandler"""
554f62e9 1852 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc
RD
1853 def CanOpen(*args, **kwargs):
1854 """CanOpen(self, String location) -> bool"""
1855 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1856
1857 def OpenFile(*args, **kwargs):
1858 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1859 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1860
2131d850 1861_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc
RD
1862
1863class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1864 """Proxy of C++ ZipFSHandler class"""
554f62e9
RD
1865 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1866 __repr__ = _swig_repr
1867 def __init__(self, *args, **kwargs):
d55e5bfc 1868 """__init__(self) -> ZipFSHandler"""
554f62e9 1869 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc
RD
1870 def CanOpen(*args, **kwargs):
1871 """CanOpen(self, String location) -> bool"""
1872 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1873
1874 def OpenFile(*args, **kwargs):
1875 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1876 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1877
1878 def FindFirst(*args, **kwargs):
1879 """FindFirst(self, String spec, int flags=0) -> String"""
1880 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1881
1882 def FindNext(*args, **kwargs):
1883 """FindNext(self) -> String"""
1884 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1885
2131d850 1886_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1887
1888
1889def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
554f62e9
RD
1890 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1891 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1892
1893def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
554f62e9
RD
1894 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1895 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1896
1897def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
554f62e9
RD
1898 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1899 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
ae8162c8
RD
1900def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1901 """
1902 Add 'file' to the memory filesystem. The dataItem parameter can
1903 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1904 arbitrary data. If a bitmap or image is used then the imgType
1905 parameter should specify what kind of image file it should be
1906 written as, wx.BITMAP_TYPE_PNG, etc.
1907 """
1908 if isinstance(dataItem, wx.Image):
1909 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1910 elif isinstance(dataItem, wx.Bitmap):
1911 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1912 elif type(dataItem) == str:
1913 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1914 else:
1915 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc
RD
1916
1917class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 1918 """Proxy of C++ MemoryFSHandler class"""
554f62e9
RD
1919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1920 __repr__ = _swig_repr
1921 def __init__(self, *args, **kwargs):
d55e5bfc 1922 """__init__(self) -> MemoryFSHandler"""
554f62e9 1923 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 1924 def RemoveFile(*args, **kwargs):
c24da6d6 1925 """RemoveFile(String filename)"""
d55e5bfc
RD
1926 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1927
1928 RemoveFile = staticmethod(RemoveFile)
1929 AddFile = staticmethod(MemoryFSHandler_AddFile)
1930 def CanOpen(*args, **kwargs):
1931 """CanOpen(self, String location) -> bool"""
1932 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1933
1934 def OpenFile(*args, **kwargs):
1935 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1936 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1937
1938 def FindFirst(*args, **kwargs):
1939 """FindFirst(self, String spec, int flags=0) -> String"""
1940 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1941
1942 def FindNext(*args, **kwargs):
1943 """FindNext(self) -> String"""
1944 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1945
2131d850 1946_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc
RD
1947
1948def MemoryFSHandler_RemoveFile(*args, **kwargs):
554f62e9
RD
1949 """MemoryFSHandler_RemoveFile(String filename)"""
1950 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 1951
57133d5c
RD
1952IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1953IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1954IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
1955#---------------------------------------------------------------------------
1956
1957class ImageHandler(Object):
27fb7603
RD
1958 """
1959 This is the base class for implementing image file loading/saving, and
1960 image creation from data. It is used within `wx.Image` and is not
1961 normally seen by the application.
1962 """
554f62e9
RD
1963 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1964 def __init__(self): raise AttributeError, "No constructor defined"
1965 __repr__ = _swig_repr
d55e5bfc
RD
1966 def GetName(*args, **kwargs):
1967 """GetName(self) -> String"""
1968 return _core_.ImageHandler_GetName(*args, **kwargs)
1969
1970 def GetExtension(*args, **kwargs):
1971 """GetExtension(self) -> String"""
1972 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1973
1974 def GetType(*args, **kwargs):
1975 """GetType(self) -> long"""
1976 return _core_.ImageHandler_GetType(*args, **kwargs)
1977
1978 def GetMimeType(*args, **kwargs):
1979 """GetMimeType(self) -> String"""
1980 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
1981
1982 def CanRead(*args, **kwargs):
1983 """CanRead(self, String name) -> bool"""
1984 return _core_.ImageHandler_CanRead(*args, **kwargs)
1985
1986 def SetName(*args, **kwargs):
1987 """SetName(self, String name)"""
1988 return _core_.ImageHandler_SetName(*args, **kwargs)
1989
1990 def SetExtension(*args, **kwargs):
1991 """SetExtension(self, String extension)"""
1992 return _core_.ImageHandler_SetExtension(*args, **kwargs)
1993
1994 def SetType(*args, **kwargs):
1995 """SetType(self, long type)"""
1996 return _core_.ImageHandler_SetType(*args, **kwargs)
1997
1998 def SetMimeType(*args, **kwargs):
1999 """SetMimeType(self, String mimetype)"""
2000 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2001
2131d850 2002_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2003
9d7dfdff
RD
2004class PyImageHandler(ImageHandler):
2005 """
2006 This is the base class for implementing image file loading/saving, and
2007 image creation from data, all written in Python. To create a custom
2008 image handler derive a new class from wx.PyImageHandler and provide
2009 the following methods::
2010
2011 def DoCanRead(self, stream) --> bool
2012 '''Check if this handler can read the image on the stream'''
2013
2014 def LoadFile(self, image, stream, verbose, index) --> bool
2015 '''Load image data from the stream and load it into image.'''
2016
2017 def SaveFile(self, image, stream, verbose) --> bool
2018 '''Save the iamge data in image to the stream using
2019 this handler's image file format.'''
2020
2021 def GetImageCount(self, stream) --> int
2022 '''If this image format can hold more than one image,
2023 how many does the image on the stream have?'''
2024
2025 To activate your handler create an instance of it and pass it to
2026 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2027 `SetExtension` from your constructor.
2028
2029 """
554f62e9
RD
2030 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2031 __repr__ = _swig_repr
2032 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2033 """
2034 __init__(self) -> PyImageHandler
2035
2036 This is the base class for implementing image file loading/saving, and
2037 image creation from data, all written in Python. To create a custom
2038 image handler derive a new class from wx.PyImageHandler and provide
2039 the following methods::
2040
2041 def DoCanRead(self, stream) --> bool
2042 '''Check if this handler can read the image on the stream'''
2043
2044 def LoadFile(self, image, stream, verbose, index) --> bool
2045 '''Load image data from the stream and load it into image.'''
2046
2047 def SaveFile(self, image, stream, verbose) --> bool
2048 '''Save the iamge data in image to the stream using
2049 this handler's image file format.'''
2050
2051 def GetImageCount(self, stream) --> int
2052 '''If this image format can hold more than one image,
2053 how many does the image on the stream have?'''
2054
2055 To activate your handler create an instance of it and pass it to
2056 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2057 `SetExtension` from your constructor.
2058
2059 """
554f62e9 2060 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
9d7dfdff
RD
2061 self._SetSelf(self)
2062
2063 def _SetSelf(*args, **kwargs):
2064 """_SetSelf(self, PyObject self)"""
2065 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2066
2131d850 2067_core_.PyImageHandler_swigregister(PyImageHandler)
9d7dfdff 2068
d55e5bfc 2069class ImageHistogram(object):
093d3ff1 2070 """Proxy of C++ ImageHistogram class"""
554f62e9
RD
2071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2072 __repr__ = _swig_repr
2073 def __init__(self, *args, **kwargs):
d55e5bfc 2074 """__init__(self) -> ImageHistogram"""
554f62e9 2075 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2076 def MakeKey(*args, **kwargs):
2077 """
7a27cf7c 2078 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2079
2080 Get the key in the histogram for the given RGB values
2081 """
2082 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2083
2084 MakeKey = staticmethod(MakeKey)
2085 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2086 """
2087 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2088
2089 Find first colour that is not used in the image and has higher RGB
2090 values than startR, startG, startB. Returns a tuple consisting of a
2091 success flag and rgb values.
2092 """
d55e5bfc
RD
2093 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2094
f1cbd8fa
RD
2095 def GetCount(*args, **kwargs):
2096 """
2097 GetCount(self, unsigned long key) -> unsigned long
2098
2099 Returns the pixel count for the given key. Use `MakeKey` to create a
2100 key value from a RGB tripple.
2101 """
2102 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2103
2104 def GetCountRGB(*args, **kwargs):
2105 """
7a27cf7c 2106 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2107
2108 Returns the pixel count for the given RGB values.
2109 """
2110 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2111
2112 def GetCountColour(*args, **kwargs):
2113 """
2114 GetCountColour(self, Colour colour) -> unsigned long
2115
2116 Returns the pixel count for the given `wx.Colour` value.
2117 """
2118 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2119
2131d850 2120_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc
RD
2121
2122def ImageHistogram_MakeKey(*args, **kwargs):
554f62e9 2123 """
7a27cf7c 2124 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2125
2126 Get the key in the histogram for the given RGB values
2127 """
554f62e9 2128 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2129
2f91e3df 2130class Image_RGBValue(object):
9d7dfdff
RD
2131 """
2132 An object that contains values for red, green and blue which represent
2133 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2134 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2135 color space.
2136 """
554f62e9
RD
2137 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2138 __repr__ = _swig_repr
2139 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2140 """
2141 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2142
2143 Constructor.
2144 """
554f62e9 2145 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2f91e3df
KO
2146 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2147 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2148 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2149_core_.Image_RGBValue_swigregister(Image_RGBValue)
2f91e3df
KO
2150
2151class Image_HSVValue(object):
9d7dfdff
RD
2152 """
2153 An object that contains values for hue, saturation and value which
2154 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2155 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2156 color space.
2157 """
554f62e9
RD
2158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2159 __repr__ = _swig_repr
2160 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2161 """
2162 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2163
2164 Constructor.
2165 """
554f62e9 2166 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2f91e3df
KO
2167 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2168 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2169 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2170_core_.Image_HSVValue_swigregister(Image_HSVValue)
2f91e3df 2171
d55e5bfc 2172class Image(Object):
7a27cf7c
RD
2173 """
2174 A platform-independent image class. An image can be created from
2175 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2176 variety of formats. Functions are available to set and get image
2177 bits, so it can be used for basic image manipulation.
2178
2179 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2180 platform-specific `wx.Bitmap` object must be created from it using the
2181 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2182 device context, using `wx.DC.DrawBitmap`.
2183
2184 One colour value of the image may be used as a mask colour which will
2185 lead to the automatic creation of a `wx.Mask` object associated to the
2186 bitmap object.
2187
2188 wx.Image supports alpha channel data, that is in addition to a byte
2189 for the red, green and blue colour components for each pixel it also
2190 stores a byte representing the pixel opacity. An alpha value of 0
2191 corresponds to a transparent pixel (null opacity) while a value of 255
2192 means that the pixel is 100% opaque.
2193
2194 Unlike RGB data, not all images have an alpha channel and before using
2195 `GetAlpha` you should check if this image contains an alpha channel
2196 with `HasAlpha`. Note that currently only images loaded from PNG files
2197 with transparency information will have an alpha channel.
2198 """
554f62e9
RD
2199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2200 __repr__ = _swig_repr
2201 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2202 """
2203 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2204
2205 Loads an image from a file.
2206 """
554f62e9
RD
2207 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2208 __swig_destroy__ = _core_.delete_Image
2209 __del__ = lambda self : None;
d55e5bfc 2210 def Create(*args, **kwargs):
7a27cf7c
RD
2211 """
2212 Create(self, int width, int height, bool clear=True)
2213
2214 Creates a fresh image. If clear is ``True``, the new image will be
2215 initialized to black. Otherwise, the image data will be uninitialized.
2216 """
d55e5bfc
RD
2217 return _core_.Image_Create(*args, **kwargs)
2218
2219 def Destroy(*args, **kwargs):
2220 """
2221 Destroy(self)
2222
7a27cf7c 2223 Destroys the image data.
d55e5bfc 2224 """
7e08d4ef
RD
2225 val = _core_.Image_Destroy(*args, **kwargs)
2226 args[0].thisown = 0
2227 return val
d55e5bfc
RD
2228
2229 def Scale(*args, **kwargs):
7a27cf7c
RD
2230 """
2231 Scale(self, int width, int height) -> Image
2232
2233 Returns a scaled version of the image. This is also useful for scaling
2234 bitmaps in general as the only other way to scale bitmaps is to blit a
2235 `wx.MemoryDC` into another `wx.MemoryDC`.
2236 """
d55e5bfc
RD
2237 return _core_.Image_Scale(*args, **kwargs)
2238
2239 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2240 """
2241 ShrinkBy(self, int xFactor, int yFactor) -> Image
2242
2243 Return a version of the image scaled smaller by the given factors.
2244 """
d55e5bfc
RD
2245 return _core_.Image_ShrinkBy(*args, **kwargs)
2246
2247 def Rescale(*args, **kwargs):
7a27cf7c
RD
2248 """
2249 Rescale(self, int width, int height) -> Image
2250
2251 Changes the size of the image in-place by scaling it: after a call to
2252 this function, the image will have the given width and height.
2253
2254 Returns the (modified) image itself.
2255 """
d55e5bfc
RD
2256 return _core_.Image_Rescale(*args, **kwargs)
2257
aff4cc5c 2258 def Resize(*args, **kwargs):
7a27cf7c
RD
2259 """
2260 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2261
2262 Changes the size of the image in-place without scaling it, by adding
2263 either a border with the given colour or cropping as necessary. The
2264 image is pasted into a new image with the given size and background
2265 colour at the position pos relative to the upper left of the new
2266 image. If red = green = blue = -1 then use either the current mask
2267 colour if set or find, use, and set a suitable mask colour for any
2268 newly exposed areas.
2269
2270 Returns the (modified) image itself.
2271 """
aff4cc5c
RD
2272 return _core_.Image_Resize(*args, **kwargs)
2273
d55e5bfc 2274 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2275 """
2276 SetRGB(self, int x, int y, byte r, byte g, byte b)
2277
2278 Sets the pixel at the given coordinate. This routine performs
2279 bounds-checks for the coordinate so it can be considered a safe way to
2280 manipulate the data, but in some cases this might be too slow so that
2281 the data will have to be set directly. In that case you will have to
2282 get access to the image data using the `GetData` method.
2283 """
d55e5bfc
RD
2284 return _core_.Image_SetRGB(*args, **kwargs)
2285
aff4cc5c 2286 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2287 """
2288 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2289
2290 Sets the colour of the pixels within the given rectangle. This routine
2291 performs bounds-checks for the rectangle so it can be considered a
2292 safe way to manipulate the data.
2293 """
aff4cc5c
RD
2294 return _core_.Image_SetRGBRect(*args, **kwargs)
2295
d55e5bfc 2296 def GetRed(*args, **kwargs):
7a27cf7c
RD
2297 """
2298 GetRed(self, int x, int y) -> byte
2299
2300 Returns the red intensity at the given coordinate.
2301 """
d55e5bfc
RD
2302 return _core_.Image_GetRed(*args, **kwargs)
2303
2304 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2305 """
2306 GetGreen(self, int x, int y) -> byte
2307
2308 Returns the green intensity at the given coordinate.
2309 """
d55e5bfc
RD
2310 return _core_.Image_GetGreen(*args, **kwargs)
2311
2312 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2313 """
2314 GetBlue(self, int x, int y) -> byte
2315
2316 Returns the blue intensity at the given coordinate.
2317 """
d55e5bfc
RD
2318 return _core_.Image_GetBlue(*args, **kwargs)
2319
2320 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2321 """
2322 SetAlpha(self, int x, int y, byte alpha)
2323
2324 Sets the alpha value for the given pixel. This function should only be
2325 called if the image has alpha channel data, use `HasAlpha` to check
2326 for this.
2327 """
d55e5bfc
RD
2328 return _core_.Image_SetAlpha(*args, **kwargs)
2329
2330 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2331 """
2332 GetAlpha(self, int x, int y) -> byte
2333
2334 Returns the alpha value for the given pixel. This function may only be
2335 called for the images with alpha channel, use `HasAlpha` to check for
2336 this.
2337
2338 The returned value is the *opacity* of the image, i.e. the value of 0
2339 corresponds to the fully transparent pixels while the value of 255 to
2340 the fully opaque pixels.
2341 """
d55e5bfc
RD
2342 return _core_.Image_GetAlpha(*args, **kwargs)
2343
2344 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2345 """
2346 HasAlpha(self) -> bool
2347
2348 Returns true if this image has alpha channel, false otherwise.
2349 """
d55e5bfc
RD
2350 return _core_.Image_HasAlpha(*args, **kwargs)
2351
68350608
RD
2352 def InitAlpha(*args, **kwargs):
2353 """
2354 InitAlpha(self)
2355
2356 Initializes the image alpha channel data. It is an error to call it if
2357 the image already has alpha data. If it doesn't, alpha data will be by
2358 default initialized to all pixels being fully opaque. But if the image
2359 has a a mask colour, all mask pixels will be completely transparent.
2360 """
2361 return _core_.Image_InitAlpha(*args, **kwargs)
2362
57133d5c
RD
2363 def IsTransparent(*args, **kwargs):
2364 """
7a27cf7c 2365 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
57133d5c 2366
7a27cf7c
RD
2367 Returns ``True`` if this pixel is masked or has an alpha value less
2368 than the spcified threshold.
57133d5c
RD
2369 """
2370 return _core_.Image_IsTransparent(*args, **kwargs)
2371
d55e5bfc 2372 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2373 """
2374 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2375
2376 Find first colour that is not used in the image and has higher RGB
2377 values than startR, startG, startB. Returns a tuple consisting of a
2378 success flag and rgb values.
2379 """
d55e5bfc
RD
2380 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2381
4cf4100f
RD
2382 def ConvertAlphaToMask(*args, **kwargs):
2383 """
57133d5c 2384 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2385
7a27cf7c
RD
2386 If the image has alpha channel, this method converts it to mask. All
2387 pixels with alpha value less than ``threshold`` are replaced with the
2388 mask colour and the alpha channel is removed. The mask colour is
2389 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2390
2391 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2392 nothing.
2393 """
2394 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2395
8fb0e70a
RD
2396 def ConvertColourToAlpha(*args, **kwargs):
2397 """
7a27cf7c 2398 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2399
2400 This method converts an image where the original alpha information is
2401 only available as a shades of a colour (actually shades of grey)
2402 typically when you draw anti-aliased text into a bitmap. The DC
2403 drawing routines draw grey values on the black background although
2404 they actually mean to draw white with differnt alpha values. This
2405 method reverses it, assuming a black (!) background and white text.
2406 The method will then fill up the whole image with the colour given.
2407 """
2408 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2409
d55e5bfc 2410 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2411 """
2412 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2413
2414 Sets the image's mask so that the pixels that have RGB value of
2415 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2416 by first finding an unused colour in the image, setting this colour as
2417 the mask colour and then using this colour to draw all pixels in the
2418 image who corresponding pixel in mask has given RGB value.
2419
2420 Returns ``False`` if ``mask`` does not have same dimensions as the
2421 image or if there is no unused colour left. Returns ``True`` if the
2422 mask was successfully applied.
2423
2424 Note that this method involves computing the histogram, which is
2425 computationally intensive operation.
2426 """
d55e5bfc
RD
2427 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2428
2429 def CanRead(*args, **kwargs):
7a27cf7c
RD
2430 """
2431 CanRead(String filename) -> bool
2432
2433 Returns True if the image handlers can read this file.
2434 """
d55e5bfc
RD
2435 return _core_.Image_CanRead(*args, **kwargs)
2436
2437 CanRead = staticmethod(CanRead)
2438 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2439 """
2440 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2441
2442 If the image file contains more than one image and the image handler
2443 is capable of retrieving these individually, this function will return
2444 the number of available images.
2445 """
d55e5bfc
RD
2446 return _core_.Image_GetImageCount(*args, **kwargs)
2447
2448 GetImageCount = staticmethod(GetImageCount)
2449 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2450 """
2451 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2452
2453 Loads an image from a file. If no handler type is provided, the
2454 library will try to autodetect the format.
2455 """
d55e5bfc
RD
2456 return _core_.Image_LoadFile(*args, **kwargs)
2457
2458 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2459 """
2460 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2461
2462 Loads an image from a file, specifying the image type with a MIME type
2463 string.
2464 """
d55e5bfc
RD
2465 return _core_.Image_LoadMimeFile(*args, **kwargs)
2466
2467 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2468 """
2469 SaveFile(self, String name, int type) -> bool
2470
2471 Saves an image in the named file.
2472 """
d55e5bfc
RD
2473 return _core_.Image_SaveFile(*args, **kwargs)
2474
2475 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2476 """
2477 SaveMimeFile(self, String name, String mimetype) -> bool
2478
2479 Saves an image in the named file.
2480 """
d55e5bfc
RD
2481 return _core_.Image_SaveMimeFile(*args, **kwargs)
2482
2483 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2484 """
2485 CanReadStream(InputStream stream) -> bool
2486
2487 Returns True if the image handlers can read an image file from the
2488 data currently on the input stream, or a readable Python file-like
2489 object.
2490 """
d55e5bfc
RD
2491 return _core_.Image_CanReadStream(*args, **kwargs)
2492
2493 CanReadStream = staticmethod(CanReadStream)
2494 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2495 """
2496 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2497
2498 Loads an image from an input stream or a readable Python file-like
2499 object. If no handler type is provided, the library will try to
2500 autodetect the format.
2501 """
d55e5bfc
RD
2502 return _core_.Image_LoadStream(*args, **kwargs)
2503
2504 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2505 """
2506 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2507
2508 Loads an image from an input stream or a readable Python file-like
2509 object, using a MIME type string to specify the image file format.
2510 """
d55e5bfc
RD
2511 return _core_.Image_LoadMimeStream(*args, **kwargs)
2512
2513 def Ok(*args, **kwargs):
7a27cf7c
RD
2514 """
2515 Ok(self) -> bool
2516
2517 Returns true if image data is present.
2518 """
d55e5bfc
RD
2519 return _core_.Image_Ok(*args, **kwargs)
2520
2521 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2522 """
2523 GetWidth(self) -> int
2524
2525 Gets the width of the image in pixels.
2526 """
d55e5bfc
RD
2527 return _core_.Image_GetWidth(*args, **kwargs)
2528
2529 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2530 """
2531 GetHeight(self) -> int
2532
2533 Gets the height of the image in pixels.
2534 """
d55e5bfc
RD
2535 return _core_.Image_GetHeight(*args, **kwargs)
2536
2537 def GetSize(*args, **kwargs):
7a27cf7c
RD
2538 """
2539 GetSize(self) -> Size
2540
2541 Returns the size of the image in pixels.
2542 """
d55e5bfc
RD
2543 return _core_.Image_GetSize(*args, **kwargs)
2544
2545 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2546 """
2547 GetSubImage(self, Rect rect) -> Image
2548
2549 Returns a sub image of the current one as long as the rect belongs
2550 entirely to the image.
2551 """
d55e5bfc
RD
2552 return _core_.Image_GetSubImage(*args, **kwargs)
2553
aff4cc5c 2554 def Size(*args, **kwargs):
7a27cf7c
RD
2555 """
2556 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2557
2558 Returns a resized version of this image without scaling it by adding
2559 either a border with the given colour or cropping as necessary. The
2560 image is pasted into a new image with the given size and background
2561 colour at the position ``pos`` relative to the upper left of the new
2562 image. If red = green = blue = -1 then use either the current mask
2563 colour if set or find, use, and set a suitable mask colour for any
2564 newly exposed areas.
2565 """
aff4cc5c
RD
2566 return _core_.Image_Size(*args, **kwargs)
2567
d55e5bfc 2568 def Copy(*args, **kwargs):
7a27cf7c
RD
2569 """
2570 Copy(self) -> Image
2571
2572 Returns an identical copy of the image.
2573 """
d55e5bfc
RD
2574 return _core_.Image_Copy(*args, **kwargs)
2575
2576 def Paste(*args, **kwargs):
7a27cf7c
RD
2577 """
2578 Paste(self, Image image, int x, int y)
2579
2580 Pastes ``image`` into this instance and takes care of the mask colour
2581 and any out of bounds problems.
2582 """
d55e5bfc
RD
2583 return _core_.Image_Paste(*args, **kwargs)
2584
2585 def GetData(*args, **kwargs):
ea939623
RD
2586 """
2587 GetData(self) -> PyObject
2588
2589 Returns a string containing a copy of the RGB bytes of the image.
2590 """
d55e5bfc
RD
2591 return _core_.Image_GetData(*args, **kwargs)
2592
2593 def SetData(*args, **kwargs):
ea939623
RD
2594 """
2595 SetData(self, buffer data)
2596
2597 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2598 either a string or a buffer object holding the data and the length of
2599 the data must be width*height*3.
2600 """
d55e5bfc
RD
2601 return _core_.Image_SetData(*args, **kwargs)
2602
2603 def GetDataBuffer(*args, **kwargs):
ea939623
RD
2604 """
2605 GetDataBuffer(self) -> PyObject
2606
2607 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2608 image data buffer inside the wx.Image. You need to ensure that you do
2609 not use this buffer object after the image has been destroyed.
ea939623 2610 """
d55e5bfc
RD
2611 return _core_.Image_GetDataBuffer(*args, **kwargs)
2612
2613 def SetDataBuffer(*args, **kwargs):
ea939623
RD
2614 """
2615 SetDataBuffer(self, buffer data)
2616
2617 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2618 object. This can save making an extra copy of the data but you must
2619 ensure that the buffer object lives longer than the wx.Image does.
ea939623 2620 """
d55e5bfc
RD
2621 return _core_.Image_SetDataBuffer(*args, **kwargs)
2622
2623 def GetAlphaData(*args, **kwargs):
ea939623
RD
2624 """
2625 GetAlphaData(self) -> PyObject
2626
2627 Returns a string containing a copy of the alpha bytes of the image.
2628 """
d55e5bfc
RD
2629 return _core_.Image_GetAlphaData(*args, **kwargs)
2630
2631 def SetAlphaData(*args, **kwargs):
ea939623
RD
2632 """
2633 SetAlphaData(self, buffer alpha)
2634
2635 Resets the Image's alpha data from a buffer of bytes. Accepts either
2636 a string or a buffer object holding the data and the length of the
2637 data must be width*height.
2638 """
d55e5bfc
RD
2639 return _core_.Image_SetAlphaData(*args, **kwargs)
2640
2641 def GetAlphaBuffer(*args, **kwargs):
2642 """GetAlphaBuffer(self) -> PyObject"""
2643 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2644
2645 def SetAlphaBuffer(*args, **kwargs):
ea939623 2646 """SetAlphaBuffer(self, buffer alpha)"""
d55e5bfc
RD
2647 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2648
2649 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2650 """
2651 SetMaskColour(self, byte r, byte g, byte b)
2652
2653 Sets the mask colour for this image (and tells the image to use the
2654 mask).
2655 """
d55e5bfc
RD
2656 return _core_.Image_SetMaskColour(*args, **kwargs)
2657
aff4cc5c
RD
2658 def GetOrFindMaskColour(*args, **kwargs):
2659 """
2660 GetOrFindMaskColour() -> (r,g,b)
2661
2662 Get the current mask colour or find a suitable colour.
2663 """
2664 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2665
d55e5bfc 2666 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2667 """
2668 GetMaskRed(self) -> byte
2669
2670 Gets the red component of the mask colour.
2671 """
d55e5bfc
RD
2672 return _core_.Image_GetMaskRed(*args, **kwargs)
2673
2674 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2675 """
2676 GetMaskGreen(self) -> byte
2677
2678 Gets the green component of the mask colour.
2679 """
d55e5bfc
RD
2680 return _core_.Image_GetMaskGreen(*args, **kwargs)
2681
2682 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2683 """
2684 GetMaskBlue(self) -> byte
2685
2686 Gets the blue component of the mask colour.
2687 """
d55e5bfc
RD
2688 return _core_.Image_GetMaskBlue(*args, **kwargs)
2689
2690 def SetMask(*args, **kwargs):
7a27cf7c
RD
2691 """
2692 SetMask(self, bool mask=True)
2693
2694 Specifies whether there is a mask or not. The area of the mask is
2695 determined by the current mask colour.
2696 """
d55e5bfc
RD
2697 return _core_.Image_SetMask(*args, **kwargs)
2698
2699 def HasMask(*args, **kwargs):
7a27cf7c
RD
2700 """
2701 HasMask(self) -> bool
2702
2703 Returns ``True`` if there is a mask active, ``False`` otherwise.
2704 """
d55e5bfc
RD
2705 return _core_.Image_HasMask(*args, **kwargs)
2706
2707 def Rotate(*args, **kwargs):
2708 """
2709 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2710 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2711
2712 Rotates the image about the given point, by ``angle`` radians. Passing
2713 ``True`` to ``interpolating`` results in better image quality, but is
2714 slower. If the image has a mask, then the mask colour is used for the
2715 uncovered pixels in the rotated image background. Otherwise, black
2716 will be used as the fill colour.
2717
2718 Returns the rotated image, leaving this image intact.
d55e5bfc
RD
2719 """
2720 return _core_.Image_Rotate(*args, **kwargs)
2721
2722 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2723 """
2724 Rotate90(self, bool clockwise=True) -> Image
2725
2726 Returns a copy of the image rotated 90 degrees in the direction
2727 indicated by ``clockwise``.
2728 """
d55e5bfc
RD
2729 return _core_.Image_Rotate90(*args, **kwargs)
2730
2731 def Mirror(*args, **kwargs):
7a27cf7c
RD
2732 """
2733 Mirror(self, bool horizontally=True) -> Image
2734
2735 Returns a mirrored copy of the image. The parameter ``horizontally``
2736 indicates the orientation.
2737 """
d55e5bfc
RD
2738 return _core_.Image_Mirror(*args, **kwargs)
2739
2740 def Replace(*args, **kwargs):
2741 """
7a27cf7c
RD
2742 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2743
2744 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2745 ``(r2,g2,b2)``.
d55e5bfc
RD
2746 """
2747 return _core_.Image_Replace(*args, **kwargs)
2748
7449af73
RD
2749 def ConvertToGreyscale(*args, **kwargs):
2750 """
2751 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2752
2753 Convert to greyscale image. Uses the luminance component (Y) of the
2754 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2755 defaults to ITU-T BT.601
2756 """
2757 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2758
d55e5bfc 2759 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2760 """
2761 ConvertToMono(self, byte r, byte g, byte b) -> Image
2762
2763 Returns monochromatic version of the image. The returned image has
2764 white colour where the original has ``(r,g,b)`` colour and black
2765 colour everywhere else.
2766 """
d55e5bfc
RD
2767 return _core_.Image_ConvertToMono(*args, **kwargs)
2768
2769 def SetOption(*args, **kwargs):
7a27cf7c
RD
2770 """
2771 SetOption(self, String name, String value)
2772
2773 Sets an image handler defined option. For example, when saving as a
2774 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2775 number between 0 and 100 (0 is terrible, 100 is very good).
2776 """
d55e5bfc
RD
2777 return _core_.Image_SetOption(*args, **kwargs)
2778
2779 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2780 """
2781 SetOptionInt(self, String name, int value)
2782
2783 Sets an image option as an integer.
2784 """
d55e5bfc
RD
2785 return _core_.Image_SetOptionInt(*args, **kwargs)
2786
2787 def GetOption(*args, **kwargs):
7a27cf7c
RD
2788 """
2789 GetOption(self, String name) -> String
2790
2791 Gets the value of an image handler option.
2792 """
d55e5bfc
RD
2793 return _core_.Image_GetOption(*args, **kwargs)
2794
2795 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2796 """
2797 GetOptionInt(self, String name) -> int
2798
2799 Gets the value of an image handler option as an integer. If the given
2800 option is not present, the function returns 0.
2801 """
d55e5bfc
RD
2802 return _core_.Image_GetOptionInt(*args, **kwargs)
2803
2804 def HasOption(*args, **kwargs):
7a27cf7c
RD
2805 """
2806 HasOption(self, String name) -> bool
2807
2808 Returns true if the given option is present.
2809 """
d55e5bfc
RD
2810 return _core_.Image_HasOption(*args, **kwargs)
2811
2812 def CountColours(*args, **kwargs):
2813 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2814 return _core_.Image_CountColours(*args, **kwargs)
2815
2816 def ComputeHistogram(*args, **kwargs):
2817 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2818 return _core_.Image_ComputeHistogram(*args, **kwargs)
2819
2820 def AddHandler(*args, **kwargs):
c24da6d6 2821 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
2822 return _core_.Image_AddHandler(*args, **kwargs)
2823
2824 AddHandler = staticmethod(AddHandler)
2825 def InsertHandler(*args, **kwargs):
c24da6d6 2826 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
2827 return _core_.Image_InsertHandler(*args, **kwargs)
2828
2829 InsertHandler = staticmethod(InsertHandler)
2830 def RemoveHandler(*args, **kwargs):
c24da6d6 2831 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
2832 return _core_.Image_RemoveHandler(*args, **kwargs)
2833
2834 RemoveHandler = staticmethod(RemoveHandler)
554f62e9
RD
2835 def GetHandlers(*args, **kwargs):
2836 """GetHandlers() -> PyObject"""
2837 return _core_.Image_GetHandlers(*args, **kwargs)
2838
2839 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2840 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2841 """
2842 GetImageExtWildcard() -> String
2843
2844 Iterates all registered wxImageHandler objects, and returns a string
2845 containing file extension masks suitable for passing to file open/save
2846 dialog boxes.
2847 """
d55e5bfc
RD
2848 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2849
2850 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2851 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2852 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
d55e5bfc
RD
2853 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2854
2855 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2856 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
d55e5bfc
RD
2857 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2858
2f91e3df
KO
2859 def RotateHue(*args, **kwargs):
2860 """
2861 RotateHue(self, double angle)
2862
2863 Rotates the hue of each pixel of the image. Hue is a double in the
2864 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2865 """
2866 return _core_.Image_RotateHue(*args, **kwargs)
2867
2868 def RGBtoHSV(*args, **kwargs):
9d7dfdff
RD
2869 """
2870 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2871
2872 Converts a color in RGB color space to HSV color space.
2873 """
2f91e3df
KO
2874 return _core_.Image_RGBtoHSV(*args, **kwargs)
2875
2876 RGBtoHSV = staticmethod(RGBtoHSV)
2877 def HSVtoRGB(*args, **kwargs):
9d7dfdff
RD
2878 """
2879 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2880
2881 Converts a color in HSV color space to RGB color space.
2882 """
2f91e3df
KO
2883 return _core_.Image_HSVtoRGB(*args, **kwargs)
2884
2885 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 2886 def __nonzero__(self): return self.Ok()
2131d850 2887_core_.Image_swigregister(Image)
d55e5bfc
RD
2888
2889def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2890 """
2891 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2892
2893 Loads an image from a file, using a MIME type string (such as
2894 'image/jpeg') to specify image type.
2895 """
d55e5bfc 2896 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2897 return val
2898
2899def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2900 """
2901 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2902
2903 Loads an image from an input stream, or any readable Python file-like
2904 object.
2905 """
d55e5bfc 2906 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2907 return val
2908
2909def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2910 """
2911 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2912
2913 Loads an image from an input stream, or any readable Python file-like
2914 object, specifying the image format with a MIME type string.
2915 """
d55e5bfc 2916 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2917 return val
2918
c24da6d6 2919def EmptyImage(*args, **kwargs):
ea939623
RD
2920 """
2921 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2922
2923 Construct an empty image of a given size, optionally setting all
2924 pixels to black.
2925 """
c24da6d6 2926 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2927 return val
2928
2929def ImageFromBitmap(*args, **kwargs):
ea939623
RD
2930 """
2931 ImageFromBitmap(Bitmap bitmap) -> Image
2932
2933 Construct an Image from a `wx.Bitmap`.
2934 """
d55e5bfc 2935 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2936 return val
2937
2938def ImageFromData(*args, **kwargs):
ea939623
RD
2939 """
2940 ImageFromData(int width, int height, buffer data) -> Image
2941
2942 Construct an Image from a buffer of RGB bytes. Accepts either a
2943 string or a buffer object holding the data and the length of the data
2944 must be width*height*3.
2945 """
d55e5bfc 2946 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2947 return val
2948
c9c2cf70 2949def ImageFromDataWithAlpha(*args, **kwargs):
ea939623
RD
2950 """
2951 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2952
2953 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2954 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2955 length of the data must be width*height*3 bytes, and the length of the
2956 alpha data must be width*height bytes.
ea939623 2957 """
c9c2cf70 2958 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
c9c2cf70
RD
2959 return val
2960
d55e5bfc 2961def Image_CanRead(*args, **kwargs):
554f62e9 2962 """
7a27cf7c
RD
2963 Image_CanRead(String filename) -> bool
2964
2965 Returns True if the image handlers can read this file.
2966 """
554f62e9 2967 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2968
2969def Image_GetImageCount(*args, **kwargs):
554f62e9 2970 """
7a27cf7c
RD
2971 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2972
2973 If the image file contains more than one image and the image handler
2974 is capable of retrieving these individually, this function will return
2975 the number of available images.
2976 """
554f62e9 2977 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2978
2979def Image_CanReadStream(*args, **kwargs):
554f62e9 2980 """
7a27cf7c
RD
2981 Image_CanReadStream(InputStream stream) -> bool
2982
2983 Returns True if the image handlers can read an image file from the
2984 data currently on the input stream, or a readable Python file-like
2985 object.
2986 """
554f62e9 2987 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2988
2989def Image_AddHandler(*args, **kwargs):
554f62e9
RD
2990 """Image_AddHandler(ImageHandler handler)"""
2991 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2992
2993def Image_InsertHandler(*args, **kwargs):
554f62e9
RD
2994 """Image_InsertHandler(ImageHandler handler)"""
2995 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2996
2997def Image_RemoveHandler(*args, **kwargs):
554f62e9
RD
2998 """Image_RemoveHandler(String name) -> bool"""
2999 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3000
554f62e9
RD
3001def Image_GetHandlers(*args):
3002 """Image_GetHandlers() -> PyObject"""
3003 return _core_.Image_GetHandlers(*args)
3004
3005def Image_GetImageExtWildcard(*args):
3006 """
7a27cf7c
RD
3007 Image_GetImageExtWildcard() -> String
3008
3009 Iterates all registered wxImageHandler objects, and returns a string
3010 containing file extension masks suitable for passing to file open/save
3011 dialog boxes.
3012 """
554f62e9 3013 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3014
2f91e3df 3015def Image_RGBtoHSV(*args, **kwargs):
554f62e9 3016 """
9d7dfdff
RD
3017 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3018
3019 Converts a color in RGB color space to HSV color space.
3020 """
554f62e9 3021 return _core_.Image_RGBtoHSV(*args, **kwargs)
2f91e3df
KO
3022
3023def Image_HSVtoRGB(*args, **kwargs):
554f62e9 3024 """
9d7dfdff
RD
3025 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3026
3027 Converts a color in HSV color space to RGB color space.
3028 """
554f62e9 3029 return _core_.Image_HSVtoRGB(*args, **kwargs)
2f91e3df 3030
a07a67e6
RD
3031def InitAllImageHandlers():
3032 """
3033 The former functionality of InitAllImageHanders is now done internal to
3034 the _core_ extension module and so this function has become a simple NOP.
3035 """
3036 pass
d55e5bfc 3037
d55e5bfc
RD
3038IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3039IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3040PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3041PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3042PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
d55e5bfc
RD
3043BMP_24BPP = _core_.BMP_24BPP
3044BMP_8BPP = _core_.BMP_8BPP
3045BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3046BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3047BMP_8BPP_RED = _core_.BMP_8BPP_RED
3048BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3049BMP_4BPP = _core_.BMP_4BPP
3050BMP_1BPP = _core_.BMP_1BPP
3051BMP_1BPP_BW = _core_.BMP_1BPP_BW
3052class BMPHandler(ImageHandler):
27fb7603 3053 """A `wx.ImageHandler` for \*.bmp bitmap files."""
554f62e9
RD
3054 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3055 __repr__ = _swig_repr
3056 def __init__(self, *args, **kwargs):
27fb7603
RD
3057 """
3058 __init__(self) -> BMPHandler
3059
3060 A `wx.ImageHandler` for \*.bmp bitmap files.
3061 """
554f62e9 3062 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3063_core_.BMPHandler_swigregister(BMPHandler)
d55e5bfc 3064NullImage = cvar.NullImage
68350608 3065IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3066IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3067IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3068IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3069IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3070IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3071IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3072IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3073IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3074IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3075IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3076IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3077IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3078IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3079IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc
RD
3080
3081class ICOHandler(BMPHandler):
27fb7603 3082 """A `wx.ImageHandler` for \*.ico icon files."""
554f62e9
RD
3083 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3084 __repr__ = _swig_repr
3085 def __init__(self, *args, **kwargs):
27fb7603
RD
3086 """
3087 __init__(self) -> ICOHandler
3088
3089 A `wx.ImageHandler` for \*.ico icon files.
3090 """
554f62e9 3091 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3092_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc
RD
3093
3094class CURHandler(ICOHandler):
27fb7603 3095 """A `wx.ImageHandler` for \*.cur cursor files."""
554f62e9
RD
3096 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3097 __repr__ = _swig_repr
3098 def __init__(self, *args, **kwargs):
27fb7603
RD
3099 """
3100 __init__(self) -> CURHandler
3101
3102 A `wx.ImageHandler` for \*.cur cursor files.
3103 """
554f62e9 3104 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3105_core_.CURHandler_swigregister(CURHandler)
d55e5bfc
RD
3106
3107class ANIHandler(CURHandler):
27fb7603 3108 """A `wx.ImageHandler` for \*.ani animated cursor files."""
554f62e9
RD
3109 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3110 __repr__ = _swig_repr
3111 def __init__(self, *args, **kwargs):
27fb7603
RD
3112 """
3113 __init__(self) -> ANIHandler
3114
3115 A `wx.ImageHandler` for \*.ani animated cursor files.
3116 """
554f62e9 3117 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3118_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc
RD
3119
3120class PNGHandler(ImageHandler):
27fb7603 3121 """A `wx.ImageHandler` for PNG image files."""
554f62e9
RD
3122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3123 __repr__ = _swig_repr
3124 def __init__(self, *args, **kwargs):
27fb7603
RD
3125 """
3126 __init__(self) -> PNGHandler
3127
3128 A `wx.ImageHandler` for PNG image files.
3129 """
554f62e9 3130 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3131_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc
RD
3132
3133class GIFHandler(ImageHandler):
27fb7603 3134 """A `wx.ImageHandler` for GIF image files."""
554f62e9
RD
3135 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3136 __repr__ = _swig_repr
3137 def __init__(self, *args, **kwargs):
27fb7603
RD
3138 """
3139 __init__(self) -> GIFHandler
3140
3141 A `wx.ImageHandler` for GIF image files.
3142 """
554f62e9 3143 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3144_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc
RD
3145
3146class PCXHandler(ImageHandler):
27fb7603 3147 """A `wx.ImageHandler` for PCX imager files."""
554f62e9
RD
3148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3149 __repr__ = _swig_repr
3150 def __init__(self, *args, **kwargs):
27fb7603
RD
3151 """
3152 __init__(self) -> PCXHandler
3153
3154 A `wx.ImageHandler` for PCX imager files.
3155 """
554f62e9 3156 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3157_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc
RD
3158
3159class JPEGHandler(ImageHandler):
27fb7603 3160 """A `wx.ImageHandler` for JPEG/JPG image files."""
554f62e9
RD
3161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3162 __repr__ = _swig_repr
3163 def __init__(self, *args, **kwargs):
27fb7603
RD
3164 """
3165 __init__(self) -> JPEGHandler
3166
3167 A `wx.ImageHandler` for JPEG/JPG image files.
3168 """
554f62e9 3169 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3170_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc
RD
3171
3172class PNMHandler(ImageHandler):
27fb7603 3173 """A `wx.ImageHandler` for PNM image files."""
554f62e9
RD
3174 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3175 __repr__ = _swig_repr
3176 def __init__(self, *args, **kwargs):
27fb7603
RD
3177 """
3178 __init__(self) -> PNMHandler
3179
3180 A `wx.ImageHandler` for PNM image files.
3181 """
554f62e9 3182 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3183_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc
RD
3184
3185class XPMHandler(ImageHandler):
27fb7603 3186 """A `wx.ImageHandler` for XPM image."""
554f62e9
RD
3187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3188 __repr__ = _swig_repr
3189 def __init__(self, *args, **kwargs):
27fb7603
RD
3190 """
3191 __init__(self) -> XPMHandler
3192
3193 A `wx.ImageHandler` for XPM image.
3194 """
554f62e9 3195 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3196_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc
RD
3197
3198class TIFFHandler(ImageHandler):
27fb7603 3199 """A `wx.ImageHandler` for TIFF image files."""
554f62e9
RD
3200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3201 __repr__ = _swig_repr
3202 def __init__(self, *args, **kwargs):
27fb7603
RD
3203 """
3204 __init__(self) -> TIFFHandler
3205
3206 A `wx.ImageHandler` for TIFF image files.
3207 """
554f62e9 3208 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3209_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3210
c0de73ae
RD
3211QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3212QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3213class Quantize(object):
3214 """Performs quantization, or colour reduction, on a wxImage."""
554f62e9
RD
3215 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3216 def __init__(self): raise AttributeError, "No constructor defined"
3217 __repr__ = _swig_repr
c0de73ae
RD
3218 def Quantize(*args, **kwargs):
3219 """
3220 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3221
3222 Reduce the colours in the source image and put the result into the
3223 destination image, setting the palette in the destination if
3224 needed. Both images may be the same, to overwrite the source image.
3225 """
3226 return _core_.Quantize_Quantize(*args, **kwargs)
3227
3228 Quantize = staticmethod(Quantize)
2131d850 3229_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3230
3231def Quantize_Quantize(*args, **kwargs):
554f62e9 3232 """
c0de73ae
RD
3233 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3234
3235 Reduce the colours in the source image and put the result into the
3236 destination image, setting the palette in the destination if
3237 needed. Both images may be the same, to overwrite the source image.
3238 """
554f62e9 3239 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3240
d55e5bfc
RD
3241#---------------------------------------------------------------------------
3242
3243class EvtHandler(Object):
093d3ff1 3244 """Proxy of C++ EvtHandler class"""
554f62e9
RD
3245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3246 __repr__ = _swig_repr
3247 def __init__(self, *args, **kwargs):
d55e5bfc 3248 """__init__(self) -> EvtHandler"""
554f62e9 3249 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d55e5bfc
RD
3250 def GetNextHandler(*args, **kwargs):
3251 """GetNextHandler(self) -> EvtHandler"""
3252 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3253
3254 def GetPreviousHandler(*args, **kwargs):
3255 """GetPreviousHandler(self) -> EvtHandler"""
3256 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3257
3258 def SetNextHandler(*args, **kwargs):
3259 """SetNextHandler(self, EvtHandler handler)"""
3260 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3261
3262 def SetPreviousHandler(*args, **kwargs):
3263 """SetPreviousHandler(self, EvtHandler handler)"""
3264 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3265
3266 def GetEvtHandlerEnabled(*args, **kwargs):
3267 """GetEvtHandlerEnabled(self) -> bool"""
3268 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3269
3270 def SetEvtHandlerEnabled(*args, **kwargs):
3271 """SetEvtHandlerEnabled(self, bool enabled)"""
3272 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3273
3274 def ProcessEvent(*args, **kwargs):
3275 """ProcessEvent(self, Event event) -> bool"""
3276 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3277
3278 def AddPendingEvent(*args, **kwargs):
3279 """AddPendingEvent(self, Event event)"""
3280 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3281
3282 def ProcessPendingEvents(*args, **kwargs):
3283 """ProcessPendingEvents(self)"""
3284 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3285
3286 def Connect(*args, **kwargs):
3287 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3288 return _core_.EvtHandler_Connect(*args, **kwargs)
3289
3290 def Disconnect(*args, **kwargs):
f460c29d 3291 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
d55e5bfc
RD
3292 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3293
3294 def _setOORInfo(*args, **kwargs):
093d3ff1 3295 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3296 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3297 args[0].thisown = 0
3298 return val
d55e5bfc
RD
3299
3300 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3301 """
3302 Bind an event to an event handler.
3303
caef1a4d
RD
3304 :param event: One of the EVT_* objects that specifies the
3305 type of event to bind,
d55e5bfc 3306
caef1a4d
RD
3307 :param handler: A callable object to be invoked when the
3308 event is delivered to self. Pass None to
3309 disconnect an event handler.
d55e5bfc 3310
caef1a4d
RD
3311 :param source: Sometimes the event originates from a
3312 different window than self, but you still
3313 want to catch it in self. (For example, a
3314 button event delivered to a frame.) By
3315 passing the source of the event, the event
3316 handling system is able to differentiate
3317 between the same event type from different
3318 controls.
d55e5bfc 3319
caef1a4d
RD
3320 :param id: Used to spcify the event source by ID instead
3321 of instance.
3322
3323 :param id2: Used when it is desirable to bind a handler
3324 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3325 """
3326 if source is not None:
3327 id = source.GetId()
3328 event.Bind(self, id, id2, handler)
3329
c24da6d6
RD
3330 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3331 """
3332 Disconencts the event handler binding for event from self.
3333 Returns True if successful.
3334 """
3335 if source is not None:
3336 id = source.GetId()
3337 return event.Unbind(self, id, id2)
d55e5bfc 3338
2131d850 3339_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3340
3341#---------------------------------------------------------------------------
3342
3343class PyEventBinder(object):
3344 """
3345 Instances of this class are used to bind specific events to event
3346 handlers.
3347 """
3348 def __init__(self, evtType, expectedIDs=0):
3349 if expectedIDs not in [0, 1, 2]:
3350 raise ValueError, "Invalid number of expectedIDs"
3351 self.expectedIDs = expectedIDs
3352
3353 if type(evtType) == list or type(evtType) == tuple:
3354 self.evtType = evtType
3355 else:
3356 self.evtType = [evtType]
3357
3358
3359 def Bind(self, target, id1, id2, function):
3360 """Bind this set of event types to target."""
3361 for et in self.evtType:
3362 target.Connect(id1, id2, et, function)
3363
c24da6d6
RD
3364
3365 def Unbind(self, target, id1, id2):
3366 """Remove an event binding."""
3367 success = 0
3368 for et in self.evtType:
3369 success += target.Disconnect(id1, id2, et)
3370 return success != 0
3371
d55e5bfc
RD
3372
3373 def __call__(self, *args):
3374 """
3375 For backwards compatibility with the old EVT_* functions.
3376 Should be called with either (window, func), (window, ID,
3377 func) or (window, ID1, ID2, func) parameters depending on the
3378 type of the event.
3379 """
3380 assert len(args) == 2 + self.expectedIDs
3381 id1 = wx.ID_ANY
3382 id2 = wx.ID_ANY
3383 target = args[0]
3384 if self.expectedIDs == 0:
3385 func = args[1]
3386 elif self.expectedIDs == 1:
3387 id1 = args[1]
3388 func = args[2]
3389 elif self.expectedIDs == 2:
3390 id1 = args[1]
3391 id2 = args[2]
3392 func = args[3]
3393 else:
3394 raise ValueError, "Unexpected number of IDs"
3395
3396 self.Bind(target, id1, id2, func)
3397
3398
3399# These two are square pegs that don't fit the PyEventBinder hole...
3400def EVT_COMMAND(win, id, cmd, func):
3401 win.Connect(id, -1, cmd, func)
3402def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3403 win.Connect(id1, id2, cmd, func)
3404
3405
3406#---------------------------------------------------------------------------
3407
3408#---------------------------------------------------------------------------
3409
3410EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3411EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3412
554f62e9 3413def NewEventType(*args):
f460c29d 3414 """NewEventType() -> EventType"""
554f62e9 3415 return _core_.NewEventType(*args)
d55e5bfc
RD
3416wxEVT_NULL = _core_.wxEVT_NULL
3417wxEVT_FIRST = _core_.wxEVT_FIRST
3418wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3419wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3420wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3421wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3422wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3423wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3424wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3425wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3426wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3427wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3428wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3429wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3430wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3431wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3432wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3433wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3434wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3435wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3436wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3437wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3438wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3439wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3440wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3441wxEVT_MOTION = _core_.wxEVT_MOTION
3442wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3443wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3444wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3445wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3446wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3447wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3448wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3449wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3450wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3451wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3452wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3453wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3454wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3455wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3456wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3457wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3458wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3459wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3460wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3461wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3462wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3463wxEVT_CHAR = _core_.wxEVT_CHAR
3464wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3465wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3466wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3467wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3468wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3469wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3470wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3471wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3472wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3473wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3474wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3475wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3476wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3477wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
db67f999
RD
3478wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3479wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
d55e5bfc
RD
3480wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3481wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3482wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3483wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3484wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3485wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3486wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3487wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3488wxEVT_SIZE = _core_.wxEVT_SIZE
3489wxEVT_MOVE = _core_.wxEVT_MOVE
3490wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3491wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3492wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3493wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
d55e5bfc
RD
3494wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3495wxEVT_CREATE = _core_.wxEVT_CREATE
3496wxEVT_DESTROY = _core_.wxEVT_DESTROY
3497wxEVT_SHOW = _core_.wxEVT_SHOW
3498wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3499wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3500wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3501wxEVT_PAINT = _core_.wxEVT_PAINT
3502wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3503wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3504wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3505wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3506wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3507wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3508wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3509wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3510wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3511wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3512wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3513wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3514wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3515wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3516wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3517wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3518wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3519wxEVT_IDLE = _core_.wxEVT_IDLE
3520wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3521wxEVT_SIZING = _core_.wxEVT_SIZING
3522wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3523wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3524wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3525wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3526wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
d55e5bfc
RD
3527wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3528wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3529wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3530wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3531wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3532wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3533wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3534#
3535# Create some event binders
3536EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3537EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3538EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3539EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3540EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3541EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3542EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3543EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3544EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3545EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3546EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3547EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3548EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3549EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3550EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3551EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3552EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3553EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3554EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3555EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3556EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3557EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3558EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3559EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3560EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3561EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3562EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3563EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3564EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3565EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3566EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3567EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3568EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3569EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3570EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3571EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3572EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3573EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3574EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3575EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3576EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3577
3578EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3579EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3580EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3581EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3582EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3583EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3584EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3585EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3586EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3587EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3588EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3589EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3590EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3591
3592EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3593 wxEVT_LEFT_UP,
3594 wxEVT_MIDDLE_DOWN,
3595 wxEVT_MIDDLE_UP,
3596 wxEVT_RIGHT_DOWN,
3597 wxEVT_RIGHT_UP,
3598 wxEVT_MOTION,
3599 wxEVT_LEFT_DCLICK,
3600 wxEVT_MIDDLE_DCLICK,
3601 wxEVT_RIGHT_DCLICK,
3602 wxEVT_ENTER_WINDOW,
3603 wxEVT_LEAVE_WINDOW,
3604 wxEVT_MOUSEWHEEL
3605 ])
3606
3607
3608# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3609EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3610 wxEVT_SCROLLWIN_BOTTOM,
3611 wxEVT_SCROLLWIN_LINEUP,
3612 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3613 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3614 wxEVT_SCROLLWIN_PAGEDOWN,
3615 wxEVT_SCROLLWIN_THUMBTRACK,
3616 wxEVT_SCROLLWIN_THUMBRELEASE,
3617 ])
3618
3619EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3620EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3621EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3622EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3623EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3624EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3625EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3626EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3627
27fb7603 3628# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3629EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3630 wxEVT_SCROLL_BOTTOM,
3631 wxEVT_SCROLL_LINEUP,
3632 wxEVT_SCROLL_LINEDOWN,
3633 wxEVT_SCROLL_PAGEUP,
3634 wxEVT_SCROLL_PAGEDOWN,
3635 wxEVT_SCROLL_THUMBTRACK,
3636 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3637 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3638 ])
3639
3640EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3641EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3642EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3643EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3644EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3645EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3646EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3647EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
db67f999
RD
3648EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3649EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3650
27fb7603 3651# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3652EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3653 wxEVT_SCROLL_BOTTOM,
3654 wxEVT_SCROLL_LINEUP,
3655 wxEVT_SCROLL_LINEDOWN,
3656 wxEVT_SCROLL_PAGEUP,
3657 wxEVT_SCROLL_PAGEDOWN,
3658 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3659 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3660 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3661 ], 1)
3662
3663EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3664EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3665EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3666EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3667EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3668EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3669EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3670EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
db67f999
RD
3671EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3672EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3673
3674EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3675EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3676EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3677EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3678EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3679EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3680EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3681EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3682EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3683EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3684
3685EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3686EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3687EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3688EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3689EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3690EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3691EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3692EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3693EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3694
3695
3696EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3697EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3698EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3699EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3700EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3701EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3702EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3703
3704EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3705
3706EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3707EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3708
3709EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3710
2131d850
RD
3711EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3712EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3713EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3714
3715
3716#---------------------------------------------------------------------------
3717
3718class Event(Object):
27fb7603
RD
3719 """
3720 An event is a structure holding information about an event passed to a
3721 callback or member function. wx.Event is an abstract base class for
3722 other event classes
3723 """
554f62e9
RD
3724 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3725 def __init__(self): raise AttributeError, "No constructor defined"
3726 __repr__ = _swig_repr
3727 __swig_destroy__ = _core_.delete_Event
3728 __del__ = lambda self : None;
d55e5bfc 3729 def SetEventType(*args, **kwargs):
27fb7603 3730 """
f460c29d 3731 SetEventType(self, EventType typ)
27fb7603
RD
3732
3733 Sets the specific type of the event.
3734 """
d55e5bfc
RD
3735 return _core_.Event_SetEventType(*args, **kwargs)
3736
3737 def GetEventType(*args, **kwargs):
27fb7603 3738 """
f460c29d 3739 GetEventType(self) -> EventType
27fb7603
RD
3740
3741 Returns the identifier of the given event type, such as
3742 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3743 """
d55e5bfc
RD
3744 return _core_.Event_GetEventType(*args, **kwargs)
3745
3746 def GetEventObject(*args, **kwargs):
27fb7603
RD
3747 """
3748 GetEventObject(self) -> Object
3749
3750 Returns the object (usually a window) associated with the event, if
3751 any.
3752 """
d55e5bfc
RD
3753 return _core_.Event_GetEventObject(*args, **kwargs)
3754
3755 def SetEventObject(*args, **kwargs):
27fb7603
RD
3756 """
3757 SetEventObject(self, Object obj)
3758
3759 Sets the originating object, or in other words, obj is normally the
3760 object that is sending the event.
3761 """
d55e5bfc
RD
3762 return _core_.Event_SetEventObject(*args, **kwargs)
3763
3764 def GetTimestamp(*args, **kwargs):
3765 """GetTimestamp(self) -> long"""
3766 return _core_.Event_GetTimestamp(*args, **kwargs)
3767
3768 def SetTimestamp(*args, **kwargs):
3769 """SetTimestamp(self, long ts=0)"""
3770 return _core_.Event_SetTimestamp(*args, **kwargs)
3771
3772 def GetId(*args, **kwargs):
27fb7603
RD
3773 """
3774 GetId(self) -> int
3775
3776 Returns the identifier associated with this event, such as a button
3777 command id.
3778 """
d55e5bfc
RD
3779 return _core_.Event_GetId(*args, **kwargs)
3780
3781 def SetId(*args, **kwargs):
27fb7603
RD
3782 """
3783 SetId(self, int Id)
3784
3785 Set's the ID for the event. This is usually the ID of the window that
3786 is sending the event, but it can also be a command id from a menu
3787 item, etc.
3788 """
d55e5bfc
RD
3789 return _core_.Event_SetId(*args, **kwargs)
3790
3791 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3792 """
3793 IsCommandEvent(self) -> bool
3794
3795 Returns true if the event is or is derived from `wx.CommandEvent` else
3796 it returns false. Note: Exists only for optimization purposes.
3797 """
d55e5bfc
RD
3798 return _core_.Event_IsCommandEvent(*args, **kwargs)
3799
3800 def Skip(*args, **kwargs):
51b83b37
RD
3801 """
3802 Skip(self, bool skip=True)
3803
3804 Called by an event handler, it controls whether additional event
3805 handlers bound to this event will be called after the current event
3806 handler returns. Skip(false) (the default setting) will prevent
3807 additional event handlers from being called and control will be
3808 returned to the sender of the event immediately after the current
3809 handler has finished. Skip(True) will cause the event processing
3810 system to continue searching for a handler function for this event.
3811
3812 """
d55e5bfc
RD
3813 return _core_.Event_Skip(*args, **kwargs)
3814
3815 def GetSkipped(*args, **kwargs):
27fb7603
RD
3816 """
3817 GetSkipped(self) -> bool
3818
3819 Returns true if the event handler should be skipped, false otherwise.
3820 :see: `Skip`
3821 """
d55e5bfc
RD
3822 return _core_.Event_GetSkipped(*args, **kwargs)
3823
3824 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3825 """
3826 ShouldPropagate(self) -> bool
3827
3828 Test if this event should be propagated to the parent window or not,
3829 i.e. if the propagation level is currently greater than 0.
3830 """
d55e5bfc
RD
3831 return _core_.Event_ShouldPropagate(*args, **kwargs)
3832
3833 def StopPropagation(*args, **kwargs):
27fb7603
RD
3834 """
3835 StopPropagation(self) -> int
3836
3837 Stop the event from propagating to its parent window. Returns the old
3838 propagation level value which may be later passed to
3839 `ResumePropagation` to allow propagating the event again.
3840 """
d55e5bfc
RD
3841 return _core_.Event_StopPropagation(*args, **kwargs)
3842
3843 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3844 """
3845 ResumePropagation(self, int propagationLevel)
3846
3847 Resume the event propagation by restoring the propagation level. (For
3848 example, you can use the value returned by an earlier call to
3849 `StopPropagation`.)
3850
3851 """
d55e5bfc
RD
3852 return _core_.Event_ResumePropagation(*args, **kwargs)
3853
3854 def Clone(*args, **kwargs):
3855 """Clone(self) -> Event"""
3856 return _core_.Event_Clone(*args, **kwargs)
3857
2131d850 3858_core_.Event_swigregister(Event)
d55e5bfc
RD
3859
3860#---------------------------------------------------------------------------
3861
3862class PropagationDisabler(object):
27fb7603
RD
3863 """
3864 Helper class to temporarily change an event not to propagate. Simply
3865 create an instance of this class and then whe it is destroyed the
3866 propogation of the event will be restored.
3867 """
554f62e9
RD
3868 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3869 __repr__ = _swig_repr
3870 def __init__(self, *args, **kwargs):
27fb7603
RD
3871 """
3872 __init__(self, Event event) -> PropagationDisabler
3873
3874 Helper class to temporarily change an event not to propagate. Simply
3875 create an instance of this class and then whe it is destroyed the
3876 propogation of the event will be restored.
3877 """
554f62e9
RD
3878 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3879 __swig_destroy__ = _core_.delete_PropagationDisabler
3880 __del__ = lambda self : None;
2131d850 3881_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc
RD
3882
3883class PropagateOnce(object):
27fb7603
RD
3884 """
3885 A helper class that will temporarily lower propagation level of an
3886 event. Simply create an instance of this class and then whe it is
3887 destroyed the propogation of the event will be restored.
3888 """
554f62e9
RD
3889 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3890 __repr__ = _swig_repr
3891 def __init__(self, *args, **kwargs):
27fb7603
RD
3892 """
3893 __init__(self, Event event) -> PropagateOnce
3894
3895 A helper class that will temporarily lower propagation level of an
3896 event. Simply create an instance of this class and then whe it is
3897 destroyed the propogation of the event will be restored.
3898 """
554f62e9
RD
3899 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3900 __swig_destroy__ = _core_.delete_PropagateOnce
3901 __del__ = lambda self : None;
2131d850 3902_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
3903
3904#---------------------------------------------------------------------------
3905
3906class CommandEvent(Event):
27fb7603
RD
3907 """
3908 This event class contains information about command events, which
3909 originate from a variety of simple controls, as well as menus and
3910 toolbars.
3911 """
554f62e9
RD
3912 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3913 __repr__ = _swig_repr
3914 def __init__(self, *args, **kwargs):
27fb7603 3915 """
f460c29d 3916 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
3917
3918 This event class contains information about command events, which
3919 originate from a variety of simple controls, as well as menus and
3920 toolbars.
3921 """
554f62e9 3922 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 3923 def GetSelection(*args, **kwargs):
27fb7603
RD
3924 """
3925 GetSelection(self) -> int
3926
3927 Returns item index for a listbox or choice selection event (not valid
3928 for a deselection).
3929 """
d55e5bfc
RD
3930 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3931
3932 def SetString(*args, **kwargs):
3933 """SetString(self, String s)"""
3934 return _core_.CommandEvent_SetString(*args, **kwargs)
3935
3936 def GetString(*args, **kwargs):
27fb7603
RD
3937 """
3938 GetString(self) -> String
3939
3940 Returns item string for a listbox or choice selection event (not valid
3941 for a deselection).
3942 """
d55e5bfc
RD
3943 return _core_.CommandEvent_GetString(*args, **kwargs)
3944
3945 def IsChecked(*args, **kwargs):
27fb7603
RD
3946 """
3947 IsChecked(self) -> bool
3948
3949 This method can be used with checkbox and menu events: for the
3950 checkboxes, the method returns true for a selection event and false
3951 for a deselection one. For the menu events, this method indicates if
3952 the menu item just has become checked or unchecked (and thus only
3953 makes sense for checkable menu items).
3954 """
d55e5bfc
RD
3955 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3956
3957 Checked = IsChecked
3958 def IsSelection(*args, **kwargs):
27fb7603
RD
3959 """
3960 IsSelection(self) -> bool
3961
3962 For a listbox or similar event, returns true if it is a selection,
3963 false if it is a deselection.
3964 """
d55e5bfc
RD
3965 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3966
3967 def SetExtraLong(*args, **kwargs):
3968 """SetExtraLong(self, long extraLong)"""
3969 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3970
3971 def GetExtraLong(*args, **kwargs):
27fb7603
RD
3972 """
3973 GetExtraLong(self) -> long
3974
5ba5649b
RD
3975 Returns extra information dependant on the event objects type. If the
3976 event comes from a listbox selection, it is a boolean determining
3977 whether the event was a selection (true) or a deselection (false). A
3978 listbox deselection only occurs for multiple-selection boxes, and in
3979 this case the index and string values are indeterminate and the
3980 listbox must be examined by the application.
27fb7603 3981 """
d55e5bfc
RD
3982 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3983
3984 def SetInt(*args, **kwargs):
3985 """SetInt(self, int i)"""
3986 return _core_.CommandEvent_SetInt(*args, **kwargs)
3987
3988 def GetInt(*args, **kwargs):
27fb7603 3989 """
f460c29d 3990 GetInt(self) -> int
27fb7603 3991
5ba5649b
RD
3992 Returns the integer identifier corresponding to a listbox, choice or
3993 radiobox selection (only if the event was a selection, not a
3994 deselection), or a boolean value representing the value of a checkbox.
27fb7603 3995 """
d55e5bfc
RD
3996 return _core_.CommandEvent_GetInt(*args, **kwargs)
3997
554f62e9
RD
3998 def GetClientData(*args, **kwargs):
3999 """
4000 GetClientData(self) -> PyObject
4001
4002 Returns the client data object for a listbox or choice selection event, (if any.)
4003 """
4004 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4005
4006 def SetClientData(*args, **kwargs):
4007 """
4008 SetClientData(self, PyObject clientData)
4009
4010 Associate the given client data with the item at position n.
4011 """
4012 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4013
4014 GetClientObject = GetClientData
4015 SetClientObject = SetClientData
4016
d55e5bfc
RD
4017 def Clone(*args, **kwargs):
4018 """Clone(self) -> Event"""
4019 return _core_.CommandEvent_Clone(*args, **kwargs)
4020
2131d850 4021_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4022
4023#---------------------------------------------------------------------------
4024
4025class NotifyEvent(CommandEvent):
27fb7603
RD
4026 """
4027 An instance of this class (or one of its derived classes) is sent from
4028 a control when the control's state is being changed and the control
4029 allows that change to be prevented from happening. The event handler
4030 can call `Veto` or `Allow` to tell the control what to do.
4031 """
554f62e9
RD
4032 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4033 __repr__ = _swig_repr
4034 def __init__(self, *args, **kwargs):
27fb7603 4035 """
f460c29d 4036 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4037
4038 An instance of this class (or one of its derived classes) is sent from
4039 a control when the control's state is being changed and the control
4040 allows that change to be prevented from happening. The event handler
4041 can call `Veto` or `Allow` to tell the control what to do.
4042 """
554f62e9 4043 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4044 def Veto(*args, **kwargs):
27fb7603
RD
4045 """
4046 Veto(self)
4047
4048 Prevents the change announced by this event from happening.
4049
4050 It is in general a good idea to notify the user about the reasons for
4051 vetoing the change because otherwise the applications behaviour (which
4052 just refuses to do what the user wants) might be quite surprising.
4053 """
d55e5bfc
RD
4054 return _core_.NotifyEvent_Veto(*args, **kwargs)
4055
4056 def Allow(*args, **kwargs):
27fb7603
RD
4057 """
4058 Allow(self)
4059
4060 This is the opposite of `Veto`: it explicitly allows the event to be
4061 processed. For most events it is not necessary to call this method as
4062 the events are allowed anyhow but some are forbidden by default (this
4063 will be mentioned in the corresponding event description).
4064 """
d55e5bfc
RD
4065 return _core_.NotifyEvent_Allow(*args, **kwargs)
4066
4067 def IsAllowed(*args, **kwargs):
27fb7603
RD
4068 """
4069 IsAllowed(self) -> bool
4070
4071 Returns true if the change is allowed (`Veto` hasn't been called) or
4072 false otherwise (if it was).
4073 """
d55e5bfc
RD
4074 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4075
2131d850 4076_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4077
4078#---------------------------------------------------------------------------
4079
4080class ScrollEvent(CommandEvent):
27fb7603
RD
4081 """
4082 A scroll event holds information about events sent from stand-alone
4083 scrollbars and sliders. Note that scrolled windows do not send
4084 instnaces of this event class, but send the `wx.ScrollWinEvent`
4085 instead.
4086 """
554f62e9
RD
4087 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4088 __repr__ = _swig_repr
4089 def __init__(self, *args, **kwargs):
d55e5bfc 4090 """
f460c29d 4091 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
d55e5bfc
RD
4092 int orient=0) -> ScrollEvent
4093 """
554f62e9 4094 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4095 def GetOrientation(*args, **kwargs):
27fb7603
RD
4096 """
4097 GetOrientation(self) -> int
4098
4099 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4100 the scrollbar.
4101 """
d55e5bfc
RD
4102 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4103
4104 def GetPosition(*args, **kwargs):
27fb7603
RD
4105 """
4106 GetPosition(self) -> int
4107
4108 Returns the position of the scrollbar.
4109 """
d55e5bfc
RD
4110 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4111
4112 def SetOrientation(*args, **kwargs):
4113 """SetOrientation(self, int orient)"""
4114 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4115
4116 def SetPosition(*args, **kwargs):
4117 """SetPosition(self, int pos)"""
4118 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4119
2131d850 4120_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4121
4122#---------------------------------------------------------------------------
4123
4124class ScrollWinEvent(Event):
27fb7603
RD
4125 """
4126 A wx.ScrollWinEvent holds information about scrolling and is sent from
4127 scrolling windows.
4128 """
554f62e9
RD
4129 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4130 __repr__ = _swig_repr
4131 def __init__(self, *args, **kwargs):
27fb7603 4132 """
f460c29d 4133 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4134
4135 A wx.ScrollWinEvent holds information about scrolling and is sent from
4136 scrolling windows.
4137 """
554f62e9 4138 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4139 def GetOrientation(*args, **kwargs):
27fb7603
RD
4140 """
4141 GetOrientation(self) -> int
4142
4143 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4144 the scrollbar.
4145 """
d55e5bfc
RD
4146 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4147
4148 def GetPosition(*args, **kwargs):
27fb7603
RD
4149 """
4150 GetPosition(self) -> int
4151
4152 Returns the position of the scrollbar for the thumb track and release
4153 events. Note that this field can't be used for the other events, you
4154 need to query the window itself for the current position in that case.
4155 """
d55e5bfc
RD
4156 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4157
4158 def SetOrientation(*args, **kwargs):
4159 """SetOrientation(self, int orient)"""
4160 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4161
4162 def SetPosition(*args, **kwargs):
4163 """SetPosition(self, int pos)"""
4164 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4165
2131d850 4166_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4167
4168#---------------------------------------------------------------------------
4169
4170MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4171MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4172MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4173MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4174MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4175class MouseEvent(Event):
27fb7603
RD
4176 """
4177 This event class contains information about the events generated by
4178 the mouse: they include mouse buttons press and release events and
4179 mouse move events.
4180
4181 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4182 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4183 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4184 a middle button so a portable application should avoid relying on the
4185 events from it.
4186
4187 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4188 the former returns true when the event corresponds to the left mouse
4189 button click while the latter returns true if the left mouse button is
4190 currently being pressed. For example, when the user is dragging the
4191 mouse you can use `LeftIsDown` to test whether the left mouse button
4192 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4193 `LeftIsDown` will also return true in wxWidgets whatever the
4194 underlying GUI behaviour is (which is platform-dependent). The same
4195 applies, of course, to other mouse buttons as well.
4196 """
554f62e9
RD
4197 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4198 __repr__ = _swig_repr
4199 def __init__(self, *args, **kwargs):
27fb7603 4200 """
f460c29d 4201 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4202
4203 Constructs a wx.MouseEvent. Valid event types are:
4204
4205 * wxEVT_ENTER_WINDOW
4206 * wxEVT_LEAVE_WINDOW
4207 * wxEVT_LEFT_DOWN
4208 * wxEVT_LEFT_UP
4209 * wxEVT_LEFT_DCLICK
4210 * wxEVT_MIDDLE_DOWN
4211 * wxEVT_MIDDLE_UP
4212 * wxEVT_MIDDLE_DCLICK
4213 * wxEVT_RIGHT_DOWN
4214 * wxEVT_RIGHT_UP
4215 * wxEVT_RIGHT_DCLICK
4216 * wxEVT_MOTION
4217 * wxEVT_MOUSEWHEEL
4218 """
554f62e9 4219 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4220 def IsButton(*args, **kwargs):
27fb7603
RD
4221 """
4222 IsButton(self) -> bool
4223
4224 Returns true if the event was a mouse button event (not necessarily a
4225 button down event - that may be tested using `ButtonDown`).
4226 """
d55e5bfc
RD
4227 return _core_.MouseEvent_IsButton(*args, **kwargs)
4228
4229 def ButtonDown(*args, **kwargs):
27fb7603
RD
4230 """
4231 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4232
5ba5649b
RD
4233 If the argument is omitted, this returns true if the event was any
4234 mouse button down event. Otherwise the argument specifies which
4235 button-down event shold be checked for (see `Button` for the possible
4236 values).
27fb7603 4237 """
d55e5bfc
RD
4238 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4239
4240 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4241 """
4242 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4243
4244 If the argument is omitted, this returns true if the event was any
4245 mouse double click event. Otherwise the argument specifies which
4246 double click event to check for (see `Button` for the possible
4247 values).
4248 """
d55e5bfc
RD
4249 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4250
4251 def ButtonUp(*args, **kwargs):
27fb7603
RD
4252 """
4253 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4254
4255 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4256 mouse button up event. Otherwise the argument specifies which button
4257 up event to check for (see `Button` for the possible values).
27fb7603 4258 """
d55e5bfc
RD
4259 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4260
4261 def Button(*args, **kwargs):
27fb7603
RD
4262 """
4263 Button(self, int button) -> bool
4264
4265 Returns true if the identified mouse button is changing state. Valid
4266 values of button are:
4267
4268 ==================== =====================================
4269 wx.MOUSE_BTN_LEFT check if left button was pressed
4270 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4271 wx.MOUSE_BTN_RIGHT check if right button was pressed
4272 wx.MOUSE_BTN_ANY check if any button was pressed
4273 ==================== =====================================
4274
4275 """
d55e5bfc
RD
4276 return _core_.MouseEvent_Button(*args, **kwargs)
4277
4278 def ButtonIsDown(*args, **kwargs):
4279 """ButtonIsDown(self, int but) -> bool"""
4280 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4281
4282 def GetButton(*args, **kwargs):
27fb7603
RD
4283 """
4284 GetButton(self) -> int
4285
4286 Returns the mouse button which generated this event or
4287 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4288 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4289 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4290 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4291 right buttons respectively.
4292 """
d55e5bfc
RD
4293 return _core_.MouseEvent_GetButton(*args, **kwargs)
4294
4295 def ControlDown(*args, **kwargs):
27fb7603
RD
4296 """
4297 ControlDown(self) -> bool
4298
4299 Returns true if the control key was down at the time of the event.
4300 """
d55e5bfc
RD
4301 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4302
4303 def MetaDown(*args, **kwargs):
27fb7603
RD
4304 """
4305 MetaDown(self) -> bool
4306
4307 Returns true if the Meta key was down at the time of the event.
4308 """
d55e5bfc
RD
4309 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4310
4311 def AltDown(*args, **kwargs):
27fb7603
RD
4312 """
4313 AltDown(self) -> bool
4314
4315 Returns true if the Alt key was down at the time of the event.
4316 """
d55e5bfc
RD
4317 return _core_.MouseEvent_AltDown(*args, **kwargs)
4318
4319 def ShiftDown(*args, **kwargs):
27fb7603
RD
4320 """
4321 ShiftDown(self) -> bool
4322
4323 Returns true if the Shift key was down at the time of the event.
4324 """
d55e5bfc
RD
4325 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4326
412d302d
RD
4327 def CmdDown(*args, **kwargs):
4328 """
4329 CmdDown(self) -> bool
4330
4331 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4332 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4333 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4334 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4335 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4336 purpose. So for non-Mac platforms this is the same as `ControlDown`
4337 and Macs this is the same as `MetaDown`.
4338 """
4339 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4340
d55e5bfc 4341 def LeftDown(*args, **kwargs):
27fb7603
RD
4342 """
4343 LeftDown(self) -> bool
4344
4345 Returns true if the left mouse button state changed to down.
4346 """
d55e5bfc
RD
4347 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4348
4349 def MiddleDown(*args, **kwargs):
27fb7603
RD
4350 """
4351 MiddleDown(self) -> bool
4352
4353 Returns true if the middle mouse button state changed to down.
4354 """
d55e5bfc
RD
4355 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4356
4357 def RightDown(*args, **kwargs):
27fb7603
RD
4358 """
4359 RightDown(self) -> bool
4360
4361 Returns true if the right mouse button state changed to down.
4362 """
d55e5bfc
RD
4363 return _core_.MouseEvent_RightDown(*args, **kwargs)
4364
4365 def LeftUp(*args, **kwargs):
27fb7603
RD
4366 """
4367 LeftUp(self) -> bool
4368
4369 Returns true if the left mouse button state changed to up.
4370 """
d55e5bfc
RD
4371 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4372
4373 def MiddleUp(*args, **kwargs):
27fb7603
RD
4374 """
4375 MiddleUp(self) -> bool
4376
4377 Returns true if the middle mouse button state changed to up.
4378 """
d55e5bfc
RD
4379 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4380
4381 def RightUp(*args, **kwargs):
27fb7603
RD
4382 """
4383 RightUp(self) -> bool
4384
4385 Returns true if the right mouse button state changed to up.
4386 """
d55e5bfc
RD
4387 return _core_.MouseEvent_RightUp(*args, **kwargs)
4388
4389 def LeftDClick(*args, **kwargs):
27fb7603
RD
4390 """
4391 LeftDClick(self) -> bool
4392
4393 Returns true if the event was a left button double click.
4394 """
d55e5bfc
RD
4395 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4396
4397 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4398 """
4399 MiddleDClick(self) -> bool
4400
4401 Returns true if the event was a middle button double click.
4402 """
d55e5bfc
RD
4403 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4404
4405 def RightDClick(*args, **kwargs):
27fb7603
RD
4406 """
4407 RightDClick(self) -> bool
4408
4409 Returns true if the event was a right button double click.
4410 """
d55e5bfc
RD
4411 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4412
4413 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4414 """
4415 LeftIsDown(self) -> bool
4416
4417 Returns true if the left mouse button is currently down, independent
4418 of the current event type.
4419
4420 Please notice that it is not the same as LeftDown which returns true
4421 if the left mouse button was just pressed. Rather, it describes the
4422 state of the mouse button before the event happened.
4423
4424 This event is usually used in the mouse event handlers which process
4425 "move mouse" messages to determine whether the user is (still)
4426 dragging the mouse.
4427 """
d55e5bfc
RD
4428 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4429
4430 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4431 """
4432 MiddleIsDown(self) -> bool
4433
4434 Returns true if the middle mouse button is currently down, independent
4435 of the current event type.
4436 """
d55e5bfc
RD
4437 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4438
4439 def RightIsDown(*args, **kwargs):
27fb7603
RD
4440 """
4441 RightIsDown(self) -> bool
4442
4443 Returns true if the right mouse button is currently down, independent
4444 of the current event type.
4445 """
d55e5bfc
RD
4446 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4447
4448 def Dragging(*args, **kwargs):
27fb7603
RD
4449 """
4450 Dragging(self) -> bool
4451
4452 Returns true if this was a dragging event (motion while a button is
4453 depressed).
4454 """
d55e5bfc
RD
4455 return _core_.MouseEvent_Dragging(*args, **kwargs)
4456
4457 def Moving(*args, **kwargs):
27fb7603
RD
4458 """
4459 Moving(self) -> bool
4460
4461 Returns true if this was a motion event and no mouse buttons were
4462 pressed. If any mouse button is held pressed, then this method returns
4463 false and Dragging returns true.
4464 """
d55e5bfc
RD
4465 return _core_.MouseEvent_Moving(*args, **kwargs)
4466
4467 def Entering(*args, **kwargs):
27fb7603
RD
4468 """
4469 Entering(self) -> bool
4470
4471 Returns true if the mouse was entering the window.
4472 """
d55e5bfc
RD
4473 return _core_.MouseEvent_Entering(*args, **kwargs)
4474
4475 def Leaving(*args, **kwargs):
27fb7603
RD
4476 """
4477 Leaving(self) -> bool
4478
4479 Returns true if the mouse was leaving the window.
4480 """
d55e5bfc
RD
4481 return _core_.MouseEvent_Leaving(*args, **kwargs)
4482
4483 def GetPosition(*args, **kwargs):
4484 """
4485 GetPosition(self) -> Point
4486
27fb7603
RD
4487 Returns the pixel position of the mouse in window coordinates when the
4488 event happened.
d55e5bfc
RD
4489 """
4490 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4491
4492 def GetPositionTuple(*args, **kwargs):
4493 """
4494 GetPositionTuple() -> (x,y)
4495
27fb7603
RD
4496 Returns the pixel position of the mouse in window coordinates when the
4497 event happened.
d55e5bfc
RD
4498 """
4499 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4500
4501 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4502 """
4503 GetLogicalPosition(self, DC dc) -> Point
4504
4505 Returns the logical mouse position in pixels (i.e. translated
4506 according to the translation set for the DC, which usually indicates
4507 that the window has been scrolled).
4508 """
d55e5bfc
RD
4509 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4510
4511 def GetX(*args, **kwargs):
27fb7603
RD
4512 """
4513 GetX(self) -> int
4514
4515 Returns X coordinate of the physical mouse event position.
4516 """
d55e5bfc
RD
4517 return _core_.MouseEvent_GetX(*args, **kwargs)
4518
4519 def GetY(*args, **kwargs):
27fb7603
RD
4520 """
4521 GetY(self) -> int
4522
4523 Returns Y coordinate of the physical mouse event position.
4524 """
d55e5bfc
RD
4525 return _core_.MouseEvent_GetY(*args, **kwargs)
4526
4527 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4528 """
4529 GetWheelRotation(self) -> int
4530
4531 Get wheel rotation, positive or negative indicates direction of
4532 rotation. Current devices all send an event when rotation is equal to
4533 +/-WheelDelta, but this allows for finer resolution devices to be
4534 created in the future. Because of this you shouldn't assume that one
4535 event is equal to 1 line or whatever, but you should be able to either
4536 do partial line scrolling or wait until +/-WheelDelta rotation values
4537 have been accumulated before scrolling.
4538 """
d55e5bfc
RD
4539 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4540
4541 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4542 """
4543 GetWheelDelta(self) -> int
4544
4545 Get wheel delta, normally 120. This is the threshold for action to be
4546 taken, and one such action (for example, scrolling one increment)
4547 should occur for each delta.
4548 """
d55e5bfc
RD
4549 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4550
4551 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4552 """
4553 GetLinesPerAction(self) -> int
4554
4555 Returns the configured number of lines (or whatever) to be scrolled
4556 per wheel action. Defaults to three.
4557 """
d55e5bfc
RD
4558 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4559
4560 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4561 """
4562 IsPageScroll(self) -> bool
4563
4564 Returns true if the system has been setup to do page scrolling with
4565 the mouse wheel instead of line scrolling.
4566 """
d55e5bfc
RD
4567 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4568
4569 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4570 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4571 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4572 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4573 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4574 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4575 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4576 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4577 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4578 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4579 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4580 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
2131d850 4581_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4582
4583#---------------------------------------------------------------------------
4584
4585class SetCursorEvent(Event):
5ba5649b
RD
4586 """
4587 A SetCursorEvent is generated when the mouse cursor is about to be set
4588 as a result of mouse motion. This event gives the application the
4589 chance to perform specific mouse cursor processing based on the
4590 current position of the mouse within the window. Use the `SetCursor`
4591 method to specify the cursor you want to be displayed.
4592 """
554f62e9
RD
4593 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4594 __repr__ = _swig_repr
4595 def __init__(self, *args, **kwargs):
5ba5649b
RD
4596 """
4597 __init__(self, int x=0, int y=0) -> SetCursorEvent
4598
4599 Construct a new `wx.SetCursorEvent`.
4600 """
554f62e9 4601 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4602 def GetX(*args, **kwargs):
5ba5649b
RD
4603 """
4604 GetX(self) -> int
4605
4606 Returns the X coordinate of the mouse in client coordinates.
4607 """
d55e5bfc
RD
4608 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4609
4610 def GetY(*args, **kwargs):
5ba5649b
RD
4611 """
4612 GetY(self) -> int
4613
4614 Returns the Y coordinate of the mouse in client coordinates.
4615 """
d55e5bfc
RD
4616 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4617
4618 def SetCursor(*args, **kwargs):
5ba5649b
RD
4619 """
4620 SetCursor(self, Cursor cursor)
4621
4622 Sets the cursor associated with this event.
4623 """
d55e5bfc
RD
4624 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4625
4626 def GetCursor(*args, **kwargs):
5ba5649b
RD
4627 """
4628 GetCursor(self) -> Cursor
4629
4630 Returns a reference to the cursor specified by this event.
4631 """
d55e5bfc
RD
4632 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4633
4634 def HasCursor(*args, **kwargs):
5ba5649b
RD
4635 """
4636 HasCursor(self) -> bool
4637
4638 Returns true if the cursor specified by this event is a valid cursor.
4639 """
d55e5bfc
RD
4640 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4641
2131d850 4642_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4643
4644#---------------------------------------------------------------------------
4645
4646class KeyEvent(Event):
5ba5649b
RD
4647 """
4648 This event class contains information about keypress and character
4649 events. These events are only sent to the widget that currently has
4650 the keyboard focus.
4651
4652 Notice that there are three different kinds of keyboard events in
4653 wxWidgets: key down and up events and char events. The difference
4654 between the first two is clear - the first corresponds to a key press
4655 and the second to a key release - otherwise they are identical. Just
4656 note that if the key is maintained in a pressed state you will
4657 typically get a lot of (automatically generated) down events but only
4658 one up so it is wrong to assume that there is one up event
4659 corresponding to each down one.
4660
4661 Both key events provide untranslated key codes while the char event
4662 carries the translated one. The untranslated code for alphanumeric
4663 keys is always an upper case value. For the other keys it is one of
4664 WXK_XXX values from the keycodes table. The translated key is, in
4665 general, the character the user expects to appear as the result of the
4666 key combination when typing the text into a text entry zone, for
4667 example.
4668
4669 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4670 and the standard US keyboard): when the 'A' key is pressed, the key
4671 down event key code is equal to ASCII A == 65. But the char event key
4672 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4673 'A' keys simultaneously , the key code in key down event will still be
4674 just 'A' while the char event key code parameter will now be 'A' as
4675 well.
4676
4677 Although in this simple case it is clear that the correct key code
4678 could be found in the key down event handler by checking the value
4679 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4680 as for non alphanumeric keys or non-US keyboard layouts the
4681 translation is keyboard-layout dependent and can only be done properly
4682 by the system itself.
4683
4684 Another kind of translation is done when the control key is pressed:
4685 for example, for CTRL-A key press the key down event still carries the
4686 same key code 'A' as usual but the char event will have key code of 1,
4687 the ASCII value of this key combination.
4688
4689 You may discover how the other keys on your system behave
4690 interactively by running the KeyEvents sample in the wxPython demo and
4691 pressing some keys while the blue box at the top has the keyboard
4692 focus.
4693
4694 **Note**: If a key down event is caught and the event handler does not
4695 call event.Skip() then the coresponding char event will not
4696 happen. This is by design and enables the programs that handle both
4697 types of events to be a bit simpler.
4698
4699 **Note for Windows programmers**: The key and char events in wxWidgets
4700 are similar to but slightly different from Windows WM_KEYDOWN and
4701 WM_CHAR events. In particular, Alt-x combination will generate a char
4702 event in wxWidgets (unless it is used as an accelerator).
4703
4704 **Tip**: be sure to call event.Skip() for events that you don't
4705 process in key event function, otherwise menu shortcuts may cease to
4706 work under Windows.
4707
4708 """
554f62e9
RD
4709 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4710 __repr__ = _swig_repr
4711 def __init__(self, *args, **kwargs):
5ba5649b 4712 """
f460c29d 4713 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4714
4715 Construct a new `wx.KeyEvent`. Valid event types are:
4716 *
4717 """
554f62e9 4718 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4719 def GetModifiers(*args, **kwargs):
4720 """
4721 GetModifiers(self) -> int
4722
4723 Returns a bitmask of the current modifier settings. Can be used to
4724 check if the key event has exactly the given modifiers without having
4725 to explicitly check that the other modifiers are not down. For
4726 example::
4727
4728 if event.GetModifers() == wx.MOD_CONTROL:
4729 DoSomething()
4730
4731 """
4732 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4733
d55e5bfc 4734 def ControlDown(*args, **kwargs):
5ba5649b
RD
4735 """
4736 ControlDown(self) -> bool
4737
4738 Returns ``True`` if the Control key was down at the time of the event.
4739 """
d55e5bfc
RD
4740 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4741
4742 def MetaDown(*args, **kwargs):
5ba5649b
RD
4743 """
4744 MetaDown(self) -> bool
4745
4746 Returns ``True`` if the Meta key was down at the time of the event.
4747 """
d55e5bfc
RD
4748 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4749
4750 def AltDown(*args, **kwargs):
5ba5649b
RD
4751 """
4752 AltDown(self) -> bool
4753
4754 Returns ``True`` if the Alt key was down at the time of the event.
4755 """
d55e5bfc
RD
4756 return _core_.KeyEvent_AltDown(*args, **kwargs)
4757
4758 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4759 """
4760 ShiftDown(self) -> bool
4761
4762 Returns ``True`` if the Shift key was down at the time of the event.
4763 """
d55e5bfc
RD
4764 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4765
412d302d
RD
4766 def CmdDown(*args, **kwargs):
4767 """
4768 CmdDown(self) -> bool
4769
4770 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4771 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4772 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4773 because Cmd key is used for the same thing under Mac as Ctrl
4774 elsewhere. The Ctrl still exists, it's just not used for this
4775 purpose. So for non-Mac platforms this is the same as `ControlDown`
4776 and Macs this is the same as `MetaDown`.
4777 """
4778 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4779
d55e5bfc 4780 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4781 """
4782 HasModifiers(self) -> bool
4783
4784 Returns true if either CTRL or ALT keys was down at the time of the
4785 key event. Note that this function does not take into account neither
4786 SHIFT nor META key states (the reason for ignoring the latter is that
4787 it is common for NUMLOCK key to be configured as META under X but the
4788 key presses even while NUMLOCK is on should be still processed
4789 normally).
4790 """
d55e5bfc
RD
4791 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4792
4793 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4794 """
4795 GetKeyCode(self) -> int
4796
4797 Returns the virtual key code. ASCII events return normal ASCII values,
4798 while non-ASCII events return values such as WXK_LEFT for the left
4799 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4800 codes.
4801
4802 Note that in Unicode build, the returned value is meaningful only if
4803 the user entered a character that can be represented in current
4804 locale's default charset. You can obtain the corresponding Unicode
4805 character using `GetUnicodeKey`.
4806 """
d55e5bfc
RD
4807 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4808
4809 KeyCode = GetKeyCode
19272049 4810 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4811 """
4812 GetUnicodeKey(self) -> int
4813
4814 Returns the Unicode character corresponding to this key event. This
4815 function is only meaningfule in a Unicode build of wxPython.
4816 """
19272049 4817 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4818
19272049 4819 GetUniChar = GetUnicodeKey
d55e5bfc 4820 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4821 """
4822 GetRawKeyCode(self) -> unsigned int
4823
4824 Returns the raw key code for this event. This is a platform-dependent
4825 scan code which should only be used in advanced
4826 applications. Currently the raw key codes are not supported by all
4827 ports.
4828 """
d55e5bfc
RD
4829 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4830
4831 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4832 """
4833 GetRawKeyFlags(self) -> unsigned int
4834
4835 Returns the low level key flags for this event. The flags are
4836 platform-dependent and should only be used in advanced applications.
4837 Currently the raw key flags are not supported by all ports.
4838 """
d55e5bfc
RD
4839 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4840
4841 def GetPosition(*args, **kwargs):
4842 """
4843 GetPosition(self) -> Point
4844
5ba5649b 4845 Find the position of the event, if applicable.
d55e5bfc
RD
4846 """
4847 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4848
4849 def GetPositionTuple(*args, **kwargs):
4850 """
4851 GetPositionTuple() -> (x,y)
4852
5ba5649b 4853 Find the position of the event, if applicable.
d55e5bfc
RD
4854 """
4855 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4856
4857 def GetX(*args, **kwargs):
5ba5649b
RD
4858 """
4859 GetX(self) -> int
4860
4861 Returns the X position (in client coordinates) of the event, if
4862 applicable.
4863 """
d55e5bfc
RD
4864 return _core_.KeyEvent_GetX(*args, **kwargs)
4865
4866 def GetY(*args, **kwargs):
5ba5649b
RD
4867 """
4868 GetY(self) -> int
4869
4870 Returns the Y position (in client coordinates) of the event, if
4871 applicable.
4872 """
d55e5bfc
RD
4873 return _core_.KeyEvent_GetY(*args, **kwargs)
4874
4875 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4876 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4877 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4878 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4879 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4880 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4881 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4882 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4883 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4884 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
2131d850 4885_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
4886
4887#---------------------------------------------------------------------------
4888
4889class SizeEvent(Event):
5ba5649b
RD
4890 """
4891 A size event holds information about size change events. The EVT_SIZE
4892 handler function will be called when the window it is bound to has
4893 been resized.
4894
4895 Note that the size passed is of the whole window: call
4896 `wx.Window.GetClientSize` for the area which may be used by the
4897 application.
4898
4899 When a window is resized, usually only a small part of the window is
4900 damaged and and that area is all that is in the update region for the
4901 next paint event. However, if your drawing depends on the size of the
4902 window, you may need to clear the DC explicitly and repaint the whole
4903 window. In which case, you may need to call `wx.Window.Refresh` to
4904 invalidate the entire window.
4905
4906 """
554f62e9
RD
4907 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4908 __repr__ = _swig_repr
4909 def __init__(self, *args, **kwargs):
5ba5649b
RD
4910 """
4911 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4912
4913 Construct a new ``wx.SizeEvent``.
4914 """
554f62e9 4915 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 4916 def GetSize(*args, **kwargs):
5ba5649b
RD
4917 """
4918 GetSize(self) -> Size
4919
4920 Returns the entire size of the window generating the size change
4921 event.
4922 """
d55e5bfc
RD
4923 return _core_.SizeEvent_GetSize(*args, **kwargs)
4924
4925 def GetRect(*args, **kwargs):
4926 """GetRect(self) -> Rect"""
4927 return _core_.SizeEvent_GetRect(*args, **kwargs)
4928
4929 def SetRect(*args, **kwargs):
4930 """SetRect(self, Rect rect)"""
4931 return _core_.SizeEvent_SetRect(*args, **kwargs)
4932
4933 def SetSize(*args, **kwargs):
4934 """SetSize(self, Size size)"""
4935 return _core_.SizeEvent_SetSize(*args, **kwargs)
4936
4937 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4938 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 4939_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
4940
4941#---------------------------------------------------------------------------
4942
4943class MoveEvent(Event):
5ba5649b
RD
4944 """
4945 This event object is sent for EVT_MOVE event bindings when a window is
4946 moved to a new position.
4947 """
554f62e9
RD
4948 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4949 __repr__ = _swig_repr
4950 def __init__(self, *args, **kwargs):
5ba5649b
RD
4951 """
4952 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4953
4954 Constructor.
4955 """
554f62e9 4956 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 4957 def GetPosition(*args, **kwargs):
5ba5649b
RD
4958 """
4959 GetPosition(self) -> Point
4960
4961 Returns the position of the window generating the move change event.
4962 """
d55e5bfc
RD
4963 return _core_.MoveEvent_GetPosition(*args, **kwargs)
4964
4965 def GetRect(*args, **kwargs):
4966 """GetRect(self) -> Rect"""
4967 return _core_.MoveEvent_GetRect(*args, **kwargs)
4968
4969 def SetRect(*args, **kwargs):
4970 """SetRect(self, Rect rect)"""
4971 return _core_.MoveEvent_SetRect(*args, **kwargs)
4972
4973 def SetPosition(*args, **kwargs):
4974 """SetPosition(self, Point pos)"""
4975 return _core_.MoveEvent_SetPosition(*args, **kwargs)
4976
fef4c27a
RD
4977 m_pos = property(GetPosition, SetPosition)
4978 m_rect = property(GetRect, SetRect)
4979
2131d850 4980_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
4981
4982#---------------------------------------------------------------------------
4983
4984class PaintEvent(Event):
5ba5649b
RD
4985 """
4986 A paint event is sent when a window's contents needs to be repainted.
4987 Note that in an EVT_PAINT handler the application must *always* create
4988 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
4989 Windows assumes that the window has not been painted yet and will send
4990 the event again, causing endless refreshes.
4991
4992 You can optimize painting by retrieving the rectangles that have been
4993 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
4994 and only repainting these rectangles. The rectangles are in terms of
4995 the client area, and are unscrolled, so you will need to do some
4996 calculations using the current view position to obtain logical,
4997 scrolled units.
4998
4999 """
554f62e9
RD
5000 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5001 __repr__ = _swig_repr
5002 def __init__(self, *args, **kwargs):
d55e5bfc 5003 """__init__(self, int Id=0) -> PaintEvent"""
554f62e9 5004 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5005_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc
RD
5006
5007class NcPaintEvent(Event):
093d3ff1 5008 """Proxy of C++ NcPaintEvent class"""
554f62e9
RD
5009 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5010 __repr__ = _swig_repr
5011 def __init__(self, *args, **kwargs):
d55e5bfc 5012 """__init__(self, int winid=0) -> NcPaintEvent"""
554f62e9 5013 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5014_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5015
5016#---------------------------------------------------------------------------
5017
5018class EraseEvent(Event):
5ba5649b
RD
5019 """
5020 An erase event is sent whenever the background of a window needs to be
5021 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5022 binder. On some platforms, such as GTK+, this event is simulated
5023 (simply generated just before the paint event) and may cause flicker.
5024
5025 To paint a custom background use the `GetDC` method and use the returned
5026 device context if it is not ``None``, otherwise create a temporary
5027 `wx.ClientDC` and draw on that.
5028
5029 """
554f62e9
RD
5030 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5031 __repr__ = _swig_repr
5032 def __init__(self, *args, **kwargs):
5ba5649b
RD
5033 """
5034 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5035
5036 Constructor
5037 """
554f62e9 5038 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5039 def GetDC(*args, **kwargs):
5ba5649b
RD
5040 """
5041 GetDC(self) -> DC
5042
5043 Returns the device context the event handler should draw upon. If
5044 ``None`` is returned then create a temporary `wx.ClientDC` and use
5045 that instead.
5046 """
d55e5bfc
RD
5047 return _core_.EraseEvent_GetDC(*args, **kwargs)
5048
2131d850 5049_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5050
5051#---------------------------------------------------------------------------
5052
5053class FocusEvent(Event):
5ba5649b
RD
5054 """
5055 A focus event is sent when a window's focus changes. The window losing
5056 focus receives an EVT_KILL_FOCUS event while the window gaining it
5057 gets an EVT_SET_FOCUS event.
5058
5059 Notice that the set focus event happens both when the user gives focus
5060 to the window (whether using the mouse or keyboard) and when it is
5061 done from the program itself using `wx.Window.SetFocus`.
5062
5063 """
554f62e9
RD
5064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5065 __repr__ = _swig_repr
5066 def __init__(self, *args, **kwargs):
5ba5649b 5067 """
f460c29d 5068 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5069
5070 Constructor
5071 """
554f62e9 5072 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5073 def GetWindow(*args, **kwargs):
5ba5649b
RD
5074 """
5075 GetWindow(self) -> Window
5076
5077 Returns the other window associated with this event, that is the
5078 window which had the focus before for the EVT_SET_FOCUS event and the
5079 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5080
5081 Warning: the window returned may be None!
5082 """
d55e5bfc
RD
5083 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5084
5085 def SetWindow(*args, **kwargs):
5086 """SetWindow(self, Window win)"""
5087 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5088
2131d850 5089_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5090
5091#---------------------------------------------------------------------------
5092
5093class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5094 """
5095 wx.ChildFocusEvent notifies the parent that a child has received the
5096 focus. Unlike `wx.FocusEvent` it is propagated up the window
5097 heirarchy.
5098 """
554f62e9
RD
5099 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5100 __repr__ = _swig_repr
5101 def __init__(self, *args, **kwargs):
5ba5649b
RD
5102 """
5103 __init__(self, Window win=None) -> ChildFocusEvent
5104
5105 Constructor
5106 """
554f62e9 5107 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5108 def GetWindow(*args, **kwargs):
5ba5649b
RD
5109 """
5110 GetWindow(self) -> Window
5111
5112 The window which has just received the focus.
5113 """
d55e5bfc
RD
5114 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5115
2131d850 5116_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5117
5118#---------------------------------------------------------------------------
5119
5120class ActivateEvent(Event):
5ba5649b
RD
5121 """
5122 An activate event is sent when a top-level window or the entire
5123 application is being activated or deactivated.
5124
5125 A top-level window (a dialog or frame) receives an activate event when
5126 is being activated or deactivated. This is indicated visually by the
5127 title bar changing colour, and a subwindow gaining the keyboard focus.
5128 An application is activated or deactivated when one of its frames
5129 becomes activated, or a frame becomes inactivate resulting in all
5130 application frames being inactive.
5131
5132 Please note that usually you should call event.Skip() in your handlers
5133 for these events so the default handlers will still be called, as not
5134 doing so can result in strange effects.
5135
5136 """
554f62e9
RD
5137 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5138 __repr__ = _swig_repr
5139 def __init__(self, *args, **kwargs):
5ba5649b 5140 """
f460c29d 5141 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5142
5143 Constructor
5144 """
554f62e9 5145 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5146 def GetActive(*args, **kwargs):
5ba5649b
RD
5147 """
5148 GetActive(self) -> bool
5149
5150 Returns true if the application or window is being activated, false
5151 otherwise.
5152 """
d55e5bfc
RD
5153 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5154
2131d850 5155_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5156
5157#---------------------------------------------------------------------------
5158
5159class InitDialogEvent(Event):
5ba5649b
RD
5160 """
5161 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5162 any window when `wx.Window.InitDialog` is called. Handlers for this
5163 event can transfer data to the window, or anything else that should be
5164 done before the user begins editing the form. The default handler
5165 calls `wx.Window.TransferDataToWindow`.
5166 """
554f62e9
RD
5167 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5168 __repr__ = _swig_repr
5169 def __init__(self, *args, **kwargs):
5ba5649b
RD
5170 """
5171 __init__(self, int Id=0) -> InitDialogEvent
5172
5173 Constructor
5174 """
554f62e9 5175 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5176_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5177
5178#---------------------------------------------------------------------------
5179
5180class MenuEvent(Event):
5ba5649b
RD
5181 """
5182 This class is used for a variety of menu-related events. Note that
5183 these do not include menu command events, which are handled by sending
5184 `wx.CommandEvent` objects.
5185
5186 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5187 text in the first field of the status bar.
5188 """
554f62e9
RD
5189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5190 __repr__ = _swig_repr
5191 def __init__(self, *args, **kwargs):
5ba5649b 5192 """
f460c29d 5193 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5194
5195 Constructor
5196 """
554f62e9 5197 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5198 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5199 """
5200 GetMenuId(self) -> int
5201
5202 Returns the menu identifier associated with the event. This method
5203 should be only used with the HIGHLIGHT events.
5204 """
d55e5bfc
RD
5205 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5206
5207 def IsPopup(*args, **kwargs):
5ba5649b
RD
5208 """
5209 IsPopup(self) -> bool
5210
5211 Returns ``True`` if the menu which is being opened or closed is a
5212 popup menu, ``False`` if it is a normal one. This method should only
5213 be used with the OPEN and CLOSE events.
5214 """
d55e5bfc
RD
5215 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5216
5217 def GetMenu(*args, **kwargs):
5ba5649b
RD
5218 """
5219 GetMenu(self) -> Menu
5220
5221 Returns the menu which is being opened or closed. This method should
5222 only be used with the OPEN and CLOSE events.
5223 """
d55e5bfc
RD
5224 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5225
2131d850 5226_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5227
5228#---------------------------------------------------------------------------
5229
5230class CloseEvent(Event):
5ba5649b
RD
5231 """
5232 This event class contains information about window and session close
5233 events.
5234
5235 The handler function for EVT_CLOSE is called when the user has tried
5236 to close a a frame or dialog box using the window manager controls or
5237 the system menu. It can also be invoked by the application itself
5238 programmatically, for example by calling the `wx.Window.Close`
5239 function.
5240
5241 You should check whether the application is forcing the deletion of
5242 the window using `CanVeto`. If it returns ``False``, you must destroy
5243 the window using `wx.Window.Destroy`. If the return value is ``True``,
5244 it is up to you whether you respond by destroying the window or not.
5245 For example you may wish to display a message dialog prompting to save
5246 files or to cancel the close.
5247
5248 If you don't destroy the window, you should call `Veto` to let the
5249 calling code know that you did not destroy the window. This allows the
5250 `wx.Window.Close` function to return ``True`` or ``False`` depending
5251 on whether the close instruction was honored or not.
5252 """
554f62e9
RD
5253 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5254 __repr__ = _swig_repr
5255 def __init__(self, *args, **kwargs):
5ba5649b 5256 """
f460c29d 5257 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5258
5259 Constructor.
5260 """
554f62e9 5261 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5262 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5263 """
5264 SetLoggingOff(self, bool logOff)
5265
5266 Sets the 'logging off' flag.
5267 """
d55e5bfc
RD
5268 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5269
5270 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5271 """
5272 GetLoggingOff(self) -> bool
5273
034e3677
RD
5274 Returns ``True`` if the user is logging off or ``False`` if the
5275 system is shutting down. This method can only be called for end
5276 session and query end session events, it doesn't make sense for close
5277 window event.
5ba5649b 5278 """
d55e5bfc
RD
5279 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5280
5281 def Veto(*args, **kwargs):
5ba5649b
RD
5282 """
5283 Veto(self, bool veto=True)
5284
5285 Call this from your event handler to veto a system shutdown or to
5286 signal to the calling application that a window close did not happen.
5287
5288 You can only veto a shutdown or close if `CanVeto` returns true.
5289 """
d55e5bfc
RD
5290 return _core_.CloseEvent_Veto(*args, **kwargs)
5291
5ba5649b
RD
5292 def GetVeto(*args, **kwargs):
5293 """GetVeto(self) -> bool"""
5294 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5295
d55e5bfc 5296 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5297 """
5298 SetCanVeto(self, bool canVeto)
5299
5300 Sets the 'can veto' flag.
5301 """
d55e5bfc
RD
5302 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5303
5304 def CanVeto(*args, **kwargs):
5ba5649b
RD
5305 """
5306 CanVeto(self) -> bool
d55e5bfc 5307
5ba5649b
RD
5308 Returns true if you can veto a system shutdown or a window close
5309 event. Vetoing a window close event is not possible if the calling
5310 code wishes to force the application to exit, and so this function
5311 must be called to check this.
5312 """
5313 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5314
2131d850 5315_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5316
5317#---------------------------------------------------------------------------
5318
5319class ShowEvent(Event):
5ba5649b 5320 """An EVT_SHOW event is sent when a window is shown or hidden."""
554f62e9
RD
5321 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5322 __repr__ = _swig_repr
5323 def __init__(self, *args, **kwargs):
5ba5649b
RD
5324 """
5325 __init__(self, int winid=0, bool show=False) -> ShowEvent
5326
5327 An EVT_SHOW event is sent when a window is shown or hidden.
5328 """
554f62e9 5329 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5330 def SetShow(*args, **kwargs):
5331 """SetShow(self, bool show)"""
5332 return _core_.ShowEvent_SetShow(*args, **kwargs)
5333
5334 def GetShow(*args, **kwargs):
5335 """GetShow(self) -> bool"""
5336 return _core_.ShowEvent_GetShow(*args, **kwargs)
5337
2131d850 5338_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5339
5340#---------------------------------------------------------------------------
5341
5342class IconizeEvent(Event):
5ba5649b
RD
5343 """
5344 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5345 restored.
5346 """
554f62e9
RD
5347 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5348 __repr__ = _swig_repr
5349 def __init__(self, *args, **kwargs):
5ba5649b
RD
5350 """
5351 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5352
5353 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5354 restored.
5355 """
554f62e9 5356 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5357 def Iconized(*args, **kwargs):
5ba5649b
RD
5358 """
5359 Iconized(self) -> bool
5360
5361 Returns ``True`` if the frame has been iconized, ``False`` if it has
5362 been restored.
5363 """
d55e5bfc
RD
5364 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5365
2131d850 5366_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5367
5368#---------------------------------------------------------------------------
5369
5370class MaximizeEvent(Event):
5ba5649b 5371 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
554f62e9
RD
5372 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5373 __repr__ = _swig_repr
5374 def __init__(self, *args, **kwargs):
5ba5649b
RD
5375 """
5376 __init__(self, int id=0) -> MaximizeEvent
5377
5378 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5379 """
554f62e9 5380 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5381_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5382
5383#---------------------------------------------------------------------------
5384
5385class DropFilesEvent(Event):
5ba5649b
RD
5386 """
5387 This class is used for drop files events, that is, when files have
5388 been dropped onto the window. This functionality is only available
5389 under Windows. The window must have previously been enabled for
5390 dropping by calling `wx.Window.DragAcceptFiles`.
5391
5392 Important note: this is a separate implementation to the more general
5393 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5394 implementation uses the older, Windows message-based approach of
5395 dropping files.
5396
5397 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5398 events.
5399
5400 """
554f62e9
RD
5401 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5402 def __init__(self): raise AttributeError, "No constructor defined"
5403 __repr__ = _swig_repr
d55e5bfc 5404 def GetPosition(*args, **kwargs):
5ba5649b
RD
5405 """
5406 GetPosition(self) -> Point
5407
5408 Returns the position at which the files were dropped.
5409 """
d55e5bfc
RD
5410 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5411
5412 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5413 """
5414 GetNumberOfFiles(self) -> int
5415
5416 Returns the number of files dropped.
5417 """
d55e5bfc
RD
5418 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5419
5420 def GetFiles(*args, **kwargs):
5ba5649b
RD
5421 """
5422 GetFiles(self) -> PyObject
5423
5424 Returns a list of the filenames that were dropped.
5425 """
d55e5bfc
RD
5426 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5427
2131d850 5428_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5429
5430#---------------------------------------------------------------------------
5431
5432UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5433UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5434class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5435 """
5436 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5437 wxWidgets to give an application the chance to update various user
5438 interface elements.
5439
5440 Without update UI events, an application has to work hard to
5441 check/uncheck, enable/disable, and set the text for elements such as
5442 menu items and toolbar buttons. The code for doing this has to be
5443 mixed up with the code that is invoked when an action is invoked for a
5444 menu item or button.
5445
5446 With update UI events, you define an event handler to look at the
5447 state of the application and change UI elements accordingly. wxWidgets
5448 will call your handler functions in idle time, so you don't have to
5449 worry where to call this code. In addition to being a clearer and more
5450 declarative method, it also means you don't have to worry whether
5451 you're updating a toolbar or menubar identifier. The same handler can
5452 update a menu item and toolbar button, if the ID values are the same.
5453
5454 Instead of directly manipulating the menu or button, you call
5455 functions in the event object, such as `Check`. wxWidgets will
5456 determine whether such a call has been made, and which UI element to
5457 update.
5458
5459 These events will work for popup menus as well as menubars. Just
5460 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5461 any UI events for the window that owns the menu.
5462
5463 If you find that the overhead of UI update processing is affecting
5464 your application, you can do one or both of the following:
5465
5466 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5467 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5468 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5469 receive update events. No other windows will receive update
5470 events.
5471
5472 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5473 value to set the delay between updates. You may need to call
5474 `wx.Window.UpdateWindowUI` at critical points, for example when
5475 a dialog is about to be shown, in case the user sees a slight
5476 delay before windows are updated.
5477
5478 Note that although events are sent in idle time, defining a EVT_IDLE
5479 handler for a window does not affect this because the events are sent
5480 from an internal idle handler.
5481
5482 wxWidgets tries to optimize update events on some platforms. On
5483 Windows and GTK+, events for menubar items are only sent when the menu
5484 is about to be shown, and not in idle time.
5485
5486 """
554f62e9
RD
5487 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5488 __repr__ = _swig_repr
5489 def __init__(self, *args, **kwargs):
5ba5649b
RD
5490 """
5491 __init__(self, int commandId=0) -> UpdateUIEvent
5492
5493 Constructor
5494 """
554f62e9 5495 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5496 def GetChecked(*args, **kwargs):
5ba5649b
RD
5497 """
5498 GetChecked(self) -> bool
5499
5500 Returns ``True`` if the UI element should be checked.
5501 """
d55e5bfc
RD
5502 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5503
5504 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5505 """
5506 GetEnabled(self) -> bool
5507
5508 Returns ``True`` if the UI element should be enabled.
5509 """
d55e5bfc
RD
5510 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5511
554f62e9
RD
5512 def GetShown(*args, **kwargs):
5513 """
5514 GetShown(self) -> bool
5515
5516 Returns ``True`` if the UI element should be shown.
5517 """
5518 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5519
d55e5bfc 5520 def GetText(*args, **kwargs):
5ba5649b
RD
5521 """
5522 GetText(self) -> String
5523
5524 Returns the text that should be set for the UI element.
5525 """
d55e5bfc
RD
5526 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5527
5528 def GetSetText(*args, **kwargs):
5ba5649b
RD
5529 """
5530 GetSetText(self) -> bool
5531
5532 Returns ``True`` if the application has called `SetText`. For
5533 wxWidgets internal use only.
5534 """
d55e5bfc
RD
5535 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5536
5537 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5538 """
5539 GetSetChecked(self) -> bool
5540
5541 Returns ``True`` if the application has called `Check`. For wxWidgets
5542 internal use only.
5543 """
d55e5bfc
RD
5544 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5545
5546 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5547 """
5548 GetSetEnabled(self) -> bool
5549
5550 Returns ``True`` if the application has called `Enable`. For wxWidgets
5551 internal use only.
5552 """
d55e5bfc
RD
5553 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5554
554f62e9
RD
5555 def GetSetShown(*args, **kwargs):
5556 """
5557 GetSetShown(self) -> bool
5558
5559 Returns ``True`` if the application has called `Show`. For wxWidgets
5560 internal use only.
5561 """
5562 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5563
d55e5bfc 5564 def Check(*args, **kwargs):
5ba5649b
RD
5565 """
5566 Check(self, bool check)
5567
5568 Check or uncheck the UI element.
5569 """
d55e5bfc
RD
5570 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5571
5572 def Enable(*args, **kwargs):
5ba5649b
RD
5573 """
5574 Enable(self, bool enable)
5575
5576 Enable or disable the UI element.
5577 """
d55e5bfc
RD
5578 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5579
554f62e9
RD
5580 def Show(*args, **kwargs):
5581 """
5582 Show(self, bool show)
5583
5584 Show or hide the UI element.
5585 """
5586 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5587
d55e5bfc 5588 def SetText(*args, **kwargs):
5ba5649b
RD
5589 """
5590 SetText(self, String text)
5591
5592 Sets the text for this UI element.
5593 """
d55e5bfc
RD
5594 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5595
5596 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5597 """
5598 SetUpdateInterval(long updateInterval)
5599
5600 Sets the interval between updates in milliseconds. Set to -1 to
5601 disable updates, or to 0 to update as frequently as possible. The
5602 default is 0.
5603
5604 Use this to reduce the overhead of UI update events if your
5605 application has a lot of windows. If you set the value to -1 or
5606 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5607 at appropriate points in your application, such as when a dialog is
5608 about to be shown.
5609 """
d55e5bfc
RD
5610 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5611
5612 SetUpdateInterval = staticmethod(SetUpdateInterval)
5613 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5614 """
5615 GetUpdateInterval() -> long
5616
5617 Returns the current interval between updates in milliseconds. -1
5618 disables updates, 0 updates as frequently as possible.
5619 """
d55e5bfc
RD
5620 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5621
5622 GetUpdateInterval = staticmethod(GetUpdateInterval)
5623 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5624 """
5625 CanUpdate(Window win) -> bool
5626
5627 Returns ``True`` if it is appropriate to update (send UI update events
5628 to) this window.
5629
5630 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5631 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5632 events were last sent in idle time, and the update interval, to
5633 determine whether events should be sent to this window now. By default
5634 this will always return true because the update mode is initially
5635 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5636 events will be sent as often as possible. You can reduce the frequency
5637 that events are sent by changing the mode and/or setting an update
5638 interval.
5639
5640 """
d55e5bfc
RD
5641 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5642
5643 CanUpdate = staticmethod(CanUpdate)
5644 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5645 """
5646 ResetUpdateTime()
5647
5648 Used internally to reset the last-updated time to the current time. It
5649 is assumed that update events are normally sent in idle time, so this
5650 is called at the end of idle processing.
5651 """
d55e5bfc
RD
5652 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5653
5654 ResetUpdateTime = staticmethod(ResetUpdateTime)
5655 def SetMode(*args, **kwargs):
5ba5649b
RD
5656 """
5657 SetMode(int mode)
5658
5659 Specify how wxWidgets will send update events: to all windows, or only
5660 to those which specify that they will process the events.
5661
5662 The mode may be one of the following values:
5663
5664 ============================= ==========================================
5665 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5666 is the default setting.
5667 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5668 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5669 style set.
5670 ============================= ==========================================
5671
5672 """
d55e5bfc
RD
5673 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5674
5675 SetMode = staticmethod(SetMode)
5676 def GetMode(*args, **kwargs):
5ba5649b
RD
5677 """
5678 GetMode() -> int
5679
5680 Returns a value specifying how wxWidgets will send update events: to
5681 all windows, or only to those which specify that they will process the
5682 events.
5683 """
d55e5bfc
RD
5684 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5685
5686 GetMode = staticmethod(GetMode)
2131d850 5687_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc
RD
5688
5689def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
554f62e9 5690 """
5ba5649b
RD
5691 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5692
5693 Sets the interval between updates in milliseconds. Set to -1 to
5694 disable updates, or to 0 to update as frequently as possible. The
5695 default is 0.
5696
5697 Use this to reduce the overhead of UI update events if your
5698 application has a lot of windows. If you set the value to -1 or
5699 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5700 at appropriate points in your application, such as when a dialog is
5701 about to be shown.
5702 """
554f62e9 5703 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5704
554f62e9
RD
5705def UpdateUIEvent_GetUpdateInterval(*args):
5706 """
5ba5649b
RD
5707 UpdateUIEvent_GetUpdateInterval() -> long
5708
5709 Returns the current interval between updates in milliseconds. -1
5710 disables updates, 0 updates as frequently as possible.
5711 """
554f62e9 5712 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc
RD
5713
5714def UpdateUIEvent_CanUpdate(*args, **kwargs):
554f62e9 5715 """
5ba5649b
RD
5716 UpdateUIEvent_CanUpdate(Window win) -> bool
5717
5718 Returns ``True`` if it is appropriate to update (send UI update events
5719 to) this window.
5720
5721 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5722 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5723 events were last sent in idle time, and the update interval, to
5724 determine whether events should be sent to this window now. By default
5725 this will always return true because the update mode is initially
5726 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5727 events will be sent as often as possible. You can reduce the frequency
5728 that events are sent by changing the mode and/or setting an update
5729 interval.
5730
5731 """
554f62e9 5732 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 5733
554f62e9
RD
5734def UpdateUIEvent_ResetUpdateTime(*args):
5735 """
5ba5649b
RD
5736 UpdateUIEvent_ResetUpdateTime()
5737
5738 Used internally to reset the last-updated time to the current time. It
5739 is assumed that update events are normally sent in idle time, so this
5740 is called at the end of idle processing.
5741 """
554f62e9 5742 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc
RD
5743
5744def UpdateUIEvent_SetMode(*args, **kwargs):
554f62e9 5745 """
5ba5649b
RD
5746 UpdateUIEvent_SetMode(int mode)
5747
5748 Specify how wxWidgets will send update events: to all windows, or only
5749 to those which specify that they will process the events.
5750
5751 The mode may be one of the following values:
5752
5753 ============================= ==========================================
5754 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5755 is the default setting.
5756 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5757 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5758 style set.
5759 ============================= ==========================================
5760
5761 """
554f62e9 5762 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 5763
554f62e9
RD
5764def UpdateUIEvent_GetMode(*args):
5765 """
5ba5649b
RD
5766 UpdateUIEvent_GetMode() -> int
5767
5768 Returns a value specifying how wxWidgets will send update events: to
5769 all windows, or only to those which specify that they will process the
5770 events.
5771 """
554f62e9 5772 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
5773
5774#---------------------------------------------------------------------------
5775
5776class SysColourChangedEvent(Event):
5ba5649b
RD
5777 """
5778 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5779 when the user changes the colour settings using the control
5780 panel. This is only applicable under Windows.
5781
5782 The default event handler for this event propagates the event to child
5783 windows, since Windows only sends the events to top-level windows. If
5784 intercepting this event for a top-level window, remember to call
5785 `Skip` so the the base class handler will still be executed, or to
5786 pass the event on to the window's children explicitly.
5787
5788 """
554f62e9
RD
5789 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5790 __repr__ = _swig_repr
5791 def __init__(self, *args, **kwargs):
5ba5649b
RD
5792 """
5793 __init__(self) -> SysColourChangedEvent
5794
5795 Constructor
5796 """
554f62e9 5797 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5798_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
5799
5800#---------------------------------------------------------------------------
5801
5802class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5803 """
5804 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5805 a window that loses its mouse capture. This is called even if
5806 `wx.Window.ReleaseMouse` was called by the application code. Handling
5807 this event allows an application to cater for unexpected capture
5808 releases which might otherwise confuse mouse handling code.
5809
5810 This event is implemented under Windows only.
5811 """
554f62e9
RD
5812 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5813 __repr__ = _swig_repr
5814 def __init__(self, *args, **kwargs):
5ba5649b
RD
5815 """
5816 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5817
5818 Constructor
5819 """
554f62e9 5820 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 5821 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5822 """
5823 GetCapturedWindow(self) -> Window
5824
5825 Returns the window that gained the capture, or ``None`` if it was a
5826 non-wxWidgets window.
5827 """
d55e5bfc
RD
5828 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5829
2131d850 5830_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
5831
5832#---------------------------------------------------------------------------
5833
5834class DisplayChangedEvent(Event):
5ba5649b
RD
5835 """
5836 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5837 resolution has changed.
5838
5839 This event is implemented under Windows only.
5840 """
554f62e9
RD
5841 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5842 __repr__ = _swig_repr
5843 def __init__(self, *args, **kwargs):
d55e5bfc 5844 """__init__(self) -> DisplayChangedEvent"""
554f62e9 5845 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 5846_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
5847
5848#---------------------------------------------------------------------------
5849
5850class PaletteChangedEvent(Event):
5ba5649b
RD
5851 """
5852 An EVT_PALETTE_CHANGED event is sent when the system palette has
5853 changed, thereby giving each window a chance to redo their own to
5854 match.
5855
5856 This event is implemented under Windows only.
5857 """
554f62e9
RD
5858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5859 __repr__ = _swig_repr
5860 def __init__(self, *args, **kwargs):
5ba5649b
RD
5861 """
5862 __init__(self, int id=0) -> PaletteChangedEvent
5863
5864 An EVT_PALETTE_CHANGED event is sent when the system palette has
5865 changed, thereby giving each window a chance to redo their own to
5866 match.
5867
5868 This event is implemented under Windows only.
5869 """
554f62e9 5870 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc
RD
5871 def SetChangedWindow(*args, **kwargs):
5872 """SetChangedWindow(self, Window win)"""
5873 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
5874
5875 def GetChangedWindow(*args, **kwargs):
5876 """GetChangedWindow(self) -> Window"""
5877 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
5878
2131d850 5879_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
5880
5881#---------------------------------------------------------------------------
5882
5883class QueryNewPaletteEvent(Event):
5ba5649b
RD
5884 """
5885 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5886 focus and should re-do its palette.
5887
5888 This event is implemented under Windows only.
5889 """
554f62e9
RD
5890 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5891 __repr__ = _swig_repr
5892 def __init__(self, *args, **kwargs):
5ba5649b
RD
5893 """
5894 __init__(self, int winid=0) -> QueryNewPaletteEvent
5895
5896 Constructor.
5897 """
554f62e9 5898 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 5899 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5900 """
5901 SetPaletteRealized(self, bool realized)
5902
5903 App should set this if it changes the palette.
5904 """
d55e5bfc
RD
5905 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
5906
5907 def GetPaletteRealized(*args, **kwargs):
5908 """GetPaletteRealized(self) -> bool"""
5909 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
5910
2131d850 5911_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
5912
5913#---------------------------------------------------------------------------
5914
5915class NavigationKeyEvent(Event):
5ba5649b
RD
5916 """
5917 EVT_NAVIGATION_KEY events are used to control moving the focus between
5918 widgets, otherwise known as tab-traversal. You woudl normally not
5919 catch navigation events in applications as there are already
5920 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5921 it useful to send navigation events in certain situations to change
5922 the focus in certain ways, although it's probably easier to just call
5923 `wx.Window.Navigate`.
5924 """
554f62e9
RD
5925 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5926 __repr__ = _swig_repr
5927 def __init__(self, *args, **kwargs):
d55e5bfc 5928 """__init__(self) -> NavigationKeyEvent"""
554f62e9 5929 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 5930 def GetDirection(*args, **kwargs):
5ba5649b
RD
5931 """
5932 GetDirection(self) -> bool
5933
5934 Returns ``True`` if the direction is forward, ``False`` otherwise.
5935 """
d55e5bfc
RD
5936 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
5937
5938 def SetDirection(*args, **kwargs):
5ba5649b
RD
5939 """
5940 SetDirection(self, bool forward)
5941
5942 Specify the direction that the navigation should take. Usually the
5943 difference between using Tab and Shift-Tab.
5944 """
d55e5bfc
RD
5945 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
5946
5947 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
5948 """
5949 IsWindowChange(self) -> bool
5950
5951 Returns ``True`` if window change is allowed.
5952 """
d55e5bfc
RD
5953 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
5954
5955 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
5956 """
5957 SetWindowChange(self, bool ischange)
5958
5959 Specify if the navigation should be able to change parent windows.
5960 For example, changing notebook pages, etc. This is usually implemented
5961 by using Control-Tab.
5962 """
d55e5bfc
RD
5963 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
5964
68350608 5965 def IsFromTab(*args, **kwargs):
5ba5649b
RD
5966 """
5967 IsFromTab(self) -> bool
5968
5969 Returns ``True`` if the navigation event is originated from the Tab
5970 key.
5971 """
68350608
RD
5972 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
5973
5974 def SetFromTab(*args, **kwargs):
5ba5649b
RD
5975 """
5976 SetFromTab(self, bool bIs)
5977
5978 Set to true under MSW if the event was generated using the tab key.
5979 This is required for proper navogation over radio buttons.
5980 """
68350608
RD
5981 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
5982
908b74cd 5983 def SetFlags(*args, **kwargs):
5ba5649b
RD
5984 """
5985 SetFlags(self, long flags)
5986
5987 Set the navigation flags to a combination of the following:
5988
5989 * wx.NavigationKeyEvent.IsBackward
5990 * wx.NavigationKeyEvent.IsForward
5991 * wx.NavigationKeyEvent.WinChange
5992 * wx.NavigationKeyEvent.FromTab
5993
5994 """
908b74cd
RD
5995 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
5996
d55e5bfc 5997 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
5998 """
5999 GetCurrentFocus(self) -> Window
6000
6001 Returns the child window which currenty has the focus. May be
6002 ``None``.
6003 """
d55e5bfc
RD
6004 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6005
6006 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6007 """
6008 SetCurrentFocus(self, Window win)
6009
6010 Set the window that has the focus.
6011 """
d55e5bfc
RD
6012 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6013
b0f7404b 6014 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6015 IsForward = _core_.NavigationKeyEvent_IsForward
6016 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6017 FromTab = _core_.NavigationKeyEvent_FromTab
2131d850 6018_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6019
6020#---------------------------------------------------------------------------
6021
6022class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6023 """
6024 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6025 underlying GUI object) exists.
6026 """
554f62e9
RD
6027 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6028 __repr__ = _swig_repr
6029 def __init__(self, *args, **kwargs):
5ba5649b
RD
6030 """
6031 __init__(self, Window win=None) -> WindowCreateEvent
6032
6033 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6034 underlying GUI object) exists.
6035 """
554f62e9 6036 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6037 def GetWindow(*args, **kwargs):
5ba5649b
RD
6038 """
6039 GetWindow(self) -> Window
6040
6041 Returns the window that this event refers to.
6042 """
d55e5bfc
RD
6043 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6044
2131d850 6045_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc
RD
6046
6047class WindowDestroyEvent(CommandEvent):
5ba5649b 6048 """
9d7dfdff
RD
6049 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6050 when the GUI window is destroyed.
6051
6052 When a class derived from `wx.Window` is destroyed its destructor will
6053 have already run by the time this event is sent. Therefore this event
6054 will not usually be received at all by the window itself. Since it is
6055 received after the destructor has run, an object should not try to
6056 handle its own wx.WindowDestroyEvent, but it can be used to get
6057 notification of the destruction of another window.
5ba5649b 6058 """
554f62e9
RD
6059 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6060 __repr__ = _swig_repr
6061 def __init__(self, *args, **kwargs):
5ba5649b
RD
6062 """
6063 __init__(self, Window win=None) -> WindowDestroyEvent
6064
9d7dfdff
RD
6065 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6066 when the GUI window is destroyed.
6067
6068 When a class derived from `wx.Window` is destroyed its destructor will
6069 have already run by the time this event is sent. Therefore this event
6070 will not usually be received at all by the window itself. Since it is
6071 received after the destructor has run, an object should not try to
6072 handle its own wx.WindowDestroyEvent, but it can be used to get
6073 notification of the destruction of another window.
5ba5649b 6074 """
554f62e9 6075 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6076 def GetWindow(*args, **kwargs):
5ba5649b
RD
6077 """
6078 GetWindow(self) -> Window
6079
6080 Returns the window that this event refers to.
6081 """
d55e5bfc
RD
6082 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6083
2131d850 6084_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6085
6086#---------------------------------------------------------------------------
6087
6088class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6089 """
6090 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6091 give the application a chance to show a context (popup) menu.
6092 """
554f62e9
RD
6093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6094 __repr__ = _swig_repr
6095 def __init__(self, *args, **kwargs):
5ba5649b 6096 """
f460c29d 6097 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6098
6099 Constructor.
6100 """
554f62e9 6101 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6102 def GetPosition(*args, **kwargs):
5ba5649b
RD
6103 """
6104 GetPosition(self) -> Point
6105
6106 Returns the position (in screen coordinants) at which the menu should
6107 be shown.
6108 """
d55e5bfc
RD
6109 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6110
6111 def SetPosition(*args, **kwargs):
5ba5649b
RD
6112 """
6113 SetPosition(self, Point pos)
6114
6115 Sets the position at which the menu should be shown.
6116 """
d55e5bfc
RD
6117 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6118
2131d850 6119_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6120
6121#---------------------------------------------------------------------------
6122
6123IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6124IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6125class IdleEvent(Event):
5ba5649b
RD
6126 """
6127 This class is used for EVT_IDLE events, which are generated and sent
6128 when the application *becomes* idle. In other words, the when the
6129 event queue becomes empty then idle events are sent to all windows (by
6130 default) and as long as none of them call `RequestMore` then there are
6131 no more idle events until after the system event queue has some normal
6132 events and then becomes empty again.
6133
6134 By default, idle events are sent to all windows. If this is causing a
6135 significant overhead in your application, you can call
6136 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6137 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6138 which should receive idle events. Then idle events will only be sent
6139 to those windows and not to any others.
6140 """
554f62e9
RD
6141 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6142 __repr__ = _swig_repr
6143 def __init__(self, *args, **kwargs):
5ba5649b
RD
6144 """
6145 __init__(self) -> IdleEvent
6146
6147 Constructor
6148 """
554f62e9 6149 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6150 def RequestMore(*args, **kwargs):
5ba5649b
RD
6151 """
6152 RequestMore(self, bool needMore=True)
6153
6154 Tells wxWidgets that more processing is required. This function can be
6155 called by an EVT_IDLE handler for a window to indicate that the
6156 application should forward the EVT_IDLE event once more to the
6157 application windows. If no window calls this function during its
6158 EVT_IDLE handler, then the application will remain in a passive event
6159 loop until a new event is posted to the application by the windowing
6160 system.
6161 """
d55e5bfc
RD
6162 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6163
6164 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6165 """
6166 MoreRequested(self) -> bool
6167
6168 Returns ``True`` if the OnIdle function processing this event
6169 requested more processing time.
6170 """
d55e5bfc
RD
6171 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6172
6173 def SetMode(*args, **kwargs):
5ba5649b
RD
6174 """
6175 SetMode(int mode)
6176
6177 Static method for specifying how wxWidgets will send idle events: to
6178 all windows, or only to those which specify that they will process the
6179 events.
6180
6181 The mode can be one of the following values:
6182
6183 ========================= ========================================
6184 wx.IDLE_PROCESS_ALL Send idle events to all windows
6185 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6186 the wx.WS_EX_PROCESS_IDLE extra style
6187 flag set.
6188 ========================= ========================================
6189
6190 """
d55e5bfc
RD
6191 return _core_.IdleEvent_SetMode(*args, **kwargs)
6192
6193 SetMode = staticmethod(SetMode)
6194 def GetMode(*args, **kwargs):
5ba5649b
RD
6195 """
6196 GetMode() -> int
6197
6198 Static method returning a value specifying how wxWidgets will send
6199 idle events: to all windows, or only to those which specify that they
6200 will process the events.
6201 """
d55e5bfc
RD
6202 return _core_.IdleEvent_GetMode(*args, **kwargs)
6203
6204 GetMode = staticmethod(GetMode)
6205 def CanSend(*args, **kwargs):
5ba5649b
RD
6206 """
6207 CanSend(Window win) -> bool
6208
6209 Returns ``True`` if it is appropriate to send idle events to this
6210 window.
6211
6212 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6213 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6214 events should be sent to this window now. By default this will always
6215 return ``True`` because the update mode is initially
6216 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6217 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6218 """
d55e5bfc
RD
6219 return _core_.IdleEvent_CanSend(*args, **kwargs)
6220
6221 CanSend = staticmethod(CanSend)
2131d850 6222_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc
RD
6223
6224def IdleEvent_SetMode(*args, **kwargs):
554f62e9 6225 """
5ba5649b
RD
6226 IdleEvent_SetMode(int mode)
6227
6228 Static method for specifying how wxWidgets will send idle events: to
6229 all windows, or only to those which specify that they will process the
6230 events.
6231
6232 The mode can be one of the following values:
6233
6234 ========================= ========================================
6235 wx.IDLE_PROCESS_ALL Send idle events to all windows
6236 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6237 the wx.WS_EX_PROCESS_IDLE extra style
6238 flag set.
6239 ========================= ========================================
6240
6241 """
554f62e9 6242 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6243
554f62e9
RD
6244def IdleEvent_GetMode(*args):
6245 """
5ba5649b
RD
6246 IdleEvent_GetMode() -> int
6247
6248 Static method returning a value specifying how wxWidgets will send
6249 idle events: to all windows, or only to those which specify that they
6250 will process the events.
6251 """
554f62e9 6252 return _core_.IdleEvent_GetMode(*args)
d55e5bfc
RD
6253
6254def IdleEvent_CanSend(*args, **kwargs):
554f62e9 6255 """
5ba5649b
RD
6256 IdleEvent_CanSend(Window win) -> bool
6257
6258 Returns ``True`` if it is appropriate to send idle events to this
6259 window.
6260
6261 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6262 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6263 events should be sent to this window now. By default this will always
6264 return ``True`` because the update mode is initially
6265 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6266 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6267 """
554f62e9 6268 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6269
6270#---------------------------------------------------------------------------
6271
2131d850
RD
6272class ClipboardTextEvent(CommandEvent):
6273 """
6274 A Clipboard Text event is sent when a window intercepts a text
6275 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6276 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6277 popup menu command, etc. NOTE : under windows these events are *NOT*
6278 generated automatically for a Rich Edit text control.
6279 """
6280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6281 __repr__ = _swig_repr
6282 def __init__(self, *args, **kwargs):
6283 """
6284 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6285
6286 A Clipboard Text event is sent when a window intercepts a text
6287 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6288 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6289 popup menu command, etc. NOTE : under windows these events are *NOT*
6290 generated automatically for a Rich Edit text control.
6291 """
6292 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6293_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6294
6295#---------------------------------------------------------------------------
6296
d55e5bfc 6297class PyEvent(Event):
5ba5649b
RD
6298 """
6299 wx.PyEvent can be used as a base class for implementing custom event
6300 types in Python. You should derived from this class instead of
6301 `wx.Event` because this class is Python-aware and is able to transport
6302 its Python bits safely through the wxWidgets event system and have
6303 them still be there when the event handler is invoked.
6304
6305 :see: `wx.PyCommandEvent`
6306
6307 """
554f62e9
RD
6308 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6309 __repr__ = _swig_repr
6310 def __init__(self, *args, **kwargs):
f460c29d 6311 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
554f62e9 6312 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6313 self._SetSelf(self)
d55e5bfc 6314
554f62e9
RD
6315 __swig_destroy__ = _core_.delete_PyEvent
6316 __del__ = lambda self : None;
5ba5649b
RD
6317 def _SetSelf(*args, **kwargs):
6318 """_SetSelf(self, PyObject self)"""
6319 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6320
5ba5649b
RD
6321 def _GetSelf(*args, **kwargs):
6322 """_GetSelf(self) -> PyObject"""
6323 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6324
2131d850 6325_core_.PyEvent_swigregister(PyEvent)
d55e5bfc
RD
6326
6327class PyCommandEvent(CommandEvent):
5ba5649b
RD
6328 """
6329 wx.PyCommandEvent can be used as a base class for implementing custom
6330 event types in Python, where the event shoudl travel up to parent
6331 windows looking for a handler. You should derived from this class
6332 instead of `wx.CommandEvent` because this class is Python-aware and is
6333 able to transport its Python bits safely through the wxWidgets event
6334 system and have them still be there when the event handler is invoked.
6335
6336 :see: `wx.PyEvent`
6337
6338 """
554f62e9
RD
6339 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6340 __repr__ = _swig_repr
6341 def __init__(self, *args, **kwargs):
f460c29d 6342 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
554f62e9 6343 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6344 self._SetSelf(self)
d55e5bfc 6345
554f62e9
RD
6346 __swig_destroy__ = _core_.delete_PyCommandEvent
6347 __del__ = lambda self : None;
5ba5649b
RD
6348 def _SetSelf(*args, **kwargs):
6349 """_SetSelf(self, PyObject self)"""
6350 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6351
5ba5649b
RD
6352 def _GetSelf(*args, **kwargs):
6353 """_GetSelf(self) -> PyObject"""
6354 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6355
2131d850 6356_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6357
53aa7709 6358class DateEvent(CommandEvent):
5ba5649b
RD
6359 """
6360 This event class holds information about a date change event and is
6361 used together with `wx.DatePickerCtrl`. It also serves as a base class
6362 for `wx.calendar.CalendarEvent`. Bind these event types with
6363 EVT_DATE_CHANGED.
6364 """
554f62e9
RD
6365 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6366 __repr__ = _swig_repr
6367 def __init__(self, *args, **kwargs):
f460c29d 6368 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
554f62e9 6369 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6370 def GetDate(*args, **kwargs):
5ba5649b
RD
6371 """
6372 GetDate(self) -> DateTime
6373
6374 Returns the date.
6375 """
53aa7709
RD
6376 return _core_.DateEvent_GetDate(*args, **kwargs)
6377
6378 def SetDate(*args, **kwargs):
5ba5649b
RD
6379 """
6380 SetDate(self, DateTime date)
6381
6382 Sets the date carried by the event, normally only used by the library
6383 internally.
6384 """
53aa7709
RD
6385 return _core_.DateEvent_SetDate(*args, **kwargs)
6386
2131d850 6387_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
6388
6389wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6390EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6391
d55e5bfc
RD
6392#---------------------------------------------------------------------------
6393
6394PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6395PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6396PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6397PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6398PRINT_WINDOWS = _core_.PRINT_WINDOWS
6399PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6400class PyApp(EvtHandler):
c24da6d6
RD
6401 """
6402 The ``wx.PyApp`` class is an *implementation detail*, please use the
6403 `wx.App` class (or some other derived class) instead.
6404 """
554f62e9
RD
6405 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6406 __repr__ = _swig_repr
6407 def __init__(self, *args, **kwargs):
d55e5bfc
RD
6408 """
6409 __init__(self) -> PyApp
6410
6411 Create a new application object, starting the bootstrap process.
6412 """
554f62e9 6413 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
70b7a5fe
RD
6414 self._setCallbackInfo(self, PyApp, False)
6415 self._setOORInfo(self, False)
d55e5bfc 6416
554f62e9
RD
6417 __swig_destroy__ = _core_.delete_PyApp
6418 __del__ = lambda self : None;
d55e5bfc 6419 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6420 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
d55e5bfc
RD
6421 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6422
6423 def GetAppName(*args, **kwargs):
6424 """
6425 GetAppName(self) -> String
6426
6427 Get the application name.
6428 """
6429 return _core_.PyApp_GetAppName(*args, **kwargs)
6430
6431 def SetAppName(*args, **kwargs):
6432 """
6433 SetAppName(self, String name)
6434
c24da6d6
RD
6435 Set the application name. This value may be used automatically by
6436 `wx.Config` and such.
d55e5bfc
RD
6437 """
6438 return _core_.PyApp_SetAppName(*args, **kwargs)
6439
6440 def GetClassName(*args, **kwargs):
6441 """
6442 GetClassName(self) -> String
6443
6444 Get the application's class name.
6445 """
6446 return _core_.PyApp_GetClassName(*args, **kwargs)
6447
6448 def SetClassName(*args, **kwargs):
6449 """
6450 SetClassName(self, String name)
6451
c24da6d6
RD
6452 Set the application's class name. This value may be used for
6453 X-resources if applicable for the platform
d55e5bfc
RD
6454 """
6455 return _core_.PyApp_SetClassName(*args, **kwargs)
6456
6457 def GetVendorName(*args, **kwargs):
6458 """
6459 GetVendorName(self) -> String
6460
6461 Get the application's vendor name.
6462 """
6463 return _core_.PyApp_GetVendorName(*args, **kwargs)
6464
6465 def SetVendorName(*args, **kwargs):
6466 """
6467 SetVendorName(self, String name)
6468
c24da6d6
RD
6469 Set the application's vendor name. This value may be used
6470 automatically by `wx.Config` and such.
d55e5bfc
RD
6471 """
6472 return _core_.PyApp_SetVendorName(*args, **kwargs)
6473
6474 def GetTraits(*args, **kwargs):
6475 """
6476 GetTraits(self) -> wxAppTraits
6477
c24da6d6
RD
6478 Return (and create if necessary) the app traits object to which we
6479 delegate for everything which either should be configurable by the
6480 user (then he can change the default behaviour simply by overriding
6481 CreateTraits() and returning his own traits object) or which is
6482 GUI/console dependent as then wx.AppTraits allows us to abstract the
6483 differences behind the common facade.
6484
6485 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
6486 """
6487 return _core_.PyApp_GetTraits(*args, **kwargs)
6488
6489 def ProcessPendingEvents(*args, **kwargs):
6490 """
6491 ProcessPendingEvents(self)
6492
c24da6d6
RD
6493 Process all events in the Pending Events list -- it is necessary to
6494 call this function to process posted events. This normally happens
6495 during each event loop iteration.
d55e5bfc
RD
6496 """
6497 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6498
6499 def Yield(*args, **kwargs):
6500 """
6501 Yield(self, bool onlyIfNeeded=False) -> bool
6502
c24da6d6
RD
6503 Process all currently pending events right now, instead of waiting
6504 until return to the event loop. It is an error to call ``Yield``
6505 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6506
c24da6d6 6507 :warning: This function is dangerous as it can lead to unexpected
79fccf9d
RD
6508 reentrancies (i.e. when called from an event handler it may
6509 result in calling the same event handler again), use with
6510 extreme care or, better, don't use at all!
d55e5bfc 6511
c24da6d6 6512 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
79fccf9d 6513
d55e5bfc
RD
6514 """
6515 return _core_.PyApp_Yield(*args, **kwargs)
6516
6517 def WakeUpIdle(*args, **kwargs):
6518 """
6519 WakeUpIdle(self)
6520
c24da6d6
RD
6521 Make sure that idle events are sent again.
6522 :see: `wx.WakeUpIdle`
d55e5bfc
RD
6523 """
6524 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6525
84f85550
RD
6526 def IsMainLoopRunning(*args, **kwargs):
6527 """
6528 IsMainLoopRunning() -> bool
6529
6530 Returns True if we're running the main loop, i.e. if the events can
6531 currently be dispatched.
6532 """
6533 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6534
6535 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6536 def MainLoop(*args, **kwargs):
6537 """
6538 MainLoop(self) -> int
6539
c24da6d6
RD
6540 Execute the main GUI loop, the function doesn't normally return until
6541 all top level windows have been closed and destroyed.
d55e5bfc
RD
6542 """
6543 return _core_.PyApp_MainLoop(*args, **kwargs)
6544
6545 def Exit(*args, **kwargs):
6546 """
6547 Exit(self)
6548
6549 Exit the main loop thus terminating the application.
c24da6d6 6550 :see: `wx.Exit`
d55e5bfc
RD
6551 """
6552 return _core_.PyApp_Exit(*args, **kwargs)
6553
6554 def ExitMainLoop(*args, **kwargs):
6555 """
6556 ExitMainLoop(self)
6557
c24da6d6
RD
6558 Exit the main GUI loop during the next iteration of the main
6559 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
6560 """
6561 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6562
6563 def Pending(*args, **kwargs):
6564 """
6565 Pending(self) -> bool
6566
6567 Returns True if there are unprocessed events in the event queue.
6568 """
6569 return _core_.PyApp_Pending(*args, **kwargs)
6570
6571 def Dispatch(*args, **kwargs):
6572 """
6573 Dispatch(self) -> bool
6574
6575 Process the first event in the event queue (blocks until an event
6576 appears if there are none currently)
6577 """
6578 return _core_.PyApp_Dispatch(*args, **kwargs)
6579
6580 def ProcessIdle(*args, **kwargs):
6581 """
6582 ProcessIdle(self) -> bool
6583
c24da6d6
RD
6584 Called from the MainLoop when the application becomes idle (there are
6585 no pending events) and sends a `wx.IdleEvent` to all interested
6586 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
6587 """
6588 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6589
6590 def SendIdleEvents(*args, **kwargs):
6591 """
6592 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6593
c24da6d6
RD
6594 Send idle event to window and all subwindows. Returns True if more
6595 idle time is requested.
d55e5bfc
RD
6596 """
6597 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6598
6599 def IsActive(*args, **kwargs):
6600 """
6601 IsActive(self) -> bool
6602
6603 Return True if our app has focus.
6604 """
6605 return _core_.PyApp_IsActive(*args, **kwargs)
6606
6607 def SetTopWindow(*args, **kwargs):
6608 """
6609 SetTopWindow(self, Window win)
6610
c24da6d6 6611 Set the *main* top level window
d55e5bfc
RD
6612 """
6613 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6614
6615 def GetTopWindow(*args, **kwargs):
6616 """
6617 GetTopWindow(self) -> Window
6618
c24da6d6
RD
6619 Return the *main* top level window (if it hadn't been set previously
6620 with SetTopWindow(), will return just some top level window and, if
6621 there not any, will return None)
d55e5bfc
RD
6622 """
6623 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6624
6625 def SetExitOnFrameDelete(*args, **kwargs):
6626 """
6627 SetExitOnFrameDelete(self, bool flag)
6628
c24da6d6
RD
6629 Control the exit behaviour: by default, the program will exit the main
6630 loop (and so, usually, terminate) when the last top-level program
6631 window is deleted. Beware that if you disable this behaviour (with
6632 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6633 explicitly from somewhere.
d55e5bfc
RD
6634 """
6635 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6636
6637 def GetExitOnFrameDelete(*args, **kwargs):
6638 """
6639 GetExitOnFrameDelete(self) -> bool
6640
6641 Get the current exit behaviour setting.
6642 """
6643 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6644
6645 def SetUseBestVisual(*args, **kwargs):
6646 """
6647 SetUseBestVisual(self, bool flag)
6648
c24da6d6
RD
6649 Set whether the app should try to use the best available visual on
6650 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
6651 """
6652 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6653
6654 def GetUseBestVisual(*args, **kwargs):
6655 """
6656 GetUseBestVisual(self) -> bool
6657
6658 Get current UseBestVisual setting.
6659 """
6660 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6661
6662 def SetPrintMode(*args, **kwargs):
6663 """SetPrintMode(self, int mode)"""
6664 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6665
6666 def GetPrintMode(*args, **kwargs):
6667 """GetPrintMode(self) -> int"""
6668 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6669
6670 def SetAssertMode(*args, **kwargs):
6671 """
6672 SetAssertMode(self, int mode)
6673
79fccf9d 6674 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
6675 """
6676 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6677
6678 def GetAssertMode(*args, **kwargs):
6679 """
6680 GetAssertMode(self) -> int
6681
6682 Get the current OnAssert behaviour setting.
6683 """
6684 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6685
6686 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 6687 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
6688 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6689
6690 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6691 def GetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 6692 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
6693 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6694
6695 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6696 def GetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 6697 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
6698 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6699
6700 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6701 def GetMacExitMenuItemId(*args, **kwargs):
c24da6d6 6702 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
6703 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6704
6705 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6706 def GetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 6707 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
6708 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6709
6710 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6711 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 6712 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
6713 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6714
6715 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6716 def SetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 6717 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
6718 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6719
6720 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6721 def SetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 6722 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
6723 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6724
6725 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6726 def SetMacExitMenuItemId(*args, **kwargs):
c24da6d6 6727 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
6728 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6729
6730 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6731 def SetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 6732 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
6733 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6734
6735 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6736 def _BootstrapApp(*args, **kwargs):
6737 """
6738 _BootstrapApp(self)
6739
6740 For internal use only
6741 """
6742 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6743
6744 def GetComCtl32Version(*args, **kwargs):
6745 """
c24da6d6 6746 GetComCtl32Version() -> int
d55e5bfc 6747
c24da6d6
RD
6748 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6749 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
6750 """
6751 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6752
6753 GetComCtl32Version = staticmethod(GetComCtl32Version)
2131d850 6754_core_.PyApp_swigregister(PyApp)
d55e5bfc 6755
554f62e9
RD
6756def PyApp_IsMainLoopRunning(*args):
6757 """
84f85550
RD
6758 PyApp_IsMainLoopRunning() -> bool
6759
6760 Returns True if we're running the main loop, i.e. if the events can
6761 currently be dispatched.
6762 """
554f62e9 6763 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 6764
554f62e9
RD
6765def PyApp_GetMacSupportPCMenuShortcuts(*args):
6766 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6767 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 6768
554f62e9
RD
6769def PyApp_GetMacAboutMenuItemId(*args):
6770 """PyApp_GetMacAboutMenuItemId() -> long"""
6771 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 6772
554f62e9
RD
6773def PyApp_GetMacPreferencesMenuItemId(*args):
6774 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6775 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 6776
554f62e9
RD
6777def PyApp_GetMacExitMenuItemId(*args):
6778 """PyApp_GetMacExitMenuItemId() -> long"""
6779 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 6780
554f62e9
RD
6781def PyApp_GetMacHelpMenuTitleName(*args):
6782 """PyApp_GetMacHelpMenuTitleName() -> String"""
6783 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc
RD
6784
6785def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
554f62e9
RD
6786 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6787 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6788
6789def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
554f62e9
RD
6790 """PyApp_SetMacAboutMenuItemId(long val)"""
6791 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6792
6793def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
554f62e9
RD
6794 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6795 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6796
6797def PyApp_SetMacExitMenuItemId(*args, **kwargs):
554f62e9
RD
6798 """PyApp_SetMacExitMenuItemId(long val)"""
6799 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6800
6801def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
554f62e9
RD
6802 """PyApp_SetMacHelpMenuTitleName(String val)"""
6803 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 6804
554f62e9
RD
6805def PyApp_GetComCtl32Version(*args):
6806 """
d55e5bfc
RD
6807 PyApp_GetComCtl32Version() -> int
6808
c24da6d6
RD
6809 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6810 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6811 """
554f62e9 6812 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc
RD
6813
6814#---------------------------------------------------------------------------
6815
6816
554f62e9
RD
6817def Exit(*args):
6818 """
d55e5bfc
RD
6819 Exit()
6820
6821 Force an exit of the application. Convenience for wx.GetApp().Exit()
6822 """
554f62e9 6823 return _core_.Exit(*args)
d55e5bfc 6824
554f62e9
RD
6825def Yield(*args):
6826 """
d55e5bfc
RD
6827 Yield() -> bool
6828
6829 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6830 """
554f62e9 6831 return _core_.Yield(*args)
d55e5bfc 6832
554f62e9
RD
6833def YieldIfNeeded(*args):
6834 """
d55e5bfc
RD
6835 YieldIfNeeded() -> bool
6836
6837 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6838 """
554f62e9 6839 return _core_.YieldIfNeeded(*args)
d55e5bfc
RD
6840
6841def SafeYield(*args, **kwargs):
554f62e9 6842 """
d55e5bfc
RD
6843 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6844
c24da6d6
RD
6845 This function is similar to `wx.Yield`, except that it disables the
6846 user input to all program windows before calling `wx.Yield` and
6847 re-enables it again afterwards. If ``win`` is not None, this window
6848 will remain enabled, allowing the implementation of some limited user
6849 interaction.
d55e5bfc 6850
c24da6d6 6851 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 6852 """
554f62e9 6853 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 6854
554f62e9
RD
6855def WakeUpIdle(*args):
6856 """
d55e5bfc
RD
6857 WakeUpIdle()
6858
c24da6d6
RD
6859 Cause the message queue to become empty again, so idle events will be
6860 sent.
d55e5bfc 6861 """
554f62e9 6862 return _core_.WakeUpIdle(*args)
d55e5bfc
RD
6863
6864def PostEvent(*args, **kwargs):
554f62e9 6865 """
d55e5bfc
RD
6866 PostEvent(EvtHandler dest, Event event)
6867
c24da6d6
RD
6868 Send an event to a window or other wx.EvtHandler to be processed
6869 later.
d55e5bfc 6870 """
554f62e9 6871 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 6872
554f62e9
RD
6873def App_CleanUp(*args):
6874 """
d55e5bfc
RD
6875 App_CleanUp()
6876
79fccf9d 6877 For internal use only, it is used to cleanup after wxWidgets when
c24da6d6 6878 Python shuts down.
d55e5bfc 6879 """
554f62e9 6880 return _core_.App_CleanUp(*args)
d55e5bfc 6881
554f62e9
RD
6882def GetApp(*args):
6883 """
d55e5bfc
RD
6884 GetApp() -> PyApp
6885
6886 Return a reference to the current wx.App object.
6887 """
554f62e9 6888 return _core_.GetApp(*args)
5cbf236d
RD
6889
6890def SetDefaultPyEncoding(*args, **kwargs):
554f62e9 6891 """
5cbf236d
RD
6892 SetDefaultPyEncoding(string encoding)
6893
6894 Sets the encoding that wxPython will use when it needs to convert a
6895 Python string or unicode object to or from a wxString.
62d32a5f
RD
6896
6897 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6898 but please be aware that the default encoding within the same locale
6899 may be slightly different on different platforms. For example, please
6900 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6901 between the common latin/roman encodings.
5cbf236d 6902 """
554f62e9 6903 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6904
554f62e9
RD
6905def GetDefaultPyEncoding(*args):
6906 """
5cbf236d
RD
6907 GetDefaultPyEncoding() -> string
6908
6909 Gets the current encoding that wxPython will use when it needs to
6910 convert a Python string or unicode object to or from a wxString.
6911 """
554f62e9 6912 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
6913#----------------------------------------------------------------------
6914
6915class PyOnDemandOutputWindow:
6916 """
6917 A class that can be used for redirecting Python's stdout and
6918 stderr streams. It will do nothing until something is wrriten to
6919 the stream at which point it will create a Frame with a text area
6920 and write the text there.
6921 """
6922 def __init__(self, title = "wxPython: stdout/stderr"):
6923 self.frame = None
6924 self.title = title
412d302d
RD
6925 self.pos = wx.DefaultPosition
6926 self.size = (450, 300)
d55e5bfc
RD
6927 self.parent = None
6928
6929 def SetParent(self, parent):
6930 """Set the window to be used as the popup Frame's parent."""
6931 self.parent = parent
6932
6933
6934 def CreateOutputWindow(self, st):
412d302d
RD
6935 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6936 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 6937 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 6938 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 6939 self.text.AppendText(st)
d55e5bfc 6940 self.frame.Show(True)
2131d850 6941 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
6942
6943
6944 def OnCloseWindow(self, event):
6945 if self.frame is not None:
6946 self.frame.Destroy()
6947 self.frame = None
6948 self.text = None
6949
6950
6951 # These methods provide the file-like output behaviour.
6952 def write(self, text):
6953 """
6954 Create the output window if needed and write the string to it.
6955 If not called in the context of the gui thread then uses
6956 CallAfter to do the work there.
6957 """
6958 if self.frame is None:
6959 if not wx.Thread_IsMain():
6960 wx.CallAfter(self.CreateOutputWindow, text)
6961 else:
6962 self.CreateOutputWindow(text)
6963 else:
6964 if not wx.Thread_IsMain():
6965 wx.CallAfter(self.text.AppendText, text)
6966 else:
6967 self.text.AppendText(text)
6968
6969
6970 def close(self):
6971 if self.frame is not None:
6972 wx.CallAfter(self.frame.Close)
6973
6974
19272049
RD
6975 def flush(self):
6976 pass
6977
6978
d55e5bfc
RD
6979
6980#----------------------------------------------------------------------
6981
6982_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6983
6984class App(wx.PyApp):
6985 """
c24da6d6
RD
6986 The ``wx.App`` class represents the application and is used to:
6987
6988 * bootstrap the wxPython system and initialize the underlying
6989 gui toolkit
6990 * set and get application-wide properties
6991 * implement the windowing system main message or event loop,
6992 and to dispatch events to window instances
6993 * etc.
6994
6995 Every application must have a ``wx.App`` instance, and all
6996 creation of UI objects should be delayed until after the
6997 ``wx.App`` object has been created in order to ensure that the gui
6998 platform and wxWidgets have been fully initialized.
6999
7000 Normally you would derive from this class and implement an
7001 ``OnInit`` method that creates a frame and then calls
7002 ``self.SetTopWindow(frame)``.
7003
7004 :see: `wx.PySimpleApp` for a simpler app class that can be used
79fccf9d 7005 directly.
d55e5bfc 7006 """
c24da6d6 7007
d55e5bfc
RD
7008 outputWindowClass = PyOnDemandOutputWindow
7009
c24da6d6
RD
7010 def __init__(self, redirect=_defRedirect, filename=None,
7011 useBestVisual=False, clearSigInt=True):
7012 """
7013 Construct a ``wx.App`` object.
7014
7015 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7016 redirected? Defaults to True on Windows and Mac, False
7017 otherwise. If `filename` is None then output will be
7018 redirected to a window that pops up as needed. (You can
7019 control what kind of window is created for the output by
7020 resetting the class variable ``outputWindowClass`` to a
7021 class of your choosing.)
7022
7023 :param filename: The name of a file to redirect output to, if
7024 redirect is True.
7025
7026 :param useBestVisual: Should the app try to use the best
7027 available visual provided by the system (only relevant on
7028 systems that have more than one visual.) This parameter
7029 must be used instead of calling `SetUseBestVisual` later
7030 on because it must be set before the underlying GUI
7031 toolkit is initialized.
7032
7033 :param clearSigInt: Should SIGINT be cleared? This allows the
7034 app to terminate upon a Ctrl-C in the console like other
7035 GUI apps will.
7036
7037 :note: You should override OnInit to do applicaition
7038 initialization to ensure that the system, toolkit and
7039 wxWidgets are fully initialized.
7040 """
d55e5bfc
RD
7041 wx.PyApp.__init__(self)
7042
7043 if wx.Platform == "__WXMAC__":
7044 try:
7045 import MacOS
7046 if not MacOS.WMAvailable():
7047 print """\
7048This program needs access to the screen. Please run with 'pythonw',
7049not 'python', and only when you are logged in on the main display of
7050your Mac."""
7051 _sys.exit(1)
b1f29bf7
RD
7052 except SystemExit:
7053 raise
d55e5bfc
RD
7054 except:
7055 pass
7056
7057 # This has to be done before OnInit
7058 self.SetUseBestVisual(useBestVisual)
7059
7060 # Set the default handler for SIGINT. This fixes a problem
7061 # where if Ctrl-C is pressed in the console that started this
7062 # app then it will not appear to do anything, (not even send
7063 # KeyboardInterrupt???) but will later segfault on exit. By
7064 # setting the default handler then the app will exit, as
7065 # expected (depending on platform.)
c24da6d6
RD
7066 if clearSigInt:
7067 try:
7068 import signal
7069 signal.signal(signal.SIGINT, signal.SIG_DFL)
7070 except:
7071 pass
d55e5bfc
RD
7072
7073 # Save and redirect the stdio to a window?
7074 self.stdioWin = None
7075 self.saveStdio = (_sys.stdout, _sys.stderr)
7076 if redirect:
7077 self.RedirectStdio(filename)
7078
8fb0e70a
RD
7079 # Use Python's install prefix as the default
7080 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7081
d55e5bfc
RD
7082 # This finishes the initialization of wxWindows and then calls
7083 # the OnInit that should be present in the derived class
7084 self._BootstrapApp()
7085
7086
f460c29d
RD
7087 def OnPreInit(self):
7088 """
7089 Things that must be done after _BootstrapApp has done its
7090 thing, but would be nice if they were already done by the time
7091 that OnInit is called.
7092 """
7093 wx.StockGDI._initStockObjects()
7094
7095
66af7a75
RD
7096 def __del__(self, destroy=wx.PyApp.__del__):
7097 self.RestoreStdio() # Just in case the MainLoop was overridden
7098 destroy(self)
d55e5bfc 7099
70b7a5fe
RD
7100 def Destroy(self):
7101 wx.PyApp.Destroy(self)
7102 self.thisown = 0
d55e5bfc
RD
7103
7104 def SetTopWindow(self, frame):
7105 """Set the \"main\" top level window"""
7106 if self.stdioWin:
7107 self.stdioWin.SetParent(frame)
7108 wx.PyApp.SetTopWindow(self, frame)
7109
7110
7111 def MainLoop(self):
7112 """Execute the main GUI event loop"""
7113 wx.PyApp.MainLoop(self)
7114 self.RestoreStdio()
7115
7116
7117 def RedirectStdio(self, filename=None):
7118 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7119 if filename:
7120 _sys.stdout = _sys.stderr = open(filename, 'a')
7121 else:
7122 self.stdioWin = self.outputWindowClass()
7123 _sys.stdout = _sys.stderr = self.stdioWin
7124
7125
7126 def RestoreStdio(self):
66af7a75
RD
7127 try:
7128 _sys.stdout, _sys.stderr = self.saveStdio
7129 except:
7130 pass
d55e5bfc
RD
7131
7132
412d302d
RD
7133 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7134 """
7135 Set the title, position and/or size of the output window if
f5b96ee1
RD
7136 the stdio has been redirected. This should be called before
7137 any output would cause the output window to be created.
412d302d
RD
7138 """
7139 if self.stdioWin:
7140 if title is not None:
7141 self.stdioWin.title = title
7142 if pos is not None:
7143 self.stdioWin.pos = pos
7144 if size is not None:
7145 self.stdioWin.size = size
7146
7147
7148
d55e5bfc 7149
c24da6d6 7150# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7151App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7152App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7153App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7154App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7155App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7156App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7157App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7158App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7159App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7160App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7161App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7162
7163#----------------------------------------------------------------------------
7164
7165class PySimpleApp(wx.App):
7166 """
7167 A simple application class. You can just create one of these and
7168 then then make your top level windows later, and not have to worry
c24da6d6 7169 about OnInit. For example::
d55e5bfc 7170
c24da6d6
RD
7171 app = wx.PySimpleApp()
7172 frame = wx.Frame(None, title='Hello World')
7173 frame.Show()
7174 app.MainLoop()
7175
7176 :see: `wx.App`
7177 """
7178
7179 def __init__(self, redirect=False, filename=None,
7180 useBestVisual=False, clearSigInt=True):
7181 """
7182 :see: `wx.App.__init__`
7183 """
7184 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7185
7186 def OnInit(self):
d55e5bfc
RD
7187 return True
7188
7189
c24da6d6 7190
d55e5bfc
RD
7191# Is anybody using this one?
7192class PyWidgetTester(wx.App):
7193 def __init__(self, size = (250, 100)):
7194 self.size = size
7195 wx.App.__init__(self, 0)
7196
7197 def OnInit(self):
7198 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7199 self.SetTopWindow(self.frame)
7200 return True
7201
c24da6d6
RD
7202 def SetWidget(self, widgetClass, *args, **kwargs):
7203 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7204 self.frame.Show(True)
7205
7206#----------------------------------------------------------------------------
7207# DO NOT hold any other references to this object. This is how we
c24da6d6 7208# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7209# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
c24da6d6 7210# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7211
7212class __wxPyCleanup:
7213 def __init__(self):
7214 self.cleanup = _core_.App_CleanUp
7215 def __del__(self):
7216 self.cleanup()
7217
7218_sys.__wxPythonCleanup = __wxPyCleanup()
7219
7220## # another possible solution, but it gets called too early...
c24da6d6
RD
7221## import atexit
7222## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7223
7224
7225#----------------------------------------------------------------------------
7226
7227#---------------------------------------------------------------------------
7228
ae8162c8 7229class EventLoop(object):
093d3ff1 7230 """Proxy of C++ EventLoop class"""
554f62e9
RD
7231 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7232 __repr__ = _swig_repr
7233 def __init__(self, *args, **kwargs):
ae8162c8 7234 """__init__(self) -> EventLoop"""
554f62e9
RD
7235 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7236 __swig_destroy__ = _core_.delete_EventLoop
7237 __del__ = lambda self : None;
ae8162c8
RD
7238 def Run(*args, **kwargs):
7239 """Run(self) -> int"""
7240 return _core_.EventLoop_Run(*args, **kwargs)
7241
7242 def Exit(*args, **kwargs):
7243 """Exit(self, int rc=0)"""
7244 return _core_.EventLoop_Exit(*args, **kwargs)
7245
7246 def Pending(*args, **kwargs):
7247 """Pending(self) -> bool"""
7248 return _core_.EventLoop_Pending(*args, **kwargs)
7249
7250 def Dispatch(*args, **kwargs):
7251 """Dispatch(self) -> bool"""
7252 return _core_.EventLoop_Dispatch(*args, **kwargs)
7253
7254 def IsRunning(*args, **kwargs):
7255 """IsRunning(self) -> bool"""
7256 return _core_.EventLoop_IsRunning(*args, **kwargs)
7257
7258 def GetActive(*args, **kwargs):
7259 """GetActive() -> EventLoop"""
7260 return _core_.EventLoop_GetActive(*args, **kwargs)
7261
7262 GetActive = staticmethod(GetActive)
7263 def SetActive(*args, **kwargs):
7264 """SetActive(EventLoop loop)"""
7265 return _core_.EventLoop_SetActive(*args, **kwargs)
7266
7267 SetActive = staticmethod(SetActive)
2131d850 7268_core_.EventLoop_swigregister(EventLoop)
ae8162c8 7269
554f62e9
RD
7270def EventLoop_GetActive(*args):
7271 """EventLoop_GetActive() -> EventLoop"""
7272 return _core_.EventLoop_GetActive(*args)
ae8162c8
RD
7273
7274def EventLoop_SetActive(*args, **kwargs):
554f62e9
RD
7275 """EventLoop_SetActive(EventLoop loop)"""
7276 return _core_.EventLoop_SetActive(*args, **kwargs)
ae8162c8 7277
7449af73
RD
7278class EventLoopActivator(object):
7279 """Proxy of C++ EventLoopActivator class"""
554f62e9
RD
7280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7281 __repr__ = _swig_repr
7282 def __init__(self, *args, **kwargs):
7449af73 7283 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
554f62e9
RD
7284 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7285 __swig_destroy__ = _core_.delete_EventLoopActivator
7286 __del__ = lambda self : None;
2131d850 7287_core_.EventLoopActivator_swigregister(EventLoopActivator)
7449af73 7288
ae8162c8
RD
7289#---------------------------------------------------------------------------
7290
d55e5bfc 7291class AcceleratorEntry(object):
c24da6d6
RD
7292 """
7293 A class used to define items in an `wx.AcceleratorTable`. wxPython
7294 programs can choose to use wx.AcceleratorEntry objects, but using a
7295 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
79fccf9d 7296 as well. See `__init__` for of the tuple values.
c24da6d6
RD
7297
7298 :see: `wx.AcceleratorTable`
7299 """
554f62e9
RD
7300 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7301 __repr__ = _swig_repr
7302 def __init__(self, *args, **kwargs):
c24da6d6
RD
7303 """
7304 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7305
7306 Construct a wx.AcceleratorEntry.
c24da6d6 7307 """
554f62e9
RD
7308 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7309 __swig_destroy__ = _core_.delete_AcceleratorEntry
7310 __del__ = lambda self : None;
d55e5bfc 7311 def Set(*args, **kwargs):
c24da6d6
RD
7312 """
7313 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7314
c24da6d6
RD
7315 (Re)set the attributes of a wx.AcceleratorEntry.
7316 :see `__init__`
7317 """
7318 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7319
7320 def GetFlags(*args, **kwargs):
c24da6d6
RD
7321 """
7322 GetFlags(self) -> int
7323
7324 Get the AcceleratorEntry's flags.
7325 """
d55e5bfc
RD
7326 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7327
7328 def GetKeyCode(*args, **kwargs):
c24da6d6
RD
7329 """
7330 GetKeyCode(self) -> int
7331
7332 Get the AcceleratorEntry's keycode.
7333 """
d55e5bfc
RD
7334 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7335
7336 def GetCommand(*args, **kwargs):
c24da6d6
RD
7337 """
7338 GetCommand(self) -> int
7339
7340 Get the AcceleratorEntry's command ID.
7341 """
d55e5bfc
RD
7342 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7343
2131d850 7344_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc
RD
7345
7346class AcceleratorTable(Object):
c24da6d6
RD
7347 """
7348 An accelerator table allows the application to specify a table of
7349 keyboard shortcuts for menus or other commands. On Windows, menu or
7350 button commands are supported; on GTK, only menu commands are
7351 supported.
c24da6d6 7352 """
554f62e9
RD
7353 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7354 __repr__ = _swig_repr
7355 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7356 """
7357 __init__(entries) -> AcceleratorTable
7358
c24da6d6
RD
7359 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7360 items or or of 3-tuples (flags, keyCode, cmdID)
7361
7362 :see: `wx.AcceleratorEntry`
d55e5bfc 7363 """
554f62e9
RD
7364 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7365 __swig_destroy__ = _core_.delete_AcceleratorTable
7366 __del__ = lambda self : None;
d55e5bfc
RD
7367 def Ok(*args, **kwargs):
7368 """Ok(self) -> bool"""
7369 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7370
2131d850 7371_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7372
7373
7374def GetAccelFromString(*args, **kwargs):
554f62e9
RD
7375 """GetAccelFromString(String label) -> AcceleratorEntry"""
7376 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7377#---------------------------------------------------------------------------
7378
7379class VisualAttributes(object):
7380 """struct containing all the visual attributes of a control"""
554f62e9
RD
7381 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7382 __repr__ = _swig_repr
7383 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7384 """
7385 __init__(self) -> VisualAttributes
7386
7387 struct containing all the visual attributes of a control
7388 """
554f62e9
RD
7389 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7390 __swig_destroy__ = _core_.delete_VisualAttributes
7391 __del__ = lambda self : None;
d55e5bfc
RD
7392 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7393 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7394 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7395_core_.VisualAttributes_swigregister(VisualAttributes)
d55e5bfc
RD
7396NullAcceleratorTable = cvar.NullAcceleratorTable
7397PanelNameStr = cvar.PanelNameStr
7398
7399WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7400WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7401WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7402WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7403WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7404class Window(EvtHandler):
7405 """
7406 wx.Window is the base class for all windows and represents any visible
7407 object on the screen. All controls, top level windows and so on are
7408 wx.Windows. Sizers and device contexts are not however, as they don't
7409 appear on screen themselves.
7410
7411 """
554f62e9
RD
7412 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7413 __repr__ = _swig_repr
7414 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7415 """
7416 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7417 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7418
7419 Construct and show a generic Window.
7420 """
554f62e9 7421 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7422 self._setOORInfo(self)
7423
7424 def Create(*args, **kwargs):
7425 """
7426 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7427 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7428
7429 Create the GUI part of the Window for 2-phase creation mode.
7430 """
7431 return _core_.Window_Create(*args, **kwargs)
7432
7433 def Close(*args, **kwargs):
7434 """
7435 Close(self, bool force=False) -> bool
7436
7437 This function simply generates a EVT_CLOSE event whose handler usually
7438 tries to close the window. It doesn't close the window itself,
7439 however. If force is False (the default) then the window's close
7440 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
7441 """
7442 return _core_.Window_Close(*args, **kwargs)
7443
7444 def Destroy(*args, **kwargs):
7445 """
7446 Destroy(self) -> bool
7447
7448 Destroys the window safely. Frames and dialogs are not destroyed
7449 immediately when this function is called -- they are added to a list
7450 of windows to be deleted on idle time, when all the window's events
7451 have been processed. This prevents problems with events being sent to
7452 non-existent windows.
7453
7454 Returns True if the window has either been successfully deleted, or it
7455 has been added to the list of windows pending real deletion.
7456 """
7e08d4ef
RD
7457 val = _core_.Window_Destroy(*args, **kwargs)
7458 args[0].thisown = 0
7459 return val
d55e5bfc
RD
7460
7461 def DestroyChildren(*args, **kwargs):
7462 """
7463 DestroyChildren(self) -> bool
7464
79fccf9d
RD
7465 Destroys all children of a window. Called automatically by the
7466 destructor.
d55e5bfc
RD
7467 """
7468 return _core_.Window_DestroyChildren(*args, **kwargs)
7469
7470 def IsBeingDeleted(*args, **kwargs):
7471 """
7472 IsBeingDeleted(self) -> bool
7473
7474 Is the window in the process of being deleted?
7475 """
7476 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7477
d55e5bfc
RD
7478 def SetLabel(*args, **kwargs):
7479 """
7480 SetLabel(self, String label)
7481
7482 Set the text which the window shows in its label if applicable.
7483 """
7484 return _core_.Window_SetLabel(*args, **kwargs)
7485
7486 def GetLabel(*args, **kwargs):
7487 """
7488 GetLabel(self) -> String
7489
79fccf9d
RD
7490 Generic way of getting a label from any window, for identification
7491 purposes. The interpretation of this function differs from class to
7492 class. For frames and dialogs, the value returned is the title. For
7493 buttons or static text controls, it is the button text. This function
7494 can be useful for meta-programs such as testing tools or special-needs
7495 access programs)which need to identify windows by name.
d55e5bfc
RD
7496 """
7497 return _core_.Window_GetLabel(*args, **kwargs)
7498
7499 def SetName(*args, **kwargs):
7500 """
7501 SetName(self, String name)
7502
79fccf9d
RD
7503 Sets the window's name. The window name is used for ressource setting
7504 in X, it is not the same as the window title/label
d55e5bfc
RD
7505 """
7506 return _core_.Window_SetName(*args, **kwargs)
7507
7508 def GetName(*args, **kwargs):
7509 """
7510 GetName(self) -> String
7511
79fccf9d
RD
7512 Returns the windows name. This name is not guaranteed to be unique;
7513 it is up to the programmer to supply an appropriate name in the window
7514 constructor or via wx.Window.SetName.
d55e5bfc
RD
7515 """
7516 return _core_.Window_GetName(*args, **kwargs)
7517
7518 def SetWindowVariant(*args, **kwargs):
7519 """
7520 SetWindowVariant(self, int variant)
7521
79fccf9d
RD
7522 Sets the variant of the window/font size to use for this window, if
7523 the platform supports variants, for example, wxMac.
d55e5bfc
RD
7524 """
7525 return _core_.Window_SetWindowVariant(*args, **kwargs)
7526
7527 def GetWindowVariant(*args, **kwargs):
7528 """GetWindowVariant(self) -> int"""
7529 return _core_.Window_GetWindowVariant(*args, **kwargs)
7530
7531 def SetId(*args, **kwargs):
7532 """
7533 SetId(self, int winid)
7534
7535 Sets the identifier of the window. Each window has an integer
7536 identifier. If the application has not provided one, an identifier
7537 will be generated. Normally, the identifier should be provided on
7538 creation and should not be modified subsequently.
7539 """
7540 return _core_.Window_SetId(*args, **kwargs)
7541
7542 def GetId(*args, **kwargs):
7543 """
7544 GetId(self) -> int
7545
7546 Returns the identifier of the window. Each window has an integer
7547 identifier. If the application has not provided one (or the default Id
7548 -1 is used) then an unique identifier with a negative value will be
7549 generated.
7550 """
7551 return _core_.Window_GetId(*args, **kwargs)
7552
7553 def NewControlId(*args, **kwargs):
7554 """
c24da6d6 7555 NewControlId() -> int
d55e5bfc
RD
7556
7557 Generate a control id for the controls which were not given one.
7558 """
7559 return _core_.Window_NewControlId(*args, **kwargs)
7560
7561 NewControlId = staticmethod(NewControlId)
7562 def NextControlId(*args, **kwargs):
7563 """
c24da6d6 7564 NextControlId(int winid) -> int
d55e5bfc
RD
7565
7566 Get the id of the control following the one with the given
79fccf9d 7567 autogenerated) id
d55e5bfc
RD
7568 """
7569 return _core_.Window_NextControlId(*args, **kwargs)
7570
7571 NextControlId = staticmethod(NextControlId)
7572 def PrevControlId(*args, **kwargs):
7573 """
c24da6d6 7574 PrevControlId(int winid) -> int
d55e5bfc
RD
7575
7576 Get the id of the control preceding the one with the given
79fccf9d 7577 autogenerated) id
d55e5bfc
RD
7578 """
7579 return _core_.Window_PrevControlId(*args, **kwargs)
7580
7581 PrevControlId = staticmethod(PrevControlId)
7582 def SetSize(*args, **kwargs):
7583 """
7584 SetSize(self, Size size)
7585
7586 Sets the size of the window in pixels.
7587 """
7588 return _core_.Window_SetSize(*args, **kwargs)
7589
7590 def SetDimensions(*args, **kwargs):
7591 """
7592 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7593
7594 Sets the position and size of the window in pixels. The sizeFlags
7595 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
7596 equal to -1.
7597
7598 ======================== ======================================
7599 wx.SIZE_AUTO A -1 indicates that a class-specific
7600 default should be used.
7601 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7602 -1 values are supplied.
7603 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7604 interpreted as real dimensions, not
7605 default values.
7606 ======================== ======================================
7607
d55e5bfc
RD
7608 """
7609 return _core_.Window_SetDimensions(*args, **kwargs)
7610
7611 def SetRect(*args, **kwargs):
7612 """
7613 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7614
7615 Sets the position and size of the window in pixels using a wx.Rect.
7616 """
7617 return _core_.Window_SetRect(*args, **kwargs)
7618
7619 def SetSizeWH(*args, **kwargs):
7620 """
7621 SetSizeWH(self, int width, int height)
7622
7623 Sets the size of the window in pixels.
7624 """
7625 return _core_.Window_SetSizeWH(*args, **kwargs)
7626
7627 def Move(*args, **kwargs):
7628 """
7629 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7630
7631 Moves the window to the given position.
7632 """
7633 return _core_.Window_Move(*args, **kwargs)
7634
7635 SetPosition = Move
7636 def MoveXY(*args, **kwargs):
7637 """
7638 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7639
7640 Moves the window to the given position.
7641 """
7642 return _core_.Window_MoveXY(*args, **kwargs)
7643
f8167d6e
RD
7644 def SetBestFittingSize(*args, **kwargs):
7645 """
7646 SetBestFittingSize(self, Size size=DefaultSize)
7647
7648 A 'Smart' SetSize that will fill in default size components with the
7649 window's *best size* values. Also set's the minsize for use with sizers.
7650 """
7651 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7652
d55e5bfc
RD
7653 def Raise(*args, **kwargs):
7654 """
7655 Raise(self)
7656
9d7dfdff
RD
7657 Raises the window to the top of the window hierarchy. In current
7658 version of wxWidgets this works both for manage and child windows.
d55e5bfc
RD
7659 """
7660 return _core_.Window_Raise(*args, **kwargs)
7661
7662 def Lower(*args, **kwargs):
7663 """
7664 Lower(self)
7665
9d7dfdff
RD
7666 Lowers the window to the bottom of the window hierarchy. In current
7667 version of wxWidgets this works both for manage and child windows.
d55e5bfc
RD
7668 """
7669 return _core_.Window_Lower(*args, **kwargs)
7670
7671 def SetClientSize(*args, **kwargs):
7672 """
7673 SetClientSize(self, Size size)
7674
7675 This sets the size of the window client area in pixels. Using this
7676 function to size a window tends to be more device-independent than
7677 wx.Window.SetSize, since the application need not worry about what
7678 dimensions the border or title bar have when trying to fit the window
7679 around panel items, for example.
7680 """
7681 return _core_.Window_SetClientSize(*args, **kwargs)
7682
7683 def SetClientSizeWH(*args, **kwargs):
7684 """
7685 SetClientSizeWH(self, int width, int height)
7686
7687 This sets the size of the window client area in pixels. Using this
7688 function to size a window tends to be more device-independent than
7689 wx.Window.SetSize, since the application need not worry about what
7690 dimensions the border or title bar have when trying to fit the window
7691 around panel items, for example.
7692 """
7693 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7694
7695 def SetClientRect(*args, **kwargs):
7696 """
7697 SetClientRect(self, Rect rect)
7698
7699 This sets the size of the window client area in pixels. Using this
7700 function to size a window tends to be more device-independent than
7701 wx.Window.SetSize, since the application need not worry about what
7702 dimensions the border or title bar have when trying to fit the window
7703 around panel items, for example.
7704 """
7705 return _core_.Window_SetClientRect(*args, **kwargs)
7706
7707 def GetPosition(*args, **kwargs):
7708 """
7709 GetPosition(self) -> Point
7710
1c71765a
RD
7711 Get the window's position. Notice that the position is in client
7712 coordinates for child windows and screen coordinates for the top level
7713 ones, use `GetScreenPosition` if you need screen coordinates for all
7714 kinds of windows.
d55e5bfc
RD
7715 """
7716 return _core_.Window_GetPosition(*args, **kwargs)
7717
7718 def GetPositionTuple(*args, **kwargs):
7719 """
7720 GetPositionTuple() -> (x,y)
7721
1c71765a
RD
7722 Get the window's position. Notice that the position is in client
7723 coordinates for child windows and screen coordinates for the top level
7724 ones, use `GetScreenPosition` if you need screen coordinates for all
7725 kinds of windows.
d55e5bfc
RD
7726 """
7727 return _core_.Window_GetPositionTuple(*args, **kwargs)
7728
1c71765a
RD
7729 def GetScreenPosition(*args, **kwargs):
7730 """
7731 GetScreenPosition(self) -> Point
7732
7733 Get the position of the window in screen coordinantes.
7734 """
7735 return _core_.Window_GetScreenPosition(*args, **kwargs)
7736
7737 def GetScreenPositionTuple(*args, **kwargs):
7738 """
7739 GetScreenPositionTuple() -> (x,y)
7740
7741 Get the position of the window in screen coordinantes.
7742 """
7743 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7744
7745 def GetScreenRect(*args, **kwargs):
7746 """
7747 GetScreenRect(self) -> Rect
7748
7749 Returns the size and position of the window in screen coordinantes as
7750 a `wx.Rect` object.
7751 """
7752 return _core_.Window_GetScreenRect(*args, **kwargs)
7753
d55e5bfc
RD
7754 def GetSize(*args, **kwargs):
7755 """
7756 GetSize(self) -> Size
7757
7758 Get the window size.
7759 """
7760 return _core_.Window_GetSize(*args, **kwargs)
7761
7762 def GetSizeTuple(*args, **kwargs):
7763 """
7764 GetSizeTuple() -> (width, height)
7765
7766 Get the window size.
7767 """
7768 return _core_.Window_GetSizeTuple(*args, **kwargs)
7769
7770 def GetRect(*args, **kwargs):
7771 """
7772 GetRect(self) -> Rect
7773
1c71765a 7774 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc
RD
7775 """
7776 return _core_.Window_GetRect(*args, **kwargs)
7777
7778 def GetClientSize(*args, **kwargs):
7779 """
7780 GetClientSize(self) -> Size
7781
7782 This gets the size of the window's 'client area' in pixels. The client
7783 area is the area which may be drawn on by the programmer, excluding
7784 title bar, border, scrollbars, etc.
7785 """
7786 return _core_.Window_GetClientSize(*args, **kwargs)
7787
7788 def GetClientSizeTuple(*args, **kwargs):
7789 """
7790 GetClientSizeTuple() -> (width, height)
7791
7792 This gets the size of the window's 'client area' in pixels. The client
7793 area is the area which may be drawn on by the programmer, excluding
7794 title bar, border, scrollbars, etc.
7795 """
7796 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7797
7798 def GetClientAreaOrigin(*args, **kwargs):
7799 """
7800 GetClientAreaOrigin(self) -> Point
7801
7802 Get the origin of the client area of the window relative to the
7803 window's top left corner (the client area may be shifted because of
7804 the borders, scrollbars, other decorations...)
7805 """
7806 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7807
7808 def GetClientRect(*args, **kwargs):
7809 """
7810 GetClientRect(self) -> Rect
7811
629f3c1b 7812 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
7813 """
7814 return _core_.Window_GetClientRect(*args, **kwargs)
7815
7816 def GetBestSize(*args, **kwargs):
7817 """
7818 GetBestSize(self) -> Size
7819
248ed943 7820 This function returns the best acceptable minimal size for the
79fccf9d
RD
7821 window, if applicable. For example, for a static text control, it will
7822 be the minimal size such that the control label is not truncated. For
7823 windows containing subwindows (suzh aswx.Panel), the size returned by
7824 this function will be the same as the size the window would have had
7825 after calling Fit.
d55e5bfc
RD
7826 """
7827 return _core_.Window_GetBestSize(*args, **kwargs)
7828
7829 def GetBestSizeTuple(*args, **kwargs):
7830 """
7831 GetBestSizeTuple() -> (width, height)
7832
248ed943 7833 This function returns the best acceptable minimal size for the
79fccf9d
RD
7834 window, if applicable. For example, for a static text control, it will
7835 be the minimal size such that the control label is not truncated. For
7836 windows containing subwindows (suzh aswx.Panel), the size returned by
7837 this function will be the same as the size the window would have had
7838 after calling Fit.
d55e5bfc
RD
7839 """
7840 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
7841
a001823c
RD
7842 def InvalidateBestSize(*args, **kwargs):
7843 """
7844 InvalidateBestSize(self)
7845
7846 Reset the cached best size value so it will be recalculated the next
7847 time it is needed.
7848 """
7849 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7850
e2813725
RD
7851 def CacheBestSize(*args, **kwargs):
7852 """
7853 CacheBestSize(self, Size size)
7854
7855 Cache the best size so it doesn't need to be calculated again, (at least until
7856 some properties of the window change.)
7857 """
7858 return _core_.Window_CacheBestSize(*args, **kwargs)
7859
a001823c
RD
7860 def GetBestFittingSize(*args, **kwargs):
7861 """
7862 GetBestFittingSize(self) -> Size
7863
7864 This function will merge the window's best size into the window's
7865 minimum size, giving priority to the min size components, and returns
7866 the results.
7867
7868 """
7869 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7870
d55e5bfc
RD
7871 def GetAdjustedBestSize(*args, **kwargs):
7872 """
7873 GetAdjustedBestSize(self) -> Size
7874
7875 This method is similar to GetBestSize, except in one
7876 thing. GetBestSize should return the minimum untruncated size of the
7877 window, while this method will return the largest of BestSize and any
7878 user specified minimum size. ie. it is the minimum size the window
7879 should currently be drawn at, not the minimal size it can possibly
7880 tolerate.
7881 """
7882 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
7883
7884 def Center(*args, **kwargs):
7885 """
7886 Center(self, int direction=BOTH)
7887
7888 Centers the window. The parameter specifies the direction for
7889 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7890 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7891 on the entire screen and not on its parent window. If it is a
7892 top-level window and has no parent then it will always be centered
7893 relative to the screen.
7894 """
7895 return _core_.Window_Center(*args, **kwargs)
7896
7897 Centre = Center
d55e5bfc
RD
7898 def CenterOnParent(*args, **kwargs):
7899 """
7900 CenterOnParent(self, int dir=BOTH)
7901
7902 Center with respect to the the parent window
7903 """
7904 return _core_.Window_CenterOnParent(*args, **kwargs)
7905
7906 CentreOnParent = CenterOnParent
7907 def Fit(*args, **kwargs):
7908 """
7909 Fit(self)
7910
7911 Sizes the window so that it fits around its subwindows. This function
7912 won't do anything if there are no subwindows and will only really work
7913 correctly if sizers are used for the subwindows layout. Also, if the
7914 window has exactly one subwindow it is better (faster and the result
7915 is more precise as Fit adds some margin to account for fuzziness of
7916 its calculations) to call window.SetClientSize(child.GetSize())
7917 instead of calling Fit.
7918 """
7919 return _core_.Window_Fit(*args, **kwargs)
7920
7921 def FitInside(*args, **kwargs):
7922 """
7923 FitInside(self)
7924
7925 Similar to Fit, but sizes the interior (virtual) size of a
7926 window. Mainly useful with scrolled windows to reset scrollbars after
7927 sizing changes that do not trigger a size event, and/or scrolled
7928 windows without an interior sizer. This function similarly won't do
7929 anything if there are no subwindows.
7930 """
7931 return _core_.Window_FitInside(*args, **kwargs)
7932
03837c5c 7933 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
7934 """
7935 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7936 int incH=-1)
d55e5bfc
RD
7937
7938 Allows specification of minimum and maximum window sizes, and window
7939 size increments. If a pair of values is not set (or set to -1), the
7940 default values will be used. If this function is called, the user
908b74cd
RD
7941 will not be able to size the window outside the given bounds (if it is
7942 a top-level window.) Sizers will also inspect the minimum window size
7943 and will use that value if set when calculating layout.
7944
7945 The resizing increments are only significant under Motif or Xt.
d55e5bfc 7946 """
03837c5c 7947 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 7948
03837c5c
RD
7949 def SetSizeHintsSz(*args, **kwargs):
7950 """
7951 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7952
7953 Allows specification of minimum and maximum window sizes, and window
7954 size increments. If a pair of values is not set (or set to -1), the
7955 default values will be used. If this function is called, the user
7956 will not be able to size the window outside the given bounds (if it is
7957 a top-level window.) Sizers will also inspect the minimum window size
7958 and will use that value if set when calculating layout.
7959
7960 The resizing increments are only significant under Motif or Xt.
7961 """
7962 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
7963
7964 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 7965 """
908b74cd 7966 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
7967
7968 Allows specification of minimum and maximum virtual window sizes. If a
7969 pair of values is not set (or set to -1), the default values will be
7970 used. If this function is called, the user will not be able to size
7971 the virtual area of the window outside the given bounds.
7972 """
03837c5c
RD
7973 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
7974
7975 def SetVirtualSizeHintsSz(*args, **kwargs):
7976 """
7977 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7978
7979 Allows specification of minimum and maximum virtual window sizes. If a
7980 pair of values is not set (or set to -1), the default values will be
7981 used. If this function is called, the user will not be able to size
7982 the virtual area of the window outside the given bounds.
7983 """
7984 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 7985
908b74cd
RD
7986 def GetMaxSize(*args, **kwargs):
7987 """GetMaxSize(self) -> Size"""
7988 return _core_.Window_GetMaxSize(*args, **kwargs)
7989
7990 def GetMinSize(*args, **kwargs):
7991 """GetMinSize(self) -> Size"""
7992 return _core_.Window_GetMinSize(*args, **kwargs)
7993
7994 def SetMinSize(*args, **kwargs):
7995 """
7996 SetMinSize(self, Size minSize)
7997
7998 A more convenient method than `SetSizeHints` for setting just the
7999 min size.
8000 """
8001 return _core_.Window_SetMinSize(*args, **kwargs)
8002
8003 def SetMaxSize(*args, **kwargs):
8004 """
8005 SetMaxSize(self, Size maxSize)
8006
8007 A more convenient method than `SetSizeHints` for setting just the
8008 max size.
8009 """
8010 return _core_.Window_SetMaxSize(*args, **kwargs)
8011
d55e5bfc
RD
8012 def GetMinWidth(*args, **kwargs):
8013 """GetMinWidth(self) -> int"""
8014 return _core_.Window_GetMinWidth(*args, **kwargs)
8015
8016 def GetMinHeight(*args, **kwargs):
8017 """GetMinHeight(self) -> int"""
8018 return _core_.Window_GetMinHeight(*args, **kwargs)
8019
8020 def GetMaxWidth(*args, **kwargs):
8021 """GetMaxWidth(self) -> int"""
8022 return _core_.Window_GetMaxWidth(*args, **kwargs)
8023
8024 def GetMaxHeight(*args, **kwargs):
8025 """GetMaxHeight(self) -> int"""
8026 return _core_.Window_GetMaxHeight(*args, **kwargs)
8027
d55e5bfc
RD
8028 def SetVirtualSize(*args, **kwargs):
8029 """
8030 SetVirtualSize(self, Size size)
8031
8032 Set the the virtual size of a window in pixels. For most windows this
8033 is just the client area of the window, but for some like scrolled
8034 windows it is more or less independent of the screen window size.
8035 """
8036 return _core_.Window_SetVirtualSize(*args, **kwargs)
8037
8038 def SetVirtualSizeWH(*args, **kwargs):
8039 """
8040 SetVirtualSizeWH(self, int w, int h)
8041
8042 Set the the virtual size of a window in pixels. For most windows this
8043 is just the client area of the window, but for some like scrolled
8044 windows it is more or less independent of the screen window size.
8045 """
8046 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8047
8048 def GetVirtualSize(*args, **kwargs):
8049 """
8050 GetVirtualSize(self) -> Size
8051
8052 Get the the virtual size of the window in pixels. For most windows
8053 this is just the client area of the window, but for some like scrolled
8054 windows it is more or less independent of the screen window size.
8055 """
8056 return _core_.Window_GetVirtualSize(*args, **kwargs)
8057
8058 def GetVirtualSizeTuple(*args, **kwargs):
8059 """
8060 GetVirtualSizeTuple() -> (width, height)
8061
8062 Get the the virtual size of the window in pixels. For most windows
8063 this is just the client area of the window, but for some like scrolled
8064 windows it is more or less independent of the screen window size.
8065 """
8066 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8067
8068 def GetBestVirtualSize(*args, **kwargs):
8069 """
8070 GetBestVirtualSize(self) -> Size
8071
8072 Return the largest of ClientSize and BestSize (as determined by a
8073 sizer, interior children, or other means)
8074 """
8075 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8076
8077 def Show(*args, **kwargs):
8078 """
8079 Show(self, bool show=True) -> bool
8080
8081 Shows or hides the window. You may need to call Raise for a top level
8082 window if you want to bring it to top, although this is not needed if
8083 Show is called immediately after the frame creation. Returns True if
8084 the window has been shown or hidden or False if nothing was done
8085 because it already was in the requested state.
8086 """
8087 return _core_.Window_Show(*args, **kwargs)
8088
8089 def Hide(*args, **kwargs):
8090 """
8091 Hide(self) -> bool
8092
8093 Equivalent to calling Show(False).
8094 """
8095 return _core_.Window_Hide(*args, **kwargs)
8096
8097 def Enable(*args, **kwargs):
8098 """
8099 Enable(self, bool enable=True) -> bool
8100
8101 Enable or disable the window for user input. Note that when a parent
8102 window is disabled, all of its children are disabled as well and they
8103 are reenabled again when the parent is. Returns true if the window
8104 has been enabled or disabled, false if nothing was done, i.e. if the
8105 window had already been in the specified state.
8106 """
8107 return _core_.Window_Enable(*args, **kwargs)
8108
8109 def Disable(*args, **kwargs):
8110 """
8111 Disable(self) -> bool
8112
8113 Disables the window, same as Enable(false).
8114 """
8115 return _core_.Window_Disable(*args, **kwargs)
8116
8117 def IsShown(*args, **kwargs):
8118 """
8119 IsShown(self) -> bool
8120
8121 Returns true if the window is shown, false if it has been hidden.
8122 """
8123 return _core_.Window_IsShown(*args, **kwargs)
8124
8125 def IsEnabled(*args, **kwargs):
8126 """
8127 IsEnabled(self) -> bool
8128
8129 Returns true if the window is enabled for input, false otherwise.
8130 """
8131 return _core_.Window_IsEnabled(*args, **kwargs)
8132
8133 def SetWindowStyleFlag(*args, **kwargs):
8134 """
8135 SetWindowStyleFlag(self, long style)
8136
79fccf9d
RD
8137 Sets the style of the window. Please note that some styles cannot be
8138 changed after the window creation and that Refresh() might need to be
8139 called after changing the others for the change to take place
8140 immediately.
d55e5bfc
RD
8141 """
8142 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8143
8144 def GetWindowStyleFlag(*args, **kwargs):
8145 """
8146 GetWindowStyleFlag(self) -> long
8147
8148 Gets the window style that was passed to the constructor or Create
8149 method.
8150 """
8151 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8152
8153 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8154 def HasFlag(*args, **kwargs):
8155 """
8156 HasFlag(self, int flag) -> bool
8157
8158 Test if the given style is set for this window.
8159 """
8160 return _core_.Window_HasFlag(*args, **kwargs)
8161
8162 def IsRetained(*args, **kwargs):
8163 """
8164 IsRetained(self) -> bool
8165
8166 Returns true if the window is retained, false otherwise. Retained
8167 windows are only available on X platforms.
8168 """
8169 return _core_.Window_IsRetained(*args, **kwargs)
8170
8171 def SetExtraStyle(*args, **kwargs):
8172 """
8173 SetExtraStyle(self, long exStyle)
8174
8175 Sets the extra style bits for the window. Extra styles are the less
8176 often used style bits which can't be set with the constructor or with
8177 SetWindowStyleFlag()
8178 """
8179 return _core_.Window_SetExtraStyle(*args, **kwargs)
8180
8181 def GetExtraStyle(*args, **kwargs):
8182 """
8183 GetExtraStyle(self) -> long
8184
8185 Returns the extra style bits for the window.
8186 """
8187 return _core_.Window_GetExtraStyle(*args, **kwargs)
8188
8189 def MakeModal(*args, **kwargs):
8190 """
8191 MakeModal(self, bool modal=True)
8192
8193 Disables all other windows in the application so that the user can
8194 only interact with this window. Passing False will reverse this
8195 effect.
8196 """
8197 return _core_.Window_MakeModal(*args, **kwargs)
8198
8199 def SetThemeEnabled(*args, **kwargs):
8200 """
8201 SetThemeEnabled(self, bool enableTheme)
8202
8203 This function tells a window if it should use the system's "theme"
8204 code to draw the windows' background instead if its own background
8205 drawing code. This will only have an effect on platforms that support
8206 the notion of themes in user defined windows. One such platform is
8207 GTK+ where windows can have (very colourful) backgrounds defined by a
8208 user's selected theme.
8209
8210 Dialogs, notebook pages and the status bar have this flag set to true
8211 by default so that the default look and feel is simulated best.
8212 """
8213 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8214
8215 def GetThemeEnabled(*args, **kwargs):
8216 """
8217 GetThemeEnabled(self) -> bool
8218
8219 Return the themeEnabled flag.
8220 """
8221 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8222
8223 def SetFocus(*args, **kwargs):
8224 """
8225 SetFocus(self)
8226
8227 Set's the focus to this window, allowing it to receive keyboard input.
8228 """
8229 return _core_.Window_SetFocus(*args, **kwargs)
8230
8231 def SetFocusFromKbd(*args, **kwargs):
8232 """
8233 SetFocusFromKbd(self)
8234
8235 Set focus to this window as the result of a keyboard action. Normally
8236 only called internally.
8237 """
8238 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8239
8240 def FindFocus(*args, **kwargs):
8241 """
c24da6d6 8242 FindFocus() -> Window
d55e5bfc
RD
8243
8244 Returns the window or control that currently has the keyboard focus,
8245 or None.
8246 """
8247 return _core_.Window_FindFocus(*args, **kwargs)
8248
8249 FindFocus = staticmethod(FindFocus)
8250 def AcceptsFocus(*args, **kwargs):
8251 """
8252 AcceptsFocus(self) -> bool
8253
8254 Can this window have focus?
8255 """
8256 return _core_.Window_AcceptsFocus(*args, **kwargs)
8257
8258 def AcceptsFocusFromKeyboard(*args, **kwargs):
8259 """
8260 AcceptsFocusFromKeyboard(self) -> bool
8261
8262 Can this window be given focus by keyboard navigation? if not, the
8263 only way to give it focus (provided it accepts it at all) is to click
8264 it.
8265 """
8266 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8267
8268 def GetDefaultItem(*args, **kwargs):
8269 """
8270 GetDefaultItem(self) -> Window
8271
8272 Get the default child of this parent, i.e. the one which is activated
8273 by pressing <Enter> such as the OK button on a wx.Dialog.
8274 """
8275 return _core_.Window_GetDefaultItem(*args, **kwargs)
8276
8277 def SetDefaultItem(*args, **kwargs):
8278 """
8279 SetDefaultItem(self, Window child) -> Window
8280
8281 Set this child as default, return the old default.
8282 """
8283 return _core_.Window_SetDefaultItem(*args, **kwargs)
8284
8285 def SetTmpDefaultItem(*args, **kwargs):
8286 """
8287 SetTmpDefaultItem(self, Window win)
8288
8289 Set this child as temporary default
8290 """
8291 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
8292
908b74cd
RD
8293 def Navigate(*args, **kwargs):
8294 """
8295 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8296
a8eff060
RD
8297 Does keyboard navigation from this window to another, by sending a
8298 `wx.NavigationKeyEvent`.
908b74cd
RD
8299 """
8300 return _core_.Window_Navigate(*args, **kwargs)
8301
bf26d883
RD
8302 def MoveAfterInTabOrder(*args, **kwargs):
8303 """
8304 MoveAfterInTabOrder(self, Window win)
8305
8306 Moves this window in the tab navigation order after the specified
8307 sibling window. This means that when the user presses the TAB key on
8308 that other window, the focus switches to this window.
8309
8310 The default tab order is the same as creation order. This function
8311 and `MoveBeforeInTabOrder` allow to change it after creating all the
8312 windows.
8313
8314 """
8315 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8316
8317 def MoveBeforeInTabOrder(*args, **kwargs):
8318 """
8319 MoveBeforeInTabOrder(self, Window win)
8320
8321 Same as `MoveAfterInTabOrder` except that it inserts this window just
8322 before win instead of putting it right after it.
8323 """
8324 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8325
d55e5bfc
RD
8326 def GetChildren(*args, **kwargs):
8327 """
8328 GetChildren(self) -> PyObject
8329
8330 Returns a list of the window's children. NOTE: Currently this is a
8331 copy of the child window list maintained by the window, so the return
8332 value of this function is only valid as long as the window's children
8333 do not change.
8334 """
8335 return _core_.Window_GetChildren(*args, **kwargs)
8336
8337 def GetParent(*args, **kwargs):
8338 """
8339 GetParent(self) -> Window
8340
8341 Returns the parent window of this window, or None if there isn't one.
8342 """
8343 return _core_.Window_GetParent(*args, **kwargs)
8344
8345 def GetGrandParent(*args, **kwargs):
8346 """
8347 GetGrandParent(self) -> Window
8348
79fccf9d
RD
8349 Returns the parent of the parent of this window, or None if there
8350 isn't one.
d55e5bfc
RD
8351 """
8352 return _core_.Window_GetGrandParent(*args, **kwargs)
8353
8354 def IsTopLevel(*args, **kwargs):
8355 """
8356 IsTopLevel(self) -> bool
8357
8358 Returns true if the given window is a top-level one. Currently all
8359 frames and dialogs are always considered to be top-level windows (even
8360 if they have a parent window).
8361 """
8362 return _core_.Window_IsTopLevel(*args, **kwargs)
8363
8364 def Reparent(*args, **kwargs):
8365 """
8366 Reparent(self, Window newParent) -> bool
8367
8368 Reparents the window, i.e the window will be removed from its current
8369 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8370 re-inserted into another. Available on Windows and GTK. Returns True
8371 if the parent was changed, False otherwise (error or newParent ==
8372 oldParent)
8373 """
8374 return _core_.Window_Reparent(*args, **kwargs)
8375
8376 def AddChild(*args, **kwargs):
8377 """
8378 AddChild(self, Window child)
8379
8380 Adds a child window. This is called automatically by window creation
8381 functions so should not be required by the application programmer.
8382 """
8383 return _core_.Window_AddChild(*args, **kwargs)
8384
8385 def RemoveChild(*args, **kwargs):
8386 """
8387 RemoveChild(self, Window child)
8388
8389 Removes a child window. This is called automatically by window
8390 deletion functions so should not be required by the application
8391 programmer.
8392 """
8393 return _core_.Window_RemoveChild(*args, **kwargs)
8394
704eda0c
RD
8395 def SetDoubleBuffered(*args, **kwargs):
8396 """
8397 SetDoubleBuffered(self, bool on)
8398
8399 Currently wxGTK2 only.
8400 """
8401 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8402
d55e5bfc
RD
8403 def FindWindowById(*args, **kwargs):
8404 """
8405 FindWindowById(self, long winid) -> Window
8406
8407 Find a chld of this window by window ID
8408 """
8409 return _core_.Window_FindWindowById(*args, **kwargs)
8410
8411 def FindWindowByName(*args, **kwargs):
8412 """
8413 FindWindowByName(self, String name) -> Window
8414
8415 Find a child of this window by name
8416 """
8417 return _core_.Window_FindWindowByName(*args, **kwargs)
8418
8419 def GetEventHandler(*args, **kwargs):
8420 """
8421 GetEventHandler(self) -> EvtHandler
8422
8423 Returns the event handler for this window. By default, the window is
8424 its own event handler.
8425 """
8426 return _core_.Window_GetEventHandler(*args, **kwargs)
8427
8428 def SetEventHandler(*args, **kwargs):
8429 """
8430 SetEventHandler(self, EvtHandler handler)
8431
8432 Sets the event handler for this window. An event handler is an object
8433 that is capable of processing the events sent to a window. By default,
8434 the window is its own event handler, but an application may wish to
8435 substitute another, for example to allow central implementation of
8436 event-handling for a variety of different window classes.
8437
79fccf9d 8438 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8439 up a chain of event handlers, where an event not handled by one event
8440 handler is handed to the next one in the chain.
8441 """
8442 return _core_.Window_SetEventHandler(*args, **kwargs)
8443
8444 def PushEventHandler(*args, **kwargs):
8445 """
8446 PushEventHandler(self, EvtHandler handler)
8447
8448 Pushes this event handler onto the event handler stack for the window.
8449 An event handler is an object that is capable of processing the events
8450 sent to a window. By default, the window is its own event handler, but
8451 an application may wish to substitute another, for example to allow
8452 central implementation of event-handling for a variety of different
8453 window classes.
8454
8455 wx.Window.PushEventHandler allows an application to set up a chain of
8456 event handlers, where an event not handled by one event handler is
79fccf9d 8457 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8458 remove the event handler.
8459 """
8460 return _core_.Window_PushEventHandler(*args, **kwargs)
8461
8462 def PopEventHandler(*args, **kwargs):
8463 """
8464 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8465
8466 Removes and returns the top-most event handler on the event handler
8467 stack. If deleteHandler is True then the wx.EvtHandler object will be
8468 destroyed after it is popped.
8469 """
8470 return _core_.Window_PopEventHandler(*args, **kwargs)
8471
8472 def RemoveEventHandler(*args, **kwargs):
8473 """
8474 RemoveEventHandler(self, EvtHandler handler) -> bool
8475
79fccf9d
RD
8476 Find the given handler in the event handler chain and remove (but not
8477 delete) it from the event handler chain, return True if it was found
8478 and False otherwise (this also results in an assert failure so this
8479 function should only be called when the handler is supposed to be
8480 there.)
d55e5bfc
RD
8481 """
8482 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8483
8484 def SetValidator(*args, **kwargs):
8485 """
8486 SetValidator(self, Validator validator)
8487
8488 Deletes the current validator (if any) and sets the window validator,
8489 having called wx.Validator.Clone to create a new validator of this
8490 type.
8491 """
8492 return _core_.Window_SetValidator(*args, **kwargs)
8493
8494 def GetValidator(*args, **kwargs):
8495 """
8496 GetValidator(self) -> Validator
8497
8498 Returns a pointer to the current validator for the window, or None if
8499 there is none.
8500 """
8501 return _core_.Window_GetValidator(*args, **kwargs)
8502
8503 def Validate(*args, **kwargs):
8504 """
8505 Validate(self) -> bool
8506
8507 Validates the current values of the child controls using their
79fccf9d
RD
8508 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8509 style flag set, the method will also call Validate() of all child
8510 windows. Returns false if any of the validations failed.
d55e5bfc
RD
8511 """
8512 return _core_.Window_Validate(*args, **kwargs)
8513
8514 def TransferDataToWindow(*args, **kwargs):
8515 """
8516 TransferDataToWindow(self) -> bool
8517
79fccf9d
RD
8518 Transfers values to child controls from data areas specified by their
8519 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8520 style flag set, the method will also call TransferDataToWindow() of
8521 all child windows.
d55e5bfc
RD
8522 """
8523 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8524
8525 def TransferDataFromWindow(*args, **kwargs):
8526 """
8527 TransferDataFromWindow(self) -> bool
8528
79fccf9d
RD
8529 Transfers values from child controls to data areas specified by their
8530 validators. Returns false if a transfer failed. If the window has
8531 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8532 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
8533 """
8534 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8535
8536 def InitDialog(*args, **kwargs):
8537 """
8538 InitDialog(self)
8539
79fccf9d
RD
8540 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8541 to the dialog via validators.
d55e5bfc
RD
8542 """
8543 return _core_.Window_InitDialog(*args, **kwargs)
8544
8545 def SetAcceleratorTable(*args, **kwargs):
8546 """
8547 SetAcceleratorTable(self, AcceleratorTable accel)
8548
8549 Sets the accelerator table for this window.
8550 """
8551 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8552
8553 def GetAcceleratorTable(*args, **kwargs):
8554 """
8555 GetAcceleratorTable(self) -> AcceleratorTable
8556
8557 Gets the accelerator table for this window.
8558 """
8559 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8560
8561 def RegisterHotKey(*args, **kwargs):
8562 """
8563 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8564
8565 Registers a system wide hotkey. Every time the user presses the hotkey
8566 registered here, this window will receive a hotkey event. It will
8567 receive the event even if the application is in the background and
8568 does not have the input focus because the user is working with some
8569 other application. To bind an event handler function to this hotkey
8570 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8571 hotkey was registered successfully.
8572 """
8573 return _core_.Window_RegisterHotKey(*args, **kwargs)
8574
8575 def UnregisterHotKey(*args, **kwargs):
8576 """
8577 UnregisterHotKey(self, int hotkeyId) -> bool
8578
8579 Unregisters a system wide hotkey.
8580 """
8581 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8582
8583 def ConvertDialogPointToPixels(*args, **kwargs):
8584 """
8585 ConvertDialogPointToPixels(self, Point pt) -> Point
8586
8587 Converts a point or size from dialog units to pixels. Dialog units
8588 are used for maintaining a dialog's proportions even if the font
8589 changes. For the x dimension, the dialog units are multiplied by the
8590 average character width and then divided by 4. For the y dimension,
8591 the dialog units are multiplied by the average character height and
8592 then divided by 8.
8593 """
8594 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8595
8596 def ConvertDialogSizeToPixels(*args, **kwargs):
8597 """
8598 ConvertDialogSizeToPixels(self, Size sz) -> Size
8599
8600 Converts a point or size from dialog units to pixels. Dialog units
8601 are used for maintaining a dialog's proportions even if the font
8602 changes. For the x dimension, the dialog units are multiplied by the
8603 average character width and then divided by 4. For the y dimension,
8604 the dialog units are multiplied by the average character height and
8605 then divided by 8.
8606 """
8607 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8608
8609 def DLG_PNT(*args, **kwargs):
8610 """
8611 DLG_PNT(self, Point pt) -> Point
8612
8613 Converts a point or size from dialog units to pixels. Dialog units
8614 are used for maintaining a dialog's proportions even if the font
8615 changes. For the x dimension, the dialog units are multiplied by the
8616 average character width and then divided by 4. For the y dimension,
8617 the dialog units are multiplied by the average character height and
8618 then divided by 8.
8619 """
8620 return _core_.Window_DLG_PNT(*args, **kwargs)
8621
8622 def DLG_SZE(*args, **kwargs):
8623 """
8624 DLG_SZE(self, Size sz) -> Size
8625
8626 Converts a point or size from dialog units to pixels. Dialog units
8627 are used for maintaining a dialog's proportions even if the font
8628 changes. For the x dimension, the dialog units are multiplied by the
8629 average character width and then divided by 4. For the y dimension,
8630 the dialog units are multiplied by the average character height and
8631 then divided by 8.
8632 """
8633 return _core_.Window_DLG_SZE(*args, **kwargs)
8634
8635 def ConvertPixelPointToDialog(*args, **kwargs):
8636 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8637 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8638
8639 def ConvertPixelSizeToDialog(*args, **kwargs):
8640 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8641 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8642
8643 def WarpPointer(*args, **kwargs):
8644 """
8645 WarpPointer(self, int x, int y)
8646
8647 Moves the pointer to the given position on the window.
8648
8649 NOTE: This function is not supported under Mac because Apple Human
8650 Interface Guidelines forbid moving the mouse cursor programmatically.
8651 """
8652 return _core_.Window_WarpPointer(*args, **kwargs)
8653
8654 def CaptureMouse(*args, **kwargs):
8655 """
8656 CaptureMouse(self)
8657
8658 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8659 release the capture.
8660
8661 Note that wxWindows maintains the stack of windows having captured the
8662 mouse and when the mouse is released the capture returns to the window
8663 which had had captured it previously and it is only really released if
8664 there were no previous window. In particular, this means that you must
8665 release the mouse as many times as you capture it.
8666 """
8667 return _core_.Window_CaptureMouse(*args, **kwargs)
8668
8669 def ReleaseMouse(*args, **kwargs):
8670 """
8671 ReleaseMouse(self)
8672
8673 Releases mouse input captured with wx.Window.CaptureMouse.
8674 """
8675 return _core_.Window_ReleaseMouse(*args, **kwargs)
8676
8677 def GetCapture(*args, **kwargs):
8678 """
c24da6d6 8679 GetCapture() -> Window
d55e5bfc
RD
8680
8681 Returns the window which currently captures the mouse or None
8682 """
8683 return _core_.Window_GetCapture(*args, **kwargs)
8684
8685 GetCapture = staticmethod(GetCapture)
8686 def HasCapture(*args, **kwargs):
8687 """
8688 HasCapture(self) -> bool
8689
8690 Returns true if this window has the current mouse capture.
8691 """
8692 return _core_.Window_HasCapture(*args, **kwargs)
8693
8694 def Refresh(*args, **kwargs):
8695 """
8696 Refresh(self, bool eraseBackground=True, Rect rect=None)
8697
8698 Mark the specified rectangle (or the whole window) as "dirty" so it
8699 will be repainted. Causes an EVT_PAINT event to be generated and sent
8700 to the window.
8701 """
8702 return _core_.Window_Refresh(*args, **kwargs)
8703
8704 def RefreshRect(*args, **kwargs):
8705 """
fef4c27a 8706 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
8707
8708 Redraws the contents of the given rectangle: the area inside it will
8709 be repainted. This is the same as Refresh but has a nicer syntax.
8710 """
8711 return _core_.Window_RefreshRect(*args, **kwargs)
8712
8713 def Update(*args, **kwargs):
8714 """
8715 Update(self)
8716
8717 Calling this method immediately repaints the invalidated area of the
8718 window instead of waiting for the EVT_PAINT event to happen, (normally
8719 this would usually only happen when the flow of control returns to the
8720 event loop.) Notice that this function doesn't refresh the window and
8721 does nothing if the window has been already repainted. Use Refresh
8722 first if you want to immediately redraw the window (or some portion of
8723 it) unconditionally.
8724 """
8725 return _core_.Window_Update(*args, **kwargs)
8726
8727 def ClearBackground(*args, **kwargs):
8728 """
8729 ClearBackground(self)
8730
8731 Clears the window by filling it with the current background
8732 colour. Does not cause an erase background event to be generated.
8733 """
8734 return _core_.Window_ClearBackground(*args, **kwargs)
8735
8736 def Freeze(*args, **kwargs):
8737 """
8738 Freeze(self)
8739
79fccf9d
RD
8740 Freezes the window or, in other words, prevents any updates from
8741 taking place on screen, the window is not redrawn at all. Thaw must be
8742 called to reenable window redrawing. Calls to Freeze/Thaw may be
8743 nested, with the actual Thaw being delayed until all the nesting has
8744 been undone.
d55e5bfc
RD
8745
8746 This method is useful for visual appearance optimization (for example,
8747 it is a good idea to use it before inserting large amount of text into
8748 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8749 for all controls so it is mostly just a hint to wxWindows and not a
8750 mandatory directive.
8751 """
8752 return _core_.Window_Freeze(*args, **kwargs)
8753
8754 def Thaw(*args, **kwargs):
8755 """
8756 Thaw(self)
8757
8758 Reenables window updating after a previous call to Freeze. Calls to
79fccf9d
RD
8759 Freeze/Thaw may be nested, so Thaw must be called the same number of
8760 times that Freeze was before the window will be updated.
d55e5bfc
RD
8761 """
8762 return _core_.Window_Thaw(*args, **kwargs)
8763
8764 def PrepareDC(*args, **kwargs):
8765 """
8766 PrepareDC(self, DC dc)
8767
8768 Call this function to prepare the device context for drawing a
8769 scrolled image. It sets the device origin according to the current
8770 scroll position.
8771 """
8772 return _core_.Window_PrepareDC(*args, **kwargs)
8773
8774 def GetUpdateRegion(*args, **kwargs):
8775 """
8776 GetUpdateRegion(self) -> Region
8777
8778 Returns the region specifying which parts of the window have been
8779 damaged. Should only be called within an EVT_PAINT handler.
8780 """
8781 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8782
8783 def GetUpdateClientRect(*args, **kwargs):
8784 """
8785 GetUpdateClientRect(self) -> Rect
8786
8787 Get the update rectangle region bounding box in client coords.
8788 """
8789 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8790
8791 def IsExposed(*args, **kwargs):
8792 """
8793 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8794
8795 Returns true if the given point or rectangle area has been exposed
8796 since the last repaint. Call this in an paint event handler to
8797 optimize redrawing by only redrawing those areas, which have been
8798 exposed.
8799 """
8800 return _core_.Window_IsExposed(*args, **kwargs)
8801
8802 def IsExposedPoint(*args, **kwargs):
8803 """
8804 IsExposedPoint(self, Point pt) -> bool
8805
8806 Returns true if the given point or rectangle area has been exposed
8807 since the last repaint. Call this in an paint event handler to
8808 optimize redrawing by only redrawing those areas, which have been
8809 exposed.
8810 """
8811 return _core_.Window_IsExposedPoint(*args, **kwargs)
8812
8813 def IsExposedRect(*args, **kwargs):
8814 """
8815 IsExposedRect(self, Rect rect) -> bool
8816
8817 Returns true if the given point or rectangle area has been exposed
8818 since the last repaint. Call this in an paint event handler to
8819 optimize redrawing by only redrawing those areas, which have been
8820 exposed.
8821 """
8822 return _core_.Window_IsExposedRect(*args, **kwargs)
8823
8824 def GetDefaultAttributes(*args, **kwargs):
8825 """
8826 GetDefaultAttributes(self) -> VisualAttributes
8827
79fccf9d
RD
8828 Get the default attributes for an instance of this class. This is
8829 useful if you want to use the same font or colour in your own control
8830 as in a standard control -- which is a much better idea than hard
8831 coding specific colours or fonts which might look completely out of
caef1a4d 8832 place on the user's system, especially if it uses themes.
d55e5bfc
RD
8833 """
8834 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8835
8836 def GetClassDefaultAttributes(*args, **kwargs):
8837 """
c24da6d6 8838 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 8839
79fccf9d
RD
8840 Get the default attributes for this class. This is useful if you want
8841 to use the same font or colour in your own control as in a standard
8842 control -- which is a much better idea than hard coding specific
caef1a4d
RD
8843 colours or fonts which might look completely out of place on the
8844 user's system, especially if it uses themes.
d55e5bfc
RD
8845
8846 The variant parameter is only relevant under Mac currently and is
79fccf9d 8847 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
8848 the returned font. See `wx.Window.SetWindowVariant` for more about
8849 this.
d55e5bfc
RD
8850 """
8851 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8852
8853 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8854 def SetBackgroundColour(*args, **kwargs):
8855 """
8856 SetBackgroundColour(self, Colour colour) -> bool
8857
8858 Sets the background colour of the window. Returns True if the colour
8859 was changed. The background colour is usually painted by the default
8860 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8861 automatically under GTK. Using `wx.NullColour` will reset the window
8862 to the default background colour.
d55e5bfc 8863
caef1a4d 8864 Note that setting the background colour may not cause an immediate
f8167d6e 8865 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
8866 calling this function.
8867
f8167d6e
RD
8868 Using this function will disable attempts to use themes for this
8869 window, if the system supports them. Use with care since usually the
8870 themes represent the appearance chosen by the user to be used for all
8871 applications on the system.
d55e5bfc
RD
8872 """
8873 return _core_.Window_SetBackgroundColour(*args, **kwargs)
8874
412d302d
RD
8875 def SetOwnBackgroundColour(*args, **kwargs):
8876 """SetOwnBackgroundColour(self, Colour colour)"""
8877 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8878
8879 def SetForegroundColour(*args, **kwargs):
8880 """
8881 SetForegroundColour(self, Colour colour) -> bool
8882
8883 Sets the foreground colour of the window. Returns True is the colour
8884 was changed. The interpretation of foreground colour is dependent on
8885 the window class; it may be the text colour or other colour, or it may
8886 not be used at all.
8887 """
8888 return _core_.Window_SetForegroundColour(*args, **kwargs)
8889
fa47d7a7
VS
8890 def SetOwnForegroundColour(*args, **kwargs):
8891 """SetOwnForegroundColour(self, Colour colour)"""
8892 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
8893
8894 def GetBackgroundColour(*args, **kwargs):
8895 """
8896 GetBackgroundColour(self) -> Colour
8897
8898 Returns the background colour of the window.
8899 """
8900 return _core_.Window_GetBackgroundColour(*args, **kwargs)
8901
8902 def GetForegroundColour(*args, **kwargs):
8903 """
8904 GetForegroundColour(self) -> Colour
8905
8906 Returns the foreground colour of the window. The interpretation of
8907 foreground colour is dependent on the window class; it may be the text
8908 colour or other colour, or it may not be used at all.
8909 """
8910 return _core_.Window_GetForegroundColour(*args, **kwargs)
8911
dcb8fc74
RD
8912 def InheritsBackgroundColour(*args, **kwargs):
8913 """InheritsBackgroundColour(self) -> bool"""
8914 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8915
8916 def UseBgCol(*args, **kwargs):
8917 """UseBgCol(self) -> bool"""
8918 return _core_.Window_UseBgCol(*args, **kwargs)
8919
0f63ec68
RD
8920 def SetBackgroundStyle(*args, **kwargs):
8921 """
8922 SetBackgroundStyle(self, int style) -> bool
8923
8924 Returns the background style of the window. The background style
8925 indicates how the background of the window is drawn.
8926
8927 ====================== ========================================
8928 wx.BG_STYLE_SYSTEM The background colour or pattern should
8929 be determined by the system
8930 wx.BG_STYLE_COLOUR The background should be a solid colour
8931 wx.BG_STYLE_CUSTOM The background will be implemented by the
8932 application.
8933 ====================== ========================================
8934
8935 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8936 a custom background, such as a tiled bitmap. Currently the style has
8937 no effect on other platforms.
8938
8939 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8940 """
8941 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8942
8943 def GetBackgroundStyle(*args, **kwargs):
8944 """
8945 GetBackgroundStyle(self) -> int
8946
8947 Returns the background style of the window.
8948
8949 :see: `SetBackgroundStyle`
8950 """
8951 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8952
51b83b37
RD
8953 def HasTransparentBackground(*args, **kwargs):
8954 """
8955 HasTransparentBackground(self) -> bool
8956
8957 Returns True if this window's background is transparent (as, for
8958 example, for `wx.StaticText`) and should show the parent window's
8959 background.
8960
8961 This method is mostly used internally by the library itself and you
8962 normally shouldn't have to call it. You may, however, have to override
8963 it in your custom control classes to ensure that background is painted
8964 correctly.
8965 """
8966 return _core_.Window_HasTransparentBackground(*args, **kwargs)
8967
d55e5bfc
RD
8968 def SetCursor(*args, **kwargs):
8969 """
8970 SetCursor(self, Cursor cursor) -> bool
8971
8972 Sets the window's cursor. Notice that the window cursor also sets it
8973 for the children of the window implicitly.
8974
8975 The cursor may be wx.NullCursor in which case the window cursor will
8976 be reset back to default.
8977 """
8978 return _core_.Window_SetCursor(*args, **kwargs)
8979
8980 def GetCursor(*args, **kwargs):
8981 """
8982 GetCursor(self) -> Cursor
8983
8984 Return the cursor associated with this window.
8985 """
8986 return _core_.Window_GetCursor(*args, **kwargs)
8987
8988 def SetFont(*args, **kwargs):
8989 """
8990 SetFont(self, Font font) -> bool
8991
8992 Sets the font for this window.
8993 """
8994 return _core_.Window_SetFont(*args, **kwargs)
8995
fa47d7a7
VS
8996 def SetOwnFont(*args, **kwargs):
8997 """SetOwnFont(self, Font font)"""
8998 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
8999
9000 def GetFont(*args, **kwargs):
9001 """
9002 GetFont(self) -> Font
9003
9004 Returns the default font used for this window.
9005 """
9006 return _core_.Window_GetFont(*args, **kwargs)
9007
9008 def SetCaret(*args, **kwargs):
9009 """
9010 SetCaret(self, Caret caret)
9011
9012 Sets the caret associated with the window.
9013 """
9014 return _core_.Window_SetCaret(*args, **kwargs)
9015
9016 def GetCaret(*args, **kwargs):
9017 """
9018 GetCaret(self) -> Caret
9019
9020 Returns the caret associated with the window.
9021 """
9022 return _core_.Window_GetCaret(*args, **kwargs)
9023
9024 def GetCharHeight(*args, **kwargs):
9025 """
9026 GetCharHeight(self) -> int
9027
9028 Get the (average) character size for the current font.
9029 """
9030 return _core_.Window_GetCharHeight(*args, **kwargs)
9031
9032 def GetCharWidth(*args, **kwargs):
9033 """
9034 GetCharWidth(self) -> int
9035
9036 Get the (average) character size for the current font.
9037 """
9038 return _core_.Window_GetCharWidth(*args, **kwargs)
9039
9040 def GetTextExtent(*args, **kwargs):
a8eff060
RD
9041 """
9042 GetTextExtent(String string) -> (width, height)
9043
9044 Get the width and height of the text using the current font.
9045 """
d55e5bfc
RD
9046 return _core_.Window_GetTextExtent(*args, **kwargs)
9047
9048 def GetFullTextExtent(*args, **kwargs):
9049 """
9050 GetFullTextExtent(String string, Font font=None) ->
9051 (width, height, descent, externalLeading)
9052
9053 Get the width, height, decent and leading of the text using the
9054 current or specified font.
9055 """
9056 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9057
9058 def ClientToScreenXY(*args, **kwargs):
9059 """
9060 ClientToScreenXY(int x, int y) -> (x,y)
9061
9062 Converts to screen coordinates from coordinates relative to this window.
9063 """
9064 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9065
9066 def ScreenToClientXY(*args, **kwargs):
9067 """
9068 ScreenToClientXY(int x, int y) -> (x,y)
9069
9070 Converts from screen to client window coordinates.
9071 """
9072 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9073
9074 def ClientToScreen(*args, **kwargs):
9075 """
9076 ClientToScreen(self, Point pt) -> Point
9077
9078 Converts to screen coordinates from coordinates relative to this window.
9079 """
9080 return _core_.Window_ClientToScreen(*args, **kwargs)
9081
9082 def ScreenToClient(*args, **kwargs):
9083 """
9084 ScreenToClient(self, Point pt) -> Point
9085
9086 Converts from screen to client window coordinates.
9087 """
9088 return _core_.Window_ScreenToClient(*args, **kwargs)
9089
9090 def HitTestXY(*args, **kwargs):
9091 """
9092 HitTestXY(self, int x, int y) -> int
9093
9094 Test where the given (in client coords) point lies
9095 """
9096 return _core_.Window_HitTestXY(*args, **kwargs)
9097
9098 def HitTest(*args, **kwargs):
9099 """
9100 HitTest(self, Point pt) -> int
9101
9102 Test where the given (in client coords) point lies
9103 """
9104 return _core_.Window_HitTest(*args, **kwargs)
9105
9106 def GetBorder(*args):
9107 """
9108 GetBorder(self, long flags) -> int
9109 GetBorder(self) -> int
9110
9111 Get border for the flags of this window
9112 """
9113 return _core_.Window_GetBorder(*args)
9114
9115 def UpdateWindowUI(*args, **kwargs):
9116 """
9117 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9118
9119 This function sends EVT_UPDATE_UI events to the window. The particular
9120 implementation depends on the window; for example a wx.ToolBar will
9121 send an update UI event for each toolbar button, and a wx.Frame will
9122 send an update UI event for each menubar menu item. You can call this
9123 function from your application to ensure that your UI is up-to-date at
9124 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9125 concerned). This may be necessary if you have called
5ba5649b 9126 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9127 limit the overhead that wxWindows incurs by sending update UI events
9128 in idle time.
d55e5bfc
RD
9129 """
9130 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9131
9132 def PopupMenuXY(*args, **kwargs):
9133 """
7a0b95b0 9134 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9135
7a0b95b0
RD
9136 Pops up the given menu at the specified coordinates, relative to this window,
9137 and returns control when the user has dismissed the menu. If a menu item is
9138 selected, the corresponding menu event is generated and will be processed as
9139 usual. If the default position is given then the current position of the
9140 mouse cursor will be used.
d55e5bfc
RD
9141 """
9142 return _core_.Window_PopupMenuXY(*args, **kwargs)
9143
9144 def PopupMenu(*args, **kwargs):
9145 """
7a0b95b0 9146 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9147
7a0b95b0
RD
9148 Pops up the given menu at the specified coordinates, relative to this window,
9149 and returns control when the user has dismissed the menu. If a menu item is
9150 selected, the corresponding menu event is generated and will be processed as
9151 usual. If the default position is given then the current position of the
9152 mouse cursor will be used.
d55e5bfc
RD
9153 """
9154 return _core_.Window_PopupMenu(*args, **kwargs)
9155
9156 def GetHandle(*args, **kwargs):
9157 """
9158 GetHandle(self) -> long
9159
9160 Returns the platform-specific handle (as a long integer) of the
9161 physical window. Currently on wxMac it returns the handle of the
9162 toplevel parent of the window.
9163 """
9164 return _core_.Window_GetHandle(*args, **kwargs)
9165
629e65c2
RD
9166 def AssociateHandle(*args, **kwargs):
9167 """
9168 AssociateHandle(self, long handle)
9169
9170 Associate the window with a new native handle
9171 """
9172 return _core_.Window_AssociateHandle(*args, **kwargs)
9173
9174 def DissociateHandle(*args, **kwargs):
9175 """
9176 DissociateHandle(self)
9177
9178 Dissociate the current native handle from the window
9179 """
9180 return _core_.Window_DissociateHandle(*args, **kwargs)
9181
d55e5bfc
RD
9182 def OnPaint(*args, **kwargs):
9183 """OnPaint(self, PaintEvent event)"""
9184 return _core_.Window_OnPaint(*args, **kwargs)
9185
9186 def HasScrollbar(*args, **kwargs):
9187 """
9188 HasScrollbar(self, int orient) -> bool
9189
9190 Does the window have the scrollbar for this orientation?
9191 """
9192 return _core_.Window_HasScrollbar(*args, **kwargs)
9193
9194 def SetScrollbar(*args, **kwargs):
9195 """
79fccf9d 9196 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9197 bool refresh=True)
9198
9199 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
9200 """
9201 return _core_.Window_SetScrollbar(*args, **kwargs)
9202
9203 def SetScrollPos(*args, **kwargs):
9204 """
9205 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9206
9207 Sets the position of one of the built-in scrollbars.
9208 """
9209 return _core_.Window_SetScrollPos(*args, **kwargs)
9210
9211 def GetScrollPos(*args, **kwargs):
9212 """
9213 GetScrollPos(self, int orientation) -> int
9214
9215 Returns the built-in scrollbar position.
9216 """
9217 return _core_.Window_GetScrollPos(*args, **kwargs)
9218
9219 def GetScrollThumb(*args, **kwargs):
9220 """
9221 GetScrollThumb(self, int orientation) -> int
9222
9223 Returns the built-in scrollbar thumb size.
9224 """
9225 return _core_.Window_GetScrollThumb(*args, **kwargs)
9226
9227 def GetScrollRange(*args, **kwargs):
9228 """
9229 GetScrollRange(self, int orientation) -> int
9230
9231 Returns the built-in scrollbar range.
9232 """
9233 return _core_.Window_GetScrollRange(*args, **kwargs)
9234
9235 def ScrollWindow(*args, **kwargs):
9236 """
9237 ScrollWindow(self, int dx, int dy, Rect rect=None)
9238
9239 Physically scrolls the pixels in the window and move child windows
9240 accordingly. Use this function to optimise your scrolling
9241 implementations, to minimise the area that must be redrawn. Note that
9242 it is rarely required to call this function from a user program.
d55e5bfc
RD
9243 """
9244 return _core_.Window_ScrollWindow(*args, **kwargs)
9245
9246 def ScrollLines(*args, **kwargs):
9247 """
9248 ScrollLines(self, int lines) -> bool
9249
9250 If the platform and window class supports it, scrolls the window by
9251 the given number of lines down, if lines is positive, or up if lines
9252 is negative. Returns True if the window was scrolled, False if it was
9253 already on top/bottom and nothing was done.
9254 """
9255 return _core_.Window_ScrollLines(*args, **kwargs)
9256
9257 def ScrollPages(*args, **kwargs):
9258 """
9259 ScrollPages(self, int pages) -> bool
9260
79fccf9d 9261 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9262 the given number of pages down, if pages is positive, or up if pages
9263 is negative. Returns True if the window was scrolled, False if it was
9264 already on top/bottom and nothing was done.
9265 """
9266 return _core_.Window_ScrollPages(*args, **kwargs)
9267
9268 def LineUp(*args, **kwargs):
9269 """
9270 LineUp(self) -> bool
9271
9272 This is just a wrapper for ScrollLines(-1).
9273 """
9274 return _core_.Window_LineUp(*args, **kwargs)
9275
9276 def LineDown(*args, **kwargs):
9277 """
9278 LineDown(self) -> bool
9279
9280 This is just a wrapper for ScrollLines(1).
9281 """
9282 return _core_.Window_LineDown(*args, **kwargs)
9283
9284 def PageUp(*args, **kwargs):
9285 """
9286 PageUp(self) -> bool
9287
9288 This is just a wrapper for ScrollPages(-1).
9289 """
9290 return _core_.Window_PageUp(*args, **kwargs)
9291
9292 def PageDown(*args, **kwargs):
9293 """
9294 PageDown(self) -> bool
9295
9296 This is just a wrapper for ScrollPages(1).
9297 """
9298 return _core_.Window_PageDown(*args, **kwargs)
9299
9300 def SetHelpText(*args, **kwargs):
9301 """
9302 SetHelpText(self, String text)
9303
9304 Sets the help text to be used as context-sensitive help for this
9305 window. Note that the text is actually stored by the current
f52cbe90 9306 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc
RD
9307 """
9308 return _core_.Window_SetHelpText(*args, **kwargs)
9309
9310 def SetHelpTextForId(*args, **kwargs):
9311 """
9312 SetHelpTextForId(self, String text)
9313
9314 Associate this help text with all windows with the same id as this
9315 one.
9316 """
9317 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9318
9319 def GetHelpText(*args, **kwargs):
9320 """
9321 GetHelpText(self) -> String
9322
9323 Gets the help text to be used as context-sensitive help for this
9324 window. Note that the text is actually stored by the current
f52cbe90 9325 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc
RD
9326 """
9327 return _core_.Window_GetHelpText(*args, **kwargs)
9328
9329 def SetToolTipString(*args, **kwargs):
9330 """
9331 SetToolTipString(self, String tip)
9332
9333 Attach a tooltip to the window.
9334 """
9335 return _core_.Window_SetToolTipString(*args, **kwargs)
9336
9337 def SetToolTip(*args, **kwargs):
9338 """
9339 SetToolTip(self, ToolTip tip)
9340
9341 Attach a tooltip to the window.
9342 """
9343 return _core_.Window_SetToolTip(*args, **kwargs)
9344
9345 def GetToolTip(*args, **kwargs):
9346 """
9347 GetToolTip(self) -> ToolTip
9348
9349 get the associated tooltip or None if none
9350 """
9351 return _core_.Window_GetToolTip(*args, **kwargs)
9352
9353 def SetDropTarget(*args, **kwargs):
9354 """
9355 SetDropTarget(self, DropTarget dropTarget)
9356
9357 Associates a drop target with this window. If the window already has
9358 a drop target, it is deleted.
9359 """
9360 return _core_.Window_SetDropTarget(*args, **kwargs)
9361
9362 def GetDropTarget(*args, **kwargs):
9363 """
9364 GetDropTarget(self) -> DropTarget
9365
9366 Returns the associated drop target, which may be None.
9367 """
9368 return _core_.Window_GetDropTarget(*args, **kwargs)
9369
9370 def DragAcceptFiles(*args, **kwargs):
9371 """
9372 DragAcceptFiles(self, bool accept)
9373
9374 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
5ba5649b 9375 Only functional on Windows.
d55e5bfc
RD
9376 """
9377 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9378
9379 def SetConstraints(*args, **kwargs):
9380 """
9381 SetConstraints(self, LayoutConstraints constraints)
9382
9383 Sets the window to have the given layout constraints. If an existing
9384 layout constraints object is already owned by the window, it will be
9385 deleted. Pass None to disassociate and delete the window's current
9386 constraints.
9387
9388 You must call SetAutoLayout to tell a window to use the constraints
9389 automatically in its default EVT_SIZE handler; otherwise, you must
9390 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9391 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9392 effect.
9393 """
9394 return _core_.Window_SetConstraints(*args, **kwargs)
9395
9396 def GetConstraints(*args, **kwargs):
9397 """
9398 GetConstraints(self) -> LayoutConstraints
9399
9400 Returns a pointer to the window's layout constraints, or None if there
9401 are none.
9402 """
9403 return _core_.Window_GetConstraints(*args, **kwargs)
9404
9405 def SetAutoLayout(*args, **kwargs):
9406 """
9407 SetAutoLayout(self, bool autoLayout)
9408
9409 Determines whether the Layout function will be called automatically
b1fcee84
RD
9410 when the window is resized. lease note that this only happens for the
9411 windows usually used to contain children, namely `wx.Panel` and
9412 `wx.TopLevelWindow` (and the classes deriving from them).
9413
9414 This method is called implicitly by `SetSizer` but if you use
9415 `SetConstraints` you should call it manually or otherwise the window
9416 layout won't be correctly updated when its size changes.
d55e5bfc
RD
9417 """
9418 return _core_.Window_SetAutoLayout(*args, **kwargs)
9419
9420 def GetAutoLayout(*args, **kwargs):
9421 """
9422 GetAutoLayout(self) -> bool
9423
9424 Returns the current autoLayout setting
9425 """
9426 return _core_.Window_GetAutoLayout(*args, **kwargs)
9427
9428 def Layout(*args, **kwargs):
9429 """
9430 Layout(self) -> bool
9431
9432 Invokes the constraint-based layout algorithm or the sizer-based
9433 algorithm for this window. See SetAutoLayout: when auto layout is on,
9434 this function gets called automatically by the default EVT_SIZE
9435 handler when the window is resized.
9436 """
9437 return _core_.Window_Layout(*args, **kwargs)
9438
9439 def SetSizer(*args, **kwargs):
9440 """
9441 SetSizer(self, Sizer sizer, bool deleteOld=True)
9442
9443 Sets the window to have the given layout sizer. The window will then
9444 own the object, and will take care of its deletion. If an existing
9445 layout sizer object is already owned by the window, it will be deleted
9446 if the deleteOld parameter is true. Note that this function will also
9447 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9448 non-None, and False otherwise.
d55e5bfc
RD
9449 """
9450 return _core_.Window_SetSizer(*args, **kwargs)
9451
9452 def SetSizerAndFit(*args, **kwargs):
9453 """
9454 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9455
9456 The same as SetSizer, except it also sets the size hints for the
9457 window based on the sizer's minimum size.
9458 """
9459 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9460
9461 def GetSizer(*args, **kwargs):
9462 """
9463 GetSizer(self) -> Sizer
9464
9465 Return the sizer associated with the window by a previous call to
9466 SetSizer or None if there isn't one.
9467 """
9468 return _core_.Window_GetSizer(*args, **kwargs)
9469
9470 def SetContainingSizer(*args, **kwargs):
9471 """
9472 SetContainingSizer(self, Sizer sizer)
9473
9474 This normally does not need to be called by application code. It is
9475 called internally when a window is added to a sizer, and is used so
9476 the window can remove itself from the sizer when it is destroyed.
9477 """
9478 return _core_.Window_SetContainingSizer(*args, **kwargs)
9479
9480 def GetContainingSizer(*args, **kwargs):
9481 """
9482 GetContainingSizer(self) -> Sizer
9483
9484 Return the sizer that this window is a member of, if any, otherwise None.
9485 """
9486 return _core_.Window_GetContainingSizer(*args, **kwargs)
9487
9488 def InheritAttributes(*args, **kwargs):
9489 """
9490 InheritAttributes(self)
9491
79fccf9d
RD
9492 This function is (or should be, in case of custom controls) called
9493 during window creation to intelligently set up the window visual
9494 attributes, that is the font and the foreground and background
9495 colours.
9496
9497 By 'intelligently' the following is meant: by default, all windows use
9498 their own default attributes. However if some of the parent's
9499 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9500 SetOwnFont) and if the corresponding attribute hadn't been
79fccf9d
RD
9501 explicitly set for this window itself, then this window takes the same
9502 value as used by the parent. In addition, if the window overrides
9503 ShouldInheritColours to return false, the colours will not be changed
9504 no matter what and only the font might.
9505
ec9b55ca
RD
9506 This rather complicated logic is necessary in order to accommodate the
9507 different usage scenarios. The most common one is when all default
79fccf9d
RD
9508 attributes are used and in this case, nothing should be inherited as
9509 in modern GUIs different controls use different fonts (and colours)
9510 than their siblings so they can't inherit the same value from the
9511 parent. However it was also deemed desirable to allow to simply change
9512 the attributes of all children at once by just changing the font or
9513 colour of their common parent, hence in this case we do inherit the
9514 parents attributes.
9515
d55e5bfc
RD
9516 """
9517 return _core_.Window_InheritAttributes(*args, **kwargs)
9518
9519 def ShouldInheritColours(*args, **kwargs):
9520 """
9521 ShouldInheritColours(self) -> bool
9522
9523 Return true from here to allow the colours of this window to be
79fccf9d
RD
9524 changed by InheritAttributes, returning false forbids inheriting them
9525 from the parent window.
d55e5bfc 9526
79fccf9d
RD
9527 The base class version returns false, but this method is overridden in
9528 wxControl where it returns true.
d55e5bfc
RD
9529 """
9530 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9531
9532 def PostCreate(self, pre):
9533 """
9534 Phase 3 of the 2-phase create <wink!>
9535 Call this method after precreating the window with the 2-phase create method.
9536 """
9537 self.this = pre.this
9538 self.thisown = pre.thisown
9539 pre.thisown = 0
9540 if hasattr(self, '_setOORInfo'):
9541 self._setOORInfo(self)
9542 if hasattr(self, '_setCallbackInfo'):
9543 self._setCallbackInfo(self, self.__class__)
9544
7e08d4ef
RD
9545 def SendSizeEvent(self):
9546 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9547
2131d850 9548_core_.Window_swigregister(Window)
d55e5bfc
RD
9549
9550def PreWindow(*args, **kwargs):
9551 """
9552 PreWindow() -> Window
9553
9554 Precreate a Window for 2-phase creation.
9555 """
9556 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
9557 return val
9558
554f62e9
RD
9559def Window_NewControlId(*args):
9560 """
d55e5bfc
RD
9561 Window_NewControlId() -> int
9562
9563 Generate a control id for the controls which were not given one.
9564 """
554f62e9 9565 return _core_.Window_NewControlId(*args)
d55e5bfc
RD
9566
9567def Window_NextControlId(*args, **kwargs):
554f62e9 9568 """
d55e5bfc
RD
9569 Window_NextControlId(int winid) -> int
9570
9571 Get the id of the control following the one with the given
79fccf9d 9572 autogenerated) id
d55e5bfc 9573 """
554f62e9 9574 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
9575
9576def Window_PrevControlId(*args, **kwargs):
554f62e9 9577 """
d55e5bfc
RD
9578 Window_PrevControlId(int winid) -> int
9579
9580 Get the id of the control preceding the one with the given
79fccf9d 9581 autogenerated) id
d55e5bfc 9582 """
554f62e9 9583 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 9584
554f62e9
RD
9585def Window_FindFocus(*args):
9586 """
d55e5bfc
RD
9587 Window_FindFocus() -> Window
9588
9589 Returns the window or control that currently has the keyboard focus,
9590 or None.
9591 """
554f62e9 9592 return _core_.Window_FindFocus(*args)
d55e5bfc 9593
554f62e9
RD
9594def Window_GetCapture(*args):
9595 """
d55e5bfc
RD
9596 Window_GetCapture() -> Window
9597
9598 Returns the window which currently captures the mouse or None
9599 """
554f62e9 9600 return _core_.Window_GetCapture(*args)
d55e5bfc
RD
9601
9602def Window_GetClassDefaultAttributes(*args, **kwargs):
554f62e9 9603 """
d55e5bfc
RD
9604 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9605
79fccf9d
RD
9606 Get the default attributes for this class. This is useful if you want
9607 to use the same font or colour in your own control as in a standard
9608 control -- which is a much better idea than hard coding specific
caef1a4d
RD
9609 colours or fonts which might look completely out of place on the
9610 user's system, especially if it uses themes.
d55e5bfc
RD
9611
9612 The variant parameter is only relevant under Mac currently and is
79fccf9d 9613 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
9614 the returned font. See `wx.Window.SetWindowVariant` for more about
9615 this.
d55e5bfc 9616 """
554f62e9 9617 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9618
9619def DLG_PNT(win, point_or_x, y=None):
9620 """
9621 Convenience function for converting a Point or (x,y) in
9622 dialog units to pixel units.
9623 """
9624 if y is None:
9625 return win.ConvertDialogPointToPixels(point_or_x)
9626 else:
9627 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9628
9629def DLG_SZE(win, size_width, height=None):
9630 """
9631 Convenience function for converting a Size or (w,h) in
9632 dialog units to pixel units.
9633 """
9634 if height is None:
9635 return win.ConvertDialogSizeToPixels(size_width)
9636 else:
9637 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9638
9639
9640def FindWindowById(*args, **kwargs):
554f62e9 9641 """
d55e5bfc
RD
9642 FindWindowById(long id, Window parent=None) -> Window
9643
9644 Find the first window in the application with the given id. If parent
9645 is None, the search will start from all top-level frames and dialog
9646 boxes; if non-None, the search will be limited to the given window
9647 hierarchy. The search is recursive in both cases.
9648 """
554f62e9 9649 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc
RD
9650
9651def FindWindowByName(*args, **kwargs):
554f62e9 9652 """
d55e5bfc
RD
9653 FindWindowByName(String name, Window parent=None) -> Window
9654
9655 Find a window by its name (as given in a window constructor or Create
9656 function call). If parent is None, the search will start from all
9657 top-level frames and dialog boxes; if non-None, the search will be
9658 limited to the given window hierarchy. The search is recursive in both
9659 cases.
9660
9661 If no window with such name is found, wx.FindWindowByLabel is called.
9662 """
554f62e9 9663 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc
RD
9664
9665def FindWindowByLabel(*args, **kwargs):
554f62e9 9666 """
d55e5bfc
RD
9667 FindWindowByLabel(String label, Window parent=None) -> Window
9668
9669 Find a window by its label. Depending on the type of window, the label
9670 may be a window title or panel item label. If parent is None, the
9671 search will start from all top-level frames and dialog boxes; if
9672 non-None, the search will be limited to the given window
9673 hierarchy. The search is recursive in both cases.
9674 """
554f62e9 9675 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc
RD
9676
9677def Window_FromHWND(*args, **kwargs):
554f62e9
RD
9678 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9679 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 9680
554f62e9
RD
9681def GetTopLevelWindows(*args):
9682 """
3215336e
RD
9683 GetTopLevelWindows() -> PyObject
9684
9685 Returns a list of the the application's top-level windows, (frames,
9686 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9687 by wxWidgets, and so it is only valid as long as no top-level windows
9688 are closed or new top-level windows are created.
9689
9690 """
554f62e9 9691 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
9692#---------------------------------------------------------------------------
9693
9694class Validator(EvtHandler):
093d3ff1 9695 """Proxy of C++ Validator class"""
554f62e9
RD
9696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9697 __repr__ = _swig_repr
9698 def __init__(self, *args, **kwargs):
d55e5bfc 9699 """__init__(self) -> Validator"""
554f62e9 9700 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
9701 self._setOORInfo(self)
9702
9703 def Clone(*args, **kwargs):
9704 """Clone(self) -> Validator"""
9705 return _core_.Validator_Clone(*args, **kwargs)
9706
9707 def Validate(*args, **kwargs):
9708 """Validate(self, Window parent) -> bool"""
9709 return _core_.Validator_Validate(*args, **kwargs)
9710
9711 def TransferToWindow(*args, **kwargs):
9712 """TransferToWindow(self) -> bool"""
9713 return _core_.Validator_TransferToWindow(*args, **kwargs)
9714
9715 def TransferFromWindow(*args, **kwargs):
9716 """TransferFromWindow(self) -> bool"""
9717 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9718
9719 def GetWindow(*args, **kwargs):
9720 """GetWindow(self) -> Window"""
9721 return _core_.Validator_GetWindow(*args, **kwargs)
9722
9723 def SetWindow(*args, **kwargs):
9724 """SetWindow(self, Window window)"""
9725 return _core_.Validator_SetWindow(*args, **kwargs)
9726
9727 def IsSilent(*args, **kwargs):
c24da6d6 9728 """IsSilent() -> bool"""
d55e5bfc
RD
9729 return _core_.Validator_IsSilent(*args, **kwargs)
9730
9731 IsSilent = staticmethod(IsSilent)
9732 def SetBellOnError(*args, **kwargs):
c24da6d6 9733 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
9734 return _core_.Validator_SetBellOnError(*args, **kwargs)
9735
9736 SetBellOnError = staticmethod(SetBellOnError)
2131d850 9737_core_.Validator_swigregister(Validator)
d55e5bfc 9738
554f62e9
RD
9739def Validator_IsSilent(*args):
9740 """Validator_IsSilent() -> bool"""
9741 return _core_.Validator_IsSilent(*args)
d55e5bfc
RD
9742
9743def Validator_SetBellOnError(*args, **kwargs):
554f62e9
RD
9744 """Validator_SetBellOnError(int doIt=True)"""
9745 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
9746
9747class PyValidator(Validator):
093d3ff1 9748 """Proxy of C++ PyValidator class"""
554f62e9
RD
9749 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9750 __repr__ = _swig_repr
9751 def __init__(self, *args, **kwargs):
d55e5bfc 9752 """__init__(self) -> PyValidator"""
554f62e9 9753 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
9754
9755 self._setCallbackInfo(self, PyValidator, 1)
9756 self._setOORInfo(self)
9757
9758 def _setCallbackInfo(*args, **kwargs):
9759 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9760 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9761
2131d850 9762_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
9763
9764#---------------------------------------------------------------------------
9765
9766class Menu(EvtHandler):
093d3ff1 9767 """Proxy of C++ Menu class"""
554f62e9
RD
9768 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9769 __repr__ = _swig_repr
9770 def __init__(self, *args, **kwargs):
d55e5bfc 9771 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
554f62e9 9772 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
9773 self._setOORInfo(self)
9774
9775 def Append(*args, **kwargs):
9776 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9777 return _core_.Menu_Append(*args, **kwargs)
9778
9779 def AppendSeparator(*args, **kwargs):
9780 """AppendSeparator(self) -> MenuItem"""
9781 return _core_.Menu_AppendSeparator(*args, **kwargs)
9782
9783 def AppendCheckItem(*args, **kwargs):
9784 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9785 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9786
9787 def AppendRadioItem(*args, **kwargs):
9788 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9789 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9790
9791 def AppendMenu(*args, **kwargs):
9792 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9793 return _core_.Menu_AppendMenu(*args, **kwargs)
9794
50efceee
RD
9795 def AppendSubMenu(*args, **kwargs):
9796 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9797 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9798
d55e5bfc
RD
9799 def AppendItem(*args, **kwargs):
9800 """AppendItem(self, MenuItem item) -> MenuItem"""
9801 return _core_.Menu_AppendItem(*args, **kwargs)
9802
d55e5bfc
RD
9803 def InsertItem(*args, **kwargs):
9804 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9805 return _core_.Menu_InsertItem(*args, **kwargs)
9806
554f62e9
RD
9807 def PrependItem(*args, **kwargs):
9808 """PrependItem(self, MenuItem item) -> MenuItem"""
9809 return _core_.Menu_PrependItem(*args, **kwargs)
9810
9811 def Break(*args, **kwargs):
9812 """Break(self)"""
9813 return _core_.Menu_Break(*args, **kwargs)
9814
d55e5bfc
RD
9815 def Insert(*args, **kwargs):
9816 """
9817 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9818 int kind=ITEM_NORMAL) -> MenuItem
9819 """
9820 return _core_.Menu_Insert(*args, **kwargs)
9821
9822 def InsertSeparator(*args, **kwargs):
9823 """InsertSeparator(self, size_t pos) -> MenuItem"""
9824 return _core_.Menu_InsertSeparator(*args, **kwargs)
9825
9826 def InsertCheckItem(*args, **kwargs):
9827 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9828 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9829
9830 def InsertRadioItem(*args, **kwargs):
9831 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9832 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9833
9834 def InsertMenu(*args, **kwargs):
9835 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9836 return _core_.Menu_InsertMenu(*args, **kwargs)
9837
d55e5bfc
RD
9838 def Prepend(*args, **kwargs):
9839 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9840 return _core_.Menu_Prepend(*args, **kwargs)
9841
9842 def PrependSeparator(*args, **kwargs):
9843 """PrependSeparator(self) -> MenuItem"""
9844 return _core_.Menu_PrependSeparator(*args, **kwargs)
9845
9846 def PrependCheckItem(*args, **kwargs):
9847 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9848 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9849
9850 def PrependRadioItem(*args, **kwargs):
9851 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9852 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9853
9854 def PrependMenu(*args, **kwargs):
9855 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9856 return _core_.Menu_PrependMenu(*args, **kwargs)
9857
9858 def Remove(*args, **kwargs):
9859 """Remove(self, int id) -> MenuItem"""
9860 return _core_.Menu_Remove(*args, **kwargs)
9861
9862 def RemoveItem(*args, **kwargs):
9863 """RemoveItem(self, MenuItem item) -> MenuItem"""
9864 return _core_.Menu_RemoveItem(*args, **kwargs)
9865
9866 def Delete(*args, **kwargs):
9867 """Delete(self, int id) -> bool"""
9868 return _core_.Menu_Delete(*args, **kwargs)
9869
9870 def DeleteItem(*args, **kwargs):
9871 """DeleteItem(self, MenuItem item) -> bool"""
9872 return _core_.Menu_DeleteItem(*args, **kwargs)
9873
9874 def Destroy(*args, **kwargs):
9875 """
9876 Destroy(self)
9877
9878 Deletes the C++ object this Python object is a proxy for.
9879 """
7e08d4ef
RD
9880 val = _core_.Menu_Destroy(*args, **kwargs)
9881 args[0].thisown = 0
9882 return val
d55e5bfc
RD
9883
9884 def DestroyId(*args, **kwargs):
9885 """
9886 DestroyId(self, int id) -> bool
9887
9888 Deletes the C++ object this Python object is a proxy for.
9889 """
7e08d4ef
RD
9890 val = _core_.Menu_DestroyId(*args, **kwargs)
9891 args[0].thisown = 0
9892 return val
d55e5bfc
RD
9893
9894 def DestroyItem(*args, **kwargs):
9895 """
9896 DestroyItem(self, MenuItem item) -> bool
9897
9898 Deletes the C++ object this Python object is a proxy for.
9899 """
7e08d4ef
RD
9900 val = _core_.Menu_DestroyItem(*args, **kwargs)
9901 args[0].thisown = 0
9902 return val
d55e5bfc
RD
9903
9904 def GetMenuItemCount(*args, **kwargs):
9905 """GetMenuItemCount(self) -> size_t"""
9906 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9907
9908 def GetMenuItems(*args, **kwargs):
9909 """GetMenuItems(self) -> PyObject"""
9910 return _core_.Menu_GetMenuItems(*args, **kwargs)
9911
9912 def FindItem(*args, **kwargs):
9913 """FindItem(self, String item) -> int"""
9914 return _core_.Menu_FindItem(*args, **kwargs)
9915
9916 def FindItemById(*args, **kwargs):
9917 """FindItemById(self, int id) -> MenuItem"""
9918 return _core_.Menu_FindItemById(*args, **kwargs)
9919
9920 def FindItemByPosition(*args, **kwargs):
9921 """FindItemByPosition(self, size_t position) -> MenuItem"""
9922 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9923
9924 def Enable(*args, **kwargs):
9925 """Enable(self, int id, bool enable)"""
9926 return _core_.Menu_Enable(*args, **kwargs)
9927
9928 def IsEnabled(*args, **kwargs):
9929 """IsEnabled(self, int id) -> bool"""
9930 return _core_.Menu_IsEnabled(*args, **kwargs)
9931
9932 def Check(*args, **kwargs):
9933 """Check(self, int id, bool check)"""
9934 return _core_.Menu_Check(*args, **kwargs)
9935
9936 def IsChecked(*args, **kwargs):
9937 """IsChecked(self, int id) -> bool"""
9938 return _core_.Menu_IsChecked(*args, **kwargs)
9939
9940 def SetLabel(*args, **kwargs):
9941 """SetLabel(self, int id, String label)"""
9942 return _core_.Menu_SetLabel(*args, **kwargs)
9943
9944 def GetLabel(*args, **kwargs):
9945 """GetLabel(self, int id) -> String"""
9946 return _core_.Menu_GetLabel(*args, **kwargs)
9947
9948 def SetHelpString(*args, **kwargs):
9949 """SetHelpString(self, int id, String helpString)"""
9950 return _core_.Menu_SetHelpString(*args, **kwargs)
9951
9952 def GetHelpString(*args, **kwargs):
9953 """GetHelpString(self, int id) -> String"""
9954 return _core_.Menu_GetHelpString(*args, **kwargs)
9955
9956 def SetTitle(*args, **kwargs):
9957 """SetTitle(self, String title)"""
9958 return _core_.Menu_SetTitle(*args, **kwargs)
9959
9960 def GetTitle(*args, **kwargs):
9961 """GetTitle(self) -> String"""
9962 return _core_.Menu_GetTitle(*args, **kwargs)
9963
9964 def SetEventHandler(*args, **kwargs):
9965 """SetEventHandler(self, EvtHandler handler)"""
9966 return _core_.Menu_SetEventHandler(*args, **kwargs)
9967
9968 def GetEventHandler(*args, **kwargs):
9969 """GetEventHandler(self) -> EvtHandler"""
9970 return _core_.Menu_GetEventHandler(*args, **kwargs)
9971
9972 def SetInvokingWindow(*args, **kwargs):
9973 """SetInvokingWindow(self, Window win)"""
9974 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
9975
9976 def GetInvokingWindow(*args, **kwargs):
9977 """GetInvokingWindow(self) -> Window"""
9978 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
9979
9980 def GetStyle(*args, **kwargs):
9981 """GetStyle(self) -> long"""
9982 return _core_.Menu_GetStyle(*args, **kwargs)
9983
9984 def UpdateUI(*args, **kwargs):
9985 """UpdateUI(self, EvtHandler source=None)"""
9986 return _core_.Menu_UpdateUI(*args, **kwargs)
9987
9988 def GetMenuBar(*args, **kwargs):
9989 """GetMenuBar(self) -> MenuBar"""
9990 return _core_.Menu_GetMenuBar(*args, **kwargs)
9991
9992 def Attach(*args, **kwargs):
9993 """Attach(self, wxMenuBarBase menubar)"""
9994 return _core_.Menu_Attach(*args, **kwargs)
9995
9996 def Detach(*args, **kwargs):
9997 """Detach(self)"""
9998 return _core_.Menu_Detach(*args, **kwargs)
9999
10000 def IsAttached(*args, **kwargs):
10001 """IsAttached(self) -> bool"""
10002 return _core_.Menu_IsAttached(*args, **kwargs)
10003
10004 def SetParent(*args, **kwargs):
10005 """SetParent(self, Menu parent)"""
10006 return _core_.Menu_SetParent(*args, **kwargs)
10007
10008 def GetParent(*args, **kwargs):
10009 """GetParent(self) -> Menu"""
10010 return _core_.Menu_GetParent(*args, **kwargs)
10011
2131d850 10012_core_.Menu_swigregister(Menu)
d55e5bfc
RD
10013DefaultValidator = cvar.DefaultValidator
10014
10015#---------------------------------------------------------------------------
10016
10017class MenuBar(Window):
093d3ff1 10018 """Proxy of C++ MenuBar class"""
554f62e9
RD
10019 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10020 __repr__ = _swig_repr
10021 def __init__(self, *args, **kwargs):
d55e5bfc 10022 """__init__(self, long style=0) -> MenuBar"""
554f62e9 10023 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10024 self._setOORInfo(self)
10025
10026 def Append(*args, **kwargs):
10027 """Append(self, Menu menu, String title) -> bool"""
10028 return _core_.MenuBar_Append(*args, **kwargs)
10029
10030 def Insert(*args, **kwargs):
10031 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10032 return _core_.MenuBar_Insert(*args, **kwargs)
10033
10034 def GetMenuCount(*args, **kwargs):
10035 """GetMenuCount(self) -> size_t"""
10036 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10037
10038 def GetMenu(*args, **kwargs):
10039 """GetMenu(self, size_t pos) -> Menu"""
10040 return _core_.MenuBar_GetMenu(*args, **kwargs)
10041
10042 def Replace(*args, **kwargs):
10043 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10044 return _core_.MenuBar_Replace(*args, **kwargs)
10045
10046 def Remove(*args, **kwargs):
10047 """Remove(self, size_t pos) -> Menu"""
10048 return _core_.MenuBar_Remove(*args, **kwargs)
10049
10050 def EnableTop(*args, **kwargs):
10051 """EnableTop(self, size_t pos, bool enable)"""
10052 return _core_.MenuBar_EnableTop(*args, **kwargs)
10053
10054 def IsEnabledTop(*args, **kwargs):
10055 """IsEnabledTop(self, size_t pos) -> bool"""
10056 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10057
10058 def SetLabelTop(*args, **kwargs):
10059 """SetLabelTop(self, size_t pos, String label)"""
10060 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10061
10062 def GetLabelTop(*args, **kwargs):
10063 """GetLabelTop(self, size_t pos) -> String"""
10064 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10065
10066 def FindMenuItem(*args, **kwargs):
10067 """FindMenuItem(self, String menu, String item) -> int"""
10068 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10069
10070 def FindItemById(*args, **kwargs):
10071 """FindItemById(self, int id) -> MenuItem"""
10072 return _core_.MenuBar_FindItemById(*args, **kwargs)
10073
10074 def FindMenu(*args, **kwargs):
10075 """FindMenu(self, String title) -> int"""
10076 return _core_.MenuBar_FindMenu(*args, **kwargs)
10077
10078 def Enable(*args, **kwargs):
10079 """Enable(self, int id, bool enable)"""
10080 return _core_.MenuBar_Enable(*args, **kwargs)
10081
10082 def Check(*args, **kwargs):
10083 """Check(self, int id, bool check)"""
10084 return _core_.MenuBar_Check(*args, **kwargs)
10085
10086 def IsChecked(*args, **kwargs):
10087 """IsChecked(self, int id) -> bool"""
10088 return _core_.MenuBar_IsChecked(*args, **kwargs)
10089
10090 def IsEnabled(*args, **kwargs):
10091 """IsEnabled(self, int id) -> bool"""
10092 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10093
10094 def SetLabel(*args, **kwargs):
10095 """SetLabel(self, int id, String label)"""
10096 return _core_.MenuBar_SetLabel(*args, **kwargs)
10097
10098 def GetLabel(*args, **kwargs):
10099 """GetLabel(self, int id) -> String"""
10100 return _core_.MenuBar_GetLabel(*args, **kwargs)
10101
10102 def SetHelpString(*args, **kwargs):
10103 """SetHelpString(self, int id, String helpString)"""
10104 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10105
10106 def GetHelpString(*args, **kwargs):
10107 """GetHelpString(self, int id) -> String"""
10108 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10109
10110 def GetFrame(*args, **kwargs):
10111 """GetFrame(self) -> wxFrame"""
10112 return _core_.MenuBar_GetFrame(*args, **kwargs)
10113
10114 def IsAttached(*args, **kwargs):
10115 """IsAttached(self) -> bool"""
10116 return _core_.MenuBar_IsAttached(*args, **kwargs)
10117
10118 def Attach(*args, **kwargs):
10119 """Attach(self, wxFrame frame)"""
10120 return _core_.MenuBar_Attach(*args, **kwargs)
10121
10122 def Detach(*args, **kwargs):
10123 """Detach(self)"""
10124 return _core_.MenuBar_Detach(*args, **kwargs)
10125
db67f999
RD
10126 def SetAutoWindowMenu(*args, **kwargs):
10127 """SetAutoWindowMenu(bool enable)"""
10128 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10129
10130 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10131 def GetAutoWindowMenu(*args, **kwargs):
10132 """GetAutoWindowMenu() -> bool"""
10133 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10134
10135 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
2131d850 10136_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10137
db67f999 10138def MenuBar_SetAutoWindowMenu(*args, **kwargs):
554f62e9
RD
10139 """MenuBar_SetAutoWindowMenu(bool enable)"""
10140 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
db67f999 10141
554f62e9
RD
10142def MenuBar_GetAutoWindowMenu(*args):
10143 """MenuBar_GetAutoWindowMenu() -> bool"""
10144 return _core_.MenuBar_GetAutoWindowMenu(*args)
db67f999 10145
d55e5bfc
RD
10146#---------------------------------------------------------------------------
10147
10148class MenuItem(Object):
093d3ff1 10149 """Proxy of C++ MenuItem class"""
554f62e9
RD
10150 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10151 __repr__ = _swig_repr
10152 def __init__(self, *args, **kwargs):
d55e5bfc
RD
10153 """
10154 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10155 String help=EmptyString, int kind=ITEM_NORMAL,
10156 Menu subMenu=None) -> MenuItem
10157 """
554f62e9
RD
10158 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10159 __swig_destroy__ = _core_.delete_MenuItem
10160 __del__ = lambda self : None;
d55e5bfc
RD
10161 def GetMenu(*args, **kwargs):
10162 """GetMenu(self) -> Menu"""
10163 return _core_.MenuItem_GetMenu(*args, **kwargs)
10164
10165 def SetMenu(*args, **kwargs):
10166 """SetMenu(self, Menu menu)"""
10167 return _core_.MenuItem_SetMenu(*args, **kwargs)
10168
10169 def SetId(*args, **kwargs):
10170 """SetId(self, int id)"""
10171 return _core_.MenuItem_SetId(*args, **kwargs)
10172
10173 def GetId(*args, **kwargs):
10174 """GetId(self) -> int"""
10175 return _core_.MenuItem_GetId(*args, **kwargs)
10176
10177 def IsSeparator(*args, **kwargs):
10178 """IsSeparator(self) -> bool"""
10179 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10180
10181 def SetText(*args, **kwargs):
10182 """SetText(self, String str)"""
10183 return _core_.MenuItem_SetText(*args, **kwargs)
10184
10185 def GetLabel(*args, **kwargs):
10186 """GetLabel(self) -> String"""
10187 return _core_.MenuItem_GetLabel(*args, **kwargs)
10188
10189 def GetText(*args, **kwargs):
10190 """GetText(self) -> String"""
10191 return _core_.MenuItem_GetText(*args, **kwargs)
10192
10193 def GetLabelFromText(*args, **kwargs):
c24da6d6 10194 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
10195 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10196
10197 GetLabelFromText = staticmethod(GetLabelFromText)
10198 def GetKind(*args, **kwargs):
10199 """GetKind(self) -> int"""
10200 return _core_.MenuItem_GetKind(*args, **kwargs)
10201
10202 def SetKind(*args, **kwargs):
10203 """SetKind(self, int kind)"""
10204 return _core_.MenuItem_SetKind(*args, **kwargs)
10205
10206 def SetCheckable(*args, **kwargs):
10207 """SetCheckable(self, bool checkable)"""
10208 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10209
10210 def IsCheckable(*args, **kwargs):
10211 """IsCheckable(self) -> bool"""
10212 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10213
10214 def IsSubMenu(*args, **kwargs):
10215 """IsSubMenu(self) -> bool"""
10216 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10217
10218 def SetSubMenu(*args, **kwargs):
10219 """SetSubMenu(self, Menu menu)"""
10220 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10221
10222 def GetSubMenu(*args, **kwargs):
10223 """GetSubMenu(self) -> Menu"""
10224 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10225
10226 def Enable(*args, **kwargs):
10227 """Enable(self, bool enable=True)"""
10228 return _core_.MenuItem_Enable(*args, **kwargs)
10229
10230 def IsEnabled(*args, **kwargs):
10231 """IsEnabled(self) -> bool"""
10232 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10233
10234 def Check(*args, **kwargs):
10235 """Check(self, bool check=True)"""
10236 return _core_.MenuItem_Check(*args, **kwargs)
10237
10238 def IsChecked(*args, **kwargs):
10239 """IsChecked(self) -> bool"""
10240 return _core_.MenuItem_IsChecked(*args, **kwargs)
10241
10242 def Toggle(*args, **kwargs):
10243 """Toggle(self)"""
10244 return _core_.MenuItem_Toggle(*args, **kwargs)
10245
10246 def SetHelp(*args, **kwargs):
10247 """SetHelp(self, String str)"""
10248 return _core_.MenuItem_SetHelp(*args, **kwargs)
10249
10250 def GetHelp(*args, **kwargs):
10251 """GetHelp(self) -> String"""
10252 return _core_.MenuItem_GetHelp(*args, **kwargs)
10253
10254 def GetAccel(*args, **kwargs):
10255 """GetAccel(self) -> AcceleratorEntry"""
10256 return _core_.MenuItem_GetAccel(*args, **kwargs)
10257
10258 def SetAccel(*args, **kwargs):
10259 """SetAccel(self, AcceleratorEntry accel)"""
10260 return _core_.MenuItem_SetAccel(*args, **kwargs)
10261
7449af73
RD
10262 def SetBitmap(*args, **kwargs):
10263 """SetBitmap(self, Bitmap bitmap)"""
10264 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10265
10266 def GetBitmap(*args, **kwargs):
10267 """GetBitmap(self) -> Bitmap"""
10268 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10269
d55e5bfc
RD
10270 def SetFont(*args, **kwargs):
10271 """SetFont(self, Font font)"""
10272 return _core_.MenuItem_SetFont(*args, **kwargs)
10273
10274 def GetFont(*args, **kwargs):
10275 """GetFont(self) -> Font"""
10276 return _core_.MenuItem_GetFont(*args, **kwargs)
10277
10278 def SetTextColour(*args, **kwargs):
10279 """SetTextColour(self, Colour colText)"""
10280 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10281
10282 def GetTextColour(*args, **kwargs):
10283 """GetTextColour(self) -> Colour"""
10284 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10285
10286 def SetBackgroundColour(*args, **kwargs):
10287 """SetBackgroundColour(self, Colour colBack)"""
10288 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10289
10290 def GetBackgroundColour(*args, **kwargs):
10291 """GetBackgroundColour(self) -> Colour"""
10292 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10293
10294 def SetBitmaps(*args, **kwargs):
10295 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10296 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10297
10298 def SetDisabledBitmap(*args, **kwargs):
10299 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10300 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10301
10302 def GetDisabledBitmap(*args, **kwargs):
10303 """GetDisabledBitmap(self) -> Bitmap"""
10304 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10305
10306 def SetMarginWidth(*args, **kwargs):
10307 """SetMarginWidth(self, int nWidth)"""
10308 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10309
10310 def GetMarginWidth(*args, **kwargs):
10311 """GetMarginWidth(self) -> int"""
10312 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10313
10314 def GetDefaultMarginWidth(*args, **kwargs):
c24da6d6 10315 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
10316 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10317
10318 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10319 def IsOwnerDrawn(*args, **kwargs):
10320 """IsOwnerDrawn(self) -> bool"""
10321 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10322
10323 def SetOwnerDrawn(*args, **kwargs):
10324 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10325 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10326
10327 def ResetOwnerDrawn(*args, **kwargs):
10328 """ResetOwnerDrawn(self)"""
10329 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10330
2131d850 10331_core_.MenuItem_swigregister(MenuItem)
d55e5bfc
RD
10332
10333def MenuItem_GetLabelFromText(*args, **kwargs):
554f62e9
RD
10334 """MenuItem_GetLabelFromText(String text) -> String"""
10335 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10336
554f62e9
RD
10337def MenuItem_GetDefaultMarginWidth(*args):
10338 """MenuItem_GetDefaultMarginWidth() -> int"""
10339 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10340
10341#---------------------------------------------------------------------------
10342
10343class Control(Window):
10344 """
10345 This is the base class for a control or 'widget'.
10346
79fccf9d
RD
10347 A control is generally a small window which processes user input
10348 and/or displays one or more item of data.
d55e5bfc 10349 """
554f62e9
RD
10350 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10351 __repr__ = _swig_repr
10352 def __init__(self, *args, **kwargs):
d55e5bfc 10353 """
248ed943
RD
10354 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10355 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
10356 String name=ControlNameStr) -> Control
10357
79fccf9d
RD
10358 Create a Control. Normally you should only call this from a subclass'
10359 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10360 """
554f62e9 10361 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10362 self._setOORInfo(self)
10363
10364 def Create(*args, **kwargs):
10365 """
248ed943
RD
10366 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10367 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
10368 String name=ControlNameStr) -> bool
10369
10370 Do the 2nd phase and create the GUI control.
10371 """
10372 return _core_.Control_Create(*args, **kwargs)
10373
10374 def Command(*args, **kwargs):
10375 """
10376 Command(self, CommandEvent event)
10377
79fccf9d
RD
10378 Simulates the effect of the user issuing a command to the item.
10379
10380 :see: `wx.CommandEvent`
10381
d55e5bfc
RD
10382 """
10383 return _core_.Control_Command(*args, **kwargs)
10384
10385 def GetLabel(*args, **kwargs):
10386 """
10387 GetLabel(self) -> String
10388
10389 Return a control's text.
10390 """
10391 return _core_.Control_GetLabel(*args, **kwargs)
10392
a001823c 10393 def GetClassDefaultAttributes(*args, **kwargs):
f8167d6e 10394 """
a001823c 10395 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
f8167d6e 10396
a001823c
RD
10397 Get the default attributes for this class. This is useful if you want
10398 to use the same font or colour in your own control as in a standard
10399 control -- which is a much better idea than hard coding specific
10400 colours or fonts which might look completely out of place on the
10401 user's system, especially if it uses themes.
f8167d6e 10402
a001823c
RD
10403 The variant parameter is only relevant under Mac currently and is
10404 ignore under other platforms. Under Mac, it will change the size of
10405 the returned font. See `wx.Window.SetWindowVariant` for more about
10406 this.
f8167d6e 10407 """
d55e5bfc
RD
10408 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10409
10410 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2131d850 10411_core_.Control_swigregister(Control)
d55e5bfc
RD
10412ControlNameStr = cvar.ControlNameStr
10413
10414def PreControl(*args, **kwargs):
10415 """
10416 PreControl() -> Control
10417
10418 Precreate a Control control for 2-phase creation
10419 """
10420 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
10421 return val
10422
10423def Control_GetClassDefaultAttributes(*args, **kwargs):
554f62e9 10424 """
a001823c
RD
10425 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10426
10427 Get the default attributes for this class. This is useful if you want
10428 to use the same font or colour in your own control as in a standard
10429 control -- which is a much better idea than hard coding specific
10430 colours or fonts which might look completely out of place on the
10431 user's system, especially if it uses themes.
10432
10433 The variant parameter is only relevant under Mac currently and is
10434 ignore under other platforms. Under Mac, it will change the size of
10435 the returned font. See `wx.Window.SetWindowVariant` for more about
10436 this.
10437 """
554f62e9 10438 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10439
10440#---------------------------------------------------------------------------
10441
10442class ItemContainer(object):
10443 """
53aa7709
RD
10444 The wx.ItemContainer class defines an interface which is implemented
10445 by all controls which have string subitems, each of which may be
10446 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10447 as `wx.ComboBox` which implements an extended interface deriving from
79fccf9d 10448 this one.
d55e5bfc 10449
79fccf9d
RD
10450 It defines the methods for accessing the control's items and although
10451 each of the derived classes implements them differently, they still
10452 all conform to the same interface.
d55e5bfc 10453
79fccf9d
RD
10454 The items in a wx.ItemContainer have (non empty) string labels and,
10455 optionally, client data associated with them.
d55e5bfc
RD
10456
10457 """
554f62e9
RD
10458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10459 def __init__(self): raise AttributeError, "No constructor defined"
10460 __repr__ = _swig_repr
d55e5bfc
RD
10461 def Append(*args, **kwargs):
10462 """
10463 Append(self, String item, PyObject clientData=None) -> int
10464
79fccf9d
RD
10465 Adds the item to the control, associating the given data with the item
10466 if not None. The return value is the index of the newly added item
10467 which may be different from the last one if the control is sorted (e.g.
10468 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
10469 """
10470 return _core_.ItemContainer_Append(*args, **kwargs)
10471
10472 def AppendItems(*args, **kwargs):
10473 """
f5b96ee1 10474 AppendItems(self, List strings)
d55e5bfc 10475
79fccf9d
RD
10476 Apend several items at once to the control. Notice that calling this
10477 method may be much faster than appending the items one by one if you
10478 need to add a lot of items.
d55e5bfc
RD
10479 """
10480 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10481
10482 def Insert(*args, **kwargs):
10483 """
50f151d7 10484 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 10485
79fccf9d 10486 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10487 optionally associating some data object with the item.
10488 """
10489 return _core_.ItemContainer_Insert(*args, **kwargs)
10490
10491 def Clear(*args, **kwargs):
10492 """
10493 Clear(self)
10494
10495 Removes all items from the control.
10496 """
10497 return _core_.ItemContainer_Clear(*args, **kwargs)
10498
10499 def Delete(*args, **kwargs):
10500 """
50f151d7 10501 Delete(self, unsigned int n)
d55e5bfc 10502
79fccf9d
RD
10503 Deletes the item at the zero-based index 'n' from the control. Note
10504 that it is an error (signalled by a `wx.PyAssertionError` exception if
10505 enabled) to remove an item with the index negative or greater or equal
10506 than the number of items in the control.
d55e5bfc
RD
10507 """
10508 return _core_.ItemContainer_Delete(*args, **kwargs)
10509
53aa7709
RD
10510 def GetClientData(*args, **kwargs):
10511 """
50f151d7 10512 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10513
10514 Returns the client data associated with the given item, (if any.)
10515 """
10516 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10517
10518 def SetClientData(*args, **kwargs):
10519 """
50f151d7 10520 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10521
10522 Associate the given client data with the item at position n.
10523 """
10524 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10525
d55e5bfc
RD
10526 def GetCount(*args, **kwargs):
10527 """
50f151d7 10528 GetCount(self) -> unsigned int
d55e5bfc
RD
10529
10530 Returns the number of items in the control.
10531 """
10532 return _core_.ItemContainer_GetCount(*args, **kwargs)
10533
10534 def IsEmpty(*args, **kwargs):
10535 """
10536 IsEmpty(self) -> bool
10537
10538 Returns True if the control is empty or False if it has some items.
10539 """
10540 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10541
10542 def GetString(*args, **kwargs):
10543 """
50f151d7 10544 GetString(self, unsigned int n) -> String
d55e5bfc
RD
10545
10546 Returns the label of the item with the given index.
10547 """
10548 return _core_.ItemContainer_GetString(*args, **kwargs)
10549
10550 def GetStrings(*args, **kwargs):
10551 """GetStrings(self) -> wxArrayString"""
10552 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10553
10554 def SetString(*args, **kwargs):
10555 """
50f151d7 10556 SetString(self, unsigned int n, String s)
d55e5bfc
RD
10557
10558 Sets the label for the given item.
10559 """
10560 return _core_.ItemContainer_SetString(*args, **kwargs)
10561
10562 def FindString(*args, **kwargs):
10563 """
10564 FindString(self, String s) -> int
10565
10566 Finds an item whose label matches the given string. Returns the
79fccf9d
RD
10567 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10568 found.
d55e5bfc
RD
10569 """
10570 return _core_.ItemContainer_FindString(*args, **kwargs)
10571
53aa7709 10572 def SetSelection(*args, **kwargs):
d55e5bfc 10573 """
53aa7709 10574 SetSelection(self, int n)
d55e5bfc
RD
10575
10576 Sets the item at index 'n' to be the selected item.
10577 """
53aa7709 10578 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 10579
d55e5bfc
RD
10580 def GetSelection(*args, **kwargs):
10581 """
10582 GetSelection(self) -> int
10583
79fccf9d
RD
10584 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10585 is selected.
d55e5bfc
RD
10586 """
10587 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10588
53aa7709
RD
10589 def SetStringSelection(*args, **kwargs):
10590 """SetStringSelection(self, String s) -> bool"""
10591 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10592
d55e5bfc
RD
10593 def GetStringSelection(*args, **kwargs):
10594 """
10595 GetStringSelection(self) -> String
10596
79fccf9d
RD
10597 Returns the label of the selected item or an empty string if no item
10598 is selected.
d55e5bfc
RD
10599 """
10600 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10601
53aa7709 10602 def Select(*args, **kwargs):
d55e5bfc 10603 """
53aa7709 10604 Select(self, int n)
d55e5bfc 10605
53aa7709
RD
10606 This is the same as `SetSelection` and exists only because it is
10607 slightly more natural for controls which support multiple selection.
d55e5bfc 10608 """
53aa7709 10609 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 10610
2131d850 10611_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
10612
10613#---------------------------------------------------------------------------
10614
10615class ControlWithItems(Control,ItemContainer):
10616 """
79fccf9d
RD
10617 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10618 wx.Control class, and is used for the base class of various controls
10619 that have items.
d55e5bfc 10620 """
554f62e9
RD
10621 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10622 def __init__(self): raise AttributeError, "No constructor defined"
10623 __repr__ = _swig_repr
2131d850 10624_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
10625
10626#---------------------------------------------------------------------------
10627
10628class SizerItem(Object):
248ed943
RD
10629 """
10630 The wx.SizerItem class is used to track the position, size and other
f460c29d
RD
10631 attributes of each item managed by a `wx.Sizer`. It is not usually
10632 necessary to use this class because the sizer elements can also be
10633 identified by their positions or window or sizer references but
10634 sometimes it may be more convenient to use wx.SizerItem directly.
10635 Also, custom classes derived from `wx.PySizer` will probably need to
10636 use the collection of wx.SizerItems held by wx.Sizer when calculating
10637 layout.
248ed943
RD
10638
10639 :see: `wx.Sizer`, `wx.GBSizerItem`
10640 """
554f62e9
RD
10641 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10642 __repr__ = _swig_repr
10643 def __init__(self, *args, **kwargs):
248ed943
RD
10644 """
10645 __init__(self) -> SizerItem
10646
10647 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10648 size will need to be set before this item can be used in a Sizer.
10649
10650 You will probably never need to create a wx.SizerItem directly as they
10651 are created automatically when the sizer's Add, Insert or Prepend
10652 methods are called.
10653
10654 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10655 """
554f62e9
RD
10656 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10657 __swig_destroy__ = _core_.delete_SizerItem
10658 __del__ = lambda self : None;
d55e5bfc 10659 def DeleteWindows(*args, **kwargs):
248ed943
RD
10660 """
10661 DeleteWindows(self)
10662
10663 Destroy the window or the windows in a subsizer, depending on the type
10664 of item.
10665 """
d55e5bfc
RD
10666 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10667
10668 def DetachSizer(*args, **kwargs):
248ed943
RD
10669 """
10670 DetachSizer(self)
10671
10672 Enable deleting the SizerItem without destroying the contained sizer.
10673 """
d55e5bfc
RD
10674 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10675
10676 def GetSize(*args, **kwargs):
248ed943
RD
10677 """
10678 GetSize(self) -> Size
10679
10680 Get the current size of the item, as set in the last Layout.
10681 """
d55e5bfc
RD
10682 return _core_.SizerItem_GetSize(*args, **kwargs)
10683
10684 def CalcMin(*args, **kwargs):
248ed943
RD
10685 """
10686 CalcMin(self) -> Size
10687
10688 Calculates the minimum desired size for the item, including any space
10689 needed by borders.
10690 """
d55e5bfc
RD
10691 return _core_.SizerItem_CalcMin(*args, **kwargs)
10692
10693 def SetDimension(*args, **kwargs):
248ed943
RD
10694 """
10695 SetDimension(self, Point pos, Size size)
10696
10697 Set the position and size of the space allocated for this item by the
10698 sizer, and adjust the position and size of the item (window or
10699 subsizer) to be within that space taking alignment and borders into
10700 account.
10701 """
d55e5bfc
RD
10702 return _core_.SizerItem_SetDimension(*args, **kwargs)
10703
10704 def GetMinSize(*args, **kwargs):
248ed943
RD
10705 """
10706 GetMinSize(self) -> Size
10707
10708 Get the minimum size needed for the item.
10709 """
d55e5bfc
RD
10710 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10711
a001823c
RD
10712 def GetMinSizeWithBorder(*args, **kwargs):
10713 """
10714 GetMinSizeWithBorder(self) -> Size
10715
10716 Get the minimum size needed for the item with space for the borders
10717 added, if needed.
10718 """
10719 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10720
d55e5bfc
RD
10721 def SetInitSize(*args, **kwargs):
10722 """SetInitSize(self, int x, int y)"""
10723 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10724
10725 def SetRatioWH(*args, **kwargs):
248ed943
RD
10726 """
10727 SetRatioWH(self, int width, int height)
10728
10729 Set the ratio item attribute.
10730 """
d55e5bfc
RD
10731 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10732
10733 def SetRatioSize(*args, **kwargs):
248ed943
RD
10734 """
10735 SetRatioSize(self, Size size)
10736
10737 Set the ratio item attribute.
10738 """
d55e5bfc
RD
10739 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10740
10741 def SetRatio(*args, **kwargs):
248ed943
RD
10742 """
10743 SetRatio(self, float ratio)
10744
10745 Set the ratio item attribute.
10746 """
d55e5bfc
RD
10747 return _core_.SizerItem_SetRatio(*args, **kwargs)
10748
10749 def GetRatio(*args, **kwargs):
248ed943
RD
10750 """
10751 GetRatio(self) -> float
10752
10753 Set the ratio item attribute.
10754 """
d55e5bfc
RD
10755 return _core_.SizerItem_GetRatio(*args, **kwargs)
10756
c1cb24a4
RD
10757 def GetRect(*args, **kwargs):
10758 """
10759 GetRect(self) -> Rect
10760
10761 Returns the rectangle that the sizer item should occupy
10762 """
10763 return _core_.SizerItem_GetRect(*args, **kwargs)
10764
d55e5bfc 10765 def IsWindow(*args, **kwargs):
248ed943
RD
10766 """
10767 IsWindow(self) -> bool
10768
10769 Is this sizer item a window?
10770 """
d55e5bfc
RD
10771 return _core_.SizerItem_IsWindow(*args, **kwargs)
10772
10773 def IsSizer(*args, **kwargs):
248ed943
RD
10774 """
10775 IsSizer(self) -> bool
10776
10777 Is this sizer item a subsizer?
10778 """
d55e5bfc
RD
10779 return _core_.SizerItem_IsSizer(*args, **kwargs)
10780
10781 def IsSpacer(*args, **kwargs):
248ed943
RD
10782 """
10783 IsSpacer(self) -> bool
10784
10785 Is this sizer item a spacer?
10786 """
d55e5bfc
RD
10787 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10788
10789 def SetProportion(*args, **kwargs):
248ed943
RD
10790 """
10791 SetProportion(self, int proportion)
10792
10793 Set the proportion value for this item.
10794 """
d55e5bfc
RD
10795 return _core_.SizerItem_SetProportion(*args, **kwargs)
10796
10797 def GetProportion(*args, **kwargs):
248ed943
RD
10798 """
10799 GetProportion(self) -> int
10800
10801 Get the proportion value for this item.
10802 """
d55e5bfc
RD
10803 return _core_.SizerItem_GetProportion(*args, **kwargs)
10804
248ed943
RD
10805 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10806 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 10807 def SetFlag(*args, **kwargs):
248ed943
RD
10808 """
10809 SetFlag(self, int flag)
10810
10811 Set the flag value for this item.
10812 """
d55e5bfc
RD
10813 return _core_.SizerItem_SetFlag(*args, **kwargs)
10814
10815 def GetFlag(*args, **kwargs):
248ed943
RD
10816 """
10817 GetFlag(self) -> int
10818
10819 Get the flag value for this item.
10820 """
d55e5bfc
RD
10821 return _core_.SizerItem_GetFlag(*args, **kwargs)
10822
10823 def SetBorder(*args, **kwargs):
248ed943
RD
10824 """
10825 SetBorder(self, int border)
10826
10827 Set the border value for this item.
10828 """
d55e5bfc
RD
10829 return _core_.SizerItem_SetBorder(*args, **kwargs)
10830
10831 def GetBorder(*args, **kwargs):
248ed943
RD
10832 """
10833 GetBorder(self) -> int
10834
10835 Get the border value for this item.
10836 """
d55e5bfc
RD
10837 return _core_.SizerItem_GetBorder(*args, **kwargs)
10838
10839 def GetWindow(*args, **kwargs):
248ed943
RD
10840 """
10841 GetWindow(self) -> Window
10842
10843 Get the window (if any) that is managed by this sizer item.
10844 """
d55e5bfc
RD
10845 return _core_.SizerItem_GetWindow(*args, **kwargs)
10846
10847 def SetWindow(*args, **kwargs):
248ed943
RD
10848 """
10849 SetWindow(self, Window window)
10850
10851 Set the window to be managed by this sizer item.
10852 """
d55e5bfc
RD
10853 return _core_.SizerItem_SetWindow(*args, **kwargs)
10854
10855 def GetSizer(*args, **kwargs):
248ed943
RD
10856 """
10857 GetSizer(self) -> Sizer
10858
10859 Get the subsizer (if any) that is managed by this sizer item.
10860 """
d55e5bfc
RD
10861 return _core_.SizerItem_GetSizer(*args, **kwargs)
10862
10863 def SetSizer(*args, **kwargs):
248ed943
RD
10864 """
10865 SetSizer(self, Sizer sizer)
10866
10867 Set the subsizer to be managed by this sizer item.
10868 """
d55e5bfc
RD
10869 return _core_.SizerItem_SetSizer(*args, **kwargs)
10870
10871 def GetSpacer(*args, **kwargs):
248ed943
RD
10872 """
10873 GetSpacer(self) -> Size
10874
10875 Get the size of the spacer managed by this sizer item.
10876 """
d55e5bfc
RD
10877 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10878
10879 def SetSpacer(*args, **kwargs):
248ed943
RD
10880 """
10881 SetSpacer(self, Size size)
10882
10883 Set the size of the spacer to be managed by this sizer item.
10884 """
d55e5bfc
RD
10885 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10886
10887 def Show(*args, **kwargs):
248ed943
RD
10888 """
10889 Show(self, bool show)
10890
10891 Set the show item attribute, which sizers use to determine if the item
10892 is to be made part of the layout or not. If the item is tracking a
10893 window then it is shown or hidden as needed.
10894 """
d55e5bfc
RD
10895 return _core_.SizerItem_Show(*args, **kwargs)
10896
10897 def IsShown(*args, **kwargs):
248ed943
RD
10898 """
10899 IsShown(self) -> bool
10900
10901 Is the item to be shown in the layout?
10902 """
d55e5bfc
RD
10903 return _core_.SizerItem_IsShown(*args, **kwargs)
10904
10905 def GetPosition(*args, **kwargs):
248ed943
RD
10906 """
10907 GetPosition(self) -> Point
10908
10909 Returns the current position of the item, as set in the last Layout.
10910 """
d55e5bfc
RD
10911 return _core_.SizerItem_GetPosition(*args, **kwargs)
10912
10913 def GetUserData(*args, **kwargs):
248ed943
RD
10914 """
10915 GetUserData(self) -> PyObject
10916
10917 Returns the userData associated with this sizer item, or None if there
10918 isn't any.
10919 """
d55e5bfc
RD
10920 return _core_.SizerItem_GetUserData(*args, **kwargs)
10921
7449af73
RD
10922 def SetUserData(*args, **kwargs):
10923 """
10924 SetUserData(self, PyObject userData)
10925
10926 Associate a Python object with this sizer item.
10927 """
10928 return _core_.SizerItem_SetUserData(*args, **kwargs)
10929
2131d850 10930_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 10931
248ed943 10932def SizerItemWindow(*args, **kwargs):
d55e5bfc 10933 """
248ed943
RD
10934 SizerItemWindow(Window window, int proportion, int flag, int border,
10935 PyObject userData=None) -> SizerItem
10936
10937 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 10938 """
248ed943 10939 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
10940 return val
10941
248ed943 10942def SizerItemSpacer(*args, **kwargs):
d55e5bfc 10943 """
248ed943
RD
10944 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10945 PyObject userData=None) -> SizerItem
10946
10947 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 10948 """
248ed943 10949 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
10950 return val
10951
10952def SizerItemSizer(*args, **kwargs):
10953 """
10954 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
10955 PyObject userData=None) -> SizerItem
10956
10957 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
10958 """
10959 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
10960 return val
10961
10962class Sizer(Object):
248ed943
RD
10963 """
10964 wx.Sizer is the abstract base class used for laying out subwindows in
10965 a window. You cannot use wx.Sizer directly; instead, you will have to
10966 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10967 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10968 and `wx.GridBagSizer`.
10969
10970 The concept implemented by sizers in wxWidgets is closely related to
10971 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10972 toolkit or the Qt toolkit. It is based upon the idea of the individual
10973 subwindows reporting their minimal required size and their ability to
10974 get stretched if the size of the parent window has changed. This will
10975 most often mean that the programmer does not set the original size of
10976 a dialog in the beginning, rather the dialog will assigned a sizer and
10977 this sizer will be queried about the recommended size. The sizer in
10978 turn will query its children, which can be normal windows or contorls,
10979 empty space or other sizers, so that a hierarchy of sizers can be
10980 constructed. Note that wxSizer does not derive from wxWindow and thus
10981 do not interfere with tab ordering and requires very little resources
10982 compared to a real window on screen.
10983
10984 What makes sizers so well fitted for use in wxWidgets is the fact that
10985 every control reports its own minimal size and the algorithm can
10986 handle differences in font sizes or different window (dialog item)
10987 sizes on different platforms without problems. If for example the
10988 standard font as well as the overall design of Mac widgets requires
10989 more space than on Windows, then the initial size of a dialog using a
10990 sizer will automatically be bigger on Mac than on Windows.
10991 """
554f62e9
RD
10992 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10993 def __init__(self): raise AttributeError, "No constructor defined"
10994 __repr__ = _swig_repr
10995 __swig_destroy__ = _core_.delete_Sizer
10996 __del__ = lambda self : None;
d55e5bfc
RD
10997 def _setOORInfo(*args, **kwargs):
10998 """_setOORInfo(self, PyObject _self)"""
10999 return _core_.Sizer__setOORInfo(*args, **kwargs)
11000
11001 def Add(*args, **kwargs):
11002 """
248ed943 11003 Add(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11004 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11005
11006 Appends a child item to the sizer.
d55e5bfc
RD
11007 """
11008 return _core_.Sizer_Add(*args, **kwargs)
11009
11010 def Insert(*args, **kwargs):
11011 """
248ed943 11012 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11013 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11014
11015 Inserts a new item into the list of items managed by this sizer before
11016 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
11017 """
11018 return _core_.Sizer_Insert(*args, **kwargs)
11019
11020 def Prepend(*args, **kwargs):
11021 """
248ed943 11022 Prepend(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11023 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11024
11025 Adds a new item to the begining of the list of sizer items managed by
11026 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
11027 """
11028 return _core_.Sizer_Prepend(*args, **kwargs)
11029
11030 def Remove(*args, **kwargs):
248ed943
RD
11031 """
11032 Remove(self, item) -> bool
11033
11034 Removes an item from the sizer and destroys it. This method does not
11035 cause any layout or resizing to take place, call `Layout` to update
11036 the layout on screen after removing a child from the sizer. The
11037 *item* parameter can be either a window, a sizer, or the zero-based
11038 index of an item to remove. Returns True if the child item was found
11039 and removed.
11040 """
d55e5bfc
RD
11041 return _core_.Sizer_Remove(*args, **kwargs)
11042
1a6bba1e 11043 def Detach(*args, **kwargs):
248ed943
RD
11044 """
11045 Detach(self, item) -> bool
11046
11047 Detaches an item from the sizer without destroying it. This method
11048 does not cause any layout or resizing to take place, call `Layout` to
11049 do so. The *item* parameter can be either a window, a sizer, or the
11050 zero-based index of the item to be detached. Returns True if the child item
11051 was found and detached.
11052 """
1a6bba1e
RD
11053 return _core_.Sizer_Detach(*args, **kwargs)
11054
c1cb24a4
RD
11055 def GetItem(*args, **kwargs):
11056 """
11057 GetItem(self, item) -> wx.SizerItem
11058
11059 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11060 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11061 the item to be found.
c1cb24a4
RD
11062 """
11063 return _core_.Sizer_GetItem(*args, **kwargs)
11064
d55e5bfc
RD
11065 def _SetItemMinSize(*args, **kwargs):
11066 """_SetItemMinSize(self, PyObject item, Size size)"""
11067 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11068
248ed943
RD
11069 def SetItemMinSize(self, item, *args):
11070 """
11071 SetItemMinSize(self, item, Size size)
11072
11073 Sets the minimum size that will be allocated for an item in the sizer.
11074 The *item* parameter can be either a window, a sizer, or the
11075 zero-based index of the item. If a window or sizer is given then it
11076 will be searched for recursivly in subsizers if neccessary.
11077 """
11078 if len(args) == 2:
11079 # for backward compatibility accept separate width,height args too
11080 return self._SetItemMinSize(item, args)
11081 else:
11082 return self._SetItemMinSize(item, args[0])
11083
d55e5bfc 11084 def AddItem(*args, **kwargs):
248ed943
RD
11085 """
11086 AddItem(self, SizerItem item)
11087
11088 Adds a `wx.SizerItem` to the sizer.
11089 """
d55e5bfc
RD
11090 return _core_.Sizer_AddItem(*args, **kwargs)
11091
11092 def InsertItem(*args, **kwargs):
248ed943
RD
11093 """
11094 InsertItem(self, int index, SizerItem item)
11095
11096 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11097 """
d55e5bfc
RD
11098 return _core_.Sizer_InsertItem(*args, **kwargs)
11099
11100 def PrependItem(*args, **kwargs):
248ed943
RD
11101 """
11102 PrependItem(self, SizerItem item)
11103
11104 Prepends a `wx.SizerItem` to the sizer.
11105 """
d55e5bfc
RD
11106 return _core_.Sizer_PrependItem(*args, **kwargs)
11107
248ed943 11108 def AddMany(self, items):
c24da6d6
RD
11109 """
11110 AddMany is a convenience method for adding several items
11111 to a sizer at one time. Simply pass it a list of tuples,
11112 where each tuple consists of the parameters that you
11113 would normally pass to the `Add` method.
11114 """
248ed943
RD
11115 for item in items:
11116 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11117 item = (item, )
11118 self.Add(*item)
d55e5bfc
RD
11119
11120 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11121 def AddWindow(self, *args, **kw):
11122 """Compatibility alias for `Add`."""
11123 return self.Add(*args, **kw)
11124 def AddSizer(self, *args, **kw):
11125 """Compatibility alias for `Add`."""
11126 return self.Add(*args, **kw)
11127 def AddSpacer(self, *args, **kw):
11128 """Compatibility alias for `Add`."""
11129 return self.Add(*args, **kw)
11130
11131 def PrependWindow(self, *args, **kw):
11132 """Compatibility alias for `Prepend`."""
11133 return self.Prepend(*args, **kw)
11134 def PrependSizer(self, *args, **kw):
11135 """Compatibility alias for `Prepend`."""
11136 return self.Prepend(*args, **kw)
11137 def PrependSpacer(self, *args, **kw):
11138 """Compatibility alias for `Prepend`."""
11139 return self.Prepend(*args, **kw)
11140
11141 def InsertWindow(self, *args, **kw):
11142 """Compatibility alias for `Insert`."""
11143 return self.Insert(*args, **kw)
11144 def InsertSizer(self, *args, **kw):
11145 """Compatibility alias for `Insert`."""
11146 return self.Insert(*args, **kw)
11147 def InsertSpacer(self, *args, **kw):
11148 """Compatibility alias for `Insert`."""
11149 return self.Insert(*args, **kw)
11150
11151 def RemoveWindow(self, *args, **kw):
11152 """Compatibility alias for `Remove`."""
11153 return self.Remove(*args, **kw)
11154 def RemoveSizer(self, *args, **kw):
11155 """Compatibility alias for `Remove`."""
11156 return self.Remove(*args, **kw)
11157 def RemovePos(self, *args, **kw):
11158 """Compatibility alias for `Remove`."""
11159 return self.Remove(*args, **kw)
d55e5bfc
RD
11160
11161
d55e5bfc 11162 def SetDimension(*args, **kwargs):
248ed943
RD
11163 """
11164 SetDimension(self, int x, int y, int width, int height)
11165
11166 Call this to force the sizer to take the given dimension and thus
11167 force the items owned by the sizer to resize themselves according to
11168 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11169 methods.
11170 """
d55e5bfc
RD
11171 return _core_.Sizer_SetDimension(*args, **kwargs)
11172
11173 def SetMinSize(*args, **kwargs):
248ed943
RD
11174 """
11175 SetMinSize(self, Size size)
11176
11177 Call this to give the sizer a minimal size. Normally, the sizer will
11178 calculate its minimal size based purely on how much space its children
11179 need. After calling this method `GetMinSize` will return either the
11180 minimal size as requested by its children or the minimal size set
11181 here, depending on which is bigger.
11182 """
d55e5bfc
RD
11183 return _core_.Sizer_SetMinSize(*args, **kwargs)
11184
11185 def GetSize(*args, **kwargs):
248ed943
RD
11186 """
11187 GetSize(self) -> Size
11188
11189 Returns the current size of the space managed by the sizer.
11190 """
d55e5bfc
RD
11191 return _core_.Sizer_GetSize(*args, **kwargs)
11192
11193 def GetPosition(*args, **kwargs):
248ed943
RD
11194 """
11195 GetPosition(self) -> Point
11196
11197 Returns the current position of the sizer's managed space.
11198 """
d55e5bfc
RD
11199 return _core_.Sizer_GetPosition(*args, **kwargs)
11200
11201 def GetMinSize(*args, **kwargs):
248ed943
RD
11202 """
11203 GetMinSize(self) -> Size
11204
11205 Returns the minimal size of the sizer. This is either the combined
11206 minimal size of all the children and their borders or the minimal size
11207 set by SetMinSize, depending on which is bigger.
11208 """
d55e5bfc
RD
11209 return _core_.Sizer_GetMinSize(*args, **kwargs)
11210
11211 def GetSizeTuple(self):
1a6bba1e 11212 return self.GetSize().Get()
d55e5bfc 11213 def GetPositionTuple(self):
1a6bba1e 11214 return self.GetPosition().Get()
d55e5bfc 11215 def GetMinSizeTuple(self):
1a6bba1e 11216 return self.GetMinSize().Get()
d55e5bfc
RD
11217
11218 def RecalcSizes(*args, **kwargs):
248ed943
RD
11219 """
11220 RecalcSizes(self)
11221
11222 Using the sizes calculated by `CalcMin` reposition and resize all the
11223 items managed by this sizer. You should not need to call this directly as
11224 it is called by `Layout`.
11225 """
d55e5bfc
RD
11226 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11227
11228 def CalcMin(*args, **kwargs):
248ed943
RD
11229 """
11230 CalcMin(self) -> Size
11231
11232 This method is where the sizer will do the actual calculation of its
11233 children's minimal sizes. You should not need to call this directly as
11234 it is called by `Layout`.
11235 """
d55e5bfc
RD
11236 return _core_.Sizer_CalcMin(*args, **kwargs)
11237
11238 def Layout(*args, **kwargs):
248ed943
RD
11239 """
11240 Layout(self)
11241
11242 This method will force the recalculation and layout of the items
11243 controlled by the sizer using the current space allocated to the
11244 sizer. Normally this is called automatically from the owning window's
11245 EVT_SIZE handler, but it is also useful to call it from user code when
11246 one of the items in a sizer change size, or items are added or
11247 removed.
11248 """
d55e5bfc
RD
11249 return _core_.Sizer_Layout(*args, **kwargs)
11250
11251 def Fit(*args, **kwargs):
248ed943
RD
11252 """
11253 Fit(self, Window window) -> Size
11254
11255 Tell the sizer to resize the *window* to match the sizer's minimal
11256 size. This is commonly done in the constructor of the window itself in
11257 order to set its initial size to match the needs of the children as
11258 determined by the sizer. Returns the new size.
11259
11260 For a top level window this is the total window size, not the client size.
11261 """
d55e5bfc
RD
11262 return _core_.Sizer_Fit(*args, **kwargs)
11263
11264 def FitInside(*args, **kwargs):
248ed943
RD
11265 """
11266 FitInside(self, Window window)
11267
11268 Tell the sizer to resize the *virtual size* of the *window* to match the
11269 sizer's minimal size. This will not alter the on screen size of the
11270 window, but may cause the addition/removal/alteration of scrollbars
11271 required to view the virtual area in windows which manage it.
11272
11273 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11274
11275 """
d55e5bfc
RD
11276 return _core_.Sizer_FitInside(*args, **kwargs)
11277
11278 def SetSizeHints(*args, **kwargs):
248ed943
RD
11279 """
11280 SetSizeHints(self, Window window)
11281
11282 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11283 match the sizer's minimal size. This is commonly done in the
11284 constructor of the window itself if the window is resizable (as are
11285 many dialogs under Unix and frames on probably all platforms) in order
11286 to prevent the window from being sized smaller than the minimal size
11287 required by the sizer.
11288 """
d55e5bfc
RD
11289 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11290
11291 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
11292 """
11293 SetVirtualSizeHints(self, Window window)
11294
11295 Tell the sizer to set the minimal size of the window virtual area to
11296 match the sizer's minimal size. For windows with managed scrollbars
11297 this will set them appropriately.
11298
11299 :see: `wx.ScrolledWindow.SetScrollbars`
11300
11301 """
d55e5bfc
RD
11302 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11303
11304 def Clear(*args, **kwargs):
248ed943
RD
11305 """
11306 Clear(self, bool deleteWindows=False)
11307
11308 Clear all items from the sizer, optionally destroying the window items
11309 as well.
11310 """
d55e5bfc
RD
11311 return _core_.Sizer_Clear(*args, **kwargs)
11312
11313 def DeleteWindows(*args, **kwargs):
248ed943
RD
11314 """
11315 DeleteWindows(self)
11316
11317 Destroy all windows managed by the sizer.
11318 """
d55e5bfc
RD
11319 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11320
11321 def GetChildren(*args, **kwargs):
248ed943 11322 """
51b83b37 11323 GetChildren(self) -> list
248ed943
RD
11324
11325 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11326 """
d55e5bfc
RD
11327 return _core_.Sizer_GetChildren(*args, **kwargs)
11328
11329 def Show(*args, **kwargs):
248ed943 11330 """
ae8162c8 11331 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11332
248ed943
RD
11333 Shows or hides an item managed by the sizer. To make a sizer item
11334 disappear or reappear, use Show followed by `Layout`. The *item*
11335 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11336 the item. Use the recursive parameter to show or hide an item in a
11337 subsizer. Returns True if the item was found.
248ed943
RD
11338 """
11339 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11340
11341 def IsShown(*args, **kwargs):
248ed943
RD
11342 """
11343 IsShown(self, item)
11344
b1fcee84 11345 Determines if the item is currently shown. To make a sizer
248ed943
RD
11346 item disappear or reappear, use Show followed by `Layout`. The *item*
11347 parameter can be either a window, a sizer, or the zero-based index of
11348 the item.
11349 """
d55e5bfc
RD
11350 return _core_.Sizer_IsShown(*args, **kwargs)
11351
629e65c2 11352 def Hide(self, item, recursive=False):
248ed943 11353 """
27fb7603 11354 A convenience method for `Show` (item, False, recursive).
248ed943 11355 """
06759a38 11356 return self.Show(item, False, recursive)
248ed943 11357
d55e5bfc 11358 def ShowItems(*args, **kwargs):
248ed943
RD
11359 """
11360 ShowItems(self, bool show)
11361
84f85550 11362 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 11363 """
d55e5bfc
RD
11364 return _core_.Sizer_ShowItems(*args, **kwargs)
11365
2131d850 11366_core_.Sizer_swigregister(Sizer)
d55e5bfc
RD
11367
11368class PySizer(Sizer):
248ed943
RD
11369 """
11370 wx.PySizer is a special version of `wx.Sizer` that has been
11371 instrumented to allow the C++ virtual methods to be overloaded in
11372 Python derived classes. You would derive from this class if you are
11373 wanting to implement a custom sizer in Python code. Simply implement
11374 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11375 For example::
11376
11377 class MySizer(wx.PySizer):
11378 def __init__(self):
11379 wx.PySizer.__init__(self)
11380
11381 def CalcMin(self):
11382 for item in self.GetChildren():
11383 # calculate the total minimum width and height needed
11384 # by all items in the sizer according to this sizer's
11385 # layout algorithm.
11386 ...
11387 return wx.Size(width, height)
11388
11389 def RecalcSizes(self):
11390 # find the space allotted to this sizer
11391 pos = self.GetPosition()
11392 size = self.GetSize()
11393 for item in self.GetChildren():
11394 # Recalculate (if necessary) the position and size of
11395 # each item and then call item.SetDimension to do the
11396 # actual positioning and sizing of the items within the
11397 # space alloted to this sizer.
11398 ...
11399 item.SetDimension(itemPos, itemSize)
11400
11401
11402 When `Layout` is called it first calls `CalcMin` followed by
11403 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11404 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
11405
11406 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11407
11408
11409 """
554f62e9
RD
11410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11411 __repr__ = _swig_repr
11412 def __init__(self, *args, **kwargs):
248ed943
RD
11413 """
11414 __init__(self) -> PySizer
11415
11416 Creates a wx.PySizer. Must be called from the __init__ in the derived
11417 class.
11418 """
554f62e9 11419 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
11420 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11421
11422 def _setCallbackInfo(*args, **kwargs):
11423 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11424 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11425
2131d850 11426_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
11427
11428#---------------------------------------------------------------------------
11429
11430class BoxSizer(Sizer):
248ed943
RD
11431 """
11432 The basic idea behind a box sizer is that windows will most often be
11433 laid out in rather simple basic geometry, typically in a row or a
11434 column or nested hierarchies of either. A wx.BoxSizer will lay out
11435 its items in a simple row or column, depending on the orientation
11436 parameter passed to the constructor.
11437 """
554f62e9
RD
11438 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11439 __repr__ = _swig_repr
11440 def __init__(self, *args, **kwargs):
248ed943
RD
11441 """
11442 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11443
11444 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11445 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11446 sizer.
11447 """
554f62e9 11448 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
11449 self._setOORInfo(self)
11450
11451 def GetOrientation(*args, **kwargs):
248ed943
RD
11452 """
11453 GetOrientation(self) -> int
11454
11455 Returns the current orientation of the sizer.
11456 """
d55e5bfc
RD
11457 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11458
11459 def SetOrientation(*args, **kwargs):
248ed943
RD
11460 """
11461 SetOrientation(self, int orient)
d55e5bfc 11462
248ed943
RD
11463 Resets the orientation of the sizer.
11464 """
11465 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 11466
2131d850 11467_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
11468
11469#---------------------------------------------------------------------------
11470
11471class StaticBoxSizer(BoxSizer):
248ed943
RD
11472 """
11473 wx.StaticBoxSizer derives from and functions identically to the
11474 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11475 manages. Note that this static box must be created separately and
11476 passed to the sizer constructor.
11477 """
554f62e9
RD
11478 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11479 __repr__ = _swig_repr
11480 def __init__(self, *args, **kwargs):
248ed943
RD
11481 """
11482 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11483
11484 Constructor. It takes an associated static box and the orientation
11485 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11486 ``wx.HORIZONTAL``.
11487 """
554f62e9 11488 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
11489 self._setOORInfo(self)
11490
11491 def GetStaticBox(*args, **kwargs):
248ed943
RD
11492 """
11493 GetStaticBox(self) -> StaticBox
d55e5bfc 11494
248ed943
RD
11495 Returns the static box associated with this sizer.
11496 """
11497 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 11498
2131d850 11499_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
11500
11501#---------------------------------------------------------------------------
11502
11503class GridSizer(Sizer):
248ed943
RD
11504 """
11505 A grid sizer is a sizer which lays out its children in a
11506 two-dimensional table with all cells having the same size. In other
11507 words, the width of each cell within the grid is the width of the
11508 widest item added to the sizer and the height of each grid cell is the
11509 height of the tallest item. An optional vertical and/or horizontal
11510 gap between items can also be specified (in pixels.)
11511
11512 Items are placed in the cells of the grid in the order they are added,
11513 in row-major order. In other words, the first row is filled first,
11514 then the second, and so on until all items have been added. (If
11515 neccessary, additional rows will be added as items are added.) If you
11516 need to have greater control over the cells that items are placed in
11517 then use the `wx.GridBagSizer`.
11518
11519 """
554f62e9
RD
11520 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11521 __repr__ = _swig_repr
11522 def __init__(self, *args, **kwargs):
248ed943
RD
11523 """
11524 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11525
11526 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11527 of columns and rows in the sizer - if either of the parameters is
11528 zero, it will be calculated to from the total number of children in
11529 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11530 define extra space between all children.
11531 """
554f62e9 11532 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
11533 self._setOORInfo(self)
11534
d55e5bfc 11535 def SetCols(*args, **kwargs):
248ed943
RD
11536 """
11537 SetCols(self, int cols)
11538
11539 Sets the number of columns in the sizer.
11540 """
d55e5bfc
RD
11541 return _core_.GridSizer_SetCols(*args, **kwargs)
11542
11543 def SetRows(*args, **kwargs):
248ed943
RD
11544 """
11545 SetRows(self, int rows)
11546
11547 Sets the number of rows in the sizer.
11548 """
d55e5bfc
RD
11549 return _core_.GridSizer_SetRows(*args, **kwargs)
11550
11551 def SetVGap(*args, **kwargs):
248ed943
RD
11552 """
11553 SetVGap(self, int gap)
11554
11555 Sets the vertical gap (in pixels) between the cells in the sizer.
11556 """
d55e5bfc
RD
11557 return _core_.GridSizer_SetVGap(*args, **kwargs)
11558
11559 def SetHGap(*args, **kwargs):
248ed943
RD
11560 """
11561 SetHGap(self, int gap)
11562
11563 Sets the horizontal gap (in pixels) between cells in the sizer
11564 """
d55e5bfc
RD
11565 return _core_.GridSizer_SetHGap(*args, **kwargs)
11566
11567 def GetCols(*args, **kwargs):
248ed943
RD
11568 """
11569 GetCols(self) -> int
11570
11571 Returns the number of columns in the sizer.
11572 """
d55e5bfc
RD
11573 return _core_.GridSizer_GetCols(*args, **kwargs)
11574
11575 def GetRows(*args, **kwargs):
248ed943
RD
11576 """
11577 GetRows(self) -> int
11578
11579 Returns the number of rows in the sizer.
11580 """
d55e5bfc
RD
11581 return _core_.GridSizer_GetRows(*args, **kwargs)
11582
11583 def GetVGap(*args, **kwargs):
248ed943
RD
11584 """
11585 GetVGap(self) -> int
11586
11587 Returns the vertical gap (in pixels) between the cells in the sizer.
11588 """
d55e5bfc
RD
11589 return _core_.GridSizer_GetVGap(*args, **kwargs)
11590
11591 def GetHGap(*args, **kwargs):
248ed943
RD
11592 """
11593 GetHGap(self) -> int
11594
11595 Returns the horizontal gap (in pixels) between cells in the sizer.
11596 """
d55e5bfc
RD
11597 return _core_.GridSizer_GetHGap(*args, **kwargs)
11598
554f62e9
RD
11599 def CalcRowsCols(self):
11600 """
11601 CalcRowsCols() -> (rows, cols)
d55e5bfc 11602
554f62e9
RD
11603 Calculates how many rows and columns will be in the sizer based
11604 on the current number of items and also the rows, cols specified
11605 in the constructor.
11606 """
11607 nitems = len(self.GetChildren())
11608 rows = self.GetRows()
11609 cols = self.GetCols()
11610 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11611 if cols != 0:
11612 rows = (nitems + cols - 1) / cols
11613 elif rows != 0:
11614 cols = (nitems + rows - 1) / rows
11615 return (rows, cols)
11616
2131d850 11617_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
11618
11619#---------------------------------------------------------------------------
11620
11621FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11622FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11623FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11624class FlexGridSizer(GridSizer):
248ed943
RD
11625 """
11626 A flex grid sizer is a sizer which lays out its children in a
11627 two-dimensional table with all table cells in one row having the same
11628 height and all cells in one column having the same width, but all
11629 rows or all columns are not necessarily the same height or width as in
11630 the `wx.GridSizer`.
11631
11632 wx.FlexGridSizer can also size items equally in one direction but
11633 unequally ("flexibly") in the other. If the sizer is only flexible
11634 in one direction (this can be changed using `SetFlexibleDirection`), it
11635 needs to be decided how the sizer should grow in the other ("non
11636 flexible") direction in order to fill the available space. The
11637 `SetNonFlexibleGrowMode` method serves this purpose.
11638
11639
11640 """
554f62e9
RD
11641 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11642 __repr__ = _swig_repr
11643 def __init__(self, *args, **kwargs):
248ed943
RD
11644 """
11645 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11646
11647 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11648 number of columns and rows in the sizer - if either of the parameters
11649 is zero, it will be calculated to from the total number of children in
11650 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11651 define extra space between all children.
11652 """
554f62e9 11653 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
11654 self._setOORInfo(self)
11655
248ed943
RD
11656 def AddGrowableRow(*args, **kwargs):
11657 """
11658 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 11659
248ed943
RD
11660 Specifies that row *idx* (starting from zero) should be grown if there
11661 is extra space available to the sizer.
d55e5bfc 11662
248ed943
RD
11663 The *proportion* parameter has the same meaning as the stretch factor
11664 for the box sizers except that if all proportions are 0, then all
11665 columns are resized equally (instead of not being resized at all).
11666 """
d55e5bfc
RD
11667 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11668
11669 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
11670 """
11671 RemoveGrowableRow(self, size_t idx)
11672
11673 Specifies that row *idx* is no longer growable.
11674 """
d55e5bfc
RD
11675 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11676
11677 def AddGrowableCol(*args, **kwargs):
248ed943
RD
11678 """
11679 AddGrowableCol(self, size_t idx, int proportion=0)
11680
11681 Specifies that column *idx* (starting from zero) should be grown if
11682 there is extra space available to the sizer.
11683
11684 The *proportion* parameter has the same meaning as the stretch factor
11685 for the box sizers except that if all proportions are 0, then all
11686 columns are resized equally (instead of not being resized at all).
11687 """
d55e5bfc
RD
11688 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11689
11690 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
11691 """
11692 RemoveGrowableCol(self, size_t idx)
11693
11694 Specifies that column *idx* is no longer growable.
11695 """
d55e5bfc
RD
11696 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11697
11698 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
11699 """
11700 SetFlexibleDirection(self, int direction)
11701
11702 Specifies whether the sizer should flexibly resize its columns, rows,
11703 or both. Argument *direction* can be one of the following values. Any
11704 other value is ignored.
11705
11706 ============== =======================================
11707 wx.VERTICAL Rows are flexibly sized.
11708 wx.HORIZONTAL Columns are flexibly sized.
11709 wx.BOTH Both rows and columns are flexibly sized
11710 (this is the default value).
11711 ============== =======================================
11712
11713 Note that this method does not trigger relayout.
11714
11715 """
d55e5bfc
RD
11716 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11717
11718 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
11719 """
11720 GetFlexibleDirection(self) -> int
11721
11722 Returns a value that specifies whether the sizer
11723 flexibly resizes its columns, rows, or both (default).
11724
11725 :see: `SetFlexibleDirection`
11726 """
d55e5bfc
RD
11727 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11728
11729 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11730 """
11731 SetNonFlexibleGrowMode(self, int mode)
11732
11733 Specifies how the sizer should grow in the non-flexible direction if
11734 there is one (so `SetFlexibleDirection` must have been called
11735 previously). Argument *mode* can be one of the following values:
11736
11737 ========================== =================================================
11738 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11739 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11740 `AddGrowableCol` and `AddGrowableRow`. In this
11741 case equal sizing applies to minimum sizes of
11742 columns or rows (this is the default value).
11743 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11744 the non flexible direction, whether they are
11745 growable or not in the flexbile direction.
11746 ========================== =================================================
11747
11748 Note that this method does not trigger relayout.
11749
11750
11751 """
d55e5bfc
RD
11752 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11753
11754 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11755 """
11756 GetNonFlexibleGrowMode(self) -> int
11757
11758 Returns the value that specifies how the sizer grows in the
11759 non-flexible direction if there is one.
11760
11761 :see: `SetNonFlexibleGrowMode`
11762 """
d55e5bfc
RD
11763 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11764
11765 def GetRowHeights(*args, **kwargs):
a8eff060
RD
11766 """
11767 GetRowHeights(self) -> list
11768
11769 Returns a list of integers representing the heights of each of the
11770 rows in the sizer.
11771 """
d55e5bfc
RD
11772 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11773
11774 def GetColWidths(*args, **kwargs):
a8eff060
RD
11775 """
11776 GetColWidths(self) -> list
11777
11778 Returns a list of integers representing the widths of each of the
11779 columns in the sizer.
11780 """
d55e5bfc
RD
11781 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11782
2131d850 11783_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 11784
62d32a5f
RD
11785class StdDialogButtonSizer(BoxSizer):
11786 """
11787 A special sizer that knows how to order and position standard buttons
11788 in order to conform to the current platform's standards. You simply
11789 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11790 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
11791 will take care of the rest.
11792
11793 """
554f62e9
RD
11794 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11795 __repr__ = _swig_repr
11796 def __init__(self, *args, **kwargs):
62d32a5f 11797 """__init__(self) -> StdDialogButtonSizer"""
554f62e9 11798 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
11799 def AddButton(*args, **kwargs):
11800 """
11801 AddButton(self, wxButton button)
11802
11803 Use this to add the buttons to this sizer. Do not use the `Add`
11804 method in the base class.
11805 """
11806 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11807
53aa7709 11808 def Realize(*args, **kwargs):
62d32a5f 11809 """
53aa7709 11810 Realize(self)
62d32a5f
RD
11811
11812 This funciton needs to be called after all the buttons have been added
11813 to the sizer. It will reorder them and position them in a platform
11814 specifc manner.
11815 """
53aa7709 11816 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11817
11818 def SetAffirmativeButton(*args, **kwargs):
11819 """SetAffirmativeButton(self, wxButton button)"""
11820 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11821
11822 def SetNegativeButton(*args, **kwargs):
11823 """SetNegativeButton(self, wxButton button)"""
11824 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11825
11826 def SetCancelButton(*args, **kwargs):
11827 """SetCancelButton(self, wxButton button)"""
11828 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
11829
11830 def GetAffirmativeButton(*args, **kwargs):
11831 """GetAffirmativeButton(self) -> wxButton"""
11832 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11833
11834 def GetApplyButton(*args, **kwargs):
11835 """GetApplyButton(self) -> wxButton"""
11836 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11837
11838 def GetNegativeButton(*args, **kwargs):
11839 """GetNegativeButton(self) -> wxButton"""
11840 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11841
11842 def GetCancelButton(*args, **kwargs):
11843 """GetCancelButton(self) -> wxButton"""
11844 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11845
11846 def GetHelpButton(*args, **kwargs):
11847 """GetHelpButton(self) -> wxButton"""
11848 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11849
2131d850 11850_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 11851
d55e5bfc
RD
11852#---------------------------------------------------------------------------
11853
11854class GBPosition(object):
248ed943
RD
11855 """
11856 This class represents the position of an item in a virtual grid of
11857 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11858 typemaps that will automatically convert from a 2-element sequence of
11859 integers to a wx.GBPosition, so you can use the more pythonic
11860 representation of the position nearly transparently in Python code.
11861 """
554f62e9
RD
11862 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11863 __repr__ = _swig_repr
11864 def __init__(self, *args, **kwargs):
248ed943
RD
11865 """
11866 __init__(self, int row=0, int col=0) -> GBPosition
11867
11868 This class represents the position of an item in a virtual grid of
11869 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11870 typemaps that will automatically convert from a 2-element sequence of
11871 integers to a wx.GBPosition, so you can use the more pythonic
11872 representation of the position nearly transparently in Python code.
11873 """
554f62e9
RD
11874 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11875 __swig_destroy__ = _core_.delete_GBPosition
11876 __del__ = lambda self : None;
d55e5bfc
RD
11877 def GetRow(*args, **kwargs):
11878 """GetRow(self) -> int"""
11879 return _core_.GBPosition_GetRow(*args, **kwargs)
11880
11881 def GetCol(*args, **kwargs):
11882 """GetCol(self) -> int"""
11883 return _core_.GBPosition_GetCol(*args, **kwargs)
11884
11885 def SetRow(*args, **kwargs):
11886 """SetRow(self, int row)"""
11887 return _core_.GBPosition_SetRow(*args, **kwargs)
11888
11889 def SetCol(*args, **kwargs):
11890 """SetCol(self, int col)"""
11891 return _core_.GBPosition_SetCol(*args, **kwargs)
11892
11893 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11894 """
11895 __eq__(self, PyObject other) -> bool
11896
11897 Compare GBPosition for equality.
11898 """
d55e5bfc
RD
11899 return _core_.GBPosition___eq__(*args, **kwargs)
11900
11901 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11902 """
11903 __ne__(self, PyObject other) -> bool
11904
11905 Compare GBPosition for inequality.
11906 """
d55e5bfc
RD
11907 return _core_.GBPosition___ne__(*args, **kwargs)
11908
11909 def Set(*args, **kwargs):
11910 """Set(self, int row=0, int col=0)"""
11911 return _core_.GBPosition_Set(*args, **kwargs)
11912
11913 def Get(*args, **kwargs):
11914 """Get(self) -> PyObject"""
11915 return _core_.GBPosition_Get(*args, **kwargs)
11916
79fccf9d 11917 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11918 def __str__(self): return str(self.Get())
11919 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11920 def __len__(self): return len(self.Get())
11921 def __getitem__(self, index): return self.Get()[index]
11922 def __setitem__(self, index, val):
11923 if index == 0: self.SetRow(val)
11924 elif index == 1: self.SetCol(val)
11925 else: raise IndexError
11926 def __nonzero__(self): return self.Get() != (0,0)
11927 __safe_for_unpickling__ = True
11928 def __reduce__(self): return (wx.GBPosition, self.Get())
11929
11930 row = property(GetRow, SetRow)
11931 col = property(GetCol, SetCol)
11932
2131d850 11933_core_.GBPosition_swigregister(GBPosition)
d55e5bfc
RD
11934
11935class GBSpan(object):
248ed943
RD
11936 """
11937 This class is used to hold the row and column spanning attributes of
11938 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11939 automatically convert from a 2-element sequence of integers to a
11940 wx.GBSpan, so you can use the more pythonic representation of the span
11941 nearly transparently in Python code.
11942
11943 """
554f62e9
RD
11944 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11945 __repr__ = _swig_repr
11946 def __init__(self, *args, **kwargs):
248ed943
RD
11947 """
11948 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11949
11950 Construct a new wxGBSpan, optionally setting the rowspan and
11951 colspan. The default is (1,1). (Meaning that the item occupies one
11952 cell in each direction.
11953 """
554f62e9
RD
11954 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11955 __swig_destroy__ = _core_.delete_GBSpan
11956 __del__ = lambda self : None;
d55e5bfc
RD
11957 def GetRowspan(*args, **kwargs):
11958 """GetRowspan(self) -> int"""
11959 return _core_.GBSpan_GetRowspan(*args, **kwargs)
11960
11961 def GetColspan(*args, **kwargs):
11962 """GetColspan(self) -> int"""
11963 return _core_.GBSpan_GetColspan(*args, **kwargs)
11964
11965 def SetRowspan(*args, **kwargs):
11966 """SetRowspan(self, int rowspan)"""
11967 return _core_.GBSpan_SetRowspan(*args, **kwargs)
11968
11969 def SetColspan(*args, **kwargs):
11970 """SetColspan(self, int colspan)"""
11971 return _core_.GBSpan_SetColspan(*args, **kwargs)
11972
11973 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11974 """
11975 __eq__(self, PyObject other) -> bool
11976
11977 Compare wxGBSpan for equality.
11978 """
d55e5bfc
RD
11979 return _core_.GBSpan___eq__(*args, **kwargs)
11980
11981 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11982 """
11983 __ne__(self, PyObject other) -> bool
11984
11985 Compare GBSpan for inequality.
11986 """
d55e5bfc
RD
11987 return _core_.GBSpan___ne__(*args, **kwargs)
11988
11989 def Set(*args, **kwargs):
11990 """Set(self, int rowspan=1, int colspan=1)"""
11991 return _core_.GBSpan_Set(*args, **kwargs)
11992
11993 def Get(*args, **kwargs):
11994 """Get(self) -> PyObject"""
11995 return _core_.GBSpan_Get(*args, **kwargs)
11996
79fccf9d 11997 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11998 def __str__(self): return str(self.Get())
11999 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12000 def __len__(self): return len(self.Get())
12001 def __getitem__(self, index): return self.Get()[index]
12002 def __setitem__(self, index, val):
12003 if index == 0: self.SetRowspan(val)
12004 elif index == 1: self.SetColspan(val)
12005 else: raise IndexError
12006 def __nonzero__(self): return self.Get() != (0,0)
12007 __safe_for_unpickling__ = True
12008 def __reduce__(self): return (wx.GBSpan, self.Get())
12009
12010 rowspan = property(GetRowspan, SetRowspan)
12011 colspan = property(GetColspan, SetColspan)
12012
2131d850 12013_core_.GBSpan_swigregister(GBSpan)
d55e5bfc
RD
12014
12015class GBSizerItem(SizerItem):
248ed943
RD
12016 """
12017 The wx.GBSizerItem class is used to track the additional data about
12018 items in a `wx.GridBagSizer` such as the item's position in the grid
12019 and how many rows or columns it spans.
12020
12021 """
554f62e9
RD
12022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12023 __repr__ = _swig_repr
12024 def __init__(self, *args, **kwargs):
248ed943
RD
12025 """
12026 __init__(self) -> GBSizerItem
12027
12028 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12029 size will need to be set, as well as a position and span before this
12030 item can be used in a Sizer.
12031
12032 You will probably never need to create a wx.GBSizerItem directly as they
12033 are created automatically when the sizer's Add method is called.
12034 """
554f62e9
RD
12035 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12036 __swig_destroy__ = _core_.delete_GBSizerItem
12037 __del__ = lambda self : None;
d55e5bfc 12038 def GetPos(*args, **kwargs):
248ed943
RD
12039 """
12040 GetPos(self) -> GBPosition
12041
12042 Get the grid position of the item
12043 """
d55e5bfc
RD
12044 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12045
12046 def GetPosTuple(self): return self.GetPos().Get()
12047 def GetSpan(*args, **kwargs):
248ed943
RD
12048 """
12049 GetSpan(self) -> GBSpan
12050
12051 Get the row and column spanning of the item
12052 """
d55e5bfc
RD
12053 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12054
12055 def GetSpanTuple(self): return self.GetSpan().Get()
12056 def SetPos(*args, **kwargs):
248ed943
RD
12057 """
12058 SetPos(self, GBPosition pos) -> bool
12059
12060 If the item is already a member of a sizer then first ensure that
12061 there is no other item that would intersect with this one at the new
12062 position, then set the new position. Returns True if the change is
12063 successful and after the next Layout() the item will be moved.
12064 """
d55e5bfc
RD
12065 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12066
12067 def SetSpan(*args, **kwargs):
248ed943
RD
12068 """
12069 SetSpan(self, GBSpan span) -> bool
12070
12071 If the item is already a member of a sizer then first ensure that
12072 there is no other item that would intersect with this one with its new
12073 spanning size, then set the new spanning. Returns True if the change
12074 is successful and after the next Layout() the item will be resized.
12075
12076 """
d55e5bfc
RD
12077 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12078
248ed943 12079 def Intersects(*args, **kwargs):
d55e5bfc
RD
12080 """
12081 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12082
12083 Returns True if this item and the other item instersect.
d55e5bfc 12084 """
248ed943
RD
12085 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12086
12087 def IntersectsPos(*args, **kwargs):
12088 """
12089 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12090
12091 Returns True if the given pos/span would intersect with this item.
12092 """
12093 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12094
12095 def GetEndPos(*args, **kwargs):
248ed943
RD
12096 """
12097 GetEndPos(self) -> GBPosition
12098
12099 Get the row and column of the endpoint of this item.
12100 """
d55e5bfc
RD
12101 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12102
12103 def GetGBSizer(*args, **kwargs):
248ed943
RD
12104 """
12105 GetGBSizer(self) -> GridBagSizer
12106
12107 Get the sizer this item is a member of.
12108 """
d55e5bfc
RD
12109 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12110
12111 def SetGBSizer(*args, **kwargs):
248ed943
RD
12112 """
12113 SetGBSizer(self, GridBagSizer sizer)
12114
12115 Set the sizer this item is a member of.
12116 """
d55e5bfc
RD
12117 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12118
2131d850 12119_core_.GBSizerItem_swigregister(GBSizerItem)
d55e5bfc
RD
12120DefaultSpan = cvar.DefaultSpan
12121
12122def GBSizerItemWindow(*args, **kwargs):
12123 """
12124 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12125 int border, PyObject userData=None) -> GBSizerItem
12126
12127 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
12128 """
12129 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12130 return val
12131
12132def GBSizerItemSizer(*args, **kwargs):
12133 """
12134 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12135 int border, PyObject userData=None) -> GBSizerItem
12136
12137 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
12138 """
12139 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12140 return val
12141
12142def GBSizerItemSpacer(*args, **kwargs):
12143 """
12144 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12145 int flag, int border, PyObject userData=None) -> GBSizerItem
12146
12147 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
12148 """
12149 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12150 return val
12151
12152class GridBagSizer(FlexGridSizer):
248ed943
RD
12153 """
12154 A `wx.Sizer` that can lay out items in a virtual grid like a
12155 `wx.FlexGridSizer` but in this case explicit positioning of the items
12156 is allowed using `wx.GBPosition`, and items can optionally span more
12157 than one row and/or column using `wx.GBSpan`. The total size of the
12158 virtual grid is determined by the largest row and column that items are
12159 positioned at, adjusted for spanning.
12160
12161 """
554f62e9
RD
12162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12163 __repr__ = _swig_repr
12164 def __init__(self, *args, **kwargs):
248ed943
RD
12165 """
12166 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12167
12168 Constructor, with optional parameters to specify the gap between the
12169 rows and columns.
12170 """
554f62e9 12171 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
c9c2cf70
RD
12172 self._setOORInfo(self)
12173
d55e5bfc
RD
12174 def Add(*args, **kwargs):
12175 """
248ed943 12176 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
c1cb24a4 12177 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12178
12179 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12180 more than one row or column as specified with *span*. The remaining
12181 args behave similarly to `wx.Sizer.Add`.
12182
12183 Returns True if the item was successfully placed at the given cell
12184 position, False if something was already there.
12185
d55e5bfc
RD
12186 """
12187 return _core_.GridBagSizer_Add(*args, **kwargs)
12188
12189 def AddItem(*args, **kwargs):
248ed943 12190 """
c1cb24a4 12191 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12192
12193 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12194 the item was successfully placed at its given cell position, False if
12195 something was already there.
12196 """
d55e5bfc
RD
12197 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12198
84f85550
RD
12199 def GetCellSize(*args, **kwargs):
12200 """
12201 GetCellSize(self, int row, int col) -> Size
12202
12203 Get the size of the specified cell, including hgap and
12204 vgap. Only valid after a Layout.
12205 """
12206 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12207
d55e5bfc 12208 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12209 """
12210 GetEmptyCellSize(self) -> Size
12211
12212 Get the size used for cells in the grid with no item.
12213 """
d55e5bfc
RD
12214 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12215
12216 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12217 """
12218 SetEmptyCellSize(self, Size sz)
12219
12220 Set the size used for cells in the grid with no item.
12221 """
d55e5bfc
RD
12222 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12223
12224 def GetItemPosition(*args):
12225 """
248ed943
RD
12226 GetItemPosition(self, item) -> GBPosition
12227
12228 Get the grid position of the specified *item* where *item* is either a
12229 window or subsizer that is a member of this sizer, or a zero-based
12230 index of an item.
d55e5bfc
RD
12231 """
12232 return _core_.GridBagSizer_GetItemPosition(*args)
12233
12234 def SetItemPosition(*args):
12235 """
248ed943
RD
12236 SetItemPosition(self, item, GBPosition pos) -> bool
12237
12238 Set the grid position of the specified *item* where *item* is either a
12239 window or subsizer that is a member of this sizer, or a zero-based
12240 index of an item. Returns True on success. If the move is not
12241 allowed (because an item is already there) then False is returned.
12242
d55e5bfc
RD
12243 """
12244 return _core_.GridBagSizer_SetItemPosition(*args)
12245
12246 def GetItemSpan(*args):
12247 """
248ed943
RD
12248 GetItemSpan(self, item) -> GBSpan
12249
12250 Get the row/col spanning of the specified *item* where *item* is
12251 either a window or subsizer that is a member of this sizer, or a
12252 zero-based index of an item.
d55e5bfc
RD
12253 """
12254 return _core_.GridBagSizer_GetItemSpan(*args)
12255
12256 def SetItemSpan(*args):
12257 """
248ed943
RD
12258 SetItemSpan(self, item, GBSpan span) -> bool
12259
12260 Set the row/col spanning of the specified *item* where *item* is
12261 either a window or subsizer that is a member of this sizer, or a
12262 zero-based index of an item. Returns True on success. If the move is
12263 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
12264 """
12265 return _core_.GridBagSizer_SetItemSpan(*args)
12266
12267 def FindItem(*args):
12268 """
248ed943
RD
12269 FindItem(self, item) -> GBSizerItem
12270
12271 Find the sizer item for the given window or subsizer, returns None if
12272 not found. (non-recursive)
d55e5bfc
RD
12273 """
12274 return _core_.GridBagSizer_FindItem(*args)
12275
12276 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
12277 """
12278 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12279
12280 Return the sizer item for the given grid cell, or None if there is no
12281 item at that position. (non-recursive)
12282 """
d55e5bfc
RD
12283 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12284
12285 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
12286 """
12287 FindItemAtPoint(self, Point pt) -> GBSizerItem
12288
12289 Return the sizer item located at the point given in *pt*, or None if
12290 there is no item at that point. The (x,y) coordinates in pt correspond
12291 to the client coordinates of the window using the sizer for
12292 layout. (non-recursive)
12293 """
d55e5bfc
RD
12294 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12295
248ed943
RD
12296 def CheckForIntersection(*args, **kwargs):
12297 """
12298 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12299
248ed943
RD
12300 Look at all items and see if any intersect (or would overlap) the
12301 given *item*. Returns True if so, False if there would be no overlap.
12302 If an *excludeItem* is given then it will not be checked for
12303 intersection, for example it may be the item we are checking the
12304 position of.
d55e5bfc 12305
248ed943
RD
12306 """
12307 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12308
248ed943 12309 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12310 """
248ed943
RD
12311 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12312
12313 Look at all items and see if any intersect (or would overlap) the
12314 given position and span. Returns True if so, False if there would be
12315 no overlap. If an *excludeItem* is given then it will not be checked
12316 for intersection, for example it may be the item we are checking the
12317 position of.
d55e5bfc 12318 """
248ed943 12319 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 12320
2131d850 12321_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
12322
12323#---------------------------------------------------------------------------
12324
12325Left = _core_.Left
12326Top = _core_.Top
12327Right = _core_.Right
12328Bottom = _core_.Bottom
12329Width = _core_.Width
12330Height = _core_.Height
12331Centre = _core_.Centre
12332Center = _core_.Center
12333CentreX = _core_.CentreX
12334CentreY = _core_.CentreY
12335Unconstrained = _core_.Unconstrained
12336AsIs = _core_.AsIs
12337PercentOf = _core_.PercentOf
12338Above = _core_.Above
12339Below = _core_.Below
12340LeftOf = _core_.LeftOf
12341RightOf = _core_.RightOf
12342SameAs = _core_.SameAs
12343Absolute = _core_.Absolute
12344class IndividualLayoutConstraint(Object):
12345 """
79fccf9d
RD
12346 Objects of this class are stored in the `wx.LayoutConstraints` class as
12347 one of eight possible constraints that a window can be involved in.
12348 You will never need to create an instance of
12349 wx.IndividualLayoutConstraint, rather you should create a
12350 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12351 that it contains.
d55e5bfc 12352 """
554f62e9
RD
12353 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12354 def __init__(self): raise AttributeError, "No constructor defined"
12355 __repr__ = _swig_repr
d55e5bfc 12356 def Set(*args, **kwargs):
79fccf9d
RD
12357 """
12358 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12359
12360 Sets the properties of the constraint. Normally called by one of the
12361 convenience functions such as Above, RightOf, SameAs.
12362 """
d55e5bfc
RD
12363 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12364
12365 def LeftOf(*args, **kwargs):
12366 """
12367 LeftOf(self, Window sibling, int marg=0)
12368
79fccf9d
RD
12369 Constrains this edge to be to the left of the given window, with an
12370 optional margin. Implicitly, this is relative to the left edge of the
12371 other window.
d55e5bfc
RD
12372 """
12373 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12374
12375 def RightOf(*args, **kwargs):
12376 """
12377 RightOf(self, Window sibling, int marg=0)
12378
79fccf9d
RD
12379 Constrains this edge to be to the right of the given window, with an
12380 optional margin. Implicitly, this is relative to the right edge of the
12381 other window.
d55e5bfc
RD
12382 """
12383 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12384
12385 def Above(*args, **kwargs):
12386 """
12387 Above(self, Window sibling, int marg=0)
12388
79fccf9d
RD
12389 Constrains this edge to be above the given window, with an optional
12390 margin. Implicitly, this is relative to the top edge of the other
12391 window.
d55e5bfc
RD
12392 """
12393 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12394
12395 def Below(*args, **kwargs):
12396 """
12397 Below(self, Window sibling, int marg=0)
12398
79fccf9d
RD
12399 Constrains this edge to be below the given window, with an optional
12400 margin. Implicitly, this is relative to the bottom edge of the other
12401 window.
d55e5bfc
RD
12402 """
12403 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12404
12405 def SameAs(*args, **kwargs):
12406 """
12407 SameAs(self, Window otherW, int edge, int marg=0)
12408
79fccf9d
RD
12409 Constrains this edge or dimension to be to the same as the edge of the
12410 given window, with an optional margin.
d55e5bfc
RD
12411 """
12412 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12413
12414 def PercentOf(*args, **kwargs):
12415 """
12416 PercentOf(self, Window otherW, int wh, int per)
12417
79fccf9d
RD
12418 Constrains this edge or dimension to be to a percentage of the given
12419 window, with an optional margin.
d55e5bfc
RD
12420 """
12421 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12422
12423 def Absolute(*args, **kwargs):
12424 """
12425 Absolute(self, int val)
12426
79fccf9d 12427 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
12428 """
12429 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12430
12431 def Unconstrained(*args, **kwargs):
12432 """
12433 Unconstrained(self)
12434
79fccf9d
RD
12435 Sets this edge or dimension to be unconstrained, that is, dependent on
12436 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
12437 """
12438 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12439
12440 def AsIs(*args, **kwargs):
12441 """
12442 AsIs(self)
12443
79fccf9d
RD
12444 Sets this edge or constraint to be whatever the window's value is at
12445 the moment. If either of the width and height constraints are *as is*,
12446 the window will not be resized, but moved instead. This is important
12447 when considering panel items which are intended to have a default
12448 size, such as a button, which may take its size from the size of the
12449 button label.
d55e5bfc
RD
12450 """
12451 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12452
12453 def GetOtherWindow(*args, **kwargs):
12454 """GetOtherWindow(self) -> Window"""
12455 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12456
12457 def GetMyEdge(*args, **kwargs):
12458 """GetMyEdge(self) -> int"""
12459 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12460
12461 def SetEdge(*args, **kwargs):
12462 """SetEdge(self, int which)"""
12463 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12464
12465 def SetValue(*args, **kwargs):
12466 """SetValue(self, int v)"""
12467 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12468
12469 def GetMargin(*args, **kwargs):
12470 """GetMargin(self) -> int"""
12471 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12472
12473 def SetMargin(*args, **kwargs):
12474 """SetMargin(self, int m)"""
12475 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12476
12477 def GetValue(*args, **kwargs):
12478 """GetValue(self) -> int"""
12479 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12480
12481 def GetPercent(*args, **kwargs):
12482 """GetPercent(self) -> int"""
12483 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12484
12485 def GetOtherEdge(*args, **kwargs):
12486 """GetOtherEdge(self) -> int"""
12487 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12488
12489 def GetDone(*args, **kwargs):
12490 """GetDone(self) -> bool"""
12491 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12492
12493 def SetDone(*args, **kwargs):
12494 """SetDone(self, bool d)"""
12495 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12496
12497 def GetRelationship(*args, **kwargs):
12498 """GetRelationship(self) -> int"""
12499 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12500
12501 def SetRelationship(*args, **kwargs):
12502 """SetRelationship(self, int r)"""
12503 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12504
12505 def ResetIfWin(*args, **kwargs):
12506 """
12507 ResetIfWin(self, Window otherW) -> bool
12508
12509 Reset constraint if it mentions otherWin
12510 """
12511 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12512
12513 def SatisfyConstraint(*args, **kwargs):
12514 """
12515 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12516
12517 Try to satisfy constraint
12518 """
12519 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12520
12521 def GetEdge(*args, **kwargs):
12522 """
12523 GetEdge(self, int which, Window thisWin, Window other) -> int
12524
12525 Get the value of this edge or dimension, or if this
12526 is not determinable, -1.
12527 """
12528 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12529
2131d850 12530_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc
RD
12531
12532class LayoutConstraints(Object):
12533 """
79fccf9d
RD
12534 **Note:** constraints are now deprecated and you should use sizers
12535 instead.
d55e5bfc 12536
79fccf9d
RD
12537 Objects of this class can be associated with a window to define its
12538 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
12539
12540 The class consists of the following eight constraints of class
12541 wx.IndividualLayoutConstraint, some or all of which should be accessed
12542 directly to set the appropriate constraints.
12543
12544 * left: represents the left hand edge of the window
12545 * right: represents the right hand edge of the window
12546 * top: represents the top edge of the window
12547 * bottom: represents the bottom edge of the window
12548 * width: represents the width of the window
12549 * height: represents the height of the window
12550 * centreX: represents the horizontal centre point of the window
12551 * centreY: represents the vertical centre point of the window
12552
79fccf9d
RD
12553 Most constraints are initially set to have the relationship
12554 wxUnconstrained, which means that their values should be calculated by
12555 looking at known constraints. The exceptions are width and height,
12556 which are set to wxAsIs to ensure that if the user does not specify a
12557 constraint, the existing width and height will be used, to be
12558 compatible with panel items which often have take a default size. If
12559 the constraint is ``wx.AsIs``, the dimension will not be changed.
12560
12561 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
12562
12563 """
554f62e9
RD
12564 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12565 __repr__ = _swig_repr
d55e5bfc
RD
12566 left = property(_core_.LayoutConstraints_left_get)
12567 top = property(_core_.LayoutConstraints_top_get)
12568 right = property(_core_.LayoutConstraints_right_get)
12569 bottom = property(_core_.LayoutConstraints_bottom_get)
12570 width = property(_core_.LayoutConstraints_width_get)
12571 height = property(_core_.LayoutConstraints_height_get)
12572 centreX = property(_core_.LayoutConstraints_centreX_get)
12573 centreY = property(_core_.LayoutConstraints_centreY_get)
554f62e9 12574 def __init__(self, *args, **kwargs):
d55e5bfc 12575 """__init__(self) -> LayoutConstraints"""
554f62e9
RD
12576 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12577 __swig_destroy__ = _core_.delete_LayoutConstraints
12578 __del__ = lambda self : None;
d55e5bfc
RD
12579 def SatisfyConstraints(*args, **kwargs):
12580 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12581 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12582
12583 def AreSatisfied(*args, **kwargs):
12584 """AreSatisfied(self) -> bool"""
12585 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12586
2131d850 12587_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
12588
12589#----------------------------------------------------------------------------
12590
12591# Use Python's bool constants if available, make some if not
12592try:
12593 True
12594except NameError:
12595 __builtins__.True = 1==1
12596 __builtins__.False = 1==0
12597 def bool(value): return not not value
12598 __builtins__.bool = bool
12599
12600
12601
12602# workarounds for bad wxRTTI names
12603__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12604__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12605__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12606
12607
12608#----------------------------------------------------------------------------
12609# Load version numbers from __version__... Ensure that major and minor
0f63ec68 12610# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
12611
12612from __version__ import *
12613__version__ = VERSION_STRING
12614
0f63ec68
RD
12615assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12616assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
12617if RELEASE_VERSION != _core_.RELEASE_VERSION:
12618 import warnings
0f63ec68 12619 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
12620
12621#----------------------------------------------------------------------------
12622
70b7a5fe
RD
12623# Set wxPython's default string<-->unicode conversion encoding from
12624# the locale, but only if Python's default hasn't been changed. (We
12625# assume that if the user has customized it already then that is the
12626# encoding we need to use as well.)
12627#
12628# The encoding selected here is used when string or unicode objects
12629# need to be converted in order to pass them to wxWidgets. Please be
12630# aware that the default encoding within the same locale may be
12631# slightly different on different platforms. For example, please see
62d32a5f
RD
12632# http://www.alanwood.net/demos/charsetdiffs.html for differences
12633# between the common latin/roman encodings.
396fb509
RD
12634
12635default = _sys.getdefaultencoding()
12636if default == 'ascii':
12637 import locale
12638 import codecs
12639 try:
12640 default = locale.getdefaultlocale()[1]
12641 codecs.lookup(default)
70b7a5fe 12642 except (ValueError, LookupError, TypeError):
396fb509
RD
12643 default = _sys.getdefaultencoding()
12644 del locale
12645 del codecs
5cbf236d
RD
12646if default:
12647 wx.SetDefaultPyEncoding(default)
12648del default
5cbf236d
RD
12649
12650#----------------------------------------------------------------------------
12651
d55e5bfc
RD
12652class PyDeadObjectError(AttributeError):
12653 pass
12654
12655class _wxPyDeadObject(object):
12656 """
12657 Instances of wx objects that are OOR capable will have their __class__
12658 changed to this class when the C++ object is deleted. This should help
12659 prevent crashes due to referencing a bogus C++ pointer.
12660 """
12661 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12662 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12663
12664 def __repr__(self):
12665 if not hasattr(self, "_name"):
12666 self._name = "[unknown]"
12667 return self.reprStr % self._name
12668
12669 def __getattr__(self, *args):
12670 if not hasattr(self, "_name"):
12671 self._name = "[unknown]"
12672 raise PyDeadObjectError(self.attrStr % self._name)
12673
12674 def __nonzero__(self):
12675 return 0
12676
12677
12678
12679class PyUnbornObjectError(AttributeError):
12680 pass
12681
12682class _wxPyUnbornObject(object):
12683 """
12684 Some stock objects are created when the wx._core module is
12685 imported, but their C++ instance is not created until the wx.App
12686 object is created and initialized. These object instances will
12687 temporarily have their __class__ changed to this class so an
12688 exception will be raised if they are used before the C++ instance
12689 is ready.
12690 """
12691
12692 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12693 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12694
12695 def __repr__(self):
12696 #if not hasattr(self, "_name"):
12697 # self._name = "[unknown]"
12698 return self.reprStr #% self._name
12699
12700 def __getattr__(self, *args):
12701 #if not hasattr(self, "_name"):
12702 # self._name = "[unknown]"
12703 raise PyUnbornObjectError(self.attrStr) # % self._name )
12704
12705 def __nonzero__(self):
12706 return 0
12707
12708
12709#----------------------------------------------------------------------------
d55e5bfc
RD
12710
12711def CallAfter(callable, *args, **kw):
12712 """
12713 Call the specified function after the current and pending event
12714 handlers have been completed. This is also good for making GUI
0439c23b
RD
12715 method calls from non-GUI threads. Any extra positional or
12716 keyword args are passed on to the callable when it is called.
12717
12718 :see: `wx.FutureCall`
d55e5bfc
RD
12719 """
12720 app = wx.GetApp()
a001823c 12721 assert app is not None, 'No wx.App created yet'
d55e5bfc 12722
891bb194
RD
12723 if not hasattr(app, "_CallAfterId"):
12724 app._CallAfterId = wx.NewEventType()
12725 app.Connect(-1, -1, app._CallAfterId,
12726 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 12727 evt = wx.PyEvent()
891bb194 12728 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
12729 evt.callable = callable
12730 evt.args = args
12731 evt.kw = kw
12732 wx.PostEvent(app, evt)
12733
d55e5bfc
RD
12734#----------------------------------------------------------------------------
12735
12736
12737class FutureCall:
12738 """
8ac8dba0 12739 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
12740 object once after the given amount of milliseconds, passing any
12741 positional or keyword args. The return value of the callable is
0439c23b 12742 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
12743
12744 If you don't need to get the return value or restart the timer
12745 then there is no need to hold a reference to this object. It will
12746 hold a reference to itself while the timer is running (the timer
12747 has a reference to self.Notify) but the cycle will be broken when
12748 the timer completes, automatically cleaning up the wx.FutureCall
12749 object.
0439c23b
RD
12750
12751 :see: `wx.CallAfter`
d55e5bfc
RD
12752 """
12753 def __init__(self, millis, callable, *args, **kwargs):
12754 self.millis = millis
12755 self.callable = callable
12756 self.SetArgs(*args, **kwargs)
12757 self.runCount = 0
12758 self.running = False
12759 self.hasRun = False
12760 self.result = None
12761 self.timer = None
12762 self.Start()
12763
12764 def __del__(self):
12765 self.Stop()
12766
12767
12768 def Start(self, millis=None, *args, **kwargs):
12769 """
12770 (Re)start the timer
12771 """
12772 self.hasRun = False
12773 if millis is not None:
12774 self.millis = millis
12775 if args or kwargs:
12776 self.SetArgs(*args, **kwargs)
12777 self.Stop()
12778 self.timer = wx.PyTimer(self.Notify)
12779 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12780 self.running = True
12781 Restart = Start
12782
12783
12784 def Stop(self):
12785 """
12786 Stop and destroy the timer.
12787 """
12788 if self.timer is not None:
12789 self.timer.Stop()
12790 self.timer = None
12791
12792
12793 def GetInterval(self):
12794 if self.timer is not None:
12795 return self.timer.GetInterval()
12796 else:
12797 return 0
12798
12799
12800 def IsRunning(self):
12801 return self.timer is not None and self.timer.IsRunning()
12802
12803
12804 def SetArgs(self, *args, **kwargs):
12805 """
12806 (Re)set the args passed to the callable object. This is
12807 useful in conjunction with Restart if you want to schedule a
12808 new call to the same callable object but with different
12809 parameters.
12810 """
12811 self.args = args
12812 self.kwargs = kwargs
12813
12814
12815 def HasRun(self):
12816 return self.hasRun
12817
12818 def GetResult(self):
12819 return self.result
12820
12821 def Notify(self):
12822 """
12823 The timer has expired so call the callable.
12824 """
12825 if self.callable and getattr(self.callable, 'im_self', True):
12826 self.runCount += 1
12827 self.running = False
12828 self.result = self.callable(*self.args, **self.kwargs)
12829 self.hasRun = True
12830 if not self.running:
12831 # if it wasn't restarted, then cleanup
12832 wx.CallAfter(self.Stop)
12833
12834
12835
12836#----------------------------------------------------------------------------
12837# Control which items in this module should be documented by epydoc.
12838# We allow only classes and functions, which will help reduce the size
12839# of the docs by filtering out the zillions of constants, EVT objects,
12840# and etc that don't make much sense by themselves, but are instead
12841# documented (or will be) as part of the classes/functions/methods
12842# where they should be used.
12843
c24da6d6
RD
12844class __DocFilter:
12845 """
12846 A filter for epydoc that only allows non-Ptr classes and
12847 fucntions, in order to reduce the clutter in the API docs.
12848 """
12849 def __init__(self, globals):
12850 self._globals = globals
12851
12852 def __call__(self, name):
12853 import types
12854 obj = self._globals.get(name, None)
12855 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12856 return False
554f62e9 12857 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
c24da6d6
RD
12858 return False
12859 return True
d55e5bfc
RD
12860
12861#----------------------------------------------------------------------------
12862#----------------------------------------------------------------------------
12863
12864# Import other modules in this package that should show up in the
12865# "core" wx namespace
12866from _gdi import *
12867from _windows import *
12868from _controls import *
12869from _misc import *
12870
d55e5bfc
RD
12871#----------------------------------------------------------------------------
12872#----------------------------------------------------------------------------
12873
12874
7449af73 12875